@epilot/sdk 2.13.2 → 2.14.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 (156) hide show
  1. package/definitions/message-runtime.json +1 -1
  2. package/definitions/message.json +146 -1
  3. package/definitions/targeting-runtime.json +1 -1
  4. package/definitions/targeting.json +291 -0
  5. package/definitions/webhooks.json +8 -7
  6. package/dist/apis/access-token.cjs +6 -6
  7. package/dist/apis/access-token.js +1 -1
  8. package/dist/apis/address-suggestions.cjs +6 -6
  9. package/dist/apis/address-suggestions.js +1 -1
  10. package/dist/apis/address.cjs +6 -6
  11. package/dist/apis/address.js +1 -1
  12. package/dist/apis/ai-agents.cjs +6 -6
  13. package/dist/apis/ai-agents.js +1 -1
  14. package/dist/apis/app.cjs +6 -6
  15. package/dist/apis/app.js +1 -1
  16. package/dist/apis/audit-logs.cjs +6 -6
  17. package/dist/apis/audit-logs.js +1 -1
  18. package/dist/apis/automation.cjs +6 -6
  19. package/dist/apis/automation.js +1 -1
  20. package/dist/apis/billing.cjs +6 -6
  21. package/dist/apis/billing.js +1 -1
  22. package/dist/apis/blueprint-manifest.cjs +6 -6
  23. package/dist/apis/blueprint-manifest.js +1 -1
  24. package/dist/apis/calendar.cjs +6 -6
  25. package/dist/apis/calendar.js +1 -1
  26. package/dist/apis/configuration-hub.cjs +6 -6
  27. package/dist/apis/configuration-hub.js +1 -1
  28. package/dist/apis/consent.cjs +6 -6
  29. package/dist/apis/consent.js +1 -1
  30. package/dist/apis/customer-portal.cjs +6 -6
  31. package/dist/apis/customer-portal.js +1 -1
  32. package/dist/apis/dashboard.cjs +6 -6
  33. package/dist/apis/dashboard.js +1 -1
  34. package/dist/apis/data-governance.cjs +6 -6
  35. package/dist/apis/data-governance.js +1 -1
  36. package/dist/apis/deduplication.cjs +6 -6
  37. package/dist/apis/deduplication.js +1 -1
  38. package/dist/apis/design.cjs +6 -6
  39. package/dist/apis/design.js +1 -1
  40. package/dist/apis/document.cjs +6 -6
  41. package/dist/apis/document.js +1 -1
  42. package/dist/apis/email-settings.cjs +6 -6
  43. package/dist/apis/email-settings.js +1 -1
  44. package/dist/apis/email-template.cjs +6 -6
  45. package/dist/apis/email-template.js +1 -1
  46. package/dist/apis/entity-mapping.cjs +6 -6
  47. package/dist/apis/entity-mapping.js +1 -1
  48. package/dist/apis/entity.cjs +6 -6
  49. package/dist/apis/entity.js +1 -1
  50. package/dist/apis/environments.cjs +6 -6
  51. package/dist/apis/environments.js +1 -1
  52. package/dist/apis/event-catalog.cjs +6 -6
  53. package/dist/apis/event-catalog.js +1 -1
  54. package/dist/apis/file.cjs +6 -6
  55. package/dist/apis/file.js +1 -1
  56. package/dist/apis/iban.cjs +6 -6
  57. package/dist/apis/iban.js +1 -1
  58. package/dist/apis/integration-toolkit.cjs +6 -6
  59. package/dist/apis/integration-toolkit.js +1 -1
  60. package/dist/apis/journey.cjs +6 -6
  61. package/dist/apis/journey.js +1 -1
  62. package/dist/apis/kanban.cjs +6 -6
  63. package/dist/apis/kanban.js +1 -1
  64. package/dist/apis/message.cjs +8 -8
  65. package/dist/apis/message.d.cts +2 -2
  66. package/dist/apis/message.d.ts +2 -2
  67. package/dist/apis/message.js +2 -2
  68. package/dist/apis/metering.cjs +6 -6
  69. package/dist/apis/metering.js +1 -1
  70. package/dist/apis/notes.cjs +6 -6
  71. package/dist/apis/notes.js +1 -1
  72. package/dist/apis/notification.cjs +6 -6
  73. package/dist/apis/notification.js +1 -1
  74. package/dist/apis/organization.cjs +6 -6
  75. package/dist/apis/organization.js +1 -1
  76. package/dist/apis/partner-directory.cjs +6 -6
  77. package/dist/apis/partner-directory.js +1 -1
  78. package/dist/apis/permissions.cjs +6 -6
  79. package/dist/apis/permissions.js +1 -1
  80. package/dist/apis/pricing-tier.cjs +6 -6
  81. package/dist/apis/pricing-tier.js +1 -1
  82. package/dist/apis/pricing.cjs +6 -6
  83. package/dist/apis/pricing.js +1 -1
  84. package/dist/apis/purpose.cjs +6 -6
  85. package/dist/apis/purpose.js +1 -1
  86. package/dist/apis/query.cjs +6 -6
  87. package/dist/apis/query.js +1 -1
  88. package/dist/apis/sandbox.cjs +6 -6
  89. package/dist/apis/sandbox.js +1 -1
  90. package/dist/apis/sharing.cjs +6 -6
  91. package/dist/apis/sharing.js +1 -1
  92. package/dist/apis/snapshot.cjs +6 -6
  93. package/dist/apis/snapshot.js +1 -1
  94. package/dist/apis/submission.cjs +6 -6
  95. package/dist/apis/submission.js +1 -1
  96. package/dist/apis/target.cjs +6 -6
  97. package/dist/apis/target.js +1 -1
  98. package/dist/apis/targeting.cjs +8 -8
  99. package/dist/apis/targeting.d.cts +2 -2
  100. package/dist/apis/targeting.d.ts +2 -2
  101. package/dist/apis/targeting.js +2 -2
  102. package/dist/apis/template-variables.cjs +6 -6
  103. package/dist/apis/template-variables.js +1 -1
  104. package/dist/apis/user.cjs +6 -6
  105. package/dist/apis/user.js +1 -1
  106. package/dist/apis/validation-rules.cjs +6 -6
  107. package/dist/apis/validation-rules.js +1 -1
  108. package/dist/apis/webhooks.cjs +6 -6
  109. package/dist/apis/webhooks.d.cts +2 -2
  110. package/dist/apis/webhooks.d.ts +2 -2
  111. package/dist/apis/webhooks.js +1 -1
  112. package/dist/apis/workflow-definition.cjs +6 -6
  113. package/dist/apis/workflow-definition.js +1 -1
  114. package/dist/apis/workflow.cjs +6 -6
  115. package/dist/apis/workflow.js +1 -1
  116. package/dist/chunk-2ESIGECW.js +14 -0
  117. package/dist/chunk-JM63KEFZ.cjs +14 -0
  118. package/dist/{chunk-CRUXTTHI.js → chunk-OJLX6U66.js} +5 -5
  119. package/dist/{chunk-GHPSNA2U.cjs → chunk-SNERI3PK.cjs} +5 -5
  120. package/dist/chunk-UH24GU2Z.js +14 -0
  121. package/dist/chunk-W3SPZ6V5.cjs +14 -0
  122. package/dist/index.cjs +12 -12
  123. package/dist/index.d.cts +3 -3
  124. package/dist/index.d.ts +3 -3
  125. package/dist/index.js +3 -3
  126. package/dist/js-yaml-DLCVPJ7G.js +0 -0
  127. package/dist/message-663RPFCZ.js +7 -0
  128. package/dist/message-CEJ6VDZ6.cjs +7 -0
  129. package/dist/{message-runtime-XOQ5EJN6.js → message-runtime-5AUGENW3.js} +1 -1
  130. package/dist/{message-runtime-JSZCNCNU.cjs → message-runtime-5Z3POFZV.cjs} +2 -2
  131. package/dist/{message.d-B5UuSqgw.d.cts → message.d-VMmPsZVq.d.cts} +317 -4
  132. package/dist/{message.d-B5UuSqgw.d.ts → message.d-VMmPsZVq.d.ts} +317 -4
  133. package/dist/targeting-A2X6X7BF.js +7 -0
  134. package/dist/targeting-CSGKITGV.cjs +7 -0
  135. package/dist/{targeting-runtime-X3DQ527N.cjs → targeting-runtime-HWL6PLJF.cjs} +2 -2
  136. package/dist/{targeting-runtime-QI7322HB.js → targeting-runtime-L5RGDNSH.js} +1 -1
  137. package/dist/{targeting.d-Bq3onSes.d.cts → targeting.d-DaK3kwZg.d.cts} +286 -1
  138. package/dist/{targeting.d-Bq3onSes.d.ts → targeting.d-DaK3kwZg.d.ts} +286 -1
  139. package/dist/{webhooks-762WMLN2.cjs → webhooks-PNLMQFE2.cjs} +1 -1
  140. package/dist/{webhooks-5VDXUDDB.js → webhooks-QYVT2NUP.js} +1 -1
  141. package/dist/{webhooks.d-B6v_xmSD.d.ts → webhooks.d-DqOEzFsp.d.cts} +18 -14
  142. package/dist/{webhooks.d-B6v_xmSD.d.cts → webhooks.d-DqOEzFsp.d.ts} +18 -14
  143. package/docs/message.md +97 -9
  144. package/docs/targeting.md +192 -0
  145. package/docs/webhooks.md +10 -7
  146. package/package.json +11 -12
  147. package/definitions/focus-pocus-runtime.json +0 -1
  148. package/definitions/focus-pocus.json +0 -757
  149. package/dist/chunk-7ILTRJDQ.cjs +0 -14
  150. package/dist/chunk-DUHAG5CO.cjs +0 -14
  151. package/dist/chunk-FAZ63FEX.js +0 -14
  152. package/dist/chunk-H3NMCCSA.js +0 -14
  153. package/dist/message-6IFCB7GH.js +0 -7
  154. package/dist/message-7LNAFKKV.cjs +0 -7
  155. package/dist/targeting-4YMBBPDW.cjs +0 -7
  156. package/dist/targeting-VCENULF6.js +0 -7
