@epilot/sdk 2.11.7 → 2.12.1
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/definitions/event-catalog.json +63 -1
- package/definitions/integration-toolkit.json +26 -19
- package/definitions/notification.json +14 -0
- package/dist/apis/access-token.cjs +6 -6
- package/dist/apis/access-token.js +1 -1
- package/dist/apis/address-suggestions.cjs +6 -6
- package/dist/apis/address-suggestions.js +1 -1
- package/dist/apis/address.cjs +6 -6
- package/dist/apis/address.js +1 -1
- package/dist/apis/ai-agents.cjs +6 -6
- package/dist/apis/ai-agents.js +1 -1
- package/dist/apis/app.cjs +6 -6
- package/dist/apis/app.js +1 -1
- package/dist/apis/audit-logs.cjs +6 -6
- package/dist/apis/audit-logs.js +1 -1
- package/dist/apis/automation.cjs +6 -6
- package/dist/apis/automation.js +1 -1
- package/dist/apis/billing.cjs +6 -6
- package/dist/apis/billing.js +1 -1
- package/dist/apis/blueprint-manifest.cjs +6 -6
- package/dist/apis/blueprint-manifest.js +1 -1
- package/dist/apis/calendar.cjs +6 -6
- package/dist/apis/calendar.js +1 -1
- package/dist/apis/configuration-hub.cjs +6 -6
- package/dist/apis/configuration-hub.js +1 -1
- package/dist/apis/consent.cjs +6 -6
- package/dist/apis/consent.js +1 -1
- package/dist/apis/customer-portal.cjs +6 -6
- package/dist/apis/customer-portal.js +1 -1
- package/dist/apis/dashboard.cjs +6 -6
- package/dist/apis/dashboard.js +1 -1
- package/dist/apis/data-governance.cjs +6 -6
- package/dist/apis/data-governance.js +1 -1
- package/dist/apis/deduplication.cjs +6 -6
- package/dist/apis/deduplication.js +1 -1
- package/dist/apis/design.cjs +6 -6
- package/dist/apis/design.js +1 -1
- package/dist/apis/document.cjs +6 -6
- package/dist/apis/document.js +1 -1
- package/dist/apis/email-settings.cjs +6 -6
- package/dist/apis/email-settings.js +1 -1
- package/dist/apis/email-template.cjs +6 -6
- package/dist/apis/email-template.js +1 -1
- package/dist/apis/entity-mapping.cjs +6 -6
- package/dist/apis/entity-mapping.js +1 -1
- package/dist/apis/entity.cjs +6 -6
- package/dist/apis/entity.js +1 -1
- package/dist/apis/environments.cjs +6 -6
- package/dist/apis/environments.js +1 -1
- package/dist/apis/event-catalog.cjs +6 -6
- package/dist/apis/event-catalog.d.cts +2 -2
- package/dist/apis/event-catalog.d.ts +2 -2
- package/dist/apis/event-catalog.js +1 -1
- package/dist/apis/file.cjs +6 -6
- package/dist/apis/file.js +1 -1
- package/dist/apis/iban.cjs +6 -6
- package/dist/apis/iban.js +1 -1
- package/dist/apis/integration-toolkit.cjs +6 -6
- package/dist/apis/integration-toolkit.d.cts +2 -2
- package/dist/apis/integration-toolkit.d.ts +2 -2
- package/dist/apis/integration-toolkit.js +1 -1
- package/dist/apis/journey.cjs +6 -6
- package/dist/apis/journey.js +1 -1
- package/dist/apis/kanban.cjs +6 -6
- package/dist/apis/kanban.js +1 -1
- package/dist/apis/message.cjs +6 -6
- package/dist/apis/message.js +1 -1
- package/dist/apis/metering.cjs +6 -6
- package/dist/apis/metering.js +1 -1
- package/dist/apis/notes.cjs +6 -6
- package/dist/apis/notes.js +1 -1
- package/dist/apis/notification.cjs +6 -6
- package/dist/apis/notification.d.cts +2 -2
- package/dist/apis/notification.d.ts +2 -2
- package/dist/apis/notification.js +1 -1
- package/dist/apis/organization.cjs +6 -6
- package/dist/apis/organization.js +1 -1
- package/dist/apis/partner-directory.cjs +6 -6
- package/dist/apis/partner-directory.js +1 -1
- package/dist/apis/permissions.cjs +6 -6
- package/dist/apis/permissions.js +1 -1
- package/dist/apis/pricing-tier.cjs +6 -6
- package/dist/apis/pricing-tier.js +1 -1
- package/dist/apis/pricing.cjs +6 -6
- package/dist/apis/pricing.js +1 -1
- package/dist/apis/purpose.cjs +6 -6
- package/dist/apis/purpose.js +1 -1
- package/dist/apis/query.cjs +6 -6
- package/dist/apis/query.js +1 -1
- package/dist/apis/sandbox.cjs +6 -6
- package/dist/apis/sandbox.js +1 -1
- package/dist/apis/sharing.cjs +6 -6
- package/dist/apis/sharing.js +1 -1
- package/dist/apis/snapshot.cjs +6 -6
- package/dist/apis/snapshot.js +1 -1
- package/dist/apis/submission.cjs +6 -6
- package/dist/apis/submission.js +1 -1
- package/dist/apis/target.cjs +6 -6
- package/dist/apis/target.js +1 -1
- package/dist/apis/targeting.cjs +6 -6
- package/dist/apis/targeting.js +1 -1
- package/dist/apis/template-variables.cjs +6 -6
- package/dist/apis/template-variables.js +1 -1
- package/dist/apis/user.cjs +6 -6
- package/dist/apis/user.js +1 -1
- package/dist/apis/validation-rules.cjs +6 -6
- package/dist/apis/validation-rules.js +1 -1
- package/dist/apis/webhooks.cjs +6 -6
- package/dist/apis/webhooks.js +1 -1
- package/dist/apis/workflow-definition.cjs +6 -6
- package/dist/apis/workflow-definition.js +1 -1
- package/dist/apis/workflow.cjs +6 -6
- package/dist/apis/workflow.js +1 -1
- package/dist/{chunk-XHYQCPF2.cjs → chunk-AJDY36Y6.cjs} +3 -3
- package/dist/{chunk-UMH5J2WT.js → chunk-L3UZLJPQ.js} +3 -3
- package/dist/event-catalog-6ZSSF5JU.cjs +7 -0
- package/dist/event-catalog-RS4LJMY2.js +7 -0
- package/dist/{event-catalog.d-CXbUn8T1.d.cts → event-catalog.d-QIhhewVH.d.cts} +153 -3
- package/dist/{event-catalog.d-CXbUn8T1.d.ts → event-catalog.d-QIhhewVH.d.ts} +153 -3
- package/dist/index.cjs +8 -8
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1 -1
- package/dist/integration-toolkit-2BLX4CSH.cjs +7 -0
- package/dist/integration-toolkit-OLFKCTLY.js +7 -0
- package/dist/{integration-toolkit.d-BVe_MBBi.d.cts → integration-toolkit.d-7q19qDTD.d.cts} +20 -11
- package/dist/{integration-toolkit.d-BVe_MBBi.d.ts → integration-toolkit.d-7q19qDTD.d.ts} +20 -11
- package/dist/js-yaml-DLCVPJ7G.js +0 -0
- package/dist/notification-PLIRHBNF.js +7 -0
- package/dist/notification-R2XBHFEW.cjs +7 -0
- package/dist/{notification.d-BfBL3lga.d.ts → notification.d-r89Jec85.d.cts} +24 -2
- package/dist/{notification.d-BfBL3lga.d.cts → notification.d-r89Jec85.d.ts} +24 -2
- package/docs/event-catalog.md +90 -5
- package/docs/integration-toolkit.md +20 -14
- package/docs/notification.md +10 -3
- package/package.json +11 -12
- package/definitions/focus-pocus-runtime.json +0 -1
- package/definitions/focus-pocus.json +0 -757
- package/dist/event-catalog-3YOQ46ZW.js +0 -7
- package/dist/event-catalog-HLWUT7RM.cjs +0 -7
- package/dist/integration-toolkit-DUMRNE6A.cjs +0 -7
- package/dist/integration-toolkit-IK7KA76K.js +0 -7
- package/dist/notification-PZOCUYD5.cjs +0 -7
- package/dist/notification-VWDZRSFZ.js +0 -7
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import "./chunk-YPSWSI3M.js";
|
|
2
|
+
|
|
3
|
+
// src/docs/notification.json
|
|
4
|
+
var notification_default = '# Notification API\n\n- **Base URL:** `https://notification.sls.epilot.io`\n- **Full API Docs:** [https://docs.epilot.io/api/notification](https://docs.epilot.io/api/notification)\n\n## Usage\n\n```ts\nimport { epilot } from \'@epilot/sdk\'\n\nepilot.authorize(() => \'<token>\')\nconst { data } = await epilot.notification.getNotificationsV2(...)\n```\n\n### Tree-shakeable import\n\n```ts\nimport { getClient, authorize } from \'@epilot/sdk/notification\'\n\nconst notificationClient = getClient()\nauthorize(notificationClient, () => \'<token>\')\nconst { data } = await notificationClient.getNotificationsV2(...)\n```\n\n## Operations\n\n**Notification**\n- [`getNotificationsV2`](#getnotificationsv2)\n- [`createNotification`](#createnotification)\n- [`getNotifications`](#getnotifications)\n- [`getNotification`](#getnotification)\n- [`markAllAsRead`](#markallasread)\n- [`markAsRead`](#markasread)\n- [`getTotalUnread`](#gettotalunread)\n\n**Template**\n- [`listNotificationTemplates`](#listnotificationtemplates)\n- [`createNotificationTemplate`](#createnotificationtemplate)\n- [`getNotificationTemplate`](#getnotificationtemplate)\n- [`updateNotificationTemplate`](#updatenotificationtemplate)\n- [`patchNotificationTemplate`](#patchnotificationtemplate)\n- [`deleteNotificationTemplate`](#deletenotificationtemplate)\n- [`sendPreview`](#sendpreview)\n\n**Schemas**\n- [`Error`](#error)\n- [`EntityOperation`](#entityoperation)\n- [`NotificationItem`](#notificationitem)\n- [`Notification`](#notification)\n- [`NotificationBase`](#notificationbase)\n- [`EntityId`](#entityid)\n- [`Entity`](#entity)\n- [`Id`](#id)\n- [`NotificationId`](#notificationid)\n- [`NotificationCallerContext`](#notificationcallercontext)\n- [`EntitySlug`](#entityslug)\n- [`EntityOwner`](#entityowner)\n- [`EntityAcl`](#entityacl)\n- [`NotificationTemplate`](#notificationtemplate)\n- [`CreateNotificationTemplateInput`](#createnotificationtemplateinput)\n- [`UpdateNotificationTemplateInput`](#updatenotificationtemplateinput)\n- [`NotificationTemplateListResponse`](#notificationtemplatelistresponse)\n- [`SendPreviewInput`](#sendpreviewinput)\n- [`SendPreviewResponse`](#sendpreviewresponse)\n\n### `getNotificationsV2`\n\nGet notifications items. These items may eventually contain entities within their payload, which can be hydrated by the client if desired by calling the Entity API directly.\n\n`GET /v2/notification/notifications`\n\n```ts\nconst { data } = await client.getNotificationsV2({\n cursor: \'example\',\n after_id: 1,\n limit: 1,\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "cursor": "eyJjcmVhd",\n "total": 1,\n "total_unread": 1,\n "results": [\n {\n "id": 123456789,\n "notification_id": 123456789,\n "timestamp": "1970-01-01T00:00:00.000Z",\n "read_state": false,\n "type": "workflow",\n "redirect_url": "https://epilot.cloud",\n "organization_id": "206801",\n "title": {\n "en": "My custom notification",\n "de": "Meine benutzerdefinierte Aktivit\xE4t"\n },\n "message": {\n "en": "{{caller}} did something with {{contact.entity.id}} {{branch.name}}.",\n "de": "{{caller}} habe etwas damit gemacht {{contact.entity.id}} {{branch.name}}."\n },\n "payload": {\n "entity": {\n "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "schema": "contact"\n }\n },\n "caller": {\n "EpilotAuth": {\n "token": {\n "sub": "476e9b48-42f4-4234-a2b0-4668b34626ce",\n "cognito:groups": ["Administrator"],\n "cognito:preferred_role": "arn:aws:iam::912468240823:role/base-administrator-role",\n "iss": "https://cognito-idp.eu-central-1.amazonaws.com/eu-central-1_6lZSgmU6D",\n "custom:ivy_org_id": "739224",\n "cognito:username": "n.ahmad@epilot.cloud",\n "custom:ivy_user_id": "10006129",\n "cognito:roles": ["arn:aws:iam::912468240823:role/base-administrator-role"],\n "aud": "6e0jbdnger7nmoktaaflarue1l",\n "event_id": "cd5f5583-d90c-4db5-8e99-5f5dd29a4d75",\n "token_use": "id",\n "auth_time": 1614333023,\n "exp": 1614336623,\n "iat": 1614333023,\n "email": "n.ahmad@epilot.cloud"\n }\n }\n },\n "operations": [\n {\n "entity": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "operation": "updateEntity",\n "params": {\n "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "slug": "contact"\n },\n "payload": {\n "_schema": "contact",\n "_org": "123",\n "status": "Inactive"\n }\n }\n ],\n "force_notify_users": {\n "12345": {\n "email": false,\n "in_app": false\n }\n },\n "allowed_channels": ["in_app"]\n }\n ]\n}\n```\n\n</details>\n\n---\n\n### `createNotification`\n\nCreate a message that can be displayed in the notification panel.\n\n`POST /v1/notification/notifications`\n\n```ts\nconst { data } = await client.createNotification(\n null,\n {\n notification_id: 0,\n timestamp: \'1970-01-01T00:00:00.000Z\',\n type: \'workflow\',\n redirect_url: \'https://epilot.cloud\',\n organization_id: \'206801\',\n title: {\n en: \'My custom notification\',\n de: \'Meine benutzerdefinierte Aktivit\xE4t\'\n },\n message: {\n en: \'{{caller}} did something with {{contact.entity.id}} {{branch.name}}.\',\n de: \'{{caller}} habe etwas damit gemacht {{contact.entity.id}} {{branch.name}}.\'\n },\n payload: {\n entity: {\n id: \'3fa85f64-5717-4562-b3fc-2c963f66afa6\',\n schema: \'contact\'\n }\n },\n caller: {\n EpilotAuth: {\n token: {\n sub: \'476e9b48-42f4-4234-a2b0-4668b34626ce\',\n \'cognito:groups\': [\'Administrator\'],\n \'cognito:preferred_role\': \'arn:aws:iam::912468240823:role/base-administrator-role\',\n iss: \'https://cognito-idp.eu-central-1.amazonaws.com/eu-central-1_6lZSgmU6D\',\n \'custom:ivy_org_id\': \'739224\',\n \'cognito:username\': \'n.ahmad@epilot.cloud\',\n \'custom:ivy_user_id\': \'10006129\',\n \'cognito:roles\': [\'arn:aws:iam::912468240823:role/base-administrator-role\'],\n aud: \'6e0jbdnger7nmoktaaflarue1l\',\n event_id: \'cd5f5583-d90c-4db5-8e99-5f5dd29a4d75\',\n token_use: \'id\',\n auth_time: 1614333023,\n exp: 1614336623,\n iat: 1614333023,\n email: \'n.ahmad@epilot.cloud\'\n }\n }\n },\n operations: [\n {\n entity: \'3fa85f64-5717-4562-b3fc-2c963f66afa6\',\n operation: \'updateEntity\',\n params: {\n id: \'3fa85f64-5717-4562-b3fc-2c963f66afa6\',\n slug: \'contact\'\n },\n payload: {\n _schema: \'contact\',\n _org: \'123\',\n status: \'Inactive\'\n }\n }\n ],\n force_notify_users: {\n \'12345\': {\n email: false,\n in_app: false\n }\n },\n allowed_channels: [\'in_app\'],\n read_state: false,\n visibility_user_ids: [\'1\', \'2\', \'3\', \'4\', \'5\']\n },\n)\n```\n\n---\n\n### `getNotifications`\n\nGet notifications\n\n`GET /v1/notification/notifications`\n\n```ts\nconst { data } = await client.getNotifications({\n after_id: 1,\n limit: 1,\n no_hydrate: true,\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "total": 1,\n "total_unread": 1,\n "results": [\n {\n "id": 123456789,\n "notification_id": 123456789,\n "timestamp": "1970-01-01T00:00:00.000Z",\n "read_state": false,\n "type": "workflow",\n "redirect_url": "https://epilot.cloud",\n "organization_id": "206801",\n "title": {\n "en": "My custom notification",\n "de": "Meine benutzerdefinierte Aktivit\xE4t"\n },\n "message": {\n "en": "{{caller}} did something with {{contact.entity.id}} {{branch.name}}.",\n "de": "{{caller}} habe etwas damit gemacht {{contact.entity.id}} {{branch.name}}."\n },\n "payload": {\n "entity": {\n "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "schema": "contact"\n }\n },\n "caller": {\n "EpilotAuth": {\n "token": {\n "sub": "476e9b48-42f4-4234-a2b0-4668b34626ce",\n "cognito:groups": ["Administrator"],\n "cognito:preferred_role": "arn:aws:iam::912468240823:role/base-administrator-role",\n "iss": "https://cognito-idp.eu-central-1.amazonaws.com/eu-central-1_6lZSgmU6D",\n "custom:ivy_org_id": "739224",\n "cognito:username": "n.ahmad@epilot.cloud",\n "custom:ivy_user_id": "10006129",\n "cognito:roles": ["arn:aws:iam::912468240823:role/base-administrator-role"],\n "aud": "6e0jbdnger7nmoktaaflarue1l",\n "event_id": "cd5f5583-d90c-4db5-8e99-5f5dd29a4d75",\n "token_use": "id",\n "auth_time": 1614333023,\n "exp": 1614336623,\n "iat": 1614333023,\n "email": "n.ahmad@epilot.cloud"\n }\n }\n },\n "operations": [\n {\n "entity": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "operation": "updateEntity",\n "params": {\n "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "slug": "contact"\n },\n "payload": {\n "_schema": "contact",\n "_org": "123",\n "status": "Inactive"\n }\n }\n ],\n "force_notify_users": {\n "12345": {\n "email": false,\n "in_app": false\n }\n },\n "allowed_channels": ["in_app"]\n }\n ]\n}\n```\n\n</details>\n\n---\n\n### `getNotification`\n\nGet the details of a single notification.\n\n`GET /v1/notification/notifications/{id}`\n\n```ts\nconst { data } = await client.getNotification({\n id: 1,\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "id": 123456789,\n "notification_id": 123456789,\n "timestamp": "1970-01-01T00:00:00.000Z",\n "read_state": false,\n "type": "workflow",\n "redirect_url": "https://epilot.cloud",\n "organization_id": "206801",\n "title": {\n "en": "My custom notification",\n "de": "Meine benutzerdefinierte Aktivit\xE4t"\n },\n "message": {\n "en": "{{caller}} did something with {{contact.entity.id}} {{branch.name}}.",\n "de": "{{caller}} habe etwas damit gemacht {{contact.entity.id}} {{branch.name}}."\n },\n "payload": {\n "entity": {\n "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "schema": "contact"\n }\n },\n "caller": {\n "EpilotAuth": {\n "token": {\n "sub": "476e9b48-42f4-4234-a2b0-4668b34626ce",\n "cognito:groups": ["Administrator"],\n "cognito:preferred_role": "arn:aws:iam::912468240823:role/base-administrator-role",\n "iss": "https://cognito-idp.eu-central-1.amazonaws.com/eu-central-1_6lZSgmU6D",\n "custom:ivy_org_id": "739224",\n "cognito:username": "n.ahmad@epilot.cloud",\n "custom:ivy_user_id": "10006129",\n "cognito:roles": ["arn:aws:iam::912468240823:role/base-administrator-role"],\n "aud": "6e0jbdnger7nmoktaaflarue1l",\n "event_id": "cd5f5583-d90c-4db5-8e99-5f5dd29a4d75",\n "token_use": "id",\n "auth_time": 1614333023,\n "exp": 1614336623,\n "iat": 1614333023,\n "email": "n.ahmad@epilot.cloud"\n }\n }\n },\n "operations": [\n {\n "entity": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "operation": "updateEntity",\n "params": {\n "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "slug": "contact"\n },\n "payload": {\n "_schema": "contact",\n "_org": "123",\n "status": "Inactive"\n }\n }\n ],\n "force_notify_users": {\n "12345": {\n "email": false,\n "in_app": false\n }\n },\n "allowed_channels": ["in_app"]\n}\n```\n\n</details>\n\n---\n\n### `markAllAsRead`\n\nMark all as read\n\n`PUT /v1/notification/notifications/mark`\n\n```ts\nconst { data } = await client.markAllAsRead()\n```\n\n---\n\n### `markAsRead`\n\nMark as read\n\n`PUT /v1/notification/notifications/{id}/mark`\n\n```ts\nconst { data } = await client.markAsRead({\n id: 1,\n})\n```\n\n---\n\n### `getTotalUnread`\n\nGet total unread\n\n`GET /v1/notification/unreads`\n\n```ts\nconst { data } = await client.getTotalUnread()\n```\n\n---\n\n### `listNotificationTemplates`\n\nList notification templates with optional filtering and pagination\n\n`GET /v1/notification/templates`\n\n```ts\nconst { data } = await client.listNotificationTemplates({\n q: \'example\',\n from: 1,\n size: 1,\n sort: \'example\',\n fields: \'example\',\n hydrate: true,\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "results": [\n {\n "_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "_schema": "string",\n "_title": "string",\n "_org": "string",\n "_tags": ["string"],\n "_created_at": "1970-01-01T00:00:00.000Z",\n "_updated_at": "1970-01-01T00:00:00.000Z",\n "_manifest": ["123e4567-e89b-12d3-a456-426614174000"],\n "_owners": [\n {\n "org_id": "string",\n "user_id": "string"\n }\n ],\n "_acl": {\n "view": ["string"],\n "edit": ["string"],\n "delete": ["string"]\n },\n "name": "string",\n "type": "string",\n "notification_title": "string",\n "message": "string",\n "action_label": "string",\n "action_url": "string",\n "style": "string",\n "system_template": true,\n "created_by": "string",\n "updated_by": "string"\n }\n ],\n "hits": 0\n}\n```\n\n</details>\n\n---\n\n### `createNotificationTemplate`\n\nCreate a new notification template\n\n`POST /v1/notification/templates`\n\n```ts\nconst { data } = await client.createNotificationTemplate(\n null,\n {\n name: \'string\',\n type: \'string\',\n notification_title: \'string\',\n message: \'string\',\n action_label: \'string\',\n action_url: \'string\',\n style: \'string\',\n _title: \'string\',\n _tags: [\'string\'],\n _manifest: [\'123e4567-e89b-12d3-a456-426614174000\']\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "_schema": "string",\n "_title": "string",\n "_org": "string",\n "_tags": ["string"],\n "_created_at": "1970-01-01T00:00:00.000Z",\n "_updated_at": "1970-01-01T00:00:00.000Z",\n "_manifest": ["123e4567-e89b-12d3-a456-426614174000"],\n "_owners": [\n {\n "org_id": "string",\n "user_id": "string"\n }\n ],\n "_acl": {\n "view": ["string"],\n "edit": ["string"],\n "delete": ["string"]\n },\n "name": "string",\n "type": "string",\n "notification_title": "string",\n "message": "string",\n "action_label": "string",\n "action_url": "string",\n "style": "string",\n "system_template": true,\n "created_by": "string",\n "updated_by": "string"\n}\n```\n\n</details>\n\n---\n\n### `getNotificationTemplate`\n\nGet a single notification template by ID\n\n`GET /v1/notification/templates/{id}`\n\n```ts\nconst { data } = await client.getNotificationTemplate({\n id: \'123e4567-e89b-12d3-a456-426614174000\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "_schema": "string",\n "_title": "string",\n "_org": "string",\n "_tags": ["string"],\n "_created_at": "1970-01-01T00:00:00.000Z",\n "_updated_at": "1970-01-01T00:00:00.000Z",\n "_manifest": ["123e4567-e89b-12d3-a456-426614174000"],\n "_owners": [\n {\n "org_id": "string",\n "user_id": "string"\n }\n ],\n "_acl": {\n "view": ["string"],\n "edit": ["string"],\n "delete": ["string"]\n },\n "name": "string",\n "type": "string",\n "notification_title": "string",\n "message": "string",\n "action_label": "string",\n "action_url": "string",\n "style": "string",\n "system_template": true,\n "created_by": "string",\n "updated_by": "string"\n}\n```\n\n</details>\n\n---\n\n### `updateNotificationTemplate`\n\nUpdate a notification template (full replacement)\n\n`PUT /v1/notification/templates/{id}`\n\n```ts\nconst { data } = await client.updateNotificationTemplate(\n {\n id: \'123e4567-e89b-12d3-a456-426614174000\',\n },\n {\n name: \'string\',\n notification_title: \'string\',\n message: \'string\',\n action_label: \'string\',\n action_url: \'string\',\n style: \'string\',\n _title: \'string\',\n _tags: [\'string\'],\n _manifest: [\'123e4567-e89b-12d3-a456-426614174000\']\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "_schema": "string",\n "_title": "string",\n "_org": "string",\n "_tags": ["string"],\n "_created_at": "1970-01-01T00:00:00.000Z",\n "_updated_at": "1970-01-01T00:00:00.000Z",\n "_manifest": ["123e4567-e89b-12d3-a456-426614174000"],\n "_owners": [\n {\n "org_id": "string",\n "user_id": "string"\n }\n ],\n "_acl": {\n "view": ["string"],\n "edit": ["string"],\n "delete": ["string"]\n },\n "name": "string",\n "type": "string",\n "notification_title": "string",\n "message": "string",\n "action_label": "string",\n "action_url": "string",\n "style": "string",\n "system_template": true,\n "created_by": "string",\n "updated_by": "string"\n}\n```\n\n</details>\n\n---\n\n### `patchNotificationTemplate`\n\nPartially update a notification template\n\n`PATCH /v1/notification/templates/{id}`\n\n```ts\nconst { data } = await client.patchNotificationTemplate(\n {\n id: \'123e4567-e89b-12d3-a456-426614174000\',\n },\n {\n name: \'string\',\n notification_title: \'string\',\n message: \'string\',\n action_label: \'string\',\n action_url: \'string\',\n style: \'string\',\n _title: \'string\',\n _tags: [\'string\'],\n _manifest: [\'123e4567-e89b-12d3-a456-426614174000\']\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "_schema": "string",\n "_title": "string",\n "_org": "string",\n "_tags": ["string"],\n "_created_at": "1970-01-01T00:00:00.000Z",\n "_updated_at": "1970-01-01T00:00:00.000Z",\n "_manifest": ["123e4567-e89b-12d3-a456-426614174000"],\n "_owners": [\n {\n "org_id": "string",\n "user_id": "string"\n }\n ],\n "_acl": {\n "view": ["string"],\n "edit": ["string"],\n "delete": ["string"]\n },\n "name": "string",\n "type": "string",\n "notification_title": "string",\n "message": "string",\n "action_label": "string",\n "action_url": "string",\n "style": "string",\n "system_template": true,\n "created_by": "string",\n "updated_by": "string"\n}\n```\n\n</details>\n\n---\n\n### `deleteNotificationTemplate`\n\nDelete a notification template permanently\n\n`DELETE /v1/notification/templates/{id}`\n\n```ts\nconst { data } = await client.deleteNotificationTemplate({\n id: \'123e4567-e89b-12d3-a456-426614174000\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "_schema": "string",\n "_title": "string",\n "_org": "string",\n "_tags": ["string"],\n "_created_at": "1970-01-01T00:00:00.000Z",\n "_updated_at": "1970-01-01T00:00:00.000Z",\n "_manifest": ["123e4567-e89b-12d3-a456-426614174000"],\n "_owners": [\n {\n "org_id": "string",\n "user_id": "string"\n }\n ],\n "_acl": {\n "view": ["string"],\n "edit": ["string"],\n "delete": ["string"]\n },\n "name": "string",\n "type": "string",\n "notification_title": "string",\n "message": "string",\n "action_label": "string",\n "action_url": "string",\n "style": "string",\n "system_template": true,\n "created_by": "string",\n "updated_by": "string"\n}\n```\n\n</details>\n\n---\n\n### `sendPreview`\n\nSend a preview notification (both email and in-app) to the requesting user.\nUsed to test notification templates before saving.\n\n`POST /v1/notification/templates/send-preview`\n\n```ts\nconst { data } = await client.sendPreview(\n null,\n {\n template: {\n name: \'string\',\n notification_title: \'string\',\n message: \'string\',\n action_label: \'string\',\n action_url: \'string\',\n style: \'string\',\n _title: \'string\',\n _tags: [\'string\'],\n _manifest: [\'123e4567-e89b-12d3-a456-426614174000\']\n },\n context_ids: {}\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n[\n {\n "success": true,\n "data": {}\n }\n]\n```\n\n</details>\n\n---\n\n## Schemas\n\n### `Error`\n\n```ts\ntype Error = {\n message: string\n code?: string\n}\n```\n\n### `EntityOperation`\n\n```ts\ntype EntityOperation = {\n entity: string // uuid\n operation?: string\n params?: {\n id?: string // uuid\n slug?: string\n }\n payload?: object\n}\n```\n\n### `NotificationItem`\n\n```ts\ntype NotificationItem = {\n id?: number\n notification_id?: number\n timestamp?: string // date-time\n read_state?: boolean\n type: string\n redirect_url?: string\n organization_id?: string\n title: {\n en?: string\n de?: string\n }\n message: {\n en?: string\n de?: string\n }\n payload?: Record<string, unknown>\n caller?: {\n EpilotAuth?: {\n token?: { ... }\n }\n }\n operations?: Array<{\n entity: string // uuid\n operation?: string\n params?: {\n id?: { ... }\n slug?: { ... }\n }\n payload?: object\n }>\n force_notify_users?: Record<string, unknown>\n allowed_channels?: "email" | "in_app"[]\n}\n```\n\n### `Notification`\n\n```ts\ntype Notification = {\n notification_id?: number\n timestamp?: string // date-time\n type: string\n redirect_url?: string\n organization_id?: string\n title: {\n en?: string\n de?: string\n }\n message: {\n en?: string\n de?: string\n }\n payload?: Record<string, unknown>\n caller?: {\n EpilotAuth?: {\n token?: { ... }\n }\n }\n operations?: Array<{\n entity: string // uuid\n operation?: string\n params?: {\n id?: { ... }\n slug?: { ... }\n }\n payload?: object\n }>\n force_notify_users?: Record<string, unknown>\n allowed_channels?: "email" | "in_app"[]\n read_state?: boolean\n visibility_user_ids?: string[]\n}\n```\n\n### `NotificationBase`\n\n```ts\ntype NotificationBase = {\n notification_id?: number\n timestamp?: string // date-time\n type: string\n redirect_url?: string\n organization_id?: string\n title: {\n en?: string\n de?: string\n }\n message: {\n en?: string\n de?: string\n }\n payload?: Record<string, unknown>\n caller?: {\n EpilotAuth?: {\n token?: { ... }\n }\n }\n operations?: Array<{\n entity: string // uuid\n operation?: string\n params?: {\n id?: { ... }\n slug?: { ... }\n }\n payload?: object\n }>\n force_notify_users?: Record<string, unknown>\n allowed_channels?: "email" | "in_app"[]\n}\n```\n\n### `EntityId`\n\n```ts\ntype EntityId = string // uuid\n```\n\n### `Entity`\n\n```ts\ntype Entity = Record<string, unknown>\n```\n\n### `Id`\n\n```ts\ntype Id = number\n```\n\n### `NotificationId`\n\n```ts\ntype NotificationId = number\n```\n\n### `NotificationCallerContext`\n\n```ts\ntype NotificationCallerContext = {\n EpilotAuth?: {\n token?: {\n sub?: { ... }\n email?: { ... }\n cognito:username?: { ... }\n custom:ivy_user_id?: { ... }\n }\n }\n}\n```\n\n### `EntitySlug`\n\nURL-friendly identifier for the entity schema\n\n```ts\ntype EntitySlug = string\n```\n\n### `EntityOwner`\n\n```ts\ntype EntityOwner = {\n org_id: string\n user_id: string\n}\n```\n\n### `EntityAcl`\n\nAccess control list\n\n```ts\ntype EntityAcl = {\n view?: string[]\n edit?: string[]\n delete?: string[]\n}\n```\n\n### `NotificationTemplate`\n\n```ts\ntype NotificationTemplate = {\n _id: string // uuid\n _schema: string\n _title: string\n _org: string\n _tags?: string[]\n _created_at: string // date-time\n _updated_at: string // date-time\n _manifest?: string // uuid[]\n _owners?: Array<{\n org_id: string\n user_id: string\n }>\n _acl?: {\n view?: string[]\n edit?: string[]\n delete?: string[]\n }\n name?: string\n type?: string\n notification_title?: string\n message?: string\n action_label?: string\n action_url?: string\n style?: string\n system_template?: boolean\n created_by?: string\n updated_by?: string\n}\n```\n\n### `CreateNotificationTemplateInput`\n\n```ts\ntype CreateNotificationTemplateInput = {\n name: string\n type: string\n notification_title?: string\n message?: string\n action_label?: string\n action_url?: string\n style?: string\n _title?: string\n _tags?: string[]\n _manifest?: string // uuid[]\n}\n```\n\n### `UpdateNotificationTemplateInput`\n\n```ts\ntype UpdateNotificationTemplateInput = {\n name?: string\n notification_title?: string\n message?: string\n action_label?: string\n action_url?: string\n style?: string\n _title?: string\n _tags?: string[]\n _manifest?: string // uuid[]\n}\n```\n\n### `NotificationTemplateListResponse`\n\n```ts\ntype NotificationTemplateListResponse = {\n results?: Array<{\n _id: string // uuid\n _schema: string\n _title: string\n _org: string\n _tags?: string[]\n _created_at: string // date-time\n _updated_at: string // date-time\n _manifest?: string // uuid[]\n _owners?: Array<{\n org_id: { ... }\n user_id: { ... }\n }>\n _acl?: {\n view?: { ... }\n edit?: { ... }\n delete?: { ... }\n }\n name?: string\n type?: string\n notification_title?: string\n message?: string\n action_label?: string\n action_url?: string\n style?: string\n system_template?: boolean\n created_by?: string\n updated_by?: string\n }>\n hits?: number\n}\n```\n\n### `SendPreviewInput`\n\n```ts\ntype SendPreviewInput = {\n template: {\n name?: string\n notification_title?: string\n message?: string\n action_label?: string\n action_url?: string\n style?: string\n _title?: string\n _tags?: string[]\n _manifest?: string // uuid[]\n }\n context_ids?: Record<string, string>\n}\n```\n\n### `SendPreviewResponse`\n\nArray of results for each notification channel (email, in-app)\n\n```ts\ntype SendPreviewResponse = Array<{\n success: boolean\n data?: unknown\n}>\n```\n';
|
|
5
|
+
export {
|
|
6
|
+
notification_default as default
|
|
7
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-NJK5F5TF.cjs');
|
|
2
|
+
|
|
3
|
+
// src/docs/notification.json
|
|
4
|
+
var notification_default = '# Notification API\n\n- **Base URL:** `https://notification.sls.epilot.io`\n- **Full API Docs:** [https://docs.epilot.io/api/notification](https://docs.epilot.io/api/notification)\n\n## Usage\n\n```ts\nimport { epilot } from \'@epilot/sdk\'\n\nepilot.authorize(() => \'<token>\')\nconst { data } = await epilot.notification.getNotificationsV2(...)\n```\n\n### Tree-shakeable import\n\n```ts\nimport { getClient, authorize } from \'@epilot/sdk/notification\'\n\nconst notificationClient = getClient()\nauthorize(notificationClient, () => \'<token>\')\nconst { data } = await notificationClient.getNotificationsV2(...)\n```\n\n## Operations\n\n**Notification**\n- [`getNotificationsV2`](#getnotificationsv2)\n- [`createNotification`](#createnotification)\n- [`getNotifications`](#getnotifications)\n- [`getNotification`](#getnotification)\n- [`markAllAsRead`](#markallasread)\n- [`markAsRead`](#markasread)\n- [`getTotalUnread`](#gettotalunread)\n\n**Template**\n- [`listNotificationTemplates`](#listnotificationtemplates)\n- [`createNotificationTemplate`](#createnotificationtemplate)\n- [`getNotificationTemplate`](#getnotificationtemplate)\n- [`updateNotificationTemplate`](#updatenotificationtemplate)\n- [`patchNotificationTemplate`](#patchnotificationtemplate)\n- [`deleteNotificationTemplate`](#deletenotificationtemplate)\n- [`sendPreview`](#sendpreview)\n\n**Schemas**\n- [`Error`](#error)\n- [`EntityOperation`](#entityoperation)\n- [`NotificationItem`](#notificationitem)\n- [`Notification`](#notification)\n- [`NotificationBase`](#notificationbase)\n- [`EntityId`](#entityid)\n- [`Entity`](#entity)\n- [`Id`](#id)\n- [`NotificationId`](#notificationid)\n- [`NotificationCallerContext`](#notificationcallercontext)\n- [`EntitySlug`](#entityslug)\n- [`EntityOwner`](#entityowner)\n- [`EntityAcl`](#entityacl)\n- [`NotificationTemplate`](#notificationtemplate)\n- [`CreateNotificationTemplateInput`](#createnotificationtemplateinput)\n- [`UpdateNotificationTemplateInput`](#updatenotificationtemplateinput)\n- [`NotificationTemplateListResponse`](#notificationtemplatelistresponse)\n- [`SendPreviewInput`](#sendpreviewinput)\n- [`SendPreviewResponse`](#sendpreviewresponse)\n\n### `getNotificationsV2`\n\nGet notifications items. These items may eventually contain entities within their payload, which can be hydrated by the client if desired by calling the Entity API directly.\n\n`GET /v2/notification/notifications`\n\n```ts\nconst { data } = await client.getNotificationsV2({\n cursor: \'example\',\n after_id: 1,\n limit: 1,\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "cursor": "eyJjcmVhd",\n "total": 1,\n "total_unread": 1,\n "results": [\n {\n "id": 123456789,\n "notification_id": 123456789,\n "timestamp": "1970-01-01T00:00:00.000Z",\n "read_state": false,\n "type": "workflow",\n "redirect_url": "https://epilot.cloud",\n "organization_id": "206801",\n "title": {\n "en": "My custom notification",\n "de": "Meine benutzerdefinierte Aktivit\xE4t"\n },\n "message": {\n "en": "{{caller}} did something with {{contact.entity.id}} {{branch.name}}.",\n "de": "{{caller}} habe etwas damit gemacht {{contact.entity.id}} {{branch.name}}."\n },\n "payload": {\n "entity": {\n "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "schema": "contact"\n }\n },\n "caller": {\n "EpilotAuth": {\n "token": {\n "sub": "476e9b48-42f4-4234-a2b0-4668b34626ce",\n "cognito:groups": ["Administrator"],\n "cognito:preferred_role": "arn:aws:iam::912468240823:role/base-administrator-role",\n "iss": "https://cognito-idp.eu-central-1.amazonaws.com/eu-central-1_6lZSgmU6D",\n "custom:ivy_org_id": "739224",\n "cognito:username": "n.ahmad@epilot.cloud",\n "custom:ivy_user_id": "10006129",\n "cognito:roles": ["arn:aws:iam::912468240823:role/base-administrator-role"],\n "aud": "6e0jbdnger7nmoktaaflarue1l",\n "event_id": "cd5f5583-d90c-4db5-8e99-5f5dd29a4d75",\n "token_use": "id",\n "auth_time": 1614333023,\n "exp": 1614336623,\n "iat": 1614333023,\n "email": "n.ahmad@epilot.cloud"\n }\n }\n },\n "operations": [\n {\n "entity": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "operation": "updateEntity",\n "params": {\n "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "slug": "contact"\n },\n "payload": {\n "_schema": "contact",\n "_org": "123",\n "status": "Inactive"\n }\n }\n ],\n "force_notify_users": {\n "12345": {\n "email": false,\n "in_app": false\n }\n },\n "allowed_channels": ["in_app"]\n }\n ]\n}\n```\n\n</details>\n\n---\n\n### `createNotification`\n\nCreate a message that can be displayed in the notification panel.\n\n`POST /v1/notification/notifications`\n\n```ts\nconst { data } = await client.createNotification(\n null,\n {\n notification_id: 0,\n timestamp: \'1970-01-01T00:00:00.000Z\',\n type: \'workflow\',\n redirect_url: \'https://epilot.cloud\',\n organization_id: \'206801\',\n title: {\n en: \'My custom notification\',\n de: \'Meine benutzerdefinierte Aktivit\xE4t\'\n },\n message: {\n en: \'{{caller}} did something with {{contact.entity.id}} {{branch.name}}.\',\n de: \'{{caller}} habe etwas damit gemacht {{contact.entity.id}} {{branch.name}}.\'\n },\n payload: {\n entity: {\n id: \'3fa85f64-5717-4562-b3fc-2c963f66afa6\',\n schema: \'contact\'\n }\n },\n caller: {\n EpilotAuth: {\n token: {\n sub: \'476e9b48-42f4-4234-a2b0-4668b34626ce\',\n \'cognito:groups\': [\'Administrator\'],\n \'cognito:preferred_role\': \'arn:aws:iam::912468240823:role/base-administrator-role\',\n iss: \'https://cognito-idp.eu-central-1.amazonaws.com/eu-central-1_6lZSgmU6D\',\n \'custom:ivy_org_id\': \'739224\',\n \'cognito:username\': \'n.ahmad@epilot.cloud\',\n \'custom:ivy_user_id\': \'10006129\',\n \'cognito:roles\': [\'arn:aws:iam::912468240823:role/base-administrator-role\'],\n aud: \'6e0jbdnger7nmoktaaflarue1l\',\n event_id: \'cd5f5583-d90c-4db5-8e99-5f5dd29a4d75\',\n token_use: \'id\',\n auth_time: 1614333023,\n exp: 1614336623,\n iat: 1614333023,\n email: \'n.ahmad@epilot.cloud\'\n }\n }\n },\n operations: [\n {\n entity: \'3fa85f64-5717-4562-b3fc-2c963f66afa6\',\n operation: \'updateEntity\',\n params: {\n id: \'3fa85f64-5717-4562-b3fc-2c963f66afa6\',\n slug: \'contact\'\n },\n payload: {\n _schema: \'contact\',\n _org: \'123\',\n status: \'Inactive\'\n }\n }\n ],\n force_notify_users: {\n \'12345\': {\n email: false,\n in_app: false\n }\n },\n allowed_channels: [\'in_app\'],\n read_state: false,\n visibility_user_ids: [\'1\', \'2\', \'3\', \'4\', \'5\']\n },\n)\n```\n\n---\n\n### `getNotifications`\n\nGet notifications\n\n`GET /v1/notification/notifications`\n\n```ts\nconst { data } = await client.getNotifications({\n after_id: 1,\n limit: 1,\n no_hydrate: true,\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "total": 1,\n "total_unread": 1,\n "results": [\n {\n "id": 123456789,\n "notification_id": 123456789,\n "timestamp": "1970-01-01T00:00:00.000Z",\n "read_state": false,\n "type": "workflow",\n "redirect_url": "https://epilot.cloud",\n "organization_id": "206801",\n "title": {\n "en": "My custom notification",\n "de": "Meine benutzerdefinierte Aktivit\xE4t"\n },\n "message": {\n "en": "{{caller}} did something with {{contact.entity.id}} {{branch.name}}.",\n "de": "{{caller}} habe etwas damit gemacht {{contact.entity.id}} {{branch.name}}."\n },\n "payload": {\n "entity": {\n "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "schema": "contact"\n }\n },\n "caller": {\n "EpilotAuth": {\n "token": {\n "sub": "476e9b48-42f4-4234-a2b0-4668b34626ce",\n "cognito:groups": ["Administrator"],\n "cognito:preferred_role": "arn:aws:iam::912468240823:role/base-administrator-role",\n "iss": "https://cognito-idp.eu-central-1.amazonaws.com/eu-central-1_6lZSgmU6D",\n "custom:ivy_org_id": "739224",\n "cognito:username": "n.ahmad@epilot.cloud",\n "custom:ivy_user_id": "10006129",\n "cognito:roles": ["arn:aws:iam::912468240823:role/base-administrator-role"],\n "aud": "6e0jbdnger7nmoktaaflarue1l",\n "event_id": "cd5f5583-d90c-4db5-8e99-5f5dd29a4d75",\n "token_use": "id",\n "auth_time": 1614333023,\n "exp": 1614336623,\n "iat": 1614333023,\n "email": "n.ahmad@epilot.cloud"\n }\n }\n },\n "operations": [\n {\n "entity": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "operation": "updateEntity",\n "params": {\n "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "slug": "contact"\n },\n "payload": {\n "_schema": "contact",\n "_org": "123",\n "status": "Inactive"\n }\n }\n ],\n "force_notify_users": {\n "12345": {\n "email": false,\n "in_app": false\n }\n },\n "allowed_channels": ["in_app"]\n }\n ]\n}\n```\n\n</details>\n\n---\n\n### `getNotification`\n\nGet the details of a single notification.\n\n`GET /v1/notification/notifications/{id}`\n\n```ts\nconst { data } = await client.getNotification({\n id: 1,\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "id": 123456789,\n "notification_id": 123456789,\n "timestamp": "1970-01-01T00:00:00.000Z",\n "read_state": false,\n "type": "workflow",\n "redirect_url": "https://epilot.cloud",\n "organization_id": "206801",\n "title": {\n "en": "My custom notification",\n "de": "Meine benutzerdefinierte Aktivit\xE4t"\n },\n "message": {\n "en": "{{caller}} did something with {{contact.entity.id}} {{branch.name}}.",\n "de": "{{caller}} habe etwas damit gemacht {{contact.entity.id}} {{branch.name}}."\n },\n "payload": {\n "entity": {\n "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "schema": "contact"\n }\n },\n "caller": {\n "EpilotAuth": {\n "token": {\n "sub": "476e9b48-42f4-4234-a2b0-4668b34626ce",\n "cognito:groups": ["Administrator"],\n "cognito:preferred_role": "arn:aws:iam::912468240823:role/base-administrator-role",\n "iss": "https://cognito-idp.eu-central-1.amazonaws.com/eu-central-1_6lZSgmU6D",\n "custom:ivy_org_id": "739224",\n "cognito:username": "n.ahmad@epilot.cloud",\n "custom:ivy_user_id": "10006129",\n "cognito:roles": ["arn:aws:iam::912468240823:role/base-administrator-role"],\n "aud": "6e0jbdnger7nmoktaaflarue1l",\n "event_id": "cd5f5583-d90c-4db5-8e99-5f5dd29a4d75",\n "token_use": "id",\n "auth_time": 1614333023,\n "exp": 1614336623,\n "iat": 1614333023,\n "email": "n.ahmad@epilot.cloud"\n }\n }\n },\n "operations": [\n {\n "entity": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "operation": "updateEntity",\n "params": {\n "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "slug": "contact"\n },\n "payload": {\n "_schema": "contact",\n "_org": "123",\n "status": "Inactive"\n }\n }\n ],\n "force_notify_users": {\n "12345": {\n "email": false,\n "in_app": false\n }\n },\n "allowed_channels": ["in_app"]\n}\n```\n\n</details>\n\n---\n\n### `markAllAsRead`\n\nMark all as read\n\n`PUT /v1/notification/notifications/mark`\n\n```ts\nconst { data } = await client.markAllAsRead()\n```\n\n---\n\n### `markAsRead`\n\nMark as read\n\n`PUT /v1/notification/notifications/{id}/mark`\n\n```ts\nconst { data } = await client.markAsRead({\n id: 1,\n})\n```\n\n---\n\n### `getTotalUnread`\n\nGet total unread\n\n`GET /v1/notification/unreads`\n\n```ts\nconst { data } = await client.getTotalUnread()\n```\n\n---\n\n### `listNotificationTemplates`\n\nList notification templates with optional filtering and pagination\n\n`GET /v1/notification/templates`\n\n```ts\nconst { data } = await client.listNotificationTemplates({\n q: \'example\',\n from: 1,\n size: 1,\n sort: \'example\',\n fields: \'example\',\n hydrate: true,\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "results": [\n {\n "_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "_schema": "string",\n "_title": "string",\n "_org": "string",\n "_tags": ["string"],\n "_created_at": "1970-01-01T00:00:00.000Z",\n "_updated_at": "1970-01-01T00:00:00.000Z",\n "_manifest": ["123e4567-e89b-12d3-a456-426614174000"],\n "_owners": [\n {\n "org_id": "string",\n "user_id": "string"\n }\n ],\n "_acl": {\n "view": ["string"],\n "edit": ["string"],\n "delete": ["string"]\n },\n "name": "string",\n "type": "string",\n "notification_title": "string",\n "message": "string",\n "action_label": "string",\n "action_url": "string",\n "style": "string",\n "system_template": true,\n "created_by": "string",\n "updated_by": "string"\n }\n ],\n "hits": 0\n}\n```\n\n</details>\n\n---\n\n### `createNotificationTemplate`\n\nCreate a new notification template\n\n`POST /v1/notification/templates`\n\n```ts\nconst { data } = await client.createNotificationTemplate(\n null,\n {\n name: \'string\',\n type: \'string\',\n notification_title: \'string\',\n message: \'string\',\n action_label: \'string\',\n action_url: \'string\',\n style: \'string\',\n _title: \'string\',\n _tags: [\'string\'],\n _manifest: [\'123e4567-e89b-12d3-a456-426614174000\']\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "_schema": "string",\n "_title": "string",\n "_org": "string",\n "_tags": ["string"],\n "_created_at": "1970-01-01T00:00:00.000Z",\n "_updated_at": "1970-01-01T00:00:00.000Z",\n "_manifest": ["123e4567-e89b-12d3-a456-426614174000"],\n "_owners": [\n {\n "org_id": "string",\n "user_id": "string"\n }\n ],\n "_acl": {\n "view": ["string"],\n "edit": ["string"],\n "delete": ["string"]\n },\n "name": "string",\n "type": "string",\n "notification_title": "string",\n "message": "string",\n "action_label": "string",\n "action_url": "string",\n "style": "string",\n "system_template": true,\n "created_by": "string",\n "updated_by": "string"\n}\n```\n\n</details>\n\n---\n\n### `getNotificationTemplate`\n\nGet a single notification template by ID\n\n`GET /v1/notification/templates/{id}`\n\n```ts\nconst { data } = await client.getNotificationTemplate({\n id: \'123e4567-e89b-12d3-a456-426614174000\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "_schema": "string",\n "_title": "string",\n "_org": "string",\n "_tags": ["string"],\n "_created_at": "1970-01-01T00:00:00.000Z",\n "_updated_at": "1970-01-01T00:00:00.000Z",\n "_manifest": ["123e4567-e89b-12d3-a456-426614174000"],\n "_owners": [\n {\n "org_id": "string",\n "user_id": "string"\n }\n ],\n "_acl": {\n "view": ["string"],\n "edit": ["string"],\n "delete": ["string"]\n },\n "name": "string",\n "type": "string",\n "notification_title": "string",\n "message": "string",\n "action_label": "string",\n "action_url": "string",\n "style": "string",\n "system_template": true,\n "created_by": "string",\n "updated_by": "string"\n}\n```\n\n</details>\n\n---\n\n### `updateNotificationTemplate`\n\nUpdate a notification template (full replacement)\n\n`PUT /v1/notification/templates/{id}`\n\n```ts\nconst { data } = await client.updateNotificationTemplate(\n {\n id: \'123e4567-e89b-12d3-a456-426614174000\',\n },\n {\n name: \'string\',\n notification_title: \'string\',\n message: \'string\',\n action_label: \'string\',\n action_url: \'string\',\n style: \'string\',\n _title: \'string\',\n _tags: [\'string\'],\n _manifest: [\'123e4567-e89b-12d3-a456-426614174000\']\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "_schema": "string",\n "_title": "string",\n "_org": "string",\n "_tags": ["string"],\n "_created_at": "1970-01-01T00:00:00.000Z",\n "_updated_at": "1970-01-01T00:00:00.000Z",\n "_manifest": ["123e4567-e89b-12d3-a456-426614174000"],\n "_owners": [\n {\n "org_id": "string",\n "user_id": "string"\n }\n ],\n "_acl": {\n "view": ["string"],\n "edit": ["string"],\n "delete": ["string"]\n },\n "name": "string",\n "type": "string",\n "notification_title": "string",\n "message": "string",\n "action_label": "string",\n "action_url": "string",\n "style": "string",\n "system_template": true,\n "created_by": "string",\n "updated_by": "string"\n}\n```\n\n</details>\n\n---\n\n### `patchNotificationTemplate`\n\nPartially update a notification template\n\n`PATCH /v1/notification/templates/{id}`\n\n```ts\nconst { data } = await client.patchNotificationTemplate(\n {\n id: \'123e4567-e89b-12d3-a456-426614174000\',\n },\n {\n name: \'string\',\n notification_title: \'string\',\n message: \'string\',\n action_label: \'string\',\n action_url: \'string\',\n style: \'string\',\n _title: \'string\',\n _tags: [\'string\'],\n _manifest: [\'123e4567-e89b-12d3-a456-426614174000\']\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "_schema": "string",\n "_title": "string",\n "_org": "string",\n "_tags": ["string"],\n "_created_at": "1970-01-01T00:00:00.000Z",\n "_updated_at": "1970-01-01T00:00:00.000Z",\n "_manifest": ["123e4567-e89b-12d3-a456-426614174000"],\n "_owners": [\n {\n "org_id": "string",\n "user_id": "string"\n }\n ],\n "_acl": {\n "view": ["string"],\n "edit": ["string"],\n "delete": ["string"]\n },\n "name": "string",\n "type": "string",\n "notification_title": "string",\n "message": "string",\n "action_label": "string",\n "action_url": "string",\n "style": "string",\n "system_template": true,\n "created_by": "string",\n "updated_by": "string"\n}\n```\n\n</details>\n\n---\n\n### `deleteNotificationTemplate`\n\nDelete a notification template permanently\n\n`DELETE /v1/notification/templates/{id}`\n\n```ts\nconst { data } = await client.deleteNotificationTemplate({\n id: \'123e4567-e89b-12d3-a456-426614174000\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",\n "_schema": "string",\n "_title": "string",\n "_org": "string",\n "_tags": ["string"],\n "_created_at": "1970-01-01T00:00:00.000Z",\n "_updated_at": "1970-01-01T00:00:00.000Z",\n "_manifest": ["123e4567-e89b-12d3-a456-426614174000"],\n "_owners": [\n {\n "org_id": "string",\n "user_id": "string"\n }\n ],\n "_acl": {\n "view": ["string"],\n "edit": ["string"],\n "delete": ["string"]\n },\n "name": "string",\n "type": "string",\n "notification_title": "string",\n "message": "string",\n "action_label": "string",\n "action_url": "string",\n "style": "string",\n "system_template": true,\n "created_by": "string",\n "updated_by": "string"\n}\n```\n\n</details>\n\n---\n\n### `sendPreview`\n\nSend a preview notification (both email and in-app) to the requesting user.\nUsed to test notification templates before saving.\n\n`POST /v1/notification/templates/send-preview`\n\n```ts\nconst { data } = await client.sendPreview(\n null,\n {\n template: {\n name: \'string\',\n notification_title: \'string\',\n message: \'string\',\n action_label: \'string\',\n action_url: \'string\',\n style: \'string\',\n _title: \'string\',\n _tags: [\'string\'],\n _manifest: [\'123e4567-e89b-12d3-a456-426614174000\']\n },\n context_ids: {}\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n[\n {\n "success": true,\n "data": {}\n }\n]\n```\n\n</details>\n\n---\n\n## Schemas\n\n### `Error`\n\n```ts\ntype Error = {\n message: string\n code?: string\n}\n```\n\n### `EntityOperation`\n\n```ts\ntype EntityOperation = {\n entity: string // uuid\n operation?: string\n params?: {\n id?: string // uuid\n slug?: string\n }\n payload?: object\n}\n```\n\n### `NotificationItem`\n\n```ts\ntype NotificationItem = {\n id?: number\n notification_id?: number\n timestamp?: string // date-time\n read_state?: boolean\n type: string\n redirect_url?: string\n organization_id?: string\n title: {\n en?: string\n de?: string\n }\n message: {\n en?: string\n de?: string\n }\n payload?: Record<string, unknown>\n caller?: {\n EpilotAuth?: {\n token?: { ... }\n }\n }\n operations?: Array<{\n entity: string // uuid\n operation?: string\n params?: {\n id?: { ... }\n slug?: { ... }\n }\n payload?: object\n }>\n force_notify_users?: Record<string, unknown>\n allowed_channels?: "email" | "in_app"[]\n}\n```\n\n### `Notification`\n\n```ts\ntype Notification = {\n notification_id?: number\n timestamp?: string // date-time\n type: string\n redirect_url?: string\n organization_id?: string\n title: {\n en?: string\n de?: string\n }\n message: {\n en?: string\n de?: string\n }\n payload?: Record<string, unknown>\n caller?: {\n EpilotAuth?: {\n token?: { ... }\n }\n }\n operations?: Array<{\n entity: string // uuid\n operation?: string\n params?: {\n id?: { ... }\n slug?: { ... }\n }\n payload?: object\n }>\n force_notify_users?: Record<string, unknown>\n allowed_channels?: "email" | "in_app"[]\n read_state?: boolean\n visibility_user_ids?: string[]\n}\n```\n\n### `NotificationBase`\n\n```ts\ntype NotificationBase = {\n notification_id?: number\n timestamp?: string // date-time\n type: string\n redirect_url?: string\n organization_id?: string\n title: {\n en?: string\n de?: string\n }\n message: {\n en?: string\n de?: string\n }\n payload?: Record<string, unknown>\n caller?: {\n EpilotAuth?: {\n token?: { ... }\n }\n }\n operations?: Array<{\n entity: string // uuid\n operation?: string\n params?: {\n id?: { ... }\n slug?: { ... }\n }\n payload?: object\n }>\n force_notify_users?: Record<string, unknown>\n allowed_channels?: "email" | "in_app"[]\n}\n```\n\n### `EntityId`\n\n```ts\ntype EntityId = string // uuid\n```\n\n### `Entity`\n\n```ts\ntype Entity = Record<string, unknown>\n```\n\n### `Id`\n\n```ts\ntype Id = number\n```\n\n### `NotificationId`\n\n```ts\ntype NotificationId = number\n```\n\n### `NotificationCallerContext`\n\n```ts\ntype NotificationCallerContext = {\n EpilotAuth?: {\n token?: {\n sub?: { ... }\n email?: { ... }\n cognito:username?: { ... }\n custom:ivy_user_id?: { ... }\n }\n }\n}\n```\n\n### `EntitySlug`\n\nURL-friendly identifier for the entity schema\n\n```ts\ntype EntitySlug = string\n```\n\n### `EntityOwner`\n\n```ts\ntype EntityOwner = {\n org_id: string\n user_id: string\n}\n```\n\n### `EntityAcl`\n\nAccess control list\n\n```ts\ntype EntityAcl = {\n view?: string[]\n edit?: string[]\n delete?: string[]\n}\n```\n\n### `NotificationTemplate`\n\n```ts\ntype NotificationTemplate = {\n _id: string // uuid\n _schema: string\n _title: string\n _org: string\n _tags?: string[]\n _created_at: string // date-time\n _updated_at: string // date-time\n _manifest?: string // uuid[]\n _owners?: Array<{\n org_id: string\n user_id: string\n }>\n _acl?: {\n view?: string[]\n edit?: string[]\n delete?: string[]\n }\n name?: string\n type?: string\n notification_title?: string\n message?: string\n action_label?: string\n action_url?: string\n style?: string\n system_template?: boolean\n created_by?: string\n updated_by?: string\n}\n```\n\n### `CreateNotificationTemplateInput`\n\n```ts\ntype CreateNotificationTemplateInput = {\n name: string\n type: string\n notification_title?: string\n message?: string\n action_label?: string\n action_url?: string\n style?: string\n _title?: string\n _tags?: string[]\n _manifest?: string // uuid[]\n}\n```\n\n### `UpdateNotificationTemplateInput`\n\n```ts\ntype UpdateNotificationTemplateInput = {\n name?: string\n notification_title?: string\n message?: string\n action_label?: string\n action_url?: string\n style?: string\n _title?: string\n _tags?: string[]\n _manifest?: string // uuid[]\n}\n```\n\n### `NotificationTemplateListResponse`\n\n```ts\ntype NotificationTemplateListResponse = {\n results?: Array<{\n _id: string // uuid\n _schema: string\n _title: string\n _org: string\n _tags?: string[]\n _created_at: string // date-time\n _updated_at: string // date-time\n _manifest?: string // uuid[]\n _owners?: Array<{\n org_id: { ... }\n user_id: { ... }\n }>\n _acl?: {\n view?: { ... }\n edit?: { ... }\n delete?: { ... }\n }\n name?: string\n type?: string\n notification_title?: string\n message?: string\n action_label?: string\n action_url?: string\n style?: string\n system_template?: boolean\n created_by?: string\n updated_by?: string\n }>\n hits?: number\n}\n```\n\n### `SendPreviewInput`\n\n```ts\ntype SendPreviewInput = {\n template: {\n name?: string\n notification_title?: string\n message?: string\n action_label?: string\n action_url?: string\n style?: string\n _title?: string\n _tags?: string[]\n _manifest?: string // uuid[]\n }\n context_ids?: Record<string, string>\n}\n```\n\n### `SendPreviewResponse`\n\nArray of results for each notification channel (email, in-app)\n\n```ts\ntype SendPreviewResponse = Array<{\n success: boolean\n data?: unknown\n}>\n```\n';
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
exports.default = notification_default;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { OpenAPIClient, Parameters, AxiosRequestConfig, OperationResponse, UnknownParamsObject } from 'openapi-client-axios';
|
|
2
2
|
|
|
3
3
|
/* Auto-copied from notification-client */
|
|
4
|
-
/* eslint-disable */
|
|
5
|
-
|
|
6
4
|
|
|
7
5
|
|
|
8
6
|
declare namespace Components {
|
|
@@ -208,6 +206,14 @@ declare namespace Components {
|
|
|
208
206
|
force_notify_users?: {
|
|
209
207
|
[name: string]: any;
|
|
210
208
|
};
|
|
209
|
+
/**
|
|
210
|
+
* Optional delivery-channel ceiling. When present, delivery is restricted to the intersection of this set and each recipient's own notification preferences — it can only NARROW delivery, never force a channel on. Absent means no restriction (recipient preferences and per-type defaults apply as before). An empty array suppresses all channels.
|
|
211
|
+
* example:
|
|
212
|
+
* [
|
|
213
|
+
* "in_app"
|
|
214
|
+
* ]
|
|
215
|
+
*/
|
|
216
|
+
allowed_channels?: ("email" | "in_app")[];
|
|
211
217
|
/**
|
|
212
218
|
* example:
|
|
213
219
|
* false
|
|
@@ -301,6 +307,14 @@ declare namespace Components {
|
|
|
301
307
|
force_notify_users?: {
|
|
302
308
|
[name: string]: any;
|
|
303
309
|
};
|
|
310
|
+
/**
|
|
311
|
+
* Optional delivery-channel ceiling. When present, delivery is restricted to the intersection of this set and each recipient's own notification preferences — it can only NARROW delivery, never force a channel on. Absent means no restriction (recipient preferences and per-type defaults apply as before). An empty array suppresses all channels.
|
|
312
|
+
* example:
|
|
313
|
+
* [
|
|
314
|
+
* "in_app"
|
|
315
|
+
* ]
|
|
316
|
+
*/
|
|
317
|
+
allowed_channels?: ("email" | "in_app")[];
|
|
304
318
|
}
|
|
305
319
|
export interface NotificationCallerContext {
|
|
306
320
|
[name: string]: any;
|
|
@@ -447,6 +461,14 @@ declare namespace Components {
|
|
|
447
461
|
force_notify_users?: {
|
|
448
462
|
[name: string]: any;
|
|
449
463
|
};
|
|
464
|
+
/**
|
|
465
|
+
* Optional delivery-channel ceiling. When present, delivery is restricted to the intersection of this set and each recipient's own notification preferences — it can only NARROW delivery, never force a channel on. Absent means no restriction (recipient preferences and per-type defaults apply as before). An empty array suppresses all channels.
|
|
466
|
+
* example:
|
|
467
|
+
* [
|
|
468
|
+
* "in_app"
|
|
469
|
+
* ]
|
|
470
|
+
*/
|
|
471
|
+
allowed_channels?: ("email" | "in_app")[];
|
|
450
472
|
}
|
|
451
473
|
export interface NotificationTemplate {
|
|
452
474
|
/**
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { OpenAPIClient, Parameters, AxiosRequestConfig, OperationResponse, UnknownParamsObject } from 'openapi-client-axios';
|
|
2
2
|
|
|
3
3
|
/* Auto-copied from notification-client */
|
|
4
|
-
/* eslint-disable */
|
|
5
|
-
|
|
6
4
|
|
|
7
5
|
|
|
8
6
|
declare namespace Components {
|
|
@@ -208,6 +206,14 @@ declare namespace Components {
|
|
|
208
206
|
force_notify_users?: {
|
|
209
207
|
[name: string]: any;
|
|
210
208
|
};
|
|
209
|
+
/**
|
|
210
|
+
* Optional delivery-channel ceiling. When present, delivery is restricted to the intersection of this set and each recipient's own notification preferences — it can only NARROW delivery, never force a channel on. Absent means no restriction (recipient preferences and per-type defaults apply as before). An empty array suppresses all channels.
|
|
211
|
+
* example:
|
|
212
|
+
* [
|
|
213
|
+
* "in_app"
|
|
214
|
+
* ]
|
|
215
|
+
*/
|
|
216
|
+
allowed_channels?: ("email" | "in_app")[];
|
|
211
217
|
/**
|
|
212
218
|
* example:
|
|
213
219
|
* false
|
|
@@ -301,6 +307,14 @@ declare namespace Components {
|
|
|
301
307
|
force_notify_users?: {
|
|
302
308
|
[name: string]: any;
|
|
303
309
|
};
|
|
310
|
+
/**
|
|
311
|
+
* Optional delivery-channel ceiling. When present, delivery is restricted to the intersection of this set and each recipient's own notification preferences — it can only NARROW delivery, never force a channel on. Absent means no restriction (recipient preferences and per-type defaults apply as before). An empty array suppresses all channels.
|
|
312
|
+
* example:
|
|
313
|
+
* [
|
|
314
|
+
* "in_app"
|
|
315
|
+
* ]
|
|
316
|
+
*/
|
|
317
|
+
allowed_channels?: ("email" | "in_app")[];
|
|
304
318
|
}
|
|
305
319
|
export interface NotificationCallerContext {
|
|
306
320
|
[name: string]: any;
|
|
@@ -447,6 +461,14 @@ declare namespace Components {
|
|
|
447
461
|
force_notify_users?: {
|
|
448
462
|
[name: string]: any;
|
|
449
463
|
};
|
|
464
|
+
/**
|
|
465
|
+
* Optional delivery-channel ceiling. When present, delivery is restricted to the intersection of this set and each recipient's own notification preferences — it can only NARROW delivery, never force a channel on. Absent means no restriction (recipient preferences and per-type defaults apply as before). An empty array suppresses all channels.
|
|
466
|
+
* example:
|
|
467
|
+
* [
|
|
468
|
+
* "in_app"
|
|
469
|
+
* ]
|
|
470
|
+
*/
|
|
471
|
+
allowed_channels?: ("email" | "in_app")[];
|
|
450
472
|
}
|
|
451
473
|
export interface NotificationTemplate {
|
|
452
474
|
/**
|
package/docs/event-catalog.md
CHANGED
|
@@ -44,8 +44,10 @@ const { data } = await eventCatalogClient.listEvents(...)
|
|
|
44
44
|
- [`ContextEntity`](#contextentity)
|
|
45
45
|
- [`AttachmentField`](#attachmentfield)
|
|
46
46
|
- [`SchemaField`](#schemafield)
|
|
47
|
+
- [`SuccessCriterion`](#successcriterion)
|
|
47
48
|
- [`CommonEventMetadata`](#commoneventmetadata)
|
|
48
49
|
- [`EventJsonSchema`](#eventjsonschema)
|
|
50
|
+
- [`InlineDowngradeStep`](#inlinedowngradestep)
|
|
49
51
|
- [`Event`](#event)
|
|
50
52
|
- [`EventSummary`](#eventsummary)
|
|
51
53
|
- [`GraphDefinition`](#graphdefinition)
|
|
@@ -110,7 +112,17 @@ const { data } = await client.listEvents()
|
|
|
110
112
|
},
|
|
111
113
|
"enabled": true,
|
|
112
114
|
"auto_trigger": true,
|
|
113
|
-
"automation_trigger": true
|
|
115
|
+
"automation_trigger": true,
|
|
116
|
+
"success_criteria": [
|
|
117
|
+
{
|
|
118
|
+
"entity_schema": "contract",
|
|
119
|
+
"attribute": "installment_amount"
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"entity_schema": "billing_account",
|
|
123
|
+
"attribute": "due_date"
|
|
124
|
+
}
|
|
125
|
+
]
|
|
114
126
|
}
|
|
115
127
|
]
|
|
116
128
|
}
|
|
@@ -168,7 +180,17 @@ const { data } = await client.getEvent({
|
|
|
168
180
|
},
|
|
169
181
|
"enabled": true,
|
|
170
182
|
"auto_trigger": true,
|
|
171
|
-
"automation_trigger": true
|
|
183
|
+
"automation_trigger": true,
|
|
184
|
+
"success_criteria": [
|
|
185
|
+
{
|
|
186
|
+
"entity_schema": "contract",
|
|
187
|
+
"attribute": "installment_amount"
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
"entity_schema": "billing_account",
|
|
191
|
+
"attribute": "due_date"
|
|
192
|
+
}
|
|
193
|
+
]
|
|
172
194
|
}
|
|
173
195
|
```
|
|
174
196
|
|
|
@@ -219,7 +241,17 @@ const { data } = await client.patchEvent(
|
|
|
219
241
|
},
|
|
220
242
|
enabled: true,
|
|
221
243
|
auto_trigger: true,
|
|
222
|
-
automation_trigger: true
|
|
244
|
+
automation_trigger: true,
|
|
245
|
+
success_criteria: [
|
|
246
|
+
{
|
|
247
|
+
entity_schema: 'contract',
|
|
248
|
+
attribute: 'installment_amount'
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
entity_schema: 'billing_account',
|
|
252
|
+
attribute: 'due_date'
|
|
253
|
+
}
|
|
254
|
+
]
|
|
223
255
|
},
|
|
224
256
|
)
|
|
225
257
|
```
|
|
@@ -260,7 +292,17 @@ const { data } = await client.patchEvent(
|
|
|
260
292
|
},
|
|
261
293
|
"enabled": true,
|
|
262
294
|
"auto_trigger": true,
|
|
263
|
-
"automation_trigger": true
|
|
295
|
+
"automation_trigger": true,
|
|
296
|
+
"success_criteria": [
|
|
297
|
+
{
|
|
298
|
+
"entity_schema": "contract",
|
|
299
|
+
"attribute": "installment_amount"
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
"entity_schema": "billing_account",
|
|
303
|
+
"attribute": "due_date"
|
|
304
|
+
}
|
|
305
|
+
]
|
|
264
306
|
}
|
|
265
307
|
```
|
|
266
308
|
|
|
@@ -726,6 +768,10 @@ type EventConfigBase = {
|
|
|
726
768
|
enabled?: boolean
|
|
727
769
|
auto_trigger?: boolean
|
|
728
770
|
automation_trigger?: boolean
|
|
771
|
+
success_criteria?: Array<{
|
|
772
|
+
entity_schema: string
|
|
773
|
+
attribute: string
|
|
774
|
+
}>
|
|
729
775
|
}
|
|
730
776
|
```
|
|
731
777
|
|
|
@@ -781,6 +827,10 @@ type EventConfig = {
|
|
|
781
827
|
enabled?: boolean
|
|
782
828
|
auto_trigger?: boolean
|
|
783
829
|
automation_trigger?: boolean
|
|
830
|
+
success_criteria?: Array<{
|
|
831
|
+
entity_schema: string
|
|
832
|
+
attribute: string
|
|
833
|
+
}>
|
|
784
834
|
}
|
|
785
835
|
```
|
|
786
836
|
|
|
@@ -788,7 +838,7 @@ type EventConfig = {
|
|
|
788
838
|
|
|
789
839
|
Payload for updating an event configuration.
|
|
790
840
|
Accepts the same fields as EventConfig (all optional for PATCH).
|
|
791
|
-
Currently `enabled` and `
|
|
841
|
+
Currently `enabled`, `auto_trigger` and `success_criteria` fields are processed.
|
|
792
842
|
|
|
793
843
|
|
|
794
844
|
```ts
|
|
@@ -839,6 +889,10 @@ type UpdateEventPayload = {
|
|
|
839
889
|
enabled?: boolean
|
|
840
890
|
auto_trigger?: boolean
|
|
841
891
|
automation_trigger?: boolean
|
|
892
|
+
success_criteria?: Array<{
|
|
893
|
+
entity_schema: string
|
|
894
|
+
attribute: string
|
|
895
|
+
}>
|
|
842
896
|
}
|
|
843
897
|
```
|
|
844
898
|
|
|
@@ -914,6 +968,22 @@ type SchemaField = {
|
|
|
914
968
|
}
|
|
915
969
|
```
|
|
916
970
|
|
|
971
|
+
### `SuccessCriterion`
|
|
972
|
+
|
|
973
|
+
A single org-defined success criterion: an entity attribute that must be captured
|
|
974
|
+
for this event's change request to be considered complete.
|
|
975
|
+
|
|
976
|
+
Identity is the entity schema plus the attribute name — mirroring the
|
|
977
|
+
EntityOperationTrigger `schema`/`attribute` vocabulary. On write (PATCH), both
|
|
978
|
+
`attribut
|
|
979
|
+
|
|
980
|
+
```ts
|
|
981
|
+
type SuccessCriterion = {
|
|
982
|
+
entity_schema: string
|
|
983
|
+
attribute: string
|
|
984
|
+
}
|
|
985
|
+
```
|
|
986
|
+
|
|
917
987
|
### `CommonEventMetadata`
|
|
918
988
|
|
|
919
989
|
Common metadata fields present in all event payloads
|
|
@@ -930,6 +1000,17 @@ JSON Schema declaring the event payload structure
|
|
|
930
1000
|
type EventJsonSchema = object
|
|
931
1001
|
```
|
|
932
1002
|
|
|
1003
|
+
### `InlineDowngradeStep`
|
|
1004
|
+
|
|
1005
|
+
One step of an event's inline `_downgrades` chain. Maps the current-version payload to the previous version via a JSONata expression. Stamped by Event Catalog at publish time; executed by consumers during walk-back, never by EC itself.
|
|
1006
|
+
|
|
1007
|
+
```ts
|
|
1008
|
+
type InlineDowngradeStep = {
|
|
1009
|
+
to: string
|
|
1010
|
+
jsonata: string
|
|
1011
|
+
}
|
|
1012
|
+
```
|
|
1013
|
+
|
|
933
1014
|
### `Event`
|
|
934
1015
|
|
|
935
1016
|
An event instance in the event history
|
|
@@ -945,6 +1026,10 @@ type Event = {
|
|
|
945
1026
|
_trigger_source_type?: string
|
|
946
1027
|
_trigger_source?: string
|
|
947
1028
|
_ack_id?: string
|
|
1029
|
+
_downgrades?: Array<{
|
|
1030
|
+
to: string
|
|
1031
|
+
jsonata: string
|
|
1032
|
+
}>
|
|
948
1033
|
}
|
|
949
1034
|
```
|
|
950
1035
|
|
|
@@ -2669,6 +2669,7 @@ const { data } = await client.getMonitoringStatsV2(
|
|
|
2669
2669
|
from_date: '2025-01-01T00:00:00Z',
|
|
2670
2670
|
to_date: '2025-01-31T23:59:59Z',
|
|
2671
2671
|
use_case_type: 'inbound',
|
|
2672
|
+
use_case_types: ['inbound'],
|
|
2672
2673
|
group_by: 'use_case_id',
|
|
2673
2674
|
source: 'monitoring'
|
|
2674
2675
|
},
|
|
@@ -3572,7 +3573,7 @@ type IntegrationSettings = {
|
|
|
3572
3573
|
monitoredUseCases?: string[]
|
|
3573
3574
|
monitoredCodes?: string[]
|
|
3574
3575
|
rules: Array<{
|
|
3575
|
-
id
|
|
3576
|
+
id?: { ... }
|
|
3576
3577
|
name?: { ... }
|
|
3577
3578
|
type: { ... }
|
|
3578
3579
|
enabled: { ... }
|
|
@@ -3583,7 +3584,6 @@ type IntegrationSettings = {
|
|
|
3583
3584
|
fallbackThreshold?: { ... }
|
|
3584
3585
|
window?: { ... }
|
|
3585
3586
|
minSampleSize?: { ... }
|
|
3586
|
-
consecutive?: { ... }
|
|
3587
3587
|
quietPeriod?: { ... }
|
|
3588
3588
|
}>
|
|
3589
3589
|
digest: {
|
|
@@ -3629,9 +3629,9 @@ type IntegrationNotificationConfig = {
|
|
|
3629
3629
|
monitoredUseCases?: string[]
|
|
3630
3630
|
monitoredCodes?: string[]
|
|
3631
3631
|
rules: Array<{
|
|
3632
|
-
id
|
|
3632
|
+
id?: string
|
|
3633
3633
|
name?: string
|
|
3634
|
-
type: "critical_error" | "error_threshold" | "warning_threshold" | "success_rate_drop" | "recovery" | "silence"
|
|
3634
|
+
type: "critical_error" | "error_threshold" | "warning_threshold" | "success_rate_drop" | "recovery" | "silence"
|
|
3635
3635
|
enabled: boolean
|
|
3636
3636
|
channels?: {
|
|
3637
3637
|
email: { ... }
|
|
@@ -3643,7 +3643,6 @@ type IntegrationNotificationConfig = {
|
|
|
3643
3643
|
fallbackThreshold?: number
|
|
3644
3644
|
window?: string
|
|
3645
3645
|
minSampleSize?: number
|
|
3646
|
-
consecutive?: number
|
|
3647
3646
|
quietPeriod?: string
|
|
3648
3647
|
}>
|
|
3649
3648
|
digest: {
|
|
@@ -3686,13 +3685,13 @@ type NotificationChannelSet = {
|
|
|
3686
3685
|
|
|
3687
3686
|
### `NotificationRule`
|
|
3688
3687
|
|
|
3689
|
-
A single notification rule. Only the params relevant to a given type are set. The id is
|
|
3688
|
+
A single notification rule. Only the params relevant to a given type are set. The id is optional on write: the server mints a ULID when omitted and preserves a supplied id verbatim (a stable id keeps a rule's AlertState across config saves).
|
|
3690
3689
|
|
|
3691
3690
|
```ts
|
|
3692
3691
|
type NotificationRule = {
|
|
3693
|
-
id
|
|
3692
|
+
id?: string
|
|
3694
3693
|
name?: string
|
|
3695
|
-
type: "critical_error" | "error_threshold" | "warning_threshold" | "success_rate_drop" | "recovery" | "silence"
|
|
3694
|
+
type: "critical_error" | "error_threshold" | "warning_threshold" | "success_rate_drop" | "recovery" | "silence"
|
|
3696
3695
|
enabled: boolean
|
|
3697
3696
|
channels?: {
|
|
3698
3697
|
email: boolean
|
|
@@ -3704,7 +3703,6 @@ type NotificationRule = {
|
|
|
3704
3703
|
fallbackThreshold?: number
|
|
3705
3704
|
window?: string
|
|
3706
3705
|
minSampleSize?: number
|
|
3707
|
-
consecutive?: number
|
|
3708
3706
|
quietPeriod?: string
|
|
3709
3707
|
}
|
|
3710
3708
|
```
|
|
@@ -3805,6 +3803,7 @@ type IntegrationWithUseCases = {
|
|
|
3805
3803
|
allowed_origins?: { ... }
|
|
3806
3804
|
steps: { ... }
|
|
3807
3805
|
response: { ... }
|
|
3806
|
+
prevent_indirect_serving?: { ... }
|
|
3808
3807
|
}
|
|
3809
3808
|
} | {
|
|
3810
3809
|
id: string // uuid
|
|
@@ -3944,11 +3943,11 @@ type UpsertIntegrationWithUseCasesRequest = {
|
|
|
3944
3943
|
allowed_origins?: { ... }
|
|
3945
3944
|
steps: { ... }
|
|
3946
3945
|
response: { ... }
|
|
3946
|
+
prevent_indirect_serving?: { ... }
|
|
3947
3947
|
}
|
|
3948
3948
|
} | {
|
|
3949
3949
|
id?: string // uuid
|
|
3950
3950
|
name: string
|
|
3951
|
-
slug?: string
|
|
3952
3951
|
// ...
|
|
3953
3952
|
}
|
|
3954
3953
|
```
|
|
@@ -4554,6 +4553,7 @@ type EmbeddedUseCaseRequest = {
|
|
|
4554
4553
|
filename?: { ... }
|
|
4555
4554
|
content_type?: { ... }
|
|
4556
4555
|
}
|
|
4556
|
+
prevent_indirect_serving?: boolean
|
|
4557
4557
|
}
|
|
4558
4558
|
} | {
|
|
4559
4559
|
id?: string // uuid
|
|
@@ -4563,7 +4563,6 @@ type EmbeddedUseCaseRequest = {
|
|
|
4563
4563
|
change_description?: string
|
|
4564
4564
|
type: "managed_call"
|
|
4565
4565
|
configuration?: {
|
|
4566
|
-
operation: {
|
|
4567
4566
|
// ...
|
|
4568
4567
|
}
|
|
4569
4568
|
```
|
|
@@ -4685,6 +4684,7 @@ type EmbeddedFileProxyUseCaseRequest = {
|
|
|
4685
4684
|
filename?: { ... }
|
|
4686
4685
|
content_type?: { ... }
|
|
4687
4686
|
}
|
|
4687
|
+
prevent_indirect_serving?: boolean
|
|
4688
4688
|
}
|
|
4689
4689
|
}
|
|
4690
4690
|
```
|
|
@@ -4861,6 +4861,7 @@ type FileProxyUseCase = {
|
|
|
4861
4861
|
filename?: { ... }
|
|
4862
4862
|
content_type?: { ... }
|
|
4863
4863
|
}
|
|
4864
|
+
prevent_indirect_serving?: boolean
|
|
4864
4865
|
}
|
|
4865
4866
|
}
|
|
4866
4867
|
```
|
|
@@ -5020,7 +5021,7 @@ type UseCase = {
|
|
|
5020
5021
|
filename?: { ... }
|
|
5021
5022
|
content_type?: { ... }
|
|
5022
5023
|
}
|
|
5023
|
-
|
|
5024
|
+
prevent_indirect_serving?: boolean
|
|
5024
5025
|
// ...
|
|
5025
5026
|
}
|
|
5026
5027
|
```
|
|
@@ -5112,6 +5113,7 @@ type CreateUseCaseRequest = {
|
|
|
5112
5113
|
filename?: { ... }
|
|
5113
5114
|
content_type?: { ... }
|
|
5114
5115
|
}
|
|
5116
|
+
prevent_indirect_serving?: boolean
|
|
5115
5117
|
}
|
|
5116
5118
|
} | {
|
|
5117
5119
|
name: string
|
|
@@ -5127,7 +5129,6 @@ type CreateUseCaseRequest = {
|
|
|
5127
5129
|
}
|
|
5128
5130
|
request_mapping?: string
|
|
5129
5131
|
response_mapping?: string
|
|
5130
|
-
inbound_use_case_slug?: string
|
|
5131
5132
|
// ...
|
|
5132
5133
|
}
|
|
5133
5134
|
```
|
|
@@ -5241,6 +5242,7 @@ type CreateFileProxyUseCaseRequest = {
|
|
|
5241
5242
|
filename?: { ... }
|
|
5242
5243
|
content_type?: { ... }
|
|
5243
5244
|
}
|
|
5245
|
+
prevent_indirect_serving?: boolean
|
|
5244
5246
|
}
|
|
5245
5247
|
}
|
|
5246
5248
|
```
|
|
@@ -5373,6 +5375,7 @@ type UpdateUseCaseRequest = {
|
|
|
5373
5375
|
filename?: { ... }
|
|
5374
5376
|
content_type?: { ... }
|
|
5375
5377
|
}
|
|
5378
|
+
prevent_indirect_serving?: boolean
|
|
5376
5379
|
}
|
|
5377
5380
|
} | {
|
|
5378
5381
|
name?: string
|
|
@@ -5385,7 +5388,6 @@ type UpdateUseCaseRequest = {
|
|
|
5385
5388
|
method: { ... }
|
|
5386
5389
|
path: { ... }
|
|
5387
5390
|
headers?: { ... }
|
|
5388
|
-
query_params?: { ... }
|
|
5389
5391
|
// ...
|
|
5390
5392
|
}
|
|
5391
5393
|
```
|
|
@@ -5503,6 +5505,7 @@ type UpdateFileProxyUseCaseRequest = {
|
|
|
5503
5505
|
filename?: { ... }
|
|
5504
5506
|
content_type?: { ... }
|
|
5505
5507
|
}
|
|
5508
|
+
prevent_indirect_serving?: boolean
|
|
5506
5509
|
}
|
|
5507
5510
|
}
|
|
5508
5511
|
```
|
|
@@ -5799,6 +5802,7 @@ type FileProxyUseCaseHistoryEntry = {
|
|
|
5799
5802
|
filename?: { ... }
|
|
5800
5803
|
content_type?: { ... }
|
|
5801
5804
|
}
|
|
5805
|
+
prevent_indirect_serving?: boolean
|
|
5802
5806
|
}
|
|
5803
5807
|
}
|
|
5804
5808
|
```
|
|
@@ -6319,6 +6323,7 @@ type FileProxyUseCaseConfiguration = {
|
|
|
6319
6323
|
filename?: string
|
|
6320
6324
|
content_type?: string
|
|
6321
6325
|
}
|
|
6326
|
+
prevent_indirect_serving?: boolean
|
|
6322
6327
|
}
|
|
6323
6328
|
```
|
|
6324
6329
|
|
|
@@ -7268,6 +7273,7 @@ type GetMonitoringStatsV2Request = {
|
|
|
7268
7273
|
from_date?: string // date-time
|
|
7269
7274
|
to_date?: string // date-time
|
|
7270
7275
|
use_case_type?: "inbound" | "outbound" | "file_proxy" | "managed_call" | "secure_proxy"
|
|
7276
|
+
use_case_types?: "inbound" | "outbound" | "file_proxy" | "managed_call" | "secure_proxy"[]
|
|
7271
7277
|
group_by?: "use_case_id" | "use_case_type" | "level" | "code" | "date"
|
|
7272
7278
|
source?: "monitoring" | "incoming"
|
|
7273
7279
|
}
|