@squonk/account-server-client 2.1.0-rc.2 → 2.1.0-rc.20

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 (78) hide show
  1. package/README.md +1 -1
  2. package/admin/admin.cjs +30 -8
  3. package/admin/admin.cjs.map +1 -1
  4. package/admin/admin.d.cts +50 -0
  5. package/admin/admin.d.ts +26 -6
  6. package/admin/admin.js +30 -8
  7. package/admin/admin.js.map +1 -1
  8. package/asset/asset.cjs +62 -22
  9. package/asset/asset.cjs.map +1 -1
  10. package/asset/asset.d.cts +260 -0
  11. package/asset/asset.d.ts +79 -36
  12. package/asset/asset.js +54 -14
  13. package/asset/asset.js.map +1 -1
  14. package/{chunk-3RNIDX7T.js → chunk-EBOQPVLG.js} +2 -2
  15. package/{chunk-3RNIDX7T.js.map → chunk-EBOQPVLG.js.map} +1 -1
  16. package/{chunk-UZTHSGDT.cjs → chunk-TKLTUR4R.cjs} +2 -2
  17. package/chunk-TKLTUR4R.cjs.map +1 -0
  18. package/event-stream/event-stream.cjs +64 -19
  19. package/event-stream/event-stream.cjs.map +1 -1
  20. package/event-stream/event-stream.d.cts +142 -0
  21. package/event-stream/event-stream.d.ts +66 -20
  22. package/event-stream/event-stream.js +61 -16
  23. package/event-stream/event-stream.js.map +1 -1
  24. package/index.cjs +10 -10
  25. package/index.cjs.map +1 -1
  26. package/{custom-instance-35e5d4fd.d.ts → index.d.cts} +165 -163
  27. package/index.d.ts +702 -2
  28. package/index.js +9 -9
  29. package/index.js.map +1 -1
  30. package/merchant/merchant.cjs +53 -14
  31. package/merchant/merchant.cjs.map +1 -1
  32. package/merchant/merchant.d.cts +91 -0
  33. package/merchant/merchant.d.ts +48 -8
  34. package/merchant/merchant.js +52 -13
  35. package/merchant/merchant.js.map +1 -1
  36. package/organisation/organisation.cjs +110 -28
  37. package/organisation/organisation.cjs.map +1 -1
  38. package/organisation/organisation.d.cts +271 -0
  39. package/organisation/organisation.d.ts +114 -25
  40. package/organisation/organisation.js +103 -21
  41. package/organisation/organisation.js.map +1 -1
  42. package/package.json +13 -13
  43. package/product/product.cjs +182 -47
  44. package/product/product.cjs.map +1 -1
  45. package/product/product.d.cts +399 -0
  46. package/product/product.d.ts +180 -31
  47. package/product/product.js +172 -37
  48. package/product/product.js.map +1 -1
  49. package/src/account-server-api.schemas.ts +274 -280
  50. package/src/admin/admin.ts +114 -84
  51. package/src/asset/asset.ts +480 -565
  52. package/src/custom-instance.ts +3 -4
  53. package/src/event-stream/event-stream.ts +300 -275
  54. package/src/merchant/merchant.ts +206 -142
  55. package/src/organisation/organisation.ts +549 -490
  56. package/src/product/product.ts +829 -688
  57. package/src/state/state.ts +112 -75
  58. package/src/unit/unit.ts +645 -599
  59. package/src/user/user.ts +489 -469
  60. package/state/state.cjs +29 -8
  61. package/state/state.cjs.map +1 -1
  62. package/state/state.d.cts +46 -0
  63. package/state/state.d.ts +26 -6
  64. package/state/state.js +29 -8
  65. package/state/state.js.map +1 -1
  66. package/unit/unit.cjs +120 -32
  67. package/unit/unit.cjs.map +1 -1
  68. package/unit/unit.d.cts +322 -0
  69. package/unit/unit.d.ts +133 -38
  70. package/unit/unit.js +112 -24
  71. package/unit/unit.js.map +1 -1
  72. package/user/user.cjs +96 -22
  73. package/user/user.cjs.map +1 -1
  74. package/user/user.d.cts +271 -0
  75. package/user/user.d.ts +96 -24
  76. package/user/user.js +90 -16
  77. package/user/user.js.map +1 -1
  78. package/chunk-UZTHSGDT.cjs.map +0 -1
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Generated by orval v6.15.0 🍺
2
+ * Generated by orval v6.25.0 🍺
3
3
  * Do not edit manually.
4
4
  * Account Server API
5
5
  * The Informatics Matters Account Server API.
@@ -9,17 +9,17 @@ A service that provides access to the Account Server, which gives *registered* u
9
9
  * OpenAPI spec version: 2.1
10
10
  */
11
11
  export type DetachAssetParams = {
12
- /**
13
- * A Merchant Identity
14
- */
15
- m_id?: QMIdParameter;
12
+ /**
13
+ * A Merchant Identity
14
+ */
15
+ m_id?: QMIdParameter;
16
16
  };
17
17
 
18
18
  export type AttachAssetParams = {
19
- /**
20
- * A Merchant Identity
21
- */
22
- m_id?: QMIdParameter;
19
+ /**
20
+ * A Merchant Identity
21
+ */
22
+ m_id?: QMIdParameter;
23
23
  };
24
24
 
