@antcde/connect-ts 0.4.35-rc.1 → 0.4.35

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 (175) hide show
  1. package/build/AntConnect.d.ts +15 -2
  2. package/build/AntConnect.d.ts.map +1 -1
  3. package/build/AntConnect.js +14 -2
  4. package/build/index.d.ts +29 -29
  5. package/build/index.d.ts.map +1 -1
  6. package/build/index.js +7 -7
  7. package/build/service-runtime.d.ts +1 -1
  8. package/build/service-runtime.d.ts.map +1 -1
  9. package/build/service-runtime.js +1 -1
  10. package/build/service-types.d.ts +7 -7
  11. package/build/service-types.d.ts.map +1 -1
  12. package/build/services/AppService/types/resourceReleases.d.ts +1 -1
  13. package/build/services/AppService/types/seats.d.ts +0 -8
  14. package/build/services/AppService/types/seats.d.ts.map +1 -1
  15. package/build/services/AppService/types/sellableResources.d.ts +1 -1
  16. package/build/services/AppService/types/subscriptions.d.ts +0 -4
  17. package/build/services/AppService/types/subscriptions.d.ts.map +1 -1
  18. package/build/services/SecretSharing.types.d.ts +1 -1
  19. package/build/services/TaskRelation.types.d.ts +1 -1
  20. package/build/services/TaskService.types.d.ts +1 -1
  21. package/build/services/TaskService.types.d.ts.map +1 -1
  22. package/build/services/Webhook/ConfigService.d.ts +50 -2
  23. package/build/services/Webhook/ConfigService.d.ts.map +1 -1
  24. package/build/services/Webhook/ConfigService.js +5 -2
  25. package/build/services/Webhook/EventService.d.ts +145 -2
  26. package/build/services/Webhook/EventService.d.ts.map +1 -1
  27. package/build/services/Webhook/EventService.js +6 -2
  28. package/build/services/Webhook/TriggerCaller.types.d.ts +17 -2
  29. package/build/services/Webhook/TriggerCaller.types.d.ts.map +1 -1
  30. package/build/services/Webhook/TriggerCaller.types.js +1 -2
  31. package/build/services/Webhook/TriggerDataset.types.d.ts +167 -2
  32. package/build/services/Webhook/TriggerDataset.types.d.ts.map +1 -1
  33. package/build/services/Webhook/TriggerDataset.types.js +51 -2
  34. package/build/services/Webhook/TriggerDatasetColumns.d.ts +73 -2
  35. package/build/services/Webhook/TriggerDatasetColumns.d.ts.map +1 -1
  36. package/build/services/Webhook/TriggerDatasetColumns.js +118 -2
  37. package/build/services/Webhook/TriggerDatasetCsv.types.d.ts +6 -2
  38. package/build/services/Webhook/TriggerDatasetCsv.types.d.ts.map +1 -1
  39. package/build/services/Webhook/TriggerDatasetCsv.types.js +1 -2
  40. package/build/services/Webhook/TriggerDatasetResponses.types.d.ts +175 -2
  41. package/build/services/Webhook/TriggerDatasetResponses.types.d.ts.map +1 -1
  42. package/build/services/Webhook/TriggerDatasetResponses.types.js +99 -2
  43. package/build/services/Webhook/TriggerDatasetSourceService.d.ts +181 -2
  44. package/build/services/Webhook/TriggerDatasetSourceService.d.ts.map +1 -1
  45. package/build/services/Webhook/TriggerDatasetSourceService.js +23 -2
  46. package/build/services/Webhook/TriggerDispatch.types.d.ts +88 -2
  47. package/build/services/Webhook/TriggerDispatch.types.d.ts.map +1 -1
  48. package/build/services/Webhook/TriggerDispatch.types.js +24 -2
  49. package/build/services/Webhook/TriggerDispatchUrl.d.ts +8 -2
  50. package/build/services/Webhook/TriggerDispatchUrl.d.ts.map +1 -1
  51. package/build/services/Webhook/TriggerDispatchUrl.js +27 -2
  52. package/build/services/Webhook/TriggerDivergence.d.ts +29 -2
  53. package/build/services/Webhook/TriggerDivergence.d.ts.map +1 -1
  54. package/build/services/Webhook/TriggerDivergence.js +25 -2
  55. package/build/services/Webhook/TriggerFailedRuns.types.d.ts +32 -2
  56. package/build/services/Webhook/TriggerFailedRuns.types.d.ts.map +1 -1
  57. package/build/services/Webhook/TriggerFailedRuns.types.js +1 -2
  58. package/build/services/Webhook/TriggerHistoryService.d.ts +200 -2
  59. package/build/services/Webhook/TriggerHistoryService.d.ts.map +1 -1
  60. package/build/services/Webhook/TriggerHistoryService.js +13 -2
  61. package/build/services/Webhook/TriggerLastRun.types.d.ts +79 -2
  62. package/build/services/Webhook/TriggerLastRun.types.d.ts.map +1 -1
  63. package/build/services/Webhook/TriggerLastRun.types.js +1 -2
  64. package/build/services/Webhook/TriggerOwner.d.ts +4 -2
  65. package/build/services/Webhook/TriggerOwner.d.ts.map +1 -1
  66. package/build/services/Webhook/TriggerOwner.js +6 -2
  67. package/build/services/Webhook/TriggerRefresh.types.d.ts +14 -2
  68. package/build/services/Webhook/TriggerRefresh.types.d.ts.map +1 -1
  69. package/build/services/Webhook/TriggerRefresh.types.js +1 -2
  70. package/build/services/Webhook/TriggerRefusalDetail.types.d.ts +62 -2
  71. package/build/services/Webhook/TriggerRefusalDetail.types.d.ts.map +1 -1
  72. package/build/services/Webhook/TriggerRefusalDetail.types.js +12 -2
  73. package/build/services/Webhook/TriggerRequest.types.d.ts +57 -2
  74. package/build/services/Webhook/TriggerRequest.types.d.ts.map +1 -1
  75. package/build/services/Webhook/TriggerRequest.types.js +1 -2
  76. package/build/services/Webhook/TriggerSearch.types.d.ts +38 -2
  77. package/build/services/Webhook/TriggerSearch.types.d.ts.map +1 -1
  78. package/build/services/Webhook/TriggerSearch.types.js +1 -2
  79. package/build/services/Webhook/TriggerSecretService.d.ts +87 -2
  80. package/build/services/Webhook/TriggerSecretService.d.ts.map +1 -1
  81. package/build/services/Webhook/TriggerSecretService.js +9 -2
  82. package/build/services/Webhook/TriggerService.d.ts +190 -2
  83. package/build/services/Webhook/TriggerService.d.ts.map +1 -1
  84. package/build/services/Webhook/TriggerService.js +14 -2
  85. package/build/services/Webhook/TriggerStats.types.d.ts +45 -2
  86. package/build/services/Webhook/TriggerStats.types.d.ts.map +1 -1
  87. package/build/services/Webhook/TriggerStats.types.js +1 -2
  88. package/build/services/Webhook/TriggerTimeline.types.d.ts +41 -2
  89. package/build/services/Webhook/TriggerTimeline.types.d.ts.map +1 -1
  90. package/build/services/Webhook/TriggerTimeline.types.js +1 -2
  91. package/build/services/Webhook/TriggerVersion.types.d.ts +108 -2
  92. package/build/services/Webhook/TriggerVersion.types.d.ts.map +1 -1
  93. package/build/services/Webhook/TriggerVersion.types.js +1 -2
  94. package/build/services/Webhook/TriggerVersionService.d.ts +53 -2
  95. package/build/services/Webhook/TriggerVersionService.d.ts.map +1 -1
  96. package/build/services/Webhook/TriggerVersionService.js +20 -2
  97. package/package.json +1 -1
  98. package/build/services/Trigger/ConfigService.d.ts +0 -51
  99. package/build/services/Trigger/ConfigService.d.ts.map +0 -1
  100. package/build/services/Trigger/ConfigService.js +0 -5
  101. package/build/services/Trigger/EventService.d.ts +0 -146
  102. package/build/services/Trigger/EventService.d.ts.map +0 -1
  103. package/build/services/Trigger/EventService.js +0 -6
  104. package/build/services/Trigger/TriggerCaller.types.d.ts +0 -18
  105. package/build/services/Trigger/TriggerCaller.types.d.ts.map +0 -1
  106. package/build/services/Trigger/TriggerCaller.types.js +0 -1
  107. package/build/services/Trigger/TriggerDataset.types.d.ts +0 -168
  108. package/build/services/Trigger/TriggerDataset.types.d.ts.map +0 -1
  109. package/build/services/Trigger/TriggerDataset.types.js +0 -51
  110. package/build/services/Trigger/TriggerDatasetColumns.d.ts +0 -74
  111. package/build/services/Trigger/TriggerDatasetColumns.d.ts.map +0 -1
  112. package/build/services/Trigger/TriggerDatasetColumns.js +0 -118
  113. package/build/services/Trigger/TriggerDatasetCsv.types.d.ts +0 -7
  114. package/build/services/Trigger/TriggerDatasetCsv.types.d.ts.map +0 -1
  115. package/build/services/Trigger/TriggerDatasetCsv.types.js +0 -1
  116. package/build/services/Trigger/TriggerDatasetResponses.types.d.ts +0 -176
  117. package/build/services/Trigger/TriggerDatasetResponses.types.d.ts.map +0 -1
  118. package/build/services/Trigger/TriggerDatasetResponses.types.js +0 -99
  119. package/build/services/Trigger/TriggerDatasetSourceService.d.ts +0 -182
  120. package/build/services/Trigger/TriggerDatasetSourceService.d.ts.map +0 -1
  121. package/build/services/Trigger/TriggerDatasetSourceService.js +0 -23
  122. package/build/services/Trigger/TriggerDispatch.types.d.ts +0 -89
  123. package/build/services/Trigger/TriggerDispatch.types.d.ts.map +0 -1
  124. package/build/services/Trigger/TriggerDispatch.types.js +0 -24
  125. package/build/services/Trigger/TriggerDispatchUrl.d.ts +0 -9
  126. package/build/services/Trigger/TriggerDispatchUrl.d.ts.map +0 -1
  127. package/build/services/Trigger/TriggerDispatchUrl.js +0 -27
  128. package/build/services/Trigger/TriggerDivergence.d.ts +0 -30
  129. package/build/services/Trigger/TriggerDivergence.d.ts.map +0 -1
  130. package/build/services/Trigger/TriggerDivergence.js +0 -25
  131. package/build/services/Trigger/TriggerFailedRuns.types.d.ts +0 -33
  132. package/build/services/Trigger/TriggerFailedRuns.types.d.ts.map +0 -1
  133. package/build/services/Trigger/TriggerFailedRuns.types.js +0 -1
  134. package/build/services/Trigger/TriggerHistoryService.d.ts +0 -201
  135. package/build/services/Trigger/TriggerHistoryService.d.ts.map +0 -1
  136. package/build/services/Trigger/TriggerHistoryService.js +0 -13
  137. package/build/services/Trigger/TriggerLastRun.types.d.ts +0 -80
  138. package/build/services/Trigger/TriggerLastRun.types.d.ts.map +0 -1
  139. package/build/services/Trigger/TriggerLastRun.types.js +0 -1
  140. package/build/services/Trigger/TriggerOwner.d.ts +0 -5
  141. package/build/services/Trigger/TriggerOwner.d.ts.map +0 -1
  142. package/build/services/Trigger/TriggerOwner.js +0 -6
  143. package/build/services/Trigger/TriggerRefresh.types.d.ts +0 -15
  144. package/build/services/Trigger/TriggerRefresh.types.d.ts.map +0 -1
  145. package/build/services/Trigger/TriggerRefresh.types.js +0 -1
  146. package/build/services/Trigger/TriggerRefusalDetail.types.d.ts +0 -63
  147. package/build/services/Trigger/TriggerRefusalDetail.types.d.ts.map +0 -1
  148. package/build/services/Trigger/TriggerRefusalDetail.types.js +0 -12
  149. package/build/services/Trigger/TriggerRequest.types.d.ts +0 -58
  150. package/build/services/Trigger/TriggerRequest.types.d.ts.map +0 -1
  151. package/build/services/Trigger/TriggerRequest.types.js +0 -1
  152. package/build/services/Trigger/TriggerSearch.types.d.ts +0 -39
  153. package/build/services/Trigger/TriggerSearch.types.d.ts.map +0 -1
  154. package/build/services/Trigger/TriggerSearch.types.js +0 -1
  155. package/build/services/Trigger/TriggerSecretService.d.ts +0 -88
  156. package/build/services/Trigger/TriggerSecretService.d.ts.map +0 -1
  157. package/build/services/Trigger/TriggerSecretService.js +0 -9
  158. package/build/services/Trigger/TriggerService.d.ts +0 -191
  159. package/build/services/Trigger/TriggerService.d.ts.map +0 -1
  160. package/build/services/Trigger/TriggerService.js +0 -14
  161. package/build/services/Trigger/TriggerServices.d.ts +0 -33
  162. package/build/services/Trigger/TriggerServices.d.ts.map +0 -1
  163. package/build/services/Trigger/TriggerServices.js +0 -32
  164. package/build/services/Trigger/TriggerStats.types.d.ts +0 -46
  165. package/build/services/Trigger/TriggerStats.types.d.ts.map +0 -1
  166. package/build/services/Trigger/TriggerStats.types.js +0 -1
  167. package/build/services/Trigger/TriggerTimeline.types.d.ts +0 -42
  168. package/build/services/Trigger/TriggerTimeline.types.d.ts.map +0 -1
  169. package/build/services/Trigger/TriggerTimeline.types.js +0 -1
  170. package/build/services/Trigger/TriggerVersion.types.d.ts +0 -109
  171. package/build/services/Trigger/TriggerVersion.types.d.ts.map +0 -1
  172. package/build/services/Trigger/TriggerVersion.types.js +0 -1
  173. package/build/services/Trigger/TriggerVersionService.d.ts +0 -54
  174. package/build/services/Trigger/TriggerVersionService.d.ts.map +0 -1
  175. package/build/services/Trigger/TriggerVersionService.js +0 -20
