@antcde/connect-ts 0.4.27-rc.3 → 0.4.27-rc.4

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 (79) hide show
  1. package/build/comms/client.d.ts.map +1 -1
  2. package/build/comms/client.js +39 -41
  3. package/build/comms/connection.d.ts +32 -0
  4. package/build/comms/connection.d.ts.map +1 -0
  5. package/build/comms/connection.js +159 -0
  6. package/build/comms/handshake.d.ts +16 -0
  7. package/build/comms/handshake.d.ts.map +1 -0
  8. package/build/comms/handshake.js +73 -0
  9. package/build/comms/host.d.ts.map +1 -1
  10. package/build/comms/host.js +22 -26
  11. package/build/comms/hostSlot.d.ts +23 -0
  12. package/build/comms/hostSlot.d.ts.map +1 -0
  13. package/build/comms/hostSlot.js +55 -0
  14. package/build/comms/transport.d.ts +18 -2
  15. package/build/comms/transport.d.ts.map +1 -1
  16. package/build/comms/transport.js +25 -10
  17. package/build/index.d.ts +1 -1
  18. package/build/index.d.ts.map +1 -1
  19. package/build/service-runtime.d.ts +2 -2
  20. package/build/service-runtime.d.ts.map +1 -1
  21. package/build/service-runtime.js +2 -2
  22. package/build/service-types-app.d.ts +1 -1
  23. package/build/service-types-app.d.ts.map +1 -1
  24. package/build/services/AppService/factory/categories.d.ts +30 -0
  25. package/build/services/AppService/factory/categories.d.ts.map +1 -0
  26. package/build/services/AppService/factory/categories.js +11 -0
  27. package/build/services/AppService/factory/resourceAccess.d.ts +1 -1
  28. package/build/services/AppService/factory/resourceAccess.d.ts.map +1 -1
  29. package/build/services/AppService/factory/resourceAccess.js +5 -0
  30. package/build/services/AppService/factory/resourceAssignments.d.ts +66 -0
  31. package/build/services/AppService/factory/resourceAssignments.d.ts.map +1 -0
  32. package/build/services/AppService/factory/resourceAssignments.js +12 -0
  33. package/build/services/AppService/factory/resourceSnapshot.d.ts +13 -0
  34. package/build/services/AppService/factory/resourceSnapshot.d.ts.map +1 -1
  35. package/build/services/AppService/factory/resourceSnapshot.js +21 -0
  36. package/build/services/AppService/factory/resourceUploads.d.ts +37 -0
  37. package/build/services/AppService/factory/resourceUploads.d.ts.map +1 -0
  38. package/build/services/AppService/factory/resourceUploads.js +8 -0
  39. package/build/services/AppService/factory/resources.d.ts +15 -2
  40. package/build/services/AppService/factory/resources.d.ts.map +1 -1
  41. package/build/services/AppService/factory/resources.js +5 -0
  42. package/build/services/AppService/factory/taxonomy.d.ts +25 -0
  43. package/build/services/AppService/factory/taxonomy.d.ts.map +1 -0
  44. package/build/services/AppService/factory/taxonomy.js +5 -0
  45. package/build/services/AppService/index.d.ts +4 -5
  46. package/build/services/AppService/index.d.ts.map +1 -1
  47. package/build/services/AppService/index.js +4 -6
  48. package/build/services/AppService/types/appCategories.d.ts +28 -0
  49. package/build/services/AppService/types/appCategories.d.ts.map +1 -1
  50. package/build/services/AppService/types/resourceAssignments.d.ts +38 -0
  51. package/build/services/AppService/types/resourceAssignments.d.ts.map +1 -0
  52. package/build/services/AppService/types/resourceAssignments.js +10 -0
  53. package/build/services/AppService/types/resourceEntitlements.d.ts +10 -1
  54. package/build/services/AppService/types/resourceEntitlements.d.ts.map +1 -1
  55. package/build/services/AppService/types/resourceReleases.d.ts +13 -6
  56. package/build/services/AppService/types/resourceReleases.d.ts.map +1 -1
  57. package/build/services/AppService/types/sellableResources.d.ts +43 -1
  58. package/build/services/AppService/types/sellableResources.d.ts.map +1 -1
  59. package/build/services/AppService/types/snapshotFileSource.d.ts +110 -0
  60. package/build/services/AppService/types/snapshotFileSource.d.ts.map +1 -0
  61. package/build/services/AppService/types/snapshotFileSource.js +8 -0
  62. package/build/services/AppService/types/snapshotPayload.d.ts +30 -10
  63. package/build/services/AppService/types/snapshotPayload.d.ts.map +1 -1
  64. package/build/services/AppService/types/snapshotPayload.js +5 -2
  65. package/build/services/AppService/types/snapshotSources.d.ts +19 -1
  66. package/build/services/AppService/types/snapshotSources.d.ts.map +1 -1
  67. package/build/services/AppService/types/snapshotUploads.d.ts +109 -0
  68. package/build/services/AppService/types/snapshotUploads.d.ts.map +1 -0
  69. package/build/services/AppService/types/snapshotUploads.js +20 -0
  70. package/build/services/AppService/types/taxonomy.d.ts +76 -0
  71. package/build/services/AppService/types/taxonomy.d.ts.map +1 -0
  72. package/build/services/AppService/types/taxonomy.js +1 -0
  73. package/build/services/AppService/types.d.ts +4 -0
  74. package/build/services/AppService/types.d.ts.map +1 -1
  75. package/build/services/AppService/types.js +4 -0
  76. package/build/services/Webhook/TriggerService.d.ts +44 -0
  77. package/build/services/Webhook/TriggerService.d.ts.map +1 -1
  78. package/build/services/Webhook/TriggerService.js +15 -0
  79. package/package.json +1 -1