25
25
  /**
@@ -33,48 +33,48 @@ export type QUntilParameter = string;
33
33
  export type QFromParameter = string;
34
34
 
35
35
  export type GetOrganisationChargesParams = {
36
- /**
37
- * A date from which to retrieve assets. This can be a date-time string but it is interpreted as a date, i.e. `2020-01-01T00:00:00Z` is interpreted as `2020-01-01`. Any asset that occurs on ar after this date will be returned. UTC is assumed if no timezone is provided
38
- */
39
- from?: QFromParameter;
40
- /**
41
- * A date where assets prior to this will be returned. This can be a date-time string but it is interpreted as a date, i.e. `2020-01-01T00:00:00Z` is interpreted as `2020-01-01`. Any asset that occurs prior this date will be returned. UTC is assumed if no timezone is provided
42
- */
43
- until?: QUntilParameter;
44
- /**
45
- * A charge Prior Billing Period, 0 implies "current" and -23 is for the period 23 months ago.
46
- */
47
- pbp?: QPbpParameter;
36
+ /**
37
+ * A date from which to retrieve assets. This can be a date-time string but it is interpreted as a date, i.e. `2020-01-01T00:00:00Z` is interpreted as `2020-01-01`. Any asset that occurs on ar after this date will be returned. UTC is assumed if no timezone is provided
38
+ */
39
+ from?: QFromParameter;
40
+ /**
41
+ * A date where assets prior to this will be returned. This can be a date-time string but it is interpreted as a date, i.e. `2020-01-01T00:00:00Z` is interpreted as `2020-01-01`. Any asset that occurs prior this date will be returned. UTC is assumed if no timezone is provided
42
+ */
43
+ until?: QUntilParameter;
44
+ /**
45
+ * A charge Prior Billing Period, 0 implies "current" and -23 is for the period 23 months ago.
46
+ */
47
+ pbp?: QPbpParameter;
48
48
  };
49
49
 
50
50
  export type GetProductChargesParams = {
51
- /**
52
- * A date from which to retrieve assets. This can be a date-time string but it is interpreted as a date, i.e. `2020-01-01T00:00:00Z` is interpreted as `2020-01-01`. Any asset that occurs on ar after this date will be returned. UTC is assumed if no timezone is provided
53
- */
54
- from?: QFromParameter;
55
- /**
56
- * A date where assets prior to this will be returned. This can be a date-time string but it is interpreted as a date, i.e. `2020-01-01T00:00:00Z` is interpreted as `2020-01-01`. Any asset that occurs prior this date will be returned. UTC is assumed if no timezone is provided
57
- */
58
- until?: QUntilParameter;
59
- /**
60
- * A charge Prior Billing Period, 0 implies "current" and -23 is for the period 23 months ago.
61
- */
62
- pbp?: QPbpParameter;
51
+ /**
52
+ * A date from which to retrieve assets. This can be a date-time string but it is interpreted as a date, i.e. `2020-01-01T00:00:00Z` is interpreted as `2020-01-01`. Any asset that occurs on ar after this date will be returned. UTC is assumed if no timezone is provided
53
+ */
54
+ from?: QFromParameter;
55
+ /**
56
+ * A date where assets prior to this will be returned. This can be a date-time string but it is interpreted as a date, i.e. `2020-01-01T00:00:00Z` is interpreted as `2020-01-01`. Any asset that occurs prior this date will be returned. UTC is assumed if no timezone is provided
57
+ */
58
+ until?: QUntilParameter;
59
+ /**
60
+ * A charge Prior Billing Period, 0 implies "current" and -23 is for the period 23 months ago.
61
+ */
62
+ pbp?: QPbpParameter;
63
63
  };
64
64
 
65
65
  export type GetChargesParams = {
66
- /**
67
- * A date from which to retrieve assets. This can be a date-time string but it is interpreted as a date, i.e. `2020-01-01T00:00:00Z` is interpreted as `2020-01-01`. Any asset that occurs on ar after this date will be returned. UTC is assumed if no timezone is provided
68
- */
69
- from?: QFromParameter;
70
- /**
71
- * A date where assets prior to this will be returned. This can be a date-time string but it is interpreted as a date, i.e. `2020-01-01T00:00:00Z` is interpreted as `2020-01-01`. Any asset that occurs prior this date will be returned. UTC is assumed if no timezone is provided
72
- */
73
- until?: QUntilParameter;
74
- /**
75
- * A charge Prior Billing Period, 0 implies "current" and -23 is for the period 23 months ago.
76
- */
77
- pbp?: QPbpParameter;
66
+ /**
67
+ * A date from which to retrieve assets. This can be a date-time string but it is interpreted as a date, i.e. `2020-01-01T00:00:00Z` is interpreted as `2020-01-01`. Any asset that occurs on ar after this date will be returned. UTC is assumed if no timezone is provided
68
+ */
69
+ from?: QFromParameter;
70
+ /**
71
+ * A date where assets prior to this will be returned. This can be a date-time string but it is interpreted as a date, i.e. `2020-01-01T00:00:00Z` is interpreted as `2020-01-01`. Any asset that occurs prior this date will be returned. UTC is assumed if no timezone is provided
72
+ */
73
+ until?: QUntilParameter;
74
+ /**
75
+ * A charge Prior Billing Period, 0 implies "current" and -23 is for the period 23 months ago.
76
+ */
77
+ pbp?: QPbpParameter;
78
78
  };
79
79
 
80
80
  /**
@@ -93,22 +93,22 @@ export type QProductIdParameter = string;
93
93
  export type QUnitIdParameter = string;
94
94
 
95
95
  export type GetAssetParams = {
96
- /**
97
- * A User Identity
98
- */
99
- user_id?: QUserIdParameter;
100
- /**
101
- * A Product Identity
102
- */
103
- product_id?: QProductIdParameter;
104
- /**
105
- * A Unit Identity
106
- */
107
- unit_id?: QUnitIdParameter;
108
- /**
109
- * An Organisation Identity
110
- */
111
- org_id?: QOrgIdParameter;
96
+ /**
97
+ * A User Identity
98
+ */
99
+ user_id?: QUserIdParameter;
100
+ /**
101
+ * A Product Identity
102
+ */
103
+ product_id?: QProductIdParameter;
104
+ /**
105
+ * A Unit Identity
106
+ */
107
+ unit_id?: QUnitIdParameter;
108
+ /**
109
+ * An Organisation Identity
110
+ */
111
+ org_id?: QOrgIdParameter;
112
112
  };
113
113
 
