@antcde/connect-ts 0.4.27 → 0.4.28-rc.2

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 (136) hide show
  1. package/build/AntConnect.d.ts +4 -0
  2. package/build/AntConnect.d.ts.map +1 -1
  3. package/build/AntConnect.js +4 -0
  4. package/build/comms/signal.d.ts +1 -0
  5. package/build/comms/signal.d.ts.map +1 -1
  6. package/build/comms/signal.js +1 -0
  7. package/build/comms/signalFilePreviewTypes.d.ts +65 -0
  8. package/build/comms/signalFilePreviewTypes.d.ts.map +1 -0
  9. package/build/comms/signalFilePreviewTypes.js +9 -0
  10. package/build/comms/signalRouteTypes.d.ts +38 -0
  11. package/build/comms/signalRouteTypes.d.ts.map +1 -0
  12. package/build/comms/signalRouteTypes.js +8 -0
  13. package/build/comms/signalTypes.d.ts +11 -46
  14. package/build/comms/signalTypes.d.ts.map +1 -1
  15. package/build/index.d.ts +26 -2
  16. package/build/index.d.ts.map +1 -1
  17. package/build/index.js +5 -0
  18. package/build/service-runtime.d.ts +1 -1
  19. package/build/service-runtime.d.ts.map +1 -1
  20. package/build/service-runtime.js +1 -1
  21. package/build/service-types-app.d.ts +1 -1
  22. package/build/service-types-app.d.ts.map +1 -1
  23. package/build/service-types.d.ts +3 -1
  24. package/build/service-types.d.ts.map +1 -1
  25. package/build/services/AppService/factory/assignments.d.ts +13 -0
  26. package/build/services/AppService/factory/assignments.d.ts.map +1 -1
  27. package/build/services/AppService/factory/assignments.js +5 -0
  28. package/build/services/AppService/factory/resourceAccess.d.ts +1 -1
  29. package/build/services/AppService/factory/resourceAccess.d.ts.map +1 -1
  30. package/build/services/AppService/factory/resourceAccess.js +16 -0
  31. package/build/services/AppService/factory/resourceAssignments.d.ts +26 -2
  32. package/build/services/AppService/factory/resourceAssignments.d.ts.map +1 -1
  33. package/build/services/AppService/factory/resourceAssignments.js +2 -0
  34. package/build/services/AppService/factory/resourceEntitlementActions.d.ts +42 -0
  35. package/build/services/AppService/factory/resourceEntitlementActions.d.ts.map +1 -0
  36. package/build/services/AppService/factory/resourceEntitlementActions.js +10 -0
  37. package/build/services/AppService/factory/resources.d.ts +15 -28
  38. package/build/services/AppService/factory/resources.d.ts.map +1 -1
  39. package/build/services/AppService/factory/resources.js +2 -5
  40. package/build/services/AppService/factory/subscriptions.d.ts +1 -1
  41. package/build/services/AppService/factory/subscriptions.d.ts.map +1 -1
  42. package/build/services/AppService/factory/subscriptions.js +1 -1
  43. package/build/services/AppService/types/accessBlocks.d.ts +64 -0
  44. package/build/services/AppService/types/accessBlocks.d.ts.map +1 -0
  45. package/build/services/AppService/types/accessBlocks.js +5 -0
  46. package/build/services/AppService/types/app.d.ts +46 -1
  47. package/build/services/AppService/types/app.d.ts.map +1 -1
  48. package/build/services/AppService/types/appList.d.ts +17 -1
  49. package/build/services/AppService/types/appList.d.ts.map +1 -1
  50. package/build/services/AppService/types/appScopes.d.ts +56 -0
  51. package/build/services/AppService/types/appScopes.d.ts.map +1 -1
  52. package/build/services/AppService/types/resourceAssignments.d.ts +20 -0
  53. package/build/services/AppService/types/resourceAssignments.d.ts.map +1 -1
  54. package/build/services/AppService/types/resourceEntitlements.d.ts +33 -1
  55. package/build/services/AppService/types/resourceEntitlements.d.ts.map +1 -1
  56. package/build/services/AppService/types/resourceReleases.d.ts +14 -0
  57. package/build/services/AppService/types/resourceReleases.d.ts.map +1 -1
  58. package/build/services/AppService/types/resourceRequests.d.ts +29 -1
  59. package/build/services/AppService/types/resourceRequests.d.ts.map +1 -1
  60. package/build/services/AppService/types/seats.d.ts +48 -63
  61. package/build/services/AppService/types/seats.d.ts.map +1 -1
  62. package/build/services/AppService/types/seats.js +0 -2
  63. package/build/services/AppService/types/sellableResources.d.ts +10 -1
  64. package/build/services/AppService/types/sellableResources.d.ts.map +1 -1
  65. package/build/services/AppService/types/subscriptions.d.ts +6 -1
  66. package/build/services/AppService/types/subscriptions.d.ts.map +1 -1
  67. package/build/services/AppService/types.d.ts +1 -0
  68. package/build/services/AppService/types.d.ts.map +1 -1
  69. package/build/services/AppService/types.js +1 -0
  70. package/build/services/LicenseService.d.ts +1 -1
  71. package/build/services/LicenseService.d.ts.map +1 -1
  72. package/build/services/LicenseService.js +3 -1
  73. package/build/services/ProjectService.d.ts +0 -1
  74. package/build/services/ProjectService.d.ts.map +1 -1
  75. package/build/services/TaskService.d.ts +6 -1
  76. package/build/services/TaskService.d.ts.map +1 -1
  77. package/build/services/TaskService.js +1 -1
  78. package/build/services/TaskServiceQueries.d.ts +9 -1
  79. package/build/services/TaskServiceQueries.d.ts.map +1 -1
  80. package/build/services/TaskServiceQueries.js +12 -1
  81. package/build/services/Webhook/ConfigService.d.ts +31 -1
  82. package/build/services/Webhook/ConfigService.d.ts.map +1 -1
  83. package/build/services/Webhook/ConfigService.js +1 -1
  84. package/build/services/Webhook/EventService.d.ts +117 -0
  85. package/build/services/Webhook/EventService.d.ts.map +1 -1
  86. package/build/services/Webhook/TriggerChaining.d.ts +45 -0
  87. package/build/services/Webhook/TriggerChaining.d.ts.map +1 -0
  88. package/build/services/Webhook/TriggerChaining.js +1 -0
  89. package/build/services/Webhook/TriggerDataset.types.d.ts +160 -0
  90. package/build/services/Webhook/TriggerDataset.types.d.ts.map +1 -0
  91. package/build/services/Webhook/TriggerDataset.types.js +74 -0
  92. package/build/services/Webhook/TriggerDatasetColumns.d.ts +72 -0
  93. package/build/services/Webhook/TriggerDatasetColumns.d.ts.map +1 -0
  94. package/build/services/Webhook/TriggerDatasetColumns.js +116 -0
  95. package/build/services/Webhook/TriggerDatasetResponses.types.d.ts +158 -0
  96. package/build/services/Webhook/TriggerDatasetResponses.types.d.ts.map +1 -0
  97. package/build/services/Webhook/TriggerDatasetResponses.types.js +98 -0
  98. package/build/services/Webhook/TriggerDatasetSourceService.d.ts +180 -0
  99. package/build/services/Webhook/TriggerDatasetSourceService.d.ts.map +1 -0
  100. package/build/services/Webhook/TriggerDatasetSourceService.js +23 -0
  101. package/build/services/Webhook/TriggerDispatch.types.d.ts +89 -0
  102. package/build/services/Webhook/TriggerDispatch.types.d.ts.map +1 -0
  103. package/build/services/Webhook/TriggerDispatch.types.js +24 -0
  104. package/build/services/Webhook/TriggerDivergence.d.ts +30 -0
  105. package/build/services/Webhook/TriggerDivergence.d.ts.map +1 -0
  106. package/build/services/Webhook/TriggerDivergence.js +25 -0
  107. package/build/services/Webhook/TriggerFailedRuns.types.d.ts +57 -0
  108. package/build/services/Webhook/TriggerFailedRuns.types.d.ts.map +1 -0
  109. package/build/services/Webhook/TriggerFailedRuns.types.js +1 -0
  110. package/build/services/Webhook/TriggerHistoryService.d.ts +88 -18
  111. package/build/services/Webhook/TriggerHistoryService.d.ts.map +1 -1
  112. package/build/services/Webhook/TriggerLastRun.types.d.ts +80 -0
  113. package/build/services/Webhook/TriggerLastRun.types.d.ts.map +1 -0
  114. package/build/services/Webhook/TriggerLastRun.types.js +1 -0
  115. package/build/services/Webhook/TriggerRefusalDetail.types.d.ts +63 -0
  116. package/build/services/Webhook/TriggerRefusalDetail.types.d.ts.map +1 -0
  117. package/build/services/Webhook/TriggerRefusalDetail.types.js +12 -0
  118. package/build/services/Webhook/TriggerRequest.types.d.ts +77 -0
  119. package/build/services/Webhook/TriggerRequest.types.d.ts.map +1 -0
  120. package/build/services/Webhook/TriggerRequest.types.js +1 -0
  121. package/build/services/Webhook/TriggerSearch.types.d.ts +42 -0
  122. package/build/services/Webhook/TriggerSearch.types.d.ts.map +1 -0
  123. package/build/services/Webhook/TriggerSearch.types.js +1 -0
  124. package/build/services/Webhook/TriggerService.d.ts +158 -150
  125. package/build/services/Webhook/TriggerService.d.ts.map +1 -1
  126. package/build/services/Webhook/TriggerService.js +0 -24
  127. package/build/services/Webhook/TriggerTimeline.types.d.ts +42 -0
  128. package/build/services/Webhook/TriggerTimeline.types.d.ts.map +1 -0
  129. package/build/services/Webhook/TriggerTimeline.types.js +1 -0
  130. package/build/services/Webhook/TriggerVersion.types.d.ts +93 -0
  131. package/build/services/Webhook/TriggerVersion.types.d.ts.map +1 -0
  132. package/build/services/Webhook/TriggerVersion.types.js +1 -0
  133. package/build/services/Webhook/TriggerVersionService.d.ts +56 -0
  134. package/build/services/Webhook/TriggerVersionService.d.ts.map +1 -0
  135. package/build/services/Webhook/TriggerVersionService.js +20 -0
  136. package/package.json +8 -7
