Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions apis/api-gateway/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,8 @@ type Mutation @join__type(graph: API_ANALYTICS) @join__type(graph: API_JOURNEYS
integrationGoogleCreate(input: IntegrationGoogleCreateInput!) : IntegrationGoogle! @join__field(graph: API_JOURNEYS_MODERN)
integrationGoogleUpdate(id: ID!, input: IntegrationGoogleUpdateInput!) : IntegrationGoogle! @join__field(graph: API_JOURNEYS_MODERN)
integrationDelete(id: ID!) : Integration! @join__field(graph: API_JOURNEYS_MODERN)
journeyAiChatUndo(turnId: String!) : Boolean! @join__field(graph: API_JOURNEYS_MODERN)
journeyAiChatExecutePlan(turnId: String!) : Boolean! @join__field(graph: API_JOURNEYS_MODERN)
journeyAiTranslateCreate(input: JourneyAiTranslateInput!) : Journey! @join__field(graph: API_JOURNEYS_MODERN)
createJourneyEventsExportLog(input: JourneyEventsExportLogInput!) : JourneyEventsExportLog! @join__field(graph: API_JOURNEYS_MODERN)
journeyLanguageAiDetect(input: MutationJourneyLanguageAiDetectInput!) : Boolean! @join__field(graph: API_JOURNEYS_MODERN)
Expand Down Expand Up @@ -2389,6 +2391,23 @@ type GoogleSheetsSync @join__type(graph: API_JOURNEYS_MODERN) {
journey: Journey!
}

type JourneyAiChatMessage @join__type(graph: API_JOURNEYS_MODERN) {
type: String
text: String
operations: String
operationId: String
status: String
turnId: String
journeyUpdated: Boolean
requiresConfirmation: Boolean
name: String
args: String
summary: String
cardId: String
error: String
validation: String
}

type JourneyAiTranslateProgress @join__type(graph: API_JOURNEYS_MODERN) {
"""
Translation progress as a percentage (0-100)
Expand Down Expand Up @@ -2525,6 +2544,7 @@ type PlausibleStatsResponse @join__type(graph: API_JOURNEYS_MODERN) {
}

type Subscription @join__type(graph: API_JOURNEYS_MODERN) {
journeyAiChatCreateSubscription(input: JourneyAiChatInput!) : JourneyAiChatMessage!
journeyAiTranslateCreateSubscription(input: JourneyAiTranslateInput!) : JourneyAiTranslateProgress!
}

Expand Down Expand Up @@ -3727,6 +3747,11 @@ enum GoogleSheetExportMode @join__type(graph: API_JOURNEYS_MODERN) {
existing @join__enumValue(graph: API_JOURNEYS_MODERN)
}

enum JourneyAiChatPreferredTier @join__type(graph: API_JOURNEYS_MODERN) {
free @join__enumValue(graph: API_JOURNEYS_MODERN)
premium @join__enumValue(graph: API_JOURNEYS_MODERN)
}

enum PlausibleEvent @join__type(graph: API_JOURNEYS_MODERN) {
footerThumbsUpButtonClick @join__enumValue(graph: API_JOURNEYS_MODERN)
footerThumbsDownButtonClick @join__enumValue(graph: API_JOURNEYS_MODERN)
Expand Down Expand Up @@ -4804,6 +4829,21 @@ input IntegrationGoogleUpdateInput @join__type(graph: API_JOURNEYS_MODERN) {
redirectUri: String!
}

input JourneyAiChatHistoryMessage @join__type(graph: API_JOURNEYS_MODERN) {
role: String!
content: String!
}

input JourneyAiChatInput @join__type(graph: API_JOURNEYS_MODERN) {
journeyId: ID!
message: String!
history: [JourneyAiChatHistoryMessage!]!
turnId: String
contextCardId: String
preferredTier: JourneyAiChatPreferredTier
languageName: String
}

input JourneyAiTranslateInput @join__type(graph: API_JOURNEYS_MODERN) {
journeyId: ID!
name: String!
Expand Down
40 changes: 40 additions & 0 deletions apis/api-journeys-modern/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -823,6 +823,43 @@ type Journey
journeyCollections: [JourneyCollection!]!
}

input JourneyAiChatHistoryMessage {
role: String!
content: String!
}

input JourneyAiChatInput {
journeyId: ID!
message: String!
history: [JourneyAiChatHistoryMessage!]!
turnId: String
contextCardId: String
preferredTier: JourneyAiChatPreferredTier
languageName: String
}

type JourneyAiChatMessage {
type: String
text: String
operations: String
operationId: String
status: String
turnId: String
journeyUpdated: Boolean
requiresConfirmation: Boolean
name: String
args: String
summary: String
cardId: String
error: String
validation: String
}

enum JourneyAiChatPreferredTier {
free
premium
}

input JourneyAiTranslateInput {
journeyId: ID!
name: String!
Expand Down Expand Up @@ -1401,6 +1438,8 @@ type Mutation {
integrationGoogleCreate(input: IntegrationGoogleCreateInput!): IntegrationGoogle!
integrationGoogleUpdate(id: ID!, input: IntegrationGoogleUpdateInput!): IntegrationGoogle!
integrationDelete(id: ID!): Integration!
journeyAiChatUndo(turnId: String!): Boolean!
journeyAiChatExecutePlan(turnId: String!): Boolean!
journeyAiTranslateCreate(input: JourneyAiTranslateInput!): Journey!
createJourneyEventsExportLog(input: JourneyEventsExportLogInput!): JourneyEventsExportLog!
journeyLanguageAiDetect(input: MutationJourneyLanguageAiDetectInput!): Boolean!
Expand Down Expand Up @@ -2081,6 +2120,7 @@ input StepViewEventCreateInput {
}

type Subscription {
journeyAiChatCreateSubscription(input: JourneyAiChatInput!): JourneyAiChatMessage!
journeyAiTranslateCreateSubscription(input: JourneyAiTranslateInput!): JourneyAiTranslateProgress!
}

Expand Down
4 changes: 3 additions & 1 deletion apis/api-journeys-modern/src/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export const env = createEnv({
throw new Error('Invalid environment variables')
},
server: {
ANTHROPIC_API_KEY: z.string().trim().min(1).optional(),
CLOUDFLARE_UPLOAD_KEY: z.string().trim().min(1),
FACEBOOK_APP_ID: z.string().trim().min(1),
FACEBOOK_APP_SECRET: z.string().trim().min(1),
Expand All @@ -29,6 +30,7 @@ export const env = createEnv({
}),
REDIS_PORT: z.coerce.number().int().positive().default(6379),
REDIS_URL: z.string().trim().min(1).default('redis'),
SERVICE_VERSION: z.string().trim().default('')
SERVICE_VERSION: z.string().trim().default(''),
UNSPLASH_ACCESS_KEY: z.string().trim().min(1).optional()
}
})
3 changes: 2 additions & 1 deletion apis/api-journeys-modern/src/schema/journey/journey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ export const JourneyRef = builder.prismaObject('Journey', {
resolve: (journey) => ({ id: journey.languageId ?? '529' })
}),
blocks: t.relation('blocks', {
nullable: true
nullable: true,
query: { where: { deletedAt: null } }
}),
chatButtons: t.relation('chatButtons', {
nullable: false
Expand Down
Loading
Loading