114
114
  /**
@@ -127,71 +127,70 @@ export type QOrgIdParameter = string;
127
127
  export type QPbpParameter = number;
128
128
 
129
129
  export type GetUnitChargesParams = {
130
- /**
131
- * A date from which to retrieve assets. This can be a date-time string but it is interpreted as a date, i.e. `2020-01-01T00:00:00Z` is interpreted as `2020-01-01`. Any asset that occurs on ar after this date will be returned. UTC is assumed if no timezone is provided
132
- */
133
- from?: QFromParameter;
134
- /**
135
- * A date where assets prior to this will be returned. This can be a date-time string but it is interpreted as a date, i.e. `2020-01-01T00:00:00Z` is interpreted as `2020-01-01`. Any asset that occurs prior this date will be returned. UTC is assumed if no timezone is provided
136
- */
137
- until?: QUntilParameter;
138
- /**
139
- * A charge Prior Billing Period, 0 implies "current" and -23 is for the period 23 months ago.
140
- */
141
- pbp?: QPbpParameter;
130
+ /**
131
+ * A date from which to retrieve assets. This can be a date-time string but it is interpreted as a date, i.e. `2020-01-01T00:00:00Z` is interpreted as `2020-01-01`. Any asset that occurs on ar after this date will be returned. UTC is assumed if no timezone is provided
132
+ */
133
+ from?: QFromParameter;
134
+ /**
135
+ * A date where assets prior to this will be returned. This can be a date-time string but it is interpreted as a date, i.e. `2020-01-01T00:00:00Z` is interpreted as `2020-01-01`. Any asset that occurs prior this date will be returned. UTC is assumed if no timezone is provided
136
+ */
137
+ until?: QUntilParameter;
138
+ /**
139
+ * A charge Prior Billing Period, 0 implies "current" and -23 is for the period 23 months ago.
140
+ */
141
+ pbp?: QPbpParameter;
142
142
  };
143
143
 
144
144
  export type ProductPatchBodyBody = {
145
- /** The name you want to give the Product */
146
- name?: string;
147
145
  /** The Product's built-in coin allowance. Product allowances cannot be reduced */
148
146
  allowance?: number;
149
147
  /** The Product's built-in coin limit. If set it must not be less than the allowance. If not set the allowance is used. The existing product limit cannot be reduced */
150
148
  limit?: number;
149
+ /** The name you want to give the Product */
150
+ name?: string;
151
151
  };
152
152
 
153
153
  /**
154
- * The Flavour of the Product. Used only for Project Tier Products. Do not set this for Storage products
154
+ * The Type of Product. Storage subscriptions require an **Allowance** to be defined and the **Flavour** must not be provided.
155
+
156
+ Project Tier subscriptions have built-in allowances and Limits so you must not provide values for these for these products
155
157
  */
156
- export type UnitProductPostBodyBodyFlavour =
157
- (typeof UnitProductPostBodyBodyFlavour)[keyof typeof UnitProductPostBodyBodyFlavour];
158
+ export type UnitProductPostBodyBodyType = typeof UnitProductPostBodyBodyType[keyof typeof UnitProductPostBodyBodyType];
159
+
158
160
 
159
161
  // eslint-disable-next-line @typescript-eslint/no-redeclare