@@ -1,3 +1,109 @@
1
- /** @deprecated Moved to `services/Trigger/TriggerVersion.types`. Remove in the next major release. */
2
- export * from '../Trigger/TriggerVersion.types';
1
+ import type { AuthType, HTTPMethod } from './ConfigService';
2
+ /**
3
+ * Versions of a trigger.
4
+ *
5
+ * The model, which the UI should reflect rather than reinterpret:
6
+ *
7
+ * **The trigger row IS the permanent draft.** A version is a frozen COPY of the
8
+ * trigger's output- and access-affecting columns, overlaid onto a clone of the
9
+ * trigger at dispatch time. There is no separate draft object to fetch or save —
10
+ * editing a trigger edits the draft, and a released version is a different row
11
+ * that the edit does not touch.
12
+ *
13
+ * Consequences worth designing around:
14
+ *
15
+ * - **Fork-on-edit needs no UI.** An edit always lands on the draft. Divergence
16
+ * from the released copy surfaces as `has_unreleased_changes` on the trigger.
17
+ * - **Several versions are callable at once.** That is the point, not an edge
18
+ * case: `…/versions/{version}/dispatch` addresses one specific version, and the
19
+ * bare dispatch URL follows whichever version is `is_default`.
20
+ * - **State is derived, never stored.** `released_at` and `retired_at` are the
21
+ * only facts; `state` and `is_callable` are computed from them.
22
+ */
23
+ /** Derived from `released_at` / `retired_at` — not a stored column. */
24
+ export type TriggerVersionState = 'draft' | 'released' | 'retired';
25
+ /**
26
+ * The fields a version freezes, and therefore the fields an edit to the draft can
27
+ * diverge on. Anything absent from this list — `name`, labels, `is_active`,
28
+ * `custom_path` — stays editable on the trigger at all times and deliberately does
29
+ * NOT count as an unreleased change. `debug_mode` IS locked: it switches
30
+ * RunScriptEvent's response shape (backend `TriggerLockPolicy`, AAD-975).
31
+ *
32
+ * Use it to label a diff, not to build a form: the trigger editor already edits
33
+ * these fields under their own names.
34
+ */
35
+ export type TriggerVersionLockedField = 'event_id' | 'payload' | 'http_method' | 'when' | 'close_task_after_execution' | 'debug_mode' | 'auth_type' | 'secret_token' | 'authorization_enforced' | 'read_only' | 'rate_limit_per_second' | 'rate_limit_per_minute';
36
+ export interface TriggerVersion {
37
+ id: string;
38
+ trigger_id: string;
39
+ /** Publisher-chosen label, unique per trigger. Free-form, max 64 chars. */
40
+ version: string;
41
+ release_notes: string | null;
42
+ state: TriggerVersionState;
43
+ /** Released and not retired. Only a callable version can be dispatched. */
44
+ is_callable: boolean;
45
+ /**
46
+ * Both are now **unconditional**, including on a version nested inside
47
+ * `Trigger.default_version`. They used to be omitted there, and `is_default` was
48
+ * the dangerous one: `is_default ?? false` did not fail to render, it rendered
49
+ * the WRONG version as the default — and the bare dispatch URL is exactly what
50
+ * follows this field.
51
+ *
52
+ * `dispatch_url` is `''` — not null — for a trigger with a `custom_path`. A
53
+ * custom path always dispatches the DEFAULT version and has no version-qualified
54
+ * form, so there is no URL that would address this specific version. Render the
55
+ * empty string as "no direct URL", never as a broken link.
56
+ */
57
+ dispatch_url: string;
58
+ is_default: boolean;
59
+ event_id: string;
60
+ /**
61
+ * The FROZEN event's category — what a store listing selling this version is.
62
+ * `returns_data` needs the data-publishing grant to link; null for an event the
63
+ * server has not synced a category for (treated as data).
64
+ */
65
+ action_kind: 'returns_data' | 'performs_action' | null;
66
+ payload: unknown;
67
+ http_method: HTTPMethod | null;
68
+ when: string | null;
69
+ auth_type: AuthType | null;
70
+ authorization_enforced: boolean;
71
+ read_only: boolean;
72
+ rate_limit_per_second: number | null;
73
+ rate_limit_per_minute: number | null;
74
+ close_task_after_execution: boolean;
75
+ /** Frozen at release; shapes this version's response. `?debug=true` timelines follow the draft. */
76
+ debug_mode: boolean;
77
+ /** AAD-1102: the script row pinned at release; null if no script or pre-pinning. */
78
+ script_version: {
79
+ id: string;
80
+ name: string;
81
+ version: string;
82
+ sha256: string;
83
+ } | null;
84
+ released_at: string | null;
85
+ retired_at: string | null;
86
+ created_by: string | null;
87
+ created_at: string | null;
88
+ updated_at: string | null;
89
+ }
90
+ /**
91
+ * Releasing a version. There is no "create a draft" call — the draft is the
92
+ * trigger, so this freezes whatever the trigger currently holds.
93
+ *
94
+ * The body carries NO configuration on purpose: a release that could also change
95
+ * the configuration would make "what did I just publish?" unanswerable.
96
+ */
97
+ export interface ReleaseTriggerVersionBody {
98
+ /** Max 64 chars. Rejected with 409 if this trigger already has it. */
99
+ version: string;
100
+ release_notes?: string | null;
101
+ }
102
+ /** Only the publisher-facing labels are editable on a released version. */
103
+ export interface UpdateTriggerVersionBody {
104
+ version?: string;
105
+ release_notes?: string | null;
106
+ }
107
+ /** What a resource a version depends on can be. */
108
+ export type TriggerDependencyType = 'table' | 'column' | 'script' | 'table_query' | 'project' | 'dms_file';
3
109
  //# sourceMappingURL=TriggerVersion.types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TriggerVersion.types.d.ts","sourceRoot":"","sources":["../../../src/services/Webhook/TriggerVersion.types.ts"],"names":[],"mappings":"AAAA,sGAAsG;AACtG,cAAc,iCAAiC,CAAA"}