@@ -1 +1 @@
1
- {"s":"https://message.sls.epilot.io","o":[["sendMessage","post","/v1/message/messages",[["do_not_create_entities","q"]],1],["updateMessage","put","/v1/message/messages"],["getMessage","get","/v1/message/messages/{id}",[["id","p",true]]],["deleteMessage","delete","/v1/message/messages/{id}",[["id","p",true]]],["getMessageEml","get","/v1/message/messages/{id}/eml",[["id","p",true]]],["searchMessages","post","/v1/message/messages:search",null,1],["trashMessage","post","/v1/message/messages/{id}/trash",[["id","p",true]]],["untrashMessage","post","/v1/message/messages/{id}/untrash",[["id","p",true]]],["markReadMessage","post","/v1/message/messages/{id}/read",[["id","p",true]]],["markReadMessageV2","post","/v2/message/messages/{id}/read",[["id","p",true]],1],["markUnreadMessage","post","/v1/message/messages/{id}/unread",[["id","p",true]]],["getUnread","get","/v1/message/messages/unread/{actor}",[["actor","p",true],["email_filter","q"]]],["markUnreadMessageV2","post","/v2/message/messages/{id}/unread",[["id","p",true]],1],["searchThreads","post","/v1/message/threads:search",null,1],["searchThreadsV2","post","/v2/message/threads:search",null,1],["searchIds","post","/v1/message/threads:searchIds",null,1],["updateThread","put","/v1/message/threads"],["deleteThread","delete","/v1/message/threads/{id}",[["id","p",true]]],["moveThread","post","/v1/message/threads/{id}:move",[["id","p",true]],1],["markThreadAsDone","post","/v1/message/threads/{id}:markAsDone",[["id","p",true]]],["markThreadAsOpen","post","/v1/message/threads/{id}:markAsOpen",[["id","p",true]]],["getThreadTimeline","get","/v1/message/threads/{id}/timeline",[["id","p",true]]],["trashThread","post","/v1/message/threads/{id}/trash",[["id","p",true]]],["untrashThread","post","/v1/message/threads/{id}/untrash",[["id","p",true]]],["spamThread","post","/v1/message/threads/{id}/spam",[["id","p",true]]],["unspamThread","post","/v1/message/threads/{id}/unspam",[["id","p",true]]],["spamMessage","post","/v1/message/messages/{id}/spam",[["id","p",true]]],["unspamMessage","post","/v1/message/messages/{id}/unspam",[["id","p",true]]],["bulkMoveThreads","post","/v1/message/threads/bulk:move",null,1],["bulkAssignThreads","post","/v1/message/threads/bulk:assign",null,1],["threadBulkActionsRead","post","/v1/message/threads/bulk:read",null,1],["threadBulkActionsUnread","post","/v1/message/threads/bulk:unread",null,1],["threadBulkActionsFavorite","post","/v1/message/threads/bulk:favorite",null,1],["threadBulkActionsUnfavorite","post","/v1/message/threads/bulk:unfavorite",null,1],["threadBulkActionsTrash","post","/v1/message/threads/bulk:trash",null,1],["threadBulkActionsUntrash","post","/v1/message/threads/bulk:untrash",null,1],["threadBulkActionsDelete","post","/v1/message/threads/bulk:delete",null,1],["threadBulkActionsDone","post","/v1/message/threads/bulk:done",null,1],["threadBulkActionsOpen","post","/v1/message/threads/bulk:open",null,1],["markReadThread","post","/v1/message/threads/{id}/read",[["id","p",true]]],["markReadThreadV2","post","/v2/message/threads/{id}/read",[["id","p",true]],1],["markUnreadThread","post","/v1/message/threads/{id}/unread",[["id","p",true]]],["markUnreadThreadV2","post","/v2/message/threads/{id}/unread",[["id","p",true]],1],["assignThread","post","/v1/message/threads/{id}/assign",[["id","p",true]],1],["unassignThread","post","/v1/message/threads/{id}/unassign",[["id","p",true],["unlink_mapped_entities","q"]],1],["assignUsers","post","/v1/message/threads/{id}/assign:users",[["id","p",true]],1],["assignUsersV2","post","/v2/message/threads/{id}/assign:users",[["id","p",true]],1],["pinThread","post","/v1/message/threads/{id}:pin",[["id","p",true]]],["unpinThread","delete","/v1/message/threads/{id}:pin",[["id","p",true]]],["createDraft","post","/v1/message/drafts",null,1],["sendDraft","post","/v1/message/drafts:send"],["getMessageV2","get","/v2/message/messages/{id}",[["id","p",true]]]]}
1
+ {"s":"https://message.sls.epilot.io","o":[["sendMessage","post","/v1/message/messages",[["do_not_create_entities","q"]],1],["updateMessage","put","/v1/message/messages"],["getMessage","get","/v1/message/messages/{id}",[["id","p",true]]],["deleteMessage","delete","/v1/message/messages/{id}",[["id","p",true]]],["getMessageEml","get","/v1/message/messages/{id}/eml",[["id","p",true]]],["searchMessages","post","/v1/message/messages:search",null,1],["trashMessage","post","/v1/message/messages/{id}/trash",[["id","p",true]]],["untrashMessage","post","/v1/message/messages/{id}/untrash",[["id","p",true]]],["markReadMessage","post","/v1/message/messages/{id}/read",[["id","p",true]]],["markReadMessageV2","post","/v2/message/messages/{id}/read",[["id","p",true]],1],["markUnreadMessage","post","/v1/message/messages/{id}/unread",[["id","p",true]]],["getUnread","get","/v1/message/messages/unread/{actor}",[["actor","p",true],["email_filter","q"]]],["markUnreadMessageV2","post","/v2/message/messages/{id}/unread",[["id","p",true]],1],["searchThreads","post","/v1/message/threads:search",null,1],["searchThreadsV2","post","/v2/message/threads:search",null,1],["searchIds","post","/v1/message/threads:searchIds",null,1],["getAssigneeWorkload","post","/v2/message/threads:workload",null,1],["updateThread","put","/v1/message/threads"],["deleteThread","delete","/v1/message/threads/{id}",[["id","p",true]]],["moveThread","post","/v1/message/threads/{id}:move",[["id","p",true]],1],["markThreadAsDone","post","/v1/message/threads/{id}:markAsDone",[["id","p",true]]],["markThreadAsOpen","post","/v1/message/threads/{id}:markAsOpen",[["id","p",true]]],["getThreadTimeline","get","/v1/message/threads/{id}/timeline",[["id","p",true]]],["trashThread","post","/v1/message/threads/{id}/trash",[["id","p",true]]],["untrashThread","post","/v1/message/threads/{id}/untrash",[["id","p",true]]],["spamThread","post","/v1/message/threads/{id}/spam",[["id","p",true]]],["unspamThread","post","/v1/message/threads/{id}/unspam",[["id","p",true]]],["spamMessage","post","/v1/message/messages/{id}/spam",[["id","p",true]]],["unspamMessage","post","/v1/message/messages/{id}/unspam",[["id","p",true]]],["bulkMoveThreads","post","/v1/message/threads/bulk:move",null,1],["bulkAssignThreads","post","/v1/message/threads/bulk:assign",null,1],["threadBulkActionsRead","post","/v1/message/threads/bulk:read",null,1],["threadBulkActionsUnread","post","/v1/message/threads/bulk:unread",null,1],["threadBulkActionsFavorite","post","/v1/message/threads/bulk:favorite",null,1],["threadBulkActionsUnfavorite","post","/v1/message/threads/bulk:unfavorite",null,1],["threadBulkActionsTrash","post","/v1/message/threads/bulk:trash",null,1],["threadBulkActionsUntrash","post","/v1/message/threads/bulk:untrash",null,1],["threadBulkActionsDelete","post","/v1/message/threads/bulk:delete",null,1],["threadBulkActionsDone","post","/v1/message/threads/bulk:done",null,1],["threadBulkActionsOpen","post","/v1/message/threads/bulk:open",null,1],["markReadThread","post","/v1/message/threads/{id}/read",[["id","p",true]]],["markReadThreadV2","post","/v2/message/threads/{id}/read",[["id","p",true]],1],["markUnreadThread","post","/v1/message/threads/{id}/unread",[["id","p",true]]],["markUnreadThreadV2","post","/v2/message/threads/{id}/unread",[["id","p",true]],1],["assignThread","post","/v1/message/threads/{id}/assign",[["id","p",true]],1],["unassignThread","post","/v1/message/threads/{id}/unassign",[["id","p",true],["unlink_mapped_entities","q"]],1],["assignUsers","post","/v1/message/threads/{id}/assign:users",[["id","p",true]],1],["assignUsersV2","post","/v2/message/threads/{id}/assign:users",[["id","p",true]],1],["pinThread","post","/v1/message/threads/{id}:pin",[["id","p",true]]],["unpinThread","delete","/v1/message/threads/{id}:pin",[["id","p",true]]],["createDraft","post","/v1/message/drafts",null,1],["sendDraft","post","/v1/message/drafts:send"],["getMessageV2","get","/v2/message/messages/{id}",[["id","p",true]]]]}
@@ -123,6 +123,34 @@
123
123
  },
