@antcde/connect-ts 0.4.36 → 0.4.37-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (195) hide show
  1. package/README.md +1 -1
  2. package/build/AntConnect.d.ts +2 -15
  3. package/build/AntConnect.d.ts.map +1 -1
  4. package/build/AntConnect.js +2 -14
  5. package/build/comms/client.d.ts.map +1 -1
  6. package/build/comms/client.js +7 -1
  7. package/build/comms/hostAPI.d.ts.map +1 -1
  8. package/build/comms/hostAPI.js +9 -1
  9. package/build/comms/signalRouteTypes.d.ts +2 -0
  10. package/build/comms/signalRouteTypes.d.ts.map +1 -1
  11. package/build/index.d.ts +29 -29
  12. package/build/index.d.ts.map +1 -1
  13. package/build/index.js +7 -7
  14. package/build/service-runtime.d.ts +1 -1
  15. package/build/service-runtime.d.ts.map +1 -1
  16. package/build/service-runtime.js +1 -1
  17. package/build/service-types.d.ts +8 -8
  18. package/build/service-types.d.ts.map +1 -1
  19. package/build/services/AppService/factory/assignments.d.ts +4 -4
  20. package/build/services/AppService/factory/assignments.d.ts.map +1 -1
  21. package/build/services/AppService/factory/assignments.js +8 -4
  22. package/build/services/AppService/types/appManifest.d.ts +2 -0
  23. package/build/services/AppService/types/appManifest.d.ts.map +1 -1
  24. package/build/services/AppService/types/appScopes.d.ts +14 -14
  25. package/build/services/AppService/types/appScopes.d.ts.map +1 -1
  26. package/build/services/AppService/types/bulkAssignments.d.ts +2 -4
  27. package/build/services/AppService/types/bulkAssignments.d.ts.map +1 -1
  28. package/build/services/AppService/types/resourceReleases.d.ts +1 -1
  29. package/build/services/AppService/types/seats.d.ts +14 -1
  30. package/build/services/AppService/types/seats.d.ts.map +1 -1
  31. package/build/services/AppService/types/sellableResources.d.ts +1 -1
  32. package/build/services/AppService/types/subscriptions.d.ts +4 -0
  33. package/build/services/AppService/types/subscriptions.d.ts.map +1 -1
  34. package/build/services/ColumnService.d.ts +17 -0
  35. package/build/services/ColumnService.d.ts.map +1 -1
  36. package/build/services/ColumnService.js +1 -0
  37. package/build/services/SecretSharing.types.d.ts +1 -1
  38. package/build/services/TaskRelation.types.d.ts +1 -1
  39. package/build/services/TaskService.types.d.ts +1 -1
  40. package/build/services/TaskService.types.d.ts.map +1 -1
  41. package/build/services/Trigger/ConfigService.d.ts +51 -0
  42. package/build/services/Trigger/ConfigService.d.ts.map +1 -0
  43. package/build/services/Trigger/ConfigService.js +5 -0
  44. package/build/services/Trigger/EventService.d.ts +146 -0
  45. package/build/services/Trigger/EventService.d.ts.map +1 -0
  46. package/build/services/Trigger/EventService.js +6 -0
  47. package/build/services/Trigger/TriggerCaller.types.d.ts +18 -0
  48. package/build/services/Trigger/TriggerCaller.types.d.ts.map +1 -0
  49. package/build/services/Trigger/TriggerCaller.types.js +1 -0
  50. package/build/services/Trigger/TriggerDataset.types.d.ts +168 -0
  51. package/build/services/Trigger/TriggerDataset.types.d.ts.map +1 -0
  52. package/build/services/Trigger/TriggerDataset.types.js +51 -0
  53. package/build/services/Trigger/TriggerDatasetColumns.d.ts +74 -0
  54. package/build/services/Trigger/TriggerDatasetColumns.d.ts.map +1 -0
  55. package/build/services/Trigger/TriggerDatasetColumns.js +118 -0
  56. package/build/services/Trigger/TriggerDatasetCsv.types.d.ts +7 -0
  57. package/build/services/Trigger/TriggerDatasetCsv.types.d.ts.map +1 -0
  58. package/build/services/Trigger/TriggerDatasetCsv.types.js +1 -0
  59. package/build/services/Trigger/TriggerDatasetResponses.types.d.ts +176 -0
  60. package/build/services/Trigger/TriggerDatasetResponses.types.d.ts.map +1 -0
  61. package/build/services/Trigger/TriggerDatasetResponses.types.js +99 -0
  62. package/build/services/Trigger/TriggerDatasetSourceService.d.ts +182 -0
  63. package/build/services/Trigger/TriggerDatasetSourceService.d.ts.map +1 -0
  64. package/build/services/Trigger/TriggerDatasetSourceService.js +23 -0
  65. package/build/services/Trigger/TriggerDispatch.types.d.ts +89 -0
  66. package/build/services/Trigger/TriggerDispatch.types.d.ts.map +1 -0
  67. package/build/services/Trigger/TriggerDispatch.types.js +24 -0
  68. package/build/services/Trigger/TriggerDispatchUrl.d.ts +9 -0
  69. package/build/services/Trigger/TriggerDispatchUrl.d.ts.map +1 -0
  70. package/build/services/Trigger/TriggerDispatchUrl.js +27 -0
  71. package/build/services/Trigger/TriggerDivergence.d.ts +30 -0
  72. package/build/services/Trigger/TriggerDivergence.d.ts.map +1 -0
  73. package/build/services/Trigger/TriggerDivergence.js +25 -0
  74. package/build/services/Trigger/TriggerFailedRuns.types.d.ts +33 -0
  75. package/build/services/Trigger/TriggerFailedRuns.types.d.ts.map +1 -0
  76. package/build/services/Trigger/TriggerFailedRuns.types.js +1 -0
  77. package/build/services/Trigger/TriggerHistoryService.d.ts +201 -0
  78. package/build/services/Trigger/TriggerHistoryService.d.ts.map +1 -0
  79. package/build/services/Trigger/TriggerHistoryService.js +13 -0
  80. package/build/services/Trigger/TriggerLastRun.types.d.ts +80 -0
  81. package/build/services/Trigger/TriggerLastRun.types.d.ts.map +1 -0
  82. package/build/services/Trigger/TriggerLastRun.types.js +1 -0
  83. package/build/services/Trigger/TriggerOwner.d.ts +5 -0
  84. package/build/services/Trigger/TriggerOwner.d.ts.map +1 -0
  85. package/build/services/Trigger/TriggerOwner.js +6 -0
  86. package/build/services/Trigger/TriggerRefresh.types.d.ts +15 -0
  87. package/build/services/Trigger/TriggerRefresh.types.d.ts.map +1 -0
  88. package/build/services/Trigger/TriggerRefresh.types.js +1 -0
  89. package/build/services/Trigger/TriggerRefusalDetail.types.d.ts +63 -0
  90. package/build/services/Trigger/TriggerRefusalDetail.types.d.ts.map +1 -0
  91. package/build/services/Trigger/TriggerRefusalDetail.types.js +12 -0
  92. package/build/services/Trigger/TriggerRequest.types.d.ts +57 -0
  93. package/build/services/Trigger/TriggerRequest.types.d.ts.map +1 -0
  94. package/build/services/Trigger/TriggerRequest.types.js +1 -0
  95. package/build/services/Trigger/TriggerSearch.types.d.ts +39 -0
  96. package/build/services/Trigger/TriggerSearch.types.d.ts.map +1 -0
  97. package/build/services/Trigger/TriggerSearch.types.js +1 -0
  98. package/build/services/Trigger/TriggerSecretService.d.ts +88 -0
  99. package/build/services/Trigger/TriggerSecretService.d.ts.map +1 -0
  100. package/build/services/Trigger/TriggerSecretService.js +9 -0
  101. package/build/services/Trigger/TriggerService.d.ts +203 -0
  102. package/build/services/Trigger/TriggerService.d.ts.map +1 -0
  103. package/build/services/Trigger/TriggerService.js +15 -0
  104. package/build/services/Trigger/TriggerServices.d.ts +33 -0
  105. package/build/services/Trigger/TriggerServices.d.ts.map +1 -0
  106. package/build/services/Trigger/TriggerServices.js +32 -0
  107. package/build/services/Trigger/TriggerStats.types.d.ts +46 -0
  108. package/build/services/Trigger/TriggerStats.types.d.ts.map +1 -0
  109. package/build/services/Trigger/TriggerStats.types.js +1 -0
  110. package/build/services/Trigger/TriggerTimeline.types.d.ts +42 -0
  111. package/build/services/Trigger/TriggerTimeline.types.d.ts.map +1 -0
  112. package/build/services/Trigger/TriggerTimeline.types.js +1 -0
  113. package/build/services/Trigger/TriggerVersion.types.d.ts +109 -0
  114. package/build/services/Trigger/TriggerVersion.types.d.ts.map +1 -0
  115. package/build/services/Trigger/TriggerVersion.types.js +1 -0
  116. package/build/services/Trigger/TriggerVersionService.d.ts +54 -0
  117. package/build/services/Trigger/TriggerVersionService.d.ts.map +1 -0
  118. package/build/services/Trigger/TriggerVersionService.js +20 -0
  119. package/build/services/Webhook/ConfigService.d.ts +2 -50
  120. package/build/services/Webhook/ConfigService.d.ts.map +1 -1
  121. package/build/services/Webhook/ConfigService.js +2 -5
  122. package/build/services/Webhook/EventService.d.ts +2 -145
  123. package/build/services/Webhook/EventService.d.ts.map +1 -1
  124. package/build/services/Webhook/EventService.js +2 -6
  125. package/build/services/Webhook/TriggerCaller.types.d.ts +2 -17
  126. package/build/services/Webhook/TriggerCaller.types.d.ts.map +1 -1
  127. package/build/services/Webhook/TriggerCaller.types.js +2 -1
  128. package/build/services/Webhook/TriggerDataset.types.d.ts +2 -167
  129. package/build/services/Webhook/TriggerDataset.types.d.ts.map +1 -1
  130. package/build/services/Webhook/TriggerDataset.types.js +2 -51
  131. package/build/services/Webhook/TriggerDatasetColumns.d.ts +2 -73
  132. package/build/services/Webhook/TriggerDatasetColumns.d.ts.map +1 -1
  133. package/build/services/Webhook/TriggerDatasetColumns.js +2 -118
  134. package/build/services/Webhook/TriggerDatasetCsv.types.d.ts +2 -6
  135. package/build/services/Webhook/TriggerDatasetCsv.types.d.ts.map +1 -1
  136. package/build/services/Webhook/TriggerDatasetCsv.types.js +2 -1
  137. package/build/services/Webhook/TriggerDatasetResponses.types.d.ts +2 -175
  138. package/build/services/Webhook/TriggerDatasetResponses.types.d.ts.map +1 -1
  139. package/build/services/Webhook/TriggerDatasetResponses.types.js +2 -99
  140. package/build/services/Webhook/TriggerDatasetSourceService.d.ts +2 -181
  141. package/build/services/Webhook/TriggerDatasetSourceService.d.ts.map +1 -1
  142. package/build/services/Webhook/TriggerDatasetSourceService.js +2 -23
  143. package/build/services/Webhook/TriggerDispatch.types.d.ts +2 -88
  144. package/build/services/Webhook/TriggerDispatch.types.d.ts.map +1 -1
  145. package/build/services/Webhook/TriggerDispatch.types.js +2 -24
  146. package/build/services/Webhook/TriggerDispatchUrl.d.ts +2 -8
  147. package/build/services/Webhook/TriggerDispatchUrl.d.ts.map +1 -1
  148. package/build/services/Webhook/TriggerDispatchUrl.js +2 -27
  149. package/build/services/Webhook/TriggerDivergence.d.ts +2 -29
  150. package/build/services/Webhook/TriggerDivergence.d.ts.map +1 -1
  151. package/build/services/Webhook/TriggerDivergence.js +2 -25
  152. package/build/services/Webhook/TriggerFailedRuns.types.d.ts +2 -32
  153. package/build/services/Webhook/TriggerFailedRuns.types.d.ts.map +1 -1
  154. package/build/services/Webhook/TriggerFailedRuns.types.js +2 -1
  155. package/build/services/Webhook/TriggerHistoryService.d.ts +2 -200
  156. package/build/services/Webhook/TriggerHistoryService.d.ts.map +1 -1
  157. package/build/services/Webhook/TriggerHistoryService.js +2 -13
  158. package/build/services/Webhook/TriggerLastRun.types.d.ts +2 -79
  159. package/build/services/Webhook/TriggerLastRun.types.d.ts.map +1 -1
  160. package/build/services/Webhook/TriggerLastRun.types.js +2 -1
  161. package/build/services/Webhook/TriggerOwner.d.ts +2 -4
  162. package/build/services/Webhook/TriggerOwner.d.ts.map +1 -1
  163. package/build/services/Webhook/TriggerOwner.js +2 -6
  164. package/build/services/Webhook/TriggerRefresh.types.d.ts +2 -14
  165. package/build/services/Webhook/TriggerRefresh.types.d.ts.map +1 -1
  166. package/build/services/Webhook/TriggerRefresh.types.js +2 -1
  167. package/build/services/Webhook/TriggerRefusalDetail.types.d.ts +2 -62
  168. package/build/services/Webhook/TriggerRefusalDetail.types.d.ts.map +1 -1
  169. package/build/services/Webhook/TriggerRefusalDetail.types.js +2 -12
  170. package/build/services/Webhook/TriggerRequest.types.d.ts +2 -57
  171. package/build/services/Webhook/TriggerRequest.types.d.ts.map +1 -1
  172. package/build/services/Webhook/TriggerRequest.types.js +2 -1
  173. package/build/services/Webhook/TriggerSearch.types.d.ts +2 -38
  174. package/build/services/Webhook/TriggerSearch.types.d.ts.map +1 -1
  175. package/build/services/Webhook/TriggerSearch.types.js +2 -1
  176. package/build/services/Webhook/TriggerSecretService.d.ts +2 -87
  177. package/build/services/Webhook/TriggerSecretService.d.ts.map +1 -1
  178. package/build/services/Webhook/TriggerSecretService.js +2 -9
  179. package/build/services/Webhook/TriggerService.d.ts +2 -190
  180. package/build/services/Webhook/TriggerService.d.ts.map +1 -1
  181. package/build/services/Webhook/TriggerService.js +2 -14
  182. package/build/services/Webhook/TriggerStats.types.d.ts +2 -45
  183. package/build/services/Webhook/TriggerStats.types.d.ts.map +1 -1
  184. package/build/services/Webhook/TriggerStats.types.js +2 -1
  185. package/build/services/Webhook/TriggerTimeline.types.d.ts +2 -41
  186. package/build/services/Webhook/TriggerTimeline.types.d.ts.map +1 -1
  187. package/build/services/Webhook/TriggerTimeline.types.js +2 -1
  188. package/build/services/Webhook/TriggerVersion.types.d.ts +2 -108
  189. package/build/services/Webhook/TriggerVersion.types.d.ts.map +1 -1
  190. package/build/services/Webhook/TriggerVersion.types.js +2 -1
  191. package/build/services/Webhook/TriggerVersionService.d.ts +2 -53
  192. package/build/services/Webhook/TriggerVersionService.d.ts.map +1 -1
  193. package/build/services/Webhook/TriggerVersionService.js +2 -20
  194. package/package.json +5 -5
  195. package/schemas/app-config.schema.json +16 -6
