@headless-lms/core 0.1.0 → 0.2.0
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/dist/assets/events.d.ts +66 -3
- package/dist/assets/events.js +19 -3
- package/dist/assets/events.js.map +1 -1
- package/dist/assets/service.js +5 -3
- package/dist/assets/service.js.map +1 -1
- package/dist/automations/actions.d.ts +11 -3
- package/dist/automations/actions.js +38 -5
- package/dist/automations/actions.js.map +1 -1
- package/dist/automations/catalog.d.ts +4 -1
- package/dist/automations/catalog.js +289 -188
- package/dist/automations/catalog.js.map +1 -1
- package/dist/automations/events.d.ts +46 -24
- package/dist/automations/events.js +5 -5
- package/dist/automations/events.js.map +1 -1
- package/dist/automations/index.d.ts +5 -5
- package/dist/automations/index.js +2 -2
- package/dist/automations/model.d.ts +13 -3
- package/dist/automations/model.js +23 -3
- package/dist/automations/model.js.map +1 -1
- package/dist/automations/ports.d.ts +23 -8
- package/dist/automations/service.d.ts +21 -5
- package/dist/automations/service.js +267 -47
- package/dist/automations/service.js.map +1 -1
- package/dist/automations/types.d.ts +2 -2
- package/dist/automations/webhook-signing.d.ts +7 -0
- package/dist/automations/webhook-signing.js +22 -0
- package/dist/automations/webhook-signing.js.map +1 -0
- package/dist/content/events.d.ts +401 -25
- package/dist/content/events.js +125 -19
- package/dist/content/events.js.map +1 -1
- package/dist/content/index.d.ts +5 -5
- package/dist/content/index.js +2 -2
- package/dist/content/model.d.ts +2 -2
- package/dist/content/ports.d.ts +42 -11
- package/dist/content/service.d.ts +15 -9
- package/dist/content/service.js +153 -45
- package/dist/content/service.js.map +1 -1
- package/dist/content/types.d.ts +2 -2
- package/dist/discussion/events.d.ts +60 -4
- package/dist/discussion/events.js +30 -4
- package/dist/discussion/events.js.map +1 -1
- package/dist/discussion/model.d.ts +1 -2
- package/dist/discussion/ports.d.ts +1 -1
- package/dist/discussion/service.d.ts +1 -1
- package/dist/discussion/service.js +11 -10
- package/dist/discussion/service.js.map +1 -1
- package/dist/entitlements/events.d.ts +96 -12
- package/dist/entitlements/events.js +21 -4
- package/dist/entitlements/events.js.map +1 -1
- package/dist/entitlements/service.js +1 -0
- package/dist/entitlements/service.js.map +1 -1
- package/dist/identity/events.d.ts +17 -3
- package/dist/identity/events.js +12 -2
- package/dist/identity/events.js.map +1 -1
- package/dist/identity/ports.d.ts +3 -0
- package/dist/identity/service.d.ts +3 -0
- package/dist/identity/service.js +12 -1
- package/dist/identity/service.js.map +1 -1
- package/dist/integrations/events.d.ts +27 -3
- package/dist/integrations/events.js +15 -3
- package/dist/integrations/events.js.map +1 -1
- package/dist/integrations/service.js +1 -1
- package/dist/integrations/service.js.map +1 -1
- package/dist/organizations/events.d.ts +178 -11
- package/dist/organizations/events.js +52 -9
- package/dist/organizations/events.js.map +1 -1
- package/dist/organizations/index.d.ts +3 -3
- package/dist/organizations/members.js.map +1 -1
- package/dist/organizations/ports.d.ts +6 -10
- package/dist/organizations/roles.js.map +1 -1
- package/dist/organizations/service.d.ts +9 -4
- package/dist/organizations/service.js +131 -72
- package/dist/organizations/service.js.map +1 -1
- package/dist/organizations/types.d.ts +2 -2
- package/dist/progress/events.d.ts +34 -2
- package/dist/progress/events.js +15 -2
- package/dist/progress/events.js.map +1 -1
- package/dist/progress/service.d.ts +2 -2
- package/dist/progress/service.js +4 -2
- package/dist/progress/service.js.map +1 -1
- package/dist/reporting/courses/index.d.ts +4 -0
- package/dist/reporting/courses/index.js +2 -0
- package/dist/reporting/courses/model.d.ts +24 -0
- package/dist/reporting/courses/model.js +1 -0
- package/dist/reporting/courses/ports.d.ts +13 -0
- package/dist/reporting/courses/ports.js +1 -0
- package/dist/reporting/courses/service.d.ts +19 -0
- package/dist/reporting/courses/service.js +20 -0
- package/dist/reporting/courses/service.js.map +1 -0
- package/dist/reporting/learn/model.d.ts +2 -2
- package/dist/reporting/learn/ports.d.ts +2 -1
- package/dist/reporting/learn/service.d.ts +2 -1
- package/dist/reporting/learn/service.js +5 -0
- package/dist/reporting/learn/service.js.map +1 -1
- package/dist/reporting/students/index.d.ts +2 -2
- package/dist/reporting/students/model.d.ts +21 -1
- package/dist/reporting/students/ports.d.ts +3 -1
- package/dist/reporting/students/service.d.ts +2 -1
- package/dist/reporting/students/service.js +3 -0
- package/dist/reporting/students/service.js.map +1 -1
- package/dist/shared/events.d.ts +5 -3
- package/dist/shared/events.js +1 -0
- package/dist/shared/events.js.map +1 -1
- package/dist/shared/id.d.ts +1 -0
- package/dist/shared/id.js +1 -0
- package/dist/shared/id.js.map +1 -1
- package/dist/shared/mailer.d.ts +2 -0
- package/dist/shared/mailer.js.map +1 -1
- package/dist/shared/settings.js.map +1 -1
- package/dist/types/automations.d.ts +13 -2
- package/dist/types/content.d.ts +2 -2
- package/dist/types/discussion.d.ts +3 -2
- package/dist/types/email-templates.d.ts +3 -1
- package/dist/types/events.d.ts +3 -3
- package/dist/types/index.d.ts +6 -6
- package/dist/types/organizations.d.ts +2 -2
- package/dist/types/ports.d.ts +1 -1
- package/dist/types/schemas/assets.d.ts +3 -0
- package/dist/types/schemas/assets.js +2 -1
- package/dist/types/schemas/assets.js.map +1 -1
- package/dist/types/schemas/automations.d.ts +71 -4
- package/dist/types/schemas/automations.js +35 -4
- package/dist/types/schemas/automations.js.map +1 -1
- package/dist/types/schemas/content.d.ts +51 -18
- package/dist/types/schemas/content.js +40 -13
- package/dist/types/schemas/content.js.map +1 -1
- package/dist/types/schemas/credentials.js.map +1 -1
- package/dist/types/schemas/discussion.d.ts +10 -2
- package/dist/types/schemas/discussion.js +12 -5
- package/dist/types/schemas/discussion.js.map +1 -1
- package/dist/types/schemas/entitlements.d.ts +8 -2
- package/dist/types/schemas/entitlements.js +10 -4
- package/dist/types/schemas/entitlements.js.map +1 -1
- package/dist/types/schemas/identity.d.ts +4 -4
- package/dist/types/schemas/identity.js +5 -5
- package/dist/types/schemas/identity.js.map +1 -1
- package/dist/types/schemas/index.d.ts +6 -6
- package/dist/types/schemas/index.js +6 -6
- package/dist/types/schemas/integrations.js.map +1 -1
- package/dist/types/schemas/organizations.d.ts +19 -5
- package/dist/types/schemas/organizations.js +12 -7
- package/dist/types/schemas/organizations.js.map +1 -1
- package/dist/types/schemas/outbox.d.ts +1 -0
- package/dist/types/schemas/outbox.js +1 -0
- package/dist/types/schemas/outbox.js.map +1 -1
- package/dist/types/schemas/progress.d.ts +1 -0
- package/dist/types/schemas/progress.js +1 -0
- package/dist/types/schemas/progress.js.map +1 -1
- package/dist/types/schemas/settings.js.map +1 -1
- package/dist/types/schemas/shared.d.ts +2 -1
- package/dist/types/schemas/shared.js +3 -1
- package/dist/types/schemas/shared.js.map +1 -1
- package/dist/types/shared.d.ts +1 -1
- package/package.json +1 -1
package/dist/shared/id.js
CHANGED
package/dist/shared/id.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"id.js","names":[],"sources":["../../src/shared/id.ts"],"sourcesContent":["import KSUID from 'ksuid';\n\n/**\n * Prefixed, KSUID-bodied string ids — `${prefix}_${ksuid}`, e.g. `org_2QZ4mK...`.\n *\n * The body is a real KSUID (27-char base62, 4-byte timestamp + 16 random bytes),\n * so ids are lexicographically time-sortable. The prefix marks the entity type at\n * a glance. A core utility (one implementation, nothing to swap), called directly\n * by core services and used as the Drizzle `.$defaultFn` for every domain id column.\n */\nexport const ID_PREFIXES = {\n organization: 'org',\n user: 'usr',\n student: 'stu',\n orgUser: 'orm',\n invite: 'ivt',\n course: 'crs',\n module: 'mod',\n activity: 'act',\n activityAsset: 'aca',\n download: 'dwn',\n downloadAsset: 'dla',\n asset: 'ast',\n entitlement: 'ent',\n progress: 'prg',\n credential: 'crd',\n connection: 'con',\n event: 'evt',\n automation: 'atm',\n automationRun: 'run',\n comment: 'cmt',\n commentReport: 'crp',\n} as const;\n\nexport type IdType = keyof typeof ID_PREFIXES;\n\n/** A bare KSUID body (27-char base62, time-sortable), no prefix. */\nexport function ksuid(): string {\n return KSUID.randomSync().string;\n}\n\n/** Attach an arbitrary prefix to a fresh KSUID — `${prefix}_${ksuid}`. */\nexport function prefixId(prefix: string): string {\n return `${prefix}_${ksuid()}`;\n}\n\n/** Generate a prefixed, time-sortable id for the given domain entity type. */\nexport function genId(type: IdType): string {\n return prefixId(ID_PREFIXES[type]);\n}\n\n/** True when `value` carries the prefix for `type` (shape check only, not existence). */\nexport function isId(type: IdType, value: string): boolean {\n return value.startsWith(`${ID_PREFIXES[type]}_`);\n}\n"],"mappings":";;;;;;;;;;AAUA,MAAa,cAAc;CACzB,cAAc;CACd,MAAM;CACN,SAAS;CACT,SAAS;CACT,QAAQ;CACR,QAAQ;CACR,QAAQ;CACR,UAAU;CACV,eAAe;CACf,UAAU;CACV,eAAe;CACf,OAAO;CACP,aAAa;CACb,UAAU;CACV,YAAY;CACZ,YAAY;CACZ,OAAO;CACP,YAAY;CACZ,eAAe;CACf,SAAS;CACT,eAAe;AACjB;;AAKA,SAAgB,QAAgB;CAC9B,OAAO,MAAM,WAAW,CAAC,CAAC;AAC5B;;AAGA,SAAgB,SAAS,QAAwB;CAC/C,OAAO,GAAG,OAAO,GAAG,MAAM;AAC5B;;AAGA,SAAgB,MAAM,MAAsB;CAC1C,OAAO,SAAS,YAAY,KAAK;AACnC;;AAGA,SAAgB,KAAK,MAAc,OAAwB;CACzD,OAAO,MAAM,WAAW,GAAG,YAAY,MAAM,EAAE;AACjD"}
|
|
1
|
+
{"version":3,"file":"id.js","names":[],"sources":["../../src/shared/id.ts"],"sourcesContent":["import KSUID from 'ksuid';\n\n/**\n * Prefixed, KSUID-bodied string ids — `${prefix}_${ksuid}`, e.g. `org_2QZ4mK...`.\n *\n * The body is a real KSUID (27-char base62, 4-byte timestamp + 16 random bytes),\n * so ids are lexicographically time-sortable. The prefix marks the entity type at\n * a glance. A core utility (one implementation, nothing to swap), called directly\n * by core services and used as the Drizzle `.$defaultFn` for every domain id column.\n */\nexport const ID_PREFIXES = {\n organization: 'org',\n user: 'usr',\n student: 'stu',\n orgUser: 'orm',\n invite: 'ivt',\n bundle: 'bun',\n course: 'crs',\n module: 'mod',\n activity: 'act',\n activityAsset: 'aca',\n download: 'dwn',\n downloadAsset: 'dla',\n asset: 'ast',\n entitlement: 'ent',\n progress: 'prg',\n credential: 'crd',\n connection: 'con',\n event: 'evt',\n automation: 'atm',\n automationRun: 'run',\n comment: 'cmt',\n commentReport: 'crp',\n} as const;\n\nexport type IdType = keyof typeof ID_PREFIXES;\n\n/** A bare KSUID body (27-char base62, time-sortable), no prefix. */\nexport function ksuid(): string {\n return KSUID.randomSync().string;\n}\n\n/** Attach an arbitrary prefix to a fresh KSUID — `${prefix}_${ksuid}`. */\nexport function prefixId(prefix: string): string {\n return `${prefix}_${ksuid()}`;\n}\n\n/** Generate a prefixed, time-sortable id for the given domain entity type. */\nexport function genId(type: IdType): string {\n return prefixId(ID_PREFIXES[type]);\n}\n\n/** True when `value` carries the prefix for `type` (shape check only, not existence). */\nexport function isId(type: IdType, value: string): boolean {\n return value.startsWith(`${ID_PREFIXES[type]}_`);\n}\n"],"mappings":";;;;;;;;;;AAUA,MAAa,cAAc;CACzB,cAAc;CACd,MAAM;CACN,SAAS;CACT,SAAS;CACT,QAAQ;CACR,QAAQ;CACR,QAAQ;CACR,QAAQ;CACR,UAAU;CACV,eAAe;CACf,UAAU;CACV,eAAe;CACf,OAAO;CACP,aAAa;CACb,UAAU;CACV,YAAY;CACZ,YAAY;CACZ,OAAO;CACP,YAAY;CACZ,eAAe;CACf,SAAS;CACT,eAAe;AACjB;;AAKA,SAAgB,QAAgB;CAC9B,OAAO,MAAM,WAAW,CAAC,CAAC;AAC5B;;AAGA,SAAgB,SAAS,QAAwB;CAC/C,OAAO,GAAG,OAAO,GAAG,MAAM;AAC5B;;AAGA,SAAgB,MAAM,MAAsB;CAC1C,OAAO,SAAS,YAAY,KAAK;AACnC;;AAGA,SAAgB,KAAK,MAAc,OAAwB;CACzD,OAAO,MAAM,WAAW,GAAG,YAAY,MAAM,EAAE;AACjD"}
|
package/dist/shared/mailer.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { EmailSender } from "../types/ports.js";
|
|
2
|
+
import { ContentType } from "../types/schemas/content.js";
|
|
2
3
|
import { EmailTemplateId, EmailTemplateParams, TemplateContext, TemplateRenderer } from "../types/email-templates.js";
|
|
3
4
|
import "./ports.js";
|
|
4
5
|
//#region src/shared/mailer.d.ts
|
|
@@ -9,6 +10,7 @@ interface MailerLookups {
|
|
|
9
10
|
contentInfo(orgId: string, contentId: string): Promise<{
|
|
10
11
|
id: string;
|
|
11
12
|
title: string;
|
|
13
|
+
type: ContentType;
|
|
12
14
|
} | null>;
|
|
13
15
|
}
|
|
14
16
|
declare class Mailer {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mailer.js","names":[],"sources":["../../src/shared/mailer.ts"],"sourcesContent":["// Composes a TemplateRenderer with an EmailSender: callers name a template,\n// the mailer resolves content and hands it to the transport.\nimport type {\n EmailSender,\n EmailTemplateId,\n EmailTemplateParams,\n TemplateContext,\n TemplateRenderer,\n} from './ports.js';\n\n/** Resolves the recipient/content details a template needs when the\n * triggering event carries only row ids. Wired by the app layer. */\nexport interface MailerLookups {\n orgUserEmail(orgId: string, orgUserId: string): Promise<string | null>;\n contentInfo(orgId: string
|
|
1
|
+
{"version":3,"file":"mailer.js","names":[],"sources":["../../src/shared/mailer.ts"],"sourcesContent":["// Composes a TemplateRenderer with an EmailSender: callers name a template,\n// the mailer resolves content and hands it to the transport.\nimport type {\n EmailSender,\n EmailTemplateId,\n EmailTemplateParams,\n TemplateContext,\n TemplateRenderer,\n} from './ports.js';\nimport type { ContentType } from '../types/schemas/content.js';\n\n/** Resolves the recipient/content details a template needs when the\n * triggering event carries only row ids. Wired by the app layer. */\nexport interface MailerLookups {\n orgUserEmail(orgId: string, orgUserId: string): Promise<string | null>;\n contentInfo(\n orgId: string,\n contentId: string,\n ): Promise<{ id: string; title: string; type: ContentType } | null>;\n}\n\nexport class Mailer {\n constructor(\n private readonly templates: TemplateRenderer,\n private readonly email: EmailSender,\n private readonly ctx: TemplateContext,\n ) {}\n\n async send<K extends EmailTemplateId>(\n to: string,\n id: K,\n params: EmailTemplateParams[K],\n ctx?: Partial<TemplateContext>,\n ): Promise<void> {\n const content = await this.templates.render(id, { ...this.ctx, ...ctx }, params);\n await this.email.send({ to, subject: content.subject, text: content.text, html: content.html });\n }\n}\n"],"mappings":";AAqBA,IAAa,SAAb,MAAoB;CAEC;CACA;CACA;CAHnB,YACE,WACA,OACA,KACA;EAHiB,KAAA,YAAA;EACA,KAAA,QAAA;EACA,KAAA,MAAA;CAChB;CAEH,MAAM,KACJ,IACA,IACA,QACA,KACe;EACf,MAAM,UAAU,MAAM,KAAK,UAAU,OAAO,IAAI;GAAE,GAAG,KAAK;GAAK,GAAG;EAAI,GAAG,MAAM;EAC/E,MAAM,KAAK,MAAM,KAAK;GAAE;GAAI,SAAS,QAAQ;GAAS,MAAM,QAAQ;GAAM,MAAM,QAAQ;EAAK,CAAC;CAChG;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.js","names":[],"sources":["../../src/shared/settings.ts"],"sourcesContent":["// Cross-cutting settings: storage, scoping and resolution for every domain's\n// configuration. Not a bounded context: it is a leaf every context may import, and it imports\n// no context.\n\nexport interface SettingsRecord {\n namespace: string;\n scopeId: string;\n value?: Record<string,unknown>;\n}\n\nexport enum SettingsNamespace {\n content = 'content',\n}\n\nexport interface SettingsRepository {\n /** Rows for the given scopes, optionally narrowed to one namespace. */\n find(orgId: string, scopeId: string, namespace?: string): Promise<SettingsRecord[]>;\n /** Deep-merges the patch into the row's value, inserting when absent. Nested\n * objects merge key by key; arrays and scalars are replaced outright. */\n patch(orgId: string, namespace: string, scopeId: string, value: unknown): Promise<SettingsRecord>;\n}\n\nexport class SettingsService {\n constructor(private readonly repo: SettingsRepository) {}\n\n async get<T>(\n orgId: string,\n namespace: string,\n scopeId: string,\n defaultIfNull?: T,\n ): Promise<T | undefined> {\n const rows = await this.repo.find(orgId, scopeId, namespace);\n return (rows[0]?.value as T) ?? defaultIfNull;\n }\n\n async patch<T>(orgId: string, namespace: string, scopeId: string, value: unknown): Promise<T> {\n const row = await this.repo.patch(orgId, namespace, scopeId, value);\n return row.value as T;\n }\n}\n"],"mappings":";AAUA,IAAY,oBAAL,yBAAA,mBAAA;CACL,kBAAA,aAAA;;AACF,EAAA,CAAA,CAAA;AAUA,IAAa,kBAAb,MAA6B;CACE;CAA7B,YAAY,MAA2C;EAA1B,KAAA,OAAA;CAA2B;CAExD,MAAM,IACJ,OACA,WACA,SACA,eACwB;EAExB,QAAQ,MADW,KAAK,KAAK,KAAK,OAAO,SAAS,SAAS,EAAA,CAC9C,EAAE,EAAE,SAAe;CAClC;CAEA,MAAM,MAAS,OAAe,WAAmB,SAAiB,OAA4B;EAE5F,QAAO,MADW,KAAK,KAAK,MAAM,OAAO,WAAW,SAAS,KAAK,EAAA,CACvD;CACb;AACF"}
|
|
1
|
+
{"version":3,"file":"settings.js","names":[],"sources":["../../src/shared/settings.ts"],"sourcesContent":["// Cross-cutting settings: storage, scoping and resolution for every domain's\n// configuration. Not a bounded context: it is a leaf every context may import, and it imports\n// no context.\n\nexport interface SettingsRecord {\n namespace: string;\n scopeId: string;\n value?: Record<string, unknown>;\n}\n\nexport enum SettingsNamespace {\n content = 'content',\n}\n\nexport interface SettingsRepository {\n /** Rows for the given scopes, optionally narrowed to one namespace. */\n find(orgId: string, scopeId: string, namespace?: string): Promise<SettingsRecord[]>;\n /** Deep-merges the patch into the row's value, inserting when absent. Nested\n * objects merge key by key; arrays and scalars are replaced outright. */\n patch(orgId: string, namespace: string, scopeId: string, value: unknown): Promise<SettingsRecord>;\n}\n\nexport class SettingsService {\n constructor(private readonly repo: SettingsRepository) {}\n\n async get<T>(\n orgId: string,\n namespace: string,\n scopeId: string,\n defaultIfNull?: T,\n ): Promise<T | undefined> {\n const rows = await this.repo.find(orgId, scopeId, namespace);\n return (rows[0]?.value as T) ?? defaultIfNull;\n }\n\n async patch<T>(orgId: string, namespace: string, scopeId: string, value: unknown): Promise<T> {\n const row = await this.repo.patch(orgId, namespace, scopeId, value);\n return row.value as T;\n }\n}\n"],"mappings":";AAUA,IAAY,oBAAL,yBAAA,mBAAA;CACL,kBAAA,aAAA;;AACF,EAAA,CAAA,CAAA;AAUA,IAAa,kBAAb,MAA6B;CACE;CAA7B,YAAY,MAA2C;EAA1B,KAAA,OAAA;CAA2B;CAExD,MAAM,IACJ,OACA,WACA,SACA,eACwB;EAExB,QAAQ,MADW,KAAK,KAAK,KAAK,OAAO,SAAS,SAAS,EAAA,CAC9C,EAAE,EAAE,SAAe;CAClC;CAEA,MAAM,MAAS,OAAe,WAAmB,SAAiB,OAA4B;EAE5F,QAAO,MADW,KAAK,KAAK,MAAM,OAAO,WAAW,SAAS,KAAK,EAAA,CACvD;CACb;AACF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DomainEvent } from "./shared.js";
|
|
2
|
-
import { Automation, AutomationAction, AutomationActionResult, AutomationRun, AutomationRunStatus, AutomationRunsQuery, AutomationTrigger, AvailableAction, AvailableActions, AvailableTriggers, CreateAutomationInput, UpdateAutomationInput } from "./schemas/automations.js";
|
|
2
|
+
import { Automation, AutomationAction, AutomationActionResult, AutomationKind, AutomationRun, AutomationRunStatus, AutomationRunsQuery, AutomationTrigger, AutomationsQuery, AvailableAction, AvailableActions, AvailableTriggers, CreateAutomationInput, CreateWebhookInput, CreatedWebhook, DeliverWebhookInput, UpdateAutomationInput, UpdateWebhookInput, Webhook, WebhookSecret } from "./schemas/automations.js";
|
|
3
3
|
//#region src/types/automations.d.ts
|
|
4
4
|
interface AutomationDispatch {
|
|
5
5
|
runId: string;
|
|
@@ -18,6 +18,17 @@ interface AutomationEngine {
|
|
|
18
18
|
start(): Promise<void>;
|
|
19
19
|
stop(): Promise<void>;
|
|
20
20
|
}
|
|
21
|
+
interface WebhookRequest {
|
|
22
|
+
url: string;
|
|
23
|
+
headers: Record<string, string>;
|
|
24
|
+
body: string;
|
|
25
|
+
}
|
|
26
|
+
interface WebhookResponse {
|
|
27
|
+
status: number;
|
|
28
|
+
}
|
|
29
|
+
interface WebhookSender {
|
|
30
|
+
send(request: WebhookRequest): Promise<WebhookResponse>;
|
|
31
|
+
}
|
|
21
32
|
//#endregion
|
|
22
|
-
export { type Automation, type AutomationAction, type AutomationActionResult, AutomationDispatch, AutomationEngine, AutomationExecutor, type AutomationRun, type AutomationRunStatus, type AutomationRunsQuery, type AutomationTrigger, type AvailableAction, type AvailableActions, type AvailableTriggers, type CreateAutomationInput, type UpdateAutomationInput };
|
|
33
|
+
export { type Automation, type AutomationAction, type AutomationActionResult, AutomationDispatch, AutomationEngine, AutomationExecutor, type AutomationKind, type AutomationRun, type AutomationRunStatus, type AutomationRunsQuery, type AutomationTrigger, type AutomationsQuery, type AvailableAction, type AvailableActions, type AvailableTriggers, type CreateAutomationInput, type CreateWebhookInput, type CreatedWebhook, type DeliverWebhookInput, type UpdateAutomationInput, type UpdateWebhookInput, type Webhook, WebhookRequest, WebhookResponse, type WebhookSecret, WebhookSender };
|
|
23
34
|
//# sourceMappingURL=automations.d.ts.map
|
package/dist/types/content.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Activity, ActivityAsset,
|
|
2
|
-
export type { Activity, ActivityAsset,
|
|
1
|
+
import { Activity, ActivityAsset, ActivitySettings, AddDownloadAssetInput, Bundle, BundleItem, ContentItem, ContentType, Course, CourseSettings, CourseStatus, CreateBundleInput, CreateCourseInput, CreateDownloadInput, Download, DownloadAsset, DownloadStatus, ListBundlesQuery, ListCoursesQuery, ListDownloadsQuery, Module, ReorderDownloadAssetsInput, SaveActivityInput, UpdateBundleInput, UpdateCourseInput, UpdateDownloadInput } from "./schemas/content.js";
|
|
2
|
+
export type { Activity, ActivityAsset, ActivitySettings, AddDownloadAssetInput, Bundle, BundleItem, ContentItem, ContentType, Course, CourseSettings, CourseStatus, CreateBundleInput, CreateCourseInput, CreateDownloadInput, Download, DownloadAsset, DownloadStatus, ListBundlesQuery, ListCoursesQuery, ListDownloadsQuery, Module, ReorderDownloadAssetsInput, SaveActivityInput, UpdateBundleInput, UpdateCourseInput, UpdateDownloadInput };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Page } from "./shared.js";
|
|
2
2
|
import { Role } from "./schemas/organizations.js";
|
|
3
3
|
import "./organizations.js";
|
|
4
|
-
import { CommentListItem, CommentReaction, CommentReportSummary, CommentSettings, CommentStatus, CommentView, CommentsConfig, ListCommentsQuery, ReactionCounts, ReactionEmoji } from "./schemas/discussion.js";
|
|
4
|
+
import { ActivityCommentsRule, CommentListItem, CommentReaction, CommentReportSummary, CommentSettings, CommentStatus, CommentView, CommentsConfig, ListCommentsQuery, ReactionCounts, ReactionEmoji } from "./schemas/discussion.js";
|
|
5
5
|
//#region src/types/discussion.d.ts
|
|
6
6
|
interface Comment {
|
|
7
7
|
readonly id: string;
|
|
@@ -30,7 +30,8 @@ interface CommentReport {
|
|
|
30
30
|
readonly reason: string;
|
|
31
31
|
resolvedAt: Date | null;
|
|
32
32
|
readonly createdAt: Date;
|
|
33
|
+
updatedAt: Date;
|
|
33
34
|
}
|
|
34
35
|
//#endregion
|
|
35
|
-
export { Comment, CommentAuthor, type CommentListItem, type CommentReaction, CommentReport, type CommentReportSummary, type CommentSettings, type CommentStatus, type CommentView, type CommentsConfig, type ListCommentsQuery, type Page, type ReactionCounts, type ReactionEmoji };
|
|
36
|
+
export { type ActivityCommentsRule, Comment, CommentAuthor, type CommentListItem, type CommentReaction, CommentReport, type CommentReportSummary, type CommentSettings, type CommentStatus, type CommentView, type CommentsConfig, type ListCommentsQuery, type Page, type ReactionCounts, type ReactionEmoji };
|
|
36
37
|
//# sourceMappingURL=discussion.d.ts.map
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ContentType } from "./schemas/content.js";
|
|
1
2
|
//#region src/types/email-templates.d.ts
|
|
2
3
|
/** Branding threaded into every template. */
|
|
3
4
|
interface TemplateContext {
|
|
@@ -7,7 +8,6 @@ interface TemplateContext {
|
|
|
7
8
|
baseUrl: string;
|
|
8
9
|
/** Origin student-facing links resolve against (the student portal URL). */
|
|
9
10
|
studentPortalUrl: string;
|
|
10
|
-
logoUrl?: string;
|
|
11
11
|
}
|
|
12
12
|
/** A fully rendered email, ready for an EmailSender. */
|
|
13
13
|
interface EmailContent {
|
|
@@ -32,12 +32,14 @@ interface EmailTemplateParams {
|
|
|
32
32
|
passwordReset: {
|
|
33
33
|
resetUrl: string;
|
|
34
34
|
};
|
|
35
|
+
passwordChanged: Record<string, never>;
|
|
35
36
|
emailVerification: {
|
|
36
37
|
verifyUrl: string;
|
|
37
38
|
};
|
|
38
39
|
accessGranted: {
|
|
39
40
|
contentTitle: string;
|
|
40
41
|
contentId: string;
|
|
42
|
+
contentType: ContentType;
|
|
41
43
|
};
|
|
42
44
|
accessRevoked: {
|
|
43
45
|
contentTitle: string;
|
package/dist/types/events.d.ts
CHANGED
|
@@ -12,9 +12,9 @@ type EventParseResult<E extends DomainEvent> = {
|
|
|
12
12
|
readonly success: false;
|
|
13
13
|
readonly error: Error;
|
|
14
14
|
};
|
|
15
|
-
interface EventDefinition<E extends DomainEvent, TMakeData = E[
|
|
16
|
-
readonly type: E[
|
|
17
|
-
readonly version: E[
|
|
15
|
+
interface EventDefinition<E extends DomainEvent, TMakeData = E['data']> {
|
|
16
|
+
readonly type: E['type'];
|
|
17
|
+
readonly version: E['version'];
|
|
18
18
|
make(input: MakeEventInput<TMakeData>): ContractNewDomainEvent<E>;
|
|
19
19
|
is(event: unknown): event is E;
|
|
20
20
|
parse(event: unknown): E;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { ContractNewDomainEvent, DomainEvent, EventMetadata, JsonValue, NewDomainEvent, Page } from "./shared.js";
|
|
2
2
|
import { EventDefinition, EventParseResult, MakeEventInput } from "./events.js";
|
|
3
3
|
import { EmailMessage, EmailSender, Logger, ObjectStorage, PresignDownloadInput, PresignedUpload, StoredObjectInfo } from "./ports.js";
|
|
4
|
+
import { Activity, ActivityAsset, ActivitySettings, AddDownloadAssetInput, Bundle, BundleItem, ContentItem, ContentType, Course, CourseSettings, CourseStatus, CreateBundleInput, CreateCourseInput, CreateDownloadInput, Download, DownloadAsset, DownloadStatus, ListBundlesQuery, ListCoursesQuery, ListDownloadsQuery, Module, ReorderDownloadAssetsInput, SaveActivityInput, UpdateBundleInput, UpdateCourseInput, UpdateDownloadInput } from "./schemas/content.js";
|
|
4
5
|
import { EmailContent, EmailTemplateId, EmailTemplateParams, TemplateContext, TemplateRenderer } from "./email-templates.js";
|
|
5
6
|
import { CreateUserInput, ProvisionUserInput, UpdateUserInput } from "./schemas/identity.js";
|
|
6
7
|
import { AccountProvisioner, ActiveSession, SessionVerifier, User, UserId } from "./identity.js";
|
|
7
|
-
import { AcceptInviteInput, AddOrgUserInput, CreateInviteInput, CreateOrgUserInput, Invite, InviteInput, InviteRole, NewOrganizationInput, OrgUser, OrgUserInput, OrgUserProfile, OrgUserStatus, Organization, OrganizationInput, Role } from "./schemas/organizations.js";
|
|
8
|
+
import { AcceptInviteInput, AddOrgUserInput, CreateInviteInput, CreateOrgUserInput, Invite, InviteInput, InviteRole, NewOrganizationInput, OrgUser, OrgUserInput, OrgUserProfile, OrgUserStatus, Organization, OrganizationInput, Role, UpdateOrgUserInput } from "./schemas/organizations.js";
|
|
8
9
|
import { CreateOrganizationInput, InviteId, OrgUserId, OrganizationId } from "./organizations.js";
|
|
9
|
-
import { Activity, ActivityAsset, ActivityCommentsRule, ActivitySettings, AddDownloadAssetInput, ContentItem, ContentType, Course, CourseSettings, CourseStatus, CreateCourseInput, CreateDownloadInput, Download, DownloadAsset, DownloadStatus, ListCoursesQuery, ListDownloadsQuery, Module, ReorderDownloadAssetsInput, SaveActivityInput, UpdateCourseInput, UpdateDownloadInput } from "./schemas/content.js";
|
|
10
10
|
import "./content.js";
|
|
11
11
|
import { Entitlement, EntitlementStatus, EntitlementsQuery, GrantEntitlementInput } from "./schemas/entitlements.js";
|
|
12
12
|
import "./entitlements.js";
|
|
@@ -16,8 +16,8 @@ import { Asset, AssetKind, AssetStatus, AssetsQuery, DownloadTicket, RequestUplo
|
|
|
16
16
|
import "./assets.js";
|
|
17
17
|
import { ConfigureInput, ConnectInput, Connection, Validation } from "./schemas/integrations.js";
|
|
18
18
|
import { Action, ActionContext, Integration } from "./integrations.js";
|
|
19
|
-
import { Automation, AutomationAction, AutomationActionResult, AutomationRun, AutomationRunStatus, AutomationRunsQuery, AutomationTrigger, AvailableAction, AvailableActions, AvailableTriggers, CreateAutomationInput, UpdateAutomationInput } from "./schemas/automations.js";
|
|
20
|
-
import { AutomationDispatch, AutomationEngine, AutomationExecutor } from "./automations.js";
|
|
21
|
-
import { CommentListItem, CommentReaction, CommentReportSummary, CommentSettings, CommentStatus, CommentView, CommentsConfig, ListCommentsQuery, ReactionCounts, ReactionEmoji } from "./schemas/discussion.js";
|
|
19
|
+
import { Automation, AutomationAction, AutomationActionResult, AutomationKind, AutomationRun, AutomationRunStatus, AutomationRunsQuery, AutomationTrigger, AutomationsQuery, AvailableAction, AvailableActions, AvailableTriggers, CreateAutomationInput, CreateWebhookInput, CreatedWebhook, DeliverWebhookInput, UpdateAutomationInput, UpdateWebhookInput, Webhook, WebhookSecret } from "./schemas/automations.js";
|
|
20
|
+
import { AutomationDispatch, AutomationEngine, AutomationExecutor, WebhookRequest, WebhookResponse, WebhookSender } from "./automations.js";
|
|
21
|
+
import { ActivityCommentsRule, CommentListItem, CommentReaction, CommentReportSummary, CommentSettings, CommentStatus, CommentView, CommentsConfig, ListCommentsQuery, ReactionCounts, ReactionEmoji } from "./schemas/discussion.js";
|
|
22
22
|
import { Comment, CommentAuthor, CommentReport } from "./discussion.js";
|
|
23
|
-
export { type AcceptInviteInput, AccountProvisioner, Action, ActionContext, ActiveSession, type Activity, type ActivityAsset, type ActivityCommentsRule, type ActivitySettings, type AddDownloadAssetInput, type AddOrgUserInput, type Asset, type AssetKind, type AssetStatus, type AssetsQuery, type Automation, type AutomationAction, type AutomationActionResult, AutomationDispatch, AutomationEngine, AutomationExecutor, type AutomationRun, type AutomationRunStatus, type AutomationRunsQuery, type AutomationTrigger, type AvailableAction, type AvailableActions, type AvailableTriggers, Comment, CommentAuthor, type CommentListItem, type CommentReaction, CommentReport, type CommentReportSummary, type CommentSettings, type CommentStatus, type CommentView, type CommentsConfig, type ConfigureInput, type ConnectInput, type Connection, type ContentItem, type ContentType, ContractNewDomainEvent, type Course, type CourseSettings, type CourseStatus, type CreateAutomationInput, type CreateCourseInput, type CreateDownloadInput, type CreateInviteInput, type CreateOrgUserInput, CreateOrganizationInput, type CreateUserInput, DomainEvent, type Download, type DownloadAsset, type DownloadStatus, type DownloadTicket, EmailContent, EmailMessage, EmailSender, EmailTemplateId, EmailTemplateParams, type Entitlement, type EntitlementStatus, type EntitlementsQuery, EventDefinition, EventMetadata, EventParseResult, type GrantEntitlementInput, Integration, type Invite, InviteId, type InviteInput, type InviteRole, JsonValue, type ListCommentsQuery, type ListCoursesQuery, type ListDownloadsQuery, Logger, MakeEventInput, type Module, NewDomainEvent, type NewOrganizationInput, ObjectStorage, type OrgUser, OrgUserId, type OrgUserInput, type OrgUserProfile, type OrgUserStatus, type Organization, OrganizationId, type OrganizationInput, Page, PresignDownloadInput, PresignedUpload, ProgressId, type ProgressRecord, type ProgressRecordInput, type ProgressReportItem, type ProgressTarget, type ProgressTargetType, type ProvisionUserInput, type ReactionCounts, type ReactionEmoji, type ReorderDownloadAssetsInput, type ReportProgressInput, type RequestUploadInput, type Role, type SaveActivityInput, SessionVerifier, StoredObjectInfo, TemplateContext, TemplateRenderer, type UpdateAutomationInput, type UpdateCourseInput, type UpdateDownloadInput, type UpdateUserInput, type UploadTicket, User, UserId, type Validation };
|
|
23
|
+
export { type AcceptInviteInput, AccountProvisioner, Action, ActionContext, ActiveSession, type Activity, type ActivityAsset, type ActivityCommentsRule, type ActivitySettings, type AddDownloadAssetInput, type AddOrgUserInput, type Asset, type AssetKind, type AssetStatus, type AssetsQuery, type Automation, type AutomationAction, type AutomationActionResult, AutomationDispatch, AutomationEngine, AutomationExecutor, type AutomationKind, type AutomationRun, type AutomationRunStatus, type AutomationRunsQuery, type AutomationTrigger, type AutomationsQuery, type AvailableAction, type AvailableActions, type AvailableTriggers, type Bundle, type BundleItem, Comment, CommentAuthor, type CommentListItem, type CommentReaction, CommentReport, type CommentReportSummary, type CommentSettings, type CommentStatus, type CommentView, type CommentsConfig, type ConfigureInput, type ConnectInput, type Connection, type ContentItem, type ContentType, ContractNewDomainEvent, type Course, type CourseSettings, type CourseStatus, type CreateAutomationInput, type CreateBundleInput, type CreateCourseInput, type CreateDownloadInput, type CreateInviteInput, type CreateOrgUserInput, CreateOrganizationInput, type CreateUserInput, type CreateWebhookInput, type CreatedWebhook, type DeliverWebhookInput, DomainEvent, type Download, type DownloadAsset, type DownloadStatus, type DownloadTicket, EmailContent, EmailMessage, EmailSender, EmailTemplateId, EmailTemplateParams, type Entitlement, type EntitlementStatus, type EntitlementsQuery, EventDefinition, EventMetadata, EventParseResult, type GrantEntitlementInput, Integration, type Invite, InviteId, type InviteInput, type InviteRole, JsonValue, type ListBundlesQuery, type ListCommentsQuery, type ListCoursesQuery, type ListDownloadsQuery, Logger, MakeEventInput, type Module, NewDomainEvent, type NewOrganizationInput, ObjectStorage, type OrgUser, OrgUserId, type OrgUserInput, type OrgUserProfile, type OrgUserStatus, type Organization, OrganizationId, type OrganizationInput, Page, PresignDownloadInput, PresignedUpload, ProgressId, type ProgressRecord, type ProgressRecordInput, type ProgressReportItem, type ProgressTarget, type ProgressTargetType, type ProvisionUserInput, type ReactionCounts, type ReactionEmoji, type ReorderDownloadAssetsInput, type ReportProgressInput, type RequestUploadInput, type Role, type SaveActivityInput, SessionVerifier, StoredObjectInfo, TemplateContext, TemplateRenderer, type UpdateAutomationInput, type UpdateBundleInput, type UpdateCourseInput, type UpdateDownloadInput, type UpdateOrgUserInput, type UpdateUserInput, type UpdateWebhookInput, type UploadTicket, User, UserId, type Validation, type Webhook, WebhookRequest, WebhookResponse, type WebhookSecret, WebhookSender };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AcceptInviteInput, AddOrgUserInput, CreateInviteInput, CreateOrgUserInput, Invite, InviteInput, InviteRole, NewOrganizationInput, OrgUser, OrgUserInput, OrgUserProfile, OrgUserStatus, Organization, OrganizationInput, Role } from "./schemas/organizations.js";
|
|
1
|
+
import { AcceptInviteInput, AddOrgUserInput, CreateInviteInput, CreateOrgUserInput, Invite, InviteInput, InviteRole, NewOrganizationInput, OrgUser, OrgUserInput, OrgUserProfile, OrgUserStatus, Organization, OrganizationInput, Role, UpdateOrgUserInput } from "./schemas/organizations.js";
|
|
2
2
|
//#region src/types/organizations.d.ts
|
|
3
3
|
type OrganizationId = string;
|
|
4
4
|
type OrgUserId = string;
|
|
@@ -11,5 +11,5 @@ interface CreateOrganizationInput {
|
|
|
11
11
|
ownerId: string;
|
|
12
12
|
}
|
|
13
13
|
//#endregion
|
|
14
|
-
export { type AcceptInviteInput, type AddOrgUserInput, type CreateInviteInput, type CreateOrgUserInput, CreateOrganizationInput, type Invite, InviteId, type InviteInput, type InviteRole, type NewOrganizationInput, type OrgUser, OrgUserId, type OrgUserInput, type OrgUserProfile, type OrgUserStatus, type Organization, OrganizationId, type OrganizationInput, type Role };
|
|
14
|
+
export { type AcceptInviteInput, type AddOrgUserInput, type CreateInviteInput, type CreateOrgUserInput, CreateOrganizationInput, type Invite, InviteId, type InviteInput, type InviteRole, type NewOrganizationInput, type OrgUser, OrgUserId, type OrgUserInput, type OrgUserProfile, type OrgUserStatus, type Organization, OrganizationId, type OrganizationInput, type Role, type UpdateOrgUserInput };
|
|
15
15
|
//# sourceMappingURL=organizations.d.ts.map
|
package/dist/types/ports.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ interface EmailSender {
|
|
|
20
20
|
/** A presigned URL the browser uses to PUT a file straight to the store. */
|
|
21
21
|
interface PresignedUpload {
|
|
22
22
|
url: string;
|
|
23
|
-
method:
|
|
23
|
+
method: 'PUT';
|
|
24
24
|
key: string;
|
|
25
25
|
expiresInSeconds: number;
|
|
26
26
|
/** Headers the client must send on the PUT (e.g. Content-Type). */
|
|
@@ -29,6 +29,7 @@ declare const assetSchema: z.ZodObject<{
|
|
|
29
29
|
}>;
|
|
30
30
|
uploadedBy: z.ZodString;
|
|
31
31
|
createdAt: z.ZodCoercedDate<unknown>;
|
|
32
|
+
updatedAt: z.ZodCoercedDate<unknown>;
|
|
32
33
|
}, z.core.$strict>;
|
|
33
34
|
type Asset = z.output<typeof assetSchema>;
|
|
34
35
|
type AssetInput = z.input<typeof assetSchema>;
|
|
@@ -62,6 +63,7 @@ declare const uploadTicketSchema: z.ZodObject<{
|
|
|
62
63
|
}>;
|
|
63
64
|
uploadedBy: z.ZodString;
|
|
64
65
|
createdAt: z.ZodCoercedDate<unknown>;
|
|
66
|
+
updatedAt: z.ZodCoercedDate<unknown>;
|
|
65
67
|
}, z.core.$strict>;
|
|
66
68
|
uploadUrl: z.ZodString;
|
|
67
69
|
method: z.ZodLiteral<"PUT">;
|
|
@@ -89,6 +91,7 @@ declare const downloadTicketSchema: z.ZodObject<{
|
|
|
89
91
|
}>;
|
|
90
92
|
uploadedBy: z.ZodString;
|
|
91
93
|
createdAt: z.ZodCoercedDate<unknown>;
|
|
94
|
+
updatedAt: z.ZodCoercedDate<unknown>;
|
|
92
95
|
}, z.core.$strict>;
|
|
93
96
|
}, z.core.$strict>;
|
|
94
97
|
type DownloadTicket = z.infer<typeof downloadTicketSchema>;
|
|
@@ -17,7 +17,8 @@ const assetSchema = z.object({
|
|
|
17
17
|
size: z.number().int().min(0),
|
|
18
18
|
status: assetStatusSchema,
|
|
19
19
|
uploadedBy: idSchema,
|
|
20
|
-
createdAt: z.coerce.date()
|
|
20
|
+
createdAt: z.coerce.date(),
|
|
21
|
+
updatedAt: z.coerce.date()
|
|
21
22
|
}).strict();
|
|
22
23
|
const requestUploadInputSchema = z.object({
|
|
23
24
|
uploadedBy: idSchema,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assets.js","names":[],"sources":["../../../src/types/schemas/assets.ts"],"sourcesContent":["import { z } from
|
|
1
|
+
{"version":3,"file":"assets.js","names":[],"sources":["../../../src/types/schemas/assets.ts"],"sourcesContent":["import { z } from 'zod';\nimport { idSchema } from './shared.js';\n\nexport const assetKindSchema = z.enum(['video', 'download', 'content']);\nexport type AssetKind = z.infer<typeof assetKindSchema>;\n\nexport const assetStatusSchema = z.enum(['pending', 'ready']);\nexport type AssetStatus = z.infer<typeof assetStatusSchema>;\n\nexport const assetSchema = z\n .object({\n orgId: idSchema,\n id: idSchema,\n key: z.string().trim().min(1),\n kind: assetKindSchema,\n filename: z.string().trim().min(1),\n contentType: z.string().trim().min(1),\n size: z.number().int().min(0),\n status: assetStatusSchema,\n uploadedBy: idSchema,\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n })\n .strict();\nexport type Asset = z.output<typeof assetSchema>;\nexport type AssetInput = z.input<typeof assetSchema>;\n\nexport const requestUploadInputSchema = z\n .object({\n uploadedBy: idSchema,\n filename: z.string().trim().min(1),\n contentType: z.string().trim().min(1),\n kind: assetKindSchema,\n })\n .strict();\nexport type RequestUploadInput = z.infer<typeof requestUploadInputSchema>;\n\nexport const uploadTicketSchema = z\n .object({\n asset: assetSchema,\n uploadUrl: z.string().trim().min(1),\n method: z.literal('PUT'),\n expiresInSeconds: z.number().int().positive(),\n headers: z.record(z.string(), z.string()),\n })\n .strict();\nexport type UploadTicket = z.infer<typeof uploadTicketSchema>;\n\nexport const downloadTicketSchema = z\n .object({\n url: z.string().trim().min(1),\n asset: assetSchema,\n })\n .strict();\nexport type DownloadTicket = z.infer<typeof downloadTicketSchema>;\n\nexport const assetsQuerySchema = z\n .object({\n page: z.number().int().min(1),\n pageSize: z.number().int().min(1),\n search: z.string().optional(),\n sort: z.string().optional(),\n kind: assetKindSchema.optional(),\n })\n .strict();\nexport type AssetsQuery = z.infer<typeof assetsQuerySchema>;\n"],"mappings":";;;AAGA,MAAa,kBAAkB,EAAE,KAAK;CAAC;CAAS;CAAY;AAAS,CAAC;AAGtE,MAAa,oBAAoB,EAAE,KAAK,CAAC,WAAW,OAAO,CAAC;AAG5D,MAAa,cAAc,EACxB,OAAO;CACN,OAAO;CACP,IAAI;CACJ,KAAK,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC;CAC5B,MAAM;CACN,UAAU,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC;CACjC,aAAa,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC;CACpC,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC;CAC5B,QAAQ;CACR,YAAY;CACZ,WAAW,EAAE,OAAO,KAAK;CACzB,WAAW,EAAE,OAAO,KAAK;AAC3B,CAAC,CAAC,CACD,OAAO;AAIV,MAAa,2BAA2B,EACrC,OAAO;CACN,YAAY;CACZ,UAAU,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC;CACjC,aAAa,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC;CACpC,MAAM;AACR,CAAC,CAAC,CACD,OAAO;AAGV,MAAa,qBAAqB,EAC/B,OAAO;CACN,OAAO;CACP,WAAW,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC;CAClC,QAAQ,EAAE,QAAQ,KAAK;CACvB,kBAAkB,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS;CAC5C,SAAS,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,OAAO,CAAC;AAC1C,CAAC,CAAC,CACD,OAAO;AAGV,MAAa,uBAAuB,EACjC,OAAO;CACN,KAAK,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC;CAC5B,OAAO;AACT,CAAC,CAAC,CACD,OAAO;AAGV,MAAa,oBAAoB,EAC9B,OAAO;CACN,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC;CAC5B,UAAU,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC;CAChC,QAAQ,EAAE,OAAO,CAAC,CAAC,SAAS;CAC5B,MAAM,EAAE,OAAO,CAAC,CAAC,SAAS;CAC1B,MAAM,gBAAgB,SAAS;AACjC,CAAC,CAAC,CACD,OAAO"}
|
|
@@ -3,6 +3,12 @@ import { z } from "zod";
|
|
|
3
3
|
//#region src/types/schemas/automations.d.ts
|
|
4
4
|
declare const automationTriggerSchema: z.ZodString;
|
|
5
5
|
type AutomationTrigger = z.infer<typeof automationTriggerSchema>;
|
|
6
|
+
declare const automationTriggersSchema: z.ZodArray<z.ZodString>;
|
|
7
|
+
declare const automationKindSchema: z.ZodEnum<{
|
|
8
|
+
workflow: "workflow";
|
|
9
|
+
webhook: "webhook";
|
|
10
|
+
}>;
|
|
11
|
+
type AutomationKind = z.infer<typeof automationKindSchema>;
|
|
6
12
|
declare const automationActionSchema: z.ZodObject<{
|
|
7
13
|
type: z.ZodString;
|
|
8
14
|
input: z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
|
|
@@ -12,8 +18,12 @@ declare const automationSchema: z.ZodObject<{
|
|
|
12
18
|
orgId: z.ZodString;
|
|
13
19
|
id: z.ZodString;
|
|
14
20
|
name: z.ZodString;
|
|
21
|
+
kind: z.ZodEnum<{
|
|
22
|
+
workflow: "workflow";
|
|
23
|
+
webhook: "webhook";
|
|
24
|
+
}>;
|
|
15
25
|
description: z.ZodNullable<z.ZodString>;
|
|
16
|
-
|
|
26
|
+
triggers: z.ZodArray<z.ZodString>;
|
|
17
27
|
actions: z.ZodArray<z.ZodObject<{
|
|
18
28
|
type: z.ZodString;
|
|
19
29
|
input: z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
|
|
@@ -27,7 +37,7 @@ type AutomationInput = z.input<typeof automationSchema>;
|
|
|
27
37
|
declare const createAutomationInputSchema: z.ZodObject<{
|
|
28
38
|
name: z.ZodString;
|
|
29
39
|
description: z.ZodOptional<z.ZodString>;
|
|
30
|
-
|
|
40
|
+
triggers: z.ZodArray<z.ZodString>;
|
|
31
41
|
actions: z.ZodArray<z.ZodObject<{
|
|
32
42
|
type: z.ZodString;
|
|
33
43
|
input: z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
|
|
@@ -37,7 +47,7 @@ type CreateAutomationInput = z.infer<typeof createAutomationInputSchema>;
|
|
|
37
47
|
declare const updateAutomationInputSchema: z.ZodObject<{
|
|
38
48
|
name: z.ZodOptional<z.ZodString>;
|
|
39
49
|
description: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
40
|
-
|
|
50
|
+
triggers: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
41
51
|
actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
42
52
|
type: z.ZodString;
|
|
43
53
|
input: z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
|
|
@@ -45,6 +55,13 @@ declare const updateAutomationInputSchema: z.ZodObject<{
|
|
|
45
55
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
46
56
|
}, z.core.$strict>;
|
|
47
57
|
type UpdateAutomationInput = z.infer<typeof updateAutomationInputSchema>;
|
|
58
|
+
declare const automationsQuerySchema: z.ZodObject<{
|
|
59
|
+
kind: z.ZodOptional<z.ZodEnum<{
|
|
60
|
+
workflow: "workflow";
|
|
61
|
+
webhook: "webhook";
|
|
62
|
+
}>>;
|
|
63
|
+
}, z.core.$strict>;
|
|
64
|
+
type AutomationsQuery = z.infer<typeof automationsQuerySchema>;
|
|
48
65
|
declare const automationRunsQuerySchema: z.ZodObject<{
|
|
49
66
|
page: z.ZodNumber;
|
|
50
67
|
pageSize: z.ZodNumber;
|
|
@@ -95,6 +112,8 @@ declare const automationRunSchema: z.ZodObject<{
|
|
|
95
112
|
}, z.core.$strict>>;
|
|
96
113
|
startedAt: z.ZodCoercedDate<unknown>;
|
|
97
114
|
finishedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
115
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
116
|
+
updatedAt: z.ZodCoercedDate<unknown>;
|
|
98
117
|
}, z.core.$strict>;
|
|
99
118
|
type AutomationRun = z.output<typeof automationRunSchema>;
|
|
100
119
|
type AutomationRunInput = z.input<typeof automationRunSchema>;
|
|
@@ -109,10 +128,58 @@ type AvailableActions = AvailableAction[];
|
|
|
109
128
|
declare const availableTriggersSchema: z.ZodObject<{
|
|
110
129
|
triggers: z.ZodArray<z.ZodObject<{
|
|
111
130
|
type: z.ZodString;
|
|
131
|
+
label: z.ZodString;
|
|
132
|
+
category: z.ZodString;
|
|
112
133
|
description: z.ZodString;
|
|
113
134
|
}, z.core.$strict>>;
|
|
114
135
|
}, z.core.$strict>;
|
|
115
136
|
type AvailableTriggers = z.infer<typeof availableTriggersSchema>;
|
|
137
|
+
declare const deliverWebhookInputSchema: z.ZodObject<{
|
|
138
|
+
url: z.ZodString;
|
|
139
|
+
secretRef: z.ZodString;
|
|
140
|
+
}, z.core.$strict>;
|
|
141
|
+
type DeliverWebhookInput = z.infer<typeof deliverWebhookInputSchema>;
|
|
142
|
+
declare const webhookUrlSchema: z.ZodURL;
|
|
143
|
+
declare const webhookSchema: z.ZodObject<{
|
|
144
|
+
orgId: z.ZodString;
|
|
145
|
+
id: z.ZodString;
|
|
146
|
+
url: z.ZodString;
|
|
147
|
+
events: z.ZodArray<z.ZodString>;
|
|
148
|
+
description: z.ZodNullable<z.ZodString>;
|
|
149
|
+
enabled: z.ZodBoolean;
|
|
150
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
151
|
+
updatedAt: z.ZodCoercedDate<unknown>;
|
|
152
|
+
}, z.core.$strict>;
|
|
153
|
+
type Webhook = z.output<typeof webhookSchema>;
|
|
154
|
+
declare const createWebhookInputSchema: z.ZodObject<{
|
|
155
|
+
url: z.ZodURL;
|
|
156
|
+
events: z.ZodArray<z.ZodString>;
|
|
157
|
+
description: z.ZodOptional<z.ZodString>;
|
|
158
|
+
}, z.core.$strict>;
|
|
159
|
+
type CreateWebhookInput = z.infer<typeof createWebhookInputSchema>;
|
|
160
|
+
declare const updateWebhookInputSchema: z.ZodObject<{
|
|
161
|
+
url: z.ZodOptional<z.ZodURL>;
|
|
162
|
+
events: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
163
|
+
description: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
164
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
165
|
+
}, z.core.$strict>;
|
|
166
|
+
type UpdateWebhookInput = z.infer<typeof updateWebhookInputSchema>;
|
|
167
|
+
declare const webhookSecretSchema: z.ZodObject<{
|
|
168
|
+
secret: z.ZodString;
|
|
169
|
+
}, z.core.$strict>;
|
|
170
|
+
type WebhookSecret = z.infer<typeof webhookSecretSchema>;
|
|
171
|
+
declare const createdWebhookSchema: z.ZodObject<{
|
|
172
|
+
orgId: z.ZodString;
|
|
173
|
+
id: z.ZodString;
|
|
174
|
+
url: z.ZodString;
|
|
175
|
+
events: z.ZodArray<z.ZodString>;
|
|
176
|
+
description: z.ZodNullable<z.ZodString>;
|
|
177
|
+
enabled: z.ZodBoolean;
|
|
178
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
179
|
+
updatedAt: z.ZodCoercedDate<unknown>;
|
|
180
|
+
secret: z.ZodString;
|
|
181
|
+
}, z.core.$strict>;
|
|
182
|
+
type CreatedWebhook = z.output<typeof createdWebhookSchema>;
|
|
116
183
|
//#endregion
|
|
117
|
-
export { Automation, AutomationAction, AutomationActionResult, AutomationInput, AutomationRun, AutomationRunInput, AutomationRunStatus, AutomationRunsQuery, AutomationTrigger, AvailableAction, AvailableActions, AvailableTriggers, CreateAutomationInput, UpdateAutomationInput, automationActionResultSchema, automationActionSchema, automationRunSchema, automationRunStatusSchema, automationRunsQuerySchema, automationSchema, automationTriggerSchema, availableActionSchema, availableTriggersSchema, createAutomationInputSchema, updateAutomationInputSchema };
|
|
184
|
+
export { Automation, AutomationAction, AutomationActionResult, AutomationInput, AutomationKind, AutomationRun, AutomationRunInput, AutomationRunStatus, AutomationRunsQuery, AutomationTrigger, AutomationsQuery, AvailableAction, AvailableActions, AvailableTriggers, CreateAutomationInput, CreateWebhookInput, CreatedWebhook, DeliverWebhookInput, UpdateAutomationInput, UpdateWebhookInput, Webhook, WebhookSecret, automationActionResultSchema, automationActionSchema, automationKindSchema, automationRunSchema, automationRunStatusSchema, automationRunsQuerySchema, automationSchema, automationTriggerSchema, automationTriggersSchema, automationsQuerySchema, availableActionSchema, availableTriggersSchema, createAutomationInputSchema, createWebhookInputSchema, createdWebhookSchema, deliverWebhookInputSchema, updateAutomationInputSchema, updateWebhookInputSchema, webhookSchema, webhookSecretSchema, webhookUrlSchema };
|
|
118
185
|
//# sourceMappingURL=automations.d.ts.map
|
|
@@ -2,6 +2,8 @@ import { domainEventSchema, idSchema, jsonRecordSchema } from "./shared.js";
|
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
//#region src/types/schemas/automations.ts
|
|
4
4
|
const automationTriggerSchema = z.string().trim().min(1);
|
|
5
|
+
const automationTriggersSchema = z.array(automationTriggerSchema).min(1);
|
|
6
|
+
const automationKindSchema = z.enum(["workflow", "webhook"]);
|
|
5
7
|
const automationActionSchema = z.object({
|
|
6
8
|
type: z.string().trim().min(1),
|
|
7
9
|
input: jsonRecordSchema
|
|
@@ -10,8 +12,9 @@ const automationSchema = z.object({
|
|
|
10
12
|
orgId: idSchema,
|
|
11
13
|
id: idSchema,
|
|
12
14
|
name: z.string(),
|
|
15
|
+
kind: automationKindSchema,
|
|
13
16
|
description: z.string().nullable(),
|
|
14
|
-
|
|
17
|
+
triggers: z.array(automationTriggerSchema),
|
|
15
18
|
actions: z.array(automationActionSchema),
|
|
16
19
|
enabled: z.boolean(),
|
|
17
20
|
createdAt: z.coerce.date(),
|
|
@@ -20,10 +23,11 @@ const automationSchema = z.object({
|
|
|
20
23
|
const createAutomationInputSchema = z.object({
|
|
21
24
|
name: z.string(),
|
|
22
25
|
description: z.string().optional(),
|
|
23
|
-
|
|
26
|
+
triggers: automationTriggersSchema,
|
|
24
27
|
actions: z.array(automationActionSchema)
|
|
25
28
|
}).strict();
|
|
26
29
|
const updateAutomationInputSchema = createAutomationInputSchema.partial().extend({ enabled: z.boolean().optional() });
|
|
30
|
+
const automationsQuerySchema = z.object({ kind: automationKindSchema.optional() }).strict();
|
|
27
31
|
const automationRunsQuerySchema = z.object({
|
|
28
32
|
page: z.number().int().min(1),
|
|
29
33
|
pageSize: z.number().int().min(1),
|
|
@@ -55,7 +59,9 @@ const automationRunSchema = z.object({
|
|
|
55
59
|
status: automationRunStatusSchema,
|
|
56
60
|
actionResults: z.array(automationActionResultSchema),
|
|
57
61
|
startedAt: z.coerce.date(),
|
|
58
|
-
finishedAt: z.coerce.date().nullable()
|
|
62
|
+
finishedAt: z.coerce.date().nullable(),
|
|
63
|
+
createdAt: z.coerce.date(),
|
|
64
|
+
updatedAt: z.coerce.date()
|
|
59
65
|
}).strict();
|
|
60
66
|
const availableActionSchema = z.object({
|
|
61
67
|
type: z.string().trim().min(1),
|
|
@@ -65,9 +71,34 @@ const availableActionSchema = z.object({
|
|
|
65
71
|
}).strict();
|
|
66
72
|
const availableTriggersSchema = z.object({ triggers: z.array(z.object({
|
|
67
73
|
type: z.string().trim().min(1),
|
|
74
|
+
label: z.string().min(1),
|
|
75
|
+
category: z.string().min(1),
|
|
68
76
|
description: z.string()
|
|
69
77
|
}).strict()) }).strict();
|
|
78
|
+
const deliverWebhookInputSchema = z.object({
|
|
79
|
+
url: z.string(),
|
|
80
|
+
secretRef: idSchema
|
|
81
|
+
}).strict();
|
|
82
|
+
const webhookUrlSchema = z.url({ protocol: /^https?$/ });
|
|
83
|
+
const webhookSchema = z.object({
|
|
84
|
+
orgId: idSchema,
|
|
85
|
+
id: idSchema,
|
|
86
|
+
url: z.string(),
|
|
87
|
+
events: z.array(automationTriggerSchema),
|
|
88
|
+
description: z.string().nullable(),
|
|
89
|
+
enabled: z.boolean(),
|
|
90
|
+
createdAt: z.coerce.date(),
|
|
91
|
+
updatedAt: z.coerce.date()
|
|
92
|
+
}).strict();
|
|
93
|
+
const createWebhookInputSchema = z.object({
|
|
94
|
+
url: webhookUrlSchema,
|
|
95
|
+
events: automationTriggersSchema,
|
|
96
|
+
description: z.string().optional()
|
|
97
|
+
}).strict();
|
|
98
|
+
const updateWebhookInputSchema = createWebhookInputSchema.partial().extend({ enabled: z.boolean().optional() });
|
|
99
|
+
const webhookSecretSchema = z.object({ secret: z.string() }).strict();
|
|
100
|
+
const createdWebhookSchema = webhookSchema.extend({ secret: z.string() }).strict();
|
|
70
101
|
//#endregion
|
|
71
|
-
export { automationActionResultSchema, automationActionSchema, automationRunSchema, automationRunStatusSchema, automationRunsQuerySchema, automationSchema, automationTriggerSchema, availableActionSchema, availableTriggersSchema, createAutomationInputSchema, updateAutomationInputSchema };
|
|
102
|
+
export { automationActionResultSchema, automationActionSchema, automationKindSchema, automationRunSchema, automationRunStatusSchema, automationRunsQuerySchema, automationSchema, automationTriggerSchema, automationTriggersSchema, automationsQuerySchema, availableActionSchema, availableTriggersSchema, createAutomationInputSchema, createWebhookInputSchema, createdWebhookSchema, deliverWebhookInputSchema, updateAutomationInputSchema, updateWebhookInputSchema, webhookSchema, webhookSecretSchema, webhookUrlSchema };
|
|
72
103
|
|
|
73
104
|
//# sourceMappingURL=automations.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"automations.js","names":[],"sources":["../../../src/types/schemas/automations.ts"],"sourcesContent":["import { z } from
|
|
1
|
+
{"version":3,"file":"automations.js","names":[],"sources":["../../../src/types/schemas/automations.ts"],"sourcesContent":["import { z } from 'zod';\nimport { domainEventSchema, idSchema, jsonRecordSchema } from './shared.js';\n\nexport const automationTriggerSchema = z.string().trim().min(1);\nexport type AutomationTrigger = z.infer<typeof automationTriggerSchema>;\n\nexport const automationTriggersSchema = z.array(automationTriggerSchema).min(1);\n\nexport const automationKindSchema = z.enum(['workflow', 'webhook']);\nexport type AutomationKind = z.infer<typeof automationKindSchema>;\n\nexport const automationActionSchema = z\n .object({\n type: z.string().trim().min(1),\n input: jsonRecordSchema,\n })\n .strict();\nexport type AutomationAction = z.infer<typeof automationActionSchema>;\n\nexport const automationSchema = z\n .object({\n orgId: idSchema,\n id: idSchema,\n name: z.string(),\n kind: automationKindSchema,\n description: z.string().nullable(),\n triggers: z.array(automationTriggerSchema),\n actions: z.array(automationActionSchema),\n enabled: z.boolean(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n })\n .strict();\nexport type Automation = z.output<typeof automationSchema>;\nexport type AutomationInput = z.input<typeof automationSchema>;\n\nexport const createAutomationInputSchema = z\n .object({\n name: z.string(),\n description: z.string().optional(),\n triggers: automationTriggersSchema,\n actions: z.array(automationActionSchema),\n })\n .strict();\nexport type CreateAutomationInput = z.infer<typeof createAutomationInputSchema>;\n\nexport const updateAutomationInputSchema = createAutomationInputSchema.partial().extend({\n enabled: z.boolean().optional(),\n});\nexport type UpdateAutomationInput = z.infer<typeof updateAutomationInputSchema>;\n\nexport const automationsQuerySchema = z\n .object({\n kind: automationKindSchema.optional(),\n })\n .strict();\nexport type AutomationsQuery = z.infer<typeof automationsQuerySchema>;\n\nexport const automationRunsQuerySchema = z\n .object({\n page: z.number().int().min(1),\n pageSize: z.number().int().min(1),\n status: z.enum(['running', 'completed', 'failed']).optional(),\n sort: z.string().optional(),\n })\n .strict();\nexport type AutomationRunsQuery = z.infer<typeof automationRunsQuerySchema>;\n\nexport const automationRunStatusSchema = z.enum(['running', 'completed', 'failed']);\nexport type AutomationRunStatus = z.infer<typeof automationRunStatusSchema>;\n\nexport const automationActionResultSchema = z\n .object({\n index: z.number().int().min(0),\n type: z.string().trim().min(1),\n status: z.enum(['completed', 'failed']),\n error: z.string().optional(),\n })\n .strict();\nexport type AutomationActionResult = z.infer<typeof automationActionResultSchema>;\n\nexport const automationRunSchema = z\n .object({\n orgId: idSchema,\n id: idSchema,\n automationId: idSchema,\n trigger: automationTriggerSchema,\n eventId: idSchema,\n event: domainEventSchema,\n status: automationRunStatusSchema,\n actionResults: z.array(automationActionResultSchema),\n startedAt: z.coerce.date(),\n finishedAt: z.coerce.date().nullable(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n })\n .strict();\nexport type AutomationRun = z.output<typeof automationRunSchema>;\nexport type AutomationRunInput = z.input<typeof automationRunSchema>;\n\nexport const availableActionSchema = z\n .object({\n type: z.string().trim().min(1),\n description: z.string(),\n inputSchema: jsonRecordSchema,\n source: z.string(),\n })\n .strict();\nexport type AvailableAction = z.infer<typeof availableActionSchema>;\nexport type AvailableActions = AvailableAction[];\n\nexport const availableTriggersSchema = z\n .object({\n triggers: z.array(\n z\n .object({\n type: z.string().trim().min(1),\n label: z.string().min(1),\n category: z.string().min(1),\n description: z.string(),\n })\n .strict(),\n ),\n })\n .strict();\nexport type AvailableTriggers = z.infer<typeof availableTriggersSchema>;\n\nexport const deliverWebhookInputSchema = z\n .object({\n url: z.string(),\n secretRef: idSchema,\n })\n .strict();\nexport type DeliverWebhookInput = z.infer<typeof deliverWebhookInputSchema>;\n\nexport const webhookUrlSchema = z.url({ protocol: /^https?$/ });\n\nexport const webhookSchema = z\n .object({\n orgId: idSchema,\n id: idSchema,\n url: z.string(),\n events: z.array(automationTriggerSchema),\n description: z.string().nullable(),\n enabled: z.boolean(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n })\n .strict();\nexport type Webhook = z.output<typeof webhookSchema>;\n\nexport const createWebhookInputSchema = z\n .object({\n url: webhookUrlSchema,\n events: automationTriggersSchema,\n description: z.string().optional(),\n })\n .strict();\nexport type CreateWebhookInput = z.infer<typeof createWebhookInputSchema>;\n\nexport const updateWebhookInputSchema = createWebhookInputSchema.partial().extend({\n enabled: z.boolean().optional(),\n});\nexport type UpdateWebhookInput = z.infer<typeof updateWebhookInputSchema>;\n\nexport const webhookSecretSchema = z\n .object({\n secret: z.string(),\n })\n .strict();\nexport type WebhookSecret = z.infer<typeof webhookSecretSchema>;\n\nexport const createdWebhookSchema = webhookSchema.extend({ secret: z.string() }).strict();\nexport type CreatedWebhook = z.output<typeof createdWebhookSchema>;\n"],"mappings":"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"}
|