124
124
  "403": {
125
125
  "description": "Forbidden"
126
+ },
127
+ "409": {
128
+ "description": "Conflict - the draft was edited by someone else since it was loaded",
129
+ "content": {
130
+ "application/json": {
131
+ "schema": {
132
+ "type": "object",
133
+ "properties": {
134
+ "error": {
135
+ "type": "string",
136
+ "description": "Human-readable conflict message",
137
+ "example": "This draft was edited by someone else. Please reload and try again."
138
+ },
139
+ "current_message": {
140
+ "description": "The current server version of the message (includes updated_by / _updated_at)",
141
+ "allOf": [
142
+ {
143
+ "$ref": "#/components/schemas/BaseEntity"
144
+ },
145
+ {
146
+ "$ref": "#/components/schemas/Message"
147
+ }
148
+ ]
149
+ }
150
+ }
151
+ }
152
+ }
153
+ }
126
154
  }
127
155
  }
128
156
  }
@@ -762,6 +790,41 @@
762
790
  }
763
791
  }
764
792
  },
793
+ "/v2/message/threads:workload": {
794
+ "post": {
795
+ "operationId": "getAssigneeWorkload",
796
+ "summary": "getAssigneeWorkload",
797
+ "description": "Return the open-thread workload for a set of user ids.\n\nFor each requested user id, returns the number of *open* threads assigned\ndirectly to that user — matching what the user sees in their central-inbox\nopen view: in inbox, not trashed, not done, and excluding notification-only\nand spam threads.\n\nOnly threads assigned directly to a user are counted; threads assigned to a\ngroup the user belongs to are not. Intended for assignment load-balancing\n(e.g. even-distribution automations) that need a consistent, inbox-aligned\nworkload per user.\n",
798
+ "tags": [
799
+ "Threads"
800
+ ],
801
+ "requestBody": {
802
+ "required": true,
803
+ "content": {
804
+ "application/json": {
805
+ "schema": {
806
+ "$ref": "#/components/schemas/AssigneeWorkloadParams"
807
+ }
808
+ }
809
+ }
810
+ },
811
+ "responses": {
812
+ "200": {
813
+ "description": "Success",
814
+ "content": {
815
+ "application/json": {
816
+ "schema": {
817
+ "$ref": "#/components/schemas/AssigneeWorkloadResults"
818
+ }
819
+ }
820
+ }
821
+ },
822
+ "403": {
823
+ "description": "Forbidden"
824
+ }
825
+ }
826
+ }
827
+ },
765
828
  "/v1/message/threads": {
766
829
  "put": {
767
830
  "operationId": "updateThread",
@@ -2242,6 +2305,11 @@
2242
2305
  "description": "User ID of user sends the message.",
2243
2306
  "example": "206801"
2244
2307
  },
2308
+ "updated_by": {
2309
+ "type": "string",
2310
+ "description": "User ID of the user who last updated (edited) the message. Set for drafts on each save.",
2311
+ "example": "206801"
2312
+ },
2245
2313
  "subject": {
2246
2314
  "type": "string",
2247
2315
  "description": "Subject",
@@ -2466,6 +2534,11 @@
2466
2534
  "type": "boolean",
2467
2535
  "description": "If true then this attachment is sent via link. The link have to be inserted to email body by API caller. In this case, service doesn't process this attachment.\n",
2468
2536
  "default": false
2537
+ },
2538
+ "save_to_entity": {
2539
+ "type": "boolean",
2540
+ "description": "If false, this file relation is kept on the message (e.g. for CID/inline rendering) but is NOT propagated to the entity the email is sent from. Used for inline images such as logos, signatures and social icons. Defaults to true.\n",
2541
+ "default": true
2469
2542
  }
2470
2543
  }
