@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.
Files changed (124) hide show
  1. package/definitions/event-catalog.json +63 -1
  2. package/dist/apis/access-token.cjs +6 -6
  3. package/dist/apis/access-token.js +1 -1
  4. package/dist/apis/address-suggestions.cjs +6 -6
  5. package/dist/apis/address-suggestions.js +1 -1
  6. package/dist/apis/address.cjs +6 -6
  7. package/dist/apis/address.js +1 -1
  8. package/dist/apis/ai-agents.cjs +6 -6
  9. package/dist/apis/ai-agents.js +1 -1
  10. package/dist/apis/app.cjs +6 -6
  11. package/dist/apis/app.js +1 -1
  12. package/dist/apis/audit-logs.cjs +6 -6
  13. package/dist/apis/audit-logs.js +1 -1
  14. package/dist/apis/automation.cjs +6 -6
  15. package/dist/apis/automation.js +1 -1
  16. package/dist/apis/billing.cjs +6 -6
  17. package/dist/apis/billing.js +1 -1
  18. package/dist/apis/blueprint-manifest.cjs +6 -6
  19. package/dist/apis/blueprint-manifest.js +1 -1
  20. package/dist/apis/calendar.cjs +6 -6
  21. package/dist/apis/calendar.js +1 -1
  22. package/dist/apis/configuration-hub.cjs +6 -6
  23. package/dist/apis/configuration-hub.js +1 -1
  24. package/dist/apis/consent.cjs +6 -6
  25. package/dist/apis/consent.js +1 -1
  26. package/dist/apis/customer-portal.cjs +6 -6
  27. package/dist/apis/customer-portal.js +1 -1
  28. package/dist/apis/dashboard.cjs +6 -6
  29. package/dist/apis/dashboard.js +1 -1
  30. package/dist/apis/data-governance.cjs +6 -6
  31. package/dist/apis/data-governance.js +1 -1
  32. package/dist/apis/deduplication.cjs +6 -6
  33. package/dist/apis/deduplication.js +1 -1
  34. package/dist/apis/design.cjs +6 -6
  35. package/dist/apis/design.js +1 -1
  36. package/dist/apis/document.cjs +6 -6
  37. package/dist/apis/document.js +1 -1
  38. package/dist/apis/email-settings.cjs +6 -6
  39. package/dist/apis/email-settings.js +1 -1
  40. package/dist/apis/email-template.cjs +6 -6
  41. package/dist/apis/email-template.js +1 -1
  42. package/dist/apis/entity-mapping.cjs +6 -6
  43. package/dist/apis/entity-mapping.js +1 -1
  44. package/dist/apis/entity.cjs +6 -6
  45. package/dist/apis/entity.js +1 -1
  46. package/dist/apis/environments.cjs +6 -6
  47. package/dist/apis/environments.js +1 -1
  48. package/dist/apis/event-catalog.cjs +6 -6
  49. package/dist/apis/event-catalog.d.cts +2 -2
  50. package/dist/apis/event-catalog.d.ts +2 -2
  51. package/dist/apis/event-catalog.js +1 -1
  52. package/dist/apis/file.cjs +6 -6
  53. package/dist/apis/file.js +1 -1
  54. package/dist/apis/iban.cjs +6 -6
  55. package/dist/apis/iban.js +1 -1
  56. package/dist/apis/integration-toolkit.cjs +6 -6
  57. package/dist/apis/integration-toolkit.js +1 -1
  58. package/dist/apis/journey.cjs +6 -6
  59. package/dist/apis/journey.js +1 -1
  60. package/dist/apis/kanban.cjs +6 -6
  61. package/dist/apis/kanban.js +1 -1
  62. package/dist/apis/message.cjs +6 -6
  63. package/dist/apis/message.js +1 -1
  64. package/dist/apis/metering.cjs +6 -6
  65. package/dist/apis/metering.js +1 -1
  66. package/dist/apis/notes.cjs +6 -6
  67. package/dist/apis/notes.js +1 -1
  68. package/dist/apis/notification.cjs +6 -6
  69. package/dist/apis/notification.js +1 -1
  70. package/dist/apis/organization.cjs +6 -6
  71. package/dist/apis/organization.js +1 -1
  72. package/dist/apis/partner-directory.cjs +6 -6
  73. package/dist/apis/partner-directory.js +1 -1
  74. package/dist/apis/permissions.cjs +6 -6
  75. package/dist/apis/permissions.js +1 -1
  76. package/dist/apis/pricing-tier.cjs +6 -6
  77. package/dist/apis/pricing-tier.js +1 -1
  78. package/dist/apis/pricing.cjs +6 -6
  79. package/dist/apis/pricing.js +1 -1
  80. package/dist/apis/purpose.cjs +6 -6
  81. package/dist/apis/purpose.js +1 -1
  82. package/dist/apis/query.cjs +6 -6
  83. package/dist/apis/query.js +1 -1
  84. package/dist/apis/sandbox.cjs +6 -6
  85. package/dist/apis/sandbox.js +1 -1
  86. package/dist/apis/sharing.cjs +6 -6
  87. package/dist/apis/sharing.js +1 -1
  88. package/dist/apis/snapshot.cjs +6 -6
  89. package/dist/apis/snapshot.js +1 -1
  90. package/dist/apis/submission.cjs +6 -6
  91. package/dist/apis/submission.js +1 -1
  92. package/dist/apis/target.cjs +6 -6
  93. package/dist/apis/target.js +1 -1
  94. package/dist/apis/targeting.cjs +6 -6
  95. package/dist/apis/targeting.js +1 -1
  96. package/dist/apis/template-variables.cjs +6 -6
  97. package/dist/apis/template-variables.js +1 -1
  98. package/dist/apis/user.cjs +6 -6
  99. package/dist/apis/user.js +1 -1
  100. package/dist/apis/validation-rules.cjs +6 -6
  101. package/dist/apis/validation-rules.js +1 -1
  102. package/dist/apis/webhooks.cjs +6 -6
  103. package/dist/apis/webhooks.js +1 -1
  104. package/dist/apis/workflow-definition.cjs +6 -6
  105. package/dist/apis/workflow-definition.js +1 -1
  106. package/dist/apis/workflow.cjs +6 -6
  107. package/dist/apis/workflow.js +1 -1
  108. package/dist/{chunk-XGCTJYBW.cjs → chunk-AJDY36Y6.cjs} +1 -1
  109. package/dist/{chunk-FOGUF2AK.js → chunk-L3UZLJPQ.js} +1 -1
  110. package/dist/event-catalog-6ZSSF5JU.cjs +7 -0
  111. package/dist/event-catalog-RS4LJMY2.js +7 -0
  112. package/dist/{event-catalog.d-CXbUn8T1.d.cts → event-catalog.d-QIhhewVH.d.cts} +153 -3
  113. package/dist/{event-catalog.d-CXbUn8T1.d.ts → event-catalog.d-QIhhewVH.d.ts} +153 -3
  114. package/dist/index.cjs +8 -8
  115. package/dist/index.d.cts +1 -1
  116. package/dist/index.d.ts +1 -1
  117. package/dist/index.js +1 -1
  118. package/dist/js-yaml-DLCVPJ7G.js +0 -0
  119. package/docs/event-catalog.md +90 -5
  120. package/package.json +11 -12
  121. package/definitions/focus-pocus-runtime.json +0 -1
  122. package/definitions/focus-pocus.json +0 -757
  123. package/dist/event-catalog-3YOQ46ZW.js +0 -7
  124. package/dist/event-catalog-HLWUT7RM.cjs +0 -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 `auto_trigger` fields are processed.
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 `auto_trigger` fields are processed.
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 TriggerEventResponse as r };
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 };
package/dist/index.cjs CHANGED
@@ -158,7 +158,7 @@ var _chunkDVM27A7Ecjs = require('./chunk-DVM27A7E.cjs');
158
158
 