@@ -0,0 +1,89 @@
1
+ import type { ResourceAccessReason } from '../AppService/types/resourceEntitlements';
2
+ import type { Event } from './EventService';
3
+ /**
4
+ * What a trigger DISPATCH answers with — the two structured envelopes and their
5
+ * guards.
6
+ *
7
+ * Split from `TriggerService.ts`, which describes the trigger itself. Dataset
8
+ * actions have their own refusal contract in `TriggerDatasetResponses.types.ts`.
9
+ */
10
+ /**
11
+ * The actionable response a dispatch returns when a bound per-user
12
+ * (`oauth2_authorization_code`) secret has no token yet for the signed-in user.
13
+ * The OS host opens `authorize_url` in a consent popup and re-dispatches. This is
14
+ * NOT an error — the backend returns it with HTTP 200.
15
+ */
16
+ export interface AuthorizationRequiredResult {
17
+ authorization_required: true;
18
+ authorize_url: string;
19
+ secret_id: string;
20
+ }
21
+ /**
22
+ * A trigger that consumes a purchased store resource was refused (AAD-940).
23
+ *
24
+ * ⚠️ This arrives as a NON-2xx response, so it surfaces as a rejected request —
25
+ * read it off the error body, not the resolved value. It is wrapped in the
26
+ * dispatch envelope: `error.response.data.response`.
27
+ *
28
+ * **Branch on `reason`, never on the HTTP status** — several reasons share 403.
29
+ * `reason` is a {@link ResourceAccessReason} (`not_entitled`,
30
+ * `entitlement_revoked`, `subscription_expired`, `version_withdrawn`, …) or one
31
+ * of the trigger-side reasons below, which describe the trigger's own
32
+ * configuration rather than the licence's entitlement:
33
+ *
34
+ * | reason | status | what it means |
35
+ * | --- | --- | --- |
36
+ * | `resource_not_configured` | 422 | the trigger names no resource — send the user to edit it |
37
+ * | `resource_not_found` | 404 | the configured listing is gone |
38
+ * | `no_license_context` | 409 | the trigger resolves to no owning licence |
39
+ * | `store_resources_disabled` | 404 | the resource surface is off for this deployment |
40
+ *
41
+ * ⚠️ **Never render this as an empty result.** "Not entitled" and "this dataset
42
+ * has no rows" look identical to a user and call for opposite actions, which is
43
+ * exactly why the refusal is a populated body rather than an empty one.
44
+ */
45
+ export interface ResourceAccessDeniedResult {
46
+ resource_access_denied: true;
47
+ reason: ResourceAccessReason | TriggerResourceReason;
48
+ message: string;
49
+ /** The status the response carried. Informational — branch on `reason`. */
50
+ status_code: number;
51
+ }
52
+ /** Refusals that are about the trigger's configuration, not the entitlement. */
53
+ export type TriggerResourceReason = 'resource_not_configured' | 'resource_not_found' | 'no_license_context' | 'store_resources_disabled';
54
+ /**
55
+ * A dispatch returns either the trigger's own response payload or, for an
56
+ * unconsented per-user OAuth2 binding, an {@link AuthorizationRequiredResult}.
57
+ * Narrow with {@link isAuthorizationRequired}.
58
+ *
59
+ * A refused resource-consuming trigger does NOT appear here — it is a non-2xx
60
+ * response; see {@link ResourceAccessDeniedResult}.
61
+ */
62
+ export type TriggerDispatchResult = AuthorizationRequiredResult | unknown;
63
+ /** Type guard: is this dispatch result the "user must authorize" envelope? */
64
+ export declare function isAuthorizationRequired(result: unknown): result is AuthorizationRequiredResult;
65
+ /**
66
+ * Type guard: is this a refused resource-consuming dispatch?
67
+ *
68
+ * Accepts either the dispatch envelope or the inner body, so it can be pointed
69
+ * straight at `error.response?.data` without unwrapping first.
70
+ */
71
+ export declare function isResourceAccessDenied(result: unknown): result is ResourceAccessDeniedResult;
72
+ /**
73
+ * The result of a TEST dispatch.
74
+ *
75
+ * Moved here from `TriggerService.ts` (at its size limit) because this is a
76
+ * dispatch-result shape and this file already holds those. Re-exported from the
77
+ * package root, so no consumer import path changes.
78
+ */
79
+ export interface TriggerExecutionResult {
80
+ trigger: {
81
+ id: string;
82
+ name: string;
83
+ event: Event;
84
+ };
85
+ data: any;
86
+ error: string | null;
87
+ status: 'error' | 'success';
88
+ }
89
+ //# sourceMappingURL=TriggerDispatch.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TriggerDispatch.types.d.ts","sourceRoot":"","sources":["../../../src/services/Webhook/TriggerDispatch.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAA;AAGpF,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAE3C;;;;;;GAMG;AAEH;;;;;GAKG;AACH,MAAM,WAAW,2BAA2B;IAC1C,sBAAsB,EAAE,IAAI,CAAA;IAC5B,aAAa,EAAE,MAAM,CAAA;IACrB,SAAS,EAAE,MAAM,CAAA;CAClB;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,WAAW,0BAA0B;IACzC,sBAAsB,EAAE,IAAI,CAAA;IAC5B,MAAM,EAAE,oBAAoB,GAAG,qBAAqB,CAAA;IACpD,OAAO,EAAE,MAAM,CAAA;IACf,2EAA2E;IAC3E,WAAW,EAAE,MAAM,CAAA;CACpB;AAED,gFAAgF;AAChF,MAAM,MAAM,qBAAqB,GAC3B,yBAAyB,GACzB,oBAAoB,GACpB,oBAAoB,GACpB,0BAA0B,CAAA;AAEhC;;;;;;;GAOG;AACH,MAAM,MAAM,qBAAqB,GAAG,2BAA2B,GAAG,OAAO,CAAA;AAEzE,8EAA8E;AAC9E,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,IAAI,2BAA2B,CAO9F;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,IAAI,0BAA0B,CAQ5F;AAED;;;;;;GAMG;AACH,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE;QACP,EAAE,EAAE,MAAM,CAAA;QACV,IAAI,EAAE,MAAM,CAAA;QACZ,KAAK,EAAE,KAAK,CAAA;KACb,CAAA;IACD,IAAI,EAAE,GAAG,CAAA;IACT,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,MAAM,EAAE,OAAO,GAAG,SAAS,CAAA;CAC5B"}
@@ -0,0 +1,24 @@
1
+ /** Type guard: is this dispatch result the "user must authorize" envelope? */
2
+ export function isAuthorizationRequired(result) {
3
+ if (typeof result !== 'object' || result === null)
4
+ return false;
5
+ const record = result;
6
+ return record.authorization_required === true
7
+ && typeof record.authorize_url === 'string'
8
+ && typeof record.secret_id === 'string';
9
+ }
10
+ /**
11
+ * Type guard: is this a refused resource-consuming dispatch?
12
+ *
13
+ * Accepts either the dispatch envelope or the inner body, so it can be pointed
14
+ * straight at `error.response?.data` without unwrapping first.
15
+ */
16
+ export function isResourceAccessDenied(result) {
17
+ if (typeof result !== 'object' || result === null)
18
+ return false;
19
+ const envelope = result;
20
+ const body = (typeof envelope.response === 'object' && envelope.response !== null)
21
+ ? envelope.response
22
+ : envelope;
23
+ return body.resource_access_denied === true && typeof body.reason === 'string';
24
+ }
@@ -0,0 +1,30 @@
1
+ import type { Trigger } from './TriggerService';
2
+ /**
3
+ * Reading a trigger's divergence from its released default (AAD-964).
4
+ *
5
+ * Split out of TriggerService.ts rather than living beside the interface: that
6
+ * file is at its size limit, and this is a self-contained concern with one type
7
+ * and one function. Re-exported from the package root, so no consumer import path
8
+ * changes.
9
+ */
10
+ /**
11
+ * The three states {@link Trigger.has_unreleased_changes} can be in, as names
12
+ * rather than as a boolean that has an extra value.
13
+ */
14
+ export type TriggerDivergence = 'never_released' | 'in_sync' | 'has_unreleased_changes';
15
+ /**
16
+ * Read a trigger's divergence as a named state.
17
+ *
18
+ * Prefer this over touching `has_unreleased_changes` directly. Not because the raw
19
+ * field is wrong, but because the two most natural ways to consume a
20
+ * `boolean | null` — `?? false` and `!!value` — are both silently incorrect, and
21
+ * TypeScript cannot reject either: narrowing a nullable boolean is legal. A
22
+ * function returning a three-way union moves the problem somewhere the compiler
23
+ * DOES help, because a `switch` over the result can be checked for exhaustiveness
24
+ * and a forgotten case is a type error.
25
+ *
26
+ * `default_version_id` is consulted as a fallback for responses produced before
27
+ * the index eager-loaded the relation, where the flag could be absent.
28
+ */
29
+ export declare function triggerDivergence(trigger: Pick<Trigger, 'has_unreleased_changes' | 'default_version_id'>): TriggerDivergence;
30
+ //# sourceMappingURL=TriggerDivergence.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TriggerDivergence.d.ts","sourceRoot":"","sources":["../../../src/services/Webhook/TriggerDivergence.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAE/C;;;;;;;GAOG;AAEH;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,gBAAgB,GAAG,SAAS,GAAG,wBAAwB,CAAA;AAEvF;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,wBAAwB,GAAG,oBAAoB,CAAC,GACtE,iBAAiB,CAYnB"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Read a trigger's divergence as a named state.
3
+ *
4
+ * Prefer this over touching `has_unreleased_changes` directly. Not because the raw
5
+ * field is wrong, but because the two most natural ways to consume a
6
+ * `boolean | null` — `?? false` and `!!value` — are both silently incorrect, and
7
+ * TypeScript cannot reject either: narrowing a nullable boolean is legal. A
8
+ * function returning a three-way union moves the problem somewhere the compiler
9
+ * DOES help, because a `switch` over the result can be checked for exhaustiveness
10
+ * and a forgotten case is a type error.
11
+ *
12
+ * `default_version_id` is consulted as a fallback for responses produced before
13
+ * the index eager-loaded the relation, where the flag could be absent.
14
+ */
15
+ export function triggerDivergence(trigger) {
16
+ if (trigger.has_unreleased_changes === true) {
17
+ return 'has_unreleased_changes';
18
+ }
19
+ if (trigger.has_unreleased_changes === false) {
20
+ return 'in_sync';
21
+ }
22
+ // null, or absent on an older response. Corroborated by the version pointer,
23
+ // which is unconditional and has always been present.
24
+ return trigger.default_version_id === null ? 'never_released' : 'in_sync';
25
+ }
@@ -0,0 +1,57 @@
1
+ import type { PaginatedResponse } from '../../types';
2
+ import type { TriggerExecutionHistory } from './TriggerHistoryService';
3
+ /**
4
+ * The failed-runs badge on the Runs rail (AAD-961).
5
+ *
6
+ * Split out of `TriggerHistoryService.ts`, which is near its size limit;
7
+ * re-exported from the package root, so no consumer import path changes.
8
+ */
9
+ /**
10
+ * The execution-history list response.
11
+ *
12
+ * A paginated list plus the licence/project-wide failed-runs count the rail badge
13
+ * renders from.
14
+ */
15
+ export interface ExecutionHistoryResponse extends PaginatedResponse<TriggerExecutionHistory> {
16
+ failed_runs: FailedRunsSummary;
17
+ }
18
+ export interface FailedRunsSummary {
19
+ /**
20
+ * How many RUNS failed in the last {@link window_hours} hours, across this
21
+ * licence or project.
22
+ *
23
+ * ⚠️ **This counts runs, not triggers — and "triggers whose last run failed" is a
24
+ * DIFFERENT number.** You can derive that one from `Trigger.last_run`, but one
25
+ * trigger failing six times is six here and one there. Do not substitute either
26
+ * for the other: the label says failed runs.
27
+ *
28
+ * ⚠️ **UNFILTERED and UNPAGINATED. Do not recompute it from `data`.** It answers
29
+ * "is something wrong in this licence right now", so filtering the list — by
30
+ * `trigger_id`, by status, by date — does not change it, and neither does turning
31
+ * a page. A badge that shrank with a filter would make remaining trouble look
32
+ * resolved. It is also not narrowed to a trigger even on the per-trigger route.
33
+ *
34
+ * Counts `error` only. `authorization_required` is NOT a failure — that run
35
+ * carries an `authorize_url` and is waiting on a person — and `pending` has not
36
+ * finished. Neither belongs under a "failed" label.
37
+ *
38
+ * Root executions only, matching what the list shows, so every counted run is one
39
+ * the user can open. A chained child failure is therefore not counted; chain-aware
40
+ * status is a deliberate non-goal, not a gap.
41
+ *
42
+ * Always present, so this is `number` and not nullable — zero is a real value and
43
+ * hides the badge. Keep "not yet loaded" in your own state, as with the chaining
44
+ * count.
45
+ */
46
+ count: number;
47
+ /**
48
+ * The window `count` was measured over, in hours.
49
+ *
50
+ * ⚠️ **Label the badge from this, never from a hardcoded string.** It is echoed
51
+ * precisely so no client has to write "24h" in its copy and keep saying it after
52
+ * the window changes. Today it is 24; that is a server-side constant and may be
53
+ * widened deliberately.
54
+ */
55
+ window_hours: number;
56
+ }
57
+ //# sourceMappingURL=TriggerFailedRuns.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TriggerFailedRuns.types.d.ts","sourceRoot":"","sources":["../../../src/services/Webhook/TriggerFailedRuns.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AACpD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAA;AAEtE;;;;;GAKG;AAEH;;;;;GAKG;AACH,MAAM,WAAW,wBAAyB,SAAQ,iBAAiB,CAAC,uBAAuB,CAAC;IAC1F,WAAW,EAAE,iBAAiB,CAAA;CAC/B;AAED,MAAM,WAAW,iBAAiB;IAChC;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACH,KAAK,EAAE,MAAM,CAAA;IAEb;;;;;;;OAOG;IACH,YAAY,EAAE,MAAM,CAAA;CACrB"}
@@ -0,0 +1 @@
1
+ export {};
@@ -1,6 +1,12 @@
1
- import type { DataWrapper, PaginatedResponse } from '../../types';
1
+ import type { DataWrapper } from '../../types';
2
+ import type { ResourceAccessReason } from '../AppService/types/resourceEntitlements';
3
+ import type { DatasetRefusalReason } from './TriggerDatasetResponses.types';
4
+ import type { TriggerResourceReason } from './TriggerDispatch.types';
5
+ import type { ExecutionHistoryResponse } from './TriggerFailedRuns.types';
6
+ import type { DatasetRefusalDetail } from './TriggerRefusalDetail.types';
7
+ import type { ExecutionTimelineItem } from './TriggerTimeline.types';
2
8
  import type { AntHttpClient } from "../../AntHttpClient";