2471
2544
  },
@@ -2481,6 +2554,11 @@
2481
2554
  "description": "Whether the thread is marked as Done immediately after sending the message",
2482
2555
  "default": false
2483
2556
  },
2557
+ "mark_thread_as_read": {
2558
+ "type": "boolean",
2559
+ "description": "Whether to mark the thread as read by the sender's org/user after sending a reply.\nOnly applies when `parent_id` is set. When false, the thread's `org_read_message` and\n`user_read_message` arrays are left unchanged, so the thread remains unread for anyone\nwho had it unread before. Defaults to true for backward compatibility.\n",
2560
+ "default": true
2561
+ },
2484
2562
  "thread": {
2485
2563
  "type": "object",
2486
2564
  "required": [
@@ -2563,6 +2641,19 @@
2563
2641
  "type": "string",
2564
2642
  "description": "Template ID used for sending message.",
2565
2643
  "example": "3f34ce73-089c-4d45-a5ee-c161234e41c3"
2644
+ },
2645
+ "source": {
2646
+ "type": "string",
2647
+ "description": "Identifies who triggered the send so server-side policy can branch on it.\nFor `manual` sends, the caller's curated `_tags` are trusted as-is and no\nserver-side enrichment from the referenced `template_id` (e.g. merging the\ntemplate's `email_tags`) is performed. Any non-manual value (or omitting the\nfield) opts into template-derived enrichment.\n",
2648
+ "enum": [
2649
+ "manual",
2650
+ "automation",
2651
+ "workflow",
2652
+ "partner",
2653
+ "bulk",
2654
+ "system"
2655
+ ],
2656
+ "example": "manual"
2566
2657
  }
2567
2658
  }
