@antcde/connect-ts 0.4.30 → 0.4.32-rc.1
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/index.d.ts +3 -3
- package/build/index.d.ts.map +1 -1
- package/build/index.js +1 -1
- package/build/service-runtime.d.ts +0 -1
- package/build/service-runtime.d.ts.map +1 -1
- package/build/service-runtime.js +0 -1
- package/build/service-types-app.d.ts +1 -1
- package/build/service-types-app.d.ts.map +1 -1
- package/build/service-types.d.ts +3 -3
- package/build/service-types.d.ts.map +1 -1
- package/build/services/AppService/factory/resourceCommerce.d.ts +3 -1
- package/build/services/AppService/factory/resourceCommerce.d.ts.map +1 -1
- package/build/services/AppService/factory/resourceCommerce.js +1 -0
- package/build/services/AppService/factory/resourceEntitlementActions.d.ts +1 -12
- package/build/services/AppService/factory/resourceEntitlementActions.d.ts.map +1 -1
- package/build/services/AppService/factory/resources.d.ts +12 -75
- package/build/services/AppService/factory/resources.d.ts.map +1 -1
- package/build/services/AppService/factory/resources.js +15 -10
- package/build/services/AppService/types/resourceReleases.d.ts +12 -107
- package/build/services/AppService/types/resourceReleases.d.ts.map +1 -1
- package/build/services/AppService/types/resourceReleases.js +7 -0
- package/build/services/AppService/types/resourceRequests.d.ts +30 -43
- package/build/services/AppService/types/resourceRequests.d.ts.map +1 -1
- package/build/services/AppService/types/resourceSubscriptions.d.ts +22 -0
- package/build/services/AppService/types/resourceSubscriptions.d.ts.map +1 -0
- package/build/services/AppService/types/resourceSubscriptions.js +1 -0
- package/build/services/AppService/types/sellableResources.d.ts +19 -50
- package/build/services/AppService/types/sellableResources.d.ts.map +1 -1
- package/build/services/AppService/types/taxonomy.d.ts +10 -34
- package/build/services/AppService/types/taxonomy.d.ts.map +1 -1
- package/build/services/AppService/types.d.ts +1 -4
- package/build/services/AppService/types.d.ts.map +1 -1
- package/build/services/AppService/types.js +1 -4
- package/build/services/ColumnService.d.ts +7 -1
- package/build/services/ColumnService.d.ts.map +1 -1
- package/build/services/DmsService.d.ts +2 -2
- package/build/services/DmsService.d.ts.map +1 -1
- package/build/services/DmsService.types.d.ts +14 -0
- package/build/services/DmsService.types.d.ts.map +1 -1
- package/build/services/PropagationService.d.ts +15 -2
- package/build/services/PropagationService.d.ts.map +1 -1
- package/build/services/PropagationService.js +2 -0
- package/build/services/RBAC/PermissionService.d.ts +2 -2
- package/build/services/RBAC/PermissionService.d.ts.map +1 -1
- package/build/services/Webhook/TriggerDataset.types.d.ts +9 -1
- package/build/services/Webhook/TriggerDataset.types.d.ts.map +1 -1
- package/build/services/Webhook/TriggerDataset.types.js +0 -23
- package/build/services/Webhook/TriggerDatasetColumns.d.ts +2 -0
- package/build/services/Webhook/TriggerDatasetColumns.d.ts.map +1 -1
- package/build/services/Webhook/TriggerDatasetColumns.js +2 -0
- package/build/services/Webhook/TriggerDatasetCsv.types.d.ts +7 -0
- package/build/services/Webhook/TriggerDatasetCsv.types.d.ts.map +1 -0
- package/build/services/Webhook/TriggerDatasetCsv.types.js +1 -0
- package/build/services/Webhook/TriggerDatasetResponses.types.d.ts +20 -2
- package/build/services/Webhook/TriggerDatasetResponses.types.d.ts.map +1 -1
- package/build/services/Webhook/TriggerDatasetResponses.types.js +1 -0
- package/build/services/Webhook/TriggerDatasetSourceService.d.ts +4 -2
- package/build/services/Webhook/TriggerDatasetSourceService.d.ts.map +1 -1
- package/build/services/Webhook/TriggerDatasetSourceService.js +2 -2
- package/build/services/Webhook/TriggerHistoryService.d.ts +2 -1
- package/build/services/Webhook/TriggerHistoryService.d.ts.map +1 -1
- package/build/services/Webhook/TriggerVersion.types.d.ts +10 -3
- package/build/services/Webhook/TriggerVersion.types.d.ts.map +1 -1
- package/build/services/Webhook/TriggerVersionService.d.ts +6 -8
- package/build/services/Webhook/TriggerVersionService.d.ts.map +1 -1
- package/build/services/Webhook/TriggerVersionService.js +1 -1
- package/package.json +2 -2
- package/build/services/AppService/factory/resourceSnapshot.d.ts +0 -75
- package/build/services/AppService/factory/resourceSnapshot.d.ts.map +0 -1
- package/build/services/AppService/factory/resourceSnapshot.js +0 -55
- package/build/services/AppService/factory/resourceUploads.d.ts +0 -37
- package/build/services/AppService/factory/resourceUploads.d.ts.map +0 -1
- package/build/services/AppService/factory/resourceUploads.js +0 -8
- package/build/services/AppService/types/snapshotFileSource.d.ts +0 -110
- package/build/services/AppService/types/snapshotFileSource.d.ts.map +0 -1
- package/build/services/AppService/types/snapshotFileSource.js +0 -8
- package/build/services/AppService/types/snapshotPayload.d.ts +0 -166
- package/build/services/AppService/types/snapshotPayload.d.ts.map +0 -1
- package/build/services/AppService/types/snapshotPayload.js +0 -19
- package/build/services/AppService/types/snapshotSources.d.ts +0 -116
- package/build/services/AppService/types/snapshotSources.d.ts.map +0 -1
- package/build/services/AppService/types/snapshotSources.js +0 -7
- package/build/services/AppService/types/snapshotUploads.d.ts +0 -109
- package/build/services/AppService/types/snapshotUploads.d.ts.map +0 -1
- package/build/services/AppService/types/snapshotUploads.js +0 -20
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { maybeFormData } from './formData';
|
|
2
|
-
export function newResourceUploadFactory(client) {
|
|
3
|
-
const base = (resourceId) => `/store/resources/${resourceId}/snapshot-uploads`;
|
|
4
|
-
return {
|
|
5
|
-
uploadSnapshotFile: (resourceId, data, requestConfig) => client.post(base(resourceId), maybeFormData(data), requestConfig),
|
|
6
|
-
deleteSnapshotUpload: (resourceId, uploadId, requestConfig) => client.delete(`${base(resourceId)}/${uploadId}`, requestConfig),
|
|
7
|
-
};
|
|
8
|
-
}
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* File-sourced snapshot shapes (AAD-948).
|
|
3
|
-
*
|
|
4
|
-
* Split out of `snapshotPayload.ts` to keep that file under the 250-line limit. These
|
|
5
|
-
* are the halves of the source and column unions that describe an UPLOADED file; the
|
|
6
|
-
* table halves and the unions themselves stay next to the rest of the payload types.
|
|
7
|
-
*/
|
|
8
|
-
import type { SnapshotFieldType } from './snapshotPayload';
|
|
9
|
-
import type { SnapshotUploadFormat } from './snapshotUploads';
|
|
10
|
-
/**
|
|
11
|
-
* Which uploaded file a snapshot reads from (AAD-948).
|
|
12
|
-
*
|
|
13
|
-
* Only `type` and `upload_id` are sent. The provenance fields are stamped by the
|
|
14
|
-
* server from the upload row and echoed back on the stored config — a publisher who
|
|
15
|
-
* could state their own digest would be authoring the record that exists precisely
|
|
16
|
-
* because nobody can verify their claims about a file.
|
|
17
|
-
*/
|
|
18
|
-
export interface SnapshotFileSourceSelection {
|
|
19
|
-
type: 'file';
|
|
20
|
-
upload_id: string;
|
|
21
|
-
/** Server-stamped. Present on a stored config, never sent. */
|
|
22
|
-
original_filename?: string;
|
|
23
|
-
format?: SnapshotUploadFormat;
|
|
24
|
-
byte_size?: number;
|
|
25
|
-
sha256?: string;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* One published column from an uploaded FILE (AAD-948).
|
|
29
|
-
*
|
|
30
|
-
* Selection is by header NAME, because a file has no column ids to point at — which
|
|
31
|
-
* is the whole reason `source_column_id` has to be minted rather than read.
|
|
32
|
-
*/
|
|
33
|
-
export interface SnapshotFileColumnSelection {
|
|
34
|
-
/** The header exactly as it appears in the uploaded file. */
|
|
35
|
-
source_key: string;
|
|
36
|
-
/** The buyer-facing key. Required for a file source; there is no name to fall back to. */
|
|
37
|
-
key: string;
|
|
38
|
-
/** Display only. Renaming it breaks nothing and is not a schema change. */
|
|
39
|
-
label?: string | null;
|
|
40
|
-
/**
|
|
41
|
-
* The publisher's DECLARATION of the column's type.
|
|
42
|
-
*
|
|
43
|
-
* Required, and there is no default. A file states no types, so a missing answer
|
|
44
|
-
* is a question nobody asked rather than a value the server may assume. Take the
|
|
45
|
-
* server's `proposed_type` from the upload response as the starting point — it is
|
|
46
|
-
* a proposal, and overriding it is the point.
|
|
47
|
-
*
|
|
48
|
-
* Materialisation validates every value against this and REFUSES on mismatch
|
|
49
|
-
* rather than coercing: a silent cast turns "N/A" into 0 and ships wrong totals.
|
|
50
|
-
*/
|
|
51
|
-
type: SnapshotFieldType;
|
|
52
|
-
required?: boolean;
|
|
53
|
-
/**
|
|
54
|
-
* Carried forward from a previous version's schema, or omitted to have one minted.
|
|
55
|
-
*
|
|
56
|
-
* ⚠️ An IDENTITY TOKEN, never a foreign key. For a table source it happens to be a
|
|
57
|
-
* `columns.id`; for a file it points at nothing; and a listing that switched from a
|
|
58
|
-
* table keeps the old table's id on any column that kept its key. Its only contract
|
|
59
|
-
* is "the same value means the same column".
|
|
60
|
-
*/
|
|
61
|
-
column_id?: string | null;
|
|
62
|
-
/**
|
|
63
|
-
* Declares a RENAME: this column was published under that key last version.
|
|
64
|
-
*
|
|
65
|
-
* Without it a rename is indistinguishable from a removal plus an addition, and
|
|
66
|
-
* AAD-942 must classify that as breaking. Offer it whenever a publisher changes a
|
|
67
|
-
* key on a re-publish.
|
|
68
|
-
*/
|
|
69
|
-
previous_key?: string | null;
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* Provenance for a version built from an uploaded file (AAD-948).
|
|
73
|
-
*
|
|
74
|
-
* It OUTLIVES THE BYTES: a successful version releases its staged upload, so this is
|
|
75
|
-
* the only remaining answer to "what exactly did we publish?".
|
|
76
|
-
*
|
|
77
|
-
* `verified` is always false and is stated rather than implied. A table source is a
|
|
78
|
-
* live source inside the publisher's own license that the platform can inspect; an
|
|
79
|
-
* uploaded file is opaque bytes from an origin nobody can check. AAD-943's
|
|
80
|
-
* attestation work needs those told apart.
|
|
81
|
-
*/
|
|
82
|
-
export interface SnapshotFileSchemaSource {
|
|
83
|
-
type: 'file';
|
|
84
|
-
upload_id: string;
|
|
85
|
-
original_filename: string;
|
|
86
|
-
format: SnapshotUploadFormat;
|
|
87
|
-
byte_size: number;
|
|
88
|
-
sha256: string;
|
|
89
|
-
uploaded_at: string | null;
|
|
90
|
-
uploaded_by: string | null;
|
|
91
|
-
verified: false;
|
|
92
|
-
}
|
|
93
|
-
/** Where a version's rows came from. Absent `type` means a linked table. */
|
|
94
|
-
export type ResourceVersionSource = ResourceVersionTableSource | ResourceVersionFileSource;
|
|
95
|
-
export interface ResourceVersionTableSource {
|
|
96
|
-
type?: 'table';
|
|
97
|
-
table_id: string;
|
|
98
|
-
table_name: string | null;
|
|
99
|
-
}
|
|
100
|
-
export interface ResourceVersionFileSource {
|
|
101
|
-
type: 'file';
|
|
102
|
-
upload_id: string;
|
|
103
|
-
original_filename: string | null;
|
|
104
|
-
format: string | null;
|
|
105
|
-
byte_size: number | null;
|
|
106
|
-
sha256: string | null;
|
|
107
|
-
/** Always false. An uploaded file's origin is not something this platform can check. */
|
|
108
|
-
verified: false;
|
|
109
|
-
}
|
|
110
|
-
//# sourceMappingURL=snapshotFileSource.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"snapshotFileSource.d.ts","sourceRoot":"","sources":["../../../../src/services/AppService/types/snapshotFileSource.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAC1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAA;AAE7D;;;;;;;GAOG;AACH,MAAM,WAAW,2BAA2B;IAC1C,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,MAAM,CAAA;IACjB,8DAA8D;IAC9D,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,MAAM,CAAC,EAAE,oBAAoB,CAAA;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED;;;;;GAKG;AACH,MAAM,WAAW,2BAA2B;IAC1C,6DAA6D;IAC7D,UAAU,EAAE,MAAM,CAAA;IAClB,0FAA0F;IAC1F,GAAG,EAAE,MAAM,CAAA;IACX,2EAA2E;IAC3E,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB;;;;;;;;;;OAUG;IACH,IAAI,EAAE,iBAAiB,CAAA;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;;;;;;OAOG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAC7B;AAED;;;;;;;;;;GAUG;AACH,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,MAAM,CAAA;IACjB,iBAAiB,EAAE,MAAM,CAAA;IACzB,MAAM,EAAE,oBAAoB,CAAA;IAC5B,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,MAAM,CAAA;IACd,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,QAAQ,EAAE,KAAK,CAAA;CAChB;AAED,4EAA4E;AAC5E,MAAM,MAAM,qBAAqB,GAAG,0BAA0B,GAAG,yBAAyB,CAAA;AAE1F,MAAM,WAAW,0BAA0B;IACzC,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;IAChB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;CAC1B;AAED,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,MAAM,CAAA;IACjB,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAA;IAChC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,wFAAwF;IACxF,QAAQ,EAAE,KAAK,CAAA;CAChB"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* File-sourced snapshot shapes (AAD-948).
|
|
3
|
-
*
|
|
4
|
-
* Split out of `snapshotPayload.ts` to keep that file under the 250-line limit. These
|
|
5
|
-
* are the halves of the source and column unions that describe an UPLOADED file; the
|
|
6
|
-
* table halves and the unions themselves stay next to the rest of the payload types.
|
|
7
|
-
*/
|
|
8
|
-
export {};
|
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Snapshot payload shapes (AAD-939) — the first payload type a sellable resource
|
|
3
|
-
* can have.
|
|
4
|
-
*
|
|
5
|
-
* A snapshot publishes an EXPLICIT column selection from one of two sources: a
|
|
6
|
-
* linked dynamic table (AAD-939) or an uploaded CSV/JSON file (AAD-948). Both are
|
|
7
|
-
* the same payload type and produce the same schema, the same JSON and CSV, and the
|
|
8
|
-
* same access-layer behaviour — a buyer cannot tell them apart except by reading the
|
|
9
|
-
* provenance on the version.
|
|
10
|
-
*
|
|
11
|
-
* Two things about this file are load-bearing:
|
|
12
|
-
*
|
|
13
|
-
* 1. `SnapshotPayloadSchema` is the DECLARED schema, recorded once per version and
|
|
14
|
-
* **not backfillable**. AAD-942 builds structural diffs on it.
|
|
15
|
-
* 2. Materialisation is QUEUED. A version is created `pending` and a job flips it
|
|
16
|
-
* to `ready` or `failed`, so nothing here is servable the moment
|
|
17
|
-
* `createResourceVersion` returns.
|
|
18
|
-
*/
|
|
19
|
-
import type { SnapshotFileColumnSelection, SnapshotFileSchemaSource, SnapshotFileSourceSelection } from './snapshotFileSource';
|
|
20
|
-
/** A column type a dataset may publish. */
|
|
21
|
-
export type SnapshotFieldType = 'boolean' | 'integer' | 'float' | 'text' | 'text-field' | 'link' | 'email' | 'dropdown' | 'sbscode' | 'date';
|
|
22
|
-
/**
|
|
23
|
-
* Which table a snapshot reads from. Must belong to the publisher's own license.
|
|
24
|
-
*
|
|
25
|
-
* `type` is optional and ABSENT MEANS `'table'`. The discriminator was added inside
|
|
26
|
-
* the existing object rather than replacing it, so every config written against
|
|
27
|
-
* AAD-939 keeps working untouched — read it as `source.type ?? 'table'`.
|
|
28
|
-
*/
|
|
29
|
-
export interface SnapshotTableSourceSelection {
|
|
30
|
-
type?: 'table';
|
|
31
|
-
table_id: string;
|
|
32
|
-
}
|
|
33
|
-
export type SnapshotSourceSelection = SnapshotTableSourceSelection | SnapshotFileSourceSelection;
|
|
34
|
-
/** One published column from a linked TABLE. */
|
|
35
|
-
export interface SnapshotTableColumnSelection {
|
|
36
|
-
/** The logical `columns.id`. Selection is by ID, never by name. */
|
|
37
|
-
column_id: string;
|
|
38
|
-
/**
|
|
39
|
-
* Optional output key. Defaults to the column's name.
|
|
40
|
-
*
|
|
41
|
-
* Letters, numbers, underscores and hyphens only, and unique across the
|
|
42
|
-
* selection — a duplicate key collapses in JSON and produces two identically
|
|
43
|
-
* named CSV columns, so the dataset would not match its own schema.
|
|
44
|
-
*/
|
|
45
|
-
key?: string | null;
|
|
46
|
-
}
|
|
47
|
-
export type SnapshotColumnSelection = SnapshotTableColumnSelection | SnapshotFileColumnSelection;
|
|
48
|
-
/**
|
|
49
|
-
* A row filter.
|
|
50
|
-
*
|
|
51
|
-
* ⚠️ **Accepted and stored, but NOT yet applied.** The shape is fixed now so
|
|
52
|
-
* nothing has to be reshaped later, but a version carrying a non-empty filter
|
|
53
|
-
* fails materialisation with `payload_error` "Row filters are not supported yet".
|
|
54
|
-
* Do not offer filtering in the publish flow until the backend applies it — the
|
|
55
|
-
* preview reports `row_filters_supported: false` for exactly this reason.
|
|
56
|
-
*/
|
|
57
|
-
export interface SnapshotRowFilter {
|
|
58
|
-
column_id: string;
|
|
59
|
-
operator: '=' | '>' | '<' | '>=' | '<=' | '<>' | 'like' | 'not like' | 'is null' | 'is not null' | 'between';
|
|
60
|
-
value?: unknown;
|
|
61
|
-
values?: unknown[];
|
|
62
|
-
boolean?: 'and' | 'or';
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* What the publisher declared for a snapshot version.
|
|
66
|
-
*
|
|
67
|
-
* `declarations.contains_personal_data` is REQUIRED on create and `true` is
|
|
68
|
-
* refused with a 422 — publishing personal data is not possible in v1, so this is
|
|
69
|
-
* a blocking question rather than a warning.
|
|
70
|
-
*/
|
|
71
|
-
export interface SnapshotPayloadConfig {
|
|
72
|
-
source: SnapshotSourceSelection;
|
|
73
|
-
columns: SnapshotColumnSelection[];
|
|
74
|
-
filters?: SnapshotRowFilter[];
|
|
75
|
-
declarations: {
|
|
76
|
-
contains_personal_data: boolean;
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
/** One field of the declared schema. */
|
|
80
|
-
export interface SnapshotFieldSchema {
|
|
81
|
-
/** The stable key in the payload — what buyer code reads. */
|
|
82
|
-
key: string;
|
|
83
|
-
/** The publisher's human label. Display only; renaming it breaks nothing. */
|
|
84
|
-
label: string | null;
|
|
85
|
-
type: SnapshotFieldType;
|
|
86
|
-
/**
|
|
87
|
-
* Whether this field is null anywhere in THIS artifact.
|
|
88
|
-
*
|
|
89
|
-
* MEASURED, not declared. The source column's `required` flag is a write-time UI
|
|
90
|
-
* hint that no record write path enforces, so it cannot answer the question —
|
|
91
|
-
* a `required` column can and does contain nulls. A field is reported nullable
|
|
92
|
-
* when a null was actually seen, or when the dataset is empty (zero rows cannot
|
|
93
|
-
* demonstrate non-nullability).
|
|
94
|
-
*
|
|
95
|
-
* It describes the bytes the buyer received, not a promise about future versions.
|
|
96
|
-
*/
|
|
97
|
-
nullable: boolean;
|
|
98
|
-
/** `observed` from the artifact, or `declared` from the column flag (preview only). */
|
|
99
|
-
nullable_source: 'observed' | 'declared';
|
|
100
|
-
/** How many rows had null here. Null when not measured (preview). */
|
|
101
|
-
null_count: number | null;
|
|
102
|
-
/** What the source column claimed. Recorded for AAD-942; not what `nullable` is from. */
|
|
103
|
-
declared_required: boolean;
|
|
104
|
-
/** Position in the payload. CSV column order follows it. */
|
|
105
|
-
order: number;
|
|
106
|
-
/** The source column's id, so AAD-942 can tell a rename from a remove-plus-add. */
|
|
107
|
-
source_column_id: string;
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* The declared schema stored on a materialised version.
|
|
111
|
-
*
|
|
112
|
-
* Null until the job completes. `row_count` / `byte_size` are also flattened onto
|
|
113
|
-
* `ResourceVersion` for convenience.
|
|
114
|
-
*/
|
|
115
|
-
export interface SnapshotPayloadSchema {
|
|
116
|
-
/**
|
|
117
|
-
* 1 = nullability derived from the column flag (never shipped).
|
|
118
|
-
* 2 = nullability observed from the artifact, with `null_count`.
|
|
119
|
-
*
|
|
120
|
-
* NOT bumped by AAD-948: the per-field shape is identical for both sources, which
|
|
121
|
-
* is exactly why the schema diff needed no change. Only `source` varies.
|
|
122
|
-
*/
|
|
123
|
-
schema_version: number;
|
|
124
|
-
fields: SnapshotFieldSchema[];
|
|
125
|
-
row_count: number;
|
|
126
|
-
byte_size: number;
|
|
127
|
-
materialised_at: string;
|
|
128
|
-
source: SnapshotSchemaSource;
|
|
129
|
-
}
|
|
130
|
-
/** Where a materialised version's rows came from. Discriminated on `type`, absent meaning a table. */
|
|
131
|
-
export type SnapshotSchemaSource = SnapshotTableSchemaSource | SnapshotFileSchemaSource;
|
|
132
|
-
export interface SnapshotTableSchemaSource {
|
|
133
|
-
type?: 'table';
|
|
134
|
-
table_id: string;
|
|
135
|
-
table_name: string | null;
|
|
136
|
-
}
|
|
137
|
-
/**
|
|
138
|
-
* A dry run of a selection, before creating a version from it.
|
|
139
|
-
*
|
|
140
|
-
* This is how a publisher learns they are over a ceiling BEFORE publishing.
|
|
141
|
-
* Above either ceiling the backend REFUSES the version rather than truncating it,
|
|
142
|
-
* so surfacing `exceeds_limits` here is what keeps that refusal from being a
|
|
143
|
-
* surprise at the last step.
|
|
144
|
-
*/
|
|
145
|
-
export interface SnapshotPreview {
|
|
146
|
-
row_count: number;
|
|
147
|
-
/** Extrapolated from the sample, not measured. Order of magnitude only. */
|
|
148
|
-
estimated_bytes: number;
|
|
149
|
-
exceeds_limits: {
|
|
150
|
-
rows: boolean;
|
|
151
|
-
bytes: boolean;
|
|
152
|
-
};
|
|
153
|
-
limits: {
|
|
154
|
-
max_rows: number;
|
|
155
|
-
max_bytes: number;
|
|
156
|
-
};
|
|
157
|
-
/** Exactly the schema that would be recorded, so the contract is reviewable. */
|
|
158
|
-
schema: SnapshotFieldSchema[];
|
|
159
|
-
/** First N rows, shaped as the payload would be. Always a sample. */
|
|
160
|
-
sample: Array<Record<string, unknown>>;
|
|
161
|
-
/** True when `sample` is shorter than `row_count`. A preview may truncate; a published dataset never does. */
|
|
162
|
-
truncated: boolean;
|
|
163
|
-
/** False until row filters are applied server-side. */
|
|
164
|
-
row_filters_supported: boolean;
|
|
165
|
-
}
|
|
166
|
-
//# sourceMappingURL=snapshotPayload.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"snapshotPayload.d.ts","sourceRoot":"","sources":["../../../../src/services/AppService/types/snapshotPayload.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Snapshot payload shapes (AAD-939) — the first payload type a sellable resource
|
|
3
|
-
* can have.
|
|
4
|
-
*
|
|
5
|
-
* A snapshot publishes an EXPLICIT column selection from one of two sources: a
|
|
6
|
-
* linked dynamic table (AAD-939) or an uploaded CSV/JSON file (AAD-948). Both are
|
|
7
|
-
* the same payload type and produce the same schema, the same JSON and CSV, and the
|
|
8
|
-
* same access-layer behaviour — a buyer cannot tell them apart except by reading the
|
|
9
|
-
* provenance on the version.
|
|
10
|
-
*
|
|
11
|
-
* Two things about this file are load-bearing:
|
|
12
|
-
*
|
|
13
|
-
* 1. `SnapshotPayloadSchema` is the DECLARED schema, recorded once per version and
|
|
14
|
-
* **not backfillable**. AAD-942 builds structural diffs on it.
|
|
15
|
-
* 2. Materialisation is QUEUED. A version is created `pending` and a job flips it
|
|
16
|
-
* to `ready` or `failed`, so nothing here is servable the moment
|
|
17
|
-
* `createResourceVersion` returns.
|
|
18
|
-
*/
|
|
19
|
-
export {};
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Snapshot error detail and source-table listing (AAD-939).
|
|
3
|
-
*
|
|
4
|
-
* Split from `snapshotPayload.ts` for file size; re-exported through the same
|
|
5
|
-
* barrel, so the public surface is unchanged.
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Why a snapshot version failed, as a code you can branch and translate on.
|
|
9
|
-
*
|
|
10
|
-
* **Branch on this, not on `payload_error`.** The prose is English-only and cannot
|
|
11
|
-
* be localised for the nl/de builds, and it is the only place the numbers appear if
|
|
12
|
-
* you read it as a string. `payload_error` stays the fallback for a code you have
|
|
13
|
-
* not localised yet.
|
|
14
|
-
*
|
|
15
|
-
* | code | context | means |
|
|
16
|
-
* | --- | --- | --- |
|
|
17
|
-
* | `row_limit_exceeded` | `actual_rows`, `max_rows` | too many rows — narrow the selection |
|
|
18
|
-
* | `byte_limit_exceeded` | `max_bytes` | too large; the write aborted, so there is no `actual_bytes` to report |
|
|
19
|
-
* | `row_filters_unsupported` | — | a row filter was stored; filters are not applied yet |
|
|
20
|
-
* | `source_table_missing` | — | the source table was deleted after the version was declared |
|
|
21
|
-
* | `unpublishable_column_type` | `column_name`, `column_type` | a selected column cannot be published |
|
|
22
|
-
* | `invalid_payload_config` | varies | the stored configuration could not be read |
|
|
23
|
-
* | `snapshot_limits_misconfigured` | `config_key`, `env_var`, `resolved` | the DEPLOYMENT's size ceiling is unset or zero |
|
|
24
|
-
* | `internal_error` | — | a backend fault; the publisher cannot act on it |
|
|
25
|
-
*/
|
|
26
|
-
export type SnapshotErrorCode = 'row_limit_exceeded' | 'byte_limit_exceeded' | 'row_filters_unsupported' | 'source_table_missing' | 'unpublishable_column_type' | 'invalid_payload_config' | 'snapshot_limits_misconfigured'
|
|
27
|
-
/** AAD-948. The uploaded file could not be read — truncated, or not the format it claims. */
|
|
28
|
-
| 'malformed_upload'
|
|
29
|
-
/** AAD-948. A row's field count disagrees with the header's. Context: row_number, expected_columns, actual_columns. */
|
|
30
|
-
| 'row_shape_mismatch'
|
|
31
|
-
/** AAD-948. A value is not the type the publisher declared. Context: column_key, row_number, expected_type, value_excerpt. */
|
|
32
|
-
| 'value_type_mismatch'
|
|
33
|
-
/** AAD-948. The uploaded bytes backing this version are gone. The fix is to re-upload. */
|
|
34
|
-
| 'upload_source_missing'
|
|
35
|
-
/** AAD-948. The stored upload names a format this deployment can no longer read. */
|
|
36
|
-
| 'unsupported_upload_format' | 'internal_error';
|
|
37
|
-
/**
|
|
38
|
-
* The numbers behind a failure, so a client can build its own sentence.
|
|
39
|
-
*
|
|
40
|
-
* Every field is optional: which ones are present depends on the code. Key ORDER is
|
|
41
|
-
* not stable — it round-trips through a MySQL JSON column, which reorders object
|
|
42
|
-
* keys — so read by name.
|
|
43
|
-
*/
|
|
44
|
-
export interface SnapshotErrorContext {
|
|
45
|
-
actual_rows?: number;
|
|
46
|
-
/** AAD-948. 1-based position in the UPLOADED FILE, so the publisher can go and open it. */
|
|
47
|
-
row_number?: number;
|
|
48
|
-
expected_columns?: number;
|
|
49
|
-
actual_columns?: number;
|
|
50
|
-
column_key?: string;
|
|
51
|
-
expected_type?: string;
|
|
52
|
-
/** Truncated to 32 characters — enough to recognise the cell, not a copy of it. */
|
|
53
|
-
value_excerpt?: string;
|
|
54
|
-
max_rows?: number;
|
|
55
|
-
max_bytes?: number;
|
|
56
|
-
column_name?: string;
|
|
57
|
-
column_type?: string;
|
|
58
|
-
/** `snapshot_limits_misconfigured` only — the setting at fault, e.g. `STORE_RESOURCE_SNAPSHOT_MAX_ROWS`. */
|
|
59
|
-
env_var?: string;
|
|
60
|
-
config_key?: string;
|
|
61
|
-
/** What the ceiling resolved to: `0`, or null when the setting is absent entirely. */
|
|
62
|
-
resolved?: number | null;
|
|
63
|
-
[key: string]: unknown;
|
|
64
|
-
}
|
|
65
|
-
/** Which table, and who owns it. */
|
|
66
|
-
export interface SnapshotSourceOwner {
|
|
67
|
-
type: 'project' | 'license' | 'unknown';
|
|
68
|
-
id: string | null;
|
|
69
|
-
/** The project (or license) name — what makes two same-named tables tellable apart. */
|
|
70
|
-
name: string | null;
|
|
71
|
-
}
|
|
72
|
-
/** Why a source table cannot be used. */
|
|
73
|
-
export type SnapshotSourceUnavailableReason = 'storage_missing' | 'no_publishable_columns';
|
|
74
|
-
/**
|
|
75
|
-
* A table the publisher can build a dataset from.
|
|
76
|
-
*
|
|
77
|
-
* From `previewResourceSnapshot`'s sibling, `fetchSnapshotSources()`. Use this rather
|
|
78
|
-
* than the generic table listing: that one has no project attribution, no row count
|
|
79
|
-
* and no publishable-column count, so a picker built on it shows identical rows for
|
|
80
|
-
* same-named tables in different projects and needs one extra request per table.
|
|
81
|
-
*/
|
|
82
|
-
export interface SnapshotSource {
|
|
83
|
-
table_id: string;
|
|
84
|
-
name: string;
|
|
85
|
-
owner: SnapshotSourceOwner;
|
|
86
|
-
/**
|
|
87
|
-
* Live rows (soft-deleted excluded). Exact, so it can be compared to the ceiling.
|
|
88
|
-
*
|
|
89
|
-
* **Null when the table has no physical storage behind it** — a `tables` row whose
|
|
90
|
-
* underlying table was never created or has since been dropped, which does occur.
|
|
91
|
-
* Null means "could not look", which is not the same fact as a real `0`, and a
|
|
92
|
-
* publisher judging a selection against the row ceiling needs to tell them apart.
|
|
93
|
-
*/
|
|
94
|
-
row_count: number | null;
|
|
95
|
-
column_count: number;
|
|
96
|
-
/** Columns of a type a dataset may publish. */
|
|
97
|
-
publishable_column_count: number;
|
|
98
|
-
/**
|
|
99
|
-
* False when the table cannot be used as a source.
|
|
100
|
-
*
|
|
101
|
-
* Show the row and disable it rather than filtering it out — a publisher looking
|
|
102
|
-
* for a table they know exists should find it and learn why it is unusable.
|
|
103
|
-
*/
|
|
104
|
-
is_publishable: boolean;
|
|
105
|
-
/**
|
|
106
|
-
* Why it cannot be used, or null when it can.
|
|
107
|
-
*
|
|
108
|
-
* - `storage_missing` — no physical table behind the row; nothing we can publish
|
|
109
|
-
* - `no_publishable_columns` — real table, but no column of a publishable type
|
|
110
|
-
*
|
|
111
|
-
* Two genuinely different problems, so the disabled row can say which rather than
|
|
112
|
-
* leaving the reader to infer it from a zero.
|
|
113
|
-
*/
|
|
114
|
-
unavailable_reason: SnapshotSourceUnavailableReason | null;
|
|
115
|
-
}
|
|
116
|
-
//# sourceMappingURL=snapshotSources.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"snapshotSources.d.ts","sourceRoot":"","sources":["../../../../src/services/AppService/types/snapshotSources.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,MAAM,iBAAiB,GACvB,oBAAoB,GACpB,qBAAqB,GACrB,yBAAyB,GACzB,sBAAsB,GACtB,2BAA2B,GAC3B,wBAAwB,GACxB,+BAA+B;AACjC,6FAA6F;GAC3F,kBAAkB;AACpB,uHAAuH;GACrH,oBAAoB;AACtB,8HAA8H;GAC5H,qBAAqB;AACvB,0FAA0F;GACxF,uBAAuB;AACzB,oFAAoF;GAClF,2BAA2B,GAC3B,gBAAgB,CAAA;AAEtB;;;;;;GAMG;AACH,MAAM,WAAW,oBAAoB;IACnC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,2FAA2F;IAC3F,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,mFAAmF;IACnF,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,4GAA4G;IAC5G,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,sFAAsF;IACtF,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CACvB;AAED,oCAAoC;AACpC,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,CAAA;IACvC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAA;IACjB,uFAAuF;IACvF,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;CACpB;AAED,yCAAyC;AACzC,MAAM,MAAM,+BAA+B,GAAG,iBAAiB,GAAG,wBAAwB,CAAA;AAE1F;;;;;;;GAOG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,mBAAmB,CAAA;IAC1B;;;;;;;OAOG;IACH,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,YAAY,EAAE,MAAM,CAAA;IACpB,+CAA+C;IAC/C,wBAAwB,EAAE,MAAM,CAAA;IAChC;;;;;OAKG;IACH,cAAc,EAAE,OAAO,CAAA;IACvB;;;;;;;;OAQG;IACH,kBAAkB,EAAE,+BAA+B,GAAG,IAAI,CAAA;CAC3D"}
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Staging a dataset FILE for a snapshot version (AAD-948).
|
|
3
|
-
*
|
|
4
|
-
* The file-source counterpart of `snapshotSources.ts`, and it answers the same
|
|
5
|
-
* question that one does — what can I publish, and is it within the limits? — for a
|
|
6
|
-
* source the platform has never seen before.
|
|
7
|
-
*
|
|
8
|
-
* Two things about this step are load-bearing:
|
|
9
|
-
*
|
|
10
|
-
* 1. **It is synchronous, and materialisation still is not.** The upload call returns
|
|
11
|
-
* the analysis immediately because the publisher is waiting on it to make their
|
|
12
|
-
* next decision. Creating a version from it is still queued, and `payload_state`
|
|
13
|
-
* still has to be polled. Do not treat a 201 here as publication.
|
|
14
|
-
* 2. **A file that cannot be READ never becomes a version.** It is analysed before
|
|
15
|
-
* anything is stored, so a malformed file is a 422 on `errors.file` with nothing
|
|
16
|
-
* created. That is a different event from a version whose build failed, and the
|
|
17
|
-
* two must not share copy — one is fixed by picking another file, the other by
|
|
18
|
-
* correcting a declaration and retrying.
|
|
19
|
-
*/
|
|
20
|
-
/** A dataset file format the store can read. `.jsonl` is accepted and reported as `ndjson`. */
|
|
21
|
-
export type SnapshotUploadFormat = 'csv' | 'json' | 'ndjson';
|
|
22
|
-
/**
|
|
23
|
-
* What the server made of one column of the uploaded file.
|
|
24
|
-
*
|
|
25
|
-
* `proposed_type` is a PROPOSAL, not a schema. The publisher confirms or overrides it
|
|
26
|
-
* per column and their answer is what the version stores — which is what keeps "the
|
|
27
|
-
* schema is declared, not inferred" true for a file source.
|
|
28
|
-
*
|
|
29
|
-
* Every ambiguity resolves to `text` on purpose. A column proposed as text that could
|
|
30
|
-
* have been an integer costs one click; a column proposed as an INTEGER that should
|
|
31
|
-
* have been text turns `01223` into `1223` and silently corrupts a postcode in a
|
|
32
|
-
* dataset somebody paid for.
|
|
33
|
-
*/
|
|
34
|
-
export interface SnapshotUploadColumnProposal {
|
|
35
|
-
/** The header exactly as it appears in the file. */
|
|
36
|
-
source_key: string;
|
|
37
|
-
/** A suggested buyer-facing key, derived from the header. The publisher may change it. */
|
|
38
|
-
key: string;
|
|
39
|
-
label: string;
|
|
40
|
-
proposed_type: string;
|
|
41
|
-
/** How many rows were empty here — so the publisher can see WHY a column fell back to text. */
|
|
42
|
-
null_count: number;
|
|
43
|
-
/** Advisory. The authoritative nullability is measured from the finished artifact. */
|
|
44
|
-
nullable: boolean;
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* A staged file, and everything measured about it.
|
|
48
|
-
*
|
|
49
|
-
* Everything here is measured SERVER-SIDE and none of it is accepted from the client.
|
|
50
|
-
*/
|
|
51
|
-
export interface SnapshotUpload {
|
|
52
|
-
id: string;
|
|
53
|
-
resource_id: string;
|
|
54
|
-
original_filename: string;
|
|
55
|
-
format: SnapshotUploadFormat;
|
|
56
|
-
byte_size: number;
|
|
57
|
-
/**
|
|
58
|
-
* The digest of exactly what was uploaded.
|
|
59
|
-
*
|
|
60
|
-
* A file source has no origin anyone can check, so this is the one fact about it
|
|
61
|
-
* that cannot be disputed later. It is also how a publisher who uploaded the wrong
|
|
62
|
-
* export twice tells the two apart when nothing else on the row differs.
|
|
63
|
-
*/
|
|
64
|
-
sha256: string;
|
|
65
|
-
row_count: number;
|
|
66
|
-
column_count: number;
|
|
67
|
-
columns: SnapshotUploadColumnProposal[];
|
|
68
|
-
/**
|
|
69
|
-
* Show this BEFORE letting the publisher continue.
|
|
70
|
-
*
|
|
71
|
-
* Above a ceiling the backend refuses the version rather than truncating it, so a
|
|
72
|
-
* publisher who is not warned here hits a wall at the last step of a flow they have
|
|
73
|
-
* already invested in.
|
|
74
|
-
*/
|
|
75
|
-
exceeds_limits: {
|
|
76
|
-
rows: boolean;
|
|
77
|
-
bytes: boolean;
|
|
78
|
-
};
|
|
79
|
-
limits: {
|
|
80
|
-
max_rows: number;
|
|
81
|
-
max_bytes: number;
|
|
82
|
-
max_upload_bytes: number;
|
|
83
|
-
};
|
|
84
|
-
/**
|
|
85
|
-
* When an unused upload is swept.
|
|
86
|
-
*
|
|
87
|
-
* An upload nobody turns into a version is pruned, so a publisher who leaves the tab
|
|
88
|
-
* open over a weekend should be told why their file is gone rather than discovering
|
|
89
|
-
* it.
|
|
90
|
-
*/
|
|
91
|
-
expires_at: string | null;
|
|
92
|
-
created_at: string | null;
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* The multipart body for staging a file.
|
|
96
|
-
*
|
|
97
|
-
* Send it through `maybeFormData`, which the SDK already does — it detects the Blob
|
|
98
|
-
* and switches to FormData, and deliberately does not set Content-Type so axios picks
|
|
99
|
-
* the boundary.
|
|
100
|
-
*
|
|
101
|
-
* ⚠️ Check the file's size against `StoreCapabilities.resources_snapshot_max_upload_bytes`
|
|
102
|
-
* first. That is the EFFECTIVE ceiling — the configured one capped by what PHP will
|
|
103
|
-
* accept — and going over it produces a bare 413 that names nothing. A null there
|
|
104
|
-
* means the deployment cannot currently accept uploads at all.
|
|
105
|
-
*/
|
|
106
|
-
export interface UploadSnapshotFileData {
|
|
107
|
-
file: File;
|
|
108
|
-
}
|
|
109
|
-
//# sourceMappingURL=snapshotUploads.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"snapshotUploads.d.ts","sourceRoot":"","sources":["../../../../src/services/AppService/types/snapshotUploads.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,+FAA+F;AAC/F,MAAM,MAAM,oBAAoB,GAAG,KAAK,GAAG,MAAM,GAAG,QAAQ,CAAA;AAE5D;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,4BAA4B;IAC3C,oDAAoD;IACpD,UAAU,EAAE,MAAM,CAAA;IAClB,0FAA0F;IAC1F,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IACb,aAAa,EAAE,MAAM,CAAA;IACrB,+FAA+F;IAC/F,UAAU,EAAE,MAAM,CAAA;IAClB,sFAAsF;IACtF,QAAQ,EAAE,OAAO,CAAA;CAClB;AAED;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAA;IACV,WAAW,EAAE,MAAM,CAAA;IACnB,iBAAiB,EAAE,MAAM,CAAA;IACzB,MAAM,EAAE,oBAAoB,CAAA;IAC5B,SAAS,EAAE,MAAM,CAAA;IACjB;;;;;;OAMG;IACH,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,MAAM,CAAA;IACjB,YAAY,EAAE,MAAM,CAAA;IACpB,OAAO,EAAE,4BAA4B,EAAE,CAAA;IACvC;;;;;;OAMG;IACH,cAAc,EAAE;QACd,IAAI,EAAE,OAAO,CAAA;QACb,KAAK,EAAE,OAAO,CAAA;KACf,CAAA;IACD,MAAM,EAAE;QACN,QAAQ,EAAE,MAAM,CAAA;QAChB,SAAS,EAAE,MAAM,CAAA;QACjB,gBAAgB,EAAE,MAAM,CAAA;KACzB,CAAA;IACD;;;;;;OAMG;IACH,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;CAC1B;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,IAAI,CAAA;CACX"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Staging a dataset FILE for a snapshot version (AAD-948).
|
|
3
|
-
*
|
|
4
|
-
* The file-source counterpart of `snapshotSources.ts`, and it answers the same
|
|
5
|
-
* question that one does — what can I publish, and is it within the limits? — for a
|
|
6
|
-
* source the platform has never seen before.
|
|
7
|
-
*
|
|
8
|
-
* Two things about this step are load-bearing:
|
|
9
|
-
*
|
|
10
|
-
* 1. **It is synchronous, and materialisation still is not.** The upload call returns
|
|
11
|
-
* the analysis immediately because the publisher is waiting on it to make their
|
|
12
|
-
* next decision. Creating a version from it is still queued, and `payload_state`
|
|
13
|
-
* still has to be polled. Do not treat a 201 here as publication.
|
|
14
|
-
* 2. **A file that cannot be READ never becomes a version.** It is analysed before
|
|
15
|
-
* anything is stored, so a malformed file is a 422 on `errors.file` with nothing
|
|
16
|
-
* created. That is a different event from a version whose build failed, and the
|
|
17
|
-
* two must not share copy — one is fixed by picking another file, the other by
|
|
18
|
-
* correcting a declaration and retrying.
|
|
19
|
-
*/
|
|
20
|
-
export {};
|