@antcde/connect-ts 0.4.26 → 0.4.27-rc.10

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 (265) hide show
  1. package/README.md +67 -3
  2. package/build/AntConnect.d.ts +8 -0
  3. package/build/AntConnect.d.ts.map +1 -1
  4. package/build/AntConnect.js +8 -0
  5. package/build/AntHttpClient.d.ts +0 -5
  6. package/build/AntHttpClient.d.ts.map +1 -1
  7. package/build/AntHttpClient.js +0 -5
  8. package/build/ai/index.d.ts +5 -0
  9. package/build/ai/index.d.ts.map +1 -0
  10. package/build/ai/index.js +3 -0
  11. package/build/ai/mutationDescriptors.d.ts +3 -0
  12. package/build/ai/mutationDescriptors.d.ts.map +1 -0
  13. package/build/ai/mutationDescriptors.js +207 -0
  14. package/build/ai/mutationTargets.d.ts +21 -0
  15. package/build/ai/mutationTargets.d.ts.map +1 -0
  16. package/build/ai/mutationTargets.js +72 -0
  17. package/build/ai/queryDescriptors.d.ts +3 -0
  18. package/build/ai/queryDescriptors.d.ts.map +1 -0
  19. package/build/ai/queryDescriptors.js +174 -0
  20. package/build/ai/types.d.ts +35 -0
  21. package/build/ai/types.d.ts.map +1 -0
  22. package/build/comms/client.d.ts.map +1 -1
  23. package/build/comms/client.js +39 -41
  24. package/build/comms/connection.d.ts +32 -0
  25. package/build/comms/connection.d.ts.map +1 -0
  26. package/build/comms/connection.js +159 -0
  27. package/build/comms/handshake.d.ts +16 -0
  28. package/build/comms/handshake.d.ts.map +1 -0
  29. package/build/comms/handshake.js +73 -0
  30. package/build/comms/host.d.ts.map +1 -1
  31. package/build/comms/host.js +22 -26
  32. package/build/comms/hostAPI.js +1 -1
  33. package/build/comms/hostSlot.d.ts +23 -0
  34. package/build/comms/hostSlot.d.ts.map +1 -0
  35. package/build/comms/hostSlot.js +55 -0
  36. package/build/comms/models.d.ts +31 -2
  37. package/build/comms/models.d.ts.map +1 -1
  38. package/build/comms/signalChangeTypes.d.ts +27 -1
  39. package/build/comms/signalChangeTypes.d.ts.map +1 -1
  40. package/build/comms/signalChangeTypes.js +7 -0
  41. package/build/comms/signalTypes.d.ts +21 -3
  42. package/build/comms/signalTypes.d.ts.map +1 -1
  43. package/build/comms/transport.d.ts +18 -2
  44. package/build/comms/transport.d.ts.map +1 -1
  45. package/build/comms/transport.js +25 -10
  46. package/build/index.d.ts +8 -35
  47. package/build/index.d.ts.map +1 -1
  48. package/build/index.js +8 -3
  49. package/build/service-runtime.d.ts +9 -0
  50. package/build/service-runtime.d.ts.map +1 -0
  51. package/build/service-runtime.js +10 -0
  52. package/build/service-types-app.d.ts +2 -0
  53. package/build/service-types-app.d.ts.map +1 -0
  54. package/build/service-types-app.js +3 -0
  55. package/build/service-types.d.ts +37 -0
  56. package/build/service-types.d.ts.map +1 -0
  57. package/build/service-types.js +7 -0
  58. package/build/services/AiService.d.ts +18 -0
  59. package/build/services/AiService.d.ts.map +1 -0
  60. package/build/services/AiService.js +9 -0
  61. package/build/services/AppService/factory/accessRequests.d.ts +19 -0
  62. package/build/services/AppService/factory/accessRequests.d.ts.map +1 -0
  63. package/build/services/AppService/factory/accessRequests.js +17 -0
  64. package/build/services/AppService/factory/assignments.d.ts +57 -0
  65. package/build/services/AppService/factory/assignments.d.ts.map +1 -0
  66. package/build/services/AppService/factory/assignments.js +30 -0
  67. package/build/services/AppService/factory/categories.d.ts +30 -0
  68. package/build/services/AppService/factory/categories.d.ts.map +1 -0
  69. package/build/services/AppService/factory/categories.js +11 -0
  70. package/build/services/AppService/factory/channels.d.ts +35 -0
  71. package/build/services/AppService/factory/channels.d.ts.map +1 -0
  72. package/build/services/AppService/factory/channels.js +18 -0
  73. package/build/services/AppService/factory/formData.d.ts +14 -0
  74. package/build/services/AppService/factory/formData.d.ts.map +1 -0
  75. package/build/services/AppService/factory/formData.js +50 -0
  76. package/build/services/AppService/factory/media.d.ts +17 -0
  77. package/build/services/AppService/factory/media.d.ts.map +1 -0
  78. package/build/services/AppService/factory/media.js +10 -0
  79. package/build/services/AppService/factory/resourceAccess.d.ts +21 -0
  80. package/build/services/AppService/factory/resourceAccess.d.ts.map +1 -0
  81. package/build/services/AppService/factory/resourceAccess.js +49 -0
  82. package/build/services/AppService/factory/resourceAssignments.d.ts +66 -0
  83. package/build/services/AppService/factory/resourceAssignments.d.ts.map +1 -0
  84. package/build/services/AppService/factory/resourceAssignments.js +12 -0
  85. package/build/services/AppService/factory/resourceChannels.d.ts +89 -0
  86. package/build/services/AppService/factory/resourceChannels.d.ts.map +1 -0
  87. package/build/services/AppService/factory/resourceChannels.js +19 -0
  88. package/build/services/AppService/factory/resourceCommerce.d.ts +52 -0
  89. package/build/services/AppService/factory/resourceCommerce.d.ts.map +1 -0
  90. package/build/services/AppService/factory/resourceCommerce.js +18 -0
  91. package/build/services/AppService/factory/resourceSnapshot.d.ts +75 -0
  92. package/build/services/AppService/factory/resourceSnapshot.d.ts.map +1 -0
  93. package/build/services/AppService/factory/resourceSnapshot.js +55 -0
  94. package/build/services/AppService/factory/resourceUploads.d.ts +37 -0
  95. package/build/services/AppService/factory/resourceUploads.d.ts.map +1 -0
  96. package/build/services/AppService/factory/resourceUploads.js +8 -0
  97. package/build/services/AppService/factory/resources.d.ts +167 -0
  98. package/build/services/AppService/factory/resources.d.ts.map +1 -0
  99. package/build/services/AppService/factory/resources.js +45 -0
  100. package/build/services/AppService/factory/subscriptions.d.ts +73 -0
  101. package/build/services/AppService/factory/subscriptions.d.ts.map +1 -0
  102. package/build/services/AppService/factory/subscriptions.js +39 -0
  103. package/build/services/AppService/factory/taxonomy.d.ts +25 -0
  104. package/build/services/AppService/factory/taxonomy.d.ts.map +1 -0
  105. package/build/services/AppService/factory/taxonomy.js +5 -0
  106. package/build/services/AppService/index.d.ts +58 -0
  107. package/build/services/AppService/index.d.ts.map +1 -0
  108. package/build/services/AppService/index.js +74 -0
  109. package/build/services/AppService/types/accessRequests.d.ts +164 -0
  110. package/build/services/AppService/types/accessRequests.d.ts.map +1 -0
  111. package/build/services/AppService/types/app.d.ts +124 -0
  112. package/build/services/AppService/types/app.d.ts.map +1 -0
  113. package/build/services/AppService/types/app.js +6 -0
  114. package/build/services/AppService/types/appCategories.d.ts +44 -0
  115. package/build/services/AppService/types/appCategories.d.ts.map +1 -0
  116. package/build/services/AppService/types/appCategories.js +1 -0
  117. package/build/services/AppService/types/appChangelog.d.ts +31 -0
  118. package/build/services/AppService/types/appChangelog.d.ts.map +1 -0
  119. package/build/services/AppService/types/appChangelog.js +1 -0
  120. package/build/services/AppService/types/appConfigStatus.d.ts +68 -0
  121. package/build/services/AppService/types/appConfigStatus.d.ts.map +1 -0
  122. package/build/services/AppService/types/appConfigStatus.js +11 -0
  123. package/build/services/AppService/types/appList.d.ts +211 -0
  124. package/build/services/AppService/types/appList.d.ts.map +1 -0
  125. package/build/services/AppService/types/appList.js +1 -0
  126. package/build/services/AppService/types/appManifest.d.ts +100 -0
  127. package/build/services/AppService/types/appManifest.d.ts.map +1 -0
  128. package/build/services/AppService/types/appManifest.js +4 -0
  129. package/build/services/AppService/types/appMedia.d.ts +136 -0
  130. package/build/services/AppService/types/appMedia.d.ts.map +1 -0
  131. package/build/services/AppService/types/appMedia.js +1 -0
  132. package/build/services/AppService/types/appRequests.d.ts +126 -0
  133. package/build/services/AppService/types/appRequests.d.ts.map +1 -0
  134. package/build/services/AppService/types/appRequests.js +1 -0
  135. package/build/services/AppService/types/appScopes.d.ts +165 -0
  136. package/build/services/AppService/types/appScopes.d.ts.map +1 -0
  137. package/build/services/AppService/types/appScopes.js +1 -0
  138. package/build/services/AppService/types/channels.d.ts +45 -0
  139. package/build/services/AppService/types/channels.d.ts.map +1 -0
  140. package/build/services/AppService/types/channels.js +1 -0
  141. package/build/services/AppService/types/pricingTiers.d.ts +111 -0
  142. package/build/services/AppService/types/pricingTiers.d.ts.map +1 -0
  143. package/build/services/AppService/types/pricingTiers.js +1 -0
  144. package/build/services/AppService/types/publisherStats.d.ts +20 -0
  145. package/build/services/AppService/types/publisherStats.d.ts.map +1 -0
  146. package/build/services/AppService/types/publisherStats.js +1 -0
  147. package/build/services/AppService/types/releaseChannels.d.ts +127 -0
  148. package/build/services/AppService/types/releaseChannels.d.ts.map +1 -0
  149. package/build/services/AppService/types/releaseChannels.js +1 -0
  150. package/build/services/AppService/types/resourceAssignments.d.ts +38 -0
  151. package/build/services/AppService/types/resourceAssignments.d.ts.map +1 -0
  152. package/build/services/AppService/types/resourceAssignments.js +10 -0
  153. package/build/services/AppService/types/resourceEntitlements.d.ts +118 -0
  154. package/build/services/AppService/types/resourceEntitlements.d.ts.map +1 -0
  155. package/build/services/AppService/types/resourceEntitlements.js +1 -0
  156. package/build/services/AppService/types/resourceReleases.d.ts +230 -0
  157. package/build/services/AppService/types/resourceReleases.d.ts.map +1 -0
  158. package/build/services/AppService/types/resourceReleases.js +1 -0
  159. package/build/services/AppService/types/resourceRequests.d.ts +115 -0
  160. package/build/services/AppService/types/resourceRequests.d.ts.map +1 -0
  161. package/build/services/AppService/types/resourceRequests.js +1 -0
  162. package/build/services/AppService/types/seats.d.ts +220 -0
  163. package/build/services/AppService/types/seats.d.ts.map +1 -0
  164. package/build/services/AppService/types/seats.js +4 -0
  165. package/build/services/AppService/types/sellableResources.d.ts +231 -0
  166. package/build/services/AppService/types/sellableResources.d.ts.map +1 -0
  167. package/build/services/AppService/types/sellableResources.js +1 -0
  168. package/build/services/AppService/types/snapshotFileSource.d.ts +110 -0
  169. package/build/services/AppService/types/snapshotFileSource.d.ts.map +1 -0
  170. package/build/services/AppService/types/snapshotFileSource.js +8 -0
  171. package/build/services/AppService/types/snapshotPayload.d.ts +166 -0
  172. package/build/services/AppService/types/snapshotPayload.d.ts.map +1 -0
  173. package/build/services/AppService/types/snapshotPayload.js +19 -0
  174. package/build/services/AppService/types/snapshotSources.d.ts +116 -0
  175. package/build/services/AppService/types/snapshotSources.d.ts.map +1 -0
  176. package/build/services/AppService/types/snapshotSources.js +7 -0
  177. package/build/services/AppService/types/snapshotUploads.d.ts +109 -0
  178. package/build/services/AppService/types/snapshotUploads.d.ts.map +1 -0
  179. package/build/services/AppService/types/snapshotUploads.js +20 -0
  180. package/build/services/AppService/types/subscriptions.d.ts +182 -0
  181. package/build/services/AppService/types/subscriptions.d.ts.map +1 -0
  182. package/build/services/AppService/types/subscriptions.js +1 -0
  183. package/build/services/AppService/types/taxonomy.d.ts +76 -0
  184. package/build/services/AppService/types/taxonomy.d.ts.map +1 -0
  185. package/build/services/AppService/types/taxonomy.js +1 -0
  186. package/build/services/AppService/types.d.ts +27 -0
  187. package/build/services/AppService/types.d.ts.map +1 -0
  188. package/build/services/AppService/types.js +29 -0
  189. package/build/services/DmsService.d.ts +6 -151
  190. package/build/services/DmsService.d.ts.map +1 -1
  191. package/build/services/DmsService.types.d.ts +169 -0
  192. package/build/services/DmsService.types.d.ts.map +1 -0
  193. package/build/services/DmsService.types.js +1 -0
  194. package/build/services/DmsServiceImpl.d.ts.map +1 -1
  195. package/build/services/DmsServiceImpl.js +8 -0
  196. package/build/services/LicenseService.d.ts +1 -1
  197. package/build/services/LicenseService.d.ts.map +1 -1
  198. package/build/services/LicenseService.js +1 -1
  199. package/build/services/OAuthClientService.d.ts +20 -0
  200. package/build/services/OAuthClientService.d.ts.map +1 -0
  201. package/build/services/OAuthClientService.js +12 -0
  202. package/build/services/OAuthClientService.types.d.ts +37 -0
  203. package/build/services/OAuthClientService.types.d.ts.map +1 -0
  204. package/build/services/OAuthClientService.types.js +4 -0
  205. package/build/services/ProjectService.d.ts +21 -0
  206. package/build/services/ProjectService.d.ts.map +1 -1
  207. package/build/services/ProjectService.js +1 -0
  208. package/build/services/ReleaseService.d.ts +1 -0
  209. package/build/services/ReleaseService.d.ts.map +1 -1
  210. package/build/services/SecretService.d.ts +22 -0
  211. package/build/services/SecretService.d.ts.map +1 -0
  212. package/build/services/SecretService.js +21 -0
  213. package/build/services/SecretService.types.d.ts +147 -0
  214. package/build/services/SecretService.types.d.ts.map +1 -0
  215. package/build/services/SecretService.types.js +1 -0
  216. package/build/services/SecretSharing.types.d.ts +112 -0
  217. package/build/services/SecretSharing.types.d.ts.map +1 -0
  218. package/build/services/SecretSharing.types.js +1 -0
  219. package/build/services/TableService.js +7 -7
  220. package/build/services/TaskService.d.ts +3 -3
  221. package/build/services/TaskService.d.ts.map +1 -1
  222. package/build/services/TaskService.js +1 -1
  223. package/build/services/TaskService.requests.d.ts +61 -0
  224. package/build/services/TaskService.requests.d.ts.map +1 -0
  225. package/build/services/TaskService.requests.js +1 -0
  226. package/build/services/TaskService.types.d.ts +21 -53
  227. package/build/services/TaskService.types.d.ts.map +1 -1
  228. package/build/services/TaskServiceQueries.d.ts +2 -0
  229. package/build/services/TaskServiceQueries.d.ts.map +1 -1
  230. package/build/services/TaskServiceQueries.js +13 -2
  231. package/build/services/TaskTemplate.types.d.ts +74 -1
  232. package/build/services/TaskTemplate.types.d.ts.map +1 -1
  233. package/build/services/TokenService.d.ts +5 -1
  234. package/build/services/TokenService.d.ts.map +1 -1
  235. package/build/services/TokenService.js +1 -2
  236. package/build/services/UserService.d.ts +3 -0
  237. package/build/services/UserService.d.ts.map +1 -1
  238. package/build/services/UserService.js +4 -4
  239. package/build/services/Webhook/EventService.d.ts +7 -0
  240. package/build/services/Webhook/EventService.d.ts.map +1 -1
  241. package/build/services/Webhook/TriggerHistoryService.d.ts +1 -1
  242. package/build/services/Webhook/TriggerHistoryService.d.ts.map +1 -1
  243. package/build/services/Webhook/TriggerSecretService.d.ts +88 -0
  244. package/build/services/Webhook/TriggerSecretService.d.ts.map +1 -0
  245. package/build/services/Webhook/TriggerSecretService.js +9 -0
  246. package/build/services/Webhook/TriggerService.d.ts +108 -0
  247. package/build/services/Webhook/TriggerService.d.ts.map +1 -1
  248. package/build/services/Webhook/TriggerService.js +25 -0
  249. package/build/services/Websockets/StoreEvents.d.ts +44 -0
  250. package/build/services/Websockets/StoreEvents.d.ts.map +1 -0
  251. package/build/services/Websockets/StoreEvents.js +5 -0
  252. package/build/services/userPreferences.d.ts +47 -0
  253. package/build/services/userPreferences.d.ts.map +1 -0
  254. package/build/services/userPreferences.js +42 -0
  255. package/package.json +8 -7
  256. package/schemas/app-config.schema.json +85 -8
  257. package/build/services/AppManifest.d.ts +0 -39
  258. package/build/services/AppManifest.d.ts.map +0 -1
  259. package/build/services/AppService.d.ts +0 -57
  260. package/build/services/AppService.d.ts.map +0 -1
  261. package/build/services/AppService.js +0 -47
  262. package/build/services/AppService.types.d.ts +0 -173
  263. package/build/services/AppService.types.d.ts.map +0 -1
  264. /package/build/{services/AppManifest.js → ai/types.js} +0 -0
  265. /package/build/services/{AppService.types.js → AppService/types/accessRequests.js} +0 -0