160
- export const UnitProductPostBodyBodyFlavour = {
161
- EVALUATION: "EVALUATION",
162
- BRONZE: "BRONZE",
163
- SILVER: "SILVER",
164
- GOLD: "GOLD",
162
+ export const UnitProductPostBodyBodyType = {
163
+ DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION: 'DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION',
164
+ DATA_MANAGER_STORAGE_SUBSCRIPTION: 'DATA_MANAGER_STORAGE_SUBSCRIPTION',
165
165
  } as const;
166
166
 
167
167
  /**
168
- * The Type of Product. Storage subscriptions require an **Allowance** to be defined and the **Flavour** must not be provided.
169
-
170
- Project Tier subscriptions have built-in allowances and Limits so you must not provide values for these for these products
168
+ * The Flavour of the Product. Used only for Project Tier Products. Do not set this for Storage products
171
169
  */
172
- export type UnitProductPostBodyBodyType =
173
- (typeof UnitProductPostBodyBodyType)[keyof typeof UnitProductPostBodyBodyType];
170
+ export type UnitProductPostBodyBodyFlavour = typeof UnitProductPostBodyBodyFlavour[keyof typeof UnitProductPostBodyBodyFlavour];
171
+
174
172
 
175
173
  // eslint-disable-next-line @typescript-eslint/no-redeclare
176
- export const UnitProductPostBodyBodyType = {
177
- DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION:
178
- "DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION",
179
- DATA_MANAGER_STORAGE_SUBSCRIPTION: "DATA_MANAGER_STORAGE_SUBSCRIPTION",
174
+ export const UnitProductPostBodyBodyFlavour = {
175
+ EVALUATION: 'EVALUATION',
176
+ BRONZE: 'BRONZE',
177
+ SILVER: 'SILVER',
178
+ GOLD: 'GOLD',
180
179
  } as const;
181
180
 
182
181
  export type UnitProductPostBodyBody = {
182
+ /** The Product's coin allowance. You must provide this for Storage products but you must not provide a value for Project Tier Products */
183
+ allowance?: number;
184
+ /** The Flavour of the Product. Used only for Project Tier Products. Do not set this for Storage products */
185
+ flavour?: UnitProductPostBodyBodyFlavour;
186
+ /** The Product's built-in coin limit. If set it must not be less than the allowance. If not set the allowance is used. You can provide this for Storage products but you must not provide a value for Project Tier Products */
187
+ limit?: number;
183
188
  /** The name you want to give the Product */
184
189
  name: string;
185
190
  /** The Type of Product. Storage subscriptions require an **Allowance** to be defined and the **Flavour** must not be provided.
186
191
 
187
192
  Project Tier subscriptions have built-in allowances and Limits so you must not provide values for these for these products */
188
193
  type: UnitProductPostBodyBodyType;
189
- /** The Flavour of the Product. Used only for Project Tier Products. Do not set this for Storage products */
190
- flavour?: UnitProductPostBodyBodyFlavour;
191
- /** The Product's coin allowance. You must provide this for Storage products but you must not provide a value for Project Tier Products */
192
- allowance?: number;
193
- /** The Product's built-in coin limit. If set it must not be less than the allowance. If not set the allowance is used. You can provide this for Storage products but you must not provide a value for Project Tier Products */
194
- limit?: number;
195
194
  };
196
195
 
197
196
  export type UnitPatchBodyBody = {
@@ -205,10 +204,10 @@ export type OrganisationPatchBodyBody = {
205
204
  };
206
205
 
207
206
  export type OrganisationUnitPostBodyBody = {
208
- /** The name of the unit */
209
- name: string;
210
207
  /** The day you would like to be billed for the Unit's Products (a value from 1 and 28) */
211
208
  billing_day: number;
209
+ /** The name of the unit */
210
+ name: string;
212
211
  };
213
212
 
214
213
  export type PersonalUnitPutBodyBody = {
@@ -223,32 +222,32 @@ export type OrganisationPostBodyBody = {
223
222
  owner: string;
224
223
  };
225
224
 
226
- export type AssetPostBodyBodyScope =
227
- (typeof AssetPostBodyBodyScope)[keyof typeof AssetPostBodyBodyScope];
225
+ export type AssetPostBodyBodyScope = typeof AssetPostBodyBodyScope[keyof typeof AssetPostBodyBodyScope];
226
+
228
227
 
229
228
  // eslint-disable-next-line @typescript-eslint/no-redeclare
230
229
  export const AssetPostBodyBodyScope = {
231
- USER: "USER",
232
- PRODUCT: "PRODUCT",
233
- UNIT: "UNIT",
234
- ORGANISATION: "ORGANISATION",
235
- GLOBAL: "GLOBAL",
230
+ USER: 'USER',
231
+ PRODUCT: 'PRODUCT',
232
+ UNIT: 'UNIT',
233
+ ORGANISATION: 'ORGANISATION',
234
+ GLOBAL: 'GLOBAL',
236
235
  } as const;
237
236
 
238
237
  export type AssetPostBodyBody = {
239
- /** The name of the asset. This must be unique within its scope. For example, only one asset can be called "asset-1" within a given Unit. Asset names must be valid RFC 1123 Label Names */
240
- name: string;
241
238
  /** A file containing the content for the asset. You must provide a value here or in content_string */
242
239
  content_file?: Blob;
243
240
  /** The textual content of the asset. You must provide a value here or in content_file */
244
241
  content_string?: string;
242
+ /** An optional description for the Asset */
243
+ description?: string;
244
+ /** The name of the asset. This must be unique within its scope. For example, only one asset can be called "asset-1" within a given Unit. Asset names must be valid RFC 1123 Label Names */
245
+ name: string;
245
246
  scope: AssetPostBodyBodyScope;
246
247
  /** The unique identity based on the Scope of the asset. For example, this will be the Unit ID if it's a UNIT. A scope_id is required if the scope is USER as it will be automatically set to your username. Global assets do not have a scope. */
247
248
  scope_id?: string;
248
249
  /** Is this a secret asset? */
249
250
  secret: boolean;
250
- /** An optional description for the Asset */
251
- description?: string;
252
251
  };
253
252
 
254
253
  export type AssetPatchBodyBody = {
@@ -266,16 +265,19 @@ export interface UserDetail {
266
265
  }
267
266
 
268
267
  export interface UserAccountDetail {
269
- user: UserDetail;
270
- /** Whether the caller has admin privilege */
271
- caller_has_admin_privilege: boolean;
272
268
  /** The roles assigned to the user recognised by the Account Server */
273
269
  account_server_roles: string[];
270
+ /** Whether the caller has admin privilege */
271
+ caller_has_admin_privilege: boolean;
272
+ user: UserDetail;
274
273
  }
275
274
 
276
275
  export interface UnitDetail {
276
+ /** The Unit's billing day */
277
+ billing_day: number;
277
278
  /** Whether the user making the API call is a member of the Unit */
278
279
  caller_is_member: boolean;
280
+ created: string;
279
281
  /** The Unit's unique identity */
280
282
  id: string;
281
283
  /** The Unit's name */
@@ -284,45 +286,43 @@ export interface UnitDetail {
284
286
  owner_id: string;
285
287
  /** True if the Unit is private */
286
288
  private: boolean;
287
- created: string;
288
- /** The Unit's billing day */
289
- billing_day: number;
290
289
  }
291
290
 
292
291
  /**
293
292
  * The kind of Service
294
293
  */
295
- export type MerchantDetailKind =
296
- (typeof MerchantDetailKind)[keyof typeof MerchantDetailKind];
294
+ export type MerchantDetailKind = typeof MerchantDetailKind[keyof typeof MerchantDetailKind];
295
+
297
296
 
298
297
  // eslint-disable-next-line @typescript-eslint/no-redeclare
299
298
  export const MerchantDetailKind = {
300
- DATA_MANAGER: "DATA_MANAGER",
299
+ DATA_MANAGER: 'DATA_MANAGER',
301
300
  } as const;
302
301
 
303
302
  export interface MerchantDetail {
303
+ /** The hostname used by the Service */
304
+ api_hostname: string;
305
+ created: string;
304
306
  /** The unique ID of the Service */
305
307
  id: number;
306
- created: string;
307
308
  /** The kind of Service */
308
309
  kind: MerchantDetailKind;
309
310
  /** The name assigned to the Service */
310
311
  name: string;
311
- /** The hostname used by the Service */
312
- api_hostname: string;
313
312
  }
314
313
 
315
314
  export type MerchantGetResponse = MerchantDetail;
316
315
 
317
316
  export interface MerchantsGetResponse {
318
317
  /** The list of known Merchants
319
- */
318
+ */
320
319
  merchants: MerchantDetail[];
321
320
  }
322
321
 
323
322
  export interface OrganisationDetail {
324
323
  /** Whether the user making the API call is a member of the Unit */
325
324
  caller_is_member: boolean;
325
+ created: string;
326
326
  /** The Organisation's unique ID */
327
327
  id: string;
328
328
  /** The Organisation's name */
@@ -331,32 +331,31 @@ export interface OrganisationDetail {
331
331
  owner_id?: string;
332
332
  /** True if the Unit is private */
333
333
  private: boolean;
334
- created: string;
335
334
  }
336
335
 
337
336
  /**
338
337
  * The kind of service that can use the Product
339
338
  */
340
- export type ProductTypeServiceKind =
341
- (typeof ProductTypeServiceKind)[keyof typeof ProductTypeServiceKind];
339
+ export type ProductTypeServiceKind = typeof ProductTypeServiceKind[keyof typeof ProductTypeServiceKind];
340
+
342
341
 
343
342
  // eslint-disable-next-line @typescript-eslint/no-redeclare
344
343
  export const ProductTypeServiceKind = {
345
- DATA_MANAGER: "DATA_MANAGER",
344
+ DATA_MANAGER: 'DATA_MANAGER',
346
345
  } as const;
347
346
 
348
347
  export interface ProductType {
349
- /** A product type, this is a unique string amongst all types known to the Account Server */
350
- type: string;
351
348
  /** A product flavour. Not all types have a flavour, those that do have a type-specific flavour string */
352
349
  flavour?: string;
353
350
  /** The kind of service that can use the Product */
354
351
  service_kind?: ProductTypeServiceKind;
352
+ /** A product type, this is a unique string amongst all types known to the Account Server */
353
+ type: string;
355
354
  }
356
355
 
357
356
  export type ProductInstanceDetailCoins = {
358
357
  /** The number of coins used
359
- */
358
+ */
360
359
  used: number;
361
360
  };
362
361
 
@@ -365,214 +364,213 @@ export interface ProductInstanceDetail {
365
364
  }
366
365
 
367
366
  /**
368
- * The Product Type flavour. Not all products have flavours
367
+ * The Product Type
369
368
 
370
369
  */
371
- export type ProductDetailFlavour =
372
- (typeof ProductDetailFlavour)[keyof typeof ProductDetailFlavour];
370
+ export type ProductDetailType = typeof ProductDetailType[keyof typeof ProductDetailType];
371
+
373
372
 
374
373
  // eslint-disable-next-line @typescript-eslint/no-redeclare
375
- export const ProductDetailFlavour = {
376
- EVALUATION: "EVALUATION",
377
- BRONZE: "BRONZE",
378
- SILVER: "SILVER",
379
- GOLD: "GOLD",
374
+ export const ProductDetailType = {
375
+ DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION: 'DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION',
376
+ DATA_MANAGER_STORAGE_SUBSCRIPTION: 'DATA_MANAGER_STORAGE_SUBSCRIPTION',
380
377
  } as const;
381
378
 
382
379
  /**
383
- * The Product Type
380
+ * The Product Type flavour. Not all products have flavours
384
381
 
385
382
  */
386
- export type ProductDetailType =
387
- (typeof ProductDetailType)[keyof typeof ProductDetailType];
383
+ export type ProductDetailFlavour = typeof ProductDetailFlavour[keyof typeof ProductDetailFlavour];
384
+
388
385
 
389
386
  // eslint-disable-next-line @typescript-eslint/no-redeclare
390
- export const ProductDetailType = {
391
- DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION:
392
- "DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION",
393
- DATA_MANAGER_STORAGE_SUBSCRIPTION: "DATA_MANAGER_STORAGE_SUBSCRIPTION",
387
+ export const ProductDetailFlavour = {
388
+ EVALUATION: 'EVALUATION',
389
+ BRONZE: 'BRONZE',
390
+ SILVER: 'SILVER',
391
+ GOLD: 'GOLD',
394
392
  } as const;
395
393
 
396
394
  export interface ProductDetail {
397
- /** The Product ID
398
- */
399
- id: string;
400
395
  created: string;
401
- /** The Product Type
402
- */
403
- type: ProductDetailType;
404
396
  /** The Product Type flavour. Not all products have flavours
405
- */
397
+ */
406
398
  flavour?: ProductDetailFlavour;
399
+ /** The Product ID
400
+ */
401
+ id: string;
407
402
  /** The name of the Product
408
- */
403
+ */
409
404
  name?: string;
405
+ /** The Product Type
406
+ */
407
+ type: ProductDetailType;
410
408
  }
411
409
 
412
410
  export interface ProductCoinsDetail {
413
411
  /** The billing allowance. When you exceed this during the current billing period the *cost multiplier* will increase */
414
412
  allowance: number;
415
- /** The limit on your billing period spend. You can exceed the allowance but you cannot exceed the spend limit. Once reached the dependent may be restricted */
416
- limit: number;
417
- /** The total number of coins consumed (in this billing period), excluding the coins that have been consumed for the current day */
418
- used: number;
413
+ /** A multiplier applied to your coin usage within your allowance */
414
+ allowance_multiplier: number;
419
415
  /** True if the product is operating at or beyond its coin limit. When it is authority to perform actions using the product are severely limited. */
420
416
  at_limit: boolean;
421
- /** The current burn rate, the approximate amount of coins you are currently consuming each day */
422
- current_burn_rate: number;
423
- /** The predicted billing period amount, if costs continue at the current burn rate until the end of the billing period */
424
- billing_prediction: number;
425
417
  /** The day of the month when the bill is due, and the end of the current billing period */
426
418
  billing_day: number;
427
- /** A multiplier applied to your coin usage within your allowance */
428
- allowance_multiplier: number;
419
+ /** The predicted total billing period amount, if costs continue at the current burn rate until the end of the billing period. This is an estimate */
420
+ billing_prediction: number;
421
+ /** The predicted storage contribution to the billing period amount, if costs continue at the current burn rate until the end of the billing period. This is an estimate */
422
+ billing_prediction_storage_contribution: number;
423
+ /** The current burn rate, the approximate amount of coins you are currently consuming each day */
424
+ current_burn_rate: number;
425
+ /** The limit on your billing period spend. You can exceed the allowance but you cannot exceed the spend limit. Once reached the dependent may be restricted */
426
+ limit: number;
429
427
  /** A multiplier that will be applied to coin used beyond your allowance */
430
428
  overspend_multiplier: number;
431
429
  /** The number of days remaining, in the current billing period */
432
430
  remaining_days: number;
431
+ /** The total number of coins consumed (in this billing period), excluding the coins that have been consumed for the current day */
432
+ used: number;
433
433
  }
434
434
 
435
435
  export interface ProductClaimDetail {
436
436
  /** The service-specific ID that is using this Subscription
437
- */
437
+ */
438
438
  id: string;
439
439
  /** A name for the service-specific ID
440
- */
440
+ */
441
441
  name?: string;
442
442
  }
443
443
 
444
- export type ProductDmStorageDetailCoins = {
445
- /** The number of coins currently committed for the current day. This is added to the accumulated coins at the start of each day */
446
- used: number;
447
- /** The coin cost of a 'unit' of storage or part thereof. The unit size is defined in the storage section of the response */
448
- unit_cost: number;
449
- };
450
-
451
444
  export type ProductDmStorageDetailSize = {
452
- /** The humanised size of the peak storage used for the current day. The value is reset at the start of each day */
453
- peak: string;
454
445
  /** The humanised size of the current storage used for the current day and used to calculate the 'burn rate' */
455
446
  current: string;
447
+ /** The humanised size of the peak storage used for the current day. The value is reset at the start of each day */
448
+ peak: string;
456
449
  /** The humanised storage unit. The cost of storage is based on the daily peak of the number of units (or part thereof) used */
457
450
  unit_size: string;
458
451
  /** The peak number of storage units used today */
459
452
  units_used: number;
460
453
  };
461
454
 
455
+ export type ProductDmStorageDetailCoins = {
456
+ /** The coin cost of a 'unit' of storage or part thereof. The unit size is defined in the storage section of the response */
457
+ unit_cost: number;
458
+ /** The number of coins currently committed for the current day. This is added to the accumulated coins at the start of each day */
459
+ used: number;
460
+ };
461
+
462
462
  export interface ProductDmStorageDetail {
463
- size: ProductDmStorageDetailSize;
464
463
  coins: ProductDmStorageDetailCoins;
464
+ size: ProductDmStorageDetailSize;
465
465
  }
466
466
 
467
467
  export interface ProductDmProjectTier {
468
- product: ProductDetail;
469
- organisation: OrganisationDetail;
470
- unit: UnitDetail;
471
- storage: ProductDmStorageDetail;
472
- coins: ProductCoinsDetail;
473
- instance: ProductInstanceDetail;
468
+ claim?: ProductClaimDetail;
474
469
  /** True if the product can be (needs to be) claimed. */
475
470
  claimable: boolean;
476
- claim?: ProductClaimDetail;
471
+ coins: ProductCoinsDetail;
472
+ instance: ProductInstanceDetail;
473
+ organisation: OrganisationDetail;
474
+ product: ProductDetail;
475
+ storage: ProductDmStorageDetail;
476
+ unit: UnitDetail;
477
477
  }
478
478
 
479
479
  export interface ProductDmStorage {
480
- product: ProductDetail;
481
- organisation: OrganisationDetail;
482
- unit: UnitDetail;
483
- storage: ProductDmStorageDetail;
484
- coins: ProductCoinsDetail;
485
480
  /** True if the product can be (needs to be) claimed. */
486
481
  claimable: boolean;
482
+ coins: ProductCoinsDetail;
483
+ organisation: OrganisationDetail;
484
+ product: ProductDetail;
485
+ storage: ProductDmStorageDetail;
486
+ unit: UnitDetail;
487
487
  }
488
488
 
489
- export interface ChargeAdditionalData {
490
- [key: string]: any;
491
- }
489
+ export interface ChargeAdditionalData { [key: string]: any }
492
490
 
493
491
  export interface StorageChargeItem {
494
- item_number: number;
495
- /** The date and time of the processing charge */
496
- date: string;
497
- /** The coin-cost of the storage */
498
- coins: string;
492
+ additional_data?: ChargeAdditionalData;
499
493
  /** The date when the charges concluded */
500
494
  closed?: string;
501
- additional_data?: ChargeAdditionalData;
495
+ /** The coin-cost of the storage */
496
+ coins: string;
497
+ /** The date and time of the processing charge */
498
+ date: string;
499
+ item_number: number;
502
500
  }
503
501
 
504
502
  export interface StorageCharges {
505
- num_items: number;
506
503
  items: StorageChargeItem[];
504
+ num_items: number;
507
505
  }
508
506
 
509
507
  export interface ProcessingChargeItem {
508
+ additional_data?: ChargeAdditionalData;
509
+ /** The coin-cost of the storage */
510
+ coins: string;
510
511
  /** The charge record number */
511
512
  id: number;
513
+ name?: string;
512
514
  /** The most recent sequence number for this charge */
513
515
  sqn: number;
514
- name?: string;
515
- username: string;
516
516
  /** The date and time of the processing charge */
517
517
  timestamp: string;
518
- /** The coin-cost of the storage */
519
- coins: string;
520
- additional_data?: ChargeAdditionalData;
518
+ username: string;
521
519
  }
522
520
 
523
- export type ProcessingChargesMerchantKind =
524
- (typeof ProcessingChargesMerchantKind)[keyof typeof ProcessingChargesMerchantKind];
521
+ export type ProcessingChargesMerchantKind = typeof ProcessingChargesMerchantKind[keyof typeof ProcessingChargesMerchantKind];
522
+
525
523
 
526
524
  // eslint-disable-next-line @typescript-eslint/no-redeclare
527
525
  export const ProcessingChargesMerchantKind = {
528
- DATA_MANAGER: "DATA_MANAGER",
526
+ DATA_MANAGER: 'DATA_MANAGER',
529
527
  } as const;
530
528
 
531
529
  export interface ProcessingCharges {
532
- merchant_name: string;
533
- merchant_kind: ProcessingChargesMerchantKind;
534
- merchant_api_hostname: string;
530
+ charge: ProcessingChargeItem;
535
531
  /** The date when the process stopped */
536
532
  closed?: string;
537
533
  /** True if no further change to the charges can occur. Typically True after the charge has been closed for a pre-configured period of time. */
538
534
  final: boolean;
535
+ merchant_api_hostname: string;
536
+ merchant_kind: ProcessingChargesMerchantKind;
537
+ merchant_name: string;
539
538
  /** True if charges were received after the charge record was finalised */
540
539
  post_final_charges?: boolean;
541
- charge: ProcessingChargeItem;
542
540
  }
543
541
 
544
- export type AssetDetailScope =
545
- (typeof AssetDetailScope)[keyof typeof AssetDetailScope];
542
+ export type AssetDetailScope = typeof AssetDetailScope[keyof typeof AssetDetailScope];
543
+
546
544
 
547
545
  // eslint-disable-next-line @typescript-eslint/no-redeclare
548
546
  export const AssetDetailScope = {
549
- USER: "USER",
550
- PRODUCT: "PRODUCT",
551
- UNIT: "UNIT",
552
- ORGANISATION: "ORGANISATION",
553
- GLOBAL: "GLOBAL",
547
+ USER: 'USER',
548
+ PRODUCT: 'PRODUCT',
549
+ UNIT: 'UNIT',
550
+ ORGANISATION: 'ORGANISATION',
551
+ GLOBAL: 'GLOBAL',
554
552
  } as const;
555
553
 
556
554
  export interface AssetDetail {
555
+ content: string;
556
+ content_modified?: string;
557
+ created: string;
557
558
  creator: string;
559
+ description?: string;
560
+ disabled: boolean;
558
561
  id: string;
562
+ merchants: MerchantDetail[];
559
563
  name: string;
560
564
  scope: AssetDetailScope;
561
565
  scope_id: string;
562
566
  secret: boolean;
563
- disabled: boolean;
564
- content: string;
565
- created: string;
566
- content_modified?: string;
567
- description?: string;
568
- merchants: MerchantDetail[];
569
567
  }
570
568
 
571
569
  export type UserAccountGetResponse = UserAccountDetail;
572
570
 
573
571
  export interface UnitsGetResponse {
574
572
  /** A list of Units
575
- */
573
+ */
576
574
  units: OrganisationUnitsGetResponse[];
577
575
  }
578
576
 
@@ -586,26 +584,26 @@ export interface UnitProductPostResponse {
586
584
  /**
587
585
  * The type of charge
588
586
  */
589
- export type ChargeSummaryType =
590
- (typeof ChargeSummaryType)[keyof typeof ChargeSummaryType];
587
+ export type ChargeSummaryType = typeof ChargeSummaryType[keyof typeof ChargeSummaryType];
588
+
591
589
 
592
590
  // eslint-disable-next-line @typescript-eslint/no-redeclare
593
591
  export const ChargeSummaryType = {
594
- PROCESSING: "PROCESSING",
595
- STORAGE: "STORAGE",
592
+ PROCESSING: 'PROCESSING',
593
+ STORAGE: 'STORAGE',
596
594
  } as const;
597
595
 
598
596
  export interface ChargeSummary {
599
- /** The type of charge */
600
- type: ChargeSummaryType;
601
597
  /** The cost, in coins of the charge */
602
598
  coins: string;
599
+ /** The type of charge */
600
+ type: ChargeSummaryType;
603
601
  }
604
602
 
605
603
  export interface UnitProductChargeSummary {
604
+ charges: ChargeSummary[];
606
605
  product_id: string;
607
606
  product_type: string;
608
- charges: ChargeSummary[];
609
607
  }
610
608
 
611
609
  export interface UnitChargeSummary {
@@ -613,31 +611,29 @@ export interface UnitChargeSummary {
613
611
  }
614
612
 
615
613
  export interface UnitChargesGetResponse {
614
+ billing_day: number;
616
615
  /** Whether the user making the API call is a member of the Unit */
617
616
  caller_is_member: boolean;
618
- unit_id: string;
617
+ coins: string;
618
+ created: string;
619
+ /** The start of the charge period */
620
+ from: string;
619
621
  name?: string;
620
622
  /** The Unit's owner (a username) */
621
623
  owner_id: string;
622
624
  /** True if the Unit is private */
623
625
  private: boolean;
624
- created: string;
625
- coins: string;
626
- billing_day: number;
627
- /** The start of the charge period */
628
- from: string;
626
+ products: UnitProductChargeSummary[];
627
+ summary: UnitChargeSummary;
628
+ unit_id: string;
629
629
  /** The date where of first day after the charge period */
630
630
  until: string;
631
- summary: UnitChargeSummary;
632
- products: UnitProductChargeSummary[];
633
631
  }
634
632
 
635
633
  /**
636
634
  * The Unit's Product
637
635
  */
638
- export type ProductUnitGetResponseProduct =
639
- | ProductDmStorage
640
- | ProductDmProjectTier;
636
+ export type ProductUnitGetResponseProduct = ProductDmStorage | ProductDmProjectTier;
641
637
 
642
638
  export interface ProductUnitGetResponse {
643
639
  /** The Unit's Product */
@@ -651,48 +647,45 @@ export interface ProductsGetTypesResponse {
651
647
 
652
648
  export type ProductsGetDefaultStorageCostDefaultStorageCost = {
653
649
  cost: string;
654
- units: string;
655
650
  description: string;
651
+ units: string;
656
652
  };
657
653
 
658
654
  export interface ProductsGetDefaultStorageCost {
659
655
  default_storage_cost: ProductsGetDefaultStorageCostDefaultStorageCost;
660
656
  }
661
657
 
662
- export type ProductsGetResponseProductsItem =
663
- | ProductDmStorage
664
- | ProductDmProjectTier;
658
+ export type ProductsGetResponseProductsItem = ProductDmStorage | ProductDmProjectTier;
665
659
 
666
660
  export interface ProductsGetResponse {
667
661
  /** All the Products you have access to */
668
662
  products: ProductsGetResponseProductsItem[];
669
663
  }
670
664
 
671
- export type ProductChargesGetResponseProductType =
672
- (typeof ProductChargesGetResponseProductType)[keyof typeof ProductChargesGetResponseProductType];
665
+ export type ProductChargesGetResponseProductType = typeof ProductChargesGetResponseProductType[keyof typeof ProductChargesGetResponseProductType];
666
+
673
667
 
674
668
  // eslint-disable-next-line @typescript-eslint/no-redeclare
675
669
  export const ProductChargesGetResponseProductType = {
676
- DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION:
677
- "DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION",
678
- DATA_MANAGER_STORAGE_SUBSCRIPTION: "DATA_MANAGER_STORAGE_SUBSCRIPTION",
670
+ DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION: 'DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION',
671
+ DATA_MANAGER_STORAGE_SUBSCRIPTION: 'DATA_MANAGER_STORAGE_SUBSCRIPTION',
679
672
  } as const;
680
673
 
681
674
  export interface ProductChargesGetResponse {
682
- product_id: string;
683
- product_type: ProductChargesGetResponseProductType;
684
675
  billing_day: number;
676
+ claim?: ProductClaimDetail;
685
677
  /** True if the product can be (needs to be) claimed. */
686
678
  claimable: boolean;
687
- claim?: ProductClaimDetail;
688
- /** The start of the charge period */
689
- from: string;
690
- /** The date where of first day after the charge period */
691
- until: string;
692
679
  /** The total number of coins consumed by this product for the invoice period */
693
680
  coins: string;
681
+ /** The start of the charge period */
682
+ from: string;
694
683
  processing_charges: ProcessingCharges[];
684
+ product_id: string;
685
+ product_type: ProductChargesGetResponseProductType;
695
686
  storage_charges: StorageCharges;
687
+ /** The date where of first day after the charge period */
688
+ until: string;
696
689
  }
697
690
 
698
691
  export type OrganisationGetResponse = OrganisationDetail;
@@ -703,20 +696,20 @@ export interface OrganisationsGetResponse {
703
696
  }
704
697
 
705
698
  export interface OrganisationUnitChargeSummary {
706
- unit_id: string;
707
- name: string;
708
699
  billing_day: number;
709
700
  /** The start of the charge period */
710
701
  from: string;
702
+ name: string;
703
+ summary: ChargeSummary[];
704
+ unit_id: string;
711
705
  /** The date where of first day after the charge period */
712
706
  until: string;
713
- summary: ChargeSummary[];
714
707
  }
715
708
 
716
709
  export interface OrganisationChargesGetResponse {
717
- organisation_id: string;
718
- name: string;
719
710
  coins: string;
711
+ name: string;
712
+ organisation_id: string;
720
713
  summary: ChargeSummary[];
721
714
  unit_charges: OrganisationUnitChargeSummary[];
722
715
  }
@@ -724,21 +717,21 @@ export interface OrganisationChargesGetResponse {
724
717
  export interface OrganisationUnitsGetResponse {
725
718
  organisation: OrganisationDetail;
726
719
  /** A list of Units
727
- */
720
+ */
728
721
  units: UnitDetail[];
729
722
  }
730
723
 
731
724
  export interface OrganisationChargeSummary {
732
- organisation_id: string;
733
725
  name: string;
726
+ organisation_id: string;
734
727
  summary: ChargeSummary[];
735
728
  }
736
729
 
737
730
  export interface PersonalUnitPutResponse {
738
- /** The unit's Organisation. Used to identify the Default organisation */
739
- organisation_id: string;
740
731
  /** The unit's unique ID */
741
732
  id: string;
733
+ /** The unit's Organisation. Used to identify the Default organisation */
734
+ organisation_id: string;
742
735
  }
743
736
 
744
737
  export interface OrganisationUnitPostResponse {
@@ -748,24 +741,24 @@ export interface OrganisationUnitPostResponse {
748
741
 
749
742
  export interface OrganisationGetDefaultResponse {
750
743
  /** Whether the user making the API call is a member of the Default Organisation. Only admin users are members of the Default organisation */
751
- caller_is_member: boolean;
744
+ caller_is_member?: boolean;
745
+ created?: string;
752
746
  /** The Default Organisation ID
753
- */
754
- id: string;
747
+ */
748
+ id?: string;
755
749
  /** The Default Organisation Name
756
- */
757
- name: string;
750
+ */
751
+ name?: string;
758
752
  /** True if the Organisation is private. The Default organisation is always public, although it does not contain a membership (unless you're admin) and only houses Personal Units
759
- */
760
- private: boolean;
761
- created: string;
753
+ */
754
+ private?: boolean;
762
755
  }
763
756
 
764
757
  export interface UsersGetResponse {
765
758
  organisation?: OrganisationDetail;
766
759
  unit?: UnitDetail;
767
760
  /** The list of Organisation Users
768
- */
761
+ */
769
762
  users: UserDetail[];
770
763
  }
771
764
 
@@ -776,7 +769,7 @@ export interface OrganisationPostResponse {
776
769
 
777
770
  export interface StateGetVersionResponse {
778
771
  /** The Account Server version. This is guaranteed to be a valid semantic version for official (tagged) images. The version value format for unofficial images is a string but otherwise undefined
779
- */
772
+ */
780
773
  version: string;
781
774
  }
782
775
 
@@ -789,19 +782,19 @@ export interface EventStreamGetPostResponse {
789
782
 
790
783
  export interface ChargesGetResponse {
791
784
  coins: string;
792
- summary: ChargeSummary[];
793
785
  organisation_charges: OrganisationChargeSummary[];
786
+ summary: ChargeSummary[];
794
787
  }
795
788
 
796
789
  export interface AssetPostResponse {
797
790
  /** The Asset ID
798
- */
791
+ */
799
792
  id: string;
800
793
  }
801
794
 
802
795
  export interface AssetGetResponse {
803
796
  /** A list of Assets
804
- */
797
+ */
805
798
  assets: AssetDetail[];
806
799
  }
807
800
 
@@ -809,3 +802,4 @@ export interface AsError {
809
802
  /** Brief error text that can be presented to the user */
810
803
  error: string;
811
804
  }
805
+