@@ -1,118 +1,2 @@
1
- /**
2
- * The rules for declaring a dataset column's published key and type.
3
- *
4
- * These live next to the types they narrow rather than in a UI package on
5
- * purpose: they are interpretations of the AAD-967 contract, and the exhaustive
6
- * records below are what make a new backend column type or refusal reason fail
7
- * the BUILD instead of falling silently through a default. A UI library would
8
- * put that guarantee in the wrong place, and every consumer would need its own
9
- * copy of the same eleven strings.
10
- */
11
- /**
12
- * Every publishable column type, as a runtime lookup.
13
- *
14
- * Annotated rather than inferred so the compiler rejects a missing key and a
15
- * stray one alike — adding a member to {@link DatasetColumnType} without adding
16
- * it here fails to build.
17
- */
18
- export const DATASET_COLUMN_TYPES = {
19
- boolean: true,
20
- integer: true,
21
- float: true,
22
- textfield: true,
23
- link: true,
24
- email: true,
25
- text: true,
26
- dropdown: true,
27
- sbscode: true,
28
- date: true,
29
- };
30
- /** What a FILE column may declare: the platform-table types (textfield, dropdown, sbscode) mean nothing in a file. */
31
- export const DATASET_FILE_COLUMN_TYPES = ['text', 'integer', 'float', 'boolean', 'date', 'email', 'link'];
32
- /**
33
- * Is this a column type a dataset may publish?
34
- *
35
- * ⚠️ `hasOwnProperty.call`, AND NEITHER OF THE TWO OBVIOUS ALTERNATIVES. `in`
36
- * answers true for every inherited key, so `isDatasetColumnType('toString')` used
37
- * to report a publishable column type. `Object.hasOwn` is the rule's preferred
38
- * form and this package's TS lib predates it — swapping it in compiles under
39
- * `tsc -p` and then fails the Python schema generator, which builds its own
40
- * program from these files. Hence the disable rather than the autofix.
41
- */
42
- export function isDatasetColumnType(type) {
43
- // eslint-disable-next-line e18e/prefer-object-has-own -- Object.hasOwn is not in this package's TS lib; see above
44
- return Object.prototype.hasOwnProperty.call(DATASET_COLUMN_TYPES, type);
45
- }
46
- /**
47
- * Keys a publisher may not claim.
48
- *
49
- * `id` is reserved because every dataset row leads with it — the record id for a
50
- * table, the 1-based line number for a file. A publisher who maps their own
51
- * column to `id` would silently shadow it.
52
- */
53
- export const RESERVED_DATASET_KEYS = ['id'];
54
- /** Case-insensitive: `ID` collides with the reserved `id` just as surely. */
55
- export function isReservedDatasetKey(key) {
56
- return RESERVED_DATASET_KEYS.includes(key.trim().toLowerCase());
57
- }
58
- /** Letters, digits, underscore and hyphen. Anything else is not a usable key. */
59
- export function isValidDatasetKey(key) {
60
- return /^[\w-]+$/.test(key);
61
- }
62
- /**
63
- * A reasonable published key for a source column or file header.
64
- *
65
- * Only a starting point — the publisher owns the final name, because it is the
66
- * buyer's contract.
67
- */
68
- export function defaultDatasetKeyFor(name) {
69
- return name
70
- .trim()
71
- .toLowerCase()
72
- .replace(/[^a-z0-9]+/g, '_')
73
- .replace(/^_+|_+$/g, '');
74
- }
75
- /**
76
- * Validate one published key.
77
- *
78
- * ⚠️ **The order of these checks is the message a user sees**, and it is not
79
- * arbitrary. A blank key is `required`, never `invalid` — telling someone their
80
- * empty field contains illegal characters sends them looking for a character
81
- * that is not there. Reserved beats invalid for the same reason: `id` is a
82
- * perfectly well-formed key, so "invalid" would be a lie about why it was
83
- * refused. Duplicate is last because it is the only one that depends on the
84
- * other rows rather than on this key alone.
85
- */
86
- export function datasetKeyError(key, duplicates) {
87
- const trimmed = key.trim();
88
- if (!trimmed)
89
- return 'required';
90
- if (isReservedDatasetKey(trimmed))
91
- return 'reserved';
92
- if (!isValidDatasetKey(trimmed))
93
- return 'invalid';
94
- if (duplicates.has(trimmed))
95
- return 'duplicate';
96
- return null;
97
- }
98
- /**
99
- * Which of these keys appear more than once.
100
- *
101
- * Blank keys are excluded: several unfilled rows are not a name collision, and
102
- * flagging them as duplicates would report the same problem twice under the
103
- * wrong name.
104
- */
105
- export function duplicateDatasetKeys(keys) {
106
- const seen = new Set();
107
- const dupes = new Set();
108
- for (const raw of keys) {
109
- const key = raw.trim();
110
- if (!key)
111
- continue;
112
- if (seen.has(key))
113
- dupes.add(key);
114
- else
115
- seen.add(key);
116
- }
117
- return dupes;
118
- }
1
+ /** @deprecated Moved to `services/Trigger/TriggerDatasetColumns`. Remove in the next major release. */
2
+ export * from '../Trigger/TriggerDatasetColumns';
@@ -1,7 +1,3 @@
1
- export interface DatasetCsvOptions {
2
- has_header?: boolean;
3
- delimiter?: 'auto' | ',' | ';' | '\t' | '|';
4
- encoding?: 'auto' | 'utf-8' | 'windows-1252';
5
- decimal_separator?: 'auto' | '.' | ',';
6
- }
1
+ /** @deprecated Moved to `services/Trigger/TriggerDatasetCsv.types`. Remove in the next major release. */
2
+ export * from '../Trigger/TriggerDatasetCsv.types';
7
3
  //# sourceMappingURL=TriggerDatasetCsv.types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TriggerDatasetCsv.types.d.ts","sourceRoot":"","sources":["../../../src/services/Webhook/TriggerDatasetCsv.types.ts"],"names":[],"mappings":"AACA,MAAM,WAAW,iBAAiB;IAChC,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,GAAG,GAAG,GAAG,GAAG,GAAG,IAAI,GAAG,GAAG,CAAA;IAC3C,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,cAAc,CAAA;IAC5C,iBAAiB,CAAC,EAAE,MAAM,GAAG,GAAG,GAAG,GAAG,CAAA;CACvC"}