@@ -0,0 +1,166 @@
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
@@ -0,0 +1 @@
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;AAE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CAAA;IACb,mFAAmF;IACnF,gBAAgB,EAAE,MAAM,CAAA;CACzB;AAED;;;;;GAKG;AACH,MAAM,WAAW,qBAAqB;IACpC;;;;;;OAMG;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,oBAAoB,CAAA;CAC7B;AAED,sGAAsG;AACtG,MAAM,MAAM,oBAAoB,GAAG,yBAAyB,GAAG,wBAAwB,CAAA;AAEvF,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"}
@@ -0,0 +1,19 @@
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 {};
@@ -0,0 +1,116 @@
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
@@ -0,0 +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,yBAAyB,GACzB,sBAAsB,GACtB,2BAA2B,GAC3B,wBAAwB,GACxB,+BAA+B;A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,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"}
@@ -0,0 +1,7 @@
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
+ export {};
@@ -0,0 +1,109 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,20 @@
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 {};
@@ -0,0 +1,182 @@
1
+ import type { PricingModel, PricingTier } from './pricingTiers';
2
+ /**
3
+ * `pending_approval` is the initial state of a paid purchase: the buyer has
4
+ * requested to buy, but the publisher (seller) has not yet approved the offline
5
+ * payment. It grants NO access — the app stays locked until approval moves the
6
+ * subscription to `trial`/`active`.
7
+ */
8
+ export type SubscriptionStatus = 'pending_approval' | 'trial' | 'active' | 'grace_period' | 'expired' | 'cancelled';
9
+ /**
10
+ * Lightweight subscription summary embedded on App / ListApp resources to drive
11
+ * card state (in trial, in grace period, seats badge). Mirrors the
12
+ * `preloadedSubscription` shape on the backend (AppService::preloadSubscriptionData).
13
+ */
14
+ export interface AppSubscriptionSummary {
15
+ id: string;
16
+ status: SubscriptionStatus;
17
+ tier_id: string;
18
+ tier_name: string | null;
19
+ /**
20
+ * The tier's billing nature. Use this — not `status` — to tell a perpetual
21
+ * free plan apart from a time-limited trial of a paid tier. A free-tier
22
+ * subscription is always delivered as `status: 'active'` with
23
+ * `trial_ends_at: null` (the BE normalizes it), and `is_free: true`.
24
+ */
25
+ pricing_model: PricingModel | null;
26
+ /** Convenience flag: `pricing_model === 'free'`. */
27
+ is_free: boolean;
28
+ features: Record<string, unknown>[] | null;
29
+ seat_based: boolean;
30
+ seats_purchased: number;
31
+ seats_used: number;
32
+ /** Pending seat-increase target awaiting publisher approval (null = none). */
33
+ requested_seats_purchased?: number | null;
34
+ seat_change_requested_at?: string | null;
35
+ trial_ends_at: string | null;
36
+ grace_period_ends_at: string | null;
37
+ current_period_start: string | null;
38
+ current_period_end: string | null;
39
+ auto_renew: boolean;
40
+ has_seat: boolean;
41
+ /**
42
+ * Whether the current user may manage this subscription for the license
43
+ * (admin role or `apps.configure`): change plan, manage seats, cancel,
44
+ * reactivate. Gate the My Access manage controls on this. A seat-based app
45
+ * where the user has no seat AND `can_manage` is false grants no access.
46
+ */
47
+ can_manage: boolean;
48
+ }
49
+ export interface Subscription {
50
+ id: string;
51
+ subject_type: string;
52
+ subject_id: string;
53
+ license_id: string;
54
+ pricing_tier_id: string;
55
+ status: SubscriptionStatus;
56
+ seats_purchased: number;
57
+ current_period_start: string | null;
58
+ current_period_end: string | null;
59
+ grace_period_ends_at: string | null;
60
+ trial_ends_at: string | null;
61
+ payment_confirmed_at: string | null;
62
+ external_payment_ref: string | null;
63
+ auto_renew: boolean;
64
+ requested_tier_id: string | null;
65
+ tier_change_requested_at: string | null;
66
+ /** Pending seat-increase target awaiting publisher approval (null = none). */
67
+ requested_seats_purchased: number | null;
68
+ seat_change_requested_at: string | null;
69
+ /**
70
+ * True when the buyer must pick an active tier before the subscription
71
+ * can resume (e.g. their previous tier was archived). Pair with status
72
+ * `grace_period` to render a recovery CTA.
73
+ */
74
+ requires_tier_selection: boolean;
75
+ cancelled_at: string | null;
76
+ /**
77
+ * Set when the publisher has been notified that this recurring subscription's
78
+ * next offline payment is due (cleared once the period advances). Used by the
79
+ * publisher UI to show "renewal notice sent".
80
+ */
81
+ renewal_notified_at: string | null;
82
+ /**
83
+ * Optional buyer note attached at purchase time ("note to publisher"). Shown
84
+ * as a quote on the publisher approval-inbox row. Null when none was given.
85
+ */
86
+ message?: string | null;
87
+ created_at: string;
88
+ updated_at: string;
89
+ pricing_tier?: PricingTier;
90
+ /** Populated when there is a pending tier change request. */
91
+ requested_tier?: PricingTier | null;
92
+ /**
93
+ * Buyer license that owns the subscription. Embedded on publisher reads
94
+ * (approval inbox / active subscriptions) so rows can show the license name.
95
+ */
96
+ license?: SubscriptionLicense | null;
97
+ /**
98
+ * Who submitted the purchase request. Embedded on publisher reads for the
99
+ * "requested by {name}" line on the approval-inbox row.
100
+ */
101
+ requester?: SubscriptionRequester | null;
102
+ }
103
+ export interface SubscriptionLicense {
104
+ id: string;
105
+ name: string;
106
+ }
107
+ export interface SubscriptionRequester {
108
+ user_id: string;
109
+ user_name: string;
110
+ license_id: string;
111
+ license_name: string;
112
+ }
113
+ /** Query params for the publisher's per-app subscription list. */
114
+ export interface FetchAppSubscriptionsParams {
115
+ /** Filter by status; comma-separate for multiple. Omit to exclude pending_approval. */
116
+ status?: SubscriptionStatus | string;
117
+ }
118
+ export interface RequestTierChangeData {
119
+ pricing_tier_id: string;
120
+ }
121
+ export interface RequestSeatChangeData {
122
+ /** Desired TOTAL seat count (must exceed the current count — increase only). */
123
+ seats: number;
124
+ /** Optional buyer note to the publisher. */
125
+ message?: string;
126
+ }
127
+ /**
128
+ * Surplus seat assignment surfaced by the API when a seat-decrease attempt
129
+ * fails because seats are still occupied. Buyer must revoke seats first.
130
+ * Sized to the surplus, ordered most-recent-first.
131
+ */
132
+ export interface SurplusSeatAssignment {
133
+ seat_id: string;
134
+ user_id: string;
135
+ assigned_at: string;
136
+ }
137
+ export interface CreateSubscriptionData {
138
+ pricing_tier_id: string;
139
+ seats_purchased?: number;
140
+ /** Optional buyer note to the publisher (PO number, billing contact, etc.). */
141
+ message?: string;
142
+ }
143
+ export interface UpdateSubscriptionData {
144
+ /**
145
+ * Seat DECREASE only (no charge). Increasing seats is rejected (409) — use
146
+ * `requestSeatChange` so the publisher approves the offline payment.
147
+ */
148
+ seats_purchased?: number;
149
+ auto_renew?: boolean;
150
+ }
151
+ export interface ConfirmPaymentData {
152
+ external_payment_ref?: string;
153
+ }
154
+ export interface SubscriptionSeat {
155
+ id: string;
156
+ subscription_id: string;
157
+ user_id: string;
158
+ scope_type: string | null;
159
+ scope_id: string | null;
160
+ assigned_at: string;
161
+ assigned_by: string | null;
162
+ created_at: string;
163
+ user?: {
164
+ id: string;
165
+ name: string;
166
+ email: string;
167
+ };
168
+ assigned_by_user?: {
169
+ id: string;
170
+ name: string;
171
+ email: string;
172
+ };
173
+ }
174
+ export interface AssignSeatData {
175
+ user_id: string;
176
+ }
177
+ export interface AvailableSeatUser {
178
+ id: string;
179
+ name: string;
180
+ email: string;
181
+ }
182
+ //# sourceMappingURL=subscriptions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subscriptions.d.ts","sourceRoot":"","sources":["../../../../src/services/AppService/types/subscriptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAE/D;;;;;GAKG;AACH,MAAM,MAAM,kBAAkB,GAAG,kBAAkB,GAAG,OAAO,GAAG,QAAQ,GAAG,cAAc,GAAG,SAAS,GAAG,WAAW,CAAA;AAEnH;;;;GAIG;AACH,MAAM,WAAW,sBAAsB;IACrC,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,EAAE,kB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