@seeka-labs/cli-apps 3.7.0 → 3.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +286 -0
- package/dist/ai-context/common/README.md +110 -0
- package/dist/ai-context/common/architecture/overview.md +140 -0
- package/dist/ai-context/common/guides/common-patterns.md +471 -0
- package/dist/ai-context/common/guides/data-flow.md +455 -0
- package/dist/ai-context/common/guides/getting-started.md +349 -0
- package/dist/ai-context/common/guides/testing.md +592 -0
- package/dist/ai-context/common/reference/cli-commands.md +231 -0
- package/dist/ai-context/common/reference/config-schema.md +345 -0
- package/dist/ai-context/common/reference/sdk-api.md +445 -0
- package/dist/ai-context/internal/architecture/v1-structure.md +192 -0
- package/dist/ai-context/internal/architecture/v2-structure.md +261 -0
- package/dist/ai-context/internal/architecture/v3-structure.md +386 -0
- package/dist/ai-context/internal/examples/_index.md +240 -0
- package/dist/ai-context/internal/examples/v1/_index.md +53 -0
- package/dist/ai-context/internal/examples/v1/activecampaign/.eslintrc.cjs +10 -0
- package/dist/ai-context/internal/examples/v1/activecampaign/README.md +88 -0
- package/dist/ai-context/internal/examples/v1/activecampaign/_ai-summary.md +43 -0
- package/dist/ai-context/internal/examples/v1/activecampaign/host.json +20 -0
- package/dist/ai-context/internal/examples/v1/activecampaign/package.json +43 -0
- package/dist/ai-context/internal/examples/v1/activecampaign/src/functions/healthCheck.ts +14 -0
- package/dist/ai-context/internal/examples/v1/activecampaign/src/functions/seekaAppWebhook.ts +284 -0
- package/dist/ai-context/internal/examples/v1/activecampaign/src/lib/active-campaign/api/index.ts +41 -0
- package/dist/ai-context/internal/examples/v1/activecampaign/src/lib/active-campaign/contacts/index.ts +56 -0
- package/dist/ai-context/internal/examples/v1/activecampaign/src/lib/active-campaign/custom-fields/index.ts +8 -0
- package/dist/ai-context/internal/examples/v1/activecampaign/src/lib/active-campaign/pipelines/deals/index.ts +96 -0
- package/dist/ai-context/internal/examples/v1/activecampaign/src/lib/active-campaign/pipelines/index.ts +206 -0
- package/dist/ai-context/internal/examples/v1/activecampaign/src/lib/logging/index.ts +77 -0
- package/dist/ai-context/internal/examples/v1/activecampaign/src/lib/services/index.ts +41 -0
- package/dist/ai-context/internal/examples/v1/activecampaign/src/lib/state/redis/index.ts +64 -0
- package/dist/ai-context/internal/examples/v1/activecampaign/src/lib/state/seeka/installations.ts +96 -0
- package/dist/ai-context/internal/examples/v1/activecampaign/tsconfig.json +22 -0
- package/dist/ai-context/internal/examples/v1/complianz/.eslintrc.cjs +19 -0
- package/dist/ai-context/internal/examples/v1/complianz/README.md +105 -0
- package/dist/ai-context/internal/examples/v1/complianz/_ai-summary.md +34 -0
- package/dist/ai-context/internal/examples/v1/complianz/host.json +20 -0
- package/dist/ai-context/internal/examples/v1/complianz/jest.config.js +5 -0
- package/dist/ai-context/internal/examples/v1/complianz/package.json +48 -0
- package/dist/ai-context/internal/examples/v1/complianz/src/browser/.eslintrc.cjs +1 -0
- package/dist/ai-context/internal/examples/v1/complianz/src/browser/.yarnrc +1 -0
- package/dist/ai-context/internal/examples/v1/complianz/src/browser/package.json +37 -0
- package/dist/ai-context/internal/examples/v1/complianz/src/functions/healthCheck.ts +14 -0
- package/dist/ai-context/internal/examples/v1/complianz/src/functions/seekaAppWebhook.ts +190 -0
- package/dist/ai-context/internal/examples/v1/complianz/src/index.test.ts +7 -0
- package/dist/ai-context/internal/examples/v1/complianz/src/lib/browser/index.ts +53 -0
- package/dist/ai-context/internal/examples/v1/complianz/src/lib/browser/models/index.ts +5 -0
- package/dist/ai-context/internal/examples/v1/complianz/src/lib/logging/index.ts +77 -0
- package/dist/ai-context/internal/examples/v1/complianz/src/lib/services/index.ts +41 -0
- package/dist/ai-context/internal/examples/v1/complianz/src/lib/state/redis/index.ts +65 -0
- package/dist/ai-context/internal/examples/v1/complianz/src/lib/state/seeka/installations.ts +62 -0
- package/dist/ai-context/internal/examples/v1/complianz/tsconfig.json +18 -0
- package/dist/ai-context/internal/examples/v1/ivvy/.eslintrc.cjs +10 -0
- package/dist/ai-context/internal/examples/v1/ivvy/README.md +70 -0
- package/dist/ai-context/internal/examples/v1/ivvy/_ai-summary.md +32 -0
- package/dist/ai-context/internal/examples/v1/ivvy/package.json +58 -0
- package/dist/ai-context/internal/examples/v1/ivvy/src/app/index.ts +31 -0
- package/dist/ai-context/internal/examples/v1/ivvy/src/index.ts +32 -0
- package/dist/ai-context/internal/examples/v1/ivvy/src/lib/ivvy/api/models/booking.ts +114 -0
- package/dist/ai-context/internal/examples/v1/ivvy/src/lib/ivvy/api/models/common.ts +49 -0
- package/dist/ai-context/internal/examples/v1/ivvy/src/lib/ivvy/api/models/invoice.ts +75 -0
- package/dist/ai-context/internal/examples/v1/ivvy/src/lib/ivvy/api/models/webhooks.ts +33 -0
- package/dist/ai-context/internal/examples/v1/ivvy/src/lib/ivvy/api/requests.ts +106 -0
- package/dist/ai-context/internal/examples/v1/ivvy/src/lib/ivvy/api/webhooks.ts +117 -0
- package/dist/ai-context/internal/examples/v1/ivvy/src/lib/ivvy/services/index.ts +127 -0
- package/dist/ai-context/internal/examples/v1/ivvy/src/lib/logging/index.ts +105 -0
- package/dist/ai-context/internal/examples/v1/ivvy/src/lib/polyfills/fetch.ts +21 -0
- package/dist/ai-context/internal/examples/v1/ivvy/src/lib/services/index.ts +40 -0
- package/dist/ai-context/internal/examples/v1/ivvy/src/lib/state/redis/index.ts +63 -0
- package/dist/ai-context/internal/examples/v1/ivvy/src/lib/state/seeka/installations.ts +61 -0
- package/dist/ai-context/internal/examples/v1/ivvy/src/routes/ivvyWebhook.ts +67 -0
- package/dist/ai-context/internal/examples/v1/ivvy/src/routes/seekaAppWebhook.ts +141 -0
- package/dist/ai-context/internal/examples/v1/ivvy/tsconfig.json +33 -0
- package/dist/ai-context/internal/examples/v1/me-and-u-connect/.eslintrc.cjs +11 -0
- package/dist/ai-context/internal/examples/v1/me-and-u-connect/README.md +66 -0
- package/dist/ai-context/internal/examples/v1/me-and-u-connect/_ai-summary.md +29 -0
- package/dist/ai-context/internal/examples/v1/me-and-u-connect/host.json +20 -0
- package/dist/ai-context/internal/examples/v1/me-and-u-connect/package.json +47 -0
- package/dist/ai-context/internal/examples/v1/me-and-u-connect/src/functions/healthCheck.ts +14 -0
- package/dist/ai-context/internal/examples/v1/me-and-u-connect/src/functions/meanduContactPolling.ts +38 -0
- package/dist/ai-context/internal/examples/v1/me-and-u-connect/src/functions/meanduContactSync.ts +69 -0
- package/dist/ai-context/internal/examples/v1/me-and-u-connect/src/functions/seekaAppWebhook.ts +162 -0
- package/dist/ai-context/internal/examples/v1/me-and-u-connect/src/lib/jobs/index.ts +96 -0
- package/dist/ai-context/internal/examples/v1/me-and-u-connect/src/lib/logging/index.ts +91 -0
- package/dist/ai-context/internal/examples/v1/me-and-u-connect/src/lib/meandu/api/index.ts +46 -0
- package/dist/ai-context/internal/examples/v1/me-and-u-connect/src/lib/meandu/auth/index.ts +32 -0
- package/dist/ai-context/internal/examples/v1/me-and-u-connect/src/lib/meandu/contacts/index.ts +149 -0
- package/dist/ai-context/internal/examples/v1/me-and-u-connect/src/lib/meandu/fields/index.ts +105 -0
- package/dist/ai-context/internal/examples/v1/me-and-u-connect/src/lib/meandu/jobs/contact-sync/index.ts +143 -0
- package/dist/ai-context/internal/examples/v1/me-and-u-connect/src/lib/services/index.ts +40 -0
- package/dist/ai-context/internal/examples/v1/me-and-u-connect/src/lib/state/redis/index.ts +64 -0
- package/dist/ai-context/internal/examples/v1/me-and-u-connect/src/lib/state/seeka/installations.ts +61 -0
- package/dist/ai-context/internal/examples/v1/me-and-u-connect/tsconfig.json +22 -0
- package/dist/ai-context/internal/examples/v1/me-and-u-manage/.eslintrc.cjs +11 -0
- package/dist/ai-context/internal/examples/v1/me-and-u-manage/.nvmrc +1 -0
- package/dist/ai-context/internal/examples/v1/me-and-u-manage/README.md +134 -0
- package/dist/ai-context/internal/examples/v1/me-and-u-manage/_ai-summary.md +47 -0
- package/dist/ai-context/internal/examples/v1/me-and-u-manage/host.json +20 -0
- package/dist/ai-context/internal/examples/v1/me-and-u-manage/package.json +46 -0
- package/dist/ai-context/internal/examples/v1/me-and-u-manage/src/functions/healthCheck.ts +14 -0
- package/dist/ai-context/internal/examples/v1/me-and-u-manage/src/functions/pollForNewMeAndUData.ts +47 -0
- package/dist/ai-context/internal/examples/v1/me-and-u-manage/src/functions/processNewMeAndUMarketingOptIns.ts +69 -0
- package/dist/ai-context/internal/examples/v1/me-and-u-manage/src/functions/processNewMeAndUOrders.ts +69 -0
- package/dist/ai-context/internal/examples/v1/me-and-u-manage/src/functions/seekaAppWebhook.ts +216 -0
- package/dist/ai-context/internal/examples/v1/me-and-u-manage/src/lib/jobs/index.ts +97 -0
- package/dist/ai-context/internal/examples/v1/me-and-u-manage/src/lib/logging/index.ts +93 -0
- package/dist/ai-context/internal/examples/v1/me-and-u-manage/src/lib/me-and-u/consent/index.ts +196 -0
- package/dist/ai-context/internal/examples/v1/me-and-u-manage/src/lib/me-and-u/index.ts +96 -0
- package/dist/ai-context/internal/examples/v1/me-and-u-manage/src/lib/me-and-u/menus/index.ts +125 -0
- package/dist/ai-context/internal/examples/v1/me-and-u-manage/src/lib/me-and-u/orders/index.ts +264 -0
- package/dist/ai-context/internal/examples/v1/me-and-u-manage/src/lib/services/index.ts +41 -0
- package/dist/ai-context/internal/examples/v1/me-and-u-manage/src/lib/state/redis/index.ts +65 -0
- package/dist/ai-context/internal/examples/v1/me-and-u-manage/src/lib/state/seeka/installations.ts +78 -0
- package/dist/ai-context/internal/examples/v1/me-and-u-manage/tsconfig.json +22 -0
- package/dist/ai-context/internal/examples/v1/nowbookit/.eslintrc.cjs +10 -0
- package/dist/ai-context/internal/examples/v1/nowbookit/README.md +82 -0
- package/dist/ai-context/internal/examples/v1/nowbookit/_ai-summary.md +41 -0
- package/dist/ai-context/internal/examples/v1/nowbookit/host.json +20 -0
- package/dist/ai-context/internal/examples/v1/nowbookit/package.json +44 -0
- package/dist/ai-context/internal/examples/v1/nowbookit/src/functions/pollingExample.ts +37 -0
- package/dist/ai-context/internal/examples/v1/nowbookit/src/functions/queueExample.ts +31 -0
- package/dist/ai-context/internal/examples/v1/nowbookit/src/functions/seekaAppWebhook.ts +193 -0
- package/dist/ai-context/internal/examples/v1/nowbookit/src/lib/jobs/index.ts +51 -0
- package/dist/ai-context/internal/examples/v1/nowbookit/src/lib/logging/index.ts +90 -0
- package/dist/ai-context/internal/examples/v1/nowbookit/src/lib/services/index.ts +40 -0
- package/dist/ai-context/internal/examples/v1/nowbookit/src/lib/state/redis/index.ts +64 -0
- package/dist/ai-context/internal/examples/v1/nowbookit/src/lib/state/seeka/installations.ts +61 -0
- package/dist/ai-context/internal/examples/v1/nowbookit/tsconfig.json +22 -0
- package/dist/ai-context/internal/examples/v1/sevenrooms/.eslintrc.cjs +11 -0
- package/dist/ai-context/internal/examples/v1/sevenrooms/.nvmrc +1 -0
- package/dist/ai-context/internal/examples/v1/sevenrooms/.yarnrc.yml +1 -0
- package/dist/ai-context/internal/examples/v1/sevenrooms/README.md +131 -0
- package/dist/ai-context/internal/examples/v1/sevenrooms/_ai-summary.md +41 -0
- package/dist/ai-context/internal/examples/v1/sevenrooms/host.json +20 -0
- package/dist/ai-context/internal/examples/v1/sevenrooms/package.json +47 -0
- package/dist/ai-context/internal/examples/v1/sevenrooms/src/browser/.eslintrc.cjs +1 -0
- package/dist/ai-context/internal/examples/v1/sevenrooms/src/browser/.yarnrc +1 -0
- package/dist/ai-context/internal/examples/v1/sevenrooms/src/browser/package.json +31 -0
- package/dist/ai-context/internal/examples/v1/sevenrooms/src/functions/handleSevenRoomsWebhookQueueItem.ts +71 -0
- package/dist/ai-context/internal/examples/v1/sevenrooms/src/functions/healthCheck.ts +14 -0
- package/dist/ai-context/internal/examples/v1/sevenrooms/src/functions/seekaAppWebhook.ts +255 -0
- package/dist/ai-context/internal/examples/v1/sevenrooms/src/functions/sevenRoomsWebhook.ts +202 -0
- package/dist/ai-context/internal/examples/v1/sevenrooms/src/lib/browser/index.ts +68 -0
- package/dist/ai-context/internal/examples/v1/sevenrooms/src/lib/jobs/index.ts +69 -0
- package/dist/ai-context/internal/examples/v1/sevenrooms/src/lib/logging/index.ts +106 -0
- package/dist/ai-context/internal/examples/v1/sevenrooms/src/lib/models/index.ts +17 -0
- package/dist/ai-context/internal/examples/v1/sevenrooms/src/lib/services/index.ts +41 -0
- package/dist/ai-context/internal/examples/v1/sevenrooms/src/lib/sevenrooms/auth/index.ts +70 -0
- package/dist/ai-context/internal/examples/v1/sevenrooms/src/lib/sevenrooms/charges/index.ts +202 -0
- package/dist/ai-context/internal/examples/v1/sevenrooms/src/lib/sevenrooms/clients/index.ts +505 -0
- package/dist/ai-context/internal/examples/v1/sevenrooms/src/lib/sevenrooms/helpers.ts +38 -0
- package/dist/ai-context/internal/examples/v1/sevenrooms/src/lib/sevenrooms/models.ts +193 -0
- package/dist/ai-context/internal/examples/v1/sevenrooms/src/lib/sevenrooms/reservations/index.ts +365 -0
- package/dist/ai-context/internal/examples/v1/sevenrooms/src/lib/sevenrooms/venues/index.ts +54 -0
- package/dist/ai-context/internal/examples/v1/sevenrooms/src/lib/state/redis/index.ts +102 -0
- package/dist/ai-context/internal/examples/v1/sevenrooms/src/lib/state/seeka/installations.ts +140 -0
- package/dist/ai-context/internal/examples/v1/sevenrooms/src/lib/state/seeka/models.ts +34 -0
- package/dist/ai-context/internal/examples/v1/sevenrooms/tsconfig.json +18 -0
- package/dist/ai-context/internal/examples/v1/tradable-bits/.eslintrc.cjs +10 -0
- package/dist/ai-context/internal/examples/v1/tradable-bits/README.md +104 -0
- package/dist/ai-context/internal/examples/v1/tradable-bits/_ai-summary.md +45 -0
- package/dist/ai-context/internal/examples/v1/tradable-bits/host.json +20 -0
- package/dist/ai-context/internal/examples/v1/tradable-bits/package.json +43 -0
- package/dist/ai-context/internal/examples/v1/tradable-bits/src/browser/.eslintrc.cjs +1 -0
- package/dist/ai-context/internal/examples/v1/tradable-bits/src/browser/.yarnrc +1 -0
- package/dist/ai-context/internal/examples/v1/tradable-bits/src/browser/package.json +37 -0
- package/dist/ai-context/internal/examples/v1/tradable-bits/src/functions/healthCheck.ts +14 -0
- package/dist/ai-context/internal/examples/v1/tradable-bits/src/functions/seekaAppWebhook.ts +157 -0
- package/dist/ai-context/internal/examples/v1/tradable-bits/src/lib/browser/index.ts +54 -0
- package/dist/ai-context/internal/examples/v1/tradable-bits/src/lib/logging/index.ts +77 -0
- package/dist/ai-context/internal/examples/v1/tradable-bits/src/lib/models/index.ts +6 -0
- package/dist/ai-context/internal/examples/v1/tradable-bits/src/lib/services/index.ts +41 -0
- package/dist/ai-context/internal/examples/v1/tradable-bits/src/lib/state/redis/index.ts +64 -0
- package/dist/ai-context/internal/examples/v1/tradable-bits/src/lib/state/seeka/installations.ts +64 -0
- package/dist/ai-context/internal/examples/v1/tradable-bits/tsconfig.json +18 -0
- package/dist/ai-context/internal/examples/v1/transcend/.eslintrc.cjs +19 -0
- package/dist/ai-context/internal/examples/v1/transcend/README.md +112 -0
- package/dist/ai-context/internal/examples/v1/transcend/_ai-summary.md +36 -0
- package/dist/ai-context/internal/examples/v1/transcend/host.json +29 -0
- package/dist/ai-context/internal/examples/v1/transcend/jest.config.js +5 -0
- package/dist/ai-context/internal/examples/v1/transcend/package.json +46 -0
- package/dist/ai-context/internal/examples/v1/transcend/src/browser/.eslintrc.cjs +1 -0
- package/dist/ai-context/internal/examples/v1/transcend/src/browser/.yarnrc +1 -0
- package/dist/ai-context/internal/examples/v1/transcend/src/browser/package.json +37 -0
- package/dist/ai-context/internal/examples/v1/transcend/src/functions/healthCheck.ts +14 -0
- package/dist/ai-context/internal/examples/v1/transcend/src/functions/seekaAppWebhook.ts +214 -0
- package/dist/ai-context/internal/examples/v1/transcend/src/index.test.ts +7 -0
- package/dist/ai-context/internal/examples/v1/transcend/src/lib/browser/index.ts +53 -0
- package/dist/ai-context/internal/examples/v1/transcend/src/lib/browser/models/index.ts +29 -0
- package/dist/ai-context/internal/examples/v1/transcend/src/lib/logging/index.ts +77 -0
- package/dist/ai-context/internal/examples/v1/transcend/src/lib/services/index.ts +41 -0
- package/dist/ai-context/internal/examples/v1/transcend/src/lib/state/redis/index.ts +65 -0
- package/dist/ai-context/internal/examples/v1/transcend/src/lib/state/seeka/installations.ts +64 -0
- package/dist/ai-context/internal/examples/v1/transcend/tsconfig.json +18 -0
- package/dist/ai-context/internal/examples/v2/_index.md +66 -0
- package/dist/ai-context/internal/examples/v2/calendly/.yarnrc.yml +11 -0
- package/dist/ai-context/internal/examples/v2/calendly/README.md +15 -0
- package/dist/ai-context/internal/examples/v2/calendly/_ai-summary.md +35 -0
- package/dist/ai-context/internal/examples/v2/calendly/app/browser/README.md +1 -0
- package/dist/ai-context/internal/examples/v2/calendly/app/browser/package.json +33 -0
- package/dist/ai-context/internal/examples/v2/calendly/app/browser/src/browser.ts +12 -0
- package/dist/ai-context/internal/examples/v2/calendly/app/browser/src/plugin/index.ts +164 -0
- package/dist/ai-context/internal/examples/v2/calendly/app/browser/tsconfig.json +34 -0
- package/dist/ai-context/internal/examples/v2/calendly/app/lib/package.json +25 -0
- package/dist/ai-context/internal/examples/v2/calendly/app/lib/src/index.ts +3 -0
- package/dist/ai-context/internal/examples/v2/calendly/app/lib/src/models/index.ts +30 -0
- package/dist/ai-context/internal/examples/v2/calendly/app/lib/tsconfig.json +22 -0
- package/dist/ai-context/internal/examples/v2/calendly/app/server/.eslintrc.cjs +11 -0
- package/dist/ai-context/internal/examples/v2/calendly/app/server/.nvmrc +1 -0
- package/dist/ai-context/internal/examples/v2/calendly/app/server/README.md +105 -0
- package/dist/ai-context/internal/examples/v2/calendly/app/server/host.json +25 -0
- package/dist/ai-context/internal/examples/v2/calendly/app/server/package.json +48 -0
- package/dist/ai-context/internal/examples/v2/calendly/app/server/src/functions/calendlyAuth.ts +83 -0
- package/dist/ai-context/internal/examples/v2/calendly/app/server/src/functions/calendlyWebhook.ts +97 -0
- package/dist/ai-context/internal/examples/v2/calendly/app/server/src/functions/enrichSeekaProfile.ts +117 -0
- package/dist/ai-context/internal/examples/v2/calendly/app/server/src/functions/healthCheck.ts +14 -0
- package/dist/ai-context/internal/examples/v2/calendly/app/server/src/functions/seekaAppWebhook.ts +158 -0
- package/dist/ai-context/internal/examples/v2/calendly/app/server/src/functions/ui.ts +178 -0
- package/dist/ai-context/internal/examples/v2/calendly/app/server/src/lib/api/auth.ts +91 -0
- package/dist/ai-context/internal/examples/v2/calendly/app/server/src/lib/api/routes/deleteCalendlyAuth.ts +15 -0
- package/dist/ai-context/internal/examples/v2/calendly/app/server/src/lib/api/routes/getCalendlyAuth.ts +12 -0
- package/dist/ai-context/internal/examples/v2/calendly/app/server/src/lib/api/routes/setTrackingSettings.ts +26 -0
- package/dist/ai-context/internal/examples/v2/calendly/app/server/src/lib/browser/index.ts +53 -0
- package/dist/ai-context/internal/examples/v2/calendly/app/server/src/lib/calendly/attendee.ts +198 -0
- package/dist/ai-context/internal/examples/v2/calendly/app/server/src/lib/calendly/auth.ts +103 -0
- package/dist/ai-context/internal/examples/v2/calendly/app/server/src/lib/calendly/webhooks.ts +189 -0
- package/dist/ai-context/internal/examples/v2/calendly/app/server/src/lib/logging/index.ts +81 -0
- package/dist/ai-context/internal/examples/v2/calendly/app/server/src/lib/services/index.ts +41 -0
- package/dist/ai-context/internal/examples/v2/calendly/app/server/src/lib/state/redis/index.ts +102 -0
- package/dist/ai-context/internal/examples/v2/calendly/app/server/src/lib/state/seeka/installations.ts +100 -0
- package/dist/ai-context/internal/examples/v2/calendly/app/server/tsconfig.json +21 -0
- package/dist/ai-context/internal/examples/v2/calendly/app/ui/README.md +40 -0
- package/dist/ai-context/internal/examples/v2/calendly/app/ui/index.html +22 -0
- package/dist/ai-context/internal/examples/v2/calendly/app/ui/package.json +74 -0
- package/dist/ai-context/internal/examples/v2/calendly/app/ui/public/favicon.ico +0 -0
- package/dist/ai-context/internal/examples/v2/calendly/app/ui/public/index.html +21 -0
- package/dist/ai-context/internal/examples/v2/calendly/app/ui/public/manifest.json +15 -0
- package/dist/ai-context/internal/examples/v2/calendly/app/ui/src/App.tsx +74 -0
- package/dist/ai-context/internal/examples/v2/calendly/app/ui/src/assets/calendly-icon.svg +25 -0
- package/dist/ai-context/internal/examples/v2/calendly/app/ui/src/components/calendly/login/index.tsx +129 -0
- package/dist/ai-context/internal/examples/v2/calendly/app/ui/src/components/setup/steps/auth/index.tsx +46 -0
- package/dist/ai-context/internal/examples/v2/calendly/app/ui/src/components/setup/steps/index.tsx +36 -0
- package/dist/ai-context/internal/examples/v2/calendly/app/ui/src/components/setup/steps/success/index.tsx +18 -0
- package/dist/ai-context/internal/examples/v2/calendly/app/ui/src/components/setup/steps/tracking/index.tsx +128 -0
- package/dist/ai-context/internal/examples/v2/calendly/app/ui/src/index.tsx +45 -0
- package/dist/ai-context/internal/examples/v2/calendly/app/ui/src/react-app-env.d.ts +1 -0
- package/dist/ai-context/internal/examples/v2/calendly/app/ui/src/routes/home/index.tsx +11 -0
- package/dist/ai-context/internal/examples/v2/calendly/app/ui/src/seeka-labs-app-sdk-ui/api/redux/index.tsx +16 -0
- package/dist/ai-context/internal/examples/v2/calendly/app/ui/src/seeka-labs-app-sdk-ui/shared/auth/tokenProvider/index.tsx +54 -0
- package/dist/ai-context/internal/examples/v2/calendly/app/ui/src/seeka-labs-app-sdk-ui/shared/auth/useTokens/index.ts +8 -0
- package/dist/ai-context/internal/examples/v2/calendly/app/ui/src/seeka-labs-app-sdk-ui/shared/form/fields/activities/index.tsx +188 -0
- package/dist/ai-context/internal/examples/v2/calendly/app/ui/src/seeka-labs-app-sdk-ui/shared/form/fields/activityNameSelect/index.tsx +156 -0
- package/dist/ai-context/internal/examples/v2/calendly/app/ui/src/seeka-labs-app-sdk-ui/shared/form/fields/activitySourceActivityNameFilterSelect/index.tsx +247 -0
- package/dist/ai-context/internal/examples/v2/calendly/app/ui/src/seeka-labs-app-sdk-ui/shared/form/fields/activitySourceFilterSelect/index.tsx +132 -0
- package/dist/ai-context/internal/examples/v2/calendly/app/ui/src/seeka-labs-app-sdk-ui/shared/form/fields/activitySourceSelect/index.tsx +74 -0
- package/dist/ai-context/internal/examples/v2/calendly/app/ui/src/seeka-labs-app-sdk-ui/shared/form/fields/event-pipeline/filter-row/index.tsx +263 -0
- package/dist/ai-context/internal/examples/v2/calendly/app/ui/src/seeka-labs-app-sdk-ui/shared/form/provider/index.tsx +16 -0
- package/dist/ai-context/internal/examples/v2/calendly/app/ui/src/seeka-labs-app-sdk-ui/shared/loading-spinner/index.tsx +9 -0
- package/dist/ai-context/internal/examples/v2/calendly/app/ui/src/seeka-labs-app-sdk-ui/utils/index.ts +11 -0
- package/dist/ai-context/internal/examples/v2/calendly/app/ui/src/seeka-labs-app-sdk-ui/wizard/heading/index.tsx +33 -0
- package/dist/ai-context/internal/examples/v2/calendly/app/ui/src/seeka-labs-app-sdk-ui/wizard/step/actions/index.tsx +12 -0
- package/dist/ai-context/internal/examples/v2/calendly/app/ui/src/seeka-labs-app-sdk-ui/wizard/step/content/index.tsx +24 -0
- package/dist/ai-context/internal/examples/v2/calendly/app/ui/src/seeka-labs-app-sdk-ui/wizard/step/index.tsx +16 -0
- package/dist/ai-context/internal/examples/v2/calendly/app/ui/src/vite-env.d.ts +12 -0
- package/dist/ai-context/internal/examples/v2/calendly/app/ui/tsconfig.json +35 -0
- package/dist/ai-context/internal/examples/v2/calendly/app/ui/tsconfig.node.json +10 -0
- package/dist/ai-context/internal/examples/v2/calendly/app/ui/vite.config.mts +44 -0
- package/dist/ai-context/internal/examples/v2/calendly/package.json +29 -0
- package/dist/ai-context/internal/examples/v2/calendly/tsconfig.json +27 -0
- package/dist/ai-context/internal/examples/v2/clarity/.yarnrc.yml +8 -0
- package/dist/ai-context/internal/examples/v2/clarity/README.md +7 -0
- package/dist/ai-context/internal/examples/v2/clarity/_ai-summary.md +32 -0
- package/dist/ai-context/internal/examples/v2/clarity/app/browser/README.md +1 -0
- package/dist/ai-context/internal/examples/v2/clarity/app/browser/jest.config.js +11 -0
- package/dist/ai-context/internal/examples/v2/clarity/app/browser/package.json +39 -0
- package/dist/ai-context/internal/examples/v2/clarity/app/browser/src/browser.ts +12 -0
- package/dist/ai-context/internal/examples/v2/clarity/app/browser/src/plugin/index.test.ts +6 -0
- package/dist/ai-context/internal/examples/v2/clarity/app/browser/src/plugin/index.ts +119 -0
- package/dist/ai-context/internal/examples/v2/clarity/app/browser/tsconfig.json +35 -0
- package/dist/ai-context/internal/examples/v2/clarity/app/server/.eslintrc.cjs +11 -0
- package/dist/ai-context/internal/examples/v2/clarity/app/server/README.md +105 -0
- package/dist/ai-context/internal/examples/v2/clarity/app/server/host.json +20 -0
- package/dist/ai-context/internal/examples/v2/clarity/app/server/package.json +48 -0
- package/dist/ai-context/internal/examples/v2/clarity/app/server/src/functions/healthCheck.ts +14 -0
- package/dist/ai-context/internal/examples/v2/clarity/app/server/src/functions/seekaAppWebhook.ts +163 -0
- package/dist/ai-context/internal/examples/v2/clarity/app/server/src/lib/browser/index.ts +54 -0
- package/dist/ai-context/internal/examples/v2/clarity/app/server/src/lib/logging/index.ts +77 -0
- package/dist/ai-context/internal/examples/v2/clarity/app/server/src/lib/models/index.ts +6 -0
- package/dist/ai-context/internal/examples/v2/clarity/app/server/src/lib/services/index.ts +41 -0
- package/dist/ai-context/internal/examples/v2/clarity/app/server/src/lib/state/redis/index.ts +96 -0
- package/dist/ai-context/internal/examples/v2/clarity/app/server/src/lib/state/seeka/installations.ts +64 -0
- package/dist/ai-context/internal/examples/v2/clarity/app/server/tsconfig.json +18 -0
- package/dist/ai-context/internal/examples/v2/clarity/package.json +19 -0
- package/dist/ai-context/internal/examples/v2/clarity/tsconfig.json +25 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/.yarnrc.yml +3 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/_ai-summary.md +24 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/jsonschema-bigquery-custom/CHANGELOG.md +139 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/jsonschema-bigquery-custom/LICENSE +21 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/jsonschema-bigquery-custom/README.md +70 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/jsonschema-bigquery-custom/bin/jsbq +101 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/jsonschema-bigquery-custom/package.json +66 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/jsonschema-bigquery-custom/src/converter.js +282 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/jsonschema-bigquery-custom/src/errors.js +21 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/jsonschema-bigquery-custom/src/gbq.js +31 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/jsonschema-bigquery-custom/src/log.js +37 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/jsonschema-bigquery-custom/src/utils.js +17 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/jsonschema-bigquery-custom/tablediff/README.md +6 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/jsonschema-bigquery-custom/tablediff/create_tables.sh +13 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/jsonschema-bigquery-custom/tablediff/tablediff.sh +13 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/jsonschema-bigquery-custom/test/integration/continueOnError/additionalProperties/expected.json +23 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/jsonschema-bigquery-custom/test/integration/continueOnError/additionalProperties/input.json +21 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/jsonschema-bigquery-custom/test/integration/continueOnErrorAndPreventAdditionalObjectProperties/additionalProperties/expected.json +5 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/jsonschema-bigquery-custom/test/integration/continueOnErrorAndPreventAdditionalObjectProperties/additionalProperties/input.json +21 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/jsonschema-bigquery-custom/test/integration/converter.js +112 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/jsonschema-bigquery-custom/test/integration/preventAdditionalObjectProperties/additionalPropertiesFalse/expected.json +16 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/jsonschema-bigquery-custom/test/integration/preventAdditionalObjectProperties/additionalPropertiesFalse/input.json +14 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/jsonschema-bigquery-custom/test/integration/preventAdditionalObjectProperties/unevaluatedPropertiesFalse/expected.json +16 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/jsonschema-bigquery-custom/test/integration/preventAdditionalObjectProperties/unevaluatedPropertiesFalse/input.json +14 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/jsonschema-bigquery-custom/test/integration/samples/allOf/expected.json +23 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/jsonschema-bigquery-custom/test/integration/samples/allOf/input.json +30 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/jsonschema-bigquery-custom/test/integration/samples/allOf_nested/expected.json +35 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/jsonschema-bigquery-custom/test/integration/samples/allOf_nested/input.json +47 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/jsonschema-bigquery-custom/test/integration/samples/anyOfMultipleTypes/expected.json +11 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/jsonschema-bigquery-custom/test/integration/samples/anyOfMultipleTypes/input.json +19 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/jsonschema-bigquery-custom/test/integration/samples/complex/expected.json +23 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/jsonschema-bigquery-custom/test/integration/samples/complex/input.json +20 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/jsonschema-bigquery-custom/test/integration/samples/date/expected.json +11 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/jsonschema-bigquery-custom/test/integration/samples/date/input.json +12 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/jsonschema-bigquery-custom/test/integration/samples/fieldDescription/expected.json +12 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/jsonschema-bigquery-custom/test/integration/samples/fieldDescription/input.json +12 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/jsonschema-bigquery-custom/test/integration/samples/json/expected.json +12 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/jsonschema-bigquery-custom/test/integration/samples/json/input.json +12 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/jsonschema-bigquery-custom/test/integration/samples/nestedDescription/expected.json +12 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/jsonschema-bigquery-custom/test/integration/samples/nestedDescription/input.json +23 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/jsonschema-bigquery-custom/test/integration/samples/nestedOneOf/expected.json +11 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/jsonschema-bigquery-custom/test/integration/samples/nestedOneOf/input.json +26 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/jsonschema-bigquery-custom/test/integration/samples/nestedRepeated/expected.json +18 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/jsonschema-bigquery-custom/test/integration/samples/nestedRepeated/input.json +20 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/jsonschema-bigquery-custom/test/integration/samples/nullable/expected.json +16 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/jsonschema-bigquery-custom/test/integration/samples/nullable/input.json +15 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/jsonschema-bigquery-custom/test/integration/samples/numeric/expected.json +11 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/jsonschema-bigquery-custom/test/integration/samples/numeric/input.json +11 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/jsonschema-bigquery-custom/test/integration/samples/objectDescription/expected.json +19 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/jsonschema-bigquery-custom/test/integration/samples/objectDescription/input.json +18 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/jsonschema-bigquery-custom/test/integration/samples/oneOfWithDateFormat/expected.json +28 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/jsonschema-bigquery-custom/test/integration/samples/oneOfWithDateFormat/input.json +35 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/jsonschema-bigquery-custom/test/integration/samples/oneOfWithDuplicateDescriptions/expected.json +29 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/jsonschema-bigquery-custom/test/integration/samples/oneOfWithDuplicateDescriptions/input.json +35 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/jsonschema-bigquery-custom/test/integration/samples/oneOfWithNull/expected.json +11 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/jsonschema-bigquery-custom/test/integration/samples/oneOfWithNull/input.json +17 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/jsonschema-bigquery-custom/test/integration/samples/oneof/expected.json +31 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/jsonschema-bigquery-custom/test/integration/samples/oneof/input.json +65 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/jsonschema-bigquery-custom/test/integration/samples/repeated/expected.json +11 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/jsonschema-bigquery-custom/test/integration/samples/repeated/input.json +14 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/jsonschema-bigquery-custom/test/integration/samples/simple/expected.json +16 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/jsonschema-bigquery-custom/test/integration/samples/simple/input.json +14 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/jsonschema-bigquery-custom/test/integration/samples/time/expected.json +11 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/jsonschema-bigquery-custom/test/integration/samples/time/input.json +12 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/jsonschema-bigquery-custom/test/integration/samples/timestamp/expected.json +11 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/jsonschema-bigquery-custom/test/integration/samples/timestamp/input.json +12 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/jsonschema-bigquery-custom/test/integration/samples/typeArray/expected.json +16 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/jsonschema-bigquery-custom/test/integration/samples/typeArray/input.json +15 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/jsonschema-bigquery-custom/test/unit/converter.js +216 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/jsonschema-bigquery-custom/test/unit/utils.js +20 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/server/.eslintrc.cjs +19 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/server/.nvmrc +1 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/server/README.md +225 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/server/host.json +30 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/server/jest.config.js +5 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/server/package.json +58 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/server/src/functions/healthCheck.ts +14 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/server/src/functions/pushRowsToBigQueryTable.ts +149 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/server/src/functions/seekaAppWebhook.ts +219 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/server/src/lib/google-big-query/index.ts +162 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/server/src/lib/google-big-query/migrations/activities/001_addtimestamp.sql +14 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/server/src/lib/google-big-query/migrations/activities/002_addrowversion.sql +14 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/server/src/lib/google-big-query/migrations/index.ts +280 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/server/src/lib/google-big-query/migrations/state.ts +98 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/server/src/lib/google-big-query/models/index.ts +15 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/server/src/lib/google-big-query/schema/activities/index.ts +86 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/server/src/lib/google-big-query/schema/index.test.ts +208 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/server/src/lib/google-big-query/schema/index.ts +95 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/server/src/lib/google-big-query/utils.ts +5 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/server/src/lib/jobs/index.ts +92 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/server/src/lib/logging/index.ts +108 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/server/src/lib/model.ts +6 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/server/src/lib/services/index.ts +41 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/server/src/lib/state/redis/index.ts +86 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/server/src/lib/state/seeka/installations.ts +70 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/app/server/tsconfig.json +18 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/package.json +28 -0
- package/dist/ai-context/internal/examples/v2/google-bigquery/tsconfig.json +24 -0
- package/dist/ai-context/internal/examples/v2/klaviyo-events/.yarnrc.yml +3 -0
- package/dist/ai-context/internal/examples/v2/klaviyo-events/README.md +1 -0
- package/dist/ai-context/internal/examples/v2/klaviyo-events/_ai-summary.md +26 -0
- package/dist/ai-context/internal/examples/v2/klaviyo-events/app/server/.eslintrc.cjs +11 -0
- package/dist/ai-context/internal/examples/v2/klaviyo-events/app/server/.nvmrc +1 -0
- package/dist/ai-context/internal/examples/v2/klaviyo-events/app/server/README.md +191 -0
- package/dist/ai-context/internal/examples/v2/klaviyo-events/app/server/host.json +25 -0
- package/dist/ai-context/internal/examples/v2/klaviyo-events/app/server/package.json +48 -0
- package/dist/ai-context/internal/examples/v2/klaviyo-events/app/server/src/functions/handleSeekaActivityQueueHandler.ts +45 -0
- package/dist/ai-context/internal/examples/v2/klaviyo-events/app/server/src/functions/healthCheck.ts +14 -0
- package/dist/ai-context/internal/examples/v2/klaviyo-events/app/server/src/functions/seekaAppWebhook.ts +199 -0
- package/dist/ai-context/internal/examples/v2/klaviyo-events/app/server/src/lib/jobs/index.ts +72 -0
- package/dist/ai-context/internal/examples/v2/klaviyo-events/app/server/src/lib/klaviyo/index.ts +15 -0
- package/dist/ai-context/internal/examples/v2/klaviyo-events/app/server/src/lib/klaviyo/utils/index.ts +152 -0
- package/dist/ai-context/internal/examples/v2/klaviyo-events/app/server/src/lib/logging/index.ts +106 -0
- package/dist/ai-context/internal/examples/v2/klaviyo-events/app/server/src/lib/services/index.ts +41 -0
- package/dist/ai-context/internal/examples/v2/klaviyo-events/app/server/src/lib/state/redis/index.ts +102 -0
- package/dist/ai-context/internal/examples/v2/klaviyo-events/app/server/src/lib/state/seeka/installations.ts +64 -0
- package/dist/ai-context/internal/examples/v2/klaviyo-events/app/server/tsconfig.json +21 -0
- package/dist/ai-context/internal/examples/v2/klaviyo-events/package.json +25 -0
- package/dist/ai-context/internal/examples/v2/klaviyo-events/tsconfig.json +24 -0
- package/dist/ai-context/internal/examples/v2/navitas/.yarnrc.yml +8 -0
- package/dist/ai-context/internal/examples/v2/navitas/README.md +31 -0
- package/dist/ai-context/internal/examples/v2/navitas/_ai-summary.md +39 -0
- package/dist/ai-context/internal/examples/v2/navitas/app/browser/README.md +1 -0
- package/dist/ai-context/internal/examples/v2/navitas/app/browser/package.json +33 -0
- package/dist/ai-context/internal/examples/v2/navitas/app/browser/src/browser.ts +12 -0
- package/dist/ai-context/internal/examples/v2/navitas/app/browser/src/plugin/index.ts +172 -0
- package/dist/ai-context/internal/examples/v2/navitas/app/browser/tsconfig.json +34 -0
- package/dist/ai-context/internal/examples/v2/navitas/app/server/.eslintrc.cjs +11 -0
- package/dist/ai-context/internal/examples/v2/navitas/app/server/.nvmrc +1 -0
- package/dist/ai-context/internal/examples/v2/navitas/app/server/README.md +104 -0
- package/dist/ai-context/internal/examples/v2/navitas/app/server/host.json +25 -0
- package/dist/ai-context/internal/examples/v2/navitas/app/server/package.json +50 -0
- package/dist/ai-context/internal/examples/v2/navitas/app/server/src/functions/healthCheck.ts +14 -0
- package/dist/ai-context/internal/examples/v2/navitas/app/server/src/functions/salesforceWebhook.ts +156 -0
- package/dist/ai-context/internal/examples/v2/navitas/app/server/src/functions/salesforceWebhookQueueHandler.ts +43 -0
- package/dist/ai-context/internal/examples/v2/navitas/app/server/src/functions/seekaAppWebhook.ts +158 -0
- package/dist/ai-context/internal/examples/v2/navitas/app/server/src/functions/stateChangeQueueHandler.ts +42 -0
- package/dist/ai-context/internal/examples/v2/navitas/app/server/src/lib/browser/index.ts +51 -0
- package/dist/ai-context/internal/examples/v2/navitas/app/server/src/lib/jobs/index.ts +73 -0
- package/dist/ai-context/internal/examples/v2/navitas/app/server/src/lib/logging/index.ts +108 -0
- package/dist/ai-context/internal/examples/v2/navitas/app/server/src/lib/models/index.ts +4 -0
- package/dist/ai-context/internal/examples/v2/navitas/app/server/src/lib/salesforce/enrolment/forms/index.ts +180 -0
- package/dist/ai-context/internal/examples/v2/navitas/app/server/src/lib/salesforce/index.ts +47 -0
- package/dist/ai-context/internal/examples/v2/navitas/app/server/src/lib/salesforce/journeys/index.ts +192 -0
- package/dist/ai-context/internal/examples/v2/navitas/app/server/src/lib/salesforce/leads/index.ts +177 -0
- package/dist/ai-context/internal/examples/v2/navitas/app/server/src/lib/salesforce/models/index.ts +179 -0
- package/dist/ai-context/internal/examples/v2/navitas/app/server/src/lib/salesforce/opportunities/index.ts +193 -0
- package/dist/ai-context/internal/examples/v2/navitas/app/server/src/lib/services/index.ts +41 -0
- package/dist/ai-context/internal/examples/v2/navitas/app/server/src/lib/state/navitas/journey.ts +165 -0
- package/dist/ai-context/internal/examples/v2/navitas/app/server/src/lib/state/navitas/state/models.ts +43 -0
- package/dist/ai-context/internal/examples/v2/navitas/app/server/src/lib/state/navitas/state/state-change.ts +53 -0
- package/dist/ai-context/internal/examples/v2/navitas/app/server/src/lib/state/redis/index.ts +102 -0
- package/dist/ai-context/internal/examples/v2/navitas/app/server/src/lib/state/seeka/installations.ts +66 -0
- package/dist/ai-context/internal/examples/v2/navitas/app/server/tsconfig.json +21 -0
- package/dist/ai-context/internal/examples/v2/navitas/bigquery-views/acap/seekacd-stream-activity-brand-pageview.sql +93 -0
- package/dist/ai-context/internal/examples/v2/navitas/bigquery-views/sae/seekacd-stream-activity-brand-pageview.sql +93 -0
- package/dist/ai-context/internal/examples/v2/navitas/lib/google-bigquery/.nvmrc +1 -0
- package/dist/ai-context/internal/examples/v2/navitas/lib/google-bigquery/package.json +48 -0
- package/dist/ai-context/internal/examples/v2/navitas/package.json +23 -0
- package/dist/ai-context/internal/examples/v2/navitas/tsconfig.json +26 -0
- package/dist/ai-context/internal/examples/v2/trustarc/.yarnrc.yml +8 -0
- package/dist/ai-context/internal/examples/v2/trustarc/README.md +7 -0
- package/dist/ai-context/internal/examples/v2/trustarc/_ai-summary.md +36 -0
- package/dist/ai-context/internal/examples/v2/trustarc/app/browser/README.md +1 -0
- package/dist/ai-context/internal/examples/v2/trustarc/app/browser/jest.config.js +11 -0
- package/dist/ai-context/internal/examples/v2/trustarc/app/browser/package.json +39 -0
- package/dist/ai-context/internal/examples/v2/trustarc/app/browser/src/browser.ts +12 -0
- package/dist/ai-context/internal/examples/v2/trustarc/app/browser/src/plugin/index.test.ts +6 -0
- package/dist/ai-context/internal/examples/v2/trustarc/app/browser/src/plugin/index.ts +236 -0
- package/dist/ai-context/internal/examples/v2/trustarc/app/browser/tsconfig.json +35 -0
- package/dist/ai-context/internal/examples/v2/trustarc/app/server-azure-function/.eslintrc.cjs +11 -0
- package/dist/ai-context/internal/examples/v2/trustarc/app/server-azure-function/README.md +105 -0
- package/dist/ai-context/internal/examples/v2/trustarc/app/server-azure-function/host.json +20 -0
- package/dist/ai-context/internal/examples/v2/trustarc/app/server-azure-function/package.json +51 -0
- package/dist/ai-context/internal/examples/v2/trustarc/app/server-azure-function/src/functions/healthCheck.ts +14 -0
- package/dist/ai-context/internal/examples/v2/trustarc/app/server-azure-function/src/functions/seekaAppWebhook.ts +232 -0
- package/dist/ai-context/internal/examples/v2/trustarc/app/server-azure-function/src/lib/browser/index.ts +54 -0
- package/dist/ai-context/internal/examples/v2/trustarc/app/server-azure-function/src/lib/jobs/index.ts +96 -0
- package/dist/ai-context/internal/examples/v2/trustarc/app/server-azure-function/src/lib/logging/index.ts +93 -0
- package/dist/ai-context/internal/examples/v2/trustarc/app/server-azure-function/src/lib/models/index.ts +13 -0
- package/dist/ai-context/internal/examples/v2/trustarc/app/server-azure-function/src/lib/services/index.ts +41 -0
- package/dist/ai-context/internal/examples/v2/trustarc/app/server-azure-function/src/lib/state/redis/index.ts +96 -0
- package/dist/ai-context/internal/examples/v2/trustarc/app/server-azure-function/src/lib/state/seeka/installations.ts +65 -0
- package/dist/ai-context/internal/examples/v2/trustarc/app/server-azure-function/tsconfig.json +18 -0
- package/dist/ai-context/internal/examples/v2/trustarc/package.json +22 -0
- package/dist/ai-context/internal/examples/v2/trustarc/tsconfig.json +25 -0
- package/dist/ai-context/internal/examples/v2/typeform/.yarnrc.yml +11 -0
- package/dist/ai-context/internal/examples/v2/typeform/README.md +15 -0
- package/dist/ai-context/internal/examples/v2/typeform/_ai-summary.md +31 -0
- package/dist/ai-context/internal/examples/v2/typeform/app/browser/README.md +1 -0
- package/dist/ai-context/internal/examples/v2/typeform/app/browser/package.json +34 -0
- package/dist/ai-context/internal/examples/v2/typeform/app/browser/src/browser.ts +12 -0
- package/dist/ai-context/internal/examples/v2/typeform/app/browser/src/plugin/index.ts +197 -0
- package/dist/ai-context/internal/examples/v2/typeform/app/browser/tsconfig.json +34 -0
- package/dist/ai-context/internal/examples/v2/typeform/app/lib/package.json +32 -0
- package/dist/ai-context/internal/examples/v2/typeform/app/lib/src/index.ts +2 -0
- package/dist/ai-context/internal/examples/v2/typeform/app/lib/src/models/index.ts +23 -0
- package/dist/ai-context/internal/examples/v2/typeform/app/lib/tsconfig.json +22 -0
- package/dist/ai-context/internal/examples/v2/typeform/app/server/.eslintrc.cjs +19 -0
- package/dist/ai-context/internal/examples/v2/typeform/app/server/.nvmrc +1 -0
- package/dist/ai-context/internal/examples/v2/typeform/app/server/README.md +105 -0
- package/dist/ai-context/internal/examples/v2/typeform/app/server/host.json +25 -0
- package/dist/ai-context/internal/examples/v2/typeform/app/server/package.json +50 -0
- package/dist/ai-context/internal/examples/v2/typeform/app/server/src/functions/healthCheck.ts +14 -0
- package/dist/ai-context/internal/examples/v2/typeform/app/server/src/functions/seekaAppWebhook.ts +278 -0
- package/dist/ai-context/internal/examples/v2/typeform/app/server/src/functions/typeformAuthCallback.ts +87 -0
- package/dist/ai-context/internal/examples/v2/typeform/app/server/src/functions/typeformAuthRedirect.ts +78 -0
- package/dist/ai-context/internal/examples/v2/typeform/app/server/src/functions/typeformWebhook.ts +109 -0
- package/dist/ai-context/internal/examples/v2/typeform/app/server/src/functions/ui.ts +182 -0
- package/dist/ai-context/internal/examples/v2/typeform/app/server/src/index.test.ts +7 -0
- package/dist/ai-context/internal/examples/v2/typeform/app/server/src/lib/api/auth.ts +91 -0
- package/dist/ai-context/internal/examples/v2/typeform/app/server/src/lib/api/routes/disconnectTypeform.ts +18 -0
- package/dist/ai-context/internal/examples/v2/typeform/app/server/src/lib/api/routes/getTypeformAuthInfo.ts +12 -0
- package/dist/ai-context/internal/examples/v2/typeform/app/server/src/lib/api/routes/setFormBindings.ts +43 -0
- package/dist/ai-context/internal/examples/v2/typeform/app/server/src/lib/browser/index.ts +52 -0
- package/dist/ai-context/internal/examples/v2/typeform/app/server/src/lib/logging/index.ts +89 -0
- package/dist/ai-context/internal/examples/v2/typeform/app/server/src/lib/services/index.ts +41 -0
- package/dist/ai-context/internal/examples/v2/typeform/app/server/src/lib/state/redis/index.ts +102 -0
- package/dist/ai-context/internal/examples/v2/typeform/app/server/src/lib/state/seeka/installations.ts +64 -0
- package/dist/ai-context/internal/examples/v2/typeform/app/server/src/lib/typeform/auth.ts +108 -0
- package/dist/ai-context/internal/examples/v2/typeform/app/server/src/lib/typeform/forms.ts +259 -0
- package/dist/ai-context/internal/examples/v2/typeform/app/server/src/lib/typeform/models.ts +105 -0
- package/dist/ai-context/internal/examples/v2/typeform/app/server/src/lib/typeform/webhooks.ts +182 -0
- package/dist/ai-context/internal/examples/v2/typeform/app/server/tsconfig.json +18 -0
- package/dist/ai-context/internal/examples/v2/typeform/app/ui/README.md +40 -0
- package/dist/ai-context/internal/examples/v2/typeform/app/ui/index.html +22 -0
- package/dist/ai-context/internal/examples/v2/typeform/app/ui/package.json +72 -0
- package/dist/ai-context/internal/examples/v2/typeform/app/ui/public/favicon.ico +0 -0
- package/dist/ai-context/internal/examples/v2/typeform/app/ui/src/App.tsx +79 -0
- package/dist/ai-context/internal/examples/v2/typeform/app/ui/src/components/setup/steps/auth/index.tsx +36 -0
- package/dist/ai-context/internal/examples/v2/typeform/app/ui/src/components/setup/steps/complete/index.tsx +22 -0
- package/dist/ai-context/internal/examples/v2/typeform/app/ui/src/components/setup/steps/form-binding/index.tsx +215 -0
- package/dist/ai-context/internal/examples/v2/typeform/app/ui/src/components/setup/steps/form-binding/row/index.tsx +104 -0
- package/dist/ai-context/internal/examples/v2/typeform/app/ui/src/components/setup/steps/index.tsx +31 -0
- package/dist/ai-context/internal/examples/v2/typeform/app/ui/src/components/typeform/login/index.tsx +140 -0
- package/dist/ai-context/internal/examples/v2/typeform/app/ui/src/index.tsx +45 -0
- package/dist/ai-context/internal/examples/v2/typeform/app/ui/src/routes/home/index.tsx +10 -0
- package/dist/ai-context/internal/examples/v2/typeform/app/ui/src/seeka-labs-app-sdk-ui/api/redux/index.tsx +16 -0
- package/dist/ai-context/internal/examples/v2/typeform/app/ui/src/seeka-labs-app-sdk-ui/shared/auth/tokenProvider/index.tsx +53 -0
- package/dist/ai-context/internal/examples/v2/typeform/app/ui/src/seeka-labs-app-sdk-ui/shared/auth/useTokens/index.ts +8 -0
- package/dist/ai-context/internal/examples/v2/typeform/app/ui/src/seeka-labs-app-sdk-ui/shared/form/fields/activityNameSelect/index.tsx +237 -0
- package/dist/ai-context/internal/examples/v2/typeform/app/ui/src/seeka-labs-app-sdk-ui/shared/form/fields/activitySourceSelect/index.tsx +135 -0
- package/dist/ai-context/internal/examples/v2/typeform/app/ui/src/seeka-labs-app-sdk-ui/shared/form/provider/index.tsx +16 -0
- package/dist/ai-context/internal/examples/v2/typeform/app/ui/src/seeka-labs-app-sdk-ui/shared/form/utils/index.ts +133 -0
- package/dist/ai-context/internal/examples/v2/typeform/app/ui/src/seeka-labs-app-sdk-ui/shared/form/validation/activityPipelineActivityFilter/index.ts +85 -0
- package/dist/ai-context/internal/examples/v2/typeform/app/ui/src/seeka-labs-app-sdk-ui/shared/loading-spinner/index.tsx +13 -0
- package/dist/ai-context/internal/examples/v2/typeform/app/ui/src/seeka-labs-app-sdk-ui/shared/theme/index.ts +24 -0
- package/dist/ai-context/internal/examples/v2/typeform/app/ui/src/seeka-labs-app-sdk-ui/utils/index.ts +11 -0
- package/dist/ai-context/internal/examples/v2/typeform/app/ui/src/seeka-labs-app-sdk-ui/wizard/heading/index.tsx +33 -0
- package/dist/ai-context/internal/examples/v2/typeform/app/ui/src/seeka-labs-app-sdk-ui/wizard/step/actions/index.tsx +12 -0
- package/dist/ai-context/internal/examples/v2/typeform/app/ui/src/seeka-labs-app-sdk-ui/wizard/step/content/index.tsx +24 -0
- package/dist/ai-context/internal/examples/v2/typeform/app/ui/src/seeka-labs-app-sdk-ui/wizard/step/index.tsx +16 -0
- package/dist/ai-context/internal/examples/v2/typeform/app/ui/src/vite-env.d.ts +12 -0
- package/dist/ai-context/internal/examples/v2/typeform/app/ui/tsconfig.json +35 -0
- package/dist/ai-context/internal/examples/v2/typeform/app/ui/tsconfig.node.json +10 -0
- package/dist/ai-context/internal/examples/v2/typeform/app/ui/vite.config.mts +46 -0
- package/dist/ai-context/internal/examples/v2/typeform/package.json +29 -0
- package/dist/ai-context/internal/examples/v2/typeform/tsconfig.json +37 -0
- package/dist/ai-context/internal/examples/v2/webhook/.yarnrc.yml +11 -0
- package/dist/ai-context/internal/examples/v2/webhook/README.md +14 -0
- package/dist/ai-context/internal/examples/v2/webhook/_ai-summary.md +26 -0
- package/dist/ai-context/internal/examples/v2/webhook/app/server/.eslintrc.cjs +11 -0
- package/dist/ai-context/internal/examples/v2/webhook/app/server/.nvmrc +1 -0
- package/dist/ai-context/internal/examples/v2/webhook/app/server/README.md +104 -0
- package/dist/ai-context/internal/examples/v2/webhook/app/server/host.json +25 -0
- package/dist/ai-context/internal/examples/v2/webhook/app/server/package.json +50 -0
- package/dist/ai-context/internal/examples/v2/webhook/app/server/src/functions/healthCheck.ts +14 -0
- package/dist/ai-context/internal/examples/v2/webhook/app/server/src/functions/inboundWebhook.ts +133 -0
- package/dist/ai-context/internal/examples/v2/webhook/app/server/src/functions/inboundWebhookQueueHandler.ts +45 -0
- package/dist/ai-context/internal/examples/v2/webhook/app/server/src/functions/seekaAppWebhook.ts +153 -0
- package/dist/ai-context/internal/examples/v2/webhook/app/server/src/functions/ui.ts +176 -0
- package/dist/ai-context/internal/examples/v2/webhook/app/server/src/lib/api/auth.ts +91 -0
- package/dist/ai-context/internal/examples/v2/webhook/app/server/src/lib/api/routes/setSampleState.ts +25 -0
- package/dist/ai-context/internal/examples/v2/webhook/app/server/src/lib/jobs/index.ts +72 -0
- package/dist/ai-context/internal/examples/v2/webhook/app/server/src/lib/logging/index.ts +106 -0
- package/dist/ai-context/internal/examples/v2/webhook/app/server/src/lib/services/index.ts +41 -0
- package/dist/ai-context/internal/examples/v2/webhook/app/server/src/lib/state/redis/index.ts +102 -0
- package/dist/ai-context/internal/examples/v2/webhook/app/server/src/lib/state/seeka/installations.ts +85 -0
- package/dist/ai-context/internal/examples/v2/webhook/app/server/src/lib/utils/object.ts +7 -0
- package/dist/ai-context/internal/examples/v2/webhook/app/server/src/lib/webhooks/index.ts +171 -0
- package/dist/ai-context/internal/examples/v2/webhook/app/server/src/lib/webhooks/models/index.ts +9 -0
- package/dist/ai-context/internal/examples/v2/webhook/app/server/tsconfig.json +21 -0
- package/dist/ai-context/internal/examples/v2/webhook/app/ui/README.md +40 -0
- package/dist/ai-context/internal/examples/v2/webhook/app/ui/index.html +22 -0
- package/dist/ai-context/internal/examples/v2/webhook/app/ui/package.json +67 -0
- package/dist/ai-context/internal/examples/v2/webhook/app/ui/public/favicon.ico +0 -0
- package/dist/ai-context/internal/examples/v2/webhook/app/ui/public/index.html +21 -0
- package/dist/ai-context/internal/examples/v2/webhook/app/ui/public/manifest.json +15 -0
- package/dist/ai-context/internal/examples/v2/webhook/app/ui/src/App.tsx +72 -0
- package/dist/ai-context/internal/examples/v2/webhook/app/ui/src/index.tsx +45 -0
- package/dist/ai-context/internal/examples/v2/webhook/app/ui/src/routes/home/index.tsx +26 -0
- package/dist/ai-context/internal/examples/v2/webhook/app/ui/src/seeka-labs-app-sdk-ui/shared/auth/tokenProvider/index.tsx +53 -0
- package/dist/ai-context/internal/examples/v2/webhook/app/ui/src/seeka-labs-app-sdk-ui/shared/auth/useTokens/index.ts +8 -0
- package/dist/ai-context/internal/examples/v2/webhook/app/ui/src/seeka-labs-app-sdk-ui/shared/loading-spinner/index.tsx +13 -0
- package/dist/ai-context/internal/examples/v2/webhook/app/ui/src/seeka-labs-app-sdk-ui/shared/theme/index.ts +24 -0
- package/dist/ai-context/internal/examples/v2/webhook/app/ui/src/seeka-labs-app-sdk-ui/utils/index.ts +11 -0
- package/dist/ai-context/internal/examples/v2/webhook/app/ui/src/seeka-labs-app-sdk-ui/wizard/heading/index.tsx +33 -0
- package/dist/ai-context/internal/examples/v2/webhook/app/ui/src/seeka-labs-app-sdk-ui/wizard/step/actions/index.tsx +12 -0
- package/dist/ai-context/internal/examples/v2/webhook/app/ui/src/seeka-labs-app-sdk-ui/wizard/step/content/index.tsx +24 -0
- package/dist/ai-context/internal/examples/v2/webhook/app/ui/src/seeka-labs-app-sdk-ui/wizard/step/index.tsx +16 -0
- package/dist/ai-context/internal/examples/v2/webhook/app/ui/src/vite-env.d.ts +12 -0
- package/dist/ai-context/internal/examples/v2/webhook/app/ui/tsconfig.json +45 -0
- package/dist/ai-context/internal/examples/v2/webhook/app/ui/tsconfig.node.json +12 -0
- package/dist/ai-context/internal/examples/v2/webhook/app/ui/vite.config.mts +46 -0
- package/dist/ai-context/internal/examples/v2/webhook/package.json +29 -0
- package/dist/ai-context/internal/examples/v2/webhook/tsconfig.json +25 -0
- package/dist/ai-context/internal/examples/v2/yeastar/.yarnrc.yml +11 -0
- package/dist/ai-context/internal/examples/v2/yeastar/README.md +14 -0
- package/dist/ai-context/internal/examples/v2/yeastar/_ai-summary.md +26 -0
- package/dist/ai-context/internal/examples/v2/yeastar/app/lib/package.json +25 -0
- package/dist/ai-context/internal/examples/v2/yeastar/app/lib/src/index.ts +3 -0
- package/dist/ai-context/internal/examples/v2/yeastar/app/lib/src/models/index.ts +18 -0
- package/dist/ai-context/internal/examples/v2/yeastar/app/lib/tsconfig.json +22 -0
- package/dist/ai-context/internal/examples/v2/yeastar/app/server/.eslintrc.cjs +11 -0
- package/dist/ai-context/internal/examples/v2/yeastar/app/server/.nvmrc +1 -0
- package/dist/ai-context/internal/examples/v2/yeastar/app/server/README.md +105 -0
- package/dist/ai-context/internal/examples/v2/yeastar/app/server/host.json +25 -0
- package/dist/ai-context/internal/examples/v2/yeastar/app/server/package.json +55 -0
- package/dist/ai-context/internal/examples/v2/yeastar/app/server/src/definitions.d.ts +4 -0
- package/dist/ai-context/internal/examples/v2/yeastar/app/server/src/functions/healthCheck.ts +14 -0
- package/dist/ai-context/internal/examples/v2/yeastar/app/server/src/functions/seekaAppWebhook.ts +221 -0
- package/dist/ai-context/internal/examples/v2/yeastar/app/server/src/functions/ui.ts +174 -0
- package/dist/ai-context/internal/examples/v2/yeastar/app/server/src/functions/yeastarCallJournal.ts +83 -0
- package/dist/ai-context/internal/examples/v2/yeastar/app/server/src/functions/yeastarContactCreate.ts +86 -0
- package/dist/ai-context/internal/examples/v2/yeastar/app/server/src/functions/yeastarContactPopup.ts +84 -0
- package/dist/ai-context/internal/examples/v2/yeastar/app/server/src/functions/yeastarContactsSearch.ts +95 -0
- package/dist/ai-context/internal/examples/v2/yeastar/app/server/src/functions/yeastarGetUsers.ts +120 -0
- package/dist/ai-context/internal/examples/v2/yeastar/app/server/src/lib/api/auth.ts +91 -0
- package/dist/ai-context/internal/examples/v2/yeastar/app/server/src/lib/api/routes/setTrackingSettings.ts +26 -0
- package/dist/ai-context/internal/examples/v2/yeastar/app/server/src/lib/api/routes/yeastar/config/YeastarTemplate.xml +138 -0
- package/dist/ai-context/internal/examples/v2/yeastar/app/server/src/lib/api/routes/yeastar/config/getYeastarCrmConfig.ts +30 -0
- package/dist/ai-context/internal/examples/v2/yeastar/app/server/src/lib/api/routes/yeastar/users/setYeastarUsers.ts +26 -0
- package/dist/ai-context/internal/examples/v2/yeastar/app/server/src/lib/jobs/index.ts +72 -0
- package/dist/ai-context/internal/examples/v2/yeastar/app/server/src/lib/logging/index.ts +98 -0
- package/dist/ai-context/internal/examples/v2/yeastar/app/server/src/lib/services/index.ts +41 -0
- package/dist/ai-context/internal/examples/v2/yeastar/app/server/src/lib/state/redis/index.ts +102 -0
- package/dist/ai-context/internal/examples/v2/yeastar/app/server/src/lib/state/seeka/installations.ts +67 -0
- package/dist/ai-context/internal/examples/v2/yeastar/app/server/src/lib/yeastar/calls.ts +120 -0
- package/dist/ai-context/internal/examples/v2/yeastar/app/server/tsconfig.json +21 -0
- package/dist/ai-context/internal/examples/v2/yeastar/app/ui/README.md +40 -0
- package/dist/ai-context/internal/examples/v2/yeastar/app/ui/index.html +22 -0
- package/dist/ai-context/internal/examples/v2/yeastar/app/ui/package.json +74 -0
- package/dist/ai-context/internal/examples/v2/yeastar/app/ui/public/favicon.ico +0 -0
- package/dist/ai-context/internal/examples/v2/yeastar/app/ui/public/index.html +21 -0
- package/dist/ai-context/internal/examples/v2/yeastar/app/ui/public/manifest.json +15 -0
- package/dist/ai-context/internal/examples/v2/yeastar/app/ui/src/App.tsx +73 -0
- package/dist/ai-context/internal/examples/v2/yeastar/app/ui/src/assets/yeastar-icon.svg +1 -0
- package/dist/ai-context/internal/examples/v2/yeastar/app/ui/src/components/setup/steps/account/index.tsx +39 -0
- package/dist/ai-context/internal/examples/v2/yeastar/app/ui/src/components/setup/steps/index.tsx +31 -0
- package/dist/ai-context/internal/examples/v2/yeastar/app/ui/src/components/setup/steps/tracking/index.tsx +125 -0
- package/dist/ai-context/internal/examples/v2/yeastar/app/ui/src/components/setup/steps/user-mapping/index.tsx +147 -0
- package/dist/ai-context/internal/examples/v2/yeastar/app/ui/src/components/setup/steps/user-mapping/row/index.tsx +69 -0
- package/dist/ai-context/internal/examples/v2/yeastar/app/ui/src/index.tsx +45 -0
- package/dist/ai-context/internal/examples/v2/yeastar/app/ui/src/react-app-env.d.ts +1 -0
- package/dist/ai-context/internal/examples/v2/yeastar/app/ui/src/routes/home/index.tsx +11 -0
- package/dist/ai-context/internal/examples/v2/yeastar/app/ui/src/seeka-labs-app-sdk-ui/api/redux/index.tsx +16 -0
- package/dist/ai-context/internal/examples/v2/yeastar/app/ui/src/seeka-labs-app-sdk-ui/shared/auth/tokenProvider/index.tsx +53 -0
- package/dist/ai-context/internal/examples/v2/yeastar/app/ui/src/seeka-labs-app-sdk-ui/shared/auth/useTokens/index.ts +8 -0
- package/dist/ai-context/internal/examples/v2/yeastar/app/ui/src/seeka-labs-app-sdk-ui/shared/form/fields/activities/index.tsx +188 -0
- package/dist/ai-context/internal/examples/v2/yeastar/app/ui/src/seeka-labs-app-sdk-ui/shared/form/fields/activityNameSelect/index.tsx +156 -0
- package/dist/ai-context/internal/examples/v2/yeastar/app/ui/src/seeka-labs-app-sdk-ui/shared/form/fields/activitySourceActivityNameFilterSelect/index.tsx +247 -0
- package/dist/ai-context/internal/examples/v2/yeastar/app/ui/src/seeka-labs-app-sdk-ui/shared/form/fields/activitySourceFilterSelect/index.tsx +132 -0
- package/dist/ai-context/internal/examples/v2/yeastar/app/ui/src/seeka-labs-app-sdk-ui/shared/form/fields/activitySourceSelect/index.tsx +74 -0
- package/dist/ai-context/internal/examples/v2/yeastar/app/ui/src/seeka-labs-app-sdk-ui/shared/form/fields/event-pipeline/filter-row/index.tsx +263 -0
- package/dist/ai-context/internal/examples/v2/yeastar/app/ui/src/seeka-labs-app-sdk-ui/shared/form/provider/index.tsx +16 -0
- package/dist/ai-context/internal/examples/v2/yeastar/app/ui/src/seeka-labs-app-sdk-ui/shared/loading-spinner/index.tsx +9 -0
- package/dist/ai-context/internal/examples/v2/yeastar/app/ui/src/seeka-labs-app-sdk-ui/utils/index.ts +11 -0
- package/dist/ai-context/internal/examples/v2/yeastar/app/ui/src/seeka-labs-app-sdk-ui/wizard/heading/index.tsx +33 -0
- package/dist/ai-context/internal/examples/v2/yeastar/app/ui/src/seeka-labs-app-sdk-ui/wizard/step/actions/index.tsx +12 -0
- package/dist/ai-context/internal/examples/v2/yeastar/app/ui/src/seeka-labs-app-sdk-ui/wizard/step/content/index.tsx +24 -0
- package/dist/ai-context/internal/examples/v2/yeastar/app/ui/src/seeka-labs-app-sdk-ui/wizard/step/index.tsx +16 -0
- package/dist/ai-context/internal/examples/v2/yeastar/app/ui/src/vite-env.d.ts +12 -0
- package/dist/ai-context/internal/examples/v2/yeastar/app/ui/tsconfig.json +35 -0
- package/dist/ai-context/internal/examples/v2/yeastar/app/ui/tsconfig.node.json +10 -0
- package/dist/ai-context/internal/examples/v2/yeastar/app/ui/vite.config.mts +46 -0
- package/dist/ai-context/internal/examples/v2/yeastar/developers/YeastarTemplate.xml +138 -0
- package/dist/ai-context/internal/examples/v2/yeastar/package.json +29 -0
- package/dist/ai-context/internal/examples/v2/yeastar/tsconfig.json +26 -0
- package/dist/ai-context/internal/examples/v3/_index.md +105 -0
- package/dist/ai-context/internal/examples/v3/google-ads/.nvmrc +1 -0
- package/dist/ai-context/internal/examples/v3/google-ads/.yarnrc.yml +7 -0
- package/dist/{init-template → ai-context/internal/examples/v3/google-ads}/README.md +12 -13
- package/dist/ai-context/internal/examples/v3/google-ads/_ai-summary.md +31 -0
- package/dist/ai-context/internal/examples/v3/google-ads/app/.eslintrc.cjs +13 -0
- package/dist/ai-context/internal/examples/v3/google-ads/app/browser/README.md +1 -0
- package/dist/ai-context/internal/examples/v3/google-ads/app/browser/package.json +37 -0
- package/dist/ai-context/internal/examples/v3/google-ads/app/browser/src/browser.ts +12 -0
- package/dist/ai-context/internal/examples/v3/google-ads/app/browser/src/plugin/index.ts +273 -0
- package/dist/ai-context/internal/examples/v3/google-ads/app/browser/tsconfig.json +34 -0
- package/dist/ai-context/internal/examples/v3/google-ads/app/lib/package.json +44 -0
- package/dist/ai-context/internal/examples/v3/google-ads/app/lib/src/index.ts +5 -0
- package/dist/ai-context/internal/examples/v3/google-ads/app/lib/src/models/index.ts +113 -0
- package/dist/ai-context/internal/examples/v3/google-ads/app/lib/src/utils/index.ts +66 -0
- package/dist/ai-context/internal/examples/v3/google-ads/app/lib/src/validation/index.ts +10 -0
- package/dist/ai-context/internal/examples/v3/google-ads/app/lib/tsconfig.json +22 -0
- package/dist/ai-context/internal/examples/v3/google-ads/app/server/.eslintrc.cjs +4 -0
- package/dist/ai-context/internal/examples/v3/google-ads/app/server/README.md +105 -0
- package/dist/ai-context/internal/examples/v3/google-ads/app/server/host.json +31 -0
- package/dist/ai-context/internal/examples/v3/google-ads/app/server/package.json +72 -0
- package/dist/ai-context/internal/examples/v3/google-ads/app/server/src/app/api/router.ts +26 -0
- package/dist/ai-context/internal/examples/v3/google-ads/app/server/src/app/api/routes/disconnectGoogle.ts +21 -0
- package/dist/ai-context/internal/examples/v3/google-ads/app/server/src/app/api/routes/getAccessibleCustomers.ts +16 -0
- package/dist/ai-context/internal/examples/v3/google-ads/app/server/src/app/api/routes/getGoogleAuthInfo.ts +23 -0
- package/dist/ai-context/internal/examples/v3/google-ads/app/server/src/app/api/routes/getGoogleConversionActions.ts +32 -0
- package/dist/ai-context/internal/examples/v3/google-ads/app/server/src/app/api/routes/getGoogleCustomerInfo.ts +32 -0
- package/dist/ai-context/internal/examples/v3/google-ads/app/server/src/app/api/routes/setConversionMappings.ts +46 -0
- package/dist/ai-context/internal/examples/v3/google-ads/app/server/src/app/api/routes/setGoogleCustomerId.ts +39 -0
- package/dist/ai-context/internal/examples/v3/google-ads/app/server/src/app/api/routes/setTrackingSettings.ts +41 -0
- package/dist/ai-context/internal/examples/v3/google-ads/app/server/src/app/jobs/index.ts +62 -0
- package/dist/ai-context/internal/examples/v3/google-ads/app/server/src/app/logging/index.ts +4 -0
- package/dist/ai-context/internal/examples/v3/google-ads/app/server/src/app/models/index.ts +12 -0
- package/dist/ai-context/internal/examples/v3/google-ads/app/server/src/app/services/activites.ts +8 -0
- package/dist/ai-context/internal/examples/v3/google-ads/app/server/src/app/services/google/ads.ts +47 -0
- package/dist/ai-context/internal/examples/v3/google-ads/app/server/src/app/services/google/auth.ts +126 -0
- package/dist/ai-context/internal/examples/v3/google-ads/app/server/src/app/services/google/conversions/actions.ts +102 -0
- package/dist/ai-context/internal/examples/v3/google-ads/app/server/src/app/services/google/conversions/mediate.ts +177 -0
- package/dist/ai-context/internal/examples/v3/google-ads/app/server/src/app/services/google/conversions/models.ts +10 -0
- package/dist/ai-context/internal/examples/v3/google-ads/app/server/src/app/services/google/conversions/services/adjustment.ts +101 -0
- package/dist/ai-context/internal/examples/v3/google-ads/app/server/src/app/services/google/conversions/services/call.ts +86 -0
- package/dist/ai-context/internal/examples/v3/google-ads/app/server/src/app/services/google/conversions/services/click.ts +109 -0
- package/dist/ai-context/internal/examples/v3/google-ads/app/server/src/app/services/google/conversions/utils.ts +263 -0
- package/dist/ai-context/internal/examples/v3/google-ads/app/server/src/app/services/google/customers.ts +301 -0
- package/dist/ai-context/internal/examples/v3/google-ads/app/server/src/app/services/google/queues/models.ts +16 -0
- package/dist/ai-context/internal/examples/v3/google-ads/app/server/src/functions/googleAuthCallback.ts +133 -0
- package/dist/ai-context/internal/examples/v3/google-ads/app/server/src/functions/googleAuthRedirect.ts +69 -0
- package/dist/ai-context/internal/examples/v3/google-ads/app/server/src/functions/healthCheck.ts +20 -0
- package/dist/ai-context/internal/examples/v3/google-ads/app/server/src/functions/legacyMediateSeekaActivityQueueHandler.ts +46 -0
- package/dist/ai-context/internal/examples/v3/google-ads/app/server/src/functions/seekaAppWebhook.ts +223 -0
- package/dist/ai-context/internal/examples/v3/google-ads/app/server/src/functions/trackGoogleAdsConversionQueueHandler.ts +69 -0
- package/dist/ai-context/internal/examples/v3/google-ads/app/server/src/functions/ui.ts +53 -0
- package/dist/ai-context/internal/examples/v3/google-ads/app/server/tsconfig.json +24 -0
- package/dist/ai-context/internal/examples/v3/google-ads/app/ui/README.md +40 -0
- package/dist/ai-context/internal/examples/v3/google-ads/app/ui/index.html +21 -0
- package/dist/ai-context/internal/examples/v3/google-ads/app/ui/package.json +72 -0
- package/dist/ai-context/internal/examples/v3/google-ads/app/ui/public/favicon.ico +0 -0
- package/dist/ai-context/internal/examples/v3/google-ads/app/ui/src/App.tsx +72 -0
- package/dist/ai-context/internal/examples/v3/google-ads/app/ui/src/assets/app-icon.svg +5 -0
- package/dist/ai-context/internal/examples/v3/google-ads/app/ui/src/components/customer/index.tsx +185 -0
- package/dist/ai-context/internal/examples/v3/google-ads/app/ui/src/components/google/login/index.tsx +123 -0
- package/dist/ai-context/internal/examples/v3/google-ads/app/ui/src/components/setup/steps/account/index.tsx +222 -0
- package/dist/ai-context/internal/examples/v3/google-ads/app/ui/src/components/setup/steps/auth/index.tsx +42 -0
- package/dist/ai-context/internal/examples/v3/google-ads/app/ui/src/components/setup/steps/complete/index.tsx +37 -0
- package/dist/ai-context/internal/examples/v3/google-ads/app/ui/src/components/setup/steps/conversion-mapping/index.tsx +281 -0
- package/dist/ai-context/internal/examples/v3/google-ads/app/ui/src/components/setup/steps/conversion-mapping/row/index.tsx +253 -0
- package/dist/ai-context/internal/examples/v3/google-ads/app/ui/src/components/setup/steps/index.tsx +70 -0
- package/dist/ai-context/internal/examples/v3/google-ads/app/ui/src/index.tsx +45 -0
- package/dist/ai-context/internal/examples/v3/google-ads/app/ui/src/routes/home/index.tsx +30 -0
- package/dist/ai-context/internal/examples/v3/google-ads/app/ui/src/vite-env.d.ts +13 -0
- package/dist/ai-context/internal/examples/v3/google-ads/app/ui/tsconfig.json +35 -0
- package/dist/ai-context/internal/examples/v3/google-ads/app/ui/tsconfig.node.json +10 -0
- package/dist/ai-context/internal/examples/v3/google-ads/app/ui/vite.config.mts +48 -0
- package/dist/ai-context/internal/examples/v3/google-ads/package.json +45 -0
- package/dist/ai-context/internal/examples/v3/google-ads/tsconfig.json +24 -0
- package/dist/ai-context/public/architecture/app-structure.md +385 -0
- package/dist/{index.js → index.cjs} +10453 -402
- package/dist/index.cjs.map +7 -0
- package/dist/init-template/.gitlab-ci.yml +1 -1
- package/dist/init-template/AGENTS.md +99 -0
- package/dist/init-template/README.azurefunc.md +238 -0
- package/dist/init-template/app/browser/package.json +1 -1
- package/dist/init-template/app/lib/package.json +1 -1
- package/dist/init-template/app/lib/src/validation/index.ts +13 -13
- package/dist/init-template/app/server-azurefunc/package.json +1 -1
- package/dist/init-template/app/server-azurefunc/src/app/models/index.ts +12 -12
- package/dist/init-template/app/server-azurefunc/src/app/services/activites.ts +8 -8
- package/dist/init-template/app/ui/.env +7 -0
- package/dist/init-template/app/ui/package.json +1 -1
- package/dist/init-template/app/ui/src/index.tsx +1 -1
- package/package.json +21 -14
- package/dist/index.js.map +0 -7
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { connect, disconnect, isConnected } from "../state/redis";
|
|
2
|
+
import winston, { Logger } from "winston";
|
|
3
|
+
|
|
4
|
+
export const startServices = async (logger: Logger) => {
|
|
5
|
+
logger.debug(`Trying to connect to Redis - ${process.env.REDIS_CONNECTION_HOST}`)
|
|
6
|
+
try {
|
|
7
|
+
if (isConnected()) {
|
|
8
|
+
logger.verbose(`Redis already connected - ${process.env.REDIS_CONNECTION_HOST}`)
|
|
9
|
+
}
|
|
10
|
+
else {
|
|
11
|
+
logger.profile('service.redis.connect')
|
|
12
|
+
await connect();
|
|
13
|
+
logger.profile('service.redis.connect')
|
|
14
|
+
logger.info(`Redis connected - ${process.env.REDIS_CONNECTION_HOST}`)
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
catch (e) {
|
|
18
|
+
logger.error(`Failed to connect to Redis - ${process.env.REDIS_CONNECTION_HOST}`, { ex: winston.exceptions.getAllInfo(e) })
|
|
19
|
+
throw e;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const stopServices = async (logger: Logger) => {
|
|
24
|
+
logger.debug(`Trying to disconnect from Redis - ${process.env.REDIS_CONNECTION_HOST}`)
|
|
25
|
+
try {
|
|
26
|
+
if (isConnected() === false) {
|
|
27
|
+
logger.verbose(`Redis already disconnected - ${process.env.REDIS_CONNECTION_HOST}`)
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
logger.profile('service.redis.disconnect')
|
|
31
|
+
await disconnect();
|
|
32
|
+
logger.profile('service.redis.disconnect')
|
|
33
|
+
logger.info(`Redis disconnected - ${process.env.REDIS_CONNECTION_HOST}`)
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
catch (e) {
|
|
37
|
+
logger.error(`Failed to disconnect from Redis - ${process.env.REDIS_CONNECTION_HOST}`, { ex: winston.exceptions.getAllInfo(e) })
|
|
38
|
+
throw e;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { createClient } from 'redis';
|
|
2
|
+
|
|
3
|
+
import { logger } from '../../logging';
|
|
4
|
+
|
|
5
|
+
const redisProtocol = process.env.REDIS_CONNECTION_TLS === 'true' ? 'rediss://' : 'redis://';
|
|
6
|
+
const redisConn = `${redisProtocol}${process.env.REDIS_CONNECTION_USER}:${process.env.REDIS_CONNECTION_PASSWORD}@${process.env.REDIS_CONNECTION_HOST}:${process.env.REDIS_CONNECTION_PORT}`;
|
|
7
|
+
|
|
8
|
+
const redisClient = createClient({
|
|
9
|
+
url: redisConn
|
|
10
|
+
})
|
|
11
|
+
.on('error', err => logger.error('Redis Client ', { error: err }));
|
|
12
|
+
|
|
13
|
+
export const connect = async () => {
|
|
14
|
+
await redisClient.connect();
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const isConnected = () => {
|
|
18
|
+
return redisClient.isOpen;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const disconnect = async () => {
|
|
22
|
+
await redisClient.disconnect();
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const getKeyPrefix = (stateType: string) => `seeka:app:${process.env.SEEKA_APP_ID}:${stateType}`
|
|
26
|
+
const getKey = (stateType: string, key: string) => `${getKeyPrefix(stateType)}:${key}`
|
|
27
|
+
|
|
28
|
+
export async function getOrCreate<TState>(stateType: string, key: string, toCreate: TState): Promise<TState> {
|
|
29
|
+
const fullKey = getKey(stateType, key);
|
|
30
|
+
const existingStr = await redisClient.get(fullKey);
|
|
31
|
+
if (existingStr) return JSON.parse(existingStr);
|
|
32
|
+
|
|
33
|
+
await redisClient.set(fullKey, JSON.stringify(toCreate));
|
|
34
|
+
|
|
35
|
+
return toCreate;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export async function tryGet<TState>(stateType: string, key: string): Promise<TState | null> {
|
|
39
|
+
const fullKey = getKey(stateType, key);
|
|
40
|
+
const existingStr = await redisClient.get(fullKey);
|
|
41
|
+
if (existingStr) return JSON.parse(existingStr);
|
|
42
|
+
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export async function getList<TState>(stateType: string): Promise<TState[]> {
|
|
47
|
+
const prefix = getKeyPrefix(stateType);
|
|
48
|
+
const allKeys = await redisClient.keys(`${prefix}:*`);
|
|
49
|
+
const listStr = await redisClient.mGet(allKeys);
|
|
50
|
+
|
|
51
|
+
if (listStr) return listStr.filter(e => Boolean(e)).map(e => JSON.parse(e as string));
|
|
52
|
+
|
|
53
|
+
return [];
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export async function set<TState>(stateType: string, key: string, toCreate: TState): Promise<void> {
|
|
57
|
+
const fullKey = getKey(stateType, key);
|
|
58
|
+
await redisClient.set(fullKey, JSON.stringify(toCreate));
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export async function remove(stateType: string, key: string): Promise<void> {
|
|
62
|
+
const fullKey = getKey(stateType, key);
|
|
63
|
+
await redisClient.del(fullKey);
|
|
64
|
+
}
|
package/dist/ai-context/internal/examples/v1/me-and-u-connect/src/lib/state/seeka/installations.ts
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { Logger } from 'winston';
|
|
2
|
+
|
|
3
|
+
import { getList, remove, set, tryGet } from '../../state/redis';
|
|
4
|
+
|
|
5
|
+
export interface SeekaAppInstallState {
|
|
6
|
+
/** ID of the organisation that installed the app */
|
|
7
|
+
organisationId: string;
|
|
8
|
+
/** ID of the brand that installed the app */
|
|
9
|
+
organisationBrandId: string;
|
|
10
|
+
/** ID of the installation of the app */
|
|
11
|
+
applicationInstallId: string;
|
|
12
|
+
// Installation settings provided by the user installing the app
|
|
13
|
+
installationSettings: { [key: string]: string | number | undefined; };
|
|
14
|
+
// State relating to the app and installation of the app
|
|
15
|
+
installationState: MeAndUAppInstallState;
|
|
16
|
+
|
|
17
|
+
// When the app was installed
|
|
18
|
+
installedAt: string; // new Date().toISOString()
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface MeAndUAppInstallState {
|
|
22
|
+
seekaPersonIdMeAndUFieldId?: string
|
|
23
|
+
meAndUContactSyncUpToLastCreated?: string
|
|
24
|
+
grantedPermissions?: string[]
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const stateType = 'install'
|
|
28
|
+
|
|
29
|
+
export const tryGetInstallation = async (applicationInstallId: string, throwWhenNotFound: boolean, logger: Logger): Promise<SeekaAppInstallState | null> => {
|
|
30
|
+
const installation = await tryGet<SeekaAppInstallState>(stateType, applicationInstallId);
|
|
31
|
+
if (installation == null && throwWhenNotFound) {
|
|
32
|
+
throw new Error(`Seeka installation ${applicationInstallId} not found`);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return installation;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export const listInstallations = async (logger: Logger): Promise<SeekaAppInstallState[]> => {
|
|
39
|
+
const installations = await getList<SeekaAppInstallState>(stateType);
|
|
40
|
+
|
|
41
|
+
return installations;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export const createOrUpdateInstallation = async (state: SeekaAppInstallState, logger: Logger): Promise<SeekaAppInstallState> => {
|
|
45
|
+
if (!state.installationState) state.installationState = {};
|
|
46
|
+
if (!state.installedAt) state.installedAt = new Date().toISOString();
|
|
47
|
+
|
|
48
|
+
const creating = (await tryGetInstallation(state.applicationInstallId, false, logger)) === null;
|
|
49
|
+
|
|
50
|
+
await set(stateType, state.applicationInstallId, state);
|
|
51
|
+
|
|
52
|
+
logger.info(creating ? 'Created installation state' : 'Updated installation state', { applicationInstallId: state.applicationInstallId, organisationId: state.organisationId, organisationBrandId: state.organisationBrandId });
|
|
53
|
+
|
|
54
|
+
return state;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export const deleteInstallation = async (applicationInstallId: string, logger: Logger): Promise<void> => {
|
|
58
|
+
await remove(stateType, applicationInstallId);
|
|
59
|
+
|
|
60
|
+
logger.info('Deleted installation state', { applicationInstallId });
|
|
61
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"allowJs": true,
|
|
4
|
+
"skipLibCheck": true,
|
|
5
|
+
"strict": false,
|
|
6
|
+
"esModuleInterop": true,
|
|
7
|
+
"outDir": "dist",
|
|
8
|
+
"rootDir": ".",
|
|
9
|
+
"sourceMap": true,
|
|
10
|
+
"module": "CommonJS",
|
|
11
|
+
"target": "ES6",
|
|
12
|
+
"resolveJsonModule": true,
|
|
13
|
+
"isolatedModules": false,
|
|
14
|
+
},
|
|
15
|
+
"include": [
|
|
16
|
+
"src/**/*.ts"
|
|
17
|
+
],
|
|
18
|
+
"exclude": [
|
|
19
|
+
"node_modules",
|
|
20
|
+
"dist"
|
|
21
|
+
]
|
|
22
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/* eslint-env node */
|
|
2
|
+
module.exports = {
|
|
3
|
+
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
|
|
4
|
+
parser: '@typescript-eslint/parser',
|
|
5
|
+
plugins: ['@typescript-eslint'],
|
|
6
|
+
root: true,
|
|
7
|
+
rules: {
|
|
8
|
+
"@typescript-eslint/no-unused-vars": "warn",
|
|
9
|
+
"@typescript-eslint/no-explicit-any": "warn",
|
|
10
|
+
}
|
|
11
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
v20
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
# Seeka app - Me&u - connect / CRM
|
|
2
|
+
|
|
3
|
+
## What this app does (customer‑facing overview)
|
|
4
|
+
|
|
5
|
+
This Seeka app connects your Me&u venue to Seeka so your customer data and activity stay in sync automatically. Once installed and configured, the app runs in the background and keeps your CRM up to date without any manual effort.
|
|
6
|
+
|
|
7
|
+
Key features
|
|
8
|
+
|
|
9
|
+
- Automatic order sync
|
|
10
|
+
- Regularly imports new and updated Me&u orders for your venue and makes them available for CRM workflows and reporting in Seeka.
|
|
11
|
+
- Runs on a schedule in the background (approximately every 15 minutes) and can also be triggered during installation for an initial backfill.
|
|
12
|
+
- Reliable processing with retries and safe handling for transient errors to help prevent data loss.
|
|
13
|
+
|
|
14
|
+
- Marketing consent sync
|
|
15
|
+
- Retrieves Me&u marketing opt‑ins and updates customer preferences in Seeka so your audience lists stay compliant and current.
|
|
16
|
+
- Runs on the same background schedule alongside order sync.
|
|
17
|
+
|
|
18
|
+
- Simple installation and configuration
|
|
19
|
+
- Install from Seeka, provide your Me&u Access Token and Venue Slug, and the app verifies your connection automatically.
|
|
20
|
+
- The app detects your venue’s active menu so it can precisely scope the data it syncs.
|
|
21
|
+
|
|
22
|
+
What gets synced
|
|
23
|
+
|
|
24
|
+
- Orders: New and updated Me&u orders are ingested and prepared for use in Seeka (e.g., activities, segments, or automations).
|
|
25
|
+
- Marketing opt‑ins: Customer marketing consent collected via Me&u is kept aligned with Seeka contact preferences.
|
|
26
|
+
|
|
27
|
+
How it works
|
|
28
|
+
|
|
29
|
+
1. Install the app from Seeka and enter:
|
|
30
|
+
- Me&u Access Token
|
|
31
|
+
- Me&u Venue Slug
|
|
32
|
+
2. The app validates your details and connects your venue.
|
|
33
|
+
|
|
34
|
+
### Credentials required from Me&u (what to ask your account manager)
|
|
35
|
+
|
|
36
|
+
To enable this app, you will need the following from your Me&u account manager:
|
|
37
|
+
|
|
38
|
+
- Me&u API access token (Bearer) for the Stable GraphQL API
|
|
39
|
+
- Must allow read access for: menus, orders, and marketing opt‑ins for your venue/organisation.
|
|
40
|
+
- This token is supplied to Seeka as the “Me&u Access Token”. It is sent in the HTTP header as: Authorization: Bearer <token>.
|
|
41
|
+
- Region of your Me&u account: AP, EU, or US
|
|
42
|
+
- The token should be valid for the appropriate regional Stable API endpoint (ap1/eu1/us1).
|
|
43
|
+
- Your venue slug
|
|
44
|
+
- The app uses your venue/menu slug to scope syncing precisely to your active menu.
|
|
45
|
+
|
|
46
|
+
Recommended request to send to your Me&u account manager
|
|
47
|
+
|
|
48
|
+
“Please provide a Stable GraphQL API access token (Bearer) for our venue that grants read access to Menus, Orders, and Marketing Opt‑ins, in the <AP|EU|US> region. Also confirm our venue/menu slug.”
|
|
49
|
+
|
|
50
|
+
Notes
|
|
51
|
+
|
|
52
|
+
- The app only requires read‑level access for the endpoints listed above; no write access is needed.
|
|
53
|
+
- If you operate across multiple venues, ensure the token covers the venues you intend to sync, or request separate tokens as needed.
|
|
54
|
+
|
|
55
|
+
## Development
|
|
56
|
+
|
|
57
|
+
- See [Configure your environment](https://learn.microsoft.com/en-us/azure/azure-functions/create-first-function-vs-code-typescript?pivots=nodejs-model-v4#configure-your-environment) for dependencies
|
|
58
|
+
- For emulating Azure storage queues, blobs and tables: `docker run --name azurite -p 10000:10000 -p 10001:10001 -p 10002:10002 --detach mcr.microsoft.com/azure-storage/azurite`
|
|
59
|
+
- Set `AzureWebJobsStorage` setting in local.settings.json to `UseDevelopmentStorage=true`
|
|
60
|
+
- If not using WSL:
|
|
61
|
+
`UseDevelopmentStorage=true`
|
|
62
|
+
- If using WSL: Ensure to replace DAN-LAPTOP with your hostname. Below connection string allows running Azurite on your host machine and lets WSL connect to it
|
|
63
|
+
`DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://DAN-LAPTOP.local:10000/devstoreaccount1;QueueEndpoint=http://DAN-LAPTOP.local:10001/devstoreaccount1;TableEndpoint=http://DAN-LAPTOP.local:10002/devstoreaccount1;`
|
|
64
|
+
- Install Azure Storage explorer and create your queues (see `./src/lib/jobs/index.ts` for `queueNames`). Azure Storage explorer can be used to view your queue items.
|
|
65
|
+
- `yarn install`
|
|
66
|
+
- `yarn start`
|
|
67
|
+
|
|
68
|
+
### Debugging
|
|
69
|
+
Supports VSCode debugging via the debugger and utilisation of breakpoints.
|
|
70
|
+
This is only tested on Linux but may work on Windows.
|
|
71
|
+
If using Windows then use WSL with an Ubuntu distro for support of attaching the VS code debugger
|
|
72
|
+
|
|
73
|
+
#### Live urls
|
|
74
|
+
You can expose your app locally to the internet via Ngrok to test your app before deploying.
|
|
75
|
+
|
|
76
|
+
##### Setup
|
|
77
|
+
1. Sign up for a Ngrok account
|
|
78
|
+
2. Get your auth token
|
|
79
|
+
3. `yarn ngrok config add-authtoken [auth token here]` replacing `[auth token]` with the auth token retrieved from your Ngrok dashboard
|
|
80
|
+
|
|
81
|
+
##### Running
|
|
82
|
+
1. `yarn start` OR start debugging in VSCode
|
|
83
|
+
2. In separate terminal window run `yarn tunnel` and observe the log entry that starts with `Live url exposed` for your Seeka app webhook URL that you can place in your Seeka app configuration.
|
|
84
|
+
|
|
85
|
+
#### Invoking functions
|
|
86
|
+
##### Development environment
|
|
87
|
+
Scheduled / timer function: `curl -i -d '{"input": null}' -H "Content-Type: application/json" -X POST http://localhost:7072/admin/functions/pollForNewMeAndUData`
|
|
88
|
+
|
|
89
|
+
##### Azure cloud
|
|
90
|
+
Scheduled / timer function: `curl -i -d '{"input": null}' -H "Content-Type: application/json" -H "x-functions-key: <key from azure portal>" -X POST https://seeka-app-meandu-manage.azurewebsites.net/admin/functions/pollForNewMeAndUData`
|
|
91
|
+
|
|
92
|
+
See [this doc](https://learn.microsoft.com/en-us/azure/azure-functions/functions-manually-run-non-http?tabs=azure-portal#get-the-master-key) on how to get the functions (master) key
|
|
93
|
+
|
|
94
|
+
#### Sample functions
|
|
95
|
+
##### Seeka app webhook
|
|
96
|
+
`src/functions/seekaAppWebhook.ts`
|
|
97
|
+
TODO
|
|
98
|
+
|
|
99
|
+
##### Queue example
|
|
100
|
+
`src/functions/processNewMeAndUOrders.ts`
|
|
101
|
+
TODO
|
|
102
|
+
|
|
103
|
+
##### Polling example
|
|
104
|
+
`src/functions/pollForNewMeAndUData.ts`
|
|
105
|
+
TODO
|
|
106
|
+
|
|
107
|
+
### Logging
|
|
108
|
+
|
|
109
|
+
Winston included - TODO
|
|
110
|
+
Seq included - TODO
|
|
111
|
+
|
|
112
|
+
## Deployment
|
|
113
|
+
This project comes ready to deploy for free to Azure functions with database backed by Redis hosted by Upstash and queues, blobs and tables backed by Azure Storage.
|
|
114
|
+
|
|
115
|
+
At the point of writing, Netlify and Upstash can be used to deploy your app for free.
|
|
116
|
+
- https://upstash.com/pricing
|
|
117
|
+
- https://www.netlify.com/pricing/
|
|
118
|
+
|
|
119
|
+
### Gitlab
|
|
120
|
+
TODO
|
|
121
|
+
|
|
122
|
+
### Azure Function deploy
|
|
123
|
+
- `yarn deploy`
|
|
124
|
+
|
|
125
|
+
## State management
|
|
126
|
+
Installations and other state is stored in Redis. Another state provider can be used, see `src/lib/state/seeka/installations.ts` for the file that manages the state of the installations.
|
|
127
|
+
|
|
128
|
+
### Upstash (optional)
|
|
129
|
+
If you dont want to use Upstash for Redis then swap out the connection strings with your Redis instance.
|
|
130
|
+
- When choosing region - use US East (Ohio) - us-east-* as this is the same Azure region that the Azure functions run from
|
|
131
|
+
|
|
132
|
+
## References
|
|
133
|
+
- https://learn.microsoft.com/en-us/azure/storage/common/storage-use-azurite
|
|
134
|
+
- https://learn.microsoft.com/en-us/azure/storage/queues/storage-quickstart-queues-nodejs?tabs=connection-string%2Croles-azure-portal%2Cenvironment-variable-windows%2Csign-in-azure-cli
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# AI Summary for Seeka App: Me&u Manage
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
**App Name:** Me&u Manage
|
|
6
|
+
**Purpose:** The Me&u Manage app integrates Me&u venue management with Seeka for seamless order tracking and CRM synchronization. It automates the syncing of orders and marketing consents from Me&u to Seeka, ensuring that customer data and preferences are up-to-date without manual intervention.
|
|
7
|
+
|
|
8
|
+
## Key Functionality
|
|
9
|
+
|
|
10
|
+
- **Order Syncing:** Regularly imports new and updated orders from Me&u to Seeka for CRM workflows and reporting.
|
|
11
|
+
- **Marketing Consent Syncing:** Updates customer marketing preferences in Seeka based on Me&u opt-ins.
|
|
12
|
+
- **Automated Background Processing:** Operates on a schedule (every 15 minutes) and supports initial data backfill during installation.
|
|
13
|
+
- **Simple Setup:** Requires Me&u API access token and venue slug for configuration.
|
|
14
|
+
|
|
15
|
+
## Key Implementation Patterns
|
|
16
|
+
|
|
17
|
+
- **Azure Functions:** Utilizes Azure Functions for serverless execution of background jobs and webhooks.
|
|
18
|
+
- **Queue Processing:** Employs Azure Storage Queues to handle order and marketing consent processing asynchronously.
|
|
19
|
+
- **Webhook Handling:** Processes webhooks for installation, updates, and uninstallation events.
|
|
20
|
+
- **Scheduled Jobs:** Uses a timer-triggered function to poll for new data and enqueue processing jobs.
|
|
21
|
+
|
|
22
|
+
## External APIs/Services Integrated
|
|
23
|
+
|
|
24
|
+
- **Me&u API:** Connects to Me&u's Stable GraphQL API to fetch orders and marketing opt-ins.
|
|
25
|
+
- **Azure Storage:** Uses Azure Storage Queues for managing background job processing.
|
|
26
|
+
- **Ngrok:** Facilitates local development by exposing the app to the internet for testing.
|
|
27
|
+
|
|
28
|
+
## Important Data Transformations
|
|
29
|
+
|
|
30
|
+
- **Order and Consent Grouping:** Orders and marketing consents are grouped by `applicationInstallId` for batch processing.
|
|
31
|
+
- **Payload Deserialization:** Queue payloads are deserialized to extract relevant data for processing.
|
|
32
|
+
- **Error Handling and Retries:** Implements retries and error logging to handle transient errors and prevent data loss.
|
|
33
|
+
|
|
34
|
+
## Notable Code Patterns
|
|
35
|
+
|
|
36
|
+
- **Webhook Signature Validation:** Ensures webhook authenticity by validating signatures.
|
|
37
|
+
- **Background Job Triggering:** Uses a combination of Azure Functions and Storage Queues to trigger and manage background jobs efficiently.
|
|
38
|
+
- **Logging and Profiling:** Utilizes Winston for structured logging and profiling of function execution.
|
|
39
|
+
- **Environment Configuration:** Supports local development with Docker and Azurite for emulating Azure services.
|
|
40
|
+
|
|
41
|
+
## Development and Debugging
|
|
42
|
+
|
|
43
|
+
- **Local Development:** Supports local development with Docker for Azure services emulation and Ngrok for exposing local endpoints.
|
|
44
|
+
- **VSCode Debugging:** Provides support for debugging with breakpoints in VSCode, primarily tested on Linux.
|
|
45
|
+
- **Environment Setup:** Detailed instructions for setting up the development environment, including Azure Storage Explorer for queue management.
|
|
46
|
+
|
|
47
|
+
This summary provides a comprehensive understanding of the Me&u Manage app's purpose, implementation, and integration patterns, assisting AI in referencing and utilizing this app effectively.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "2.0",
|
|
3
|
+
"logging": {
|
|
4
|
+
"applicationInsights": {
|
|
5
|
+
"samplingSettings": {
|
|
6
|
+
"isEnabled": true,
|
|
7
|
+
"excludedTypes": "Request"
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
"functionTimeout": "00:10:00",
|
|
12
|
+
"extensionBundle": {
|
|
13
|
+
"id": "Microsoft.Azure.Functions.ExtensionBundle",
|
|
14
|
+
"version": "[4.*, 5.0.0)"
|
|
15
|
+
},
|
|
16
|
+
"concurrency": {
|
|
17
|
+
"dynamicConcurrencyEnabled": true,
|
|
18
|
+
"snapshotPersistenceEnabled": true
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "seeka-app-meandu-manage",
|
|
3
|
+
"version": "1.0.6",
|
|
4
|
+
"description": "Seeka app seeka-app-meandu-manage",
|
|
5
|
+
"author": "WooCommerce testing <dev@seeka.co>",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"main": "dist/src/functions/*.js",
|
|
8
|
+
"private": true,
|
|
9
|
+
"engines": {
|
|
10
|
+
"node": ">=20"
|
|
11
|
+
},
|
|
12
|
+
"scripts": {
|
|
13
|
+
"lint": "eslint",
|
|
14
|
+
"build": "tsc",
|
|
15
|
+
"watch": "tsc -w",
|
|
16
|
+
"clean": "yarn rimraf dist",
|
|
17
|
+
"prestart": "yarn clean && yarn build",
|
|
18
|
+
"start": "func start --port 7072",
|
|
19
|
+
"tunnel": "node scripts/ngrok.js seeka-app-meandu-manage-localdev",
|
|
20
|
+
"deploy": "yarn clean && yarn build && func azure functionapp publish seeka-app-meandu-manage --no-build",
|
|
21
|
+
"dev:queue:create": "node scripts/dev-queue-setup.js process-new-meandu-orders-queue && node scripts/dev-queue-setup.js process-new-meandu-marketingoptin-queue"
|
|
22
|
+
},
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"@azure/functions": "^4.6.1",
|
|
25
|
+
"@azure/storage-queue": "^12.25.0",
|
|
26
|
+
"@datalust/winston-seq": "^2.0.0",
|
|
27
|
+
"@seeka-labs/sdk-apps-server": "^1.1.29",
|
|
28
|
+
"axios": "^1.7.9",
|
|
29
|
+
"graphql": "^16.10.0",
|
|
30
|
+
"isomorphic-unfetch": "^4.0.2",
|
|
31
|
+
"lodash": "^4.17.21",
|
|
32
|
+
"redis": "^4.7.0",
|
|
33
|
+
"winston": "^3.17.0"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@types/lodash": "^4.17.15",
|
|
37
|
+
"@types/node": "^20",
|
|
38
|
+
"@typescript-eslint/eslint-plugin": "^8.23.0",
|
|
39
|
+
"@typescript-eslint/parser": "^8.23.0",
|
|
40
|
+
"azure-functions-core-tools": "^4.x",
|
|
41
|
+
"eslint": "^9",
|
|
42
|
+
"ngrok": "^5.0.0-beta.2",
|
|
43
|
+
"rimraf": "^6.0.1",
|
|
44
|
+
"typescript": "^5.7.3"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { app, HttpRequest, HttpResponseInit, InvocationContext } from '@azure/functions';
|
|
2
|
+
|
|
3
|
+
app.http('healthCheck', {
|
|
4
|
+
methods: ['GET', 'HEAD'],
|
|
5
|
+
authLevel: 'anonymous',
|
|
6
|
+
route: 'health',
|
|
7
|
+
handler: healthCheck
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export async function healthCheck(req: HttpRequest, context: InvocationContext): Promise<HttpResponseInit> {
|
|
11
|
+
return {
|
|
12
|
+
status: 200
|
|
13
|
+
}
|
|
14
|
+
}
|
package/dist/ai-context/internal/examples/v1/me-and-u-manage/src/functions/pollForNewMeAndUData.ts
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { app, InvocationContext, Timer } from '@azure/functions';
|
|
2
|
+
import { QueueClient } from '@azure/storage-queue';
|
|
3
|
+
|
|
4
|
+
import { jobNames, queueNames, triggerBackgroundJobWithQueue } from '../lib/jobs';
|
|
5
|
+
import { backgroundJobLogger } from '../lib/logging';
|
|
6
|
+
import { startServices } from '../lib/services';
|
|
7
|
+
import { listInstallations } from '../lib/state/seeka/installations';
|
|
8
|
+
import winston from 'winston';
|
|
9
|
+
|
|
10
|
+
// https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-timer?tabs=python-v2%2Cisolated-process%2Cnodejs-v4&pivots=programming-language-typescript
|
|
11
|
+
app.timer('pollForNewMeAndUData', {
|
|
12
|
+
schedule: '0 */15 * * * *', // every 1 hour on the 15th minute
|
|
13
|
+
handler: pollForNewMeAndUData
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export async function pollForNewMeAndUData(myTimer: Timer, context: InvocationContext): Promise<void> {
|
|
17
|
+
const logger = backgroundJobLogger(jobNames.pollForNewMeAndUData, undefined, context);
|
|
18
|
+
|
|
19
|
+
logger.profile(`job.${jobNames.pollForNewMeAndUData}`)
|
|
20
|
+
logger.info('Received request to trigger scheduled job');
|
|
21
|
+
|
|
22
|
+
await startServices(logger);
|
|
23
|
+
|
|
24
|
+
const allInstallations = await listInstallations(logger);
|
|
25
|
+
logger.verbose(`Triggering background job for ${allInstallations.length} installations`)
|
|
26
|
+
|
|
27
|
+
const ordersQueueClient = new QueueClient(process.env.AzureWebJobsStorage as string, queueNames.processNewMeAndUOrdersQueueName);
|
|
28
|
+
const marketingOptInQueueClient = new QueueClient(process.env.AzureWebJobsStorage as string, queueNames.processNewMeAndUMarketingOptInsQueueName);
|
|
29
|
+
const promises = allInstallations.filter(e => Boolean(e.installationState.meAndUMenuId)).map(installation => {
|
|
30
|
+
return Promise.all([
|
|
31
|
+
// Job to trigger job to process new MeAndU marketing opt ins
|
|
32
|
+
triggerBackgroundJobWithQueue(marketingOptInQueueClient, { ...installation, causationId: context.invocationId, correlationId: context.invocationId }, logger),
|
|
33
|
+
|
|
34
|
+
// Job to trigger job to process new MeAndU orders
|
|
35
|
+
triggerBackgroundJobWithQueue(ordersQueueClient, { ...installation, causationId: context.invocationId, correlationId: context.invocationId }, logger)
|
|
36
|
+
]);
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
try {
|
|
40
|
+
await Promise.all(promises);
|
|
41
|
+
}
|
|
42
|
+
catch (err) {
|
|
43
|
+
logger.error('Error triggering background jobs', { ex: winston.exceptions.getAllInfo(err) })
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
logger.profile(`job.${jobNames.pollForNewMeAndUData}`)
|
|
47
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { app, InvocationContext } from '@azure/functions';
|
|
2
|
+
|
|
3
|
+
import { SeekaActivityAcceptedWebhookContent } from '@seeka-labs/sdk-apps-server';
|
|
4
|
+
import { groupBy } from 'lodash';
|
|
5
|
+
import winston from 'winston';
|
|
6
|
+
import { BackgroundJobRequestContext, deserialiseQueuePayload, queueNames, sendQueueMessageToPoisonQueue } from '../lib/jobs';
|
|
7
|
+
import { backgroundJobLogger } from '../lib/logging';
|
|
8
|
+
import { getAllMeAndUMarketingOptIns, handleMeAndUMarketingOptInPage } from '../lib/me-and-u/consent';
|
|
9
|
+
import { startServices } from '../lib/services';
|
|
10
|
+
import { SeekaAppInstallState, tryGetInstallation } from '../lib/state/seeka/installations';
|
|
11
|
+
|
|
12
|
+
app.storageQueue('processNewMeAndUMarketingOptIns', {
|
|
13
|
+
queueName: queueNames.processNewMeAndUMarketingOptInsQueueName,
|
|
14
|
+
connection: 'AzureWebJobsStorage',
|
|
15
|
+
handler: processNewMeAndUMarketingOptIns
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export interface MeAndUMarketingOptInQueueItem extends BackgroundJobRequestContext {
|
|
19
|
+
items: SeekaActivityAcceptedWebhookContent[];
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export async function processNewMeAndUMarketingOptIns(queueItem: unknown, context: InvocationContext): Promise<void> {
|
|
23
|
+
const logger = backgroundJobLogger(queueNames.processNewMeAndUMarketingOptInsQueueName, undefined, context);
|
|
24
|
+
logger.profile(`queue.${queueNames.processNewMeAndUMarketingOptInsQueueName}`)
|
|
25
|
+
|
|
26
|
+
try {
|
|
27
|
+
// queueItem can either be a single item or an array of items
|
|
28
|
+
const payload = deserialiseQueuePayload<MeAndUMarketingOptInQueueItem>(queueItem, logger);
|
|
29
|
+
|
|
30
|
+
// Group by applicationInstallId
|
|
31
|
+
const grouped = groupBy(payload, e => e.applicationInstallId);
|
|
32
|
+
|
|
33
|
+
logger.verbose('Received queue batch to handle queue message', { batchSize: payload.length });
|
|
34
|
+
|
|
35
|
+
// Process each group
|
|
36
|
+
await startServices(logger);
|
|
37
|
+
for (const [applicationInstallId, items] of Object.entries(grouped)) {
|
|
38
|
+
if (items.length === 0) {
|
|
39
|
+
logger.warn('No items to process for applicationInstallId', { applicationInstallId });
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
const thisLogger = backgroundJobLogger(queueNames.processNewMeAndUMarketingOptInsQueueName, items[0], context);
|
|
43
|
+
try {
|
|
44
|
+
const installation = await tryGetInstallation(applicationInstallId, true, thisLogger) as SeekaAppInstallState;
|
|
45
|
+
|
|
46
|
+
// Get all marketing opt ins and process each page
|
|
47
|
+
await getAllMeAndUMarketingOptIns(installation, async (page) => {
|
|
48
|
+
await handleMeAndUMarketingOptInPage(installation, page, logger)
|
|
49
|
+
}, logger)
|
|
50
|
+
}
|
|
51
|
+
catch (err) {
|
|
52
|
+
thisLogger.error('Error handling queue item to handle queue message', { ex: winston.exceptions.getAllInfo(err) })
|
|
53
|
+
await sendQueueMessageToPoisonQueue(queueNames.processNewMeAndUMarketingOptInsQueueName, {
|
|
54
|
+
...items[0],
|
|
55
|
+
causationId: items[0].causationId,
|
|
56
|
+
correlationId: context.invocationId,
|
|
57
|
+
rows: items.flatMap(e => e.items || []).filter(Boolean)
|
|
58
|
+
} as MeAndUMarketingOptInQueueItem, thisLogger);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
catch (err) {
|
|
63
|
+
logger.error('Error handling queue item to handle queue message', { ex: winston.exceptions.getAllInfo(err) })
|
|
64
|
+
throw err; // Will retry based on host.json > extensions.queues.maxDequeueCount and then push to poison queue
|
|
65
|
+
}
|
|
66
|
+
finally {
|
|
67
|
+
logger.profile(`queue.${queueNames.processNewMeAndUMarketingOptInsQueueName}`)
|
|
68
|
+
}
|
|
69
|
+
}
|
package/dist/ai-context/internal/examples/v1/me-and-u-manage/src/functions/processNewMeAndUOrders.ts
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { app, InvocationContext } from '@azure/functions';
|
|
2
|
+
|
|
3
|
+
import { SeekaActivityAcceptedWebhookContent } from '@seeka-labs/sdk-apps-server';
|
|
4
|
+
import { groupBy } from 'lodash';
|
|
5
|
+
import winston from 'winston';
|
|
6
|
+
import { BackgroundJobRequestContext, deserialiseQueuePayload, queueNames, sendQueueMessageToPoisonQueue } from '../lib/jobs';
|
|
7
|
+
import { backgroundJobLogger } from '../lib/logging';
|
|
8
|
+
import { getAllMeAndUOrders, handleMeAndUOrderPage } from '../lib/me-and-u/orders';
|
|
9
|
+
import { startServices } from '../lib/services';
|
|
10
|
+
import { SeekaAppInstallState, tryGetInstallation } from '../lib/state/seeka/installations';
|
|
11
|
+
|
|
12
|
+
app.storageQueue('processNewMeAndUOrders', {
|
|
13
|
+
queueName: queueNames.processNewMeAndUOrdersQueueName,
|
|
14
|
+
connection: 'AzureWebJobsStorage',
|
|
15
|
+
handler: processNewMeAndUOrders
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export interface MeAndUOrderQueueItem extends BackgroundJobRequestContext {
|
|
19
|
+
items: SeekaActivityAcceptedWebhookContent[];
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export async function processNewMeAndUOrders(queueItem: any, context: InvocationContext): Promise<void> {
|
|
23
|
+
const logger = backgroundJobLogger(queueNames.processNewMeAndUOrdersQueueName, undefined, context);
|
|
24
|
+
logger.profile(`queue.${queueNames.processNewMeAndUOrdersQueueName}`)
|
|
25
|
+
|
|
26
|
+
try {
|
|
27
|
+
// queueItem can either be a single item or an array of items
|
|
28
|
+
const payload = deserialiseQueuePayload<MeAndUOrderQueueItem>(queueItem, logger);
|
|
29
|
+
|
|
30
|
+
// Group by applicationInstallId
|
|
31
|
+
const grouped = groupBy(payload, e => e.applicationInstallId);
|
|
32
|
+
|
|
33
|
+
logger.verbose('Received queue batch to handle queue message', { batchSize: payload.length });
|
|
34
|
+
|
|
35
|
+
// Process each group
|
|
36
|
+
await startServices(logger);
|
|
37
|
+
for (const [applicationInstallId, items] of Object.entries(grouped)) {
|
|
38
|
+
if (items.length === 0) {
|
|
39
|
+
logger.warn('No items to process for applicationInstallId', { applicationInstallId });
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
const thisLogger = backgroundJobLogger(queueNames.processNewMeAndUOrdersQueueName, items[0], context);
|
|
43
|
+
try {
|
|
44
|
+
const installation = await tryGetInstallation(applicationInstallId, true, thisLogger) as SeekaAppInstallState;
|
|
45
|
+
|
|
46
|
+
// Get all orders and process each page
|
|
47
|
+
await getAllMeAndUOrders(installation, async (page) => {
|
|
48
|
+
await handleMeAndUOrderPage(installation, page, logger)
|
|
49
|
+
}, logger)
|
|
50
|
+
}
|
|
51
|
+
catch (err) {
|
|
52
|
+
thisLogger.error('Error handling queue item to handle queue message', { ex: winston.exceptions.getAllInfo(err) })
|
|
53
|
+
await sendQueueMessageToPoisonQueue(queueNames.processNewMeAndUOrdersQueueName, {
|
|
54
|
+
...items[0],
|
|
55
|
+
causationId: items[0].causationId,
|
|
56
|
+
correlationId: context.invocationId,
|
|
57
|
+
rows: items.flatMap(e => e.items || []).filter(Boolean)
|
|
58
|
+
} as MeAndUOrderQueueItem, thisLogger);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
catch (err) {
|
|
63
|
+
logger.error('Error handling queue item to handle queue message', { ex: winston.exceptions.getAllInfo(err) })
|
|
64
|
+
throw err; // Will retry based on host.json > extensions.queues.maxDequeueCount and then push to poison queue
|
|
65
|
+
}
|
|
66
|
+
finally {
|
|
67
|
+
logger.profile(`queue.${queueNames.processNewMeAndUOrdersQueueName}`)
|
|
68
|
+
}
|
|
69
|
+
}
|