1
+ {"version":3,"file":"TriggerVersion.types.d.ts","sourceRoot":"","sources":["../../../src/services/Webhook/TriggerVersion.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAE3D;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,uEAAuE;AACvE,MAAM,MAAM,mBAAmB,GAAG,OAAO,GAAG,UAAU,GAAG,SAAS,CAAA;AAElE;;;;;;;;;GASG;AACH,MAAM,MAAM,yBAAyB,GAC/B,UAAU,GACV,SAAS,GACT,aAAa,GACb,MAAM,GACN,4BAA4B,GAC5B,YAAY,GACZ,WAAW,GACX,cAAc,GACd,wBAAwB,GACxB,WAAW,GACX,uBAAuB,GACvB,uBAAuB,CAAA;AAE7B,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAA;IACV,UAAU,EAAE,MAAM,CAAA;IAClB,2EAA2E;IAC3E,OAAO,EAAE,MAAM,CAAA;IACf,aAAa,EAAE,MAAM,GAAG,IAAI,CAAA;IAE5B,KAAK,EAAE,mBAAmB,CAAA;IAC1B,2EAA2E;IAC3E,WAAW,EAAE,OAAO,CAAA;IAEpB;;;;;;;;;;;OAWG;IACH,YAAY,EAAE,MAAM,CAAA;IACpB,UAAU,EAAE,OAAO,CAAA;IAKnB,QAAQ,EAAE,MAAM,CAAA;IAChB;;;;OAIG;IACH,WAAW,EAAE,cAAc,GAAG,iBAAiB,GAAG,IAAI,CAAA;IACtD,OAAO,EAAE,OAAO,CAAA;IAChB,WAAW,EAAE,UAAU,GAAG,IAAI,CAAA;IAC9B,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;IACnB,SAAS,EAAE,QAAQ,GAAG,IAAI,CAAA;IAC1B,sBAAsB,EAAE,OAAO,CAAA;IAC/B,SAAS,EAAE,OAAO,CAAA;IAClB,qBAAqB,EAAE,MAAM,GAAG,IAAI,CAAA;IACpC,qBAAqB,EAAE,MAAM,GAAG,IAAI,CAAA;IACpC,0BAA0B,EAAE,OAAO,CAAA;IACnC,mGAAmG;IACnG,UAAU,EAAE,OAAO,CAAA;IACnB,oFAAoF;IACpF,cAAc,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAA;IAEpF,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;CAC1B;AAED;;;;;;GAMG;AACH,MAAM,WAAW,yBAAyB;IACxC,sEAAsE;IACtE,OAAO,EAAE,MAAM,CAAA;IACf,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAC9B;AAED,2EAA2E;AAC3E,MAAM,WAAW,wBAAwB;IACvC,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAC9B;AAED,mDAAmD;AACnD,MAAM,MAAM,qBAAqB,GAC3B,OAAO,GACP,QAAQ,GACR,QAAQ,GACR,aAAa,GACb,SAAS,GACT,UAAU,CAAA"}
@@ -1,2 +1 @@
1
- /** @deprecated Moved to `services/Trigger/TriggerVersion.types`. Remove in the next major release. */
2
- export * from '../Trigger/TriggerVersion.types';
1
+ export {};
@@ -1,3 +1,54 @@
1
- /** @deprecated Moved to `services/Trigger/TriggerVersionService`. Remove in the next major release. */
2
- export * from '../Trigger/TriggerVersionService';
1
+ import type { DataWrapper } from '../../types';
2
+ import type { TriggerableType } from './TriggerService';
3
+ import type { ReleaseTriggerVersionBody, TriggerVersion, UpdateTriggerVersionBody } from './TriggerVersion.types';
4
+ import type { MessageResponse } from "../../AntConnect";
5
+ import type { AntHttpClient } from "../../AntHttpClient";
6
+ export interface TriggerVersionService {
7
+ /** All versions of a trigger, newest release first. */
8
+ fetchVersions: (triggerableType: TriggerableType, triggerableId: string, triggerId: string) => Promise<DataWrapper<TriggerVersion[]>>;
9
+ /**
10
+ * Freeze the draft as a new released version. Refusals:
11
+ * - **409** the label exists, or the draft is identical to a release.
12
+ * - **422** a chain dependency has no released version; the message names it.
13
+ * - **422** `DatasetReleaseRefusal`: the file does not serve as declared; the message
14
+ * names the row and column. Pass `{ _silent: true }` to show it inline.
15
+ */
16
+ releaseVersion: (triggerableType: TriggerableType, triggerableId: string, triggerId: string, data: ReleaseTriggerVersionBody, requestConfig?: Record<string, any>) => Promise<DataWrapper<TriggerVersion>>;
17
+ /** Addressed by the version STRING, not by id. 404 for unknown or retired. */
18
+ fetchVersion: (triggerableType: TriggerableType, triggerableId: string, triggerId: string, version: string) => Promise<DataWrapper<TriggerVersion>>;
19
+ /** Renames / re-notes a version. Cannot change what it froze. */
20
+ updateVersion: (triggerableType: TriggerableType, triggerableId: string, triggerId: string, version: string, data: UpdateTriggerVersionBody) => Promise<DataWrapper<TriggerVersion>>;
21
+ /**
22
+ * Point the bare dispatch URL at this version.
23
+ *
24
+ * Only a callable version may become the default, and the default cannot be
25
+ * deleted while it holds that role — reassign first.
26
+ */
27
+ setDefaultVersion: (triggerableType: TriggerableType, triggerableId: string, triggerId: string, version: string) => Promise<DataWrapper<TriggerVersion>>;
28
+ /**
29
+ * Stop a version being callable. Reversible only by releasing a new version.
30
+ *
31
+ * Retiring is also how a publisher frees a source: only CALLABLE versions block
32
+ * a table / script / DMS file from being deleted.
33
+ */
34
+ retireVersion: (triggerableType: TriggerableType, triggerableId: string, triggerId: string, version: string) => Promise<DataWrapper<TriggerVersion>>;
35
+ /**
36
+ * Delete a version outright.
37
+ *
38
+ * **409** when it is still callable, when it is the trigger's default, when a
39
+ * store listing claims it, or when another version pins it into a frozen chain.
40
+ * The message names what blocks it.
41
+ */
42
+ deleteVersion: (triggerableType: TriggerableType, triggerableId: string, triggerId: string, version: string) => Promise<MessageResponse>;
43
+ /**
44
+ * Dispatch one specific version, regardless of which is default.
45
+ *
46
+ * Same envelope and same auth as the bare dispatch. A trigger reached through a
47
+ * custom path always runs the DEFAULT version — a custom path has no
48
+ * version-qualified form, because the path pattern would swallow the version
49
+ * segment.
50
+ */
51
+ dispatchVersion: (triggerableType: TriggerableType, triggerableId: string, triggerId: string, version: string, body?: Record<string, unknown>) => Promise<unknown>;
52
+ }
53
+ export declare function createTriggerVersionService(httpClient: AntHttpClient): TriggerVersionService;
3
54
  //# sourceMappingURL=TriggerVersionService.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TriggerVersionService.d.ts","sourceRoot":"","sources":["../../../src/services/Webhook/TriggerVersionService.ts"],"names":[],"mappings":"AAAA,uGAAuG;AACvG,cAAc,kCAAkC,CAAA"}
1
+ {"version":3,"file":"TriggerVersionService.d.ts","sourceRoot":"","sources":["../../../src/services/Webhook/TriggerVersionService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAC9C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AACvD,OAAO,KAAK,EACV,yBAAyB,EACzB,cAAc,EACd,wBAAwB,EACzB,MAAM,wBAAwB,CAAA;AAC/B,OAAO,KAAK,EAAE,eAAe,EAAE,yBAAoB;AACnD,OAAO,KAAK,EAAE,aAAa,EAAE,4BAAuB;AAEpD,MAAM,WAAW,qBAAqB;IACpC,uDAAuD;IACvD,aAAa,EAAE,CACb,eAAe,EAAE,eAAe,EAChC,aAAa,EAAE,MAAM,EACrB,SAAS,EAAE,MAAM,KACd,OAAO,CAAC,WAAW,CAAC,cAAc,EAAE,CAAC,CAAC,CAAA;IAE3C;;;;;;OAMG;IACH,cAAc,EAAE,CACd,eAAe,EAAE,eAAe,EAChC,aAAa,EAAE,MAAM,EACrB,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,yBAAyB,EAC/B,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAChC,OAAO,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC,CAAA;IAEzC,8EAA8E;IAC9E,YAAY,EAAE,CACZ,eAAe,EAAE,eAAe,EAChC,aAAa,EAAE,MAAM,EACrB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,KACZ,OAAO,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC,CAAA;IAEzC,iEAAiE;IACjE,aAAa,EAAE,CACb,eAAe,EAAE,eAAe,EAChC,aAAa,EAAE,MAAM,EACrB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,wBAAwB,KAC3B,OAAO,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC,CAAA;IAEzC;;;;;OAKG;IACH,iBAAiB,EAAE,CACjB,eAAe,EAAE,eAAe,EAChC,aAAa,EAAE,MAAM,EACrB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,KACZ,OAAO,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC,CAAA;IAEzC;;;;;OAKG;IACH,aAAa,EAAE,CACb,eAAe,EAAE,eAAe,EAChC,aAAa,EAAE,MAAM,EACrB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,KACZ,OAAO,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC,CAAA;IAEzC;;;;;;OAMG;IACH,aAAa,EAAE,CACb,eAAe,EAAE,eAAe,EAChC,aAAa,EAAE,MAAM,EACrB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,KACZ,OAAO,CAAC,eAAe,CAAC,CAAA;IAE7B;;;;;;;OAOG;IACH,eAAe,EAAE,CACf,eAAe,EAAE,eAAe,EAChC,aAAa,EAAE,MAAM,EACrB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC3B,OAAO,CAAC,OAAO,CAAC,CAAA;CACtB;AAED,wBAAgB,2BAA2B,CAAC,UAAU,EAAE,aAAa,GAAG,qBAAqB,CAqC5F"}
@@ -1,2 +1,20 @@
1
- /** @deprecated Moved to `services/Trigger/TriggerVersionService`. Remove in the next major release. */
2
- export * from '../Trigger/TriggerVersionService';
1
+ export function createTriggerVersionService(httpClient) {
2
+ const base = (triggerableType, triggerableId, triggerId) => `/webhook/${triggerableType}/${triggerableId}/triggers/${triggerId}/versions`;
3
+ /**
4
+ * A version label is free-form — the UI says "any label you like" — so it is a
5
+ * value, not a path fragment. Unencoded, a label containing `/`, `#` or a space
6
+ * addressed a different route or a truncated one; `1.0.0` encodes to itself, so
7
+ * nothing changes for the labels anyone actually uses.
8
+ */
9
+ const label = (version) => encodeURIComponent(version);
10
+ return {
11
+ fetchVersions: (triggerableType, triggerableId, triggerId) => httpClient.get(base(triggerableType, triggerableId, triggerId)),
12
+ releaseVersion: (triggerableType, triggerableId, triggerId, data, requestConfig) => httpClient.post(base(triggerableType, triggerableId, triggerId), data, requestConfig),
13
+ fetchVersion: (triggerableType, triggerableId, triggerId, version) => httpClient.get(`${base(triggerableType, triggerableId, triggerId)}/${label(version)}`),
14
+ updateVersion: (triggerableType, triggerableId, triggerId, version, data) => httpClient.put(`${base(triggerableType, triggerableId, triggerId)}/${label(version)}`, data),
15
+ setDefaultVersion: (triggerableType, triggerableId, triggerId, version) => httpClient.post(`${base(triggerableType, triggerableId, triggerId)}/${label(version)}/default`),
16
+ retireVersion: (triggerableType, triggerableId, triggerId, version) => httpClient.post(`${base(triggerableType, triggerableId, triggerId)}/${label(version)}/retire`),
17
+ deleteVersion: (triggerableType, triggerableId, triggerId, version) => httpClient.delete(`${base(triggerableType, triggerableId, triggerId)}/${label(version)}`),
18
+ dispatchVersion: (triggerableType, triggerableId, triggerId, version, body) => httpClient.post(`${base(triggerableType, triggerableId, triggerId)}/${label(version)}/dispatch`, body ?? {}),
19
+ };
20
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antcde/connect-ts",
3
- "version": "0.4.35-rc.1",
3
+ "version": "0.4.35",
4
4
  "description": "Helper to connect to the ANT api",
5
5
  "type": "module",
6
6
  "main": "build/index.js",
@@ -1,51 +0,0 @@
1
- import type { DataWrapper } from '../../types';
2
- import type { Event } from './EventService';
3
- import type { TriggerableType } from './TriggerService';
4
- import type { AntHttpClient } from "../../AntHttpClient";
5
- export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
6
- export type AuthType = 'none' | 'ant' | 'secret_token';
7
- export interface ActionOperation {
8
- title: string;
9
- value: string;
10
- triggerables: string[];
11
- }
12
- export interface ConfigResponse {
13
- actions: ActionOperation[];
14
- http_methods: HTTPMethod[];
15
- auth_types: AuthType[];
16
- events: Event[];
17
- /**
18
- * The column types a dataset action may return. Anything else is refused at
19
- * dispatch.
20
- *
21
- * The authoritative list, published so a column mapper can grey an unpublishable
22
- * column out WITH a reason rather than keeping its own copy and drifting. Grey
23
- * it out rather than filtering it away — a column that silently vanishes reads
24
- * as a bug.
25
- *
26
- * ⚠️ The four excluded types are `document`, `uuid`, `description` and `table`.
27
- * **There is no `file` column type** — a control for one never fires; the type
28
- * usually meant is `document`.
29
- *
30
- * A FILE-sourced mapper needs none of this: proposed types are already a subset
31
- * of this list, so a proposal can never suggest something the action refuses.
32
- */
33
- publishable_column_types: string[];
34
- }
35
- export interface ConfigParams {
36
- /**
37
- * Narrow `events` to those APPLICABLE to this scope, using each event's
38
- * `project_only` / `license_only`.
39
- *
40
- * ⚠️ **Applicability only — it does NOT filter by deployment availability.**
41
- * An event can be project-applicable and unavailable at the same time, and it is
42
- * still returned; check {@link Event.available} per row. Omitting the parameter
43
- * returns everything, which is the pre-existing behaviour.
44
- */
45
- triggerable_type?: TriggerableType;
46
- }
47
- export interface ConfigService {
48
- fetchConfig: (params?: ConfigParams) => Promise<DataWrapper<ConfigResponse>>;
49
- }
50
- export declare function createConfigService(httpClient: AntHttpClient): ConfigService;
51
- //# sourceMappingURL=ConfigService.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ConfigService.d.ts","sourceRoot":"","sources":["../../../src/services/Trigger/ConfigService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAC9C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AACvD,OAAO,KAAK,EAAE,aAAa,EAAE,4BAAuB;AAEpD,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,CAAA;AAEpE,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,KAAK,GAAG,cAAc,CAAA;AAEtD,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,YAAY,EAAE,MAAM,EAAE,CAAA;CACvB;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,eAAe,EAAE,CAAA;IAC1B,YAAY,EAAE,UAAU,EAAE,CAAA;IAC1B,UAAU,EAAE,QAAQ,EAAE,CAAA;IACtB,MAAM,EAAE,KAAK,EAAE,CAAA;IACf;;;;;;;;;;;;;;;OAeG;IACH,wBAAwB,EAAE,MAAM,EAAE,CAAA;CACnC;AAED,MAAM,WAAW,YAAY;IAC3B;;;;;;;;OAQG;IACH,gBAAgB,CAAC,EAAE,eAAe,CAAA;CACnC;AAED,MAAM,WAAW,aAAa;IAC5B,WAAW,EAAE,CAAC,MAAM,CAAC,EAAE,YAAY,KAAK,OAAO,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC,CAAA;CAC7E;AAED,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,aAAa,GAAG,aAAa,CAK5E"}
@@ -1,5 +0,0 @@
1
- export function createConfigService(httpClient) {
2
- return {
3
- fetchConfig: (params) => httpClient.get('/webhook/config', { params }),
4
- };
5
- }
@@ -1,146 +0,0 @@
1
- import type { DataWrapper } from '../../types';
2
- import type { AntHttpClient } from "../../AntHttpClient";
3
- export interface Event {
4
- id: string;
5
- code: string;
6
- name: string;
7
- description: string | null;
8
- /**
9
- * ⚠️ **DEAD. Never set by the backend and read by nothing.**
10
- *
11
- * `webhook:generate-events` does not write it and no code checks it — the only
12
- * `is_active` checks in the Triggers module are on a Trigger, a different model.
13
- * It defaults to `true`, so it looks live and invites exactly one confident wrong
14
- * use: filtering the picker on it. That filter would appear to work and would
15
- * never exclude anything.
16
- *
17
- * For "can this deployment serve the event", use {@link available}.
18
- */
19
- is_active: boolean;
20
- /**
21
- * ⚠️ **INVERTED LEGACY. Prefer {@link contexts}.**
22
- *
23
- * These state availability by EXCLUSION, and **both false means available in
24
- * BOTH places** — so `project_only === false` does NOT mean "unavailable in
25
- * projects", it means "not restricted to projects". Reading either as inclusion
26
- * inverts the answer, and nothing errors.
27
- *
28
- * Kept only because removing them is a separate breaking decision. New code
29
- * should read `contexts`.
30
- */
31
- project_only: boolean;
32
- license_only: boolean;
33
- /**
34
- * Where the event can be used, as a POSITIVE list — `['license', 'project']`,
35
- * `['project']`, or `['license']`.
36
- *
37
- * This is the field to read. It exists because {@link project_only} and
38
- * {@link license_only} say the same thing by exclusion and are read backwards
39
- * more often than not.
40
- *
41
- * Order is fixed (`license` before `project`), so it can be compared or rendered
42
- * without sorting. An empty array would mean the two legacy flags contradict each
43
- * other; no event does that today.
44
- */
45
- contexts: TriggerContext[];
46
- preferred_method: 'GET' | 'POST' | 'PUT' | 'DELETE' | null;
47
- /**
48
- * Whether this action reads or writes, declared by the event class and appended
49
- * by the API rather than stored (AAD-897). Needed to tell someone that
50
- * `read_only` will reject the action they picked — otherwise that only surfaces
51
- * at dispatch. Absent on older API versions; treat undefined as unknown, not read.
52
- */
53
- access_mode?: 'read' | 'write';
54
- created_at: string;
55
- updated_at: string;
56
- /**
57
- * A FULL iconify name, collection included — e.g. `mdi:table`.
58
- *
59
- * ⚠️ **Do not prepend a collection.** The whole name is here precisely so the
60
- * client never reconstructs one: an event using a set other than `mdi` could not
61
- * otherwise express it, and a hardcoded prefix is a derivation that drifts. Pass
62
- * the value straight to iconify.
63
- *
64
- * ⚠️ Nullable because the COLUMN is: it is synced from the event class by
65
- * `webhook:generate-events`, so a row written before that sync has none. Render a
66
- * fallback rather than an empty cell.
67
- */
68
- icon: string | null;
69
- /**
70
- * Which half of the create flow the event belongs to — "answer a caller with
71
- * data" or "make something happen".
72
- *
73
- * ⚠️ **NOT derivable from {@link mutates}, and never infer one from the other.**
74
- * `TransformWithScriptEvent` is `mutates: true` AND
75
- * `category: 'returns_data'`: it executes user code under a full-privilege
76
- * token, so it is a write, while the thing the publisher is building answers a
77
- * caller. Deriving either axis from the other files it in the wrong column.
78
- *
79
- * Nullable for the same reason as `icon`.
80
- */
81
- category: 'returns_data' | 'performs_action' | null;
82
- /**
83
- * True when choosing this event means the trigger WRITES something, so a
84
- * `read_only` trigger refuses it.
85
- *
86
- * ⚠️ **This is not "does it return data".** Resolved from the event class by the
87
- * same resolver dispatch enforces with — do not rebuild it from a list of event
88
- * codes, which is what drifted before: the UI offered `read_only` for an event
89
- * the dispatcher then refused by name.
90
- */
91
- mutates: boolean;
92
- /** Whether a trigger on this event can bind Vault secrets. Use it, not a list of event codes. */
93
- injects_secrets: boolean;
94
- /**
95
- * Whether THIS DEPLOYMENT can serve the event.
96
- *
97
- * ⚠️ **INSTALLATION, not scope.** No permission, licence or project setting
98
- * changes it — most often the deployment has no script engine configured, so the
99
- * script actions cannot run here at all. Do not fold it into the
100
- * `triggerable_type` filter, which answers the separate question of whether an
101
- * event APPLIES to a licence or a project.
102
- *
103
- * Unavailable events are returned rather than hidden, so grey the option out
104
- * with {@link unavailable_reason} instead of filtering it away — an option that
105
- * silently vanishes reads as a bug and explains nothing.
106
- */
107
- available: boolean;
108
- /** The sentence explaining `available: false`; null when it is true. */
109
- unavailable_reason: string | null;
110
- /**
111
- * Which kinds of source this event configures. **Empty means it has none** —
112
- * show no source step at all.
113
- *
114
- * This is the field a create wizard was missing: without it, every event looked
115
- * like it needed a table, so the flow asked for one whatever action was chosen.
116
- *
117
- * ⚠️ **Kinds only. It says nothing about required-vs-optional, nor which of
118
- * several applies.** `TransformWithScriptEvent` reports
119
- * `['script', 'table', 'dms_file']` because it MUST have a script and MAY have a
120
- * table or a file — do not read the list as "all three are needed". Required-ness
121
- * and every other parameter stay in the per-event configuration UI, deliberately:
122
- * describing them in data would duplicate what the event's own dispatch enforces
123
- * and rot the first time an event grew a field.
124
- *
125
- * ⚠️ **An empty list is NOT proof the event has no source.** An unknown or
126
- * uninstalled event code resolves to empty as well — the backend resolver fails
127
- * closed — so "configures nothing" and "we could not tell" are byte-identical
128
- * here. Read it with {@link available}: empty AND available means genuinely no
129
- * source; empty AND unavailable means the answer is unknown, and showing "no
130
- * configuration needed" would be a guess.
131
- */
132
- configures_sources: EventSourceKind[];
133
- }
134
- /**
135
- * A kind of platform resource an event reads. Resource kinds, not payload keys — a
136
- * key is one event's implementation detail; the kind is what a wizard asks about.
137
- */
138
- export type EventSourceKind = 'table' | 'dms_file' | 'script' | 'stored_query' | 'store_resource';
139
- /** Where a trigger lives, and therefore where an event can be used. */
140
- export type TriggerContext = 'license' | 'project';
141
- export interface EventService {
142
- fetchEvents: () => Promise<DataWrapper<Event[]>>;
143
- fetchEvent: (eventId: string) => Promise<DataWrapper<Event>>;
144
- }
145
- export declare function createEventService(httpClient: AntHttpClient): EventService;
146
- //# sourceMappingURL=EventService.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"EventService.d.ts","sourceRoot":"","sources":["../../../src/services/Trigger/EventService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAC9C,OAAO,KAAK,EAAE,aAAa,EAAE,4BAAuB;AAEpD,MAAM,WAAW,KAAK;IACpB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B;;;;;;;;;;OAUG;IACH,SAAS,EAAE,OAAO,CAAA;IAElB;;;;;;;;;;OAUG;IACH,YAAY,EAAE,OAAO,CAAA;IACrB,YAAY,EAAE,OAAO,CAAA;IAErB;;;;;;;;;;;OAWG;IACH,QAAQ,EAAE,cAAc,EAAE,CAAA;IAC1B,gBAAgB,EAAE,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,IAAI,CAAA;IAC1D;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;IAC9B,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;IAElB;;;;;;;;;;;OAWG;IACH,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;IAEnB;;;;;;;;;;;OAWG;IACH,QAAQ,EAAE,cAAc,GAAG,iBAAiB,GAAG,IAAI,CAAA;IAEnD;;;;;;;;OAQG;IACH,OAAO,EAAE,OAAO,CAAA;IAEhB,iGAAiG;IACjG,eAAe,EAAE,OAAO,CAAA;IAExB;;;;;;;;;;;;OAYG;IACH,SAAS,EAAE,OAAO,CAAA;IAElB,wEAAwE;IACxE,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAA;IAEjC;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,kBAAkB,EAAE,eAAe,EAAE,CAAA;CACtC;AAED;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,UAAU,GAAG,QAAQ,GAAG,cAAc,GAAG,gBAAgB,CAAA;AAEjG,uEAAuE;AACvE,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,SAAS,CAAA;AAElD,MAAM,WAAW,YAAY;IAC3B,WAAW,EAAE,MAAM,OAAO,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC,CAAC,CAAA;IAChD,UAAU,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAA;CAC7D;AAED,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,aAAa,GAAG,YAAY,CAQ1E"}
@@ -1,6 +0,0 @@
1
- export function createEventService(httpClient) {
2
- return {
3
- fetchEvents: () => httpClient.get('/webhook/events'),
4
- fetchEvent: (eventId) => httpClient.get(`/webhook/events/${eventId}`),
5
- };
6
- }
@@ -1,18 +0,0 @@
1
- /** Who started a run (AAD-1123). Never carries an IP, user agent or token id. */
2
- export type TriggerCallerKind = 'user' | 'personal_token' | 'external_user' | 'shared_secret' | 'anonymous' | 'task' | 'resource_event' | 'system';
3
- export interface TriggerExecutionCaller {
4
- kind: TriggerCallerKind;
5
- /** `null` also when the person was deleted since — render "Deleted user" for kinds that normally carry one. */
6
- user: {
7
- id: string;
8
- name: string;
9
- } | null;
10
- /** The OAuth app the call came through, e.g. "ANT OS" or "antconnect". */
11
- client: {
12
- id: number;
13
- name: string;
14
- } | null;
15
- /** The personal access token's label at call time. */
16
- token_name: string | null;
17
- }
18
- //# sourceMappingURL=TriggerCaller.types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TriggerCaller.types.d.ts","sourceRoot":"","sources":["../../../src/services/Trigger/TriggerCaller.types.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,MAAM,MAAM,iBAAiB,GACvB,MAAM,GACN,gBAAgB,GAChB,eAAe,GACf,eAAe,GACf,WAAW,GACX,MAAM,GACN,gBAAgB,GAChB,QAAQ,CAAA;AAEd,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,iBAAiB,CAAA;IACvB,+GAA+G;IAC/G,IAAI,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAA;IACzC,0EAA0E;IAC1E,MAAM,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAA;IAC3C,sDAAsD;IACtD,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;CAC1B"}
@@ -1 +0,0 @@
1
- export {};
@@ -1,168 +0,0 @@
1
- import type { DatasetCsvOptions } from './TriggerDatasetCsv.types';
2
- export type { DatasetCsvOptions };
3
- /**
4
- * The three trigger actions that RETURN data (AAD-967).
5
- *
6
- * These are not new endpoints. They are `payload` shapes for an ordinary trigger,
7
- * dispatched through the ordinary dispatch URL. What is new is the split below.
8
- *
9
- * Response and refusal shapes live in `TriggerDatasetResponses.types.ts`.
10
- *
11
- * ## Frozen publisher config vs caller parameters — the load-bearing distinction
12
- *
13
- * Everything in a `*Payload` type is **frozen publisher configuration**, stored on
14
- * the trigger and read from there at dispatch. The dispatcher merges a caller's
15
- * request body ABOVE the stored config, so an action reading its source from the
16
- * request body would let a caller repoint it — these actions deliberately do not.
17
- *
18
- * A caller can therefore change **nothing structural**: not the table, not the
19
- * file, not the script, not the column selection. The only dataset field a caller
20
- * controls is `limit`, and only downward — see {@link DatasetCallerParams}.
21
- *
22
- * A UI that blurs this will mislead a publisher about what they are selling. Show
23
- * the payload fields as "fixed for every caller" and `limit` as "the caller may
24
- * ask for fewer".
25
- */
26
- /** `Event.code` values for the three dataset actions. */
27
- export type DatasetActionCode = 'ReturnTableDataEvent' | 'ReturnFileDataEvent' | 'TransformWithScriptEvent';
28
- /** Column types a dataset may publish. Anything else is refused at dispatch. */
29
- export type DatasetColumnType = 'boolean' | 'integer' | 'float' | 'textfield' | 'link' | 'email' | 'text' | 'dropdown' | 'sbscode' | 'date';
30
- /**
31
- * One selected column of a linked TABLE.
32
- *
33
- * Selected by `column_id` rather than by name, so renaming a column in the table
34
- * does not silently change what a released version returns.
35
- */
36
- export interface DatasetTableColumn {
37
- column_id: string;
38
- /** Buyer-facing key. Defaults to the column's own name. */
39
- key?: string | null;
40
- }
41
- /**
42
- * One declared column of an uploaded FILE.
43
- *
44
- * A file declares no types of its own, so the publisher supplies them — which is
45
- * what keeps the emitted schema declared rather than guessed. `source_key` is the
46
- * header as it appears in this file; `key` is the buyer's contract. Only one of
47
- * those is allowed to be a breaking change.
48
- */
49
- export interface DatasetFileColumn {
50
- source_key: string;
51
- /** Always send it: omitted, the RAW header is returned. `^[\w-]+$`, not `id`, unique. */
52
- key?: string | null;
53
- type: DatasetColumnType;
54
- label?: string | null;
55
- }
56
- /** Either kind of declared column, for a source that could be either. */
57
- export type DatasetColumn = DatasetTableColumn | DatasetFileColumn;
58
- /** `ReturnTableDataEvent` — rows from a linked dynamic table. */
59
- export interface ReturnTableDataPayload {
60
- table_id: string;
61
- /** Required and non-empty. An empty list is REFUSED, never read as "all". */
62
- columns: DatasetTableColumn[];
63
- /** The publisher's row cap for one dispatch. Omit to use the platform default. */
64
- limit?: number;
65
- }
66
- /** How `ReturnFileDataEvent` answers. */
67
- export type DatasetFileMode = 'records' | 'raw';
68
- /** Formats a file source can be parsed as. `.jsonl` is read as `ndjson`. */
69
- export type DatasetFileFormat = 'csv' | 'json' | 'ndjson';
70
- /**
71
- * `ReturnFileDataEvent` — an uploaded DMS file, as rows or as a download link.
72
- *
73
- * **There is no upload endpoint for this.** The publisher uploads through the
74
- * existing DMS endpoints and this points at the resulting file, which is also why
75
- * deleting that file is blocked while a released version reads it.
76
- */
77
- export interface ReturnFileDataPayload {
78
- dms_file_id: string;
79
- /** Defaults to `records`. An unrecognised value is refused, not defaulted. */
80
- mode?: DatasetFileMode;
81
- /** Defaults to the file's own extension. */
82
- format?: DatasetFileFormat;
83
- /**
84
- * Required for `records`. **Ignored entirely by `raw`**, which hands over the
85
- * whole file — so the column guarantee does not apply in raw mode.
86
- *
87
- * Optional here rather than required-under-`records`, because the two modes are
88
- * not modelled as a discriminated union — so the compiler will NOT stop you
89
- * submitting a `records` payload with no columns. Validate it in the form; the
90
- * backend answers `invalid_payload_config`.
91
- */
92
- columns?: DatasetFileColumn[];
93
- /** CSV only. Omit for detection — see {@link DatasetCsvOptions}. */
94
- csv?: DatasetCsvOptions;
95
- limit?: number;
96
- }
97
- /** Whether the script's own value is returned, or the full run envelope. */
98
- export type TransformResponseMode = 'result' | 'envelope';
99
- /**
100
- * `TransformWithScriptEvent` — a script shapes the response.
101
- *
102
- * ⚠️ **This action is a WRITE**, despite reading data and returning it, because it
103
- * runs user-authored code under a freshly minted OAuth token. It therefore cannot
104
- * be used on a `read_only` trigger. Check `Trigger.access_mode` and say so up
105
- * front rather than letting the dispatch fail.
106
- *
107
- * Always synchronous — there is no async option, because an async run returns a
108
- * task id and a permanently null result.
109
- */
110
- export interface TransformWithScriptPayload {
111
- script_id: string;
112
- /** Defaults to `result`. Frozen here rather than derived from `debug_mode`. */
113
- response_mode?: TransformResponseMode;
114
- /**
115
- * An optional declared source, using the same shape as the actions above. Omit
116
- * both to hand the script only the caller's parameters.
117
- *
118
- * Nothing here expresses that `table_id` and `dms_file_id` are mutually
119
- * exclusive — setting both is invalid and the backend refuses it. Enforce it in
120
- * the form.
121
- */
122
- table_id?: string;
123
- dms_file_id?: string;
124
- /**
125
- * An ARRAY OF EITHER column kind, matching whichever source is set — not a
126
- * union of two arrays, so it can be pushed into and bound to a row editor.
127
- */
128
- columns?: DatasetColumn[];
129
- /** For a CSV `dms_file_id` source. */
130
- csv?: DatasetCsvOptions;
131
- limit?: number;
132
- /** Clamped by the engine to its configured maximum. */
133
- timeout_s?: number;
134
- python_version?: string;
135
- }
136
- export type DatasetActionPayload = ReturnTableDataPayload | ReturnFileDataPayload | TransformWithScriptPayload;
137
- /** The payload type belonging to a given dataset action code. */
138
- export type DatasetPayloadFor<C extends DatasetActionCode> = C extends 'ReturnTableDataEvent' ? ReturnTableDataPayload : C extends 'ReturnFileDataEvent' ? ReturnFileDataPayload : C extends 'TransformWithScriptEvent' ? TransformWithScriptPayload : never;
139
- /**
140
- * What a CALLER may send. Nothing here can widen what the publisher declared.
141
- *
142
- * `limit` is clamped to the publisher's declared limit and then to the platform
143
- * ceiling, so asking for more returns the publisher's number rather than an error.
144
- * A `TransformWithScriptEvent` additionally forwards the whole request body to the
145
- * script as `INPUT.params`, minus `limit`.
146
- */
147
- export interface DatasetCallerParams {
148
- limit?: number;
149
- /** Page start (records only): follow `DatasetRows.next_offset`, up to the row ceiling. */
150
- offset?: number;
151
- [param: string]: unknown;
152
- }
153
- /** Narrow an event code to one of the three dataset actions. */
154
- export declare function isDatasetAction(code: string | null | undefined): code is DatasetActionCode;
155
- /**
156
- * Whether a dataset action can run on a trigger with `read_only` set.
157
- *
158
- * Only the script transform cannot: it executes user code with real credentials,
159
- * so it is classified as a write however read-shaped it looks.
160
- */
161
- export declare function isReadOnlyCompatible(code: DatasetActionCode): boolean;
162
- /** Narrow an unknown payload to `TransformWithScriptEvent`'s config. */
163
- export declare function isTransformWithScriptPayload(payload: unknown): payload is TransformWithScriptPayload;
164
- /** Narrow an unknown payload to `ReturnTableDataEvent`'s config. */
165
- export declare function isReturnTableDataPayload(payload: unknown): payload is ReturnTableDataPayload;
166
- /** Narrow an unknown payload to `ReturnFileDataEvent`'s config. */
167
- export declare function isReturnFileDataPayload(payload: unknown): payload is ReturnFileDataPayload;
168
- //# sourceMappingURL=TriggerDataset.types.d.ts.map