2568
2659
  },
@@ -2661,6 +2752,60 @@
2661
2752
  }
2662
2753
  }
2663
2754
  },
2755
+ "AssigneeWorkloadParams": {
2756
+ "type": "object",
2757
+ "required": [
2758
+ "user_ids"
2759
+ ],
2760
+ "properties": {
2761
+ "user_ids": {
2762
+ "type": "array",
2763
+ "description": "User ids to compute the open-thread workload for. At most 100 per request; larger requests are rejected with 422.",
2764
+ "minItems": 1,
2765
+ "items": {
2766
+ "type": "string"
2767
+ },
2768
+ "example": [
2769
+ "11000902",
2770
+ "11001053"
2771
+ ]
2772
+ }
2773
+ }
2774
+ },
2775
+ "AssigneeWorkload": {
2776
+ "type": "object",
2777
+ "required": [
2778
+ "user_id",
2779
+ "open_threads"
2780
+ ],
2781
+ "properties": {
2782
+ "user_id": {
2783
+ "type": "string",
2784
+ "description": "The user id.",
2785
+ "example": "11000902"
2786
+ },
2787
+ "open_threads": {
2788
+ "type": "number",
2789
+ "description": "Number of open threads assigned directly to the user.",
2790
+ "example": 2
2791
+ }
2792
+ }
2793
+ },
2794
+ "AssigneeWorkloadResults": {
2795
+ "type": "object",
2796
+ "required": [
2797
+ "workloads"
2798
+ ],
2799
+ "properties": {
2800
+ "workloads": {
2801
+ "type": "array",
2802
+ "description": "Open-thread workload per requested user id, in request order.",
2803
+ "items": {
2804
+ "$ref": "#/components/schemas/AssigneeWorkload"
2805
+ }
2806
+ }
2807
+ }
2808
+ },
2664
2809
  "ReadMessagePayload": {
2665
2810
  "type": "object",
2666
2811
  "required": [
@@ -2785,7 +2930,7 @@
2785
2930
  "timestamp": {
2786
2931
  "type": "string",
2787
2932
  "description": "Timestamp of the event",
2788
- "example": "2024-01-01T00:00:00Z"
2933
+ "example": "2024-01-01T00:00:00.000Z"
2789
2934
  }
2790
2935
  }
2791
2936
  },
@@ -1 +1 @@
1
- {"s":"https://targeting.sls.epilot.io","o":[["changeCampaignStatus","post","/v1/campaign/{campaign_id}/status",[["CampaignIdPathParam"]]],["getCampaignJobStatus","get","/v1/campaign/{campaign_id}/job",[["CampaignIdPathParam"]]],["getCampaignPortals","get","/v1/campaign/{campaign_id}/portals",[["CampaignIdPathParam"]]],["retriggerCampaignAutomations","post","/v1/campaign/{campaign_id}/automations:retrigger",[["CampaignIdPathParam"]],1],["setupCampaign","post","/v1/campaign:setup",null,1],["matchCampaigns","post","/v1/campaign:match",null,1],["matchTargets","post","/v1/target:match",null,1],["getTargetQueries","post","/v1/target/queries",null,1],["createRecipient","post","/v1/campaign/{campaign_id}/recipient",[["CampaignIdPathParam"]],1],["updateRecipient","patch","/v1/campaign/{campaign_id}/recipient/{recipient_id}",[["CampaignIdPathParam"],["RecipientIdPathParam"]],1],["updateRecipientPortalStatus","patch","/v1/campaign/{campaign_id}/recipient/{recipient_id}/portal:status",[["CampaignIdPathParam"],["RecipientIdPathParam"]],1],["getRecipients","get","/v1/campaign/{campaign_id}/recipients",[["CampaignIdPathParam"],["limit","q"],["next","q"],["q","q"],["automation_status","q",false,"form",true],["portal_status","q"]]]],"v":"3.0.3","cp":{"CampaignIdPathParam":["campaign_id","p",true],"RecipientIdPathParam":["recipient_id","p",true]}}
1
+ {"s":"https://targeting.sls.epilot.io","o":[["changeCampaignStatus","post","/v1/campaign/{campaign_id}/status",[["CampaignIdPathParam"]]],["getCampaignJobStatus","get","/v1/campaign/{campaign_id}/job",[["CampaignIdPathParam"]]],["getCampaignPortals","get","/v1/campaign/{campaign_id}/portals",[["CampaignIdPathParam"]]],["retriggerCampaignAutomations","post","/v1/campaign/{campaign_id}/automations:retrigger",[["CampaignIdPathParam"]],1],["setupCampaign","post","/v1/campaign:setup",null,1],["matchCampaigns","post","/v1/campaign:match",null,1],["discoverCampaigns","post","/v1/campaign:discover",null,1],["matchTargets","post","/v1/target:match",null,1],["getTargetQueries","post","/v1/target/queries",null,1],["createRecipient","post","/v1/campaign/{campaign_id}/recipient",[["CampaignIdPathParam"]],1],["updateRecipient","patch","/v1/campaign/{campaign_id}/recipient/{recipient_id}",[["CampaignIdPathParam"],["RecipientIdPathParam"]],1],["updateRecipientPortalStatus","patch","/v1/campaign/{campaign_id}/recipient/{recipient_id}/portal:status",[["CampaignIdPathParam"],["RecipientIdPathParam"]],1],["updateRecipientEntityUiStatus","patch","/v1/campaign/{campaign_id}/recipient/{recipient_id}/entity_ui:status",[["CampaignIdPathParam"],["RecipientIdPathParam"]],1],["getRecipients","get","/v1/campaign/{campaign_id}/recipients",[["CampaignIdPathParam"],["limit","q"],["next","q"],["q","q"],["automation_status","q",false,"form",true],["portal_status","q"]]]],"v":"3.0.3","cp":{"CampaignIdPathParam":["campaign_id","p",true],"RecipientIdPathParam":["recipient_id","p",true]}}
@@ -243,6 +243,42 @@
243
243
  }