159
159
 
160
160
 
161
- var _chunkXGCTJYBWcjs = require('./chunk-XGCTJYBW.cjs');
161
+ var _chunkAJDY36Y6cjs = require('./chunk-AJDY36Y6.cjs');
162
162
 
163
163
 
164
164
  var _chunkNJK5F5TFcjs = require('./chunk-NJK5F5TF.cjs');
@@ -225,7 +225,7 @@ var resolveClient = (params) => {
225
225
  }
226
226
  if (!entry.instance) {
227
227
  const definition = entry.loader();
228
- entry.instance = _chunkXGCTJYBWcjs.createApiClient.call(void 0, {
228
+ entry.instance = _chunkAJDY36Y6cjs.createApiClient.call(void 0, {
229
229
  definition,
230
230
  token: state.token,
231
231
  headers: state.globalHeaders,
@@ -258,7 +258,7 @@ var resetAllClients = (registry) => {
258
258
  };
259
259
 
260
260
  // src/apis/_registry.ts
261
- var expandDef = (mod) => _chunkXGCTJYBWcjs.expand.call(void 0, _nullishCoalesce(mod.default, () => ( mod)));
261
+ var expandDef = (mod) => _chunkAJDY36Y6cjs.expand.call(void 0, _nullishCoalesce(mod.default, () => ( mod)));
262
262
  var registerBuiltinApis = (registry) => {
263
263
  registerApi({
264
264
  registry,
@@ -601,9 +601,9 @@ var createSDK = () => {
601
601
  const available = [...registry.keys()].join(", ");
602
602
  throw new Error(`Unknown API: "${name}". Available: ${available}`);
603
603
  }
604
- return _chunkXGCTJYBWcjs.createApiHandle.call(void 0, {
604
+ return _chunkAJDY36Y6cjs.createApiHandle.call(void 0, {
605
605
  resolveClient: () => resolveClient({ registry, name, state }),
606
- createClient: () => _chunkXGCTJYBWcjs.createApiClient.call(void 0, { definition: entry.loader(), apiName: name }),
606
+ createClient: () => _chunkAJDY36Y6cjs.createApiClient.call(void 0, { definition: entry.loader(), apiName: name }),
607
607
  apiName: name
608
608
  });
609
609
  };
@@ -651,9 +651,9 @@ var createSDK = () => {
651
651
  return interceptorUse;
652
652
  }
653
653
  case "help":
654
- return (apiName) => _chunkXGCTJYBWcjs.help.call(void 0, apiName);
654
+ return (apiName) => _chunkAJDY36Y6cjs.help.call(void 0, apiName);
655
655
  case "openapi":
656
- return (apiName) => _chunkXGCTJYBWcjs.openapi.call(void 0, apiName);
656
+ return (apiName) => _chunkAJDY36Y6cjs.openapi.call(void 0, apiName);
657
657
  case "then":
658
658
  case "catch":
659
659
  case "finally":
@@ -683,4 +683,4 @@ var epilot = createSDK();
683
683
 
684
684
 
685
685
 
686
- exports.applyLargeResponseInterceptor = applyLargeResponseInterceptor; exports.applyRetryInterceptor = applyRetryInterceptor; exports.authorize = _chunkXGCTJYBWcjs.authorize; exports.createSDK = createSDK; exports.epilot = epilot; exports.help = _chunkXGCTJYBWcjs.help; exports.openapi = _chunkXGCTJYBWcjs.openapi;
686
+ exports.applyLargeResponseInterceptor = applyLargeResponseInterceptor; exports.applyRetryInterceptor = applyRetryInterceptor; exports.authorize = _chunkAJDY36Y6cjs.authorize; exports.createSDK = createSDK; exports.epilot = epilot; exports.help = _chunkAJDY36Y6cjs.help; exports.openapi = _chunkAJDY36Y6cjs.openapi;
package/dist/index.d.cts CHANGED
@@ -26,7 +26,7 @@ import { C as Client$j } from './email-template.d-gtQkdaXM.cjs';
26
26
  import { C as Client$k } from './entity.d-fospShiN.cjs';
27
27
  import { C as Client$l } from './entity-mapping.d-DKSW3sfy.cjs';
28
28
  import { C as Client$m } from './environments.d-BvqvN-PD.cjs';
29
- import { C as Client$n } from './event-catalog.d-CXbUn8T1.cjs';
29
+ import { C as Client$n } from './event-catalog.d-QIhhewVH.cjs';
30
30
  import { C as Client$o } from './file.d-BN417xok.cjs';
31
31
  import { C as Client$p } from './iban.d-BwdiGbxi.cjs';
32
32
  import { C as Client$q } from './integration-toolkit.d-7q19qDTD.cjs';
package/dist/index.d.ts CHANGED
@@ -26,7 +26,7 @@ import { C as Client$j } from './email-template.d-gtQkdaXM.js';
26
26
  import { C as Client$k } from './entity.d-fospShiN.js';
27
27
  import { C as Client$l } from './entity-mapping.d-DKSW3sfy.js';
28
28
  import { C as Client$m } from './environments.d-BvqvN-PD.js';
29
- import { C as Client$n } from './event-catalog.d-CXbUn8T1.js';
29
+ import { C as Client$n } from './event-catalog.d-QIhhewVH.js';
30
30
  import { C as Client$o } from './file.d-BN417xok.js';
31
31
  import { C as Client$p } from './iban.d-BwdiGbxi.js';
32
32
  import { C as Client$q } from './integration-toolkit.d-7q19qDTD.js';
package/dist/index.js CHANGED
@@ -158,7 +158,7 @@ import {
158
158
  expand,
159
159
  help,
160
160
  openapi
161
- } from "./chunk-FOGUF2AK.js";
161
+ } from "./chunk-L3UZLJPQ.js";
162
162
  import {
163
163
  __require
164
164
  } from "./chunk-YPSWSI3M.js";
File without changes
@@ -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 `auto_trigger` fields are processed.
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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epilot/sdk",
3
- "version": "2.12.0",
3
+ "version": "2.12.1",
4
4
  "description": "JavaScript/TypeScript SDK for epilot APIs",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -322,16 +322,6 @@
322
322
  },
323
323
  "./workflow-definition/openapi.json": "./definitions/workflow-definition.json"
324
324
  },
325
- "scripts": {
326
- "generate": "tsx ../../scripts/generate-sdk-v2.ts && pnpm lint:fix",
327
- "build": "tsup",
328
- "build:watch": "tsup --watch",
329
- "test": "vitest run",
330
- "test:watch": "vitest",
331
- "lint": "biome check src",
332
- "lint:fix": "biome check src --fix",
333
- "prepublishOnly": "npm run build"
334
- },
335
325
  "keywords": [
336
326
  "epilot",
337
327
  "sdk",
@@ -525,5 +515,14 @@
525
515
  "./dist/apis/workflow-definition.d.ts"
526
516
  ]
527
517
  }
518
+ },
519
+ "scripts": {
520
+ "generate": "tsx ../../scripts/generate-sdk-v2.ts && pnpm lint:fix",
521
+ "build": "tsup",
522
+ "build:watch": "tsup --watch",
523
+ "test": "vitest run",
524
+ "test:watch": "vitest",
525
+ "lint": "biome check src",
526
+ "lint:fix": "biome check src --fix"
528
527
  }
529
- }
528
+ }
@@ -1 +0,0 @@
1
- {"s":"https://focus-pocus.dev.sls.epilot.io","o":[["getHealth","get","/v1/health"],["listAchievements","get","/v1/achievements"],["getAchievement","get","/v1/achievements/{id}",[["AchievementOrChallengeId"]]],["getSuggestedChallenge","get","/v1/challenges/suggest",[["route","q"],["entity_type","q"],["category_hint","q"]]],["acceptChallenge","post","/v1/challenges/{id}/accept",[["ChallengeId"]]],["dismissChallenge","post","/v1/challenges/{id}/dismiss",[["ChallengeId"]]],["listActiveChallenges","get","/v1/challenges/active"],["postEvent","post","/v1/events",null,1]],"v":"3.0.3","cp":{"AchievementId":["id","p",true],"AchievementOrChallengeId":["id","p",true],"ChallengeId":["id","p",true],"Cursor":["cursor","q"],"Size":["size","q"]}}