@antcde/connect-ts 0.4.35-rc.2 → 0.4.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/AntConnect.d.ts +15 -2
- package/build/AntConnect.d.ts.map +1 -1
- package/build/AntConnect.js +14 -2
- package/build/index.d.ts +29 -29
- package/build/index.d.ts.map +1 -1
- package/build/index.js +7 -7
- package/build/service-runtime.d.ts +1 -1
- package/build/service-runtime.d.ts.map +1 -1
- package/build/service-runtime.js +1 -1
- package/build/service-types.d.ts +7 -7
- package/build/service-types.d.ts.map +1 -1
- package/build/services/AppService/factory/assignments.d.ts +4 -4
- package/build/services/AppService/factory/assignments.d.ts.map +1 -1
- package/build/services/AppService/factory/assignments.js +4 -8
- package/build/services/AppService/types/appScopes.d.ts +14 -14
- package/build/services/AppService/types/appScopes.d.ts.map +1 -1
- package/build/services/AppService/types/bulkAssignments.d.ts +4 -2
- package/build/services/AppService/types/bulkAssignments.d.ts.map +1 -1
- package/build/services/AppService/types/resourceReleases.d.ts +1 -1
- package/build/services/AppService/types/seats.d.ts +1 -14
- package/build/services/AppService/types/seats.d.ts.map +1 -1
- package/build/services/AppService/types/sellableResources.d.ts +1 -1
- package/build/services/AppService/types/subscriptions.d.ts +0 -4
- package/build/services/AppService/types/subscriptions.d.ts.map +1 -1
- package/build/services/SecretSharing.types.d.ts +1 -1
- package/build/services/TaskRelation.types.d.ts +1 -1
- package/build/services/TaskService.types.d.ts +1 -1
- package/build/services/TaskService.types.d.ts.map +1 -1
- package/build/services/Webhook/ConfigService.d.ts +50 -2
- package/build/services/Webhook/ConfigService.d.ts.map +1 -1
- package/build/services/Webhook/ConfigService.js +5 -2
- package/build/services/Webhook/EventService.d.ts +145 -2
- package/build/services/Webhook/EventService.d.ts.map +1 -1
- package/build/services/Webhook/EventService.js +6 -2
- package/build/services/Webhook/TriggerCaller.types.d.ts +17 -2
- package/build/services/Webhook/TriggerCaller.types.d.ts.map +1 -1
- package/build/services/Webhook/TriggerCaller.types.js +1 -2
- package/build/services/Webhook/TriggerDataset.types.d.ts +167 -2
- package/build/services/Webhook/TriggerDataset.types.d.ts.map +1 -1
- package/build/services/Webhook/TriggerDataset.types.js +51 -2
- package/build/services/Webhook/TriggerDatasetColumns.d.ts +73 -2
- package/build/services/Webhook/TriggerDatasetColumns.d.ts.map +1 -1
- package/build/services/Webhook/TriggerDatasetColumns.js +118 -2
- package/build/services/Webhook/TriggerDatasetCsv.types.d.ts +6 -2
- package/build/services/Webhook/TriggerDatasetCsv.types.d.ts.map +1 -1
- package/build/services/Webhook/TriggerDatasetCsv.types.js +1 -2
- package/build/services/Webhook/TriggerDatasetResponses.types.d.ts +175 -2
- package/build/services/Webhook/TriggerDatasetResponses.types.d.ts.map +1 -1
- package/build/services/Webhook/TriggerDatasetResponses.types.js +99 -2
- package/build/services/Webhook/TriggerDatasetSourceService.d.ts +181 -2
- package/build/services/Webhook/TriggerDatasetSourceService.d.ts.map +1 -1
- package/build/services/Webhook/TriggerDatasetSourceService.js +23 -2
- package/build/services/Webhook/TriggerDispatch.types.d.ts +88 -2
- package/build/services/Webhook/TriggerDispatch.types.d.ts.map +1 -1
- package/build/services/Webhook/TriggerDispatch.types.js +24 -2
- package/build/services/Webhook/TriggerDispatchUrl.d.ts +8 -2
- package/build/services/Webhook/TriggerDispatchUrl.d.ts.map +1 -1
- package/build/services/Webhook/TriggerDispatchUrl.js +27 -2
- package/build/services/Webhook/TriggerDivergence.d.ts +29 -2
- package/build/services/Webhook/TriggerDivergence.d.ts.map +1 -1
- package/build/services/Webhook/TriggerDivergence.js +25 -2
- package/build/services/Webhook/TriggerFailedRuns.types.d.ts +32 -2
- package/build/services/Webhook/TriggerFailedRuns.types.d.ts.map +1 -1
- package/build/services/Webhook/TriggerFailedRuns.types.js +1 -2
- package/build/services/Webhook/TriggerHistoryService.d.ts +200 -2
- package/build/services/Webhook/TriggerHistoryService.d.ts.map +1 -1
- package/build/services/Webhook/TriggerHistoryService.js +13 -2
- package/build/services/Webhook/TriggerLastRun.types.d.ts +79 -2
- package/build/services/Webhook/TriggerLastRun.types.d.ts.map +1 -1
- package/build/services/Webhook/TriggerLastRun.types.js +1 -2
- package/build/services/Webhook/TriggerOwner.d.ts +4 -2
- package/build/services/Webhook/TriggerOwner.d.ts.map +1 -1
- package/build/services/Webhook/TriggerOwner.js +6 -2
- package/build/services/Webhook/TriggerRefresh.types.d.ts +14 -2
- package/build/services/Webhook/TriggerRefresh.types.d.ts.map +1 -1
- package/build/services/Webhook/TriggerRefresh.types.js +1 -2
- package/build/services/Webhook/TriggerRefusalDetail.types.d.ts +62 -2
- package/build/services/Webhook/TriggerRefusalDetail.types.d.ts.map +1 -1
- package/build/services/Webhook/TriggerRefusalDetail.types.js +12 -2
- package/build/services/Webhook/TriggerRequest.types.d.ts +57 -2
- package/build/services/Webhook/TriggerRequest.types.d.ts.map +1 -1
- package/build/services/Webhook/TriggerRequest.types.js +1 -2
- package/build/services/Webhook/TriggerSearch.types.d.ts +38 -2
- package/build/services/Webhook/TriggerSearch.types.d.ts.map +1 -1
- package/build/services/Webhook/TriggerSearch.types.js +1 -2
- package/build/services/Webhook/TriggerSecretService.d.ts +87 -2
- package/build/services/Webhook/TriggerSecretService.d.ts.map +1 -1
- package/build/services/Webhook/TriggerSecretService.js +9 -2
- package/build/services/Webhook/TriggerService.d.ts +190 -2
- package/build/services/Webhook/TriggerService.d.ts.map +1 -1
- package/build/services/Webhook/TriggerService.js +14 -2
- package/build/services/Webhook/TriggerStats.types.d.ts +45 -2
- package/build/services/Webhook/TriggerStats.types.d.ts.map +1 -1
- package/build/services/Webhook/TriggerStats.types.js +1 -2
- package/build/services/Webhook/TriggerTimeline.types.d.ts +41 -2
- package/build/services/Webhook/TriggerTimeline.types.d.ts.map +1 -1
- package/build/services/Webhook/TriggerTimeline.types.js +1 -2
- package/build/services/Webhook/TriggerVersion.types.d.ts +108 -2
- package/build/services/Webhook/TriggerVersion.types.d.ts.map +1 -1
- package/build/services/Webhook/TriggerVersion.types.js +1 -2
- package/build/services/Webhook/TriggerVersionService.d.ts +53 -2
- package/build/services/Webhook/TriggerVersionService.d.ts.map +1 -1
- package/build/services/Webhook/TriggerVersionService.js +20 -2
- package/package.json +1 -1
- package/build/services/Trigger/ConfigService.d.ts +0 -51
- package/build/services/Trigger/ConfigService.d.ts.map +0 -1
- package/build/services/Trigger/ConfigService.js +0 -5
- package/build/services/Trigger/EventService.d.ts +0 -146
- package/build/services/Trigger/EventService.d.ts.map +0 -1
- package/build/services/Trigger/EventService.js +0 -6
- package/build/services/Trigger/TriggerCaller.types.d.ts +0 -18
- package/build/services/Trigger/TriggerCaller.types.d.ts.map +0 -1
- package/build/services/Trigger/TriggerCaller.types.js +0 -1
- package/build/services/Trigger/TriggerDataset.types.d.ts +0 -168
- package/build/services/Trigger/TriggerDataset.types.d.ts.map +0 -1
- package/build/services/Trigger/TriggerDataset.types.js +0 -51
- package/build/services/Trigger/TriggerDatasetColumns.d.ts +0 -74
- package/build/services/Trigger/TriggerDatasetColumns.d.ts.map +0 -1
- package/build/services/Trigger/TriggerDatasetColumns.js +0 -118
- package/build/services/Trigger/TriggerDatasetCsv.types.d.ts +0 -7
- package/build/services/Trigger/TriggerDatasetCsv.types.d.ts.map +0 -1
- package/build/services/Trigger/TriggerDatasetCsv.types.js +0 -1
- package/build/services/Trigger/TriggerDatasetResponses.types.d.ts +0 -176
- package/build/services/Trigger/TriggerDatasetResponses.types.d.ts.map +0 -1
- package/build/services/Trigger/TriggerDatasetResponses.types.js +0 -99
- package/build/services/Trigger/TriggerDatasetSourceService.d.ts +0 -182
- package/build/services/Trigger/TriggerDatasetSourceService.d.ts.map +0 -1
- package/build/services/Trigger/TriggerDatasetSourceService.js +0 -23
- package/build/services/Trigger/TriggerDispatch.types.d.ts +0 -89
- package/build/services/Trigger/TriggerDispatch.types.d.ts.map +0 -1
- package/build/services/Trigger/TriggerDispatch.types.js +0 -24
- package/build/services/Trigger/TriggerDispatchUrl.d.ts +0 -9
- package/build/services/Trigger/TriggerDispatchUrl.d.ts.map +0 -1
- package/build/services/Trigger/TriggerDispatchUrl.js +0 -27
- package/build/services/Trigger/TriggerDivergence.d.ts +0 -30
- package/build/services/Trigger/TriggerDivergence.d.ts.map +0 -1
- package/build/services/Trigger/TriggerDivergence.js +0 -25
- package/build/services/Trigger/TriggerFailedRuns.types.d.ts +0 -33
- package/build/services/Trigger/TriggerFailedRuns.types.d.ts.map +0 -1
- package/build/services/Trigger/TriggerFailedRuns.types.js +0 -1
- package/build/services/Trigger/TriggerHistoryService.d.ts +0 -201
- package/build/services/Trigger/TriggerHistoryService.d.ts.map +0 -1
- package/build/services/Trigger/TriggerHistoryService.js +0 -13
- package/build/services/Trigger/TriggerLastRun.types.d.ts +0 -80
- package/build/services/Trigger/TriggerLastRun.types.d.ts.map +0 -1
- package/build/services/Trigger/TriggerLastRun.types.js +0 -1
- package/build/services/Trigger/TriggerOwner.d.ts +0 -5
- package/build/services/Trigger/TriggerOwner.d.ts.map +0 -1
- package/build/services/Trigger/TriggerOwner.js +0 -6
- package/build/services/Trigger/TriggerRefresh.types.d.ts +0 -15
- package/build/services/Trigger/TriggerRefresh.types.d.ts.map +0 -1
- package/build/services/Trigger/TriggerRefresh.types.js +0 -1
- package/build/services/Trigger/TriggerRefusalDetail.types.d.ts +0 -63
- package/build/services/Trigger/TriggerRefusalDetail.types.d.ts.map +0 -1
- package/build/services/Trigger/TriggerRefusalDetail.types.js +0 -12
- package/build/services/Trigger/TriggerRequest.types.d.ts +0 -58
- package/build/services/Trigger/TriggerRequest.types.d.ts.map +0 -1
- package/build/services/Trigger/TriggerRequest.types.js +0 -1
- package/build/services/Trigger/TriggerSearch.types.d.ts +0 -39
- package/build/services/Trigger/TriggerSearch.types.d.ts.map +0 -1
- package/build/services/Trigger/TriggerSearch.types.js +0 -1
- package/build/services/Trigger/TriggerSecretService.d.ts +0 -88
- package/build/services/Trigger/TriggerSecretService.d.ts.map +0 -1
- package/build/services/Trigger/TriggerSecretService.js +0 -9
- package/build/services/Trigger/TriggerService.d.ts +0 -191
- package/build/services/Trigger/TriggerService.d.ts.map +0 -1
- package/build/services/Trigger/TriggerService.js +0 -14
- package/build/services/Trigger/TriggerServices.d.ts +0 -33
- package/build/services/Trigger/TriggerServices.d.ts.map +0 -1
- package/build/services/Trigger/TriggerServices.js +0 -32
- package/build/services/Trigger/TriggerStats.types.d.ts +0 -46
- package/build/services/Trigger/TriggerStats.types.d.ts.map +0 -1
- package/build/services/Trigger/TriggerStats.types.js +0 -1
- package/build/services/Trigger/TriggerTimeline.types.d.ts +0 -42
- package/build/services/Trigger/TriggerTimeline.types.d.ts.map +0 -1
- package/build/services/Trigger/TriggerTimeline.types.js +0 -1
- package/build/services/Trigger/TriggerVersion.types.d.ts +0 -109
- package/build/services/Trigger/TriggerVersion.types.d.ts.map +0 -1
- package/build/services/Trigger/TriggerVersion.types.js +0 -1
- package/build/services/Trigger/TriggerVersionService.d.ts +0 -54
- package/build/services/Trigger/TriggerVersionService.d.ts.map +0 -1
- package/build/services/Trigger/TriggerVersionService.js +0 -20
|
@@ -1,3 +1,89 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
+
}
|
|
3
89
|
//# sourceMappingURL=TriggerDispatch.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TriggerDispatch.types.d.ts","sourceRoot":"","sources":["../../../src/services/Webhook/TriggerDispatch.types.ts"],"names":[],"mappings":"AAAA,
|
|
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"}
|
|
@@ -1,2 +1,24 @@
|
|
|
1
|
-
/**
|
|
2
|
-
export
|
|
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
|
+
}
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import type { TriggerDispatchResult } from './TriggerDispatch.types';
|
|
2
|
+
import type { AntHttpClient } from "../../AntHttpClient";
|
|
3
|
+
/** Whether a URL is an ANT trigger dispatch URL, in any of its three forms. */
|
|
4
|
+
export declare function isTriggerDispatchUrl(url: string): boolean;
|
|
5
|
+
export interface TriggerDispatchUrlService {
|
|
6
|
+
dispatchUrl: (url: string, method?: 'GET' | 'POST', body?: Record<string, unknown>) => Promise<TriggerDispatchResult>;
|
|
7
|
+
}
|
|
8
|
+
export declare function createTriggerDispatchUrlService(httpClient: AntHttpClient): TriggerDispatchUrlService;
|
|
3
9
|
//# sourceMappingURL=TriggerDispatchUrl.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TriggerDispatchUrl.d.ts","sourceRoot":"","sources":["../../../src/services/Webhook/TriggerDispatchUrl.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"TriggerDispatchUrl.d.ts","sourceRoot":"","sources":["../../../src/services/Webhook/TriggerDispatchUrl.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AACpE,OAAO,KAAK,EAAE,aAAa,EAAE,4BAAuB;AAMpD,+EAA+E;AAC/E,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAEzD;AAED,MAAM,WAAW,yBAAyB;IAExC,WAAW,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,KAAK,GAAG,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,qBAAqB,CAAC,CAAA;CACtH;AAED,wBAAgB,+BAA+B,CAAC,UAAU,EAAE,aAAa,GAAG,yBAAyB,CAOpG"}
|
|
@@ -1,2 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
// Default (`…/triggers/{id}/dispatch`), versioned (`…/{id}/versions/{v}/dispatch`)
|
|
2
|
+
// and custom-path (`…/triggers/dispatch/{path}`) forms of the dispatch route.
|
|
3
|
+
const DISPATCH_PATH = /\/webhook\/(?:licenses|projects)\/[^/]+\/triggers\/(?:[^/]+\/(?:versions\/[^/]+\/)?dispatch\/?$|dispatch\/.+)/;
|
|
4
|
+
/** Whether a URL is an ANT trigger dispatch URL, in any of its three forms. */
|
|
5
|
+
export function isTriggerDispatchUrl(url) {
|
|
6
|
+
return URL.canParse(url, 'http://base') && DISPATCH_PATH.test(new URL(url, 'http://base').pathname);
|
|
7
|
+
}
|
|
8
|
+
export function createTriggerDispatchUrlService(httpClient) {
|
|
9
|
+
return {
|
|
10
|
+
dispatchUrl: async (url, method = 'GET', body) => {
|
|
11
|
+
const path = apiRelativePath(httpClient, url);
|
|
12
|
+
return method === 'GET' ? httpClient.get(path) : httpClient.post(path, body ?? {});
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
// Only the path is ever requested, through this client's own base, so the token
|
|
17
|
+
// cannot leave this API. The host check stops another environment's URL running here.
|
|
18
|
+
function apiRelativePath(httpClient, url) {
|
|
19
|
+
const api = new URL(httpClient.http.defaults.baseURL ?? '', globalThis.location?.origin);
|
|
20
|
+
const apiPath = api.pathname.replace(/\/$/, '');
|
|
21
|
+
const target = URL.canParse(url, api) ? new URL(url, api) : null;
|
|
22
|
+
if (!target || !isTriggerDispatchUrl(target.href) || !target.pathname.startsWith(`${apiPath}/webhook/`))
|
|
23
|
+
throw new Error('Not an ANT trigger dispatch URL');
|
|
24
|
+
if (target.host !== api.host)
|
|
25
|
+
throw new Error(`This trigger URL belongs to another ANT environment (${target.host})`);
|
|
26
|
+
return target.pathname.slice(apiPath.length) + target.search;
|
|
27
|
+
}
|
|
@@ -1,3 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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;
|
|
3
30
|
//# sourceMappingURL=TriggerDivergence.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TriggerDivergence.d.ts","sourceRoot":"","sources":["../../../src/services/Webhook/TriggerDivergence.ts"],"names":[],"mappings":"AAAA,
|
|
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"}
|
|
@@ -1,2 +1,25 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
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
|
+
}
|
|
@@ -1,3 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
+
/** Days runs are kept before automatic pruning; `null` means pruning is off. */
|
|
18
|
+
retention_days: number | null;
|
|
19
|
+
}
|
|
20
|
+
export interface FailedRunsSummary {
|
|
21
|
+
/** Failed root runs in the window, licence-wide: runs, not triggers. Unfiltered — never recount from `data`. */
|
|
22
|
+
count: number;
|
|
23
|
+
/**
|
|
24
|
+
* The window `count` was measured over, in hours.
|
|
25
|
+
*
|
|
26
|
+
* ⚠️ **Label the badge from this, never from a hardcoded string.** It is echoed
|
|
27
|
+
* precisely so no client has to write "24h" in its copy and keep saying it after
|
|
28
|
+
* the window changes. Today it is 24; that is a server-side constant and may be
|
|
29
|
+
* widened deliberately.
|
|
30
|
+
*/
|
|
31
|
+
window_hours: number;
|
|
32
|
+
}
|
|
3
33
|
//# sourceMappingURL=TriggerFailedRuns.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TriggerFailedRuns.types.d.ts","sourceRoot":"","sources":["../../../src/services/Webhook/TriggerFailedRuns.types.ts"],"names":[],"mappings":"AAAA,
|
|
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;IAC9B,gFAAgF;IAChF,cAAc,EAAE,MAAM,GAAG,IAAI,CAAA;CAC9B;AAED,MAAM,WAAW,iBAAiB;IAChC,gHAAgH;IAChH,KAAK,EAAE,MAAM,CAAA;IAEb;;;;;;;OAOG;IACH,YAAY,EAAE,MAAM,CAAA;CACrB"}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export * from '../Trigger/TriggerFailedRuns.types';
|
|
1
|
+
export {};
|
|
@@ -1,3 +1,201 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import type { DataWrapper } from '../../types';
|
|
2
|
+
import type { ResourceAccessReason } from '../AppService/types/resourceEntitlements';
|
|
3
|
+
import type { TriggerExecutionCaller } from './TriggerCaller.types';
|
|
4
|
+
import type { DatasetRefusalReason } from './TriggerDatasetResponses.types';
|
|
5
|
+
import type { TriggerResourceReason } from './TriggerDispatch.types';
|
|
6
|
+
import type { ExecutionHistoryResponse } from './TriggerFailedRuns.types';
|
|
7
|
+
import type { DatasetRefusalDetail } from './TriggerRefusalDetail.types';
|
|
8
|
+
import type { TriggerStats, TriggerStatsParams } from './TriggerStats.types';
|
|
9
|
+
import type { ExecutionTimelineItem } from './TriggerTimeline.types';
|
|
10
|
+
import type { AntHttpClient } from "../../AntHttpClient";
|
|
11
|
+
export type ExecutionStatus = 'success' | 'error' | 'pending' | 'authorization_required';
|
|
12
|
+
export type OverallExecutionStatus = 'success' | 'partial_success' | 'error';
|
|
13
|
+
export type ExecutionSourceType = 'api_request' | 'test_dispatch' | 'task_triggered' | 'system_event' | 'related_trigger' | 'unknown';
|
|
14
|
+
export interface RelatedTriggersSummary {
|
|
15
|
+
total_related: number;
|
|
16
|
+
successful: number;
|
|
17
|
+
failed: number;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* List view (index) item
|
|
21
|
+
* Root executions by default; may include related when filtered by trigger_id
|
|
22
|
+
*/
|
|
23
|
+
export interface TriggerExecutionHistory {
|
|
24
|
+
id: string;
|
|
25
|
+
trigger_id: string;
|
|
26
|
+
triggerable_type: string;
|
|
27
|
+
triggerable_id: string;
|
|
28
|
+
trigger_name: string;
|
|
29
|
+
trigger_event_name: string | null;
|
|
30
|
+
trigger_event_id: string | null;
|
|
31
|
+
trigger_auth_type: string | null;
|
|
32
|
+
trigger_http_method: string | null;
|
|
33
|
+
trigger_when: string | null;
|
|
34
|
+
execution_duration_ms: number | null;
|
|
35
|
+
source_type: ExecutionSourceType;
|
|
36
|
+
source_details: string | null;
|
|
37
|
+
/** Who started the run (AAD-1123). `null` on runs recorded before callers were — fall back to `source_type`. */
|
|
38
|
+
caller: TriggerExecutionCaller | null;
|
|
39
|
+
status: ExecutionStatus;
|
|
40
|
+
error_message: string | null;
|
|
41
|
+
payload: any;
|
|
42
|
+
response: any;
|
|
43
|
+
executed_at: string;
|
|
44
|
+
created_at: string;
|
|
45
|
+
updated_at: string;
|
|
46
|
+
event_display_name: string | null;
|
|
47
|
+
has_current_event: boolean;
|
|
48
|
+
has_event_name_changed: boolean;
|
|
49
|
+
has_trigger_name_changed: boolean;
|
|
50
|
+
related_triggers_summary: RelatedTriggersSummary;
|
|
51
|
+
overall_status: OverallExecutionStatus;
|
|
52
|
+
total_execution_duration_ms: number;
|
|
53
|
+
/**
|
|
54
|
+
* Read as a PAIR with {@link trigger_version_label}. Three cases, and the label
|
|
55
|
+
* alone flattens the last two:
|
|
56
|
+
*
|
|
57
|
+
* | `trigger_version_id` | `trigger_version_label` | Means |
|
|
58
|
+
* | -------------------- | ----------------------- | ---------------------------- |
|
|
59
|
+
* | `null` | `null` | the trigger's draft ran |
|
|
60
|
+
* | set | set | that version ran |
|
|
61
|
+
* | set | `null` | that version has been DELETED |
|
|
62
|
+
*/
|
|
63
|
+
trigger_version_id: string | null;
|
|
64
|
+
/**
|
|
65
|
+
* The publisher's own label, e.g. `"1.0.0"` — NOT an id.
|
|
66
|
+
*
|
|
67
|
+
* It exists because an id on its own is something a client cannot resolve: every
|
|
68
|
+
* per-version lookup needs the trigger too. Null when the run used the draft, and
|
|
69
|
+
* also null when the version has since been deleted; see the table above.
|
|
70
|
+
*/
|
|
71
|
+
trigger_version_label: string | null;
|
|
72
|
+
/**
|
|
73
|
+
* The machine-readable code when this run was REFUSED, rather than merely failed.
|
|
74
|
+
*
|
|
75
|
+
* Null for a success AND null for an ordinary exception — a refusal is a
|
|
76
|
+
* deliberate, categorised "no", so an uncaught error has no code. When it is set,
|
|
77
|
+
* `response.dataset_refused` / `response.resource_access_denied` tell you which of
|
|
78
|
+
* the two vocabularies applies.
|
|
79
|
+
*
|
|
80
|
+
* ⚠️ `snapshot_limits_misconfigured` is an OPERATOR fault, not a publisher one —
|
|
81
|
+
* the deployment's ceilings are unusable. It deliberately reads differently from
|
|
82
|
+
* "your dataset is too big", and the HTTP status alone cannot carry that
|
|
83
|
+
* difference. Branch on this field, never on the status.
|
|
84
|
+
*/
|
|
85
|
+
refusal_reason: DatasetRefusalReason | ResourceAccessReason | TriggerResourceReason | null;
|
|
86
|
+
/**
|
|
87
|
+
* The figures behind a CEILING refusal, or null.
|
|
88
|
+
*
|
|
89
|
+
* ⚠️ **Null is the common case.** Only a ceiling produces one — `limit` and
|
|
90
|
+
* `unit` have to mean a ceiling for the object to mean anything, so a shape or
|
|
91
|
+
* type mismatch deliberately reports null rather than inventing a limit nothing
|
|
92
|
+
* declared. Those refusals carry their specifics in `error_message`.
|
|
93
|
+
*
|
|
94
|
+
* Publisher-only: it is never part of what the caller received, so do not look
|
|
95
|
+
* for it in `response`.
|
|
96
|
+
*
|
|
97
|
+
* ⚠️ `actual` inside it is optional — see {@link DatasetRefusalDetail.actual}
|
|
98
|
+
* before defaulting it to anything.
|
|
99
|
+
*/
|
|
100
|
+
refusal_detail: DatasetRefusalDetail | null;
|
|
101
|
+
/**
|
|
102
|
+
* The STORED copy of the response was shrunk to save database space.
|
|
103
|
+
*
|
|
104
|
+
* A fact about this history row only — **the caller received everything.** Do not
|
|
105
|
+
* render this as "some rows were left out"; that is {@link dataset_truncated}.
|
|
106
|
+
*/
|
|
107
|
+
stored_response_truncated: boolean;
|
|
108
|
+
/**
|
|
109
|
+
* A dataset action clamped its rows to the declared limit.
|
|
110
|
+
*
|
|
111
|
+
* This is what a UI means by "truncated": the run SUCCEEDED and returned fewer
|
|
112
|
+
* rows than the source holds. Not an error, and not a refusal — render it on a
|
|
113
|
+
* successful run.
|
|
114
|
+
*
|
|
115
|
+
* ⚠️ `null` means the question does not apply (the run was not a dataset action),
|
|
116
|
+
* which is NOT `false`. `?? false` would claim "no rows were left out" about a
|
|
117
|
+
* response that has no rows.
|
|
118
|
+
*
|
|
119
|
+
* These two can DISAGREE on the same row — a clamped dataset whose stored copy
|
|
120
|
+
* fitted reads `dataset_truncated: true, stored_response_truncated: false` — which
|
|
121
|
+
* is why they are two fields and not one.
|
|
122
|
+
*/
|
|
123
|
+
dataset_truncated: boolean | null;
|
|
124
|
+
}
|
|
125
|
+
export interface TriggerExecutionHistoryDetail {
|
|
126
|
+
id: string;
|
|
127
|
+
executed_at: string;
|
|
128
|
+
source_type: ExecutionSourceType;
|
|
129
|
+
source_details: string | null;
|
|
130
|
+
/** Same as on the index item. */
|
|
131
|
+
caller: TriggerExecutionCaller | null;
|
|
132
|
+
payload: any;
|
|
133
|
+
execution_context: 'main_trigger' | 'related_trigger';
|
|
134
|
+
overall_status: OverallExecutionStatus;
|
|
135
|
+
total_execution_duration_ms: number;
|
|
136
|
+
total_duration_ms: number;
|
|
137
|
+
total_executions: number;
|
|
138
|
+
has_current_event: boolean;
|
|
139
|
+
has_event_name_changed: boolean;
|
|
140
|
+
has_trigger_name_changed: boolean;
|
|
141
|
+
execution_timeline: ExecutionTimelineItem[];
|
|
142
|
+
/** Same meanings as on the index item — see {@link TriggerExecutionHistory}. */
|
|
143
|
+
trigger_version_id: string | null;
|
|
144
|
+
trigger_version_label: string | null;
|
|
145
|
+
refusal_reason: DatasetRefusalReason | ResourceAccessReason | TriggerResourceReason | null;
|
|
146
|
+
refusal_detail: DatasetRefusalDetail | null;
|
|
147
|
+
stored_response_truncated: boolean;
|
|
148
|
+
dataset_truncated: boolean | null;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Index filters
|
|
152
|
+
*/
|
|
153
|
+
export interface ExecutionHistoryFilters {
|
|
154
|
+
search?: string;
|
|
155
|
+
trigger_id?: string;
|
|
156
|
+
/** The run's OVERALL status — the backend accepts `success`, `error`, `partial_success`. */
|
|
157
|
+
status?: OverallExecutionStatus;
|
|
158
|
+
from_date?: string;
|
|
159
|
+
to_date?: string;
|
|
160
|
+
per_page?: number;
|
|
161
|
+
page?: number;
|
|
162
|
+
filters?: any;
|
|
163
|
+
}
|
|
164
|
+
export interface TriggerHistoryService {
|
|
165
|
+
/**
|
|
166
|
+
* Fetch all execution history records with optional filters
|
|
167
|
+
* Returns only root executions with summary information about related triggers
|
|
168
|
+
*/
|
|
169
|
+
fetchExecutionHistory: (triggerableType: string, triggerableId: string, filters?: ExecutionHistoryFilters) => Promise<ExecutionHistoryResponse>;
|
|
170
|
+
/**
|
|
171
|
+
* Fetch a specific execution history record by ID with detailed execution chain
|
|
172
|
+
* Returns structure matching test dispatch format with triggersBefore, triggersAfter, mainTrigger
|
|
173
|
+
*/
|
|
174
|
+
fetchExecutionHistoryDetail: (triggerableType: string, triggerableId: string, executionHistoryId: string) => Promise<DataWrapper<TriggerExecutionHistoryDetail>>;
|
|
175
|
+
/**
|
|
176
|
+
* Fetch execution history records for a specific trigger
|
|
177
|
+
* Returns execution history with full chain structure for each record
|
|
178
|
+
*/
|
|
179
|
+
fetchTriggerExecutionHistory: (triggerableType: string, triggerableId: string, triggerId: string, filters?: Omit<ExecutionHistoryFilters, 'trigger_id'>) => Promise<ExecutionHistoryResponse>;
|
|
180
|
+
/**
|
|
181
|
+
* Clear all execution history for a specific context (license/project)
|
|
182
|
+
*/
|
|
183
|
+
clearAllExecutionHistory: (triggerableType: string, triggerableId: string) => Promise<DataWrapper<{
|
|
184
|
+
message: string;
|
|
185
|
+
deleted_count: number;
|
|
186
|
+
}>>;
|
|
187
|
+
/**
|
|
188
|
+
* Clear execution history for a specific trigger
|
|
189
|
+
*/
|
|
190
|
+
clearTriggerExecutionHistory: (triggerableType: string, triggerableId: string, triggerId: string) => Promise<DataWrapper<{
|
|
191
|
+
message: string;
|
|
192
|
+
deleted_count: number;
|
|
193
|
+
}>>;
|
|
194
|
+
/** Run stats for the trigger Overview (AAD-1123); same permission as the run list. */
|
|
195
|
+
fetchTriggerStats: (triggerableType: string, triggerableId: string, triggerId: string, params?: TriggerStatsParams) => Promise<DataWrapper<TriggerStats>>;
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Creates and returns an implementation of the TriggerHistoryService
|
|
199
|
+
*/
|
|
200
|
+
export declare function createTriggerHistoryService(httpClient: AntHttpClient): TriggerHistoryService;
|
|
3
201
|
//# sourceMappingURL=TriggerHistoryService.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TriggerHistoryService.d.ts","sourceRoot":"","sources":["../../../src/services/Webhook/TriggerHistoryService.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"TriggerHistoryService.d.ts","sourceRoot":"","sources":["../../../src/services/Webhook/TriggerHistoryService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAC9C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAA;AACpF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAA;AACnE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAA;AAC3E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AACpE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAA;AACzE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAA;AACxE,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAC5E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AACpE,OAAO,KAAK,EAAE,aAAa,EAAE,4BAAuB;AAUpD,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,wB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AO,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;IAErK,sFAAsF;IACtF,iBAAiB,EAAE,CAAC,eAAe,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,kBAAkB,KAAK,OAAO,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC,CAAA;CAC1J;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,UAAU,EAAE,aAAa,GAAG,qBAAqB,CAoB5F"}
|
|
@@ -1,2 +1,13 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Creates and returns an implementation of the TriggerHistoryService
|
|
3
|
+
*/
|
|
4
|
+
export function createTriggerHistoryService(httpClient) {
|
|
5
|
+
return {
|
|
6
|
+
fetchExecutionHistory: (triggerableType, triggerableId, filters = {}) => httpClient.get(`/webhook/${triggerableType}/${triggerableId}/execution-history`, { params: filters }),
|
|
7
|
+
fetchExecutionHistoryDetail: (triggerableType, triggerableId, executionHistoryId) => httpClient.get(`/webhook/${triggerableType}/${triggerableId}/execution-history/${executionHistoryId}`),
|
|
8
|
+
fetchTriggerExecutionHistory: (triggerableType, triggerableId, triggerId, filters = {}) => httpClient.get(`/webhook/${triggerableType}/${triggerableId}/triggers/${triggerId}/execution-history`, { params: filters }),
|
|
9
|
+
clearAllExecutionHistory: (triggerableType, triggerableId) => httpClient.delete(`/webhook/${triggerableType}/${triggerableId}/execution-history`),
|
|
10
|
+
clearTriggerExecutionHistory: (triggerableType, triggerableId, triggerId) => httpClient.delete(`/webhook/${triggerableType}/${triggerableId}/triggers/${triggerId}/execution-history`),
|
|
11
|
+
fetchTriggerStats: (triggerableType, triggerableId, triggerId, params = {}) => httpClient.get(`/webhook/${triggerableType}/${triggerableId}/triggers/${triggerId}/stats`, { params }),
|
|
12
|
+
};
|
|
13
|
+
}
|
|
@@ -1,3 +1,80 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
+
}
|
|
3
80
|
//# sourceMappingURL=TriggerLastRun.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TriggerLastRun.types.d.ts","sourceRoot":"","sources":["../../../src/services/Webhook/TriggerLastRun.types.ts"],"names":[],"mappings":"AAAA,
|
|
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"}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export * from '../Trigger/TriggerLastRun.types';
|
|
1
|
+
export {};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import type { Trigger, TriggerableType } from './TriggerService';
|
|
2
|
+
/** Enough of a trigger to address it: its id and whichever licence or project owns it. */
|
|
3
|
+
export type TriggerRef = Pick<Trigger, 'id' | 'triggerable_type' | 'triggerable_id'>;
|
|
4
|
+
export declare function triggerableTypeOf(trigger: Pick<Trigger, 'triggerable_type'>): TriggerableType;
|
|
3
5
|
//# sourceMappingURL=TriggerOwner.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TriggerOwner.d.ts","sourceRoot":"","sources":["../../../src/services/Webhook/TriggerOwner.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"TriggerOwner.d.ts","sourceRoot":"","sources":["../../../src/services/Webhook/TriggerOwner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAEhE,0FAA0F;AAC1F,MAAM,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,EAAE,IAAI,GAAG,kBAAkB,GAAG,gBAAgB,CAAC,CAAA;AAIpF,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,kBAAkB,CAAC,GAAG,eAAe,CAG7F"}
|