244
244
  }
245
245
  },
246
+ "/v1/campaign:discover": {
247
+ "post": {
248
+ "operationId": "discoverCampaigns",
249
+ "summary": "Discover Entity-UI Next Best Actions for an entity",
250
+ "description": "Given an entity, returns the Next Best Actions it should see on the Entity-UI channel.\n\nEnumerates the organization's **active** campaigns that carry a valid Entity-UI Next Best\nAction, live-matches each against the entity using the existing match engine, and returns\nthe matching NBAs priority-sorted (one per campaign).\n\nThis is a pure read: it writes nothing. An entity that matches no campaigns returns an\nempty list, not an error.\n",
251
+ "tags": [
252
+ "Campaign"
253
+ ],
254
+ "security": [
255
+ {
256
+ "EpilotAuth": []
257
+ }
258
+ ],
259
+ "requestBody": {
260
+ "required": true,
261
+ "content": {
262
+ "application/json": {
263
+ "schema": {
264
+ "$ref": "#/components/schemas/DiscoverCampaignsParams"
265
+ }
266
+ }
267
+ }
268
+ },
269
+ "responses": {
270
+ "200": {
271
+ "$ref": "#/components/responses/DiscoverCampaignsResponse"
272
+ },
273
+ "400": {
274
+ "$ref": "#/components/responses/ClientErrorResponse"
275
+ },
276
+ "500": {
277
+ "$ref": "#/components/responses/ServerErrorResponse"
278
+ }
279
+ }
280
+ }
281
+ },
246
282
  "/v1/target:match": {
247
283
  "post": {
248
284
  "operationId": "matchTargets",
@@ -450,6 +486,56 @@
450
486
  }
451
487
  }
452
488
  },
489
+ "/v1/campaign/{campaign_id}/recipient/{recipient_id}/entity_ui:status": {
490
+ "patch": {
491
+ "operationId": "updateRecipientEntityUiStatus",
492
+ "summary": "Update Entity-UI (Next Best Action) status for a campaign recipient",
493
+ "description": "Records a Next Best Action interaction for a recipient on the Entity-UI channel.\n\nUnlike the portal channel, an NBA recipient is created lazily: the first `seen` creates\nthe recipient record (and requires `entity_schema`). `seen` is idempotent — re-viewing an\nNBA that is already seen/clicked/dismissed is a no-op success and never regresses the status.\n\nStatus transition rules:\n- `seen`: lazily creates the recipient; a no-op success if a status already exists\n- From `seen`: can change to `clicked` or `dismissed`\n- From `clicked`: can change to `dismissed`\n- From `dismissed`: cannot be changed (final state)\n\n`dismissed` and `clicked` require an existing recipient (404 otherwise, since an NBA is\nborn at `seen`) and reject invalid transitions (409).\n\nThe entity_ui_status_updated_at timestamp is automatically set when the status changes.\n",
494
+ "tags": [
495
+ "Campaign Recipient"
496
+ ],
497
+ "security": [
498
+ {
499
+ "EpilotAuth": []
500
+ }
501
+ ],
502
+ "parameters": [
503
+ {
504
+ "$ref": "#/components/parameters/CampaignIdPathParam"
505
+ },
506
+ {
507
+ "$ref": "#/components/parameters/RecipientIdPathParam"
508
+ }
509
+ ],
510
+ "requestBody": {
511
+ "required": true,
512
+ "content": {
513
+ "application/json": {
514
+ "schema": {
515
+ "$ref": "#/components/schemas/UpdateEntityUiStatusRequest"
516
+ }
517
+ }
518
+ }
519
+ },
520
+ "responses": {
521
+ "200": {
522
+ "$ref": "#/components/responses/RecipientResponse"
523
+ },
524
+ "400": {
525
+ "$ref": "#/components/responses/ClientErrorResponse"
526
+ },
527
+ "404": {
528
+ "$ref": "#/components/responses/ClientErrorResponse"
529
+ },
530
+ "409": {
531
+ "$ref": "#/components/responses/ClientErrorResponse"
532
+ },
533
+ "500": {
534
+ "$ref": "#/components/responses/ServerErrorResponse"
535
+ }
536
+ }
537
+ }
538
+ },
453
539
  "/v1/campaign/{campaign_id}/recipients": {
454
540
  "get": {
455
541
  "operationId": "getRecipients",
@@ -918,6 +1004,122 @@
918
1004
  ],
919
1005
  "additionalProperties": false
920
1006
  },
