@antcde/connect-ts 0.4.34 → 0.4.35-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.
- package/build/AntConnect.d.ts +2 -15
- package/build/AntConnect.d.ts.map +1 -1
- package/build/AntConnect.js +2 -14
- 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 +8 -4
- 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 +2 -4
- 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 +14 -1
- 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 +4 -0
- 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/Trigger/ConfigService.d.ts +51 -0
- package/build/services/Trigger/ConfigService.d.ts.map +1 -0
- package/build/services/Trigger/ConfigService.js +5 -0
- package/build/services/Trigger/EventService.d.ts +146 -0
- package/build/services/Trigger/EventService.d.ts.map +1 -0
- package/build/services/Trigger/EventService.js +6 -0
- package/build/services/Trigger/TriggerCaller.types.d.ts +18 -0
- package/build/services/Trigger/TriggerCaller.types.d.ts.map +1 -0
- package/build/services/Trigger/TriggerCaller.types.js +1 -0
- package/build/services/Trigger/TriggerDataset.types.d.ts +168 -0
- package/build/services/Trigger/TriggerDataset.types.d.ts.map +1 -0
- package/build/services/Trigger/TriggerDataset.types.js +51 -0
- package/build/services/Trigger/TriggerDatasetColumns.d.ts +74 -0
- package/build/services/Trigger/TriggerDatasetColumns.d.ts.map +1 -0
- package/build/services/Trigger/TriggerDatasetColumns.js +118 -0
- package/build/services/Trigger/TriggerDatasetCsv.types.d.ts +7 -0
- package/build/services/Trigger/TriggerDatasetCsv.types.d.ts.map +1 -0
- package/build/services/Trigger/TriggerDatasetCsv.types.js +1 -0
- package/build/services/Trigger/TriggerDatasetResponses.types.d.ts +176 -0
- package/build/services/Trigger/TriggerDatasetResponses.types.d.ts.map +1 -0
- package/build/services/Trigger/TriggerDatasetResponses.types.js +99 -0
- package/build/services/Trigger/TriggerDatasetSourceService.d.ts +182 -0
- package/build/services/Trigger/TriggerDatasetSourceService.d.ts.map +1 -0
- package/build/services/Trigger/TriggerDatasetSourceService.js +23 -0
- package/build/services/Trigger/TriggerDispatch.types.d.ts +89 -0
- package/build/services/Trigger/TriggerDispatch.types.d.ts.map +1 -0
- package/build/services/Trigger/TriggerDispatch.types.js +24 -0
- package/build/services/Trigger/TriggerDispatchUrl.d.ts +9 -0
- package/build/services/Trigger/TriggerDispatchUrl.d.ts.map +1 -0
- package/build/services/Trigger/TriggerDispatchUrl.js +27 -0
- package/build/services/Trigger/TriggerDivergence.d.ts +30 -0
- package/build/services/Trigger/TriggerDivergence.d.ts.map +1 -0
- package/build/services/Trigger/TriggerDivergence.js +25 -0
- package/build/services/Trigger/TriggerFailedRuns.types.d.ts +33 -0
- package/build/services/Trigger/TriggerFailedRuns.types.d.ts.map +1 -0
- package/build/services/Trigger/TriggerFailedRuns.types.js +1 -0
- package/build/services/Trigger/TriggerHistoryService.d.ts +201 -0
- package/build/services/Trigger/TriggerHistoryService.d.ts.map +1 -0
- package/build/services/Trigger/TriggerHistoryService.js +13 -0
- package/build/services/Trigger/TriggerLastRun.types.d.ts +80 -0
- package/build/services/Trigger/TriggerLastRun.types.d.ts.map +1 -0
- package/build/services/Trigger/TriggerLastRun.types.js +1 -0
- package/build/services/Trigger/TriggerOwner.d.ts +5 -0
- package/build/services/Trigger/TriggerOwner.d.ts.map +1 -0
- package/build/services/Trigger/TriggerOwner.js +6 -0
- package/build/services/Trigger/TriggerRefresh.types.d.ts +15 -0
- package/build/services/Trigger/TriggerRefresh.types.d.ts.map +1 -0
- package/build/services/Trigger/TriggerRefresh.types.js +1 -0
- package/build/services/Trigger/TriggerRefusalDetail.types.d.ts +63 -0
- package/build/services/Trigger/TriggerRefusalDetail.types.d.ts.map +1 -0
- package/build/services/Trigger/TriggerRefusalDetail.types.js +12 -0
- package/build/services/Trigger/TriggerRequest.types.d.ts +58 -0
- package/build/services/Trigger/TriggerRequest.types.d.ts.map +1 -0
- package/build/services/Trigger/TriggerRequest.types.js +1 -0
- package/build/services/Trigger/TriggerSearch.types.d.ts +39 -0
- package/build/services/Trigger/TriggerSearch.types.d.ts.map +1 -0
- package/build/services/Trigger/TriggerSearch.types.js +1 -0
- package/build/services/Trigger/TriggerSecretService.d.ts +88 -0
- package/build/services/Trigger/TriggerSecretService.d.ts.map +1 -0
- package/build/services/Trigger/TriggerSecretService.js +9 -0
- package/build/services/Trigger/TriggerService.d.ts +191 -0
- package/build/services/Trigger/TriggerService.d.ts.map +1 -0
- package/build/services/Trigger/TriggerService.js +14 -0
- package/build/services/Trigger/TriggerServices.d.ts +33 -0
- package/build/services/Trigger/TriggerServices.d.ts.map +1 -0
- package/build/services/Trigger/TriggerServices.js +32 -0
- package/build/services/Trigger/TriggerStats.types.d.ts +46 -0
- package/build/services/Trigger/TriggerStats.types.d.ts.map +1 -0
- package/build/services/Trigger/TriggerStats.types.js +1 -0
- package/build/services/Trigger/TriggerTimeline.types.d.ts +42 -0
- package/build/services/Trigger/TriggerTimeline.types.d.ts.map +1 -0
- package/build/services/Trigger/TriggerTimeline.types.js +1 -0
- package/build/services/Trigger/TriggerVersion.types.d.ts +109 -0
- package/build/services/Trigger/TriggerVersion.types.d.ts.map +1 -0
- package/build/services/Trigger/TriggerVersion.types.js +1 -0
- package/build/services/Trigger/TriggerVersionService.d.ts +54 -0
- package/build/services/Trigger/TriggerVersionService.d.ts.map +1 -0
- package/build/services/Trigger/TriggerVersionService.js +20 -0
- package/build/services/Webhook/ConfigService.d.ts +2 -50
- package/build/services/Webhook/ConfigService.d.ts.map +1 -1
- package/build/services/Webhook/ConfigService.js +2 -5
- package/build/services/Webhook/EventService.d.ts +2 -145
- package/build/services/Webhook/EventService.d.ts.map +1 -1
- package/build/services/Webhook/EventService.js +2 -6
- package/build/services/Webhook/TriggerCaller.types.d.ts +2 -17
- package/build/services/Webhook/TriggerCaller.types.d.ts.map +1 -1
- package/build/services/Webhook/TriggerCaller.types.js +2 -1
- package/build/services/Webhook/TriggerDataset.types.d.ts +2 -167
- package/build/services/Webhook/TriggerDataset.types.d.ts.map +1 -1
- package/build/services/Webhook/TriggerDataset.types.js +2 -51
- package/build/services/Webhook/TriggerDatasetColumns.d.ts +2 -73
- package/build/services/Webhook/TriggerDatasetColumns.d.ts.map +1 -1
- package/build/services/Webhook/TriggerDatasetColumns.js +2 -118
- package/build/services/Webhook/TriggerDatasetCsv.types.d.ts +2 -6
- package/build/services/Webhook/TriggerDatasetCsv.types.d.ts.map +1 -1
- package/build/services/Webhook/TriggerDatasetCsv.types.js +2 -1
- package/build/services/Webhook/TriggerDatasetResponses.types.d.ts +2 -175
- package/build/services/Webhook/TriggerDatasetResponses.types.d.ts.map +1 -1
- package/build/services/Webhook/TriggerDatasetResponses.types.js +2 -99
- package/build/services/Webhook/TriggerDatasetSourceService.d.ts +2 -181
- package/build/services/Webhook/TriggerDatasetSourceService.d.ts.map +1 -1
- package/build/services/Webhook/TriggerDatasetSourceService.js +2 -23
- package/build/services/Webhook/TriggerDispatch.types.d.ts +2 -88
- package/build/services/Webhook/TriggerDispatch.types.d.ts.map +1 -1
- package/build/services/Webhook/TriggerDispatch.types.js +2 -24
- package/build/services/Webhook/TriggerDispatchUrl.d.ts +2 -8
- package/build/services/Webhook/TriggerDispatchUrl.d.ts.map +1 -1
- package/build/services/Webhook/TriggerDispatchUrl.js +2 -27
- package/build/services/Webhook/TriggerDivergence.d.ts +2 -29
- package/build/services/Webhook/TriggerDivergence.d.ts.map +1 -1
- package/build/services/Webhook/TriggerDivergence.js +2 -25
- package/build/services/Webhook/TriggerFailedRuns.types.d.ts +2 -32
- package/build/services/Webhook/TriggerFailedRuns.types.d.ts.map +1 -1
- package/build/services/Webhook/TriggerFailedRuns.types.js +2 -1
- package/build/services/Webhook/TriggerHistoryService.d.ts +2 -200
- package/build/services/Webhook/TriggerHistoryService.d.ts.map +1 -1
- package/build/services/Webhook/TriggerHistoryService.js +2 -13
- package/build/services/Webhook/TriggerLastRun.types.d.ts +2 -79
- package/build/services/Webhook/TriggerLastRun.types.d.ts.map +1 -1
- package/build/services/Webhook/TriggerLastRun.types.js +2 -1
- package/build/services/Webhook/TriggerOwner.d.ts +2 -4
- package/build/services/Webhook/TriggerOwner.d.ts.map +1 -1
- package/build/services/Webhook/TriggerOwner.js +2 -6
- package/build/services/Webhook/TriggerRefresh.types.d.ts +2 -14
- package/build/services/Webhook/TriggerRefresh.types.d.ts.map +1 -1
- package/build/services/Webhook/TriggerRefresh.types.js +2 -1
- package/build/services/Webhook/TriggerRefusalDetail.types.d.ts +2 -62
- package/build/services/Webhook/TriggerRefusalDetail.types.d.ts.map +1 -1
- package/build/services/Webhook/TriggerRefusalDetail.types.js +2 -12
- package/build/services/Webhook/TriggerRequest.types.d.ts +2 -57
- package/build/services/Webhook/TriggerRequest.types.d.ts.map +1 -1
- package/build/services/Webhook/TriggerRequest.types.js +2 -1
- package/build/services/Webhook/TriggerSearch.types.d.ts +2 -38
- package/build/services/Webhook/TriggerSearch.types.d.ts.map +1 -1
- package/build/services/Webhook/TriggerSearch.types.js +2 -1
- package/build/services/Webhook/TriggerSecretService.d.ts +2 -87
- package/build/services/Webhook/TriggerSecretService.d.ts.map +1 -1
- package/build/services/Webhook/TriggerSecretService.js +2 -9
- package/build/services/Webhook/TriggerService.d.ts +2 -190
- package/build/services/Webhook/TriggerService.d.ts.map +1 -1
- package/build/services/Webhook/TriggerService.js +2 -14
- package/build/services/Webhook/TriggerStats.types.d.ts +2 -45
- package/build/services/Webhook/TriggerStats.types.d.ts.map +1 -1
- package/build/services/Webhook/TriggerStats.types.js +2 -1
- package/build/services/Webhook/TriggerTimeline.types.d.ts +2 -41
- package/build/services/Webhook/TriggerTimeline.types.d.ts.map +1 -1
- package/build/services/Webhook/TriggerTimeline.types.js +2 -1
- package/build/services/Webhook/TriggerVersion.types.d.ts +2 -108
- package/build/services/Webhook/TriggerVersion.types.d.ts.map +1 -1
- package/build/services/Webhook/TriggerVersion.types.js +2 -1
- package/build/services/Webhook/TriggerVersionService.d.ts +2 -53
- package/build/services/Webhook/TriggerVersionService.d.ts.map +1 -1
- package/build/services/Webhook/TriggerVersionService.js +2 -20
- package/package.json +1 -1
|
@@ -1,99 +1,2 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* Split from `TriggerDataset.types.ts`, which carries the frozen publisher config
|
|
5
|
-
* a caller cannot repoint. This file is the wire side: what comes back, and how a
|
|
6
|
-
* refusal is told apart from an empty result.
|
|
7
|
-
*/
|
|
8
|
-
/**
|
|
9
|
-
* Every refusal reason, as a runtime lookup.
|
|
10
|
-
*
|
|
11
|
-
* Annotated `Record<DatasetRefusalReason, true>` rather than inferred, so the
|
|
12
|
-
* compiler rejects both a missing key and a stray one: adding a member to
|
|
13
|
-
* {@link DatasetRefusalReason} without adding it here fails to build. That is the
|
|
14
|
-
* point — a reason nobody mapped must not fail silently.
|
|
15
|
-
*/
|
|
16
|
-
export const DATASET_REFUSAL_REASONS = {
|
|
17
|
-
invalid_payload_config: true,
|
|
18
|
-
byte_limit_exceeded: true,
|
|
19
|
-
source_table_missing: true,
|
|
20
|
-
upload_source_missing: true,
|
|
21
|
-
unsupported_upload_format: true,
|
|
22
|
-
malformed_upload: true,
|
|
23
|
-
row_shape_mismatch: true,
|
|
24
|
-
value_type_mismatch: true,
|
|
25
|
-
unknown_source_column: true,
|
|
26
|
-
unpublishable_column_type: true,
|
|
27
|
-
snapshot_limits_misconfigured: true,
|
|
28
|
-
internal_error: true,
|
|
29
|
-
};
|
|
30
|
-
/**
|
|
31
|
-
* Type guard: is this a refused dataset dispatch?
|
|
32
|
-
*
|
|
33
|
-
* Accepts either the dispatch envelope or the inner body, so it can be pointed
|
|
34
|
-
* straight at `error.response?.data` without unwrapping first.
|
|
35
|
-
*
|
|
36
|
-
* ⚠️ **This is a deliberately loose narrow, and the looseness is load-bearing.**
|
|
37
|
-
* It accepts any string `reason` rather than only the eleven known ones, so that a
|
|
38
|
-
* reason a newer backend adds is still recognised AS a refusal instead of falling
|
|
39
|
-
* through to "empty result" — which is the one failure mode this whole contract
|
|
40
|
-
* exists to prevent.
|
|
41
|
-
*
|
|
42
|
-
* The cost is that the narrowed type is optimistic: `reason` may be a string
|
|
43
|
-
* outside {@link DatasetRefusalReason}, and `message` may be absent. So:
|
|
44
|
-
*
|
|
45
|
-
* - Give every `switch (reason)` a `default:` arm, and map unknown reasons to a
|
|
46
|
-
* generic sentence rather than letting them fall into a specific one.
|
|
47
|
-
* - Do NOT trust {@link isOperatorFault} alone to classify an unrecognised
|
|
48
|
-
* reason — it answers `false`, which reads as "the publisher's fault". Check
|
|
49
|
-
* membership with {@link DATASET_REFUSAL_REASONS} first when the distinction
|
|
50
|
-
* drives what you tell someone.
|
|
51
|
-
*/
|
|
52
|
-
export function isDatasetRefused(result) {
|
|
53
|
-
if (typeof result !== 'object' || result === null)
|
|
54
|
-
return false;
|
|
55
|
-
const envelope = result;
|
|
56
|
-
const body = (typeof envelope.response === 'object' && envelope.response !== null)
|
|
57
|
-
? envelope.response
|
|
58
|
-
: envelope;
|
|
59
|
-
return body.dataset_refused === true && typeof body.reason === 'string';
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Narrow a stored or received response to {@link DatasetRows}.
|
|
63
|
-
*
|
|
64
|
-
* ⚠️ **DELIBERATELY DOES NOT REQUIRE `rows` TO BE INTACT.** A run recorded in the
|
|
65
|
-
* execution history has `stored_response_truncated: true` for essentially every
|
|
66
|
-
* dataset action — the stored copy of `rows` is elided to save database space, and
|
|
67
|
-
* arrives with a `"... (2 more items truncated)"` string sitting in the array. The
|
|
68
|
-
* caller still received everything.
|
|
69
|
-
*
|
|
70
|
-
* `row_count` is a SCALAR recorded beside the array and is never elided, so it
|
|
71
|
-
* stays true across that shrinking. Reading `rows.length` instead would report a
|
|
72
|
-
* five-row answer as two — which is why this guard checks the count and not the
|
|
73
|
-
* array, and why any caller should read `row_count` rather than measuring `rows`.
|
|
74
|
-
*/
|
|
75
|
-
export function isDatasetRows(response) {
|
|
76
|
-
if (typeof response !== 'object' || response === null)
|
|
77
|
-
return false;
|
|
78
|
-
const body = response;
|
|
79
|
-
return typeof body.row_count === 'number' && Array.isArray(body.keys);
|
|
80
|
-
}
|
|
81
|
-
/** Is this a reason this build of the SDK knows about? */
|
|
82
|
-
export function isKnownRefusalReason(reason) {
|
|
83
|
-
// `hasOwnProperty.call`, not `in` and not `Object.hasOwn`: `in` accepts every
|
|
84
|
-
// inherited key (`'constructor'` read as a known reason), and this package's TS
|
|
85
|
-
// lib predates `Object.hasOwn` — which `tsc -p` tolerates and the Python schema
|
|
86
|
-
// generator does not.
|
|
87
|
-
// eslint-disable-next-line e18e/prefer-object-has-own -- see above
|
|
88
|
-
return Object.prototype.hasOwnProperty.call(DATASET_REFUSAL_REASONS, reason);
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Is this reason the operator's fault rather than the publisher's?
|
|
92
|
-
*
|
|
93
|
-
* ⚠️ Answers `false` for an unrecognised reason, which reads as "the publisher's
|
|
94
|
-
* fault". Guard with {@link isKnownRefusalReason} when that distinction is what
|
|
95
|
-
* you are about to tell someone.
|
|
96
|
-
*/
|
|
97
|
-
export function isOperatorFault(reason) {
|
|
98
|
-
return reason === 'snapshot_limits_misconfigured' || reason === 'internal_error';
|
|
99
|
-
}
|
|
1
|
+
/** @deprecated Moved to `services/Trigger/TriggerDatasetResponses.types`. Remove in the next major release. */
|
|
2
|
+
export * from '../Trigger/TriggerDatasetResponses.types';
|
|
@@ -1,182 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import type { AntHttpClient } from "../../AntHttpClient";
|
|
4
|
-
/**
|
|
5
|
-
* Reading a candidate dataset source before anything is declared.
|
|
6
|
-
*
|
|
7
|
-
* Configuring a file-sourced dataset means declaring which columns it publishes and
|
|
8
|
-
* what type each one is. Nothing exposed a DMS file's headers, so the alternative was
|
|
9
|
-
* typing them from memory — which turns `row_shape_mismatch` and `value_type_mismatch`
|
|
10
|
-
* from edge cases into the expected outcome on a file the platform could simply read.
|
|
11
|
-
*
|
|
12
|
-
* The backend parses the file with the SAME reader the dispatch uses, so a proposal
|
|
13
|
-
* accepted unchanged cannot then be refused by the action.
|
|
14
|
-
*/
|
|
15
|
-
/** One column the backend proposes, before the publisher confirms it. */
|
|
16
|
-
export interface DatasetFileColumnProposal {
|
|
17
|
-
/** The header exactly as it appears in the file. */
|
|
18
|
-
source_key: string;
|
|
19
|
-
/** A suggested published key, already made safe (`"unit price"` -> `"unit_price"`). */
|
|
20
|
-
key: string;
|
|
21
|
-
/** The raw header again, for display. */
|
|
22
|
-
label: string;
|
|
23
|
-
/**
|
|
24
|
-
* A PROPOSAL, never a schema. The publisher confirms or overrides it and the
|
|
25
|
-
* version stores their answer — which is what keeps a file's schema declared
|
|
26
|
-
* rather than inferred.
|
|
27
|
-
*
|
|
28
|
-
* Every ambiguity resolves to text on purpose. A text column that could have been
|
|
29
|
-
* an integer costs one click; an integer that should have been text turns `01223`
|
|
30
|
-
* into `1223` and silently corrupts a postcode in a dataset somebody paid for.
|
|
31
|
-
*/
|
|
32
|
-
proposed_type: DatasetColumnType;
|
|
33
|
-
/**
|
|
34
|
-
* How many sampled rows were empty for this column. Surfaced so a publisher can
|
|
35
|
-
* see WHY a column came back as text — usually one stray value rather than a
|
|
36
|
-
* genuinely mixed column.
|
|
37
|
-
*/
|
|
38
|
-
null_count: number;
|
|
39
|
-
/** Advisory only; authoritative nullability is measured from the served data. */
|
|
40
|
-
nullable: boolean;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Which file a proposal is about — enough to LABEL a trigger that is already
|
|
44
|
-
* configured.
|
|
45
|
-
*
|
|
46
|
-
* A saved `ReturnFileDataEvent` carries only a `dms_file_id`, and every per-file DMS
|
|
47
|
-
* endpoint is addressed by the file's TOKEN rather than its id — so there is no
|
|
48
|
-
* client-side way to turn that id into a name. Without this, a configured trigger can
|
|
49
|
-
* only render the raw uuid.
|
|
50
|
-
*
|
|
51
|
-
* Not the same shape as `DatasetRawFile`'s `file` (in `TriggerDatasetResponses.types`),
|
|
52
|
-
* and the difference is
|
|
53
|
-
* deliberate rather than an oversight: that one answers a BUYER dispatching a trigger
|
|
54
|
-
* and withholds every internal id, whereas this answers a PUBLISHER who already
|
|
55
|
-
* passed the DMS view check on this exact file and supplied its id to get here.
|
|
56
|
-
*/
|
|
57
|
-
export interface DatasetSourceFile {
|
|
58
|
-
id: string;
|
|
59
|
-
/**
|
|
60
|
-
* ⚠️ **The BASE NAME — the extension is NOT included.**
|
|
61
|
-
*
|
|
62
|
-
* Mirrors the `DmsFile` columns and {@link DatasetRawFile}'s `file`, which split
|
|
63
|
-
* them the same way. To display the filename, join them yourself and guard the
|
|
64
|
-
* empty case, because a file with no extension yields a trailing dot:
|
|
65
|
-
*
|
|
66
|
-
* ```ts
|
|
67
|
-
* const label = file.extension ? `${file.name}.${file.extension}` : file.name
|
|
68
|
-
* ```
|
|
69
|
-
*/
|
|
70
|
-
name: string;
|
|
71
|
-
/** No leading dot. `''` for a file with no extension. */
|
|
72
|
-
extension: string;
|
|
73
|
-
/** `''` when the DMS recorded none. */
|
|
74
|
-
mime: string;
|
|
75
|
-
/** Bytes. Compare against the deployment's byte ceiling. */
|
|
76
|
-
size: number;
|
|
77
|
-
/** The immediate parent folder, or `null` for a file at the DMS root. */
|
|
78
|
-
folder_id: string | null;
|
|
79
|
-
/**
|
|
80
|
-
* Ancestor folder NAMES, outermost first — `[]` at the DMS root.
|
|
81
|
-
*
|
|
82
|
-
* Display only: these are names rather than ids, and the chain is not
|
|
83
|
-
* re-authorised folder by folder. Use `folder_id` if you need to navigate.
|
|
84
|
-
*/
|
|
85
|
-
folder_path: string[];
|
|
86
|
-
/**
|
|
87
|
-
* ⚠️ **`null` means the file is LICENCE-scoped**, and this is what selects which
|
|
88
|
-
* DMS routes address it: licence-scoped files go through the licence DMS endpoints,
|
|
89
|
-
* project-scoped ones through the project endpoints. Picking the wrong family
|
|
90
|
-
* yields a 404, which is the same branch the backend makes when it signs a
|
|
91
|
-
* raw-mode download URL.
|
|
92
|
-
*/
|
|
93
|
-
project_id: string | null;
|
|
94
|
-
license_id: string;
|
|
95
|
-
}
|
|
96
|
-
export interface DatasetFileProposal {
|
|
97
|
-
/**
|
|
98
|
-
* The file these columns came from.
|
|
99
|
-
*
|
|
100
|
-
* REQUIRED rather than optional: the endpoint returns it on every 2xx, and a
|
|
101
|
-
* refusal is not a `DatasetFileProposal` at all — it arrives as a non-2xx narrowed
|
|
102
|
-
* by `isDatasetRefused`. Marking it optional would buy nothing and cost every call
|
|
103
|
-
* site a permanent optional-chain for a field that is always there.
|
|
104
|
-
*
|
|
105
|
-
* One thing it does NOT cover: a refusal body carries no file, so a file over the
|
|
106
|
-
* byte ceiling cannot be labelled from this call. That is deliberate backend-side —
|
|
107
|
-
* the refusal body is byte-identical to a dispatch refusal's, and a dispatch
|
|
108
|
-
* refusal answers a buyer.
|
|
109
|
-
*/
|
|
110
|
-
file: DatasetSourceFile;
|
|
111
|
-
/**
|
|
112
|
-
* What the file was actually parsed as.
|
|
113
|
-
*
|
|
114
|
-
* Echoed because it may have been INFERRED from the extension. Re-deriving it
|
|
115
|
-
* client-side risks disagreeing with what was parsed, and then declaring a shape
|
|
116
|
-
* the dispatch refuses.
|
|
117
|
-
*/
|
|
118
|
-
format: DatasetFileFormat;
|
|
119
|
-
/** Exact, not estimated. Compare it against the row ceiling. */
|
|
120
|
-
row_count: number;
|
|
121
|
-
columns: DatasetFileColumnProposal[];
|
|
122
|
-
/** Capped by the deployment's preview-rows setting. Keyed by `source_key`, unprojected. */
|
|
123
|
-
sample: Array<Record<string, unknown>>;
|
|
124
|
-
}
|
|
125
|
-
/**
|
|
126
|
-
* Turn a proposal into the column declaration a trigger payload carries.
|
|
127
|
-
*
|
|
128
|
-
* The whole point of the endpoint is that this conversion is not retyped per call
|
|
129
|
-
* site — and `key` is the buyer-facing contract, so validate it (see
|
|
130
|
-
* `isValidDatasetKey` / `isReservedDatasetKey`) before storing a publisher's override.
|
|
131
|
-
*/
|
|
132
|
-
export declare function toFileColumn(proposal: DatasetFileColumnProposal): DatasetFileColumn;
|
|
133
|
-
export interface TriggerDatasetSourceService {
|
|
134
|
-
/**
|
|
135
|
-
* Propose the columns of a DMS file.
|
|
136
|
-
*
|
|
137
|
-
* Read-only and idempotent — safe to call every time a publisher picks a file.
|
|
138
|
-
*
|
|
139
|
-
* Authorised by DMS RBAC, so a file the caller cannot open through the DMS answers
|
|
140
|
-
* **403** here too and reveals neither headers nor sampled values. A trashed or
|
|
141
|
-
* unknown file is **404**.
|
|
142
|
-
*
|
|
143
|
-
* A refusal arrives as a non-2xx with the same `reason` vocabulary as a dispatch
|
|
144
|
-
* refusal, so `isDatasetRefused` narrows it — but the body is at the TOP LEVEL, not
|
|
145
|
-
* inside the `{ response, error }` dispatch envelope. Reachable reasons:
|
|
146
|
-
* `unsupported_upload_format`, `malformed_upload`, `row_shape_mismatch`,
|
|
147
|
-
* `value_type_mismatch`, `byte_limit_exceeded`, `upload_source_missing` (a folder,
|
|
148
|
-
* an external link, or bytes that are gone), and the operator-fault
|
|
149
|
-
* `snapshot_limits_misconfigured`.
|
|
150
|
-
*
|
|
151
|
-
* `format` overrides the file's extension; omit it to let the backend infer.
|
|
152
|
-
*/
|
|
153
|
-
proposeFileColumns: (dmsFileId: string, format?: DatasetFileFormat,
|
|
154
|
-
/** Read the file as a dispatch declaring these options would — header, delimiter, encoding, decimals. */
|
|
155
|
-
csv?: DatasetCsvOptions) => Promise<DataWrapper<DatasetFileProposal>>;
|
|
156
|
-
/**
|
|
157
|
-
* Name and locate a DMS file WITHOUT reading it.
|
|
158
|
-
*
|
|
159
|
-
* ⚠️ **Use this to render a label, not {@link proposeFileColumns}.** That one has
|
|
160
|
-
* to open the file to propose columns, which means it opens up to the byte
|
|
161
|
-
* ceiling, infers a type per column and samples rows — and, decisively, **it
|
|
162
|
-
* REFUSES a file it cannot read and the refusal carries no `file` object.**
|
|
163
|
-
* Over the ceiling, an external link, a folder: all non-2xx, no name. That is
|
|
164
|
-
* exactly the misconfigured trigger a publisher is diagnosing, so the one case
|
|
165
|
-
* where the label matters most is the case the proposal cannot answer.
|
|
166
|
-
*
|
|
167
|
-
* This inherits NONE of that. No ceiling check, no format resolution, no
|
|
168
|
-
* `reason` vocabulary — so it names a folder, an oversized file and an external
|
|
169
|
-
* link just as readily as a parseable CSV. Assume a name is available whenever
|
|
170
|
-
* the caller may see the file.
|
|
171
|
-
*
|
|
172
|
-
* What it does share is the gate: `DmsFilePolicy::view`, identical to the columns
|
|
173
|
-
* endpoint. **403** when the caller may not see the file, **404** when there is
|
|
174
|
-
* no such file or it has been trashed. Those are the only failure modes.
|
|
175
|
-
*
|
|
176
|
-
* The descriptor is byte-identical to `DatasetFileProposal.file`, from one
|
|
177
|
-
* implementation, so a label cannot differ by which endpoint a screen called.
|
|
178
|
-
*/
|
|
179
|
-
describeFile: (dmsFileId: string) => Promise<DataWrapper<DatasetSourceFile>>;
|
|
180
|
-
}
|
|
181
|
-
export declare function createTriggerDatasetSourceService(httpClient: AntHttpClient): TriggerDatasetSourceService;
|
|
1
|
+
/** @deprecated Moved to `services/Trigger/TriggerDatasetSourceService`. Remove in the next major release. */
|
|
2
|
+
export * from '../Trigger/TriggerDatasetSourceService';
|
|
182
3
|
//# sourceMappingURL=TriggerDatasetSourceService.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TriggerDatasetSourceService.d.ts","sourceRoot":"","sources":["../../../src/services/Webhook/TriggerDatasetSourceService.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"TriggerDatasetSourceService.d.ts","sourceRoot":"","sources":["../../../src/services/Webhook/TriggerDatasetSourceService.ts"],"names":[],"mappings":"AAAA,6GAA6G;AAC7G,cAAc,wCAAwC,CAAA"}
|
|
@@ -1,23 +1,2 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* The whole point of the endpoint is that this conversion is not retyped per call
|
|
5
|
-
* site — and `key` is the buyer-facing contract, so validate it (see
|
|
6
|
-
* `isValidDatasetKey` / `isReservedDatasetKey`) before storing a publisher's override.
|
|
7
|
-
*/
|
|
8
|
-
export function toFileColumn(proposal) {
|
|
9
|
-
return {
|
|
10
|
-
source_key: proposal.source_key,
|
|
11
|
-
key: proposal.key,
|
|
12
|
-
label: proposal.label,
|
|
13
|
-
type: proposal.proposed_type,
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
export function createTriggerDatasetSourceService(httpClient) {
|
|
17
|
-
return {
|
|
18
|
-
proposeFileColumns: (dmsFileId, format, csv) => httpClient.get(`/webhook/dataset-sources/${dmsFileId}/columns`, {
|
|
19
|
-
params: format === undefined && csv === undefined ? undefined : { format, csv },
|
|
20
|
-
}),
|
|
21
|
-
describeFile: (dmsFileId) => httpClient.get(`/webhook/dataset-sources/${dmsFileId}`),
|
|
22
|
-
};
|
|
23
|
-
}
|
|
1
|
+
/** @deprecated Moved to `services/Trigger/TriggerDatasetSourceService`. Remove in the next major release. */
|
|
2
|
+
export * from '../Trigger/TriggerDatasetSourceService';
|
|
@@ -1,89 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
-
}
|
|
1
|
+
/** @deprecated Moved to `services/Trigger/TriggerDispatch.types`. Remove in the next major release. */
|
|
2
|
+
export * from '../Trigger/TriggerDispatch.types';
|
|
89
3
|
//# 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,uGAAuG;AACvG,cAAc,kCAAkC,CAAA"}
|
|
@@ -1,24 +1,2 @@
|
|
|
1
|
-
/**
|
|
2
|
-
export
|
|
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
|
+
/** @deprecated Moved to `services/Trigger/TriggerDispatch.types`. Remove in the next major release. */
|
|
2
|
+
export * from '../Trigger/TriggerDispatch.types';
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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;
|
|
1
|
+
/** @deprecated Moved to `services/Trigger/TriggerDispatchUrl`. Remove in the next major release. */
|
|
2
|
+
export * from '../Trigger/TriggerDispatchUrl';
|
|
9
3
|
//# 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,oGAAoG;AACpG,cAAc,+BAA+B,CAAA"}
|
|
@@ -1,27 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
+
/** @deprecated Moved to `services/Trigger/TriggerDispatchUrl`. Remove in the next major release. */
|
|
2
|
+
export * from '../Trigger/TriggerDispatchUrl';
|
|
@@ -1,30 +1,3 @@
|
|
|
1
|
-
|
|
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;
|
|
1
|
+
/** @deprecated Moved to `services/Trigger/TriggerDivergence`. Remove in the next major release. */
|
|
2
|
+
export * from '../Trigger/TriggerDivergence';
|
|
30
3
|
//# 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,mGAAmG;AACnG,cAAc,8BAA8B,CAAA"}
|
|
@@ -1,25 +1,2 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
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
|
+
/** @deprecated Moved to `services/Trigger/TriggerDivergence`. Remove in the next major release. */
|
|
2
|
+
export * from '../Trigger/TriggerDivergence';
|
|
@@ -1,33 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
-
}
|
|
1
|
+
/** @deprecated Moved to `services/Trigger/TriggerFailedRuns.types`. Remove in the next major release. */
|
|
2
|
+
export * from '../Trigger/TriggerFailedRuns.types';
|
|
33
3
|
//# 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,yGAAyG;AACzG,cAAc,oCAAoC,CAAA"}
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
/** @deprecated Moved to `services/Trigger/TriggerFailedRuns.types`. Remove in the next major release. */
|
|
2
|
+
export * from '../Trigger/TriggerFailedRuns.types';
|