@epilot/sdk 2.12.0 → 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/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.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.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-XGCTJYBW.cjs → chunk-AJDY36Y6.cjs} +1 -1
- package/dist/{chunk-FOGUF2AK.js → chunk-L3UZLJPQ.js} +1 -1
- 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 +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/js-yaml-DLCVPJ7G.js +0 -0
- package/docs/event-catalog.md +90 -5
- 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
|
@@ -6,25 +6,25 @@ var _chunkCYS6QBW6cjs = require('../chunk-CYS6QBW6.cjs');
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkAJDY36Y6cjs = require('../chunk-AJDY36Y6.cjs');
|
|
10
10
|
require('../chunk-NJK5F5TF.cjs');
|
|
11
11
|
|
|
12
12
|
// src/apis/workflow-definition.ts
|
|
13
13
|
var loadDefinition = () => {
|
|
14
14
|
const mod = _chunkCYS6QBW6cjs.require_workflow_definition_runtime.call(void 0, );
|
|
15
|
-
return
|
|
15
|
+
return _chunkAJDY36Y6cjs.expand.call(void 0, _nullishCoalesce(mod.default, () => ( mod)));
|
|
16
16
|
};
|
|
17
17
|
var _instance = null;
|
|
18
18
|
var resolve = () => {
|
|
19
19
|
if (!_instance) {
|
|
20
20
|
const def = loadDefinition();
|
|
21
|
-
_instance =
|
|
21
|
+
_instance = _chunkAJDY36Y6cjs.createApiClient.call(void 0, { definition: def, apiName: "workflowDefinition" });
|
|
22
22
|
}
|
|
23
23
|
return _instance;
|
|
24
24
|
};
|
|
25
|
-
var _handle =
|
|
25
|
+
var _handle = _chunkAJDY36Y6cjs.createApiHandle.call(void 0, {
|
|
26
26
|
resolveClient: resolve,
|
|
27
|
-
createClient: () =>
|
|
27
|
+
createClient: () => _chunkAJDY36Y6cjs.createApiClient.call(void 0, { definition: loadDefinition(), apiName: "workflowDefinition" }),
|
|
28
28
|
apiName: "workflowDefinition"
|
|
29
29
|
});
|
|
30
30
|
var getClient = _handle.getClient;
|
|
@@ -35,4 +35,4 @@ var workflowDefinition = _handle;
|
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
|
|
38
|
-
exports.authorize =
|
|
38
|
+
exports.authorize = _chunkAJDY36Y6cjs.authorize; exports.createClient = createClient; exports.getClient = getClient; exports.workflowDefinition = workflowDefinition;
|
package/dist/apis/workflow.cjs
CHANGED
|
@@ -6,25 +6,25 @@ var _chunkPM25LLETcjs = require('../chunk-PM25LLET.cjs');
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkAJDY36Y6cjs = require('../chunk-AJDY36Y6.cjs');
|
|
10
10
|
require('../chunk-NJK5F5TF.cjs');
|
|
11
11
|
|
|
12
12
|
// src/apis/workflow.ts
|
|
13
13
|
var loadDefinition = () => {
|
|
14
14
|
const mod = _chunkPM25LLETcjs.require_workflow_runtime.call(void 0, );
|
|
15
|
-
return
|
|
15
|
+
return _chunkAJDY36Y6cjs.expand.call(void 0, _nullishCoalesce(mod.default, () => ( mod)));
|
|
16
16
|
};
|
|
17
17
|
var _instance = null;
|
|
18
18
|
var resolve = () => {
|
|
19
19
|
if (!_instance) {
|
|
20
20
|
const def = loadDefinition();
|
|
21
|
-
_instance =
|
|
21
|
+
_instance = _chunkAJDY36Y6cjs.createApiClient.call(void 0, { definition: def, apiName: "workflow" });
|
|
22
22
|
}
|
|
23
23
|
return _instance;
|
|
24
24
|
};
|
|
25
|
-
var _handle =
|
|
25
|
+
var _handle = _chunkAJDY36Y6cjs.createApiHandle.call(void 0, {
|
|
26
26
|
resolveClient: resolve,
|
|
27
|
-
createClient: () =>
|
|
27
|
+
createClient: () => _chunkAJDY36Y6cjs.createApiClient.call(void 0, { definition: loadDefinition(), apiName: "workflow" }),
|
|
28
28
|
apiName: "workflow"
|
|
29
29
|
});
|
|
30
30
|
var getClient = _handle.getClient;
|
|
@@ -35,4 +35,4 @@ var workflow = _handle;
|
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
|
|
38
|
-
exports.authorize =
|
|
38
|
+
exports.authorize = _chunkAJDY36Y6cjs.authorize; exports.createClient = createClient; exports.getClient = getClient; exports.workflow = workflow;
|
package/dist/apis/workflow.js
CHANGED
|
@@ -53,7 +53,7 @@ var globImport_docs = _chunkNJK5F5TFcjs.__glob.call(void 0, {
|
|
|
53
53
|
"./docs/entity.json": () => Promise.resolve().then(() => _interopRequireWildcard(require("./entity-SS36LQO6.cjs"))),
|
|
54
54
|
"./docs/environments.json": () => Promise.resolve().then(() => _interopRequireWildcard(require("./environments-QJ4UMJ5C.cjs"))),
|
|
55
55
|
"./docs/erp-integration.json": () => Promise.resolve().then(() => _interopRequireWildcard(require("./erp-integration-PAVHSUDM.cjs"))),
|
|
56
|
-
"./docs/event-catalog.json": () => Promise.resolve().then(() => _interopRequireWildcard(require("./event-catalog-
|
|
56
|
+
"./docs/event-catalog.json": () => Promise.resolve().then(() => _interopRequireWildcard(require("./event-catalog-6ZSSF5JU.cjs"))),
|
|
57
57
|
"./docs/file.json": () => Promise.resolve().then(() => _interopRequireWildcard(require("./file-7CQXDQ3I.cjs"))),
|
|
58
58
|
"./docs/iban.json": () => Promise.resolve().then(() => _interopRequireWildcard(require("./iban-24GHLFDB.cjs"))),
|
|
59
59
|
"./docs/integration-toolkit.json": () => Promise.resolve().then(() => _interopRequireWildcard(require("./integration-toolkit-2BLX4CSH.cjs"))),
|
|
@@ -53,7 +53,7 @@ var globImport_docs = __glob({
|
|
|
53
53
|
"./docs/entity.json": () => import("./entity-Z4YWKDVG.js"),
|
|
54
54
|
"./docs/environments.json": () => import("./environments-PXJOTQVM.js"),
|
|
55
55
|
"./docs/erp-integration.json": () => import("./erp-integration-SBQJ6HEG.js"),
|
|
56
|
-
"./docs/event-catalog.json": () => import("./event-catalog-
|
|
56
|
+
"./docs/event-catalog.json": () => import("./event-catalog-RS4LJMY2.js"),
|
|
57
57
|
"./docs/file.json": () => import("./file-O6ZD3HOU.js"),
|
|
58
58
|
"./docs/iban.json": () => import("./iban-LDKYDVQV.js"),
|
|
59
59
|
"./docs/integration-toolkit.json": () => import("./integration-toolkit-OLFKCTLY.js"),
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-NJK5F5TF.cjs');
|
|
2
|
+
|
|
3
|
+
// src/docs/event-catalog.json
|
|
4
|
+
var event_catalog_default = '# Event Catalog API\n\n- **Base URL:** `https://event-catalog.sls.epilot.io`\n- **Full API Docs:** [https://docs.epilot.io/api/event-catalog](https://docs.epilot.io/api/event-catalog)\n\n## Usage\n\n```ts\nimport { epilot } from \'@epilot/sdk\'\n\nepilot.authorize(() => \'<token>\')\nconst { data } = await epilot.eventCatalog.listEvents(...)\n```\n\n### Tree-shakeable import\n\n```ts\nimport { getClient, authorize } from \'@epilot/sdk/event-catalog\'\n\nconst eventCatalogClient = getClient()\nauthorize(eventCatalogClient, () => \'<token>\')\nconst { data } = await eventCatalogClient.listEvents(...)\n```\n\n## Operations\n\n**Event Catalog**\n- [`listEvents`](#listevents)\n- [`getEvent`](#getevent)\n- [`patchEvent`](#patchevent)\n- [`getEventJSONSchema`](#geteventjsonschema)\n- [`getEventExample`](#geteventexample)\n- [`listEventVersions`](#listeventversions)\n- [`searchEventHistory`](#searcheventhistory)\n- [`searchEventHistoryV2`](#searcheventhistoryv2)\n- [`getHistoricalEvent`](#gethistoricalevent)\n- [`triggerEvent`](#triggerevent)\n\n**Schemas**\n- [`EventConfigBase`](#eventconfigbase)\n- [`EventConfig`](#eventconfig)\n- [`UpdateEventPayload`](#updateeventpayload)\n- [`PrimitiveField`](#primitivefield)\n- [`ContextEntity`](#contextentity)\n- [`AttachmentField`](#attachmentfield)\n- [`SchemaField`](#schemafield)\n- [`SuccessCriterion`](#successcriterion)\n- [`CommonEventMetadata`](#commoneventmetadata)\n- [`EventJsonSchema`](#eventjsonschema)\n- [`InlineDowngradeStep`](#inlinedowngradestep)\n- [`Event`](#event)\n- [`EventSummary`](#eventsummary)\n- [`GraphDefinition`](#graphdefinition)\n- [`GraphNode`](#graphnode)\n- [`GraphEdge`](#graphedge)\n- [`EntityOperationTrigger`](#entityoperationtrigger)\n- [`SearchOptions`](#searchoptions)\n- [`SearchOptionsV2`](#searchoptionsv2)\n- [`FieldsParam`](#fieldsparam)\n- [`TriggerEventPayload`](#triggereventpayload)\n- [`TriggerEventResponse`](#triggereventresponse)\n- [`EventAttachment`](#eventattachment)\n- [`FieldChange`](#fieldchange)\n- [`VersionMeta`](#versionmeta)\n- [`EventVersionRegistrySummary`](#eventversionregistrysummary)\n\n### `listEvents`\n\nRetrieve list of available business events\n\n`GET /v1/events`\n\n```ts\nconst { data } = await client.listEvents()\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "results": [\n {\n "event_name": "AddMeterReading",\n "event_title": "Add Meter Reading",\n "event_description": "Triggered when a new meter reading is added",\n "event_version": "1.0",\n "event_status": "active",\n "event_tags": ["builtin", "metering", "erp"],\n "schema_fields": {},\n "entity_graph": {\n "nodes": [\n {\n "id": "contact",\n "schema": "contact",\n "cardinality": "one",\n "fields": ["_id", "_title", "first_name", "account", "!account.*._files", "**._product"]\n }\n ],\n "edges": [\n {\n "from": "contact",\n "to": "billing_account"\n }\n ]\n },\n "entity_operation": {\n "operation": ["createEntity", "updateEntity"],\n "schema": ["contact", "contract", "order"],\n "attribute": ["email", "phone", "status"],\n "purpose": ["K\xFCndigung", "Umzug/Auszug"]\n },\n "enabled": true,\n "auto_trigger": true,\n "automation_trigger": true,\n "success_criteria": [\n {\n "entity_schema": "contract",\n "attribute": "installment_amount"\n },\n {\n "entity_schema": "billing_account",\n "attribute": "due_date"\n }\n ]\n }\n ]\n}\n```\n\n</details>\n\n---\n\n### `getEvent`\n\nRetrieve the configuration of a specific business event\n\n`GET /v1/events/{event_name}`\n\n```ts\nconst { data } = await client.getEvent({\n event_name: \'example\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "event_name": "AddMeterReading",\n "event_title": "Add Meter Reading",\n "event_description": "Triggered when a new meter reading is added",\n "event_version": "1.0",\n "event_status": "active",\n "event_tags": ["builtin", "metering", "erp"],\n "schema_fields": {},\n "entity_graph": {\n "nodes": [\n {\n "id": "contact",\n "schema": "contact",\n "cardinality": "one",\n "fields": ["_id", "_title", "first_name", "account", "!account.*._files", "**._product"]\n }\n ],\n "edges": [\n {\n "from": "contact",\n "to": "billing_account"\n }\n ]\n },\n "entity_operation": {\n "operation": ["createEntity", "updateEntity"],\n "schema": ["contact", "contract", "order"],\n "attribute": ["email", "phone", "status"],\n "purpose": ["K\xFCndigung", "Umzug/Auszug"]\n },\n "enabled": true,\n "auto_trigger": true,\n "automation_trigger": true,\n "success_criteria": [\n {\n "entity_schema": "contract",\n "attribute": "installment_amount"\n },\n {\n "entity_schema": "billing_account",\n "attribute": "due_date"\n }\n ]\n}\n```\n\n</details>\n\n---\n\n### `patchEvent`\n\nUpdate the configuration of a specific business event for the organization\n\n`PATCH /v1/events/{event_name}`\n\n```ts\nconst { data } = await client.patchEvent(\n {\n event_name: \'example\',\n },\n {\n event_name: \'AddMeterReading\',\n event_title: \'Add Meter Reading\',\n event_description: \'Triggered when a new meter reading is added\',\n event_version: \'1.0\',\n event_status: \'active\',\n event_tags: [\'builtin\', \'metering\', \'erp\'],\n schema_fields: {},\n entity_graph: {\n nodes: [\n {\n id: \'contact\',\n schema: \'contact\',\n cardinality: \'one\',\n fields: [\'_id\', \'_title\', \'first_name\', \'account\', \'!account.*._files\', \'**._product\']\n }\n ],\n edges: [\n {\n from: \'contact\',\n to: \'billing_account\'\n }\n ]\n },\n entity_operation: {\n operation: [\'createEntity\', \'updateEntity\'],\n schema: [\'contact\', \'contract\', \'order\'],\n attribute: [\'email\', \'phone\', \'status\'],\n purpose: [\'K\xFCndigung\', \'Umzug/Auszug\']\n },\n enabled: true,\n auto_trigger: true,\n automation_trigger: true,\n success_criteria: [\n {\n entity_schema: \'contract\',\n attribute: \'installment_amount\'\n },\n {\n entity_schema: \'billing_account\',\n attribute: \'due_date\'\n }\n ]\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "event_name": "AddMeterReading",\n "event_title": "Add Meter Reading",\n "event_description": "Triggered when a new meter reading is added",\n "event_version": "1.0",\n "event_status": "active",\n "event_tags": ["builtin", "metering", "erp"],\n "schema_fields": {},\n "entity_graph": {\n "nodes": [\n {\n "id": "contact",\n "schema": "contact",\n "cardinality": "one",\n "fields": ["_id", "_title", "first_name", "account", "!account.*._files", "**._product"]\n }\n ],\n "edges": [\n {\n "from": "contact",\n "to": "billing_account"\n }\n ]\n },\n "entity_operation": {\n "operation": ["createEntity", "updateEntity"],\n "schema": ["contact", "contract", "order"],\n "attribute": ["email", "phone", "status"],\n "purpose": ["K\xFCndigung", "Umzug/Auszug"]\n },\n "enabled": true,\n "auto_trigger": true,\n "automation_trigger": true,\n "success_criteria": [\n {\n "entity_schema": "contract",\n "attribute": "installment_amount"\n },\n {\n "entity_schema": "billing_account",\n "attribute": "due_date"\n }\n ]\n}\n```\n\n</details>\n\n---\n\n### `getEventJSONSchema`\n\nRetrieve the JSON Schema of a specific business event. Pass an optional\n`Epilot-Event-Version` header to retrieve a specific version\'s schema;\nwhen omitted, the event\'s latest version is returned.\n\n`GET /v1/events/{event_name}/json_schema`\n\n```ts\nconst { data } = await client.getEventJSONSchema({\n event_name: \'example\',\n Epilot-Event-Version: \'example\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "type": "object",\n "properties": {\n "_org_id": {\n "type": "string",\n "description": "epilot tenant/organization ID"\n },\n "_event_time": {\n "type": "string",\n "format": "date-time",\n "description": "ISO 8601 timestamp when event occurred"\n },\n "_event_id": {\n "type": "string",\n "description": "Unique event identifier (ULID)"\n },\n "_event_name": {\n "type": "string",\n "description": "Event name from catalog"\n },\n "_event_version": {\n "type": "string",\n "description": "Event payload version (MAJOR.MINOR)"\n },\n "_event_source": {\n "type": "string",\n "description": "Source that triggered the event"\n },\n "reading_value": {\n "type": "number",\n "description": "The meter reading value"\n },\n "reading_date": {\n "type": "string",\n "format": "date-time",\n "description": "ISO 8601 timestamp when reading was taken"\n },\n "read_by": {\n "type": "string",\n "description": "Name or identifier of who submitted the reading"\n },\n "reason": {\n "type": "string",\n "enum": ["regular", "move-in", "move-out", "supplier-change", "correction", "final"],\n "description": "Reason for the meter reading"\n },\n "direction": {\n "type": "string",\n "enum": ["feed-in", "feed-out"],\n "description": "Direction of energy flow"\n },\n "source": {\n "type": "string",\n "enum": ["portal", "360", "api", "automation"],\n "description": "Source system where reading was submitted"\n },\n "meter_id": {\n "type": "string",\n "format": "uuid",\n "description": "Entity ID of the meter"\n },\n "counter_id": {\n "type": "string",\n "format": "uuid",\n "description": "Entity ID of the meter counter"\n },\n "meter_number": {\n "type": "string",\n "description": "Human-readable meter number"\n },\n "obis_number": {\n "type": "string",\n "description": "OBIS code of the counter"\n },\n "unit": {\n "type": "string",\n "description": "Unit of measurement (e.g., kWh, m3)"\n },\n "customer_id": {\n "type": "string",\n "format": "uuid",\n "description": "Entity ID of the customer"\n },\n "contract_id": {\n "type": "string",\n "format": "uuid",\n "description": "Entity ID of the contract"\n },\n "user_id": {\n "type": "string",\n "description": "ID of the user who submitted the reading"\n },\n "user_email": {\n "type": "string",\n "format": "email",\n "description": "Email of the user who submitted the reading"\n }\n },\n "required": ["_org_id", "_event_time", "_event_id", "_event_name", "_event_version", "_event_source", "reading_value", "reading_date", "read_by", "reason", "direction", "source", "meter_id", "counter_id", "meter_number", "obis_number", "unit", "customer_id", "contract_id"]\n}\n```\n\n</details>\n\n---\n\n### `getEventExample`\n\nGenerate a sample event payload based on the event\'s JSON Schema. Pass an\noptional `Epilot-Event-Version` header to generate the example for a\nspecific version; when omitted, the event\'s latest versio\n\n`GET /v1/events/{event_name}/example`\n\n```ts\nconst { data } = await client.getEventExample({\n event_name: \'example\',\n Epilot-Event-Version: \'example\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{}\n```\n\n</details>\n\n---\n\n### `listEventVersions`\n\nList every known version of an event, along with the `latest`\nand the set of currently `active` versions. See \xA73.2 of the\nEvent Payload Versioning RFC.\n\n`GET /v1/events/{event_name}/versions`\n\n```ts\nconst { data } = await client.listEventVersions({\n event_name: \'example\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "event_name": "MeterReadingAdded",\n "latest": "1.0",\n "versions": [\n {\n "version": "1.0",\n "released_at": "2025-11-15",\n "change_summary": "string",\n "change_notes": "string",\n "changes": [\n {\n "field": "reading",\n "op": "added",\n "type_old": "string",\n "type_new": "string"\n }\n ]\n }\n ]\n}\n```\n\n</details>\n\n---\n\n### `searchEventHistory`\n\nPaginated history of events\n\n`POST /v1/events/{event_name}:history`\n\n```ts\nconst { data } = await client.searchEventHistory(\n {\n event_name: \'example\',\n },\n {\n limit: 10,\n cursor: {\n event_time: \'2025-10-31 12:34:56\',\n event_id: \'evt_1234567890abcdef\'\n },\n timestamp: {\n from: \'2025-10-01T00:00:00Z\',\n to: \'2025-10-31T23:59:59Z\'\n },\n event_id: \'evt_1234567890abcdef\'\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "results": [\n {\n "_org_id": "org_123456",\n "_event_time": "2024-01-01T12:00:00Z",\n "_event_id": "01FZ4Z5FZ5FZ5FZ5FZ5FZ5FZ5F",\n "_event_name": "MeterReading",\n "_event_version": "1.0",\n "_event_source": "api",\n "_trigger_source_type": "api",\n "_trigger_source": "user_123456",\n "reading_value": 123.45,\n "reading_date": "2024-01-01T11:59:00Z",\n "read_by": "John Doe",\n "reason": "regular",\n "direction": "feed-out",\n "source": "portal",\n "meter_id": "550e8400-e29b-41d4-a716-446655440000",\n "counter_id": "660e8400-e29b-41d4-a716-446655440000",\n "meter_number": "MT123456789",\n "obis_number": "1-0:1.8.0",\n "unit": "kWh",\n "customer_id": "770e8400-e29b-41d4-a716-446655440000",\n "contract_id": "880e8400-e29b-41d4-a716-446655440000"\n }\n ],\n "next_cursor": {\n "event_time": "2025-10-31T12:34:56Z",\n "event_id": "evt_1234567890abcdef"\n }\n}\n```\n\n</details>\n\n---\n\n### `searchEventHistoryV2`\n\nPaginated history of events with projected/lightweight payload (v2).\n\n`POST /v2/events/{event_name}:history`\n\n```ts\nconst { data } = await client.searchEventHistoryV2(\n {\n event_name: \'example\',\n },\n {\n limit: 10,\n cursor: {\n event_time: \'2025-10-31 12:34:56\',\n event_id: \'evt_1234567890abcdef\'\n },\n timestamp: {\n from: \'2025-10-01T00:00:00Z\',\n to: \'2025-10-31T23:59:59Z\'\n },\n event_id: \'evt_1234567890abcdef\',\n fields: [\'_id\', \'_title\', \'first_name\', \'account\', \'!account.*._files\', \'**._product\']\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "results": [\n {\n "_org_id": "string",\n "_event_time": "1970-01-01T00:00:00.000Z",\n "_event_id": "string",\n "_event_name": "string",\n "_event_version": "1.0",\n "_event_source": "string",\n "_trigger_source_type": "api",\n "_trigger_source": "string",\n "_ack_id": "string"\n }\n ],\n "next_cursor": {\n "event_time": "2025-10-31T12:34:56Z",\n "event_id": "evt_1234567890abcdef"\n }\n}\n```\n\n</details>\n\n---\n\n### `getHistoricalEvent`\n\nFetch a single historical event by id with full hydration\n\n`GET /v2/events/{event_name}/history/{event_id}`\n\n```ts\nconst { data } = await client.getHistoricalEvent({\n event_name: \'example\',\n event_id: \'example\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "_org_id": "org_123456",\n "_event_time": "2024-01-01T12:00:00Z",\n "_event_id": "01FZ4Z5FZ5FZ5FZ5FZ5FZ5FZ5F",\n "_event_name": "MeterReading",\n "_event_version": "1.0",\n "_event_source": "api",\n "_trigger_source_type": "api",\n "_trigger_source": "user_123456",\n "reading_value": 123.45,\n "reading_date": "2024-01-01T11:59:00Z",\n "read_by": "John Doe",\n "reason": "regular",\n "direction": "feed-out",\n "source": "portal",\n "meter_id": "550e8400-e29b-41d4-a716-446655440000",\n "counter_id": "660e8400-e29b-41d4-a716-446655440000",\n "meter_number": "MT123456789",\n "obis_number": "1-0:1.8.0",\n "unit": "kWh",\n "customer_id": "770e8400-e29b-41d4-a716-446655440000",\n "contract_id": "880e8400-e29b-41d4-a716-446655440000"\n}\n```\n\n</details>\n\n---\n\n### `triggerEvent`\n\nExplicitly trigger an event by providing input field values and an optional entity seed\nfor graph hydration. The event must be enabled for the organization.\n\n`POST /v1/events/{event_name}:trigger`\n\n```ts\nconst { data } = await client.triggerEvent(\n {\n event_name: \'example\',\n },\n {\n seed: {\n entity_id: \'3fa85f64-5717-4562-b3fc-2c963f66afa6\',\n node_id: \'string\'\n },\n fields: {},\n skip_hydration: [\'string\'],\n _trigger_source_type: \'string\',\n _trigger_source: \'string\'\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "success": true,\n "event_id": "string",\n "event_bridge_event_id": "string"\n}\n```\n\n</details>\n\n---\n\n## Schemas\n\n### `EventConfigBase`\n\nBase properties shared between EventConfig and UpdateEventPayload\n\n```ts\ntype EventConfigBase = {\n event_name?: string\n event_title?: string\n event_description?: string\n event_version?: string\n event_status?: "active" | "deprecated" | "draft" | "disabled"\n event_tags?: string[]\n schema_fields?: Record<string, {\n json_schema: object\n required?: boolean\n graph_source?: string\n } | {\n entity_schema: string\n required?: boolean\n } | {\n items: {\n entity_id: { ... }\n filename?: { ... }\n mime_type?: { ... }\n size_bytes?: { ... }\n s3ref?: { ... }\n version_index: { ... }\n readable_size?: { ... }\n }\n required?: boolean\n }>\n entity_graph?: {\n nodes: Array<{\n id: { ... }\n schema: { ... }\n cardinality?: { ... }\n fields?: { ... }\n }>\n edges: Array<{\n from: { ... }\n to: { ... }\n }>\n }\n entity_operation?: {\n operation: "createEntity" | "updateEntity" | "deleteEntity"[]\n schema: string[]\n attribute?: string[]\n purpose?: string[]\n }\n enabled?: boolean\n auto_trigger?: boolean\n automation_trigger?: boolean\n success_criteria?: Array<{\n entity_schema: string\n attribute: string\n }>\n}\n```\n\n### `EventConfig`\n\nEvent configuration with required fields\n\n```ts\ntype EventConfig = {\n event_name: string\n event_title?: string\n event_description?: string\n event_version: string\n event_status?: "active" | "deprecated" | "draft" | "disabled"\n event_tags?: string[]\n schema_fields: Record<string, {\n json_schema: object\n required?: boolean\n graph_source?: string\n } | {\n entity_schema: string\n required?: boolean\n } | {\n items: {\n entity_id: { ... }\n filename?: { ... }\n mime_type?: { ... }\n size_bytes?: { ... }\n s3ref?: { ... }\n version_index: { ... }\n readable_size?: { ... }\n }\n required?: boolean\n }>\n entity_graph?: {\n nodes: Array<{\n id: { ... }\n schema: { ... }\n cardinality?: { ... }\n fields?: { ... }\n }>\n edges: Array<{\n from: { ... }\n to: { ... }\n }>\n }\n entity_operation?: {\n operation: "createEntity" | "updateEntity" | "deleteEntity"[]\n schema: string[]\n attribute?: string[]\n purpose?: string[]\n }\n enabled?: boolean\n auto_trigger?: boolean\n automation_trigger?: boolean\n success_criteria?: Array<{\n entity_schema: string\n attribute: string\n }>\n}\n```\n\n### `UpdateEventPayload`\n\nPayload for updating an event configuration.\nAccepts the same fields as EventConfig (all optional for PATCH).\nCurrently `enabled`, `auto_trigger` and `success_criteria` fields are processed.\n\n\n```ts\ntype UpdateEventPayload = {\n event_name?: string\n event_title?: string\n event_description?: string\n event_version?: string\n event_status?: "active" | "deprecated" | "draft" | "disabled"\n event_tags?: string[]\n schema_fields?: Record<string, {\n json_schema: object\n required?: boolean\n graph_source?: string\n } | {\n entity_schema: string\n required?: boolean\n } | {\n items: {\n entity_id: { ... }\n filename?: { ... }\n mime_type?: { ... }\n size_bytes?: { ... }\n s3ref?: { ... }\n version_index: { ... }\n readable_size?: { ... }\n }\n required?: boolean\n }>\n entity_graph?: {\n nodes: Array<{\n id: { ... }\n schema: { ... }\n cardinality?: { ... }\n fields?: { ... }\n }>\n edges: Array<{\n from: { ... }\n to: { ... }\n }>\n }\n entity_operation?: {\n operation: "createEntity" | "updateEntity" | "deleteEntity"[]\n schema: string[]\n attribute?: string[]\n purpose?: string[]\n }\n enabled?: boolean\n auto_trigger?: boolean\n automation_trigger?: boolean\n success_criteria?: Array<{\n entity_schema: string\n attribute: string\n }>\n}\n```\n\n### `PrimitiveField`\n\nA primitive JSON Schema field definition\n\n```ts\ntype PrimitiveField = {\n json_schema: object\n required?: boolean\n graph_source?: string\n}\n```\n\n### `ContextEntity`\n\n```ts\ntype ContextEntity = {\n entity_schema: string\n required?: boolean\n}\n```\n\n### `AttachmentField`\n\nA schema field representing file attachments associated with the event.\nPresent in schema_fields for events tagged with "attachment".\n\n\n```ts\ntype AttachmentField = {\n items: {\n entity_id: string // uuid\n filename?: string\n mime_type?: string\n size_bytes?: number\n s3ref?: {\n bucket: { ... }\n key: { ... }\n }\n version_index: number\n readable_size?: string\n }\n required?: boolean\n}\n```\n\n### `SchemaField`\n\n```ts\ntype SchemaField = {\n json_schema: object\n required?: boolean\n graph_source?: string\n} | {\n entity_schema: string\n required?: boolean\n} | {\n items: {\n entity_id: string // uuid\n filename?: string\n mime_type?: string\n size_bytes?: number\n s3ref?: {\n bucket: { ... }\n key: { ... }\n }\n version_index: number\n readable_size?: string\n }\n required?: boolean\n}\n```\n\n### `SuccessCriterion`\n\nA single org-defined success criterion: an entity attribute that must be captured\nfor this event\'s change request to be considered complete.\n\nIdentity is the entity schema plus the attribute name \u2014 mirroring the\nEntityOperationTrigger `schema`/`attribute` vocabulary. On write (PATCH), both\n`attribut\n\n```ts\ntype SuccessCriterion = {\n entity_schema: string\n attribute: string\n}\n```\n\n### `CommonEventMetadata`\n\nCommon metadata fields present in all event payloads\n\n```ts\ntype CommonEventMetadata = object\n```\n\n### `EventJsonSchema`\n\nJSON Schema declaring the event payload structure\n\n```ts\ntype EventJsonSchema = object\n```\n\n### `InlineDowngradeStep`\n\nOne 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.\n\n```ts\ntype InlineDowngradeStep = {\n to: string\n jsonata: string\n}\n```\n\n### `Event`\n\nAn event instance in the event history\n\n```ts\ntype Event = {\n _org_id: string\n _event_time: string // date-time\n _event_id: string\n _event_name: string\n _event_version: string\n _event_source: string\n _trigger_source_type?: string\n _trigger_source?: string\n _ack_id?: string\n _downgrades?: Array<{\n to: string\n jsonata: string\n }>\n}\n```\n\n### `EventSummary`\n\nA lightweight event summary returned by the v2 history endpoint.\n\nIncludes the standard `_*` metadata fields plus a projected subset of the\nevent payload. Hydrated entity objects (values carrying `_schema` or `_id`)\n\u2014 and arrays of such objects \u2014 are reduced to reference stubs\n`{_schema, _id, _title\n\n```ts\ntype EventSummary = {\n _org_id: string\n _event_time: string // date-time\n _event_id: string\n _event_name: string\n _event_version: string\n _event_source: string\n _trigger_source_type?: string\n _trigger_source?: string\n _ack_id?: string\n}\n```\n\n### `GraphDefinition`\n\nEntity graph definition for resolving related entities\n\n```ts\ntype GraphDefinition = {\n nodes: Array<{\n id: string\n schema: string\n cardinality?: "one" | "many"\n fields?: object\n }>\n edges: Array<{\n from: string\n to: string\n }>\n}\n```\n\n### `GraphNode`\n\nA node in the entity graph\n\n```ts\ntype GraphNode = {\n id: string\n schema: string\n cardinality?: "one" | "many"\n fields?: object\n}\n```\n\n### `GraphEdge`\n\nAn edge connecting two nodes in the graph\n\n```ts\ntype GraphEdge = {\n from: string\n to: string\n}\n```\n\n### `EntityOperationTrigger`\n\nConfiguration for triggering an event based on entity operations.\n\nWhen an entity operation matches the configured criteria, the event will be triggered.\n- On createEntity: the attribute must be present in the entity payload\n- On updateEntity: the attribute must be in diff.added, diff.updated, or di\n\n```ts\ntype EntityOperationTrigger = {\n operation: "createEntity" | "updateEntity" | "deleteEntity"[]\n schema: string[]\n attribute?: string[]\n purpose?: string[]\n}\n```\n\n### `SearchOptions`\n\n```ts\ntype SearchOptions = {\n limit?: number\n cursor?: {\n event_time?: string\n event_id?: string\n }\n timestamp?: {\n from?: string // date-time\n to?: string // date-time\n }\n event_id?: string\n}\n```\n\n### `SearchOptionsV2`\n\nSearch options for the v2 history endpoint.\n\nExtends `SearchOptions` with an optional `fields` projection. When `fields`\nis omitted, the response includes all `_*` metadata plus all scalar payload\nfields (and primitive arrays / empty objects/arrays) after entity stripping.\nWhen `fields` is provided,\n\n```ts\ntype SearchOptionsV2 = {\n limit?: number\n cursor?: {\n event_time?: string\n event_id?: string\n }\n timestamp?: {\n from?: string // date-time\n to?: string // date-time\n }\n event_id?: string\n fields?: string[]\n}\n```\n\n### `FieldsParam`\n\nList of entity fields to include or exclude in the response\n\nUse ! to exclude fields, e.g. `!_id` to exclude the `_id` field.\n\nGlobbing and globstart (**) is supported for nested fields.\n\n\n```ts\ntype FieldsParam = string[]\n```\n\n### `TriggerEventPayload`\n\nPayload for explicitly triggering an event via API\n\n```ts\ntype TriggerEventPayload = {\n seed?: {\n entity_id: string // uuid\n node_id: string\n }\n fields?: Record<string, unknown>\n skip_hydration?: string[]\n _trigger_source_type?: string\n _trigger_source?: string\n}\n```\n\n### `TriggerEventResponse`\n\nResponse from triggering an event\n\n```ts\ntype TriggerEventResponse = {\n success: boolean\n event_id: string\n event_bridge_event_id?: string\n}\n```\n\n### `EventAttachment`\n\nA file attachment associated with an event\n\n```ts\ntype EventAttachment = {\n entity_id: string // uuid\n filename?: string\n mime_type?: string\n size_bytes?: number\n s3ref?: {\n bucket: string\n key: string\n }\n version_index: number\n readable_size?: string\n}\n```\n\n### `FieldChange`\n\nA field-level change descriptor. Powers the declarative half of the\nversion DSL.\n\n\n```ts\ntype FieldChange = {\n field: string\n op: "added" | "removed" | "type-changed"\n type_old?: string\n type_new?: string\n}\n```\n\n### `VersionMeta`\n\nOne entry of an event\'s version timeline.\n\n```ts\ntype VersionMeta = {\n version: string\n released_at: string\n change_summary: string\n change_notes?: string\n changes: Array<{\n field: string\n op: "added" | "removed" | "type-changed"\n type_old?: string\n type_new?: string\n }>\n}\n```\n\n### `EventVersionRegistrySummary`\n\nSummary of an event\'s version timeline returned by\n`GET /v1/events/{event_name}/versions`.\n\n\n```ts\ntype EventVersionRegistrySummary = {\n event_name: string\n latest: string\n versions: Array<{\n version: string\n released_at: string\n change_summary: string\n change_notes?: string\n changes: Array<{\n field: { ... }\n op: { ... }\n type_old?: { ... }\n type_new?: { ... }\n }>\n }>\n}\n```\n';
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
exports.default = event_catalog_default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import "./chunk-YPSWSI3M.js";
|
|
2
|
+
|
|
3
|
+
// src/docs/event-catalog.json
|
|
4
|
+
var event_catalog_default = '# Event Catalog API\n\n- **Base URL:** `https://event-catalog.sls.epilot.io`\n- **Full API Docs:** [https://docs.epilot.io/api/event-catalog](https://docs.epilot.io/api/event-catalog)\n\n## Usage\n\n```ts\nimport { epilot } from \'@epilot/sdk\'\n\nepilot.authorize(() => \'<token>\')\nconst { data } = await epilot.eventCatalog.listEvents(...)\n```\n\n### Tree-shakeable import\n\n```ts\nimport { getClient, authorize } from \'@epilot/sdk/event-catalog\'\n\nconst eventCatalogClient = getClient()\nauthorize(eventCatalogClient, () => \'<token>\')\nconst { data } = await eventCatalogClient.listEvents(...)\n```\n\n## Operations\n\n**Event Catalog**\n- [`listEvents`](#listevents)\n- [`getEvent`](#getevent)\n- [`patchEvent`](#patchevent)\n- [`getEventJSONSchema`](#geteventjsonschema)\n- [`getEventExample`](#geteventexample)\n- [`listEventVersions`](#listeventversions)\n- [`searchEventHistory`](#searcheventhistory)\n- [`searchEventHistoryV2`](#searcheventhistoryv2)\n- [`getHistoricalEvent`](#gethistoricalevent)\n- [`triggerEvent`](#triggerevent)\n\n**Schemas**\n- [`EventConfigBase`](#eventconfigbase)\n- [`EventConfig`](#eventconfig)\n- [`UpdateEventPayload`](#updateeventpayload)\n- [`PrimitiveField`](#primitivefield)\n- [`ContextEntity`](#contextentity)\n- [`AttachmentField`](#attachmentfield)\n- [`SchemaField`](#schemafield)\n- [`SuccessCriterion`](#successcriterion)\n- [`CommonEventMetadata`](#commoneventmetadata)\n- [`EventJsonSchema`](#eventjsonschema)\n- [`InlineDowngradeStep`](#inlinedowngradestep)\n- [`Event`](#event)\n- [`EventSummary`](#eventsummary)\n- [`GraphDefinition`](#graphdefinition)\n- [`GraphNode`](#graphnode)\n- [`GraphEdge`](#graphedge)\n- [`EntityOperationTrigger`](#entityoperationtrigger)\n- [`SearchOptions`](#searchoptions)\n- [`SearchOptionsV2`](#searchoptionsv2)\n- [`FieldsParam`](#fieldsparam)\n- [`TriggerEventPayload`](#triggereventpayload)\n- [`TriggerEventResponse`](#triggereventresponse)\n- [`EventAttachment`](#eventattachment)\n- [`FieldChange`](#fieldchange)\n- [`VersionMeta`](#versionmeta)\n- [`EventVersionRegistrySummary`](#eventversionregistrysummary)\n\n### `listEvents`\n\nRetrieve list of available business events\n\n`GET /v1/events`\n\n```ts\nconst { data } = await client.listEvents()\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "results": [\n {\n "event_name": "AddMeterReading",\n "event_title": "Add Meter Reading",\n "event_description": "Triggered when a new meter reading is added",\n "event_version": "1.0",\n "event_status": "active",\n "event_tags": ["builtin", "metering", "erp"],\n "schema_fields": {},\n "entity_graph": {\n "nodes": [\n {\n "id": "contact",\n "schema": "contact",\n "cardinality": "one",\n "fields": ["_id", "_title", "first_name", "account", "!account.*._files", "**._product"]\n }\n ],\n "edges": [\n {\n "from": "contact",\n "to": "billing_account"\n }\n ]\n },\n "entity_operation": {\n "operation": ["createEntity", "updateEntity"],\n "schema": ["contact", "contract", "order"],\n "attribute": ["email", "phone", "status"],\n "purpose": ["K\xFCndigung", "Umzug/Auszug"]\n },\n "enabled": true,\n "auto_trigger": true,\n "automation_trigger": true,\n "success_criteria": [\n {\n "entity_schema": "contract",\n "attribute": "installment_amount"\n },\n {\n "entity_schema": "billing_account",\n "attribute": "due_date"\n }\n ]\n }\n ]\n}\n```\n\n</details>\n\n---\n\n### `getEvent`\n\nRetrieve the configuration of a specific business event\n\n`GET /v1/events/{event_name}`\n\n```ts\nconst { data } = await client.getEvent({\n event_name: \'example\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "event_name": "AddMeterReading",\n "event_title": "Add Meter Reading",\n "event_description": "Triggered when a new meter reading is added",\n "event_version": "1.0",\n "event_status": "active",\n "event_tags": ["builtin", "metering", "erp"],\n "schema_fields": {},\n "entity_graph": {\n "nodes": [\n {\n "id": "contact",\n "schema": "contact",\n "cardinality": "one",\n "fields": ["_id", "_title", "first_name", "account", "!account.*._files", "**._product"]\n }\n ],\n "edges": [\n {\n "from": "contact",\n "to": "billing_account"\n }\n ]\n },\n "entity_operation": {\n "operation": ["createEntity", "updateEntity"],\n "schema": ["contact", "contract", "order"],\n "attribute": ["email", "phone", "status"],\n "purpose": ["K\xFCndigung", "Umzug/Auszug"]\n },\n "enabled": true,\n "auto_trigger": true,\n "automation_trigger": true,\n "success_criteria": [\n {\n "entity_schema": "contract",\n "attribute": "installment_amount"\n },\n {\n "entity_schema": "billing_account",\n "attribute": "due_date"\n }\n ]\n}\n```\n\n</details>\n\n---\n\n### `patchEvent`\n\nUpdate the configuration of a specific business event for the organization\n\n`PATCH /v1/events/{event_name}`\n\n```ts\nconst { data } = await client.patchEvent(\n {\n event_name: \'example\',\n },\n {\n event_name: \'AddMeterReading\',\n event_title: \'Add Meter Reading\',\n event_description: \'Triggered when a new meter reading is added\',\n event_version: \'1.0\',\n event_status: \'active\',\n event_tags: [\'builtin\', \'metering\', \'erp\'],\n schema_fields: {},\n entity_graph: {\n nodes: [\n {\n id: \'contact\',\n schema: \'contact\',\n cardinality: \'one\',\n fields: [\'_id\', \'_title\', \'first_name\', \'account\', \'!account.*._files\', \'**._product\']\n }\n ],\n edges: [\n {\n from: \'contact\',\n to: \'billing_account\'\n }\n ]\n },\n entity_operation: {\n operation: [\'createEntity\', \'updateEntity\'],\n schema: [\'contact\', \'contract\', \'order\'],\n attribute: [\'email\', \'phone\', \'status\'],\n purpose: [\'K\xFCndigung\', \'Umzug/Auszug\']\n },\n enabled: true,\n auto_trigger: true,\n automation_trigger: true,\n success_criteria: [\n {\n entity_schema: \'contract\',\n attribute: \'installment_amount\'\n },\n {\n entity_schema: \'billing_account\',\n attribute: \'due_date\'\n }\n ]\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "event_name": "AddMeterReading",\n "event_title": "Add Meter Reading",\n "event_description": "Triggered when a new meter reading is added",\n "event_version": "1.0",\n "event_status": "active",\n "event_tags": ["builtin", "metering", "erp"],\n "schema_fields": {},\n "entity_graph": {\n "nodes": [\n {\n "id": "contact",\n "schema": "contact",\n "cardinality": "one",\n "fields": ["_id", "_title", "first_name", "account", "!account.*._files", "**._product"]\n }\n ],\n "edges": [\n {\n "from": "contact",\n "to": "billing_account"\n }\n ]\n },\n "entity_operation": {\n "operation": ["createEntity", "updateEntity"],\n "schema": ["contact", "contract", "order"],\n "attribute": ["email", "phone", "status"],\n "purpose": ["K\xFCndigung", "Umzug/Auszug"]\n },\n "enabled": true,\n "auto_trigger": true,\n "automation_trigger": true,\n "success_criteria": [\n {\n "entity_schema": "contract",\n "attribute": "installment_amount"\n },\n {\n "entity_schema": "billing_account",\n "attribute": "due_date"\n }\n ]\n}\n```\n\n</details>\n\n---\n\n### `getEventJSONSchema`\n\nRetrieve the JSON Schema of a specific business event. Pass an optional\n`Epilot-Event-Version` header to retrieve a specific version\'s schema;\nwhen omitted, the event\'s latest version is returned.\n\n`GET /v1/events/{event_name}/json_schema`\n\n```ts\nconst { data } = await client.getEventJSONSchema({\n event_name: \'example\',\n Epilot-Event-Version: \'example\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "type": "object",\n "properties": {\n "_org_id": {\n "type": "string",\n "description": "epilot tenant/organization ID"\n },\n "_event_time": {\n "type": "string",\n "format": "date-time",\n "description": "ISO 8601 timestamp when event occurred"\n },\n "_event_id": {\n "type": "string",\n "description": "Unique event identifier (ULID)"\n },\n "_event_name": {\n "type": "string",\n "description": "Event name from catalog"\n },\n "_event_version": {\n "type": "string",\n "description": "Event payload version (MAJOR.MINOR)"\n },\n "_event_source": {\n "type": "string",\n "description": "Source that triggered the event"\n },\n "reading_value": {\n "type": "number",\n "description": "The meter reading value"\n },\n "reading_date": {\n "type": "string",\n "format": "date-time",\n "description": "ISO 8601 timestamp when reading was taken"\n },\n "read_by": {\n "type": "string",\n "description": "Name or identifier of who submitted the reading"\n },\n "reason": {\n "type": "string",\n "enum": ["regular", "move-in", "move-out", "supplier-change", "correction", "final"],\n "description": "Reason for the meter reading"\n },\n "direction": {\n "type": "string",\n "enum": ["feed-in", "feed-out"],\n "description": "Direction of energy flow"\n },\n "source": {\n "type": "string",\n "enum": ["portal", "360", "api", "automation"],\n "description": "Source system where reading was submitted"\n },\n "meter_id": {\n "type": "string",\n "format": "uuid",\n "description": "Entity ID of the meter"\n },\n "counter_id": {\n "type": "string",\n "format": "uuid",\n "description": "Entity ID of the meter counter"\n },\n "meter_number": {\n "type": "string",\n "description": "Human-readable meter number"\n },\n "obis_number": {\n "type": "string",\n "description": "OBIS code of the counter"\n },\n "unit": {\n "type": "string",\n "description": "Unit of measurement (e.g., kWh, m3)"\n },\n "customer_id": {\n "type": "string",\n "format": "uuid",\n "description": "Entity ID of the customer"\n },\n "contract_id": {\n "type": "string",\n "format": "uuid",\n "description": "Entity ID of the contract"\n },\n "user_id": {\n "type": "string",\n "description": "ID of the user who submitted the reading"\n },\n "user_email": {\n "type": "string",\n "format": "email",\n "description": "Email of the user who submitted the reading"\n }\n },\n "required": ["_org_id", "_event_time", "_event_id", "_event_name", "_event_version", "_event_source", "reading_value", "reading_date", "read_by", "reason", "direction", "source", "meter_id", "counter_id", "meter_number", "obis_number", "unit", "customer_id", "contract_id"]\n}\n```\n\n</details>\n\n---\n\n### `getEventExample`\n\nGenerate a sample event payload based on the event\'s JSON Schema. Pass an\noptional `Epilot-Event-Version` header to generate the example for a\nspecific version; when omitted, the event\'s latest versio\n\n`GET /v1/events/{event_name}/example`\n\n```ts\nconst { data } = await client.getEventExample({\n event_name: \'example\',\n Epilot-Event-Version: \'example\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{}\n```\n\n</details>\n\n---\n\n### `listEventVersions`\n\nList every known version of an event, along with the `latest`\nand the set of currently `active` versions. See \xA73.2 of the\nEvent Payload Versioning RFC.\n\n`GET /v1/events/{event_name}/versions`\n\n```ts\nconst { data } = await client.listEventVersions({\n event_name: \'example\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "event_name": "MeterReadingAdded",\n "latest": "1.0",\n "versions": [\n {\n "version": "1.0",\n "released_at": "2025-11-15",\n "change_summary": "string",\n "change_notes": "string",\n "changes": [\n {\n "field": "reading",\n "op": "added",\n "type_old": "string",\n "type_new": "string"\n }\n ]\n }\n ]\n}\n```\n\n</details>\n\n---\n\n### `searchEventHistory`\n\nPaginated history of events\n\n`POST /v1/events/{event_name}:history`\n\n```ts\nconst { data } = await client.searchEventHistory(\n {\n event_name: \'example\',\n },\n {\n limit: 10,\n cursor: {\n event_time: \'2025-10-31 12:34:56\',\n event_id: \'evt_1234567890abcdef\'\n },\n timestamp: {\n from: \'2025-10-01T00:00:00Z\',\n to: \'2025-10-31T23:59:59Z\'\n },\n event_id: \'evt_1234567890abcdef\'\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "results": [\n {\n "_org_id": "org_123456",\n "_event_time": "2024-01-01T12:00:00Z",\n "_event_id": "01FZ4Z5FZ5FZ5FZ5FZ5FZ5FZ5F",\n "_event_name": "MeterReading",\n "_event_version": "1.0",\n "_event_source": "api",\n "_trigger_source_type": "api",\n "_trigger_source": "user_123456",\n "reading_value": 123.45,\n "reading_date": "2024-01-01T11:59:00Z",\n "read_by": "John Doe",\n "reason": "regular",\n "direction": "feed-out",\n "source": "portal",\n "meter_id": "550e8400-e29b-41d4-a716-446655440000",\n "counter_id": "660e8400-e29b-41d4-a716-446655440000",\n "meter_number": "MT123456789",\n "obis_number": "1-0:1.8.0",\n "unit": "kWh",\n "customer_id": "770e8400-e29b-41d4-a716-446655440000",\n "contract_id": "880e8400-e29b-41d4-a716-446655440000"\n }\n ],\n "next_cursor": {\n "event_time": "2025-10-31T12:34:56Z",\n "event_id": "evt_1234567890abcdef"\n }\n}\n```\n\n</details>\n\n---\n\n### `searchEventHistoryV2`\n\nPaginated history of events with projected/lightweight payload (v2).\n\n`POST /v2/events/{event_name}:history`\n\n```ts\nconst { data } = await client.searchEventHistoryV2(\n {\n event_name: \'example\',\n },\n {\n limit: 10,\n cursor: {\n event_time: \'2025-10-31 12:34:56\',\n event_id: \'evt_1234567890abcdef\'\n },\n timestamp: {\n from: \'2025-10-01T00:00:00Z\',\n to: \'2025-10-31T23:59:59Z\'\n },\n event_id: \'evt_1234567890abcdef\',\n fields: [\'_id\', \'_title\', \'first_name\', \'account\', \'!account.*._files\', \'**._product\']\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "results": [\n {\n "_org_id": "string",\n "_event_time": "1970-01-01T00:00:00.000Z",\n "_event_id": "string",\n "_event_name": "string",\n "_event_version": "1.0",\n "_event_source": "string",\n "_trigger_source_type": "api",\n "_trigger_source": "string",\n "_ack_id": "string"\n }\n ],\n "next_cursor": {\n "event_time": "2025-10-31T12:34:56Z",\n "event_id": "evt_1234567890abcdef"\n }\n}\n```\n\n</details>\n\n---\n\n### `getHistoricalEvent`\n\nFetch a single historical event by id with full hydration\n\n`GET /v2/events/{event_name}/history/{event_id}`\n\n```ts\nconst { data } = await client.getHistoricalEvent({\n event_name: \'example\',\n event_id: \'example\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "_org_id": "org_123456",\n "_event_time": "2024-01-01T12:00:00Z",\n "_event_id": "01FZ4Z5FZ5FZ5FZ5FZ5FZ5FZ5F",\n "_event_name": "MeterReading",\n "_event_version": "1.0",\n "_event_source": "api",\n "_trigger_source_type": "api",\n "_trigger_source": "user_123456",\n "reading_value": 123.45,\n "reading_date": "2024-01-01T11:59:00Z",\n "read_by": "John Doe",\n "reason": "regular",\n "direction": "feed-out",\n "source": "portal",\n "meter_id": "550e8400-e29b-41d4-a716-446655440000",\n "counter_id": "660e8400-e29b-41d4-a716-446655440000",\n "meter_number": "MT123456789",\n "obis_number": "1-0:1.8.0",\n "unit": "kWh",\n "customer_id": "770e8400-e29b-41d4-a716-446655440000",\n "contract_id": "880e8400-e29b-41d4-a716-446655440000"\n}\n```\n\n</details>\n\n---\n\n### `triggerEvent`\n\nExplicitly trigger an event by providing input field values and an optional entity seed\nfor graph hydration. The event must be enabled for the organization.\n\n`POST /v1/events/{event_name}:trigger`\n\n```ts\nconst { data } = await client.triggerEvent(\n {\n event_name: \'example\',\n },\n {\n seed: {\n entity_id: \'3fa85f64-5717-4562-b3fc-2c963f66afa6\',\n node_id: \'string\'\n },\n fields: {},\n skip_hydration: [\'string\'],\n _trigger_source_type: \'string\',\n _trigger_source: \'string\'\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "success": true,\n "event_id": "string",\n "event_bridge_event_id": "string"\n}\n```\n\n</details>\n\n---\n\n## Schemas\n\n### `EventConfigBase`\n\nBase properties shared between EventConfig and UpdateEventPayload\n\n```ts\ntype EventConfigBase = {\n event_name?: string\n event_title?: string\n event_description?: string\n event_version?: string\n event_status?: "active" | "deprecated" | "draft" | "disabled"\n event_tags?: string[]\n schema_fields?: Record<string, {\n json_schema: object\n required?: boolean\n graph_source?: string\n } | {\n entity_schema: string\n required?: boolean\n } | {\n items: {\n entity_id: { ... }\n filename?: { ... }\n mime_type?: { ... }\n size_bytes?: { ... }\n s3ref?: { ... }\n version_index: { ... }\n readable_size?: { ... }\n }\n required?: boolean\n }>\n entity_graph?: {\n nodes: Array<{\n id: { ... }\n schema: { ... }\n cardinality?: { ... }\n fields?: { ... }\n }>\n edges: Array<{\n from: { ... }\n to: { ... }\n }>\n }\n entity_operation?: {\n operation: "createEntity" | "updateEntity" | "deleteEntity"[]\n schema: string[]\n attribute?: string[]\n purpose?: string[]\n }\n enabled?: boolean\n auto_trigger?: boolean\n automation_trigger?: boolean\n success_criteria?: Array<{\n entity_schema: string\n attribute: string\n }>\n}\n```\n\n### `EventConfig`\n\nEvent configuration with required fields\n\n```ts\ntype EventConfig = {\n event_name: string\n event_title?: string\n event_description?: string\n event_version: string\n event_status?: "active" | "deprecated" | "draft" | "disabled"\n event_tags?: string[]\n schema_fields: Record<string, {\n json_schema: object\n required?: boolean\n graph_source?: string\n } | {\n entity_schema: string\n required?: boolean\n } | {\n items: {\n entity_id: { ... }\n filename?: { ... }\n mime_type?: { ... }\n size_bytes?: { ... }\n s3ref?: { ... }\n version_index: { ... }\n readable_size?: { ... }\n }\n required?: boolean\n }>\n entity_graph?: {\n nodes: Array<{\n id: { ... }\n schema: { ... }\n cardinality?: { ... }\n fields?: { ... }\n }>\n edges: Array<{\n from: { ... }\n to: { ... }\n }>\n }\n entity_operation?: {\n operation: "createEntity" | "updateEntity" | "deleteEntity"[]\n schema: string[]\n attribute?: string[]\n purpose?: string[]\n }\n enabled?: boolean\n auto_trigger?: boolean\n automation_trigger?: boolean\n success_criteria?: Array<{\n entity_schema: string\n attribute: string\n }>\n}\n```\n\n### `UpdateEventPayload`\n\nPayload for updating an event configuration.\nAccepts the same fields as EventConfig (all optional for PATCH).\nCurrently `enabled`, `auto_trigger` and `success_criteria` fields are processed.\n\n\n```ts\ntype UpdateEventPayload = {\n event_name?: string\n event_title?: string\n event_description?: string\n event_version?: string\n event_status?: "active" | "deprecated" | "draft" | "disabled"\n event_tags?: string[]\n schema_fields?: Record<string, {\n json_schema: object\n required?: boolean\n graph_source?: string\n } | {\n entity_schema: string\n required?: boolean\n } | {\n items: {\n entity_id: { ... }\n filename?: { ... }\n mime_type?: { ... }\n size_bytes?: { ... }\n s3ref?: { ... }\n version_index: { ... }\n readable_size?: { ... }\n }\n required?: boolean\n }>\n entity_graph?: {\n nodes: Array<{\n id: { ... }\n schema: { ... }\n cardinality?: { ... }\n fields?: { ... }\n }>\n edges: Array<{\n from: { ... }\n to: { ... }\n }>\n }\n entity_operation?: {\n operation: "createEntity" | "updateEntity" | "deleteEntity"[]\n schema: string[]\n attribute?: string[]\n purpose?: string[]\n }\n enabled?: boolean\n auto_trigger?: boolean\n automation_trigger?: boolean\n success_criteria?: Array<{\n entity_schema: string\n attribute: string\n }>\n}\n```\n\n### `PrimitiveField`\n\nA primitive JSON Schema field definition\n\n```ts\ntype PrimitiveField = {\n json_schema: object\n required?: boolean\n graph_source?: string\n}\n```\n\n### `ContextEntity`\n\n```ts\ntype ContextEntity = {\n entity_schema: string\n required?: boolean\n}\n```\n\n### `AttachmentField`\n\nA schema field representing file attachments associated with the event.\nPresent in schema_fields for events tagged with "attachment".\n\n\n```ts\ntype AttachmentField = {\n items: {\n entity_id: string // uuid\n filename?: string\n mime_type?: string\n size_bytes?: number\n s3ref?: {\n bucket: { ... }\n key: { ... }\n }\n version_index: number\n readable_size?: string\n }\n required?: boolean\n}\n```\n\n### `SchemaField`\n\n```ts\ntype SchemaField = {\n json_schema: object\n required?: boolean\n graph_source?: string\n} | {\n entity_schema: string\n required?: boolean\n} | {\n items: {\n entity_id: string // uuid\n filename?: string\n mime_type?: string\n size_bytes?: number\n s3ref?: {\n bucket: { ... }\n key: { ... }\n }\n version_index: number\n readable_size?: string\n }\n required?: boolean\n}\n```\n\n### `SuccessCriterion`\n\nA single org-defined success criterion: an entity attribute that must be captured\nfor this event\'s change request to be considered complete.\n\nIdentity is the entity schema plus the attribute name \u2014 mirroring the\nEntityOperationTrigger `schema`/`attribute` vocabulary. On write (PATCH), both\n`attribut\n\n```ts\ntype SuccessCriterion = {\n entity_schema: string\n attribute: string\n}\n```\n\n### `CommonEventMetadata`\n\nCommon metadata fields present in all event payloads\n\n```ts\ntype CommonEventMetadata = object\n```\n\n### `EventJsonSchema`\n\nJSON Schema declaring the event payload structure\n\n```ts\ntype EventJsonSchema = object\n```\n\n### `InlineDowngradeStep`\n\nOne 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.\n\n```ts\ntype InlineDowngradeStep = {\n to: string\n jsonata: string\n}\n```\n\n### `Event`\n\nAn event instance in the event history\n\n```ts\ntype Event = {\n _org_id: string\n _event_time: string // date-time\n _event_id: string\n _event_name: string\n _event_version: string\n _event_source: string\n _trigger_source_type?: string\n _trigger_source?: string\n _ack_id?: string\n _downgrades?: Array<{\n to: string\n jsonata: string\n }>\n}\n```\n\n### `EventSummary`\n\nA lightweight event summary returned by the v2 history endpoint.\n\nIncludes the standard `_*` metadata fields plus a projected subset of the\nevent payload. Hydrated entity objects (values carrying `_schema` or `_id`)\n\u2014 and arrays of such objects \u2014 are reduced to reference stubs\n`{_schema, _id, _title\n\n```ts\ntype EventSummary = {\n _org_id: string\n _event_time: string // date-time\n _event_id: string\n _event_name: string\n _event_version: string\n _event_source: string\n _trigger_source_type?: string\n _trigger_source?: string\n _ack_id?: string\n}\n```\n\n### `GraphDefinition`\n\nEntity graph definition for resolving related entities\n\n```ts\ntype GraphDefinition = {\n nodes: Array<{\n id: string\n schema: string\n cardinality?: "one" | "many"\n fields?: object\n }>\n edges: Array<{\n from: string\n to: string\n }>\n}\n```\n\n### `GraphNode`\n\nA node in the entity graph\n\n```ts\ntype GraphNode = {\n id: string\n schema: string\n cardinality?: "one" | "many"\n fields?: object\n}\n```\n\n### `GraphEdge`\n\nAn edge connecting two nodes in the graph\n\n```ts\ntype GraphEdge = {\n from: string\n to: string\n}\n```\n\n### `EntityOperationTrigger`\n\nConfiguration for triggering an event based on entity operations.\n\nWhen an entity operation matches the configured criteria, the event will be triggered.\n- On createEntity: the attribute must be present in the entity payload\n- On updateEntity: the attribute must be in diff.added, diff.updated, or di\n\n```ts\ntype EntityOperationTrigger = {\n operation: "createEntity" | "updateEntity" | "deleteEntity"[]\n schema: string[]\n attribute?: string[]\n purpose?: string[]\n}\n```\n\n### `SearchOptions`\n\n```ts\ntype SearchOptions = {\n limit?: number\n cursor?: {\n event_time?: string\n event_id?: string\n }\n timestamp?: {\n from?: string // date-time\n to?: string // date-time\n }\n event_id?: string\n}\n```\n\n### `SearchOptionsV2`\n\nSearch options for the v2 history endpoint.\n\nExtends `SearchOptions` with an optional `fields` projection. When `fields`\nis omitted, the response includes all `_*` metadata plus all scalar payload\nfields (and primitive arrays / empty objects/arrays) after entity stripping.\nWhen `fields` is provided,\n\n```ts\ntype SearchOptionsV2 = {\n limit?: number\n cursor?: {\n event_time?: string\n event_id?: string\n }\n timestamp?: {\n from?: string // date-time\n to?: string // date-time\n }\n event_id?: string\n fields?: string[]\n}\n```\n\n### `FieldsParam`\n\nList of entity fields to include or exclude in the response\n\nUse ! to exclude fields, e.g. `!_id` to exclude the `_id` field.\n\nGlobbing and globstart (**) is supported for nested fields.\n\n\n```ts\ntype FieldsParam = string[]\n```\n\n### `TriggerEventPayload`\n\nPayload for explicitly triggering an event via API\n\n```ts\ntype TriggerEventPayload = {\n seed?: {\n entity_id: string // uuid\n node_id: string\n }\n fields?: Record<string, unknown>\n skip_hydration?: string[]\n _trigger_source_type?: string\n _trigger_source?: string\n}\n```\n\n### `TriggerEventResponse`\n\nResponse from triggering an event\n\n```ts\ntype TriggerEventResponse = {\n success: boolean\n event_id: string\n event_bridge_event_id?: string\n}\n```\n\n### `EventAttachment`\n\nA file attachment associated with an event\n\n```ts\ntype EventAttachment = {\n entity_id: string // uuid\n filename?: string\n mime_type?: string\n size_bytes?: number\n s3ref?: {\n bucket: string\n key: string\n }\n version_index: number\n readable_size?: string\n}\n```\n\n### `FieldChange`\n\nA field-level change descriptor. Powers the declarative half of the\nversion DSL.\n\n\n```ts\ntype FieldChange = {\n field: string\n op: "added" | "removed" | "type-changed"\n type_old?: string\n type_new?: string\n}\n```\n\n### `VersionMeta`\n\nOne entry of an event\'s version timeline.\n\n```ts\ntype VersionMeta = {\n version: string\n released_at: string\n change_summary: string\n change_notes?: string\n changes: Array<{\n field: string\n op: "added" | "removed" | "type-changed"\n type_old?: string\n type_new?: string\n }>\n}\n```\n\n### `EventVersionRegistrySummary`\n\nSummary of an event\'s version timeline returned by\n`GET /v1/events/{event_name}/versions`.\n\n\n```ts\ntype EventVersionRegistrySummary = {\n event_name: string\n latest: string\n versions: Array<{\n version: string\n released_at: string\n change_summary: string\n change_notes?: string\n changes: Array<{\n field: { ... }\n op: { ... }\n type_old?: { ... }\n type_new?: { ... }\n }>\n }>\n}\n```\n';
|
|
5
|
+
export {
|
|
6
|
+
event_catalog_default as default
|
|
7
|
+
};
|
|
@@ -202,6 +202,10 @@ declare namespace Components {
|
|
|
202
202
|
*
|
|
203
203
|
*/
|
|
204
204
|
_ack_id?: string;
|
|
205
|
+
/**
|
|
206
|
+
* Inline downgrade chain stamped by Event Catalog at publish time, ordered newest-to-oldest. Present ONLY on multi-version events. Internal versioning transport: consumers (e.g. svc-webhooks) walk the payload back to a pinned version using these JSONata steps, then strip the field before delivery -- end customers never receive it.
|
|
207
|
+
*/
|
|
208
|
+
_downgrades?: /* 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. */ InlineDowngradeStep[];
|
|
205
209
|
}
|
|
206
210
|
/**
|
|
207
211
|
* A file attachment associated with an event
|
|
@@ -394,6 +398,41 @@ declare namespace Components {
|
|
|
394
398
|
* true
|
|
395
399
|
*/
|
|
396
400
|
automation_trigger?: boolean;
|
|
401
|
+
/**
|
|
402
|
+
* Org-defined success criteria for this event: the entity attributes that an
|
|
403
|
+
* organization considers must be captured for an event change request to be
|
|
404
|
+
* treated as complete (e.g. for telephony / self-service flows).
|
|
405
|
+
*
|
|
406
|
+
* Advisory metadata — event-catalog does NOT require an org to define any and
|
|
407
|
+
* does NOT enforce them when an event is triggered or published. The org may
|
|
408
|
+
* define none (empty array or omitted). When provided, each entry is validated
|
|
409
|
+
* for well-formedness on write (see SuccessCriterion).
|
|
410
|
+
*
|
|
411
|
+
* example:
|
|
412
|
+
* [
|
|
413
|
+
* {
|
|
414
|
+
* "entity_schema": "contract",
|
|
415
|
+
* "attribute": "installment_amount"
|
|
416
|
+
* },
|
|
417
|
+
* {
|
|
418
|
+
* "entity_schema": "billing_account",
|
|
419
|
+
* "attribute": "due_date"
|
|
420
|
+
* }
|
|
421
|
+
* ]
|
|
422
|
+
*/
|
|
423
|
+
success_criteria?: /**
|
|
424
|
+
* A single org-defined success criterion: an entity attribute that must be captured
|
|
425
|
+
* for this event's change request to be considered complete.
|
|
426
|
+
*
|
|
427
|
+
* Identity is the entity schema plus the attribute name — mirroring the
|
|
428
|
+
* EntityOperationTrigger `schema`/`attribute` vocabulary. On write (PATCH), both
|
|
429
|
+
* `attribute` and `entity_schema` are required and `entity_schema` must match the
|
|
430
|
+
* `schema` of a node in the event's `entity_graph` (else the request is rejected) —
|
|
431
|
+
* this prevents unsatisfiable criteria. The criteria themselves are advisory and are
|
|
432
|
+
* never enforced when an event is triggered or published.
|
|
433
|
+
*
|
|
434
|
+
*/
|
|
435
|
+
SuccessCriterion[];
|
|
397
436
|
}
|
|
398
437
|
/**
|
|
399
438
|
* Base properties shared between EventConfig and UpdateEventPayload
|
|
@@ -544,6 +583,41 @@ declare namespace Components {
|
|
|
544
583
|
* true
|
|
545
584
|
*/
|
|
546
585
|
automation_trigger?: boolean;
|
|
586
|
+
/**
|
|
587
|
+
* Org-defined success criteria for this event: the entity attributes that an
|
|
588
|
+
* organization considers must be captured for an event change request to be
|
|
589
|
+
* treated as complete (e.g. for telephony / self-service flows).
|
|
590
|
+
*
|
|
591
|
+
* Advisory metadata — event-catalog does NOT require an org to define any and
|
|
592
|
+
* does NOT enforce them when an event is triggered or published. The org may
|
|
593
|
+
* define none (empty array or omitted). When provided, each entry is validated
|
|
594
|
+
* for well-formedness on write (see SuccessCriterion).
|
|
595
|
+
*
|
|
596
|
+
* example:
|
|
597
|
+
* [
|
|
598
|
+
* {
|
|
599
|
+
* "entity_schema": "contract",
|
|
600
|
+
* "attribute": "installment_amount"
|
|
601
|
+
* },
|
|
602
|
+
* {
|
|
603
|
+
* "entity_schema": "billing_account",
|
|
604
|
+
* "attribute": "due_date"
|
|
605
|
+
* }
|
|
606
|
+
* ]
|
|
607
|
+
*/
|
|
608
|
+
success_criteria?: /**
|
|
609
|
+
* A single org-defined success criterion: an entity attribute that must be captured
|
|
610
|
+
* for this event's change request to be considered complete.
|
|
611
|
+
*
|
|
612
|
+
* Identity is the entity schema plus the attribute name — mirroring the
|
|
613
|
+
* EntityOperationTrigger `schema`/`attribute` vocabulary. On write (PATCH), both
|
|
614
|
+
* `attribute` and `entity_schema` are required and `entity_schema` must match the
|
|
615
|
+
* `schema` of a node in the event's `entity_graph` (else the request is rejected) —
|
|
616
|
+
* this prevents unsatisfiable criteria. The criteria themselves are advisory and are
|
|
617
|
+
* never enforced when an event is triggered or published.
|
|
618
|
+
*
|
|
619
|
+
*/
|
|
620
|
+
SuccessCriterion[];
|
|
547
621
|
}
|
|
548
622
|
/**
|
|
549
623
|
* JSON Schema declaring the event payload structure
|
|
@@ -887,6 +961,19 @@ declare namespace Components {
|
|
|
887
961
|
*/
|
|
888
962
|
fields?: string[];
|
|
889
963
|
}
|
|
964
|
+
/**
|
|
965
|
+
* 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.
|
|
966
|
+
*/
|
|
967
|
+
export interface InlineDowngradeStep {
|
|
968
|
+
/**
|
|
969
|
+
* Version label this step downgrades to (the previous version).
|
|
970
|
+
*/
|
|
971
|
+
to: string;
|
|
972
|
+
/**
|
|
973
|
+
* JSONata expression mapping the current-shape payload to the previous-shape payload.
|
|
974
|
+
*/
|
|
975
|
+
jsonata: string;
|
|
976
|
+
}
|
|
890
977
|
/**
|
|
891
978
|
* A primitive JSON Schema field definition
|
|
892
979
|
*/
|
|
@@ -1051,6 +1138,32 @@ declare namespace Components {
|
|
|
1051
1138
|
*/
|
|
1052
1139
|
FieldsParam;
|
|
1053
1140
|
}
|
|
1141
|
+
/**
|
|
1142
|
+
* A single org-defined success criterion: an entity attribute that must be captured
|
|
1143
|
+
* for this event's change request to be considered complete.
|
|
1144
|
+
*
|
|
1145
|
+
* Identity is the entity schema plus the attribute name — mirroring the
|
|
1146
|
+
* EntityOperationTrigger `schema`/`attribute` vocabulary. On write (PATCH), both
|
|
1147
|
+
* `attribute` and `entity_schema` are required and `entity_schema` must match the
|
|
1148
|
+
* `schema` of a node in the event's `entity_graph` (else the request is rejected) —
|
|
1149
|
+
* this prevents unsatisfiable criteria. The criteria themselves are advisory and are
|
|
1150
|
+
* never enforced when an event is triggered or published.
|
|
1151
|
+
*
|
|
1152
|
+
*/
|
|
1153
|
+
export interface SuccessCriterion {
|
|
1154
|
+
/**
|
|
1155
|
+
* Entity schema slug the attribute belongs to (matches a node schema in the event's entity_graph).
|
|
1156
|
+
* example:
|
|
1157
|
+
* contract
|
|
1158
|
+
*/
|
|
1159
|
+
entity_schema: string;
|
|
1160
|
+
/**
|
|
1161
|
+
* Attribute name on the entity schema.
|
|
1162
|
+
* example:
|
|
1163
|
+
* installment_amount
|
|
1164
|
+
*/
|
|
1165
|
+
attribute: string;
|
|
1166
|
+
}
|
|
1054
1167
|
/**
|
|
1055
1168
|
* Payload for explicitly triggering an event via API
|
|
1056
1169
|
*/
|
|
@@ -1122,7 +1235,7 @@ declare namespace Components {
|
|
|
1122
1235
|
/**
|
|
1123
1236
|
* Payload for updating an event configuration.
|
|
1124
1237
|
* Accepts the same fields as EventConfig (all optional for PATCH).
|
|
1125
|
-
* Currently `enabled` and `
|
|
1238
|
+
* Currently `enabled`, `auto_trigger` and `success_criteria` fields are processed.
|
|
1126
1239
|
*
|
|
1127
1240
|
*/
|
|
1128
1241
|
export interface UpdateEventPayload {
|
|
@@ -1271,6 +1384,41 @@ declare namespace Components {
|
|
|
1271
1384
|
* true
|
|
1272
1385
|
*/
|
|
1273
1386
|
automation_trigger?: boolean;
|
|
1387
|
+
/**
|
|
1388
|
+
* Org-defined success criteria for this event: the entity attributes that an
|
|
1389
|
+
* organization considers must be captured for an event change request to be
|
|
1390
|
+
* treated as complete (e.g. for telephony / self-service flows).
|
|
1391
|
+
*
|
|
1392
|
+
* Advisory metadata — event-catalog does NOT require an org to define any and
|
|
1393
|
+
* does NOT enforce them when an event is triggered or published. The org may
|
|
1394
|
+
* define none (empty array or omitted). When provided, each entry is validated
|
|
1395
|
+
* for well-formedness on write (see SuccessCriterion).
|
|
1396
|
+
*
|
|
1397
|
+
* example:
|
|
1398
|
+
* [
|
|
1399
|
+
* {
|
|
1400
|
+
* "entity_schema": "contract",
|
|
1401
|
+
* "attribute": "installment_amount"
|
|
1402
|
+
* },
|
|
1403
|
+
* {
|
|
1404
|
+
* "entity_schema": "billing_account",
|
|
1405
|
+
* "attribute": "due_date"
|
|
1406
|
+
* }
|
|
1407
|
+
* ]
|
|
1408
|
+
*/
|
|
1409
|
+
success_criteria?: /**
|
|
1410
|
+
* A single org-defined success criterion: an entity attribute that must be captured
|
|
1411
|
+
* for this event's change request to be considered complete.
|
|
1412
|
+
*
|
|
1413
|
+
* Identity is the entity schema plus the attribute name — mirroring the
|
|
1414
|
+
* EntityOperationTrigger `schema`/`attribute` vocabulary. On write (PATCH), both
|
|
1415
|
+
* `attribute` and `entity_schema` are required and `entity_schema` must match the
|
|
1416
|
+
* `schema` of a node in the event's `entity_graph` (else the request is rejected) —
|
|
1417
|
+
* this prevents unsatisfiable criteria. The criteria themselves are advisory and are
|
|
1418
|
+
* never enforced when an event is triggered or published.
|
|
1419
|
+
*
|
|
1420
|
+
*/
|
|
1421
|
+
SuccessCriterion[];
|
|
1274
1422
|
}
|
|
1275
1423
|
/**
|
|
1276
1424
|
* One entry of an event's version timeline.
|
|
@@ -1574,7 +1722,7 @@ declare namespace Paths {
|
|
|
1574
1722
|
export type RequestBody = /**
|
|
1575
1723
|
* Payload for updating an event configuration.
|
|
1576
1724
|
* Accepts the same fields as EventConfig (all optional for PATCH).
|
|
1577
|
-
* Currently `enabled` and `
|
|
1725
|
+
* Currently `enabled`, `auto_trigger` and `success_criteria` fields are processed.
|
|
1578
1726
|
*
|
|
1579
1727
|
*/
|
|
1580
1728
|
Components.Schemas.UpdateEventPayload;
|
|
@@ -2007,13 +2155,15 @@ type FieldsParam = Components.Schemas.FieldsParam;
|
|
|
2007
2155
|
type GraphDefinition = Components.Schemas.GraphDefinition;
|
|
2008
2156
|
type GraphEdge = Components.Schemas.GraphEdge;
|
|
2009
2157
|
type GraphNode = Components.Schemas.GraphNode;
|
|
2158
|
+
type InlineDowngradeStep = Components.Schemas.InlineDowngradeStep;
|
|
2010
2159
|
type PrimitiveField = Components.Schemas.PrimitiveField;
|
|
2011
2160
|
type SchemaField = Components.Schemas.SchemaField;
|
|
2012
2161
|
type SearchOptions = Components.Schemas.SearchOptions;
|
|
2013
2162
|
type SearchOptionsV2 = Components.Schemas.SearchOptionsV2;
|
|
2163
|
+
type SuccessCriterion = Components.Schemas.SuccessCriterion;
|
|
2014
2164
|
type TriggerEventPayload = Components.Schemas.TriggerEventPayload;
|
|
2015
2165
|
type TriggerEventResponse = Components.Schemas.TriggerEventResponse;
|
|
2016
2166
|
type UpdateEventPayload = Components.Schemas.UpdateEventPayload;
|
|
2017
2167
|
type VersionMeta = Components.Schemas.VersionMeta;
|
|
2018
2168
|
|
|
2019
|
-
export { type AttachmentField as A, type Client as C, type EntityOperationTrigger as E, type FieldChange as F, type GraphDefinition as G, type OperationMethods as O, Paths as P, type SchemaField as S, type TriggerEventPayload as T, type UpdateEventPayload as U, type VersionMeta as V, Components as a, type PathsDictionary as b, type CommonEventMetadata as c, type ContextEntity as d, type Event as e, type EventAttachment as f, type EventConfig as g, type EventConfigBase as h, type EventJsonSchema as i, type EventSummary as j, type EventVersionRegistrySummary as k, type FieldsParam as l, type GraphEdge as m, type GraphNode as n, type PrimitiveField as o, type SearchOptions as p, type SearchOptionsV2 as q, type
|
|
2169
|
+
export { type AttachmentField as A, type Client as C, type EntityOperationTrigger as E, type FieldChange as F, type GraphDefinition as G, type InlineDowngradeStep as I, type OperationMethods as O, Paths as P, type SchemaField as S, type TriggerEventPayload as T, type UpdateEventPayload as U, type VersionMeta as V, Components as a, type PathsDictionary as b, type CommonEventMetadata as c, type ContextEntity as d, type Event as e, type EventAttachment as f, type EventConfig as g, type EventConfigBase as h, type EventJsonSchema as i, type EventSummary as j, type EventVersionRegistrySummary as k, type FieldsParam as l, type GraphEdge as m, type GraphNode as n, type PrimitiveField as o, type SearchOptions as p, type SearchOptionsV2 as q, type SuccessCriterion as r, type TriggerEventResponse as s };
|