1007
+ "NextBestAction": {
1008
+ "type": "object",
1009
+ "description": "A Next Best Action configured on a campaign's Entity-UI channel.\nThis is the canonical NBA contract shared by discovery (this API), authoring, and rendering.\nNBA content is single-language in v1; text fields may contain `{{placeholders}}` resolved at render time.\n",
1010
+ "properties": {
1011
+ "category": {
1012
+ "type": "string",
1013
+ "description": "Light category label shown above the title. Free-form text."
1014
+ },
1015
+ "icon": {
1016
+ "type": "object",
1017
+ "description": "Curated icon for the NBA.",
1018
+ "properties": {
1019
+ "name": {
1020
+ "type": "string",
1021
+ "description": "Icon name from \"@epilot360/icons\"."
1022
+ },
1023
+ "color": {
1024
+ "type": "string",
1025
+ "description": "Optional icon color."
1026
+ }
1027
+ },
1028
+ "required": [
1029
+ "name"
1030
+ ]
1031
+ },
1032
+ "title": {
1033
+ "type": "string",
1034
+ "description": "Bold action title. Required. Supports `{{placeholders}}`."
1035
+ },
1036
+ "body": {
1037
+ "type": "string",
1038
+ "description": "Optional description. Supports `{{placeholders}}` (incl. relative dates)."
1039
+ },
1040
+ "priority": {
1041
+ "type": "string",
1042
+ "enum": [
1043
+ "low",
1044
+ "medium",
1045
+ "high"
1046
+ ],
1047
+ "default": "medium",
1048
+ "description": "Display priority. NBAs are shown highest-priority first."
1049
+ },
1050
+ "is_dismissable": {
1051
+ "type": "boolean",
1052
+ "default": true,
1053
+ "description": "Whether the agent can dismiss the NBA."
1054
+ },
1055
+ "cta": {
1056
+ "type": "object",
1057
+ "description": "The NBA's single call-to-action.",
1058
+ "properties": {
1059
+ "type": {
1060
+ "type": "string",
1061
+ "enum": [
1062
+ "journey",
1063
+ "workflow",
1064
+ "url"
1065
+ ]
1066
+ },
1067
+ "target": {
1068
+ "type": "string",
1069
+ "description": "Journey id, workflow definition id, or URL, depending on `type`."
1070
+ },
1071
+ "label": {
1072
+ "type": "string",
1073
+ "description": "Optional CTA button label."
1074
+ },
1075
+ "context_params": {
1076
+ "type": "array",
1077
+ "description": "Journey context parameters (journey CTA only). Maps the journey's declared\ncontext parameters so the journey knows which entity it is about. Discovery\nreturns them verbatim; they are passed to the journey when it launches.\n",
1078
+ "items": {
1079
+ "type": "object",
1080
+ "properties": {
1081
+ "key": {
1082
+ "type": "string"
1083
+ },
1084
+ "value": {
1085
+ "type": "string"
1086
+ }
1087
+ },
1088
+ "required": [
1089
+ "key",
1090
+ "value"
1091
+ ]
1092
+ }
1093
+ }
1094
+ },
1095
+ "required": [
1096
+ "type",
1097
+ "target"
1098
+ ]
1099
+ }
1100
+ },
1101
+ "required": [
1102
+ "title",
1103
+ "cta"
1104
+ ]
1105
+ },
1106
+ "DiscoverCampaignsParams": {
1107
+ "type": "object",
1108
+ "properties": {
1109
+ "entity_id": {
1110
+ "$ref": "#/components/schemas/BaseUUID"
1111
+ },
1112
+ "entity_schema": {
1113
+ "type": "string",
1114
+ "description": "The schema slug of the entity (e.g. \"contact\" or \"account\")."
1115
+ }
1116
+ },
1117
+ "required": [
1118
+ "entity_id",
1119
+ "entity_schema"
1120
+ ],
1121
+ "additionalProperties": false
1122
+ },
921
1123
  "MatchTargetParams": {
922
1124
  "type": "object",
923
1125
  "properties": {
@@ -1022,6 +1224,22 @@
1022
1224
  "clicked"
1023
1225
  ]
1024
1226
  },
1227
+ "EntityUiStatus": {
1228
+ "type": "string",
1229
+ "description": "Lifecycle status of a Next Best Action on the Entity-UI channel. Unlike the portal\nchannel there is no `sent` state: an NBA recipient is born at `seen`, the moment the\naction is first rendered to an agent.\n",
1230
+ "enum": [
1231
+ "seen",
1232
+ "dismissed",
1233
+ "clicked"
1234
+ ]
1235
+ },
1236
+ "Resolution": {
1237
+ "type": "string",
1238
+ "description": "Cross-channel resolution of a campaign for a recipient. Unlike the per-channel `*_status`\nfields (where `dismissed` is channel-local), a resolution suppresses the campaign on EVERY\nchannel — the 360 Entity-UI card and the portal teaser alike. Server-managed and read-only:\nnever sent by a client. Absence means unresolved.\n",
1239
+ "enum": [
1240
+ "accepted"
1241
+ ]
1242
+ },
1025
1243
  "Recipient": {
1026
1244
  "type": "object",
1027
1245
  "properties": {
@@ -1051,6 +1269,16 @@
1051
1269
  "type": "object",
1052
1270
  "additionalProperties": true
1053
1271
  },
1272
+ "entity_ui_status": {
1273
+ "$ref": "#/components/schemas/EntityUiStatus"
1274
+ },
1275
+ "entity_ui_status_updated_at": {
1276
+ "type": "string",
1277
+ "format": "date-time"
1278
+ },
1279
+ "resolution": {
1280
+ "$ref": "#/components/schemas/Resolution"
1281
+ },
1054
1282
  "updated_at": {
1055
1283
  "type": "string",
1056
1284
  "format": "date-time"
@@ -1216,6 +1444,22 @@
1216
1444
  "status"
1217
1445
  ]
1218
1446
  },
1447
+ "UpdateEntityUiStatusRequest": {
1448
+ "type": "object",
1449
+ "properties": {
1450
+ "status": {
1451
+ "$ref": "#/components/schemas/EntityUiStatus"
1452
+ },
1453
+ "entity_schema": {
1454
+ "type": "string",
1455
+ "description": "Schema slug of the recipient entity (e.g. \"contact\"). Required when recording the\nfirst `seen`, which lazily creates the recipient record; ignored on later transitions.\n"
1456
+ }
1457
+ },
1458
+ "required": [
1459
+ "status"
1460
+ ],
1461
+ "additionalProperties": false
1462
+ },
1219
1463
  "SetupCampaignRequest": {
1220
1464
  "description": "Discriminated by `type`. Each campaign variant has its own request shape;\nnew variants are added by introducing a new schema and extending the `oneOf` list.\n",
1221
1465
  "oneOf": [
@@ -1561,6 +1805,53 @@
1561
1805
  }
1562
1806
  }
1563
1807
  },