@@ -1,11 +1,13 @@
1
1
  import qs from 'qs';
2
2
  import { newAppAccessRequestFactory } from './factory/accessRequests';
3
3
  import { newAppAssignmentFactory } from './factory/assignments';
4
+ import { newAppCategoryFactory } from './factory/categories';
4
5
  import { newReleaseChannelFactory } from './factory/channels';
5
6
  import { maybeFormData, toFormData } from './factory/formData';
6
7
  import { newAppMediaFactory } from './factory/media';
7
8
  import { newSellableResourceFactory } from './factory/resources';
8
9
  import { newSubscriptionFactory } from './factory/subscriptions';
10
+ import { newStoreTaxonomyFactory } from './factory/taxonomy';
9
11
  export * from './types';
10
12
  export function newAppService(client) {
11
13
  return {
@@ -15,6 +17,8 @@ export function newAppService(client) {
15
17
  ...newAppAssignmentFactory(client),
16
18
  ...newAppAccessRequestFactory(client),
17
19
  ...newAppMediaFactory(client),
20
+ ...newAppCategoryFactory(client),
21
+ ...newStoreTaxonomyFactory(client),
18
22
  // An icon File is sent as multipart; a scalar-only edit stays JSON. updateApp
19
23
  // is a PUT, but PHP doesn't parse multipart PUT bodies, so spoof it with POST
20
24
  // + `_method=PUT` when a file rides along.
@@ -62,12 +66,6 @@ export function newAppService(client) {
62
66
  updateInstalledApp: (appId, params = {}, requestConfig) => client.post(`/store/apps/${appId}/update`, params, requestConfig),
63
67
  batchUpdateApps: (params = {}) => client.post('/store/resources/apps/batch-update', params),
64
68
  fetchAvailableUpdates: (params = {}) => client.get('/store/resources/apps/updates-available', { params }),
65
- fetchCategories: (params = {}) => {
66
- const queryString = qs.stringify(params, { skipNulls: true, arrayFormat: 'brackets' });
67
- return client.get(`/store/app-categories${queryString ? `?${queryString}` : ''}`);
68
- },
69
- fetchCategory: categoryId => client.get(`/store/app-categories/${categoryId}`),
70
- updateAppCategories: (appId, data) => client.post(`/store/apps/${appId}/categories`, data),
71
69
  fetchAppChangelog: (appId, params = {}) => {
72
70
  const queryString = qs.stringify(params, { skipNulls: true });
73
71
  return client.get(`/store/apps/${appId}/changelog${queryString ? `?${queryString}` : ''}`);
@@ -8,8 +8,36 @@ export interface AppCategory {
8
8
  * call sites (e.g. category management screens) may not request it.
9
9
  */
10
10
  app_count?: number;
11
+ /**
12
+ * Whether a publisher may pick this category on their own listing (AAD-935
13
+ * item 2).
14
+ *
15
+ * `false` for curated buckets like "System", which group first-party apps for
16
+ * buyers to browse but are awarded by the platform — passing one to
17
+ * `updateAppCategories` or in `category_ids` is a 422. Prefer
18
+ * `fetchCategories({ assignable: true })` in the listing editor over filtering
19
+ * on this client-side.
20
+ *
21
+ * Optional because a response served before AAD-935 has no such key; treat a
22
+ * missing value as `true`.
23
+ */
24
+ is_assignable?: boolean;
11
25
  updated_at: string;
12
26
  }
27
+ /**
28
+ * Query params for the category catalog.
29
+ */
30
+ export interface FetchCategoriesParams {
31
+ search?: string;
32
+ /** Count deprecated apps in `app_count` too. */
33
+ include_deprecated?: boolean;
34
+ /**
35
+ * Narrow to categories a publisher may pick for their own listing. What the
36
+ * listing editor wants; Discover's rail wants the full list, because "System"
37
+ * is browsable.
38
+ */
39
+ assignable?: boolean;
40
+ }
13
41
  export interface CategoryRelationData {
14
42
  categories: string[];
15
43
  }
@@ -1 +1 @@
1
- {"version":3,"file":"appCategories.d.ts","sourceRoot":"","sources":["../../../../src/services/AppService/types/appCategories.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,oBAAoB;IACnC,UAAU,EAAE,MAAM,EAAE,CAAA;CACrB"}
1
+ {"version":3,"file":"appCategories.d.ts","sourceRoot":"","sources":["../../../../src/services/AppService/types/appCategories.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;;;;;;;;;;OAYG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,UAAU,EAAE,MAAM,CAAA;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,gDAAgD;IAChD,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB;AAED,MAAM,WAAW,oBAAoB;IACnC,UAAU,EAAE,MAAM,EAAE,CAAA;CACrB"}
@@ -0,0 +1,38 @@
1
+ /** A role granted `resource.use`. */
2
+ export interface ResourceAssignedRole {
3
+ role_id: string;
4
+ name: string;
5
+ /** Live rbac_role_user membership count (deleted/expiry-filtered). */
6
+ member_count: number;
7
+ }
8
+ /** A user granted `resource.use` directly, rather than through a role. */
9
+ export interface ResourceAssignedUser {
10
+ user_id: string;
11
+ name: string;
12
+ }
13
+ /**
14
+ * A license admin role. These always have access whether or not anyone assigned
15
+ * them — surfaced so the screen can say so, rather than leaving an admin
16
+ * wondering why they can read something they are not listed on.
17
+ */
18
+ export interface ResourceAdminRole {
19
+ role_id: string;
20
+ name: string;
21
+ }
22
+ /** The whole access picture for one held resource. */
23
+ export interface ResourceAssignments {
24
+ assigned_roles: ResourceAssignedRole[];
25
+ assigned_users: ResourceAssignedUser[];
26
+ admin_roles: ResourceAdminRole[];
27
+ /** Roles that could still be assigned — already excludes admin and "everyone". */
28
+ available_roles: ResourceAssignedRole[];
29
+ /**
30
+ * Whether the resource is open to every member of the license.
31
+ *
32
+ * A plain boolean, not the app side's `{ channel_ids } | null`, for the same
33
+ * reason grants carry no channel. `false` is the state a freshly bought
34
+ * resource is in: closed, admins only, until someone grants.
35
+ */
36
+ everyone: boolean;
37
+ }
38
+ //# sourceMappingURL=resourceAssignments.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resourceAssignments.d.ts","sourceRoot":"","sources":["../../../../src/services/AppService/types/resourceAssignments.ts"],"names":[],"mappings":"AAUA,qCAAqC;AACrC,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,MAAM,CAAA;IACZ,sEAAsE;IACtE,YAAY,EAAE,MAAM,CAAA;CACrB;AAED,0EAA0E;AAC1E,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,MAAM,CAAA;CACb;AAED;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,MAAM,CAAA;CACb;AAED,sDAAsD;AACtD,MAAM,WAAW,mBAAmB;IAClC,cAAc,EAAE,oBAAoB,EAAE,CAAA;IACtC,cAAc,EAAE,oBAAoB,EAAE,CAAA;IACtC,WAAW,EAAE,iBAAiB,EAAE,CAAA;IAChC,kFAAkF;IAClF,eAAe,EAAE,oBAAoB,EAAE,CAAA;IACvC;;;;;;OAMG;IACH,QAAQ,EAAE,OAAO,CAAA;CAClB"}
@@ -0,0 +1,10 @@
1
+ // Who inside the BUYING license may use a resource that license bought (AAD-954).
2
+ // Backend: app/Modules/Store/Services/Resource/ResourceAccessAssignmentService.php
3
+ //
4
+ // Shaped to match the app store's seat payload (`AssignedRole` / `AssignedUser`
5
+ // in `./seats`) so the manage-access screen can be the same experience — with
6
+ // one deliberate difference: **no `channel_ids` anywhere**. A resource
7
+ // entitlement pins one channel and one version for the whole license, so every
8
+ // user reads the same build; a per-user channel would be a control that does
9
+ // nothing. Do not add one.
10
+ export {};
@@ -20,6 +20,7 @@ import type { ResourceVersionSummary } from './resourceReleases';
20
20
  * | `subscription_expired` | 403 | the subscription lapsed — renew |
21
21
  * | `subscription_pending_approval` | 403 | awaiting the publisher's approval — wait, do NOT render as expired |
22
22
  * | `channel_not_accessible` | 403 | they DID buy it, but the track is restricted and their license is not listed — ask the publisher, never offer a purchase |
23
+ * | `not_granted` | 403 | the licence has it, this user does not — point at the licence admin |
23
24
  * | `version_withdrawn` | 409 | the pinned build was pulled — offer the Update action |
24
25
  * | `version_not_ready` | 409 | the payload has not finished preparing — poll |
25
26
  * | `payload_backend_not_implemented` | 501 | no backend registered yet (the phase-1 default) |
@@ -35,7 +36,15 @@ export type ResourceAccessReason = 'not_entitled' | 'entitlement_revoked' | 'sub
35
36
  * you to that track", never "buy this". Must not be collapsed into
36
37
  * `not_entitled`: the two are answered by different people.
37
38
  */
38
- | 'channel_not_accessible' | 'version_withdrawn' | 'version_not_ready' | 'payload_backend_not_implemented';
39
+ | 'channel_not_accessible'
40
+ /**
41
+ * AAD-954. The license bought it and may draw from the track, but THIS USER
42
+ * holds no grant. The only reason that is about a person rather than a
43
+ * license, and it is checked last — so the remedy is always "ask your
44
+ * license admin", never "buy this". Show the manage-access route to an
45
+ * admin and a "request access from your admin" message to anyone else.
46
+ */
47
+ | 'not_granted' | 'version_withdrawn' | 'version_not_ready' | 'payload_backend_not_implemented';
39
48
  /** The body of a refused access-layer read. */
40
49
  export interface ResourceAccessError {
41
50
  message: string;
@@ -1 +1 @@
1
- {"version":3,"file":"resourceEntitlements.d.ts","sourceRoot":"","sources":["../../../../src/services/AppService/types/resourceEntitlements.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAA;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AA0B;IACrE,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAA;IAC5C,eAAe,EAAE,MAAM,GAAG,IAAI,CAAA;IAC9B,6EAA6E;IAC7E,UAAU,EAAE,MAAM,CAAA;IAClB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;CACnB"}
1
+ {"version":3,"file":"resourceEntitlements.d.ts","sourceRoot":"","sources":["../../../../src/services/AppService/types/resourceEntitlements.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAA;AAEhE;;;;;;GAMG;AAEH;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,MAAM,oBAAoB,GAC1B,cAAc,GACd,qBAAqB,GACrB,sBAAsB,GACtB,+BAA+B;AACjC;;;;;GAKG;GACD,wBAAwB;AAC1B;;;;;;GAMG;GACD,aAAa,GACb,mBAAmB,GACnB,mBAAmB,GACnB,iCAAiC,CAAA;AAEvC,+CAA+C;AAC/C,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,oBAAoB,CAAA;CAC7B;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,IAAI,CAAA;IACb,MAAM,EAAE,mBAAmB,CAAA;IAC3B,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAA;IACnC;;;;;OAKG;IACH,iBAAiB,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAA;IACzD,iBAAiB,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAA;CAC1D;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,0BAA0B;IACzC,EAAE,EAAE,MAAM,CAAA;IACV,UAAU,EAAE,MAAM,CAAA;IAClB;;;;OAIG;IACH,cAAc,EAAE,sBAAsB,GAAG,IAAI,CAAA;IAC7C,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,2EAA2E;IAC3E,OAAO,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAA;IAC5C,WAAW,EAAE,OAAO,CAAA;IACpB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,iFAAiF;IACjF,OAAO,EAAE,OAAO,CAAA;IAChB,YAAY,EAAE,mBAAmB,GAAG,IAAI,CAAA;CACzC;AAED,MAAM,WAAW,mBAAoB,SAAQ,0BAA0B;IACrE,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAA;IAC5C,eAAe,EAAE,MAAM,GAAG,IAAI,CAAA;IAC9B,6EAA6E;IAC7E,UAAU,EAAE,MAAM,CAAA;IAClB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;CACnB"}
@@ -1,3 +1,4 @@
1
+ import type { ResourceVersionSource } from './snapshotFileSource';
1
2
  import type { SnapshotPayloadConfig, SnapshotPayloadSchema } from './snapshotPayload';
2
3
  import type { SnapshotErrorCode, SnapshotErrorContext } from './snapshotSources';
3
4
  /**
@@ -101,18 +102,24 @@ export interface ResourceVersion {
101
102
  */
102
103
  first_published_at: string | null;
103
104
  /**
104
- * Which table this version publishes, available from the moment it is declared.
105
+ * Where this version's rows came from, available from the moment it is declared.
106
+ *
107
+ * A linked TABLE carries a table reference; an uploaded FILE carries provenance
108
+ * instead — filename, format, size, digest and `verified: false`. The platform can
109
+ * inspect a table inside the publisher's own license and cannot inspect an
110
+ * uploaded file's origin at all, which is why the two say different things.
105
111
  *
106
112
  * Present even while `pending` or `failed`, when `payload_schema` is still null —
107
113
  * the row that most needs to say where it came from is the one that failed.
108
114
  *
115
+ * Discriminated on `type`, and ABSENT MEANS `'table'` (AAD-948), so read it as
116
+ * `source?.type ?? 'table'` — the optional chain matters, because the field itself
117
+ * is optional (below) and a non-publisher never receives it at all.
118
+ *
109
119
  * ⚠️ **PUBLISHER-ONLY, and ABSENT rather than null for anyone else**, for the same
110
- * reason as `payload_config`: it names the publisher's table.
120
+ * reason as `payload_config`: it names the publisher's own table or file.
111
121
  */
112
- source?: {
113
- table_id: string;
114
- table_name: string | null;
115
- } | null;
122
+ source?: ResourceVersionSource | null;
116
123
  created_at: string;
117
124
  updated_at: string;
118
125
  }
@@ -1 +1 @@
1
- {"version":3,"file":"resourceReleases.d.ts","sourceRoot":"","sources":["../../../../src/services/AppService/types/resourceReleases.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAA;AACrF,OAAO,KAAK,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAA;AAEhF;;;;;;GAMG;AAEH;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,oBAAoB,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,CAAA;AAEjE,uEAAuE;AACvE,MAAM,WAAW,sBAAsB;IACrC,EAAE,EAAE,MAAM,CAAA;IACV,OAAO,EAAE,MAAM,CAAA;IACf,aAAa,EAAE,oBAAoB,CAAA;CACpC;AAED,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAA;IACV,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,MAAM,CAAA;IACf,aAAa,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5B,aAAa,EAAE,oBAAoB,CAAA;IACnC;;;;;;O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uB;IACtC,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,KAAK,CAAC;QACb,UAAU,EAAE,MAAM,CAAA;QAClB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;QAC3B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;KAC1B,CAAC,CAAA;CACH"}
1
+ {"version":3,"file":"resourceReleases.d.ts","sourceRoot":"","sources":["../../../../src/services/AppService/types/resourceReleases.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAA;AACjE,OAAO,KAAK,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAA;AACrF,OAAO,KAAK,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAA;AAEhF;;;;;;GAMG;AAEH;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,oBAAoB,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,CAAA;AAEjE,uEAAuE;AACvE,MAAM,WAAW,sBAAsB;IACrC,EAAE,EAAE,MAAM,CAAA;IACV,OAAO,EAAE,MAAM,CAAA;IACf,aAAa,EAAE,oBAAoB,CAAA;CACpC;AAED,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAA;IACV,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,MAAM,CAAA;IACf,aAAa,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5B,aAAa,EAAE,oBAAoB,CAAA;IACnC;;;;;;OAMG;IACH,aAAa,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5B,yEAAyE;IACzE,kBAAkB,EAAE,iBAAiB,GAAG,IAAI,CAAA;IAC5C;;;;;;;OAOG;IACH,qBAAqB,EAAE,oBAAoB,GAAG,IAAI,CAAA;IAClD;;;;;;;OAOG;IACH,cAAc,EAAE,qBAAqB,GAAG,IAAI,CAAA;IAC5C;;;;;;;;OAQG;IACH,cAAc,CAAC,EAA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IAAI,CAAA;IAC7C,uDAAuD;IACvD,aAAa,EAAE,OAAO,CAAA;IACtB,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;CACnB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,yBAAyB;IACxC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,WAAW,CAAC,EAAE,yBAAyB,CAAA;IACvC,eAAe,CAAC,EAAE,6BAA6B,CAAA;IAC/C,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB;AAED;;;;GAIG;AACH,MAAM,WAAW,qBAAqB;IACpC,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,gFAAgF;IAChF,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,kBAAkB;IAClB,KAAK,EAAE,MAAM,CAAA;IACb,iDAAiD;IACjD,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;CACxB;AAED,iEAAiE;AACjE,MAAM,WAAW,wBAAwB;IACvC;;;OAGG;IACH,cAAc,CAAC,EAAE,qBAAqB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACjE;AAED,sCAAsC;AACtC,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,KAAK,CAAC;QACb,UAAU,EAAE,MAAM,CAAA;QAClB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;QAC3B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;KAC1B,CAAC,CAAA;CACH"}
@@ -1,8 +1,9 @@
1
1
  import type { AppLicense } from './app';
2
2
  import type { AppTierSummary } from './appList';
3
3
  import type { PricingTier } from './pricingTiers';
4
- import type { ResourceEntitlementSummary } from './resourceEntitlements';
4
+ import type { ResourceAccessReason, ResourceEntitlementSummary } from './resourceEntitlements';
5
5
  import type { ResourceChannel, ResourceVersion } from './resourceReleases';
6
+ import type { SnapshotUploadFormat } from './snapshotUploads';
6
7
  import type { Subscription } from './subscriptions';
7
8
  /**
8
9
  * Sellable resources — the Store's second sellable thing alongside apps
@@ -77,6 +78,21 @@ export interface StoreCapabilities {
77
78
  * armed behind a disabled surface is still worth surfacing.
78
79
  */
79
80
  resources_data_publishing_gate_bypassed: boolean;
81
+ /** Which file formats a dataset may be uploaded in (AAD-948). Served so a client picker cannot drift. */
82
+ resources_snapshot_upload_formats: SnapshotUploadFormat[];
83
+ /**
84
+ * The EFFECTIVE upload ceiling in bytes — the configured one capped by what PHP will
85
+ * accept (AAD-948).
86
+ *
87
+ * Check a file against THIS before uploading. Publishing the configured value
88
+ * instead would have a client accept a file the server then rejects with a bare 413
89
+ * that names nothing.
90
+ *
91
+ * **Null means the deployment cannot currently accept uploads** because a ceiling is
92
+ * misconfigured. That is an operator fault, not a publisher one — say so rather than
93
+ * telling them their file is too big.
94
+ */
95
+ resources_snapshot_max_upload_bytes: number | null;
80
96
  }
81
97
  /**
82
98
  * A storefront row.
@@ -176,6 +192,32 @@ export interface ResourceAccessEntry extends ResourceEntitlementSummary {
176
192
  /** Whether this license's channel serves a version newer than the pin. */
177
193
  update_available: boolean;
178
194
  }
195
+ /**
196
+ * An entry in the LICENSE-scoped access list (AAD-940), used to pick a resource
197
+ * for a trigger to consume.
198
+ *
199
+ * Not the same list as `fetchMyResourceAccess()`, and the differences matter:
200
+ *
201
+ * - It is **user-blind**. A trigger runs with no person behind it, so the
202
+ * per-user grant that filters "My Access" does not apply. A row here may well
203
+ * be one the signed-in user personally cannot read.
204
+ * - It **hides nothing**. Revoked, lapsed, withdrawn and not-ready entitlements
205
+ * are all present, each carrying why. Do not filter them out client-side —
206
+ * showing "you have no resources" when the licence owns three, all lapsed, is
207
+ * precisely the failure this endpoint exists to prevent. Render the reason.
208
+ *
209
+ * Render every row; use `consumable` to decide whether it is selectable and
210
+ * `access_reason` to say why it is not.
211
+ */
212
+ export interface LicenseResourceAccessEntry extends ResourceAccessEntry {
213
+ /**
214
+ * Why this resource cannot be consumed right now, or null when it can.
215
+ * Same vocabulary the dispatch refusal uses, so one mapping serves both.
216
+ */
217
+ access_reason: ResourceAccessReason | null;
218
+ /** Convenience for `access_reason === null`. */
219
+ consumable: boolean;
220
+ }
179
221
  /** A row of the publisher's consumption view. Lifetime totals, not a time series. */
180
222
  export interface ResourceConsumer {
181
223
  license_id: string;
@@ -1 +1 @@
1
- {"version":3,"file":"sellableResources.d.ts","sourceRoot":"","sources":["../../../../src/services/AppService/types/sellableResources.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AACvC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAC/C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AACjD,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAA;AACxE,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAC1E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAEnD;;;;;;;;;;;;;;;;;;;GAmBG;AAEH;;;;;GAKG;AACH,MAAM,MAAM,mBAAmB,GAAG,UAAU,GAAG,UAAU,CAAA;AAEzD,wEAAwE;AACxE,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,SAAS,CAAA;AAEjD,qEAAqE;AACrE,MAAM,WAAW,iBAAiB;IAChC;;;OAGG;IACH,iBAAiB,EAAE,OAAO,CAAA;IAC1B;;;;;;;;;;;;OAYG;IACH,0BAA0B,EAAE,OAAO,CAAA;IACnC;;;;;;;OAOG;IACH,8BAA8B,EAAE,MAAM,EAAE,CAAA;IACxC;;;;;;;;;;;;OAYG;IACH,uCAAuC,EAAE,OAAO,CAA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AM,WAAW,mBAAoB,SAAQ,0BAA0B;IACrE,QAAQ,EAAE;QACR,EAAE,EAAE,MAAM,CAAA;QACV,KAAK,EAAE,MAAM,CAAA;QACb,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;QACtB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;QACnB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;QACpB,YAAY,EAAE,mBAAmB,CAAA;QACjC,QAAQ,EAAE,gBAAgB,CAAA;KAC3B,CAAA;IACD,0EAA0E;IAC1E,gBAAgB,EAAE,OAAO,CAAA;CAC1B;AAED,qFAAqF;AACrF,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,MAAM,CAAA;IAClB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,UAAU,EAAE,MAAM,CAAA;IAClB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,UAAU,EAAE,OAAO,CAAA;CACpB;AAED,qFAAqF;AACrF,MAAM,MAAM,oBAAoB,GAAG,YAAY,CAAA"}
1
+ {"version":3,"file":"sellableResources.d.ts","sourceRoot":"","sources":["../../../../src/services/AppService/types/sellableResources.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AACvC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAC/C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AACjD,OAAO,KAAK,EAAE,oBAAoB,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAA;AAC9F,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAC1E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAA;AAC7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAEnD;;;;;;;;;;;;;;;;;;;GAmBG;AAEH;;;;;GAKG;AACH,MAAM,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IAC7B,UAAU,EAAE,OAAO,CAAA;CACpB;AAED,qFAAqF;AACrF,MAAM,MAAM,oBAAoB,GAAG,YAAY,CAAA"}
@@ -0,0 +1,110 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,8 @@
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 {};
@@ -2,8 +2,11 @@
2
2
  * Snapshot payload shapes (AAD-939) — the first payload type a sellable resource
3
3
  * can have.
4
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.
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.
7
10
  *
8
11
  * Two things about this file are load-bearing:
9
12
  *
@@ -13,14 +16,23 @@
13
16
  * to `ready` or `failed`, so nothing here is servable the moment
14
17
  * `createResourceVersion` returns.
15
18
  */
19
+ import type { SnapshotFileColumnSelection, SnapshotFileSchemaSource, SnapshotFileSourceSelection } from './snapshotFileSource';
16
20
  /** A column type a dataset may publish. */
17
21
  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 {
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';
20
31
  table_id: string;
21
32
  }
22
- /** One published column. */
23
- export interface SnapshotColumnSelection {
33
+ export type SnapshotSourceSelection = SnapshotTableSourceSelection | SnapshotFileSourceSelection;
34
+ /** One published column from a linked TABLE. */
35
+ export interface SnapshotTableColumnSelection {
24
36
  /** The logical `columns.id`. Selection is by ID, never by name. */
25
37
  column_id: string;
26
38
  /**
@@ -32,6 +44,7 @@ export interface SnapshotColumnSelection {
32
44
  */
33
45
  key?: string | null;
34
46
  }
47
+ export type SnapshotColumnSelection = SnapshotTableColumnSelection | SnapshotFileColumnSelection;
35
48
  /**
36
49
  * A row filter.
37
50
  *
@@ -103,16 +116,23 @@ export interface SnapshotPayloadSchema {
103
116
  /**
104
117
  * 1 = nullability derived from the column flag (never shipped).
105
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.
106
122
  */
107
123
  schema_version: number;
108
124
  fields: SnapshotFieldSchema[];
109
125
  row_count: number;
110
126
  byte_size: number;
111
127
  materialised_at: string;
112
- source: {
113
- table_id: string;
114
- table_name: string | null;
115
- };
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;
116
136
  }
117
137
  /**
118
138
  * A dry run of a selection, before creating a version from it.
@@ -1 +1 @@
1
- {"version":3,"file":"snapshotPayload.d.ts","sourceRoot":"","sources":["../../../../src/services/AppService/types/snapshotPayload.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,2CAA2C;AAC3C,MAAM,MAAM,iBAAiB,GACvB,SAAS,GACT,SAAS,GACT,OAAO,GACP,MAAM,GACN,YAAY,GACZ,MAAM,GACN,OAAO,GACP,UAAU,GACV,SAAS,GACT,MAAM,CAAA;AAEZ,qFAAqF;AACrF,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED,4BAA4B;AAC5B,MAAM,WAAW,uBAAuB;IACtC,mEAAmE;IACnE,SAAS,EAAE,MAAM,CAAA;IACjB;;;;;;OAMG;IACH,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CACpB;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,MAAM,GAAG,UAAU,GAAG,SAAS,GAAG,aAAa,GAAG,SAAS,CAAA;IAC5G,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,MAAM,CAAC,EAAE,OAAO,EAAE,CAAA;IAClB,OAAO,CAAC,EAAE,KAAK,GAAG,IAAI,CAAA;CACvB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,uB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AAS,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"}
1
+ {"version":3,"file":"snapshotPayload.d.ts","sourceRoot":"","sources":["../../../../src/services/AppService/types/snapshotPayload.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EACV,2BAA2B,EAC3B,wBAAwB,EACxB,2BAA2B,EAC5B,MAAM,sBAAsB,CAAA;AAE7B,2CAA2C;AAC3C,MAAM,MAAM,iBAAiB,GACvB,SAAS,GACT,SAAS,GACT,OAAO,GACP,MAAM,GACN,YAAY,GACZ,MAAM,GACN,OAAO,GACP,UAAU,GACV,SAAS,GACT,MAAM,CAAA;AAEZ;;;;;;GAMG;AACH,MAAM,WAAW,4BAA4B;IAC3C,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,MAAM,uBAAuB,GAAG,4BAA4B,GAAG,2BAA2B,CAAA;AAEhG,gDAAgD;AAChD,MAAM,WAAW,4BAA4B;IAC3C,mEAAmE;IACnE,SAAS,EAAE,MAAM,CAAA;IACjB;;;;;;OAMG;IACH,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CACpB;AAED,MAAM,MAAM,uBAAuB,GAAG,4BAA4B,GAAG,2BAA2B,CAAA;AAEhG;;;;;;;;GAQG;AACH,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,MAAM,GAA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vF,MAAM,WAAW,yBAAyB;IACxC,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;IAChB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;CAC1B;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"}
@@ -2,8 +2,11 @@
2
2
  * Snapshot payload shapes (AAD-939) — the first payload type a sellable resource
3
3
  * can have.
4
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.
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.
7
10
  *
8
11
  * Two things about this file are load-bearing:
9
12
  *
@@ -23,7 +23,17 @@
23
23
  * | `snapshot_limits_misconfigured` | `config_key`, `env_var`, `resolved` | the DEPLOYMENT's size ceiling is unset or zero |
24
24
  * | `internal_error` | — | a backend fault; the publisher cannot act on it |
25
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';
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';
27
37
  /**
28
38
  * The numbers behind a failure, so a client can build its own sentence.
29
39
  *
@@ -33,6 +43,14 @@ export type SnapshotErrorCode = 'row_limit_exceeded' | 'byte_limit_exceeded' | '
33
43
  */
34
44
  export interface SnapshotErrorContext {
35
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;
36
54
  max_rows?: number;
37
55
  max_bytes?: number;
38
56
  column_name?: string;
@@ -1 +1 @@
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,yB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