1
+ {"version":3,"file":"TriggerDatasetCsv.types.d.ts","sourceRoot":"","sources":["../../../src/services/Webhook/TriggerDatasetCsv.types.ts"],"names":[],"mappings":"AAAA,yGAAyG;AACzG,cAAc,oCAAoC,CAAA"}
@@ -1 +1,2 @@
1
- export {};
1
+ /** @deprecated Moved to `services/Trigger/TriggerDatasetCsv.types`. Remove in the next major release. */
2
+ export * from '../Trigger/TriggerDatasetCsv.types';
@@ -1,176 +1,3 @@
1
- /**
2
- * What a dataset action ANSWERS with (AAD-967) — successful shapes and refusals.
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
- /** Rows returned by a dataset action. */
9
- export interface DatasetRows {
10
- /** Buyer-facing keys, in the publisher's declared order. */
11
- keys: string[];
12
- /** Led by `id` (record id, or 1-based file line); values in their declared JSON type. */
13
- rows: Array<Record<string, unknown>>;
14
- /** How many rows are in THIS response, not how many exist. */
15
- row_count: number;
16
- /**
17
- * There was more data than `limit` allowed.
18
- *
19
- * Too much data is never an error for these actions — you get the rows up to
20
- * the limit plus this flag. Say so in the UI; a silently short answer that looks
21
- * complete is the failure this flag exists to prevent.
22
- */
23
- truncated: boolean;
24
- /** The limit actually applied, after clamping. */
25
- limit: number;
26
- /** Where this page started. */
27
- offset: number;
28
- /** Send as `offset` for the next page; null when there is none or the row ceiling is reached. */
29
- next_offset: number | null;
30
- }
31
- /** `ReturnFileDataEvent` in `raw` mode. */
32
- export interface DatasetRawFile {
33
- /** No DMS id, no storage token, no project or licence id — by design. */
34
- file: {
35
- name: string;
36
- extension: string;
37
- mime: string;
38
- size: number | string;
39
- };
40
- /** Short-lived and signed. Carries no credential, so its lifetime IS the grant. */
41
- download_url: string;
42
- expires_in_seconds: number;
43
- }
44
- /** `TransformWithScriptEvent` with `response_mode: 'envelope'`. */
45
- export interface TransformRunEnvelope {
46
- task_id: string;
47
- status: string;
48
- exit_code: number | null;
49
- /** Whatever the script emitted via its `__ANT_RESULT__:` sentinel. */
50
- result: unknown;
51
- stdout_tail: string;
52
- meta: Record<string, unknown>;
53
- }
54
- /**
55
- * ⚠️ **Every dataset dispatch is wrapped**, even though all three actions run
56
- * synchronously and inline.
57
- *
58
- * The dispatcher decides the envelope from whether the payload carries an `async`
59
- * key, and only the older `RunScriptEvent` sets one — so these actions are
60
- * reported through the async-shaped envelope regardless. Read `response`, not the
61
- * top level. Not worth changing: it would move the response shape of every
62
- * existing action.
63
- */
64
- export interface DatasetDispatchEnvelope<T> {
65
- response: T | null;
66
- error: string | null;
67
- }
68
- /** Why a dataset action refused to serve. */
69
- export type DatasetRefusalReason = 'invalid_payload_config' | 'byte_limit_exceeded' | 'source_table_missing' | 'upload_source_missing' | 'unsupported_upload_format' | 'malformed_upload' | 'row_shape_mismatch' | 'value_type_mismatch'
70
- /** A declared column names a header the file does not have. */
71
- | 'unknown_source_column' | 'unpublishable_column_type'
72
- /**
73
- * An OPERATOR fault: the deployment's ceilings are unusable. Must NOT be shown
74
- * to a publisher as "your dataset is too big" — that sends them hunting through
75
- * their own data for a problem in the environment.
76
- *
77
- * The string still says `snapshot` deliberately: it is persisted in existing
78
- * rows, and changing it would break reading them.
79
- */
80
- | 'snapshot_limits_misconfigured' | 'internal_error';
81
- /**
82
- * Every refusal reason, as a runtime lookup.
83
- *
84
- * Annotated `Record<DatasetRefusalReason, true>` rather than inferred, so the
85
- * compiler rejects both a missing key and a stray one: adding a member to
86
- * {@link DatasetRefusalReason} without adding it here fails to build. That is the
87
- * point — a reason nobody mapped must not fail silently.
88
- */
89
- export declare const DATASET_REFUSAL_REASONS: Record<DatasetRefusalReason, true>;
90
- /**
91
- * A release refused because the file does not serve as declared (422 from
92
- * `releaseTriggerVersion`). Unlike a dispatch refusal, `message` is the DETAILED
93
- * one — only the publisher releases — and names the row and column to fix.
94
- */
95
- export interface DatasetReleaseRefusal {
96
- dataset_refused: true;
97
- reason: DatasetRefusalReason;
98
- message: string;
99
- context: Record<string, unknown>;
100
- status_code: 422;
101
- }
102
- /**
103
- * A dataset action refused to serve.
104
- *
105
- * ⚠️ Arrives as a NON-2xx response, so it surfaces as a rejected request — read it
106
- * off the error body, not the resolved value. It sits inside the dispatch
107
- * envelope: `error.response.data.response`.
108
- *
109
- * **Branch on `reason`, never on the HTTP status.** There are only two statuses —
110
- * 422 for anything the publisher or the data is responsible for, 5xx for
111
- * `snapshot_limits_misconfigured` and `internal_error` — so the status cannot tell
112
- * you what to say.
113
- *
114
- * `message` is a caller-safe sentence. The detailed one, which names columns and
115
- * table ids, is deliberately withheld and only reaches the execution history the
116
- * publisher can read. Do not expect it here.
117
- *
118
- * ⚠️ **Never render this as an empty result.** "This file is gone" and "this
119
- * dataset has no rows" look identical to a user and call for opposite actions.
120
- */
121
- export interface DatasetRefusedResult {
122
- dataset_refused: true;
123
- reason: DatasetRefusalReason;
124
- message: string;
125
- /** Informational — branch on `reason`. */
126
- status_code: number;
127
- }
128
- /**
129
- * Type guard: is this a refused dataset dispatch?
130
- *
131
- * Accepts either the dispatch envelope or the inner body, so it can be pointed
132
- * straight at `error.response?.data` without unwrapping first.
133
- *
134
- * ⚠️ **This is a deliberately loose narrow, and the looseness is load-bearing.**
135
- * It accepts any string `reason` rather than only the eleven known ones, so that a
136
- * reason a newer backend adds is still recognised AS a refusal instead of falling
137
- * through to "empty result" — which is the one failure mode this whole contract
138
- * exists to prevent.
139
- *
140
- * The cost is that the narrowed type is optimistic: `reason` may be a string
141
- * outside {@link DatasetRefusalReason}, and `message` may be absent. So:
142
- *
143
- * - Give every `switch (reason)` a `default:` arm, and map unknown reasons to a
144
- * generic sentence rather than letting them fall into a specific one.
145
- * - Do NOT trust {@link isOperatorFault} alone to classify an unrecognised
146
- * reason — it answers `false`, which reads as "the publisher's fault". Check
147
- * membership with {@link DATASET_REFUSAL_REASONS} first when the distinction
148
- * drives what you tell someone.
149
- */
150
- export declare function isDatasetRefused(result: unknown): result is DatasetRefusedResult;
151
- /**
152
- * Narrow a stored or received response to {@link DatasetRows}.
153
- *
154
- * ⚠️ **DELIBERATELY DOES NOT REQUIRE `rows` TO BE INTACT.** A run recorded in the
155
- * execution history has `stored_response_truncated: true` for essentially every
156
- * dataset action — the stored copy of `rows` is elided to save database space, and
157
- * arrives with a `"... (2 more items truncated)"` string sitting in the array. The
158
- * caller still received everything.
159
- *
160
- * `row_count` is a SCALAR recorded beside the array and is never elided, so it
161
- * stays true across that shrinking. Reading `rows.length` instead would report a
162
- * five-row answer as two — which is why this guard checks the count and not the
163
- * array, and why any caller should read `row_count` rather than measuring `rows`.
164
- */
165
- export declare function isDatasetRows(response: unknown): response is DatasetRows;
166
- /** Is this a reason this build of the SDK knows about? */
167
- export declare function isKnownRefusalReason(reason: string): reason is DatasetRefusalReason;
168
- /**
169
- * Is this reason the operator's fault rather than the publisher's?
170
- *
171
- * ⚠️ Answers `false` for an unrecognised reason, which reads as "the publisher's
172
- * fault". Guard with {@link isKnownRefusalReason} when that distinction is what
173
- * you are about to tell someone.
174
- */
175
- export declare function isOperatorFault(reason: DatasetRefusalReason): boolean;
1
+ /** @deprecated Moved to `services/Trigger/TriggerDatasetResponses.types`. Remove in the next major release. */
2
+ export * from '../Trigger/TriggerDatasetResponses.types';
176
3
  //# sourceMappingURL=TriggerDatasetResponses.types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TriggerDatasetResponses.types.d.ts","sourceRoot":"","sources":["../../../src/services/Webhook/TriggerDatasetResponses.types.ts"],"names":[],"mappings":"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"}