1808
+ "DiscoverCampaignsResponse": {
1809
+ "description": "The Next Best Actions the entity should see on the Entity-UI channel, priority-sorted.",
1810
+ "content": {
1811
+ "application/json": {
1812
+ "schema": {
1813
+ "type": "object",
1814
+ "properties": {
1815
+ "hits": {
1816
+ "type": "number",
1817
+ "description": "Number of matching NBAs."
1818
+ },
1819
+ "results": {
1820
+ "type": "array",
1821
+ "description": "Matching NBAs, sorted by priority (desc); one entry per campaign.",
1822
+ "items": {
1823
+ "type": "object",
1824
+ "properties": {
1825
+ "campaign_id": {
1826
+ "$ref": "#/components/schemas/BaseUUID"
1827
+ },
1828
+ "nba": {
1829
+ "$ref": "#/components/schemas/NextBestAction"
1830
+ },
1831
+ "status": {
1832
+ "allOf": [
1833
+ {
1834
+ "$ref": "#/components/schemas/EntityUiStatus"
1835
+ }
1836
+ ],
1837
+ "description": "The recipient's current Entity-UI status for this campaign, present only\nwhen a recipient record already exists (i.e. the entity has previously seen\nor clicked this NBA). Absent when the entity has not yet interacted with it.\nDismissed NBAs are filtered out server-side, so this is only ever `seen` or\n`clicked`. Lets the client skip a redundant `seen` call for NBAs already seen.\n"
1838
+ }
1839
+ },
1840
+ "required": [
1841
+ "campaign_id",
1842
+ "nba"
1843
+ ]
1844
+ }
1845
+ }
1846
+ },
1847
+ "required": [
1848
+ "hits",
1849
+ "results"
1850
+ ]
1851
+ }
1852
+ }
1853
+ }
1854
+ },
1564
1855
  "MatchTargetsResponse": {
1565
1856
  "description": "List of targets where the given entities are found.",
1566
1857
  "content": {
@@ -1094,11 +1094,11 @@
1094
1094
  },
1095
1095
  "WebhookCondition": {
1096
1096
  "type": "object",
1097
- "description": "A condition that must be met for the webhook to fire.",
1097
+ "description": "A condition that must be met for the webhook to fire. A condition is EITHER a classic field + operation comparison OR a single jsonata_expression evaluated against the event payload — the two forms are mutually exclusive.",
1098
1098
  "properties": {
1099
1099
  "field": {
1100
1100
  "type": "string",
1101
- "description": "Dot-notation path to the field in the event payload (e.g. \"entity.status\", \"entity.line_items\")"
1101
+ "description": "Dot-notation path to the field in the event payload (e.g. \"entity.status\", \"entity.line_items\"). Supports array indices in either spelling, which resolve identically: \"meter_readings.1.file_id\" or \"meter_readings[1].file_id\"."
1102
1102
  },
1103
1103
  "operation": {
1104
1104
  "type": "string",
@@ -1154,12 +1154,13 @@
1154
1154
  "type": "boolean",
1155
1155
  "description": "When true, evaluates conditions per-item in repeatable array fields",
1156
1156
  "default": false
1157
+ },
1158
+ "jsonata_expression": {
1159
+ "type": "string",
1160
+ "maxLength": 15000,
1161
+ "description": "JSONata expression evaluated against the event payload; the condition passes when the result is truthy per JSONata $boolean semantics. Mutually exclusive with field/operation."
1157
1162
  }
1158
- },
1159
- "required": [
1160
- "field",
1161
- "operation"
1162
- ]
1163
+ }
1163
1164
  },
1164
1165
  "WebhookConditionGroup": {
1165
1166
  "type": "object",
@@ -6,25 +6,25 @@ var _chunkS5HBBTKMcjs = require('../chunk-S5HBBTKM.cjs');
6
6
 
7
7
 
8
8
 
9
- var _chunkGHPSNA2Ucjs = require('../chunk-GHPSNA2U.cjs');
9
+ var _chunkSNERI3PKcjs = require('../chunk-SNERI3PK.cjs');
10
10
  require('../chunk-NJK5F5TF.cjs');
11
11
 
12
12
  // src/apis/access-token.ts
13
13
  var loadDefinition = () => {
14
14
  const mod = _chunkS5HBBTKMcjs.require_access_token_runtime.call(void 0, );
15
- return _chunkGHPSNA2Ucjs.expand.call(void 0, _nullishCoalesce(mod.default, () => ( mod)));
15
+ return _chunkSNERI3PKcjs.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 = _chunkGHPSNA2Ucjs.createApiClient.call(void 0, { definition: def, apiName: "accessToken" });
21
+ _instance = _chunkSNERI3PKcjs.createApiClient.call(void 0, { definition: def, apiName: "accessToken" });
22
22
  }
23
23
  return _instance;
24
24
  };
25
- var _handle = _chunkGHPSNA2Ucjs.createApiHandle.call(void 0, {
25
+ var _handle = _chunkSNERI3PKcjs.createApiHandle.call(void 0, {
26
26
  resolveClient: resolve,
27
- createClient: () => _chunkGHPSNA2Ucjs.createApiClient.call(void 0, { definition: loadDefinition(), apiName: "accessToken" }),
27
+ createClient: () => _chunkSNERI3PKcjs.createApiClient.call(void 0, { definition: loadDefinition(), apiName: "accessToken" }),
28
28
  apiName: "accessToken"
29
29
  });
30
30
  var getClient = _handle.getClient;
@@ -35,4 +35,4 @@ var accessToken = _handle;
35
35
 
36
36
 
37
37
 
38
- exports.accessToken = accessToken; exports.authorize = _chunkGHPSNA2Ucjs.authorize; exports.createClient = createClient; exports.getClient = getClient;
38
+ exports.accessToken = accessToken; exports.authorize = _chunkSNERI3PKcjs.authorize; exports.createClient = createClient; exports.getClient = getClient;
@@ -6,7 +6,7 @@ import {
6
6
  createApiClient,
7
7
  createApiHandle,
8
8
  expand
9
- } from "../chunk-CRUXTTHI.js";
9
+ } from "../chunk-OJLX6U66.js";
10
10
  import "../chunk-YPSWSI3M.js";
11
11
 
12
12
  // src/apis/access-token.ts