@antcde/connect-ts 0.4.27-rc.1 → 0.4.27-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/README.md +67 -3
- package/build/AntConnect.d.ts +2 -0
- package/build/AntConnect.d.ts.map +1 -1
- package/build/AntConnect.js +2 -0
- package/build/AntHttpClient.d.ts +0 -5
- package/build/AntHttpClient.d.ts.map +1 -1
- package/build/AntHttpClient.js +0 -5
- package/build/ai/index.d.ts +5 -0
- package/build/ai/index.d.ts.map +1 -0
- package/build/ai/index.js +3 -0
- package/build/ai/mutationDescriptors.d.ts +3 -0
- package/build/ai/mutationDescriptors.d.ts.map +1 -0
- package/build/ai/mutationDescriptors.js +207 -0
- package/build/ai/mutationTargets.d.ts +21 -0
- package/build/ai/mutationTargets.d.ts.map +1 -0
- package/build/ai/mutationTargets.js +72 -0
- package/build/ai/queryDescriptors.d.ts +3 -0
- package/build/ai/queryDescriptors.d.ts.map +1 -0
- package/build/ai/queryDescriptors.js +174 -0
- package/build/ai/types.d.ts +35 -0
- package/build/ai/types.d.ts.map +1 -0
- package/build/ai/types.js +1 -0
- package/build/comms/client.js +1 -1
- package/build/comms/hostAPI.js +1 -1
- package/build/comms/models.d.ts +20 -2
- package/build/comms/models.d.ts.map +1 -1
- package/build/index.d.ts +3 -1
- package/build/index.d.ts.map +1 -1
- package/build/service-runtime.d.ts +3 -0
- package/build/service-runtime.d.ts.map +1 -1
- package/build/service-runtime.js +3 -0
- 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 +2 -1
- package/build/service-types.d.ts.map +1 -1
- package/build/services/AiService.d.ts +18 -0
- package/build/services/AiService.d.ts.map +1 -0
- package/build/services/AiService.js +9 -0
- package/build/services/AppService/factory/resourceAccess.d.ts +21 -0
- package/build/services/AppService/factory/resourceAccess.d.ts.map +1 -0
- package/build/services/AppService/factory/resourceAccess.js +37 -0
- package/build/services/AppService/factory/resourceCommerce.d.ts +52 -0
- package/build/services/AppService/factory/resourceCommerce.d.ts.map +1 -0
- package/build/services/AppService/factory/resourceCommerce.js +18 -0
- package/build/services/AppService/factory/resourceSnapshot.d.ts +62 -0
- package/build/services/AppService/factory/resourceSnapshot.d.ts.map +1 -0
- package/build/services/AppService/factory/resourceSnapshot.js +34 -0
- package/build/services/AppService/factory/resources.d.ts +153 -0
- package/build/services/AppService/factory/resources.d.ts.map +1 -0
- package/build/services/AppService/factory/resources.js +44 -0
- package/build/services/AppService/index.d.ts +2 -1
- package/build/services/AppService/index.d.ts.map +1 -1
- package/build/services/AppService/index.js +9 -2
- package/build/services/AppService/types/appList.d.ts +28 -0
- package/build/services/AppService/types/appList.d.ts.map +1 -1
- package/build/services/AppService/types/appManifest.d.ts +46 -0
- package/build/services/AppService/types/appManifest.d.ts.map +1 -1
- package/build/services/AppService/types/appRequests.d.ts +13 -0
- package/build/services/AppService/types/appRequests.d.ts.map +1 -1
- package/build/services/AppService/types/resourceEntitlements.d.ts +101 -0
- package/build/services/AppService/types/resourceEntitlements.d.ts.map +1 -0
- package/build/services/AppService/types/resourceEntitlements.js +1 -0
- package/build/services/AppService/types/resourceReleases.d.ts +143 -0
- package/build/services/AppService/types/resourceReleases.d.ts.map +1 -0
- package/build/services/AppService/types/resourceReleases.js +1 -0
- package/build/services/AppService/types/resourceRequests.d.ts +105 -0
- package/build/services/AppService/types/resourceRequests.d.ts.map +1 -0
- package/build/services/AppService/types/resourceRequests.js +1 -0
- package/build/services/AppService/types/sellableResources.d.ts +189 -0
- package/build/services/AppService/types/sellableResources.d.ts.map +1 -0
- package/build/services/AppService/types/sellableResources.js +1 -0
- package/build/services/AppService/types/snapshotPayload.d.ts +146 -0
- package/build/services/AppService/types/snapshotPayload.d.ts.map +1 -0
- package/build/services/AppService/types/snapshotPayload.js +16 -0
- package/build/services/AppService/types/snapshotSources.d.ts +98 -0
- package/build/services/AppService/types/snapshotSources.d.ts.map +1 -0
- package/build/services/AppService/types/snapshotSources.js +7 -0
- package/build/services/AppService/types.d.ts +6 -0
- package/build/services/AppService/types.d.ts.map +1 -1
- package/build/services/AppService/types.js +6 -0
- package/build/services/TokenService.d.ts +0 -1
- package/build/services/TokenService.d.ts.map +1 -1
- package/build/services/TokenService.js +0 -2
- package/build/services/UserService.d.ts +3 -0
- package/build/services/UserService.d.ts.map +1 -1
- package/build/services/Websockets/StoreEvents.d.ts +14 -1
- package/build/services/Websockets/StoreEvents.d.ts.map +1 -1
- package/build/services/userPreferences.d.ts +37 -0
- package/build/services/userPreferences.d.ts.map +1 -0
- package/build/services/userPreferences.js +39 -0
- package/package.json +3 -2
- package/schemas/app-config.schema.json +79 -8
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Snapshot payload shapes (AAD-939) — the first payload type a sellable resource
|
|
3
|
+
* can have.
|
|
4
|
+
*
|
|
5
|
+
* A snapshot publishes a linked dynamic table with an EXPLICIT column selection.
|
|
6
|
+
* File upload is deliberately not a source; there is one path in.
|
|
7
|
+
*
|
|
8
|
+
* Two things about this file are load-bearing:
|
|
9
|
+
*
|
|
10
|
+
* 1. `SnapshotPayloadSchema` is the DECLARED schema, recorded once per version and
|
|
11
|
+
* **not backfillable**. AAD-942 builds structural diffs on it.
|
|
12
|
+
* 2. Materialisation is QUEUED. A version is created `pending` and a job flips it
|
|
13
|
+
* to `ready` or `failed`, so nothing here is servable the moment
|
|
14
|
+
* `createResourceVersion` returns.
|
|
15
|
+
*/
|
|
16
|
+
/** A column type a dataset may publish. */
|
|
17
|
+
export type SnapshotFieldType = 'boolean' | 'integer' | 'float' | 'text' | 'text-field' | 'link' | 'email' | 'dropdown' | 'sbscode' | 'date';
|
|
18
|
+
/** Which table a snapshot reads from. Must belong to the publisher's own license. */
|
|
19
|
+
export interface SnapshotSourceSelection {
|
|
20
|
+
table_id: string;
|
|
21
|
+
}
|
|
22
|
+
/** One published column. */
|
|
23
|
+
export interface SnapshotColumnSelection {
|
|
24
|
+
/** The logical `columns.id`. Selection is by ID, never by name. */
|
|
25
|
+
column_id: string;
|
|
26
|
+
/**
|
|
27
|
+
* Optional output key. Defaults to the column's name.
|
|
28
|
+
*
|
|
29
|
+
* Letters, numbers, underscores and hyphens only, and unique across the
|
|
30
|
+
* selection — a duplicate key collapses in JSON and produces two identically
|
|
31
|
+
* named CSV columns, so the dataset would not match its own schema.
|
|
32
|
+
*/
|
|
33
|
+
key?: string | null;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* A row filter.
|
|
37
|
+
*
|
|
38
|
+
* ⚠️ **Accepted and stored, but NOT yet applied.** The shape is fixed now so
|
|
39
|
+
* nothing has to be reshaped later, but a version carrying a non-empty filter
|
|
40
|
+
* fails materialisation with `payload_error` "Row filters are not supported yet".
|
|
41
|
+
* Do not offer filtering in the publish flow until the backend applies it — the
|
|
42
|
+
* preview reports `row_filters_supported: false` for exactly this reason.
|
|
43
|
+
*/
|
|
44
|
+
export interface SnapshotRowFilter {
|
|
45
|
+
column_id: string;
|
|
46
|
+
operator: '=' | '>' | '<' | '>=' | '<=' | '<>' | 'like' | 'not like' | 'is null' | 'is not null' | 'between';
|
|
47
|
+
value?: unknown;
|
|
48
|
+
values?: unknown[];
|
|
49
|
+
boolean?: 'and' | 'or';
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* What the publisher declared for a snapshot version.
|
|
53
|
+
*
|
|
54
|
+
* `declarations.contains_personal_data` is REQUIRED on create and `true` is
|
|
55
|
+
* refused with a 422 — publishing personal data is not possible in v1, so this is
|
|
56
|
+
* a blocking question rather than a warning.
|
|
57
|
+
*/
|
|
58
|
+
export interface SnapshotPayloadConfig {
|
|
59
|
+
source: SnapshotSourceSelection;
|
|
60
|
+
columns: SnapshotColumnSelection[];
|
|
61
|
+
filters?: SnapshotRowFilter[];
|
|
62
|
+
declarations: {
|
|
63
|
+
contains_personal_data: boolean;
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
/** One field of the declared schema. */
|
|
67
|
+
export interface SnapshotFieldSchema {
|
|
68
|
+
/** The stable key in the payload — what buyer code reads. */
|
|
69
|
+
key: string;
|
|
70
|
+
/** The publisher's human label. Display only; renaming it breaks nothing. */
|
|
71
|
+
label: string | null;
|
|
72
|
+
type: SnapshotFieldType;
|
|
73
|
+
/**
|
|
74
|
+
* Whether this field is null anywhere in THIS artifact.
|
|
75
|
+
*
|
|
76
|
+
* MEASURED, not declared. The source column's `required` flag is a write-time UI
|
|
77
|
+
* hint that no record write path enforces, so it cannot answer the question —
|
|
78
|
+
* a `required` column can and does contain nulls. A field is reported nullable
|
|
79
|
+
* when a null was actually seen, or when the dataset is empty (zero rows cannot
|
|
80
|
+
* demonstrate non-nullability).
|
|
81
|
+
*
|
|
82
|
+
* It describes the bytes the buyer received, not a promise about future versions.
|
|
83
|
+
*/
|
|
84
|
+
nullable: boolean;
|
|
85
|
+
/** `observed` from the artifact, or `declared` from the column flag (preview only). */
|
|
86
|
+
nullable_source: 'observed' | 'declared';
|
|
87
|
+
/** How many rows had null here. Null when not measured (preview). */
|
|
88
|
+
null_count: number | null;
|
|
89
|
+
/** What the source column claimed. Recorded for AAD-942; not what `nullable` is from. */
|
|
90
|
+
declared_required: boolean;
|
|
91
|
+
/** Position in the payload. CSV column order follows it. */
|
|
92
|
+
order: number;
|
|
93
|
+
/** The source column's id, so AAD-942 can tell a rename from a remove-plus-add. */
|
|
94
|
+
source_column_id: string;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* The declared schema stored on a materialised version.
|
|
98
|
+
*
|
|
99
|
+
* Null until the job completes. `row_count` / `byte_size` are also flattened onto
|
|
100
|
+
* `ResourceVersion` for convenience.
|
|
101
|
+
*/
|
|
102
|
+
export interface SnapshotPayloadSchema {
|
|
103
|
+
/**
|
|
104
|
+
* 1 = nullability derived from the column flag (never shipped).
|
|
105
|
+
* 2 = nullability observed from the artifact, with `null_count`.
|
|
106
|
+
*/
|
|
107
|
+
schema_version: number;
|
|
108
|
+
fields: SnapshotFieldSchema[];
|
|
109
|
+
row_count: number;
|
|
110
|
+
byte_size: number;
|
|
111
|
+
materialised_at: string;
|
|
112
|
+
source: {
|
|
113
|
+
table_id: string;
|
|
114
|
+
table_name: string | null;
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* A dry run of a selection, before creating a version from it.
|
|
119
|
+
*
|
|
120
|
+
* This is how a publisher learns they are over a ceiling BEFORE publishing.
|
|
121
|
+
* Above either ceiling the backend REFUSES the version rather than truncating it,
|
|
122
|
+
* so surfacing `exceeds_limits` here is what keeps that refusal from being a
|
|
123
|
+
* surprise at the last step.
|
|
124
|
+
*/
|
|
125
|
+
export interface SnapshotPreview {
|
|
126
|
+
row_count: number;
|
|
127
|
+
/** Extrapolated from the sample, not measured. Order of magnitude only. */
|
|
128
|
+
estimated_bytes: number;
|
|
129
|
+
exceeds_limits: {
|
|
130
|
+
rows: boolean;
|
|
131
|
+
bytes: boolean;
|
|
132
|
+
};
|
|
133
|
+
limits: {
|
|
134
|
+
max_rows: number;
|
|
135
|
+
max_bytes: number;
|
|
136
|
+
};
|
|
137
|
+
/** Exactly the schema that would be recorded, so the contract is reviewable. */
|
|
138
|
+
schema: SnapshotFieldSchema[];
|
|
139
|
+
/** First N rows, shaped as the payload would be. Always a sample. */
|
|
140
|
+
sample: Array<Record<string, unknown>>;
|
|
141
|
+
/** True when `sample` is shorter than `row_count`. A preview may truncate; a published dataset never does. */
|
|
142
|
+
truncated: boolean;
|
|
143
|
+
/** False until row filters are applied server-side. */
|
|
144
|
+
row_filters_supported: boolean;
|
|
145
|
+
}
|
|
146
|
+
//# sourceMappingURL=snapshotPayload.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snapshotPayload.d.ts","sourceRoot":"","sources":["../../../../src/services/AppService/types/snapshotPayload.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,2CAA2C;AAC3C,MAAM,MAA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;IACxC,qEAAqE;IACrE,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,yFAAyF;IACzF,iBAAiB,EAAE,OAAO,CAAA;IAC1B,4DAA4D;IAC5D,KAAK,EAAE,MAAM,CAAA;IACb,mFAAmF;IACnF,gBAAgB,EAAE,MAAM,CAAA;CACzB;AAED;;;;;GAKG;AACH,MAAM,WAAW,qBAAqB;IACpC;;;OAGG;IACH,cAAc,EAAE,MAAM,CAAA;IACtB,MAAM,EAAE,mBAAmB,EAAE,CAAA;IAC7B,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,eAAe,EAAE,MAAM,CAAA;IACvB,MAAM,EAAE;QACN,QAAQ,EAAE,MAAM,CAAA;QAChB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;KAC1B,CAAA;CACF;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,CAAA;IACjB,2EAA2E;IAC3E,eAAe,EAAE,MAAM,CAAA;IACvB,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;KAClB,CAAA;IACD,gFAAgF;IAChF,MAAM,EAAE,mBAAmB,EAAE,CAAA;IAC7B,qEAAqE;IACrE,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;IACtC,8GAA8G;IAC9G,SAAS,EAAE,OAAO,CAAA;IAClB,uDAAuD;IACvD,qBAAqB,EAAE,OAAO,CAAA;CAC/B"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Snapshot payload shapes (AAD-939) — the first payload type a sellable resource
|
|
3
|
+
* can have.
|
|
4
|
+
*
|
|
5
|
+
* A snapshot publishes a linked dynamic table with an EXPLICIT column selection.
|
|
6
|
+
* File upload is deliberately not a source; there is one path in.
|
|
7
|
+
*
|
|
8
|
+
* Two things about this file are load-bearing:
|
|
9
|
+
*
|
|
10
|
+
* 1. `SnapshotPayloadSchema` is the DECLARED schema, recorded once per version and
|
|
11
|
+
* **not backfillable**. AAD-942 builds structural diffs on it.
|
|
12
|
+
* 2. Materialisation is QUEUED. A version is created `pending` and a job flips it
|
|
13
|
+
* to `ready` or `failed`, so nothing here is servable the moment
|
|
14
|
+
* `createResourceVersion` returns.
|
|
15
|
+
*/
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,98 @@
|
|
|
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' | 'internal_error';
|
|
27
|
+
/**
|
|
28
|
+
* The numbers behind a failure, so a client can build its own sentence.
|
|
29
|
+
*
|
|
30
|
+
* Every field is optional: which ones are present depends on the code. Key ORDER is
|
|
31
|
+
* not stable — it round-trips through a MySQL JSON column, which reorders object
|
|
32
|
+
* keys — so read by name.
|
|
33
|
+
*/
|
|
34
|
+
export interface SnapshotErrorContext {
|
|
35
|
+
actual_rows?: number;
|
|
36
|
+
max_rows?: number;
|
|
37
|
+
max_bytes?: number;
|
|
38
|
+
column_name?: string;
|
|
39
|
+
column_type?: string;
|
|
40
|
+
/** `snapshot_limits_misconfigured` only — the setting at fault, e.g. `STORE_RESOURCE_SNAPSHOT_MAX_ROWS`. */
|
|
41
|
+
env_var?: string;
|
|
42
|
+
config_key?: string;
|
|
43
|
+
/** What the ceiling resolved to: `0`, or null when the setting is absent entirely. */
|
|
44
|
+
resolved?: number | null;
|
|
45
|
+
[key: string]: unknown;
|
|
46
|
+
}
|
|
47
|
+
/** Which table, and who owns it. */
|
|
48
|
+
export interface SnapshotSourceOwner {
|
|
49
|
+
type: 'project' | 'license' | 'unknown';
|
|
50
|
+
id: string | null;
|
|
51
|
+
/** The project (or license) name — what makes two same-named tables tellable apart. */
|
|
52
|
+
name: string | null;
|
|
53
|
+
}
|
|
54
|
+
/** Why a source table cannot be used. */
|
|
55
|
+
export type SnapshotSourceUnavailableReason = 'storage_missing' | 'no_publishable_columns';
|
|
56
|
+
/**
|
|
57
|
+
* A table the publisher can build a dataset from.
|
|
58
|
+
*
|
|
59
|
+
* From `previewResourceSnapshot`'s sibling, `fetchSnapshotSources()`. Use this rather
|
|
60
|
+
* than the generic table listing: that one has no project attribution, no row count
|
|
61
|
+
* and no publishable-column count, so a picker built on it shows identical rows for
|
|
62
|
+
* same-named tables in different projects and needs one extra request per table.
|
|
63
|
+
*/
|
|
64
|
+
export interface SnapshotSource {
|
|
65
|
+
table_id: string;
|
|
66
|
+
name: string;
|
|
67
|
+
owner: SnapshotSourceOwner;
|
|
68
|
+
/**
|
|
69
|
+
* Live rows (soft-deleted excluded). Exact, so it can be compared to the ceiling.
|
|
70
|
+
*
|
|
71
|
+
* **Null when the table has no physical storage behind it** — a `tables` row whose
|
|
72
|
+
* underlying table was never created or has since been dropped, which does occur.
|
|
73
|
+
* Null means "could not look", which is not the same fact as a real `0`, and a
|
|
74
|
+
* publisher judging a selection against the row ceiling needs to tell them apart.
|
|
75
|
+
*/
|
|
76
|
+
row_count: number | null;
|
|
77
|
+
column_count: number;
|
|
78
|
+
/** Columns of a type a dataset may publish. */
|
|
79
|
+
publishable_column_count: number;
|
|
80
|
+
/**
|
|
81
|
+
* False when the table cannot be used as a source.
|
|
82
|
+
*
|
|
83
|
+
* Show the row and disable it rather than filtering it out — a publisher looking
|
|
84
|
+
* for a table they know exists should find it and learn why it is unusable.
|
|
85
|
+
*/
|
|
86
|
+
is_publishable: boolean;
|
|
87
|
+
/**
|
|
88
|
+
* Why it cannot be used, or null when it can.
|
|
89
|
+
*
|
|
90
|
+
* - `storage_missing` — no physical table behind the row; nothing we can publish
|
|
91
|
+
* - `no_publishable_columns` — real table, but no column of a publishable type
|
|
92
|
+
*
|
|
93
|
+
* Two genuinely different problems, so the disabled row can say which rather than
|
|
94
|
+
* leaving the reader to infer it from a zero.
|
|
95
|
+
*/
|
|
96
|
+
unavailable_reason: SnapshotSourceUnavailableReason | null;
|
|
97
|
+
}
|
|
98
|
+
//# sourceMappingURL=snapshotSources.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snapshotSources.d.ts","sourceRoot":"","sources":["../../../../src/services/AppService/types/snapshot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EAAE,OAAO,CAAA;IACvB;;;;;;;;OAQG;IACH,kBAAkB,EAAE,+BAA+B,GAAG,IAAI,CAAA;CAC3D"}
|
|
@@ -12,6 +12,12 @@ export * from './types/channels';
|
|
|
12
12
|
export * from './types/pricingTiers';
|
|
13
13
|
export * from './types/publisherStats';
|
|
14
14
|
export * from './types/releaseChannels';
|
|
15
|
+
export * from './types/resourceEntitlements';
|
|
16
|
+
export * from './types/resourceReleases';
|
|
17
|
+
export * from './types/resourceRequests';
|
|
15
18
|
export * from './types/seats';
|
|
19
|
+
export * from './types/sellableResources';
|
|
20
|
+
export * from './types/snapshotPayload';
|
|
21
|
+
export * from './types/snapshotSources';
|
|
16
22
|
export * from './types/subscriptions';
|
|
17
23
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/services/AppService/types.ts"],"names":[],"mappings":"AAIA,cAAc,wBAAwB,CAAA;AACtC,cAAc,aAAa,CAAA;AAC3B,cAAc,uBAAuB,CAAA;AACrC,cAAc,sBAAsB,CAAA;AACpC,cAAc,yBAAyB,CAAA;AACvC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,qBAAqB,CAAA;AACnC,cAAc,kBAAkB,CAAA;AAChC,cAAc,qBAAqB,CAAA;AACnC,cAAc,mBAAmB,CAAA;AACjC,cAAc,kBAAkB,CAAA;AAChC,cAAc,sBAAsB,CAAA;AACpC,cAAc,wBAAwB,CAAA;AACtC,cAAc,yBAAyB,CAAA;AACvC,cAAc,eAAe,CAAA;AAC7B,cAAc,uBAAuB,CAAA"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/services/AppService/types.ts"],"names":[],"mappings":"AAIA,cAAc,wBAAwB,CAAA;AACtC,cAAc,aAAa,CAAA;AAC3B,cAAc,uBAAuB,CAAA;AACrC,cAAc,sBAAsB,CAAA;AACpC,cAAc,yBAAyB,CAAA;AACvC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,qBAAqB,CAAA;AACnC,cAAc,kBAAkB,CAAA;AAChC,cAAc,qBAAqB,CAAA;AACnC,cAAc,mBAAmB,CAAA;AACjC,cAAc,kBAAkB,CAAA;AAChC,cAAc,sBAAsB,CAAA;AACpC,cAAc,wBAAwB,CAAA;AACtC,cAAc,yBAAyB,CAAA;AACvC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,0BAA0B,CAAA;AACxC,cAAc,0BAA0B,CAAA;AACxC,cAAc,eAAe,CAAA;AAC7B,cAAc,2BAA2B,CAAA;AACzC,cAAc,yBAAyB,CAAA;AACvC,cAAc,yBAAyB,CAAA;AACvC,cAAc,uBAAuB,CAAA"}
|
|
@@ -15,5 +15,11 @@ export * from './types/channels';
|
|
|
15
15
|
export * from './types/pricingTiers';
|
|
16
16
|
export * from './types/publisherStats';
|
|
17
17
|
export * from './types/releaseChannels';
|
|
18
|
+
export * from './types/resourceEntitlements';
|
|
19
|
+
export * from './types/resourceReleases';
|
|
20
|
+
export * from './types/resourceRequests';
|
|
18
21
|
export * from './types/seats';
|
|
22
|
+
export * from './types/sellableResources';
|
|
23
|
+
export * from './types/snapshotPayload';
|
|
24
|
+
export * from './types/snapshotSources';
|
|
19
25
|
export * from './types/subscriptions';
|
|
@@ -38,7 +38,6 @@ export interface TokenService {
|
|
|
38
38
|
createToken: (body: CreateTokenBody) => Promise<CreateTokenResponse>;
|
|
39
39
|
updateToken: (tokenId: string, body: UpdateTokenBody) => Promise<UpdateTokenResponse>;
|
|
40
40
|
deleteToken: (tokenId: string) => Promise<DeleteTokenResponse>;
|
|
41
|
-
getCookieAuthUrl: () => string;
|
|
42
41
|
}
|
|
43
42
|
export declare function newTokenService(client: AntHttpClient): TokenService;
|
|
44
43
|
export default newTokenService;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TokenService.d.ts","sourceRoot":"","sources":["../../src/services/TokenService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK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AC,WAAW,EAAE,CAAC,CAAA;IACvC,SAAS,EAAE,MAAM,OAAO,CAAC,UAAU,EAAE,CAAC,CAAA;IACtC,WAAW,EAAE,CAAC,IAAI,EAAE,eAAe,KAAK,OAAO,CAAC,mBAAmB,CAAC,CAAA;IACpE,WAAW,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,eAAe,KAAK,OAAO,CAAC,mBAAmB,CAAC,CAAA;IACrF,WAAW,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,mBAAmB,CAAC,CAAA;CAC/D;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,aAAa,GAAG,YAAY,CAYnE;AAED,eAAe,eAAe,CAAA"}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
export function newTokenService(client) {
|
|
2
|
-
const base = client.baseUrl ?? client.getBaseUrl?.();
|
|
3
2
|
return {
|
|
4
3
|
getTokens: async () => await client.get('/tokens'),
|
|
5
4
|
getScopes: async () => await client.get('/tokens/scopes'),
|
|
6
5
|
createToken: async (body) => await client.post('/tokens', body),
|
|
7
6
|
updateToken: async (tokenId, body) => await client.put(`/tokens/${tokenId}`, body),
|
|
8
7
|
deleteToken: async (tokenId) => await client.delete(`/tokens/${tokenId}`),
|
|
9
|
-
getCookieAuthUrl: () => `${base}/api/2.0/tokens/cookie`,
|
|
10
8
|
};
|
|
11
9
|
}
|
|
12
10
|
export default newTokenService;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { License } from './LicenseService';
|
|
2
|
+
import type { UserPreferences } from './userPreferences';
|
|
2
3
|
import type { MessageResponse } from "../AntConnect";
|
|
3
4
|
import type { AntHttpClient } from "../AntHttpClient";
|
|
4
5
|
import type { TokenResponse } from "../types";
|
|
@@ -40,6 +41,8 @@ export interface User {
|
|
|
40
41
|
profile_picture?: string | null;
|
|
41
42
|
/** Days until the password expires (negative once already expired). Set by getAuthenticatedUser. */
|
|
42
43
|
password_expires_in?: number;
|
|
44
|
+
/** `users.preferences` JSON column; shape owned by `userPreferencesSchema`. */
|
|
45
|
+
preferences?: UserPreferences | null;
|
|
43
46
|
}
|
|
44
47
|
export interface AuthUser extends Partial<User> {
|
|
45
48
|
password: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserService.d.ts","sourceRoot":"","sources":["../../src/services/UserService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAC/C,OAAO,KAAK,EAAE,eAAe,EAAE,sBAAoB;AACnD,OAAO,KAAK,EAAE,aAAa,EAAE,yBAAuB;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAe;AAE5C,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG;IAClC,QAAQ,EAAE,OAAO,CAAA;IACjB,YAAY,EAAE,OAAO,CAAA;CACtB,CAAA;AAED,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,UAAU,CAAA;IAC1C,eAAe,EAAE,MAAM,CAAA;IACvB,YAAY,CAAC,EAAE,OAAO,CAAA;CACvB;AAED,MAAM,WAAW,IAAI;IACnB,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,EAAE,MAAM,CAAA;IACV,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;CACb;AAED,MAAM,WAAW,IAAI;IACnB,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,MAAM,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E,MAAM,KAAK,OAAO,CAAC,eAAe,CAAC,CAAA;IACjE,aAAa,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,eAAe,CAAC,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAA;IACpE,gBAAgB,EAAE,CAAC,IAAI,EAAE,uBAAuB,KAAK,OAAO,CAAC,wBAAwB,CAAC,CAAA;IACtF,eAAe,EAAE,CAAC,IAAI,EAAE,sBAAsB,KAAK,OAAO,CAAC,uBAAuB,CAAC,CAAA;IACnF,iBAAiB,EAAE,MAAM,OAAO,CAAC,yBAAyB,CAAC,CAAA;IAC3D,eAAe,EAAE,CAAC,IAAI,EAAE,sBAAsB,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAA;IACpE,QAAQ,EAAE,CAAC,IAAI,EAAE,gBAAgB,KAAK,OAAO,CAAC,oBAAoB,CAAC,CAAA;CACpE;AAED,wBAAgB,cAAc,CAAC,UAAU,EAAE,aAAa,GAAG,WAAW,CAerE;AAED,eAAe,WAAW,CAAA"}
|
|
@@ -27,5 +27,18 @@ export interface AppVersionUnpublishedEvent {
|
|
|
27
27
|
} | null;
|
|
28
28
|
release_channel_id: string | null;
|
|
29
29
|
}
|
|
30
|
-
export
|
|
30
|
+
export interface ResourceVersionPublishedEvent {
|
|
31
|
+
type: 'resourceVersionPublished';
|
|
32
|
+
resource: {
|
|
33
|
+
id: string;
|
|
34
|
+
title: string | null;
|
|
35
|
+
};
|
|
36
|
+
resource_version: {
|
|
37
|
+
id: string;
|
|
38
|
+
version: string;
|
|
39
|
+
};
|
|
40
|
+
/** The channel the version was published onto. */
|
|
41
|
+
release_channel_id: string | null;
|
|
42
|
+
}
|
|
43
|
+
export type StoreWebSocketEvent = AppVersionPublishedEvent | AppVersionUnpublishedEvent | ResourceVersionPublishedEvent;
|
|
31
44
|
//# sourceMappingURL=StoreEvents.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StoreEvents.d.ts","sourceRoot":"","sources":["../../../src/services/Websockets/StoreEvents.ts"],"names":[],"mappings":"AAoBA,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,qBAAqB,CAAA;IAC3B,GAAG,EAAE;QACH,EAAE,EAAE,MAAM,CAAA;QACV,KAAK,EAAE,MAAM,CAAA;KACd,CAAA;IACD,WAAW,EAAE;QACX,EAAE,EAAE,MAAM,CAAA;QACV,OAAO,EAAE,MAAM,CAAA;KAChB,CAAA;IACD,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAA;CAClC;AA8BD,MAAM,WAAW,0BAA0B;IACzC,IAAI,EAAE,uBAAuB,CAAA;IAC7B,GAAG,EAAE;QACH,EAAE,EAAE,MAAM,CAAA;QACV,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;KACrB,CAAA;IACD;;;;OAIG;IACH,WAAW,EAAE;QACX,EAAE,EAAE,MAAM,CAAA;QACV,OAAO,EAAE,MAAM,CAAA;KAChB,GAAG,IAAI,CAAA;IACR,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAA;CAClC;AAID,MAAM,MAAM,mBAAmB,GAAG,wBAAwB,GAAG,0BAA0B,CAAA"}
|
|
1
|
+
{"version":3,"file":"StoreEvents.d.ts","sourceRoot":"","sources":["../../../src/services/Websockets/StoreEvents.ts"],"names":[],"mappings":"AAoBA,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,qBAAqB,CAAA;IAC3B,GAAG,EAAE;QACH,EAAE,EAAE,MAAM,CAAA;QACV,KAAK,EAAE,MAAM,CAAA;KACd,CAAA;IACD,WAAW,EAAE;QACX,EAAE,EAAE,MAAM,CAAA;QACV,OAAO,EAAE,MAAM,CAAA;KAChB,CAAA;IACD,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAA;CAClC;AA8BD,MAAM,WAAW,0BAA0B;IACzC,IAAI,EAAE,uBAAuB,CAAA;IAC7B,GAAG,EAAE;QACH,EAAE,EAAE,MAAM,CAAA;QACV,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;KACrB,CAAA;IACD;;;;OAIG;IACH,WAAW,EAAE;QACX,EAAE,EAAE,MAAM,CAAA;QACV,OAAO,EAAE,MAAM,CAAA;KAChB,GAAG,IAAI,CAAA;IACR,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAA;CAClC;AA+BD,MAAM,WAAW,6BAA6B;IAC5C,IAAI,EAAE,0BAA0B,CAAA;IAChC,QAAQ,EAAE;QACR,EAAE,EAAE,MAAM,CAAA;QACV,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;KACrB,CAAA;IACD,gBAAgB,EAAE;QAChB,EAAE,EAAE,MAAM,CAAA;QACV,OAAO,EAAE,MAAM,CAAA;KAChB,CAAA;IACD,kDAAkD;IAClD,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAA;CAClC;AAID,MAAM,MAAM,mBAAmB,GAAG,wBAAwB,GAAG,0BAA0B,GAAG,6BAA6B,CAAA"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export interface AiPreferences {
|
|
3
|
+
enabled: boolean;
|
|
4
|
+
/** Browser-side loop only (no backend needed) — the endpoint the tab calls directly. */
|
|
5
|
+
baseUrl: string;
|
|
6
|
+
/** Model for the browser-side loop. Pairs with `baseUrl`. */
|
|
7
|
+
model: string;
|
|
8
|
+
/**
|
|
9
|
+
* Which server-side model the gateway should use for this user's chats.
|
|
10
|
+
*
|
|
11
|
+
* A KEY into `ai.gateway.dev_endpoints`, never a URL: the server dereferences
|
|
12
|
+
* this, and a user-supplied address would be a read SSRF. Empty means the
|
|
13
|
+
* server default. An unknown key also falls back to the default.
|
|
14
|
+
*/
|
|
15
|
+
endpoint: string;
|
|
16
|
+
}
|
|
17
|
+
export interface DevModePreferences {
|
|
18
|
+
enabled: boolean;
|
|
19
|
+
ai: AiPreferences;
|
|
20
|
+
}
|
|
21
|
+
export interface UserPreferences {
|
|
22
|
+
devMode: DevModePreferences;
|
|
23
|
+
}
|
|
24
|
+
export declare const userPreferencesSchema: z.ZodObject<{
|
|
25
|
+
devMode: z.ZodCatch<z.ZodObject<{
|
|
26
|
+
enabled: z.ZodCatch<z.ZodBoolean>;
|
|
27
|
+
ai: z.ZodCatch<z.ZodObject<{
|
|
28
|
+
enabled: z.ZodCatch<z.ZodBoolean>;
|
|
29
|
+
baseUrl: z.ZodCatch<z.ZodString>;
|
|
30
|
+
model: z.ZodCatch<z.ZodString>;
|
|
31
|
+
endpoint: z.ZodCatch<z.ZodString>;
|
|
32
|
+
}, z.core.$strip>>;
|
|
33
|
+
}, z.core.$strip>>;
|
|
34
|
+
}, z.core.$strip>;
|
|
35
|
+
export declare const defaultUserPreferences: UserPreferences;
|
|
36
|
+
export declare function parseUserPreferences(raw: unknown): UserPreferences;
|
|
37
|
+
//# sourceMappingURL=userPreferences.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"userPreferences.d.ts","sourceRoot":"","sources":["../../src/services/userPreferences.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAUvB,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,OAAO,CAAA;IAChB,wFAAwF;IACxF,OAAO,EAAE,MAAM,CAAA;IACf,6DAA6D;IAC7D,KAAK,EAAE,MAAM,CAAA;IACb;;;;;;OAMG;IACH,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,OAAO,CAAA;IAChB,EAAE,EAAE,aAAa,CAAA;CAClB;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,kBAAkB,CAAA;CAC5B;AAcD,eAAO,MAAM,qBAAqB;;;;;;;;;;iBAEhC,CAAA;AAEF,eAAO,MAAM,sBAAsB,EAAE,eAKpC,CAAA;AAED,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,OAAO,GAAG,eAAe,CAmBlE"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
const aiPreferencesSchema = z.object({
|
|
3
|
+
enabled: z.boolean().catch(false),
|
|
4
|
+
baseUrl: z.string().catch(''),
|
|
5
|
+
model: z.string().catch(''),
|
|
6
|
+
endpoint: z.string().catch(''),
|
|
7
|
+
}).catch({ enabled: false, baseUrl: '', model: '', endpoint: '' });
|
|
8
|
+
const devModePreferencesSchema = z.object({
|
|
9
|
+
enabled: z.boolean().catch(false),
|
|
10
|
+
ai: aiPreferencesSchema,
|
|
11
|
+
}).catch({ enabled: false, ai: { enabled: false, baseUrl: '', model: '', endpoint: '' } });
|
|
12
|
+
export const userPreferencesSchema = z.object({
|
|
13
|
+
devMode: devModePreferencesSchema,
|
|
14
|
+
});
|
|
15
|
+
export const defaultUserPreferences = {
|
|
16
|
+
devMode: {
|
|
17
|
+
enabled: false,
|
|
18
|
+
ai: { enabled: false, baseUrl: '', model: '', endpoint: '' },
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
export function parseUserPreferences(raw) {
|
|
22
|
+
const result = userPreferencesSchema.safeParse(raw);
|
|
23
|
+
if (!result.success)
|
|
24
|
+
return structuredClone(defaultUserPreferences);
|
|
25
|
+
// Normalize explicitly: zod's catch() output is typed optional under
|
|
26
|
+
// non-strict tsconfigs (the codegen one), so ?? the defaults per field.
|
|
27
|
+
const devMode = result.data.devMode;
|
|
28
|
+
return {
|
|
29
|
+
devMode: {
|
|
30
|
+
enabled: devMode?.enabled ?? false,
|
|
31
|
+
ai: {
|
|
32
|
+
enabled: devMode?.ai?.enabled ?? false,
|
|
33
|
+
baseUrl: devMode?.ai?.baseUrl ?? '',
|
|
34
|
+
model: devMode?.ai?.model ?? '',
|
|
35
|
+
endpoint: devMode?.ai?.endpoint ?? '',
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antcde/connect-ts",
|
|
3
|
-
"version": "0.4.27-rc.
|
|
3
|
+
"version": "0.4.27-rc.2",
|
|
4
4
|
"description": "Helper to connect to the ANT api",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "build/index.js",
|
|
@@ -39,7 +39,8 @@
|
|
|
39
39
|
"comlink": "^4.4.2",
|
|
40
40
|
"post-robot": "10.0.46",
|
|
41
41
|
"qs": "^6.15.3",
|
|
42
|
-
"rxjs": "^7.8.2"
|
|
42
|
+
"rxjs": "^7.8.2",
|
|
43
|
+
"zod": "^4.4.3"
|
|
43
44
|
},
|
|
44
45
|
"devDependencies": {
|
|
45
46
|
"@faker-js/faker": "^9.9.0",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
3
|
"$id": "https://antcde.io/schemas/app-config.schema.json",
|
|
4
4
|
"title": "ANT App Manifest",
|
|
5
|
-
"description": "Shape of app-config.json shipped inside an ANT app's distribution. Read by ant-os and the App Store to discover what an app declares about itself.",
|
|
5
|
+
"description": "Shape of app-config.json shipped inside an ANT app's distribution. Read by ant-os and the App Store to discover what an app declares about itself. Deliberately lenient: no level sets additionalProperties, so an app may ship keys this schema does not know (a field added to the types before the schema catches up, or an app-private extension) without the manifest going invalid. Declared values are still checked — types, enums and the dropdown/options_value rule all hold. Do not re-close it without a reason: unknown keys are tolerated on purpose.",
|
|
6
6
|
"type": "object",
|
|
7
7
|
"required": ["version"],
|
|
8
8
|
"properties": {
|
|
@@ -32,13 +32,87 @@
|
|
|
32
32
|
"description": "Generic topic pub/sub capabilities keyed by topic name.",
|
|
33
33
|
"patternProperties": {
|
|
34
34
|
"^[A-Za-z0-9_-]+$": { "$ref": "#/$defs/topicEntry" }
|
|
35
|
-
}
|
|
36
|
-
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"capabilities": {
|
|
40
|
+
"type": "object",
|
|
41
|
+
"description": "What the app can be driven to do via the URL. Consumed by the AI overlay to build per-app tools and by the host to validate app-state snapshots.",
|
|
42
|
+
"properties": {
|
|
43
|
+
"queryParams": {
|
|
44
|
+
"type": "object",
|
|
45
|
+
"description": "Query params the app understands, keyed by param name.",
|
|
46
|
+
"patternProperties": {
|
|
47
|
+
"^[A-Za-z0-9_-]+$": { "$ref": "#/$defs/queryParamEntry" }
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"intents": {
|
|
51
|
+
"type": "array",
|
|
52
|
+
"description": "Named actions the app can be deep-linked into.",
|
|
53
|
+
"items": { "$ref": "#/$defs/intentEntry" }
|
|
37
54
|
}
|
|
38
55
|
}
|
|
39
56
|
}
|
|
40
57
|
},
|
|
41
58
|
"$defs": {
|
|
59
|
+
"queryParamEntry": {
|
|
60
|
+
"type": "object",
|
|
61
|
+
"description": "A single query param the app understands.",
|
|
62
|
+
"required": ["type"],
|
|
63
|
+
"properties": {
|
|
64
|
+
"type": {
|
|
65
|
+
"type": "string",
|
|
66
|
+
"enum": ["string", "number", "boolean", "date", "time", "datetime"],
|
|
67
|
+
"description": "Value type. On the URL everything is a string; number/boolean/date/time/datetime are rendering + validation hints."
|
|
68
|
+
},
|
|
69
|
+
"description": {
|
|
70
|
+
"type": "string",
|
|
71
|
+
"description": "What the param does. Surfaced to the AI as tool-parameter help."
|
|
72
|
+
},
|
|
73
|
+
"enum": {
|
|
74
|
+
"type": "array",
|
|
75
|
+
"items": { "type": "string" },
|
|
76
|
+
"description": "Allowed values. Becomes an enum constraint for the AI."
|
|
77
|
+
},
|
|
78
|
+
"multiple": {
|
|
79
|
+
"type": "boolean",
|
|
80
|
+
"default": false,
|
|
81
|
+
"description": "Accept several values (multi-select / CSV on the wire)."
|
|
82
|
+
},
|
|
83
|
+
"required": {
|
|
84
|
+
"type": "boolean",
|
|
85
|
+
"default": false,
|
|
86
|
+
"description": "Whether the param must be supplied to invoke the app."
|
|
87
|
+
},
|
|
88
|
+
"access": {
|
|
89
|
+
"type": "string",
|
|
90
|
+
"enum": ["read", "write", "readwrite"],
|
|
91
|
+
"default": "readwrite",
|
|
92
|
+
"description": "Who may drive the param. 'read' only REFLECTS app state on the URL — the AI and the confirm form show it but never set it. 'write'/'readwrite' are commandable. Defaults to 'readwrite'."
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
"intentEntry": {
|
|
97
|
+
"type": "object",
|
|
98
|
+
"description": "A named action the app can be deep-linked into.",
|
|
99
|
+
"required": ["id", "description"],
|
|
100
|
+
"properties": {
|
|
101
|
+
"id": {
|
|
102
|
+
"type": "string",
|
|
103
|
+
"description": "Stable intent identifier."
|
|
104
|
+
},
|
|
105
|
+
"description": {
|
|
106
|
+
"type": "string",
|
|
107
|
+
"description": "What the intent does. Read by the AI to match user requests."
|
|
108
|
+
},
|
|
109
|
+
"params": {
|
|
110
|
+
"type": "array",
|
|
111
|
+
"items": { "type": "string" },
|
|
112
|
+
"description": "Names of queryParams this intent uses."
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
},
|
|
42
116
|
"tableEntry": {
|
|
43
117
|
"type": "object",
|
|
44
118
|
"description": "A table the app declares. Columns are created when the app is added to a project.",
|
|
@@ -65,8 +139,7 @@
|
|
|
65
139
|
"items": { "$ref": "#/$defs/columnEntry" },
|
|
66
140
|
"minItems": 1
|
|
67
141
|
}
|
|
68
|
-
}
|
|
69
|
-
"additionalProperties": false
|
|
142
|
+
}
|
|
70
143
|
},
|
|
71
144
|
"columnEntry": {
|
|
72
145
|
"type": "object",
|
|
@@ -127,7 +200,6 @@
|
|
|
127
200
|
"description": "Display name for the column in the UI."
|
|
128
201
|
}
|
|
129
202
|
},
|
|
130
|
-
"additionalProperties": false,
|
|
131
203
|
"if": {
|
|
132
204
|
"properties": { "type": { "const": "dropdown" } }
|
|
133
205
|
},
|
|
@@ -164,8 +236,7 @@
|
|
|
164
236
|
"$ref": "https://json-schema.org/draft/2020-12/schema",
|
|
165
237
|
"description": "JSON Schema describing the topic payload shape."
|
|
166
238
|
}
|
|
167
|
-
}
|
|
168
|
-
"additionalProperties": false
|
|
239
|
+
}
|
|
169
240
|
}
|
|
170
241
|
}
|
|
171
242
|
}
|