3
- export type ExecutionStatus = 'success' | 'error' | 'authorization_required';
9
+ export type ExecutionStatus = 'success' | 'error' | 'pending' | 'authorization_required';
4
10
  export type OverallExecutionStatus = 'success' | 'partial_success' | 'error';
5
11
  export type ExecutionSourceType = 'api_request' | 'test_dispatch' | 'system_event' | 'related_trigger' | 'unknown';
6
12
  export interface RelatedTriggersSummary {
@@ -40,20 +46,77 @@ export interface TriggerExecutionHistory {
40
46
  related_triggers_summary: RelatedTriggersSummary;
41
47
  overall_status: OverallExecutionStatus;
42
48
  total_execution_duration_ms: number;
43
- }
44
- export interface ExecutionTimelineItem {
45
- id: string;
46
- trigger_id: string;
47
- trigger_name: string;
48
- event_id: string | null;
49
- event_name: string | null;
50
- executed_at: string;
51
- execution_duration_ms: number | null;
52
- status: ExecutionStatus;
53
- error_message: string | null;
54
- response: any;
55
- is_main_trigger: boolean;
56
- execution_order: number;
49
+ /**
50
+ * Read as a PAIR with {@link trigger_version_label}. Three cases, and the label
51
+ * alone flattens the last two:
52
+ *
53
+ * | `trigger_version_id` | `trigger_version_label` | Means |
54
+ * | -------------------- | ----------------------- | ---------------------------- |
55
+ * | `null` | `null` | the trigger's draft ran |
56
+ * | set | set | that version ran |
57
+ * | set | `null` | that version has been DELETED |
58
+ */
59
+ trigger_version_id: string | null;
60
+ /**
61
+ * The publisher's own label, e.g. `"1.0.0"` — NOT an id.
62
+ *
63
+ * It exists because an id on its own is something a client cannot resolve: every
64
+ * per-version lookup needs the trigger too. Null when the run used the draft, and
65
+ * also null when the version has since been deleted; see the table above.
66
+ */
67
+ trigger_version_label: string | null;
68
+ /**
69
+ * The machine-readable code when this run was REFUSED, rather than merely failed.
70
+ *
71
+ * Null for a success AND null for an ordinary exception — a refusal is a
72
+ * deliberate, categorised "no", so an uncaught error has no code. When it is set,
73
+ * `response.dataset_refused` / `response.resource_access_denied` tell you which of
74
+ * the two vocabularies applies.
75
+ *
76
+ * ⚠️ `snapshot_limits_misconfigured` is an OPERATOR fault, not a publisher one —
77
+ * the deployment's ceilings are unusable. It deliberately reads differently from
78
+ * "your dataset is too big", and the HTTP status alone cannot carry that
79
+ * difference. Branch on this field, never on the status.
80
+ */
81
+ refusal_reason: DatasetRefusalReason | ResourceAccessReason | TriggerResourceReason | null;
82
+ /**
83
+ * The figures behind a CEILING refusal, or null.
84
+ *
85
+ * ⚠️ **Null is the common case.** Only a ceiling produces one — `limit` and
86
+ * `unit` have to mean a ceiling for the object to mean anything, so a shape or
87
+ * type mismatch deliberately reports null rather than inventing a limit nothing
88
+ * declared. Those refusals carry their specifics in `error_message`.
89
+ *
90
+ * Publisher-only: it is never part of what the caller received, so do not look
91
+ * for it in `response`.
92
+ *
93
+ * ⚠️ `actual` inside it is optional — see {@link DatasetRefusalDetail.actual}
94
+ * before defaulting it to anything.
95
+ */
96
+ refusal_detail: DatasetRefusalDetail | null;
97
+ /**
98
+ * The STORED copy of the response was shrunk to save database space.
99
+ *
100
+ * A fact about this history row only — **the caller received everything.** Do not
101
+ * render this as "some rows were left out"; that is {@link dataset_truncated}.
102
+ */
103
+ stored_response_truncated: boolean;
104
+ /**
105
+ * A dataset action clamped its rows to the declared limit.
106
+ *
107
+ * This is what a UI means by "truncated": the run SUCCEEDED and returned fewer
108
+ * rows than the source holds. Not an error, and not a refusal — render it on a
109
+ * successful run.
110
+ *
111
+ * ⚠️ `null` means the question does not apply (the run was not a dataset action),
112
+ * which is NOT `false`. `?? false` would claim "no rows were left out" about a
113
+ * response that has no rows.
114
+ *
115
+ * These two can DISAGREE on the same row — a clamped dataset whose stored copy
116
+ * fitted reads `dataset_truncated: true, stored_response_truncated: false` — which
117
+ * is why they are two fields and not one.
118
+ */
119
+ dataset_truncated: boolean | null;
57
120
  }
58
121
  export interface TriggerExecutionHistoryDetail {
59
122
  id: string;
@@ -70,6 +133,13 @@ export interface TriggerExecutionHistoryDetail {
70
133
  has_event_name_changed: boolean;
71
134
  has_trigger_name_changed: boolean;
72
135
  execution_timeline: ExecutionTimelineItem[];
136
+ /** Same meanings as on the index item — see {@link TriggerExecutionHistory}. */
137
+ trigger_version_id: string | null;
138
+ trigger_version_label: string | null;
139
+ refusal_reason: DatasetRefusalReason | ResourceAccessReason | TriggerResourceReason | null;
140
+ refusal_detail: DatasetRefusalDetail | null;
141
+ stored_response_truncated: boolean;
142
+ dataset_truncated: boolean | null;
73
143
  }
74
144
  /**
75
145
  * Index filters
@@ -89,7 +159,7 @@ export interface TriggerHistoryService {
89
159
  * Fetch all execution history records with optional filters
90
160
  * Returns only root executions with summary information about related triggers
91
161
  */
92
- fetchExecutionHistory: (triggerableType: string, triggerableId: string, filters?: ExecutionHistoryFilters) => Promise<PaginatedResponse<TriggerExecutionHistory>>;
162
+ fetchExecutionHistory: (triggerableType: string, triggerableId: string, filters?: ExecutionHistoryFilters) => Promise<ExecutionHistoryResponse>;
93
163
  /**
94
164
  * Fetch a specific execution history record by ID with detailed execution chain
95
165
  * Returns structure matching test dispatch format with triggersBefore, triggersAfter, mainTrigger
@@ -99,7 +169,7 @@ export interface TriggerHistoryService {
99
169
  * Fetch execution history records for a specific trigger
100
170
  * Returns execution history with full chain structure for each record
101
171
  */
102
- fetchTriggerExecutionHistory: (triggerableType: string, triggerableId: string, triggerId: string, filters?: Omit<ExecutionHistoryFilters, 'trigger_id'>) => Promise<PaginatedResponse<TriggerExecutionHistory>>;
172
+ fetchTriggerExecutionHistory: (triggerableType: string, triggerableId: string, triggerId: string, filters?: Omit<ExecutionHistoryFilters, 'trigger_id'>) => Promise<ExecutionHistoryResponse>;
103
173
  /**
104
174
  * Clear all execution history for a specific context (license/project)
105
175
  */
@@ -1 +1 @@
1
- {"version":3,"file":"TriggerHistoryService.d.ts","sourceRoot":"","sources":["../../../src/services/Webhook/TriggerHistoryService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,4BAAuB;AAMpD,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,OAAO,GAAG,wBAAwB,CAAA;AAC5E,MAAM,MAAM,sBAAsB,GAAG,SAAS,GAAG,iBAAiB,GAAG,OAAO,CAAA;AAC5E,MAAM,MAAM,mBAAmB,GAAG,aAAa,GAAG,eAAe,GAAG,cAAc,GAAG,iBAAiB,GAAG,SAAS,CAAA;AAGlH,MAAM,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,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,uBAAuB,EAAE,YAAY,CAAC,KAAK,OAAO,CAAC,wBAAwB,CAAC,CAAA;IAE7L;;OAEG;IACH,wBAAwB,EAAE,CAAC,eAAe,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,KAAK,OAAO,CAAC,WAAW,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,aAAa,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC,CAAA;IAE9I;;OAEG;IACH,4BAA4B,EAAE,CAAC,eAAe,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,WAAW,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,aAAa,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC,CAAA;CACtK;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,UAAU,EAAE,aAAa,GAAG,qBAAqB,CAiB5F"}
@@ -0,0 +1,80 @@
1
+ import type { ResourceAccessReason } from '../AppService/types/resourceEntitlements';
2
+ import type { DatasetRefusalReason } from './TriggerDatasetResponses.types';
3
+ import type { TriggerResourceReason } from './TriggerDispatch.types';
4
+ import type { ExecutionStatus } from './TriggerHistoryService';
5
+ /**
6
+ * The most recent execution of a trigger, for the index's run-status column
7
+ * (AAD-961 §1).
8
+ *
9
+ * Split out of `TriggerService.ts`, which is at its size limit; re-exported from
10
+ * the package root, so no consumer import path changes.
11
+ *
12
+ * Backed server-side by `Trigger::latestExecution()` (`latestOfMany`) over a
13
+ * `(trigger_id, executed_at)` index, eager-loaded — so it costs one query per page
14
+ * rather than one per row.
15
+ */
16
+ /**
17
+ * ⚠️ **`null` means the trigger has NEVER RUN. That is not a run that failed.**
18
+ *
19
+ * The distinction is the entire point of the column. Defaulting a missing value to
20
+ * a green "ran clean" would call an unmeasured trigger healthy and hide the broken
21
+ * row beside it, which is the worst answer this column can give. Render "never
22
+ * run" as its own state.
23
+ *
24
+ * Every key below is always present when the object exists — the nullable ones
25
+ * carry `null`, they are not omitted.
26
+ */
27
+ export interface TriggerLastRun {
28
+ /**
29
+ * The execution id, so the row can link straight to the run.
30
+ *
31
+ * Present so a client need not search the history for the run it was just
32
+ * described.
33
+ */
34
+ id: string;
35
+ /**
36
+ * This execution's OWN status — the same vocabulary as
37
+ * {@link TriggerExecutionHistory.status}, so there is only one set of values to
38
+ * learn.
39
+ *
40
+ * ⚠️ **It is NOT `overall_status`, and the two genuinely disagree.**
41
+ * `overall_status` is chain-aware and can report `partial_success` when a
42
+ * CHILD execution failed; this reports how *this* trigger's own run ended, so a
43
+ * chained trigger whose child failed shows `success` here. `overall_status` is
44
+ * deliberately absent from the index: computing it walks every child execution,
45
+ * which is a query per row.
46
+ *
47
+ * If the column needs to reflect chain failures, read `overall_status` from the
48
+ * run detail rather than inferring it from this.
49
+ */
50
+ status: ExecutionStatus;
51
+ /** When it ran. ISO 8601; never null — the column is NOT NULL. */
52
+ at: string;
53
+ /** Wall-clock duration. Null when the run never recorded one. */
54
+ duration_ms: number | null;
55
+ /**
56
+ * The machine-readable code when the run was REFUSED, rather than merely failed.
57
+ *
58
+ * ⚠️ **`reason: null` does NOT mean the run succeeded.** A refusal is a
59
+ * deliberate, categorised "no"; an ordinary exception is not, and carries no
60
+ * code. So `status: 'error'` with `reason: null` is a real and common
61
+ * combination — an uncaught failure. Branch on `status` first and treat `reason`
62
+ * as extra detail when it is there, never as the presence test for failure.
63
+ *
64
+ * Values come from the same vocabulary as
65
+ * {@link TriggerExecutionHistory.refusal_reason}, covering both dataset refusals
66
+ * and entitlement refusals. The figures behind a ceiling refusal are not here —
67
+ * they are on the run itself, as `refusal_detail`.
68
+ */
69
+ reason: DatasetRefusalReason | ResourceAccessReason | TriggerResourceReason | null;
70
+ /**
71
+ * The publisher's label for the version that ran, e.g. `"1.0.0"`.
72
+ *
73
+ * Null when the trigger's own draft ran, AND null when the version that ran has
74
+ * since been deleted. The run detail's `trigger_version_id` tells those two
75
+ * apart; on the index there is only the label, so treat null as "no version to
76
+ * name" rather than as "no version was involved".
77
+ */
78
+ trigger_version_label: string | null;
79
+ }
80
+ //# sourceMappingURL=TriggerLastRun.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TriggerLastRun.types.d.ts","sourceRoot":"","sources":["../../../src/services/Webhook/TriggerLastRun.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAA;AACpF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAA;AAC3E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AACpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AAE9D;;;;;;;;;;GAUG;AAEH;;;;;;;;;;GAUG;AACH,MAAM,WAAW,cAAc;IAC7B;;;;;OAKG;IACH,EAAE,EAAE,MAAM,CAAA;IAEV;;;;;;;;;;;;;;OAcG;IACH,MAAM,EAAE,eAAe,CAAA;IAEvB,kEAAkE;IAClE,EAAE,EAAE,MAAM,CAAA;IAEV,iEAAiE;IACjE,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAE1B;;;;;;;;;;;;;OAaG;IACH,MAAM,EAAE,oBAAoB,GAAG,oBAAoB,GAAG,qBAAqB,GAAG,IAAI,CAAA;IAElF;;;;;;;OAOG;IACH,qBAAqB,EAAE,MAAM,GAAG,IAAI,CAAA;CACrC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,63 @@
1
+ /**
2
+ * The numbers behind a ceiling refusal, for the run-diagnosis view (AAD-961 §4).
3
+ *
4
+ * Publisher-only, and it lives on the execution-history row rather than in a
5
+ * dispatch response — a caller never receives it. That is why this is its own file
6
+ * and not part of `TriggerDatasetResponses.types.ts`, which describes what a
7
+ * dispatch returns.
8
+ *
9
+ * It exists so a run view can offer "what would fix it" instead of only echoing a
10
+ * sentence. Parsing the prose for the figures works until somebody rewords it.
11
+ */
12
+ /**
13
+ * A ceiling and, when it was actually measured, the value that exceeded it.
14
+ *
15
+ * `null` on the history row for every refusal that is not a ceiling — see
16
+ * {@link TriggerExecutionHistory.refusal_detail}.
17
+ */
18
+ export interface DatasetRefusalDetail {
19
+ /** The ceiling that applied, in `unit`. */
20
+ limit: number;
21
+ /**
22
+ * ⚠️ **OPTIONAL, and ABSENT MEANS NEVER MEASURED — not zero.**
23
+ *
24
+ * Rendering a missing `actual` as `0` reproduces at this end exactly the
25
+ * fabrication the backend refuses to commit at the other: it would tell a
26
+ * publisher their file is 0 bytes. Show "over the limit" with no figure, and
27
+ * never substitute the ceiling — reporting the limit as though it were the
28
+ * measurement is the specific mistake this shape was built to prevent.
29
+ *
30
+ * On a trigger run it is normally PRESENT. `byte_limit_exceeded` here means the
31
+ * SOURCE FILE is too big, and the check compares the file's recorded size
32
+ * before opening anything — so the number is known.
33
+ *
34
+ * It is absent in one case: when the recorded size is not a canonical byte
35
+ * count. A malformed size is refused through the *same* reason so it cannot
36
+ * bypass the ceiling, which means `byte_limit_exceeded` covers both "too big"
37
+ * and "we do not trust the recorded size" — and only the first is a
38
+ * measurement. `Number("-1")` and `Number("1.5")` are not measurements of
39
+ * anything.
40
+ *
41
+ * (The Store's artifact writer is the caller that never knows the size, because
42
+ * it aborts the moment the ceiling is crossed. That path does not write trigger
43
+ * history, so you will not see it here — but it is why the field is optional in
44
+ * the shape at all.)
45
+ */
46
+ actual?: number;
47
+ /**
48
+ * The unit `limit` and `actual` are counted in.
49
+ *
50
+ * Only `bytes` occurs on a trigger run, and the narrow type is deliberate so no
51
+ * one builds a branch that never fires. A row ceiling cannot produce a refusal
52
+ * here at all: a dataset action CLAMPS to the declared limit and reports
53
+ * `dataset_truncated: true` on a **successful** response, rather than refusing —
54
+ * which is why `row_limit_exceeded` is absent from
55
+ * {@link DatasetRefusalReason} too.
56
+ *
57
+ * If a row-based refusal ever becomes reachable, widening this to
58
+ * `'bytes' | 'rows'` is the deliberate change, and TypeScript will flag every
59
+ * exhaustive switch at that point. That is the right moment to find them.
60
+ */
61
+ unit: 'bytes';
62
+ }
63
+ //# sourceMappingURL=TriggerRefusalDetail.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TriggerRefusalDetail.types.d.ts","sourceRoot":"","sources":["../../../src/services/Webhook/TriggerRefusalDetail.types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB;IACnC,2CAA2C;IAC3C,KAAK,EAAE,MAAM,CAAA;IAEb;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IAEf;;;;;;;;;;;;;OAaG;IACH,IAAI,EAAE,OAAO,CAAA;CACd"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * The numbers behind a ceiling refusal, for the run-diagnosis view (AAD-961 §4).
3
+ *
4
+ * Publisher-only, and it lives on the execution-history row rather than in a
5
+ * dispatch response — a caller never receives it. That is why this is its own file
6
+ * and not part of `TriggerDatasetResponses.types.ts`, which describes what a
7
+ * dispatch returns.
8
+ *
9
+ * It exists so a run view can offer "what would fix it" instead of only echoing a
10
+ * sentence. Parsing the prose for the figures works until somebody rewords it.
11
+ */
12
+ export {};