1
+ {"version":3,"file":"TriggerDatasetResponses.types.d.ts","sourceRoot":"","sources":["../../../src/services/Webhook/TriggerDatasetResponses.types.ts"],"names":[],"mappings":"AAAA,+GAA+G;AAC/G,cAAc,0CAA0C,CAAA"}
@@ -1,99 +1,2 @@
1
- /**
2
- * What a dataset action ANSWERS with (AAD-967) — successful shapes and refusals.
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
- import type { DataWrapper } from '../../types';
2
- import type { DatasetColumnType, DatasetCsvOptions, DatasetFileColumn, DatasetFileFormat } from './TriggerDataset.types';
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,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAC9C,OAAO,KAAK,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AACxH,OAAO,KAAK,EAAE,aAAa,EAAE,4BAAuB;AAEpD;;;;;;;;;;GAUG;AAEH,yEAAyE;AACzE,MAAM,WAAW,yBAAyB;IACxC,oDAAoD;IACpD,UAAU,EAAE,MAAM,CAAA;IAClB,uFAAuF;IACvF,GAAG,EAAE,MAAM,CAAA;IACX,yCAAyC;IACzC,KAAK,EAAE,MAAM,CAAA;IACb;;;;;;;;OAQG;IACH,aAAa,EAAE,iBAAiB,CAAA;IAChC;;;;OAIG;IACH,UAAU,EAAE,MAAM,CAAA;IAClB,iFAAiF;IACjF,QAAQ,EAAE,OAAO,CAAA;CAClB;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAA;IACV;;;;;;;;;;OAUG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ,yDAAyD;IACzD,SAAS,EAAE,MAAM,CAAA;IACjB,uCAAuC;IACvC,IAAI,EAAE,MAAM,CAAA;IACZ,4DAA4D;IAC5D,IAAI,EAAE,MAAM,CAAA;IACZ,yEAAyE;IACzE,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB;;;;;OAKG;IACH,WAAW,EAAE,MAAM,EAAE,CAAA;IACrB;;;;;;OAMG;IACH,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,UAAU,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,mBAAmB;IAClC;;;;;;;;;;;;OAYG;IACH,IAAI,EAAE,iBAAiB,CAAA;IACvB;;;;;;OAMG;IACH,MAAM,EAAE,iBAAiB,CAAA;IACzB,gEAAgE;IAChE,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,yBAAyB,EAAE,CAAA;IACpC,2FAA2F;IAC3F,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;CACvC;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,yBAAyB,GAAG,iBAAiB,CAOnF;AAED,MAAM,WAAW,2BAA2B;IAC1C;;;;;;;;;;;;;;;;;;OAkBG;IACH,kBAAkB,EAAE,CAClB,SAAS,EAAE,MAAM,EACjB,MAAM,CAAC,EAAE,iBAAiB;IAC1B,yGAAyG;IACzG,GAAG,CAAC,EAAE,iBAAiB,KACpB,OAAO,CAAC,WAAW,CAAC,mBAAmB,CAAC,CAAC,CAAA;IAE9C;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,YAAY,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,WAAW,CAAC,iBAAiB,CAAC,CAAC,CAAA;CAC7E;AAED,wBAAgB,iCAAiC,CAAC,UAAU,EAAE,aAAa,GAAG,2BAA2B,CAUxG"}
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
- * Turn a proposal into the column declaration a trigger payload carries.
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';