@squonk/account-server-client 0.1.31 → 0.1.32

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 (59) hide show
  1. package/asset/asset.cjs +133 -0
  2. package/asset/asset.cjs.map +1 -0
  3. package/asset/asset.d.ts +126 -0
  4. package/asset/asset.js +133 -0
  5. package/asset/asset.js.map +1 -0
  6. package/asset/package.json +7 -0
  7. package/{custom-instance-13412a15.d.ts → custom-instance-b985e1be.d.ts} +127 -40
  8. package/index.cjs +20 -2
  9. package/index.cjs.map +1 -1
  10. package/index.d.ts +1 -1
  11. package/index.js +20 -2
  12. package/index.js.map +1 -1
  13. package/merchant/merchant.cjs +48 -0
  14. package/merchant/merchant.cjs.map +1 -0
  15. package/merchant/merchant.d.ts +39 -0
  16. package/merchant/merchant.js +48 -0
  17. package/merchant/merchant.js.map +1 -0
  18. package/merchant/package.json +7 -0
  19. package/organisation/organisation.cjs +12 -12
  20. package/organisation/organisation.cjs.map +1 -1
  21. package/organisation/organisation.d.ts +10 -9
  22. package/organisation/organisation.js +12 -12
  23. package/organisation/organisation.js.map +1 -1
  24. package/package.json +9 -9
  25. package/product/product.cjs +36 -26
  26. package/product/product.cjs.map +1 -1
  27. package/product/product.d.ts +23 -16
  28. package/product/product.js +36 -26
  29. package/product/product.js.map +1 -1
  30. package/src/account-server-api.schemas.ts +155 -52
  31. package/src/asset/asset.ts +433 -0
  32. package/src/merchant/merchant.ts +145 -0
  33. package/src/organisation/organisation.ts +37 -37
  34. package/src/product/product.ts +97 -74
  35. package/src/state/state.ts +19 -16
  36. package/src/unit/unit.ts +64 -56
  37. package/src/user/user.ts +63 -62
  38. package/state/state.cjs +6 -4
  39. package/state/state.cjs.map +1 -1
  40. package/state/state.d.ts +7 -6
  41. package/state/state.js +6 -4
  42. package/state/state.js.map +1 -1
  43. package/unit/unit.cjs +22 -18
  44. package/unit/unit.cjs.map +1 -1
  45. package/unit/unit.d.ts +16 -15
  46. package/unit/unit.js +22 -18
  47. package/unit/unit.js.map +1 -1
  48. package/user/user.cjs +22 -20
  49. package/user/user.cjs.map +1 -1
  50. package/user/user.d.ts +14 -13
  51. package/user/user.js +22 -20
  52. package/user/user.js.map +1 -1
  53. package/service/package.json +0 -7
  54. package/service/service.cjs +0 -44
  55. package/service/service.cjs.map +0 -1
  56. package/service/service.d.ts +0 -49
  57. package/service/service.js +0 -44
  58. package/service/service.js.map +0 -1
  59. package/src/service/service.ts +0 -136
@@ -2,7 +2,7 @@ import * as axios from 'axios';
2
2
  import { AxiosRequestConfig, AxiosError } from 'axios';
3
3
 
4
4
  /**
5
- * Generated by orval v6.7.1 🍺
5
+ * Generated by orval v6.8.0 🍺
6
6
  * Do not edit manually.
7
7
  * Account Server API
8
8
  * The Informatics Matters Account Server API.
@@ -11,6 +11,38 @@ A service that provides access to the Account Server, which gives *registered* u
11
11
 
12
12
  * OpenAPI spec version: 0.1
13
13
  */
14
+ declare type DetachAssetParams = {
15
+ m_id?: QMIdParameter;
16
+ };
17
+ declare type AttachAssetParams = {
18
+ m_id?: QMIdParameter;
19
+ };
20
+ /**
21
+ * A User Identity
22
+ */
23
+ declare type QUserIdParameter = string;
24
+ /**
25
+ * A Product Identity
26
+ */
27
+ declare type QProductIdParameter = string;
28
+ /**
29
+ * A Unit Identity
30
+ */
31
+ declare type QUnitIdParameter = string;
32
+ declare type GetAssetParams = {
33
+ user_id?: QUserIdParameter;
34
+ product_id?: QProductIdParameter;
35
+ unit_id?: QUnitIdParameter;
36
+ org_id?: QOrgIdParameter;
37
+ };
38
+ /**
39
+ * A Merchant Identity
40
+ */
41
+ declare type QMIdParameter = number;
42
+ /**
43
+ * An Organisation Identity
44
+ */
45
+ declare type QOrgIdParameter = string;
14
46
  declare type ProductPatchBodyBody = {
15
47
  /** The name you want to give the Product */
16
48
  name?: string;
@@ -22,22 +54,22 @@ declare type ProductPatchBodyBody = {
22
54
  /**
23
55
  * The Flavour of the Product. Used only for Project Tier Products. Do not set this for Storage products
24
56
  */
25
- declare type UnitProductPostBodyBodyFlavour = "EVALUATION" | "BRONZE" | "SILVER" | "GOLD";
57
+ declare type UnitProductPostBodyBodyFlavour = typeof UnitProductPostBodyBodyFlavour[keyof typeof UnitProductPostBodyBodyFlavour];
26
58
  declare const UnitProductPostBodyBodyFlavour: {
27
- EVALUATION: UnitProductPostBodyBodyFlavour;
28
- BRONZE: UnitProductPostBodyBodyFlavour;
29
- SILVER: UnitProductPostBodyBodyFlavour;
30
- GOLD: UnitProductPostBodyBodyFlavour;
59
+ readonly EVALUATION: "EVALUATION";
60
+ readonly BRONZE: "BRONZE";
61
+ readonly SILVER: "SILVER";
62
+ readonly GOLD: "GOLD";
31
63
  };
32
64
  /**
33
65
  * The Type of Product. Storage subscriptions require an **Allowance** to be defined and the **Flavour** must not be provided.
34
66
 
35
67
  Project Tier subscriptions have built-in allowances and Limits so you must not provide values for these for these products
36
68
  */
37
- declare type UnitProductPostBodyBodyType = "DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION" | "DATA_MANAGER_STORAGE_SUBSCRIPTION";
69
+ declare type UnitProductPostBodyBodyType = typeof UnitProductPostBodyBodyType[keyof typeof UnitProductPostBodyBodyType];
38
70
  declare const UnitProductPostBodyBodyType: {
39
- DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION: UnitProductPostBodyBodyType;
40
- DATA_MANAGER_STORAGE_SUBSCRIPTION: UnitProductPostBodyBodyType;
71
+ readonly DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION: "DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION";
72
+ readonly DATA_MANAGER_STORAGE_SUBSCRIPTION: "DATA_MANAGER_STORAGE_SUBSCRIPTION";
41
73
  };
42
74
  declare type UnitProductPostBodyBody = {
43
75
  /** The name you want to give the Product */
@@ -67,6 +99,28 @@ declare type OrganisationPostBodyBody = {
67
99
  /** The name of the organisation owner. A user ID */
68
100
  owner: string;
69
101
  };
102
+ declare type AssetPostBodyBodyScope = typeof AssetPostBodyBodyScope[keyof typeof AssetPostBodyBodyScope];
103
+ declare const AssetPostBodyBodyScope: {
104
+ readonly USER: "USER";
105
+ readonly PRODUCT: "PRODUCT";
106
+ readonly UNIT: "UNIT";
107
+ readonly ORGANISATION: "ORGANISATION";
108
+ };
109
+ declare type AssetPostBodyBody = {
110
+ /** 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 */
111
+ name: string;
112
+ /** A file containing the content for the asset. You must provide a value here or in content_string */
113
+ content_file?: Blob;
114
+ /** The textual content of the asset. You must provide a value here or in content_file */
115
+ content_string?: string;
116
+ scope: AssetPostBodyBodyScope;
117
+ /** The unique identity based on the Scope of the asset. For example, this wil be the Unit ID if it's a UNIT. A scope_id is required if the scope is USER as it wil be automatically set to your username */
118
+ scope_id?: string;
119
+ /** Is this a secret asset? */
120
+ secret: boolean;
121
+ /** An optional description for the Asset */
122
+ description?: string;
123
+ };
70
124
  interface UserDetail {
71
125
  /** The user identity (username) */
72
126
  id: string;
@@ -91,22 +145,25 @@ interface UnitDetail {
91
145
  /**
92
146
  * The kind of Service
93
147
  */
94
- declare type ServiceGetResponseKind = "DATA_MANAGER";
95
- declare const ServiceGetResponseKind: {
96
- DATA_MANAGER: "DATA_MANAGER";
148
+ declare type MerchantDetailKind = typeof MerchantDetailKind[keyof typeof MerchantDetailKind];
149
+ declare const MerchantDetailKind: {
150
+ readonly DATA_MANAGER: "DATA_MANAGER";
97
151
  };
98
- interface ServiceGetResponse {
152
+ interface MerchantDetail {
99
153
  /** The unique ID of the Service */
100
154
  id: number;
101
155
  /** The kind of Service */
102
- kind: ServiceGetResponseKind;
156
+ kind: MerchantDetailKind;
103
157
  /** The name assigned to the Service */
104
- name?: string;
158
+ name: string;
159
+ /** The hostname used by the Service */
160
+ api_hostname: string;
105
161
  }
106
- interface ServicesGetResponse {
107
- /** The list of known Services
162
+ declare type MerchantGetResponse = MerchantDetail;
163
+ interface MerchantsGetResponse {
164
+ /** The list of known Merchants
108
165
  */
109
- services: ServiceGetResponse[];
166
+ merchants: MerchantDetail[];
110
167
  }
111
168
  interface OrganisationDetail {
112
169
  /** Whether the user making the API call is a member of the Unit */
@@ -120,13 +177,20 @@ interface OrganisationDetail {
120
177
  /** True if the Unit is private */
121
178
  private: boolean;
122
179
  }
180
+ /**
181
+ * The kind of service that can use the Product
182
+ */
183
+ declare type ProductTypeServiceKind = typeof ProductTypeServiceKind[keyof typeof ProductTypeServiceKind];
184
+ declare const ProductTypeServiceKind: {
185
+ readonly DATA_MANAGER: "DATA_MANAGER";
186
+ };
123
187
  interface ProductType {
124
188
  /** A product type, this is a unique string amongst all types known to the Account Server */
125
189
  type: string;
126
190
  /** A product flavour. Not all types have a flavour, those that do have a type-specific flavour string */
127
191
  flavour?: string;
128
- /** For a product that belongs to a specific service, the service that owns it is provided */
129
- service?: ServiceGetResponse;
192
+ /** The kind of service that can use the Product */
193
+ service_kind?: ProductTypeServiceKind;
130
194
  }
131
195
  declare type ProductInstanceDetailCoins = {
132
196
  /** The number of coins used
@@ -140,21 +204,21 @@ interface ProductInstanceDetail {
140
204
  * The Product Type falvour. Not all products have flavours
141
205
 
142
206
  */
143
- declare type ProductDetailFlavour = "EVALUATION" | "BRONZE" | "SILVER" | "GOLD";
207
+ declare type ProductDetailFlavour = typeof ProductDetailFlavour[keyof typeof ProductDetailFlavour];
144
208
  declare const ProductDetailFlavour: {
145
- EVALUATION: ProductDetailFlavour;
146
- BRONZE: ProductDetailFlavour;
147
- SILVER: ProductDetailFlavour;
148
- GOLD: ProductDetailFlavour;
209
+ readonly EVALUATION: "EVALUATION";
210
+ readonly BRONZE: "BRONZE";
211
+ readonly SILVER: "SILVER";
212
+ readonly GOLD: "GOLD";
149
213
  };
150
214
  /**
151
215
  * The Product Type
152
216
 
153
217
  */
154
- declare type ProductDetailType = "DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION" | "DATA_MANAGER_STORAGE_SUBSCRIPTION";
218
+ declare type ProductDetailType = typeof ProductDetailType[keyof typeof ProductDetailType];
155
219
  declare const ProductDetailType: {
156
- DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION: ProductDetailType;
157
- DATA_MANAGER_STORAGE_SUBSCRIPTION: ProductDetailType;
220
+ readonly DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION: "DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION";
221
+ readonly DATA_MANAGER_STORAGE_SUBSCRIPTION: "DATA_MANAGER_STORAGE_SUBSCRIPTION";
158
222
  };
159
223
  interface ProductDetail {
160
224
  /** The Product ID
@@ -239,15 +303,33 @@ interface ProductDmStorage {
239
303
  storage: ProductDmStorageDetail;
240
304
  coins: ProductCoinsDetail;
241
305
  }
242
- declare type UserAccountGetResponse = UserAccountDetail;
243
- interface UnitGetResponse {
244
- /** The Unit's unique ID */
306
+ declare type AssetDetailScope = typeof AssetDetailScope[keyof typeof AssetDetailScope];
307
+ declare const AssetDetailScope: {
308
+ readonly USER: "USER";
309
+ readonly PRODUCT: "PRODUCT";
310
+ readonly UNIT: "UNIT";
311
+ readonly ORGANISATION: "ORGANISATION";
312
+ };
313
+ interface AssetDetail {
314
+ creator: string;
245
315
  id: string;
246
- /** The Unit's name */
247
316
  name: string;
248
- /** The Unit's oener (username) */
249
- owner_id: string;
317
+ scope: AssetDetailScope;
318
+ scope_id: string;
319
+ secret: boolean;
320
+ disabled: boolean;
321
+ content: string;
322
+ created: string;
323
+ description?: string;
324
+ merchants: MerchantDetail[];
325
+ }
326
+ declare type UserAccountGetResponse = UserAccountDetail;
327
+ interface UnitsGetResponse {
328
+ /** A list of Units
329
+ */
330
+ units: OrganisationUnitsGetResponse[];
250
331
  }
332
+ declare type UnitGetResponse = UnitDetail;
251
333
  interface UnitProductPostResponse {
252
334
  /** The Products's unique ID */
253
335
  id: string;
@@ -279,11 +361,6 @@ interface OrganisationUnitsGetResponse {
279
361
  */
280
362
  units: UnitDetail[];
281
363
  }
282
- interface UnitsGetResponse {
283
- /** A list of Units
284
- */
285
- units: OrganisationUnitsGetResponse[];
286
- }
287
364
  interface PersonalUnitPutResponse {
288
365
  /** The unit's Organisation. Used to identify the Default organisation */
289
366
  organisation_id: string;
@@ -323,6 +400,16 @@ interface StateGetVersionResponse {
323
400
  */
324
401
  version: string;
325
402
  }
403
+ interface AssetPostResponse {
404
+ /** The Asset ID
405
+ */
406
+ id: string;
407
+ }
408
+ interface AssetGetResponse {
409
+ /** A list of Assets
410
+ */
411
+ assets: AssetDetail[];
412
+ }
326
413
  interface AsError {
327
414
  /** Brief error text that can be presented to the user */
328
415
  error: string;
@@ -343,4 +430,4 @@ declare const setBaseUrl: (baseUrl: string) => void;
343
430
  declare const customInstance: <TReturn>(config: AxiosRequestConfig, options?: AxiosRequestConfig<any> | undefined) => Promise<TReturn>;
344
431
  declare type ErrorType<TError> = AxiosError<TError>;
345
432
 
346
- export { ProductUnitGetResponse as A, ProductsGetTypesResponse as B, ProductsGetResponseProductsItem as C, ProductsGetResponse as D, OrganisationsGetResponse as E, OrganisationUnitsGetResponse as F, UnitsGetResponse as G, PersonalUnitPutResponse as H, OrganisationUnitPostResponse as I, OrganisationGetDefaultResponse as J, UsersGetResponse as K, OrganisationPostResponse as L, StateGetVersionResponse as M, AsError as N, OrganisationUnitPostBodyBody as O, ProductPatchBodyBody as P, AXIOS_INSTANCE as Q, setAuthToken as R, ServiceGetResponseKind as S, setBaseUrl as T, UnitProductPostBodyBodyFlavour as U, customInstance as V, ErrorType as W, UnitProductPostBodyBodyType as a, UnitProductPostBodyBody as b, OrganisationPostBodyBody as c, UserDetail as d, UserAccountDetail as e, UnitDetail as f, ServiceGetResponse as g, ServicesGetResponse as h, OrganisationDetail as i, ProductType as j, ProductInstanceDetailCoins as k, ProductInstanceDetail as l, ProductDetailFlavour as m, ProductDetailType as n, ProductDetail as o, ProductCoinsDetail as p, ProductClaimDetail as q, ProductDmStorageDetailCoins as r, ProductDmStorageDetailSize as s, ProductDmStorageDetail as t, ProductDmProjectTier as u, ProductDmStorage as v, UserAccountGetResponse as w, UnitGetResponse as x, UnitProductPostResponse as y, ProductUnitGetResponseProduct as z };
433
+ export { OrganisationGetDefaultResponse as $, AttachAssetParams as A, ProductDmStorageDetailSize as B, ProductDmStorageDetail as C, DetachAssetParams as D, ProductDmProjectTier as E, ProductDmStorage as F, GetAssetParams as G, AssetDetailScope as H, AssetDetail as I, UserAccountGetResponse as J, UnitsGetResponse as K, UnitGetResponse as L, MerchantDetailKind as M, UnitProductPostResponse as N, OrganisationUnitPostBodyBody as O, ProductPatchBodyBody as P, QUserIdParameter as Q, ProductUnitGetResponseProduct as R, ProductUnitGetResponse as S, ProductsGetTypesResponse as T, UnitProductPostBodyBodyFlavour as U, ProductsGetResponseProductsItem as V, ProductsGetResponse as W, OrganisationsGetResponse as X, OrganisationUnitsGetResponse as Y, PersonalUnitPutResponse as Z, OrganisationUnitPostResponse as _, QProductIdParameter as a, UsersGetResponse as a0, OrganisationPostResponse as a1, StateGetVersionResponse as a2, AssetPostResponse as a3, AssetGetResponse as a4, AsError as a5, AXIOS_INSTANCE as a6, setAuthToken as a7, setBaseUrl as a8, customInstance as a9, ErrorType as aa, QUnitIdParameter as b, QMIdParameter as c, QOrgIdParameter as d, UnitProductPostBodyBodyType as e, UnitProductPostBodyBody as f, OrganisationPostBodyBody as g, AssetPostBodyBodyScope as h, AssetPostBodyBody as i, UserDetail as j, UserAccountDetail as k, UnitDetail as l, MerchantDetail as m, MerchantGetResponse as n, MerchantsGetResponse as o, OrganisationDetail as p, ProductTypeServiceKind as q, ProductType as r, ProductInstanceDetailCoins as s, ProductInstanceDetail as t, ProductDetailFlavour as u, ProductDetailType as v, ProductDetail as w, ProductCoinsDetail as x, ProductClaimDetail as y, ProductDmStorageDetailCoins as z };
package/index.cjs CHANGED
@@ -16,7 +16,16 @@ var UnitProductPostBodyBodyType = {
16
16
  DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION: "DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION",
17
17
  DATA_MANAGER_STORAGE_SUBSCRIPTION: "DATA_MANAGER_STORAGE_SUBSCRIPTION"
18
18
  };
19
- var ServiceGetResponseKind = {
19
+ var AssetPostBodyBodyScope = {
20
+ USER: "USER",
21
+ PRODUCT: "PRODUCT",
22
+ UNIT: "UNIT",
23
+ ORGANISATION: "ORGANISATION"
24
+ };
25
+ var MerchantDetailKind = {
26
+ DATA_MANAGER: "DATA_MANAGER"
27
+ };
28
+ var ProductTypeServiceKind = {
20
29
  DATA_MANAGER: "DATA_MANAGER"
21
30
  };
22
31
  var ProductDetailFlavour = {
@@ -29,6 +38,15 @@ var ProductDetailType = {
29
38
  DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION: "DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION",
30
39
  DATA_MANAGER_STORAGE_SUBSCRIPTION: "DATA_MANAGER_STORAGE_SUBSCRIPTION"
31
40
  };
41
+ var AssetDetailScope = {
42
+ USER: "USER",
43
+ PRODUCT: "PRODUCT",
44
+ UNIT: "UNIT",
45
+ ORGANISATION: "ORGANISATION"
46
+ };
47
+
48
+
49
+
32
50
 
33
51
 
34
52
 
@@ -39,5 +57,5 @@ var ProductDetailType = {
39
57
 
40
58
 
41
59
 
42
- exports.AXIOS_INSTANCE = _chunkNGBTCJWScjs.AXIOS_INSTANCE; exports.ProductDetailFlavour = ProductDetailFlavour; exports.ProductDetailType = ProductDetailType; exports.ServiceGetResponseKind = ServiceGetResponseKind; exports.UnitProductPostBodyBodyFlavour = UnitProductPostBodyBodyFlavour; exports.UnitProductPostBodyBodyType = UnitProductPostBodyBodyType; exports.customInstance = _chunkNGBTCJWScjs.customInstance; exports.setAuthToken = _chunkNGBTCJWScjs.setAuthToken; exports.setBaseUrl = _chunkNGBTCJWScjs.setBaseUrl;
60
+ exports.AXIOS_INSTANCE = _chunkNGBTCJWScjs.AXIOS_INSTANCE; exports.AssetDetailScope = AssetDetailScope; exports.AssetPostBodyBodyScope = AssetPostBodyBodyScope; exports.MerchantDetailKind = MerchantDetailKind; exports.ProductDetailFlavour = ProductDetailFlavour; exports.ProductDetailType = ProductDetailType; exports.ProductTypeServiceKind = ProductTypeServiceKind; exports.UnitProductPostBodyBodyFlavour = UnitProductPostBodyBodyFlavour; exports.UnitProductPostBodyBodyType = UnitProductPostBodyBodyType; exports.customInstance = _chunkNGBTCJWScjs.customInstance; exports.setAuthToken = _chunkNGBTCJWScjs.setAuthToken; exports.setBaseUrl = _chunkNGBTCJWScjs.setBaseUrl;
43
61
  //# sourceMappingURL=index.cjs.map
package/index.cjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/account-server-api.schemas.ts"],"names":[],"mappings":";;;;;;;;AA6BO,IAAM,iCAAiC;AAAA,EAC5C,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,MAAM;AACR;AAYO,IAAM,8BAA8B;AAAA,EACzC,wCACE;AAAA,EACF,mCACE;AACJ;AA+DO,IAAM,yBAAyB;AAAA,EACpC,cAAc;AAChB;AAwDO,IAAM,uBAAuB;AAAA,EAClC,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,MAAM;AACR;AAWO,IAAM,oBAAoB;AAAA,EAC/B,wCACE;AAAA,EACF,mCACE;AACJ","sourcesContent":["/**\n * Generated by orval v6.7.1 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Products**, **Organisations**, **Units** and **Users**.\n\n * OpenAPI spec version: 0.1\n */\nexport type ProductPatchBodyBody = {\n /** The name you want to give the Product */\n name?: string;\n /** The Product's built-in coin allowance. Product allowances cannot be reduced */\n allowance?: number;\n /** 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 */\n limit?: number;\n};\n\n/**\n * The Flavour of the Product. Used only for Project Tier Products. Do not set this for Storage products\n */\nexport type UnitProductPostBodyBodyFlavour =\n | \"EVALUATION\"\n | \"BRONZE\"\n | \"SILVER\"\n | \"GOLD\";\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const UnitProductPostBodyBodyFlavour = {\n EVALUATION: \"EVALUATION\" as UnitProductPostBodyBodyFlavour,\n BRONZE: \"BRONZE\" as UnitProductPostBodyBodyFlavour,\n SILVER: \"SILVER\" as UnitProductPostBodyBodyFlavour,\n GOLD: \"GOLD\" as UnitProductPostBodyBodyFlavour,\n};\n\n/**\n * The Type of Product. Storage subscriptions require an **Allowance** to be defined and the **Flavour** must not be provided.\n\nProject Tier subscriptions have built-in allowances and Limits so you must not provide values for these for these products\n */\nexport type UnitProductPostBodyBodyType =\n | \"DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION\"\n | \"DATA_MANAGER_STORAGE_SUBSCRIPTION\";\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const UnitProductPostBodyBodyType = {\n DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION:\n \"DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION\" as UnitProductPostBodyBodyType,\n DATA_MANAGER_STORAGE_SUBSCRIPTION:\n \"DATA_MANAGER_STORAGE_SUBSCRIPTION\" as UnitProductPostBodyBodyType,\n};\n\nexport type UnitProductPostBodyBody = {\n /** The name you want to give the Product */\n name: string;\n /** The service identity for the Product. Products are created for use on a specific service, like a Data Manager instance */\n service_id: number;\n /** The Type of Product. Storage subscriptions require an **Allowance** to be defined and the **Flavour** must not be provided.\n\nProject Tier subscriptions have built-in allowances and Limits so you must not provide values for these for these products */\n type: UnitProductPostBodyBodyType;\n /** The Flavour of the Product. Used only for Project Tier Products. Do not set this for Storage products */\n flavour?: UnitProductPostBodyBodyFlavour;\n /** The Product's coin allowance. You must provide this for Storage products but you must not provide a value for Project Tier Products */\n allowance?: number;\n /** 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 */\n limit?: number;\n /** The day you would like to be billed for the Product's subscription (a value from 1 and 28) */\n billing_day: number;\n};\n\nexport type OrganisationUnitPostBodyBody = {\n /** The name of the unit */\n name: string;\n};\n\nexport type OrganisationPostBodyBody = {\n /** The name of the organisation */\n name: string;\n /** The name of the organisation owner. A user ID */\n owner: string;\n};\n\nexport interface UserDetail {\n /** The user identity (username) */\n id: string;\n}\n\nexport interface UserAccountDetail {\n user: UserDetail;\n /** Whether the caller has admin privilege */\n caller_has_admin_privilege: boolean;\n}\n\nexport interface UnitDetail {\n /** Whether the user making the API call is a member of the Unit */\n caller_is_member: boolean;\n /** The Unit's unique identity */\n id: string;\n /** The Unit's name */\n name: string;\n /** The Unit's owner (a username) */\n owner_id: string;\n /** True if the Unit is private */\n private: boolean;\n}\n\n/**\n * The kind of Service\n */\nexport type ServiceGetResponseKind = \"DATA_MANAGER\";\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const ServiceGetResponseKind = {\n DATA_MANAGER: \"DATA_MANAGER\" as ServiceGetResponseKind,\n};\n\nexport interface ServiceGetResponse {\n /** The unique ID of the Service */\n id: number;\n /** The kind of Service */\n kind: ServiceGetResponseKind;\n /** The name assigned to the Service */\n name?: string;\n}\n\nexport interface ServicesGetResponse {\n /** The list of known Services\n */\n services: ServiceGetResponse[];\n}\n\nexport interface OrganisationDetail {\n /** Whether the user making the API call is a member of the Unit */\n caller_is_member: boolean;\n /** The Organisation's unique ID */\n id: string;\n /** The Organisation's name */\n name: string;\n /** The username of the Organisation's owner. Not all Organisations have an owner. The Default Organisation has no owner. */\n owner_id?: string;\n /** True if the Unit is private */\n private: boolean;\n}\n\nexport interface ProductType {\n /** A product type, this is a unique string amongst all types known to the Account Server */\n type: string;\n /** A product flavour. Not all types have a flavour, those that do have a type-specific flavour string */\n flavour?: string;\n /** For a product that belongs to a specific service, the service that owns it is provided */\n service?: ServiceGetResponse;\n}\n\nexport type ProductInstanceDetailCoins = {\n /** The number of coins used\n */\n used: number;\n};\n\nexport interface ProductInstanceDetail {\n coins: ProductInstanceDetailCoins;\n}\n\n/**\n * The Product Type falvour. Not all products have flavours\n\n */\nexport type ProductDetailFlavour = \"EVALUATION\" | \"BRONZE\" | \"SILVER\" | \"GOLD\";\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const ProductDetailFlavour = {\n EVALUATION: \"EVALUATION\" as ProductDetailFlavour,\n BRONZE: \"BRONZE\" as ProductDetailFlavour,\n SILVER: \"SILVER\" as ProductDetailFlavour,\n GOLD: \"GOLD\" as ProductDetailFlavour,\n};\n\n/**\n * The Product Type\n\n */\nexport type ProductDetailType =\n | \"DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION\"\n | \"DATA_MANAGER_STORAGE_SUBSCRIPTION\";\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const ProductDetailType = {\n DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION:\n \"DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION\" as ProductDetailType,\n DATA_MANAGER_STORAGE_SUBSCRIPTION:\n \"DATA_MANAGER_STORAGE_SUBSCRIPTION\" as ProductDetailType,\n};\n\nexport interface ProductDetail {\n /** The Product ID\n */\n id: string;\n /** The Product Service ID\n */\n service_id?: number;\n /** The Product Type\n */\n type: ProductDetailType;\n /** The Product Type falvour. Not all products have flavours\n */\n flavour?: ProductDetailFlavour;\n /** The name of the Product\n */\n name?: string;\n}\n\nexport interface ProductCoinsDetail {\n /** The billing allowance. When you exceed this during the current billing period the *cost multiplier* will increase */\n allowance: number;\n /** 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 */\n limit: number;\n /** The total number of coins consumed (in this billing period), excluding the coins that have been consumed for the current day */\n used: number;\n /** 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. */\n at_limit: boolean;\n /** The current burn rate, the approximate amount of coins you are currently consuming each day */\n current_burn_rate: number;\n /** The predicted billing period amount, if costs continue at the current burn rate until the end of the billing period */\n billing_prediction: number;\n /** The day of the month when the bill is due, and the end of the current billing period */\n billing_day: number;\n /** A multiplier applied to your coin usage within your allowance */\n allowance_multiplier: number;\n /** A multiplier that will be applied to coin used beyond your allowance */\n overspend_multiplier: number;\n /** The number of days remaining, in the current billing period */\n remaining_days: number;\n}\n\nexport interface ProductClaimDetail {\n /** The service-specific ID that is using this Subscription\n */\n id: string;\n /** A name for the service-specific ID\n */\n name?: string;\n}\n\nexport type ProductDmStorageDetailCoins = {\n /** The number of coins currently committed for the current day. This is added to the accumulated coins at the start of each day */\n used: number;\n /** The coin cost of a 'unit' of storage or part thereof. The unit size is defined in the storage section of the response */\n unit_cost: number;\n};\n\nexport type ProductDmStorageDetailSize = {\n /** The humanised size of the peak storage used for the current day. The value is reset at the start of each day */\n peak: string;\n /** The humanised size of the current storage used for the current day and used to calculate the 'burn rate' */\n current: string;\n /** The humanised storage unit. The cost of storage is based on the daily peak of the number of units (or part thereof) used */\n unit_size: string;\n /** The peak number of storage units used today */\n units_used: number;\n};\n\nexport interface ProductDmStorageDetail {\n size: ProductDmStorageDetailSize;\n coins: ProductDmStorageDetailCoins;\n}\n\nexport interface ProductDmProjectTier {\n product: ProductDetail;\n organisation: OrganisationDetail;\n unit: UnitDetail;\n storage: ProductDmStorageDetail;\n coins: ProductCoinsDetail;\n instance: ProductInstanceDetail;\n claim?: ProductClaimDetail;\n}\n\nexport interface ProductDmStorage {\n product: ProductDetail;\n organisation: OrganisationDetail;\n unit: UnitDetail;\n storage: ProductDmStorageDetail;\n coins: ProductCoinsDetail;\n}\n\nexport type UserAccountGetResponse = UserAccountDetail;\n\nexport interface UnitGetResponse {\n /** The Unit's unique ID */\n id: string;\n /** The Unit's name */\n name: string;\n /** The Unit's oener (username) */\n owner_id: string;\n}\n\nexport interface UnitProductPostResponse {\n /** The Products's unique ID */\n id: string;\n}\n\n/**\n * The Unit's Product\n */\nexport type ProductUnitGetResponseProduct =\n | ProductDmStorage\n | ProductDmProjectTier;\n\nexport interface ProductUnitGetResponse {\n /** The Unit's Product */\n product: ProductUnitGetResponseProduct;\n}\n\nexport interface ProductsGetTypesResponse {\n /** All the Product Types you have access to */\n product_types: ProductType[];\n}\n\nexport type ProductsGetResponseProductsItem =\n | ProductDmStorage\n | ProductDmProjectTier;\n\nexport interface ProductsGetResponse {\n /** All the Products you have access to */\n products: ProductsGetResponseProductsItem[];\n}\n\nexport interface OrganisationsGetResponse {\n /** A list of Organisations */\n organisations: OrganisationDetail[];\n}\n\nexport interface OrganisationUnitsGetResponse {\n organisation: OrganisationDetail;\n /** A list of Units\n */\n units: UnitDetail[];\n}\n\nexport interface UnitsGetResponse {\n /** A list of Units\n */\n units: OrganisationUnitsGetResponse[];\n}\n\nexport interface PersonalUnitPutResponse {\n /** The unit's Organisation. Used to identify the Default organisation */\n organisation_id: string;\n /** The unit's unique ID */\n id: string;\n}\n\nexport interface OrganisationUnitPostResponse {\n /** The unit's unique ID */\n id: string;\n}\n\nexport interface OrganisationGetDefaultResponse {\n /** Whether the user making the API call is a member of the Default Organisation. Only admin users are members of the Default organisation */\n caller_is_member: boolean;\n /** The Default Organisation ID\n */\n id: string;\n /** The Default Organisation Name\n */\n name: string;\n /** 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\n */\n private: boolean;\n}\n\nexport interface UsersGetResponse {\n organisation?: OrganisationDetail;\n unit?: UnitDetail;\n /** The list of Organisation Users\n */\n users: UserDetail[];\n}\n\nexport interface OrganisationPostResponse {\n /** The Organisation's unique ID */\n id: string;\n}\n\nexport interface StateGetVersionResponse {\n /** 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\n */\n version: string;\n}\n\nexport interface AsError {\n /** Brief error text that can be presented to the user */\n error: string;\n}\n"]}
1
+ {"version":3,"sources":["../src/account-server-api.schemas.ts"],"names":[],"mappings":";;;;;;;;AA8DO,IAAM,iCAAiC;AAAA,EAC5C,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,MAAM;AACR;AAWO,IAAM,8BAA8B;AAAA,EACzC,wCACE;AAAA,EACF,mCAAmC;AACrC;AAqCO,IAAM,yBAAyB;AAAA,EACpC,MAAM;AAAA,EACN,SAAS;AAAA,EACT,MAAM;AAAA,EACN,cAAc;AAChB;AAiDO,IAAM,qBAAqB;AAAA,EAChC,cAAc;AAChB;AAyCO,IAAM,yBAAyB;AAAA,EACpC,cAAc;AAChB;AA6BO,IAAM,uBAAuB;AAAA,EAClC,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,MAAM;AACR;AAUO,IAAM,oBAAoB;AAAA,EAC/B,wCACE;AAAA,EACF,mCAAmC;AACrC;AAiGO,IAAM,mBAAmB;AAAA,EAC9B,MAAM;AAAA,EACN,SAAS;AAAA,EACT,MAAM;AAAA,EACN,cAAc;AAChB","sourcesContent":["/**\n * Generated by orval v6.8.0 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Products**, **Organisations**, **Units** and **Users**.\n\n * OpenAPI spec version: 0.1\n */\nexport type DetachAssetParams = { m_id?: QMIdParameter };\n\nexport type AttachAssetParams = { m_id?: QMIdParameter };\n\n/**\n * A User Identity\n */\nexport type QUserIdParameter = string;\n\n/**\n * A Product Identity\n */\nexport type QProductIdParameter = string;\n\n/**\n * A Unit Identity\n */\nexport type QUnitIdParameter = string;\n\nexport type GetAssetParams = {\n user_id?: QUserIdParameter;\n product_id?: QProductIdParameter;\n unit_id?: QUnitIdParameter;\n org_id?: QOrgIdParameter;\n};\n\n/**\n * A Merchant Identity\n */\nexport type QMIdParameter = number;\n\n/**\n * An Organisation Identity\n */\nexport type QOrgIdParameter = string;\n\nexport type ProductPatchBodyBody = {\n /** The name you want to give the Product */\n name?: string;\n /** The Product's built-in coin allowance. Product allowances cannot be reduced */\n allowance?: number;\n /** 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 */\n limit?: number;\n};\n\n/**\n * The Flavour of the Product. Used only for Project Tier Products. Do not set this for Storage products\n */\nexport type UnitProductPostBodyBodyFlavour =\n typeof UnitProductPostBodyBodyFlavour[keyof typeof UnitProductPostBodyBodyFlavour];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const UnitProductPostBodyBodyFlavour = {\n EVALUATION: \"EVALUATION\",\n BRONZE: \"BRONZE\",\n SILVER: \"SILVER\",\n GOLD: \"GOLD\",\n} as const;\n\n/**\n * The Type of Product. Storage subscriptions require an **Allowance** to be defined and the **Flavour** must not be provided.\n\nProject Tier subscriptions have built-in allowances and Limits so you must not provide values for these for these products\n */\nexport type UnitProductPostBodyBodyType =\n typeof UnitProductPostBodyBodyType[keyof typeof UnitProductPostBodyBodyType];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const UnitProductPostBodyBodyType = {\n DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION:\n \"DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION\",\n DATA_MANAGER_STORAGE_SUBSCRIPTION: \"DATA_MANAGER_STORAGE_SUBSCRIPTION\",\n} as const;\n\nexport type UnitProductPostBodyBody = {\n /** The name you want to give the Product */\n name: string;\n /** The service identity for the Product. Products are created for use on a specific service, like a Data Manager instance */\n service_id: number;\n /** The Type of Product. Storage subscriptions require an **Allowance** to be defined and the **Flavour** must not be provided.\n\nProject Tier subscriptions have built-in allowances and Limits so you must not provide values for these for these products */\n type: UnitProductPostBodyBodyType;\n /** The Flavour of the Product. Used only for Project Tier Products. Do not set this for Storage products */\n flavour?: UnitProductPostBodyBodyFlavour;\n /** The Product's coin allowance. You must provide this for Storage products but you must not provide a value for Project Tier Products */\n allowance?: number;\n /** 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 */\n limit?: number;\n /** The day you would like to be billed for the Product's subscription (a value from 1 and 28) */\n billing_day: number;\n};\n\nexport type OrganisationUnitPostBodyBody = {\n /** The name of the unit */\n name: string;\n};\n\nexport type OrganisationPostBodyBody = {\n /** The name of the organisation */\n name: string;\n /** The name of the organisation owner. A user ID */\n owner: string;\n};\n\nexport type AssetPostBodyBodyScope =\n typeof AssetPostBodyBodyScope[keyof typeof AssetPostBodyBodyScope];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const AssetPostBodyBodyScope = {\n USER: \"USER\",\n PRODUCT: \"PRODUCT\",\n UNIT: \"UNIT\",\n ORGANISATION: \"ORGANISATION\",\n} as const;\n\nexport type AssetPostBodyBody = {\n /** 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 */\n name: string;\n /** A file containing the content for the asset. You must provide a value here or in content_string */\n content_file?: Blob;\n /** The textual content of the asset. You must provide a value here or in content_file */\n content_string?: string;\n scope: AssetPostBodyBodyScope;\n /** The unique identity based on the Scope of the asset. For example, this wil be the Unit ID if it's a UNIT. A scope_id is required if the scope is USER as it wil be automatically set to your username */\n scope_id?: string;\n /** Is this a secret asset? */\n secret: boolean;\n /** An optional description for the Asset */\n description?: string;\n};\n\nexport interface UserDetail {\n /** The user identity (username) */\n id: string;\n}\n\nexport interface UserAccountDetail {\n user: UserDetail;\n /** Whether the caller has admin privilege */\n caller_has_admin_privilege: boolean;\n}\n\nexport interface UnitDetail {\n /** Whether the user making the API call is a member of the Unit */\n caller_is_member: boolean;\n /** The Unit's unique identity */\n id: string;\n /** The Unit's name */\n name: string;\n /** The Unit's owner (a username) */\n owner_id: string;\n /** True if the Unit is private */\n private: boolean;\n}\n\n/**\n * The kind of Service\n */\nexport type MerchantDetailKind =\n typeof MerchantDetailKind[keyof typeof MerchantDetailKind];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const MerchantDetailKind = {\n DATA_MANAGER: \"DATA_MANAGER\",\n} as const;\n\nexport interface MerchantDetail {\n /** The unique ID of the Service */\n id: number;\n /** The kind of Service */\n kind: MerchantDetailKind;\n /** The name assigned to the Service */\n name: string;\n /** The hostname used by the Service */\n api_hostname: string;\n}\n\nexport type MerchantGetResponse = MerchantDetail;\n\nexport interface MerchantsGetResponse {\n /** The list of known Merchants\n */\n merchants: MerchantDetail[];\n}\n\nexport interface OrganisationDetail {\n /** Whether the user making the API call is a member of the Unit */\n caller_is_member: boolean;\n /** The Organisation's unique ID */\n id: string;\n /** The Organisation's name */\n name: string;\n /** The username of the Organisation's owner. Not all Organisations have an owner. The Default Organisation has no owner. */\n owner_id?: string;\n /** True if the Unit is private */\n private: boolean;\n}\n\n/**\n * The kind of service that can use the Product\n */\nexport type ProductTypeServiceKind =\n typeof ProductTypeServiceKind[keyof typeof ProductTypeServiceKind];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const ProductTypeServiceKind = {\n DATA_MANAGER: \"DATA_MANAGER\",\n} as const;\n\nexport interface ProductType {\n /** A product type, this is a unique string amongst all types known to the Account Server */\n type: string;\n /** A product flavour. Not all types have a flavour, those that do have a type-specific flavour string */\n flavour?: string;\n /** The kind of service that can use the Product */\n service_kind?: ProductTypeServiceKind;\n}\n\nexport type ProductInstanceDetailCoins = {\n /** The number of coins used\n */\n used: number;\n};\n\nexport interface ProductInstanceDetail {\n coins: ProductInstanceDetailCoins;\n}\n\n/**\n * The Product Type falvour. Not all products have flavours\n\n */\nexport type ProductDetailFlavour =\n typeof ProductDetailFlavour[keyof typeof ProductDetailFlavour];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const ProductDetailFlavour = {\n EVALUATION: \"EVALUATION\",\n BRONZE: \"BRONZE\",\n SILVER: \"SILVER\",\n GOLD: \"GOLD\",\n} as const;\n\n/**\n * The Product Type\n\n */\nexport type ProductDetailType =\n typeof ProductDetailType[keyof typeof ProductDetailType];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const ProductDetailType = {\n DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION:\n \"DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION\",\n DATA_MANAGER_STORAGE_SUBSCRIPTION: \"DATA_MANAGER_STORAGE_SUBSCRIPTION\",\n} as const;\n\nexport interface ProductDetail {\n /** The Product ID\n */\n id: string;\n /** The Product Service ID\n */\n service_id?: number;\n /** The Product Type\n */\n type: ProductDetailType;\n /** The Product Type falvour. Not all products have flavours\n */\n flavour?: ProductDetailFlavour;\n /** The name of the Product\n */\n name?: string;\n}\n\nexport interface ProductCoinsDetail {\n /** The billing allowance. When you exceed this during the current billing period the *cost multiplier* will increase */\n allowance: number;\n /** 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 */\n limit: number;\n /** The total number of coins consumed (in this billing period), excluding the coins that have been consumed for the current day */\n used: number;\n /** 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. */\n at_limit: boolean;\n /** The current burn rate, the approximate amount of coins you are currently consuming each day */\n current_burn_rate: number;\n /** The predicted billing period amount, if costs continue at the current burn rate until the end of the billing period */\n billing_prediction: number;\n /** The day of the month when the bill is due, and the end of the current billing period */\n billing_day: number;\n /** A multiplier applied to your coin usage within your allowance */\n allowance_multiplier: number;\n /** A multiplier that will be applied to coin used beyond your allowance */\n overspend_multiplier: number;\n /** The number of days remaining, in the current billing period */\n remaining_days: number;\n}\n\nexport interface ProductClaimDetail {\n /** The service-specific ID that is using this Subscription\n */\n id: string;\n /** A name for the service-specific ID\n */\n name?: string;\n}\n\nexport type ProductDmStorageDetailCoins = {\n /** The number of coins currently committed for the current day. This is added to the accumulated coins at the start of each day */\n used: number;\n /** The coin cost of a 'unit' of storage or part thereof. The unit size is defined in the storage section of the response */\n unit_cost: number;\n};\n\nexport type ProductDmStorageDetailSize = {\n /** The humanised size of the peak storage used for the current day. The value is reset at the start of each day */\n peak: string;\n /** The humanised size of the current storage used for the current day and used to calculate the 'burn rate' */\n current: string;\n /** The humanised storage unit. The cost of storage is based on the daily peak of the number of units (or part thereof) used */\n unit_size: string;\n /** The peak number of storage units used today */\n units_used: number;\n};\n\nexport interface ProductDmStorageDetail {\n size: ProductDmStorageDetailSize;\n coins: ProductDmStorageDetailCoins;\n}\n\nexport interface ProductDmProjectTier {\n product: ProductDetail;\n organisation: OrganisationDetail;\n unit: UnitDetail;\n storage: ProductDmStorageDetail;\n coins: ProductCoinsDetail;\n instance: ProductInstanceDetail;\n claim?: ProductClaimDetail;\n}\n\nexport interface ProductDmStorage {\n product: ProductDetail;\n organisation: OrganisationDetail;\n unit: UnitDetail;\n storage: ProductDmStorageDetail;\n coins: ProductCoinsDetail;\n}\n\nexport type AssetDetailScope =\n typeof AssetDetailScope[keyof typeof AssetDetailScope];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const AssetDetailScope = {\n USER: \"USER\",\n PRODUCT: \"PRODUCT\",\n UNIT: \"UNIT\",\n ORGANISATION: \"ORGANISATION\",\n} as const;\n\nexport interface AssetDetail {\n creator: string;\n id: string;\n name: string;\n scope: AssetDetailScope;\n scope_id: string;\n secret: boolean;\n disabled: boolean;\n content: string;\n created: string;\n description?: string;\n merchants: MerchantDetail[];\n}\n\nexport type UserAccountGetResponse = UserAccountDetail;\n\nexport interface UnitsGetResponse {\n /** A list of Units\n */\n units: OrganisationUnitsGetResponse[];\n}\n\nexport type UnitGetResponse = UnitDetail;\n\nexport interface UnitProductPostResponse {\n /** The Products's unique ID */\n id: string;\n}\n\n/**\n * The Unit's Product\n */\nexport type ProductUnitGetResponseProduct =\n | ProductDmStorage\n | ProductDmProjectTier;\n\nexport interface ProductUnitGetResponse {\n /** The Unit's Product */\n product: ProductUnitGetResponseProduct;\n}\n\nexport interface ProductsGetTypesResponse {\n /** All the Product Types you have access to */\n product_types: ProductType[];\n}\n\nexport type ProductsGetResponseProductsItem =\n | ProductDmStorage\n | ProductDmProjectTier;\n\nexport interface ProductsGetResponse {\n /** All the Products you have access to */\n products: ProductsGetResponseProductsItem[];\n}\n\nexport interface OrganisationsGetResponse {\n /** A list of Organisations */\n organisations: OrganisationDetail[];\n}\n\nexport interface OrganisationUnitsGetResponse {\n organisation: OrganisationDetail;\n /** A list of Units\n */\n units: UnitDetail[];\n}\n\nexport interface PersonalUnitPutResponse {\n /** The unit's Organisation. Used to identify the Default organisation */\n organisation_id: string;\n /** The unit's unique ID */\n id: string;\n}\n\nexport interface OrganisationUnitPostResponse {\n /** The unit's unique ID */\n id: string;\n}\n\nexport interface OrganisationGetDefaultResponse {\n /** Whether the user making the API call is a member of the Default Organisation. Only admin users are members of the Default organisation */\n caller_is_member: boolean;\n /** The Default Organisation ID\n */\n id: string;\n /** The Default Organisation Name\n */\n name: string;\n /** 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\n */\n private: boolean;\n}\n\nexport interface UsersGetResponse {\n organisation?: OrganisationDetail;\n unit?: UnitDetail;\n /** The list of Organisation Users\n */\n users: UserDetail[];\n}\n\nexport interface OrganisationPostResponse {\n /** The Organisation's unique ID */\n id: string;\n}\n\nexport interface StateGetVersionResponse {\n /** 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\n */\n version: string;\n}\n\nexport interface AssetPostResponse {\n /** The Asset ID\n */\n id: string;\n}\n\nexport interface AssetGetResponse {\n /** A list of Assets\n */\n assets: AssetDetail[];\n}\n\nexport interface AsError {\n /** Brief error text that can be presented to the user */\n error: string;\n}\n"]}
package/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export { Q as AXIOS_INSTANCE, N as AsError, W as ErrorType, i as OrganisationDetail, J as OrganisationGetDefaultResponse, c as OrganisationPostBodyBody, L as OrganisationPostResponse, O as OrganisationUnitPostBodyBody, I as OrganisationUnitPostResponse, F as OrganisationUnitsGetResponse, E as OrganisationsGetResponse, H as PersonalUnitPutResponse, q as ProductClaimDetail, p as ProductCoinsDetail, o as ProductDetail, m as ProductDetailFlavour, n as ProductDetailType, u as ProductDmProjectTier, v as ProductDmStorage, t as ProductDmStorageDetail, r as ProductDmStorageDetailCoins, s as ProductDmStorageDetailSize, l as ProductInstanceDetail, k as ProductInstanceDetailCoins, P as ProductPatchBodyBody, j as ProductType, A as ProductUnitGetResponse, z as ProductUnitGetResponseProduct, D as ProductsGetResponse, C as ProductsGetResponseProductsItem, B as ProductsGetTypesResponse, g as ServiceGetResponse, S as ServiceGetResponseKind, h as ServicesGetResponse, M as StateGetVersionResponse, f as UnitDetail, x as UnitGetResponse, b as UnitProductPostBodyBody, U as UnitProductPostBodyBodyFlavour, a as UnitProductPostBodyBodyType, y as UnitProductPostResponse, G as UnitsGetResponse, e as UserAccountDetail, w as UserAccountGetResponse, d as UserDetail, K as UsersGetResponse, V as customInstance, R as setAuthToken, T as setBaseUrl } from './custom-instance-13412a15.js';
1
+ export { a6 as AXIOS_INSTANCE, a5 as AsError, I as AssetDetail, H as AssetDetailScope, a4 as AssetGetResponse, i as AssetPostBodyBody, h as AssetPostBodyBodyScope, a3 as AssetPostResponse, A as AttachAssetParams, D as DetachAssetParams, aa as ErrorType, G as GetAssetParams, m as MerchantDetail, M as MerchantDetailKind, n as MerchantGetResponse, o as MerchantsGetResponse, p as OrganisationDetail, $ as OrganisationGetDefaultResponse, g as OrganisationPostBodyBody, a1 as OrganisationPostResponse, O as OrganisationUnitPostBodyBody, _ as OrganisationUnitPostResponse, Y as OrganisationUnitsGetResponse, X as OrganisationsGetResponse, Z as PersonalUnitPutResponse, y as ProductClaimDetail, x as ProductCoinsDetail, w as ProductDetail, u as ProductDetailFlavour, v as ProductDetailType, E as ProductDmProjectTier, F as ProductDmStorage, C as ProductDmStorageDetail, z as ProductDmStorageDetailCoins, B as ProductDmStorageDetailSize, t as ProductInstanceDetail, s as ProductInstanceDetailCoins, P as ProductPatchBodyBody, r as ProductType, q as ProductTypeServiceKind, S as ProductUnitGetResponse, R as ProductUnitGetResponseProduct, W as ProductsGetResponse, V as ProductsGetResponseProductsItem, T as ProductsGetTypesResponse, c as QMIdParameter, d as QOrgIdParameter, a as QProductIdParameter, b as QUnitIdParameter, Q as QUserIdParameter, a2 as StateGetVersionResponse, l as UnitDetail, L as UnitGetResponse, f as UnitProductPostBodyBody, U as UnitProductPostBodyBodyFlavour, e as UnitProductPostBodyBodyType, N as UnitProductPostResponse, K as UnitsGetResponse, k as UserAccountDetail, J as UserAccountGetResponse, j as UserDetail, a0 as UsersGetResponse, a9 as customInstance, a7 as setAuthToken, a8 as setBaseUrl } from './custom-instance-b985e1be.js';
2
2
  import 'axios';
package/index.js CHANGED
@@ -16,7 +16,16 @@ var UnitProductPostBodyBodyType = {
16
16
  DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION: "DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION",
17
17
  DATA_MANAGER_STORAGE_SUBSCRIPTION: "DATA_MANAGER_STORAGE_SUBSCRIPTION"
18
18
  };
19
- var ServiceGetResponseKind = {
19
+ var AssetPostBodyBodyScope = {
20
+ USER: "USER",
21
+ PRODUCT: "PRODUCT",
22
+ UNIT: "UNIT",
23
+ ORGANISATION: "ORGANISATION"
24
+ };
25
+ var MerchantDetailKind = {
26
+ DATA_MANAGER: "DATA_MANAGER"
27
+ };
28
+ var ProductTypeServiceKind = {
20
29
  DATA_MANAGER: "DATA_MANAGER"
21
30
  };
22
31
  var ProductDetailFlavour = {
@@ -29,11 +38,20 @@ var ProductDetailType = {
29
38
  DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION: "DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION",
30
39
  DATA_MANAGER_STORAGE_SUBSCRIPTION: "DATA_MANAGER_STORAGE_SUBSCRIPTION"
31
40
  };
41
+ var AssetDetailScope = {
42
+ USER: "USER",
43
+ PRODUCT: "PRODUCT",
44
+ UNIT: "UNIT",
45
+ ORGANISATION: "ORGANISATION"
46
+ };
32
47
  export {
33
48
  AXIOS_INSTANCE,
49
+ AssetDetailScope,
50
+ AssetPostBodyBodyScope,
51
+ MerchantDetailKind,
34
52
  ProductDetailFlavour,
35
53
  ProductDetailType,
36
- ServiceGetResponseKind,
54
+ ProductTypeServiceKind,
37
55
  UnitProductPostBodyBodyFlavour,
38
56
  UnitProductPostBodyBodyType,
39
57
  customInstance,
package/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/account-server-api.schemas.ts"],"sourcesContent":["/**\n * Generated by orval v6.7.1 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Products**, **Organisations**, **Units** and **Users**.\n\n * OpenAPI spec version: 0.1\n */\nexport type ProductPatchBodyBody = {\n /** The name you want to give the Product */\n name?: string;\n /** The Product's built-in coin allowance. Product allowances cannot be reduced */\n allowance?: number;\n /** 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 */\n limit?: number;\n};\n\n/**\n * The Flavour of the Product. Used only for Project Tier Products. Do not set this for Storage products\n */\nexport type UnitProductPostBodyBodyFlavour =\n | \"EVALUATION\"\n | \"BRONZE\"\n | \"SILVER\"\n | \"GOLD\";\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const UnitProductPostBodyBodyFlavour = {\n EVALUATION: \"EVALUATION\" as UnitProductPostBodyBodyFlavour,\n BRONZE: \"BRONZE\" as UnitProductPostBodyBodyFlavour,\n SILVER: \"SILVER\" as UnitProductPostBodyBodyFlavour,\n GOLD: \"GOLD\" as UnitProductPostBodyBodyFlavour,\n};\n\n/**\n * The Type of Product. Storage subscriptions require an **Allowance** to be defined and the **Flavour** must not be provided.\n\nProject Tier subscriptions have built-in allowances and Limits so you must not provide values for these for these products\n */\nexport type UnitProductPostBodyBodyType =\n | \"DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION\"\n | \"DATA_MANAGER_STORAGE_SUBSCRIPTION\";\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const UnitProductPostBodyBodyType = {\n DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION:\n \"DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION\" as UnitProductPostBodyBodyType,\n DATA_MANAGER_STORAGE_SUBSCRIPTION:\n \"DATA_MANAGER_STORAGE_SUBSCRIPTION\" as UnitProductPostBodyBodyType,\n};\n\nexport type UnitProductPostBodyBody = {\n /** The name you want to give the Product */\n name: string;\n /** The service identity for the Product. Products are created for use on a specific service, like a Data Manager instance */\n service_id: number;\n /** The Type of Product. Storage subscriptions require an **Allowance** to be defined and the **Flavour** must not be provided.\n\nProject Tier subscriptions have built-in allowances and Limits so you must not provide values for these for these products */\n type: UnitProductPostBodyBodyType;\n /** The Flavour of the Product. Used only for Project Tier Products. Do not set this for Storage products */\n flavour?: UnitProductPostBodyBodyFlavour;\n /** The Product's coin allowance. You must provide this for Storage products but you must not provide a value for Project Tier Products */\n allowance?: number;\n /** 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 */\n limit?: number;\n /** The day you would like to be billed for the Product's subscription (a value from 1 and 28) */\n billing_day: number;\n};\n\nexport type OrganisationUnitPostBodyBody = {\n /** The name of the unit */\n name: string;\n};\n\nexport type OrganisationPostBodyBody = {\n /** The name of the organisation */\n name: string;\n /** The name of the organisation owner. A user ID */\n owner: string;\n};\n\nexport interface UserDetail {\n /** The user identity (username) */\n id: string;\n}\n\nexport interface UserAccountDetail {\n user: UserDetail;\n /** Whether the caller has admin privilege */\n caller_has_admin_privilege: boolean;\n}\n\nexport interface UnitDetail {\n /** Whether the user making the API call is a member of the Unit */\n caller_is_member: boolean;\n /** The Unit's unique identity */\n id: string;\n /** The Unit's name */\n name: string;\n /** The Unit's owner (a username) */\n owner_id: string;\n /** True if the Unit is private */\n private: boolean;\n}\n\n/**\n * The kind of Service\n */\nexport type ServiceGetResponseKind = \"DATA_MANAGER\";\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const ServiceGetResponseKind = {\n DATA_MANAGER: \"DATA_MANAGER\" as ServiceGetResponseKind,\n};\n\nexport interface ServiceGetResponse {\n /** The unique ID of the Service */\n id: number;\n /** The kind of Service */\n kind: ServiceGetResponseKind;\n /** The name assigned to the Service */\n name?: string;\n}\n\nexport interface ServicesGetResponse {\n /** The list of known Services\n */\n services: ServiceGetResponse[];\n}\n\nexport interface OrganisationDetail {\n /** Whether the user making the API call is a member of the Unit */\n caller_is_member: boolean;\n /** The Organisation's unique ID */\n id: string;\n /** The Organisation's name */\n name: string;\n /** The username of the Organisation's owner. Not all Organisations have an owner. The Default Organisation has no owner. */\n owner_id?: string;\n /** True if the Unit is private */\n private: boolean;\n}\n\nexport interface ProductType {\n /** A product type, this is a unique string amongst all types known to the Account Server */\n type: string;\n /** A product flavour. Not all types have a flavour, those that do have a type-specific flavour string */\n flavour?: string;\n /** For a product that belongs to a specific service, the service that owns it is provided */\n service?: ServiceGetResponse;\n}\n\nexport type ProductInstanceDetailCoins = {\n /** The number of coins used\n */\n used: number;\n};\n\nexport interface ProductInstanceDetail {\n coins: ProductInstanceDetailCoins;\n}\n\n/**\n * The Product Type falvour. Not all products have flavours\n\n */\nexport type ProductDetailFlavour = \"EVALUATION\" | \"BRONZE\" | \"SILVER\" | \"GOLD\";\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const ProductDetailFlavour = {\n EVALUATION: \"EVALUATION\" as ProductDetailFlavour,\n BRONZE: \"BRONZE\" as ProductDetailFlavour,\n SILVER: \"SILVER\" as ProductDetailFlavour,\n GOLD: \"GOLD\" as ProductDetailFlavour,\n};\n\n/**\n * The Product Type\n\n */\nexport type ProductDetailType =\n | \"DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION\"\n | \"DATA_MANAGER_STORAGE_SUBSCRIPTION\";\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const ProductDetailType = {\n DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION:\n \"DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION\" as ProductDetailType,\n DATA_MANAGER_STORAGE_SUBSCRIPTION:\n \"DATA_MANAGER_STORAGE_SUBSCRIPTION\" as ProductDetailType,\n};\n\nexport interface ProductDetail {\n /** The Product ID\n */\n id: string;\n /** The Product Service ID\n */\n service_id?: number;\n /** The Product Type\n */\n type: ProductDetailType;\n /** The Product Type falvour. Not all products have flavours\n */\n flavour?: ProductDetailFlavour;\n /** The name of the Product\n */\n name?: string;\n}\n\nexport interface ProductCoinsDetail {\n /** The billing allowance. When you exceed this during the current billing period the *cost multiplier* will increase */\n allowance: number;\n /** 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 */\n limit: number;\n /** The total number of coins consumed (in this billing period), excluding the coins that have been consumed for the current day */\n used: number;\n /** 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. */\n at_limit: boolean;\n /** The current burn rate, the approximate amount of coins you are currently consuming each day */\n current_burn_rate: number;\n /** The predicted billing period amount, if costs continue at the current burn rate until the end of the billing period */\n billing_prediction: number;\n /** The day of the month when the bill is due, and the end of the current billing period */\n billing_day: number;\n /** A multiplier applied to your coin usage within your allowance */\n allowance_multiplier: number;\n /** A multiplier that will be applied to coin used beyond your allowance */\n overspend_multiplier: number;\n /** The number of days remaining, in the current billing period */\n remaining_days: number;\n}\n\nexport interface ProductClaimDetail {\n /** The service-specific ID that is using this Subscription\n */\n id: string;\n /** A name for the service-specific ID\n */\n name?: string;\n}\n\nexport type ProductDmStorageDetailCoins = {\n /** The number of coins currently committed for the current day. This is added to the accumulated coins at the start of each day */\n used: number;\n /** The coin cost of a 'unit' of storage or part thereof. The unit size is defined in the storage section of the response */\n unit_cost: number;\n};\n\nexport type ProductDmStorageDetailSize = {\n /** The humanised size of the peak storage used for the current day. The value is reset at the start of each day */\n peak: string;\n /** The humanised size of the current storage used for the current day and used to calculate the 'burn rate' */\n current: string;\n /** The humanised storage unit. The cost of storage is based on the daily peak of the number of units (or part thereof) used */\n unit_size: string;\n /** The peak number of storage units used today */\n units_used: number;\n};\n\nexport interface ProductDmStorageDetail {\n size: ProductDmStorageDetailSize;\n coins: ProductDmStorageDetailCoins;\n}\n\nexport interface ProductDmProjectTier {\n product: ProductDetail;\n organisation: OrganisationDetail;\n unit: UnitDetail;\n storage: ProductDmStorageDetail;\n coins: ProductCoinsDetail;\n instance: ProductInstanceDetail;\n claim?: ProductClaimDetail;\n}\n\nexport interface ProductDmStorage {\n product: ProductDetail;\n organisation: OrganisationDetail;\n unit: UnitDetail;\n storage: ProductDmStorageDetail;\n coins: ProductCoinsDetail;\n}\n\nexport type UserAccountGetResponse = UserAccountDetail;\n\nexport interface UnitGetResponse {\n /** The Unit's unique ID */\n id: string;\n /** The Unit's name */\n name: string;\n /** The Unit's oener (username) */\n owner_id: string;\n}\n\nexport interface UnitProductPostResponse {\n /** The Products's unique ID */\n id: string;\n}\n\n/**\n * The Unit's Product\n */\nexport type ProductUnitGetResponseProduct =\n | ProductDmStorage\n | ProductDmProjectTier;\n\nexport interface ProductUnitGetResponse {\n /** The Unit's Product */\n product: ProductUnitGetResponseProduct;\n}\n\nexport interface ProductsGetTypesResponse {\n /** All the Product Types you have access to */\n product_types: ProductType[];\n}\n\nexport type ProductsGetResponseProductsItem =\n | ProductDmStorage\n | ProductDmProjectTier;\n\nexport interface ProductsGetResponse {\n /** All the Products you have access to */\n products: ProductsGetResponseProductsItem[];\n}\n\nexport interface OrganisationsGetResponse {\n /** A list of Organisations */\n organisations: OrganisationDetail[];\n}\n\nexport interface OrganisationUnitsGetResponse {\n organisation: OrganisationDetail;\n /** A list of Units\n */\n units: UnitDetail[];\n}\n\nexport interface UnitsGetResponse {\n /** A list of Units\n */\n units: OrganisationUnitsGetResponse[];\n}\n\nexport interface PersonalUnitPutResponse {\n /** The unit's Organisation. Used to identify the Default organisation */\n organisation_id: string;\n /** The unit's unique ID */\n id: string;\n}\n\nexport interface OrganisationUnitPostResponse {\n /** The unit's unique ID */\n id: string;\n}\n\nexport interface OrganisationGetDefaultResponse {\n /** Whether the user making the API call is a member of the Default Organisation. Only admin users are members of the Default organisation */\n caller_is_member: boolean;\n /** The Default Organisation ID\n */\n id: string;\n /** The Default Organisation Name\n */\n name: string;\n /** 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\n */\n private: boolean;\n}\n\nexport interface UsersGetResponse {\n organisation?: OrganisationDetail;\n unit?: UnitDetail;\n /** The list of Organisation Users\n */\n users: UserDetail[];\n}\n\nexport interface OrganisationPostResponse {\n /** The Organisation's unique ID */\n id: string;\n}\n\nexport interface StateGetVersionResponse {\n /** 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\n */\n version: string;\n}\n\nexport interface AsError {\n /** Brief error text that can be presented to the user */\n error: string;\n}\n"],"mappings":";;;;;;;;AA6BO,IAAM,iCAAiC;AAAA,EAC5C,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,MAAM;AACR;AAYO,IAAM,8BAA8B;AAAA,EACzC,wCACE;AAAA,EACF,mCACE;AACJ;AA+DO,IAAM,yBAAyB;AAAA,EACpC,cAAc;AAChB;AAwDO,IAAM,uBAAuB;AAAA,EAClC,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,MAAM;AACR;AAWO,IAAM,oBAAoB;AAAA,EAC/B,wCACE;AAAA,EACF,mCACE;AACJ;","names":[]}
1
+ {"version":3,"sources":["../src/account-server-api.schemas.ts"],"sourcesContent":["/**\n * Generated by orval v6.8.0 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Products**, **Organisations**, **Units** and **Users**.\n\n * OpenAPI spec version: 0.1\n */\nexport type DetachAssetParams = { m_id?: QMIdParameter };\n\nexport type AttachAssetParams = { m_id?: QMIdParameter };\n\n/**\n * A User Identity\n */\nexport type QUserIdParameter = string;\n\n/**\n * A Product Identity\n */\nexport type QProductIdParameter = string;\n\n/**\n * A Unit Identity\n */\nexport type QUnitIdParameter = string;\n\nexport type GetAssetParams = {\n user_id?: QUserIdParameter;\n product_id?: QProductIdParameter;\n unit_id?: QUnitIdParameter;\n org_id?: QOrgIdParameter;\n};\n\n/**\n * A Merchant Identity\n */\nexport type QMIdParameter = number;\n\n/**\n * An Organisation Identity\n */\nexport type QOrgIdParameter = string;\n\nexport type ProductPatchBodyBody = {\n /** The name you want to give the Product */\n name?: string;\n /** The Product's built-in coin allowance. Product allowances cannot be reduced */\n allowance?: number;\n /** 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 */\n limit?: number;\n};\n\n/**\n * The Flavour of the Product. Used only for Project Tier Products. Do not set this for Storage products\n */\nexport type UnitProductPostBodyBodyFlavour =\n typeof UnitProductPostBodyBodyFlavour[keyof typeof UnitProductPostBodyBodyFlavour];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const UnitProductPostBodyBodyFlavour = {\n EVALUATION: \"EVALUATION\",\n BRONZE: \"BRONZE\",\n SILVER: \"SILVER\",\n GOLD: \"GOLD\",\n} as const;\n\n/**\n * The Type of Product. Storage subscriptions require an **Allowance** to be defined and the **Flavour** must not be provided.\n\nProject Tier subscriptions have built-in allowances and Limits so you must not provide values for these for these products\n */\nexport type UnitProductPostBodyBodyType =\n typeof UnitProductPostBodyBodyType[keyof typeof UnitProductPostBodyBodyType];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const UnitProductPostBodyBodyType = {\n DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION:\n \"DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION\",\n DATA_MANAGER_STORAGE_SUBSCRIPTION: \"DATA_MANAGER_STORAGE_SUBSCRIPTION\",\n} as const;\n\nexport type UnitProductPostBodyBody = {\n /** The name you want to give the Product */\n name: string;\n /** The service identity for the Product. Products are created for use on a specific service, like a Data Manager instance */\n service_id: number;\n /** The Type of Product. Storage subscriptions require an **Allowance** to be defined and the **Flavour** must not be provided.\n\nProject Tier subscriptions have built-in allowances and Limits so you must not provide values for these for these products */\n type: UnitProductPostBodyBodyType;\n /** The Flavour of the Product. Used only for Project Tier Products. Do not set this for Storage products */\n flavour?: UnitProductPostBodyBodyFlavour;\n /** The Product's coin allowance. You must provide this for Storage products but you must not provide a value for Project Tier Products */\n allowance?: number;\n /** 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 */\n limit?: number;\n /** The day you would like to be billed for the Product's subscription (a value from 1 and 28) */\n billing_day: number;\n};\n\nexport type OrganisationUnitPostBodyBody = {\n /** The name of the unit */\n name: string;\n};\n\nexport type OrganisationPostBodyBody = {\n /** The name of the organisation */\n name: string;\n /** The name of the organisation owner. A user ID */\n owner: string;\n};\n\nexport type AssetPostBodyBodyScope =\n typeof AssetPostBodyBodyScope[keyof typeof AssetPostBodyBodyScope];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const AssetPostBodyBodyScope = {\n USER: \"USER\",\n PRODUCT: \"PRODUCT\",\n UNIT: \"UNIT\",\n ORGANISATION: \"ORGANISATION\",\n} as const;\n\nexport type AssetPostBodyBody = {\n /** 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 */\n name: string;\n /** A file containing the content for the asset. You must provide a value here or in content_string */\n content_file?: Blob;\n /** The textual content of the asset. You must provide a value here or in content_file */\n content_string?: string;\n scope: AssetPostBodyBodyScope;\n /** The unique identity based on the Scope of the asset. For example, this wil be the Unit ID if it's a UNIT. A scope_id is required if the scope is USER as it wil be automatically set to your username */\n scope_id?: string;\n /** Is this a secret asset? */\n secret: boolean;\n /** An optional description for the Asset */\n description?: string;\n};\n\nexport interface UserDetail {\n /** The user identity (username) */\n id: string;\n}\n\nexport interface UserAccountDetail {\n user: UserDetail;\n /** Whether the caller has admin privilege */\n caller_has_admin_privilege: boolean;\n}\n\nexport interface UnitDetail {\n /** Whether the user making the API call is a member of the Unit */\n caller_is_member: boolean;\n /** The Unit's unique identity */\n id: string;\n /** The Unit's name */\n name: string;\n /** The Unit's owner (a username) */\n owner_id: string;\n /** True if the Unit is private */\n private: boolean;\n}\n\n/**\n * The kind of Service\n */\nexport type MerchantDetailKind =\n typeof MerchantDetailKind[keyof typeof MerchantDetailKind];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const MerchantDetailKind = {\n DATA_MANAGER: \"DATA_MANAGER\",\n} as const;\n\nexport interface MerchantDetail {\n /** The unique ID of the Service */\n id: number;\n /** The kind of Service */\n kind: MerchantDetailKind;\n /** The name assigned to the Service */\n name: string;\n /** The hostname used by the Service */\n api_hostname: string;\n}\n\nexport type MerchantGetResponse = MerchantDetail;\n\nexport interface MerchantsGetResponse {\n /** The list of known Merchants\n */\n merchants: MerchantDetail[];\n}\n\nexport interface OrganisationDetail {\n /** Whether the user making the API call is a member of the Unit */\n caller_is_member: boolean;\n /** The Organisation's unique ID */\n id: string;\n /** The Organisation's name */\n name: string;\n /** The username of the Organisation's owner. Not all Organisations have an owner. The Default Organisation has no owner. */\n owner_id?: string;\n /** True if the Unit is private */\n private: boolean;\n}\n\n/**\n * The kind of service that can use the Product\n */\nexport type ProductTypeServiceKind =\n typeof ProductTypeServiceKind[keyof typeof ProductTypeServiceKind];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const ProductTypeServiceKind = {\n DATA_MANAGER: \"DATA_MANAGER\",\n} as const;\n\nexport interface ProductType {\n /** A product type, this is a unique string amongst all types known to the Account Server */\n type: string;\n /** A product flavour. Not all types have a flavour, those that do have a type-specific flavour string */\n flavour?: string;\n /** The kind of service that can use the Product */\n service_kind?: ProductTypeServiceKind;\n}\n\nexport type ProductInstanceDetailCoins = {\n /** The number of coins used\n */\n used: number;\n};\n\nexport interface ProductInstanceDetail {\n coins: ProductInstanceDetailCoins;\n}\n\n/**\n * The Product Type falvour. Not all products have flavours\n\n */\nexport type ProductDetailFlavour =\n typeof ProductDetailFlavour[keyof typeof ProductDetailFlavour];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const ProductDetailFlavour = {\n EVALUATION: \"EVALUATION\",\n BRONZE: \"BRONZE\",\n SILVER: \"SILVER\",\n GOLD: \"GOLD\",\n} as const;\n\n/**\n * The Product Type\n\n */\nexport type ProductDetailType =\n typeof ProductDetailType[keyof typeof ProductDetailType];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const ProductDetailType = {\n DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION:\n \"DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION\",\n DATA_MANAGER_STORAGE_SUBSCRIPTION: \"DATA_MANAGER_STORAGE_SUBSCRIPTION\",\n} as const;\n\nexport interface ProductDetail {\n /** The Product ID\n */\n id: string;\n /** The Product Service ID\n */\n service_id?: number;\n /** The Product Type\n */\n type: ProductDetailType;\n /** The Product Type falvour. Not all products have flavours\n */\n flavour?: ProductDetailFlavour;\n /** The name of the Product\n */\n name?: string;\n}\n\nexport interface ProductCoinsDetail {\n /** The billing allowance. When you exceed this during the current billing period the *cost multiplier* will increase */\n allowance: number;\n /** 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 */\n limit: number;\n /** The total number of coins consumed (in this billing period), excluding the coins that have been consumed for the current day */\n used: number;\n /** 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. */\n at_limit: boolean;\n /** The current burn rate, the approximate amount of coins you are currently consuming each day */\n current_burn_rate: number;\n /** The predicted billing period amount, if costs continue at the current burn rate until the end of the billing period */\n billing_prediction: number;\n /** The day of the month when the bill is due, and the end of the current billing period */\n billing_day: number;\n /** A multiplier applied to your coin usage within your allowance */\n allowance_multiplier: number;\n /** A multiplier that will be applied to coin used beyond your allowance */\n overspend_multiplier: number;\n /** The number of days remaining, in the current billing period */\n remaining_days: number;\n}\n\nexport interface ProductClaimDetail {\n /** The service-specific ID that is using this Subscription\n */\n id: string;\n /** A name for the service-specific ID\n */\n name?: string;\n}\n\nexport type ProductDmStorageDetailCoins = {\n /** The number of coins currently committed for the current day. This is added to the accumulated coins at the start of each day */\n used: number;\n /** The coin cost of a 'unit' of storage or part thereof. The unit size is defined in the storage section of the response */\n unit_cost: number;\n};\n\nexport type ProductDmStorageDetailSize = {\n /** The humanised size of the peak storage used for the current day. The value is reset at the start of each day */\n peak: string;\n /** The humanised size of the current storage used for the current day and used to calculate the 'burn rate' */\n current: string;\n /** The humanised storage unit. The cost of storage is based on the daily peak of the number of units (or part thereof) used */\n unit_size: string;\n /** The peak number of storage units used today */\n units_used: number;\n};\n\nexport interface ProductDmStorageDetail {\n size: ProductDmStorageDetailSize;\n coins: ProductDmStorageDetailCoins;\n}\n\nexport interface ProductDmProjectTier {\n product: ProductDetail;\n organisation: OrganisationDetail;\n unit: UnitDetail;\n storage: ProductDmStorageDetail;\n coins: ProductCoinsDetail;\n instance: ProductInstanceDetail;\n claim?: ProductClaimDetail;\n}\n\nexport interface ProductDmStorage {\n product: ProductDetail;\n organisation: OrganisationDetail;\n unit: UnitDetail;\n storage: ProductDmStorageDetail;\n coins: ProductCoinsDetail;\n}\n\nexport type AssetDetailScope =\n typeof AssetDetailScope[keyof typeof AssetDetailScope];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const AssetDetailScope = {\n USER: \"USER\",\n PRODUCT: \"PRODUCT\",\n UNIT: \"UNIT\",\n ORGANISATION: \"ORGANISATION\",\n} as const;\n\nexport interface AssetDetail {\n creator: string;\n id: string;\n name: string;\n scope: AssetDetailScope;\n scope_id: string;\n secret: boolean;\n disabled: boolean;\n content: string;\n created: string;\n description?: string;\n merchants: MerchantDetail[];\n}\n\nexport type UserAccountGetResponse = UserAccountDetail;\n\nexport interface UnitsGetResponse {\n /** A list of Units\n */\n units: OrganisationUnitsGetResponse[];\n}\n\nexport type UnitGetResponse = UnitDetail;\n\nexport interface UnitProductPostResponse {\n /** The Products's unique ID */\n id: string;\n}\n\n/**\n * The Unit's Product\n */\nexport type ProductUnitGetResponseProduct =\n | ProductDmStorage\n | ProductDmProjectTier;\n\nexport interface ProductUnitGetResponse {\n /** The Unit's Product */\n product: ProductUnitGetResponseProduct;\n}\n\nexport interface ProductsGetTypesResponse {\n /** All the Product Types you have access to */\n product_types: ProductType[];\n}\n\nexport type ProductsGetResponseProductsItem =\n | ProductDmStorage\n | ProductDmProjectTier;\n\nexport interface ProductsGetResponse {\n /** All the Products you have access to */\n products: ProductsGetResponseProductsItem[];\n}\n\nexport interface OrganisationsGetResponse {\n /** A list of Organisations */\n organisations: OrganisationDetail[];\n}\n\nexport interface OrganisationUnitsGetResponse {\n organisation: OrganisationDetail;\n /** A list of Units\n */\n units: UnitDetail[];\n}\n\nexport interface PersonalUnitPutResponse {\n /** The unit's Organisation. Used to identify the Default organisation */\n organisation_id: string;\n /** The unit's unique ID */\n id: string;\n}\n\nexport interface OrganisationUnitPostResponse {\n /** The unit's unique ID */\n id: string;\n}\n\nexport interface OrganisationGetDefaultResponse {\n /** Whether the user making the API call is a member of the Default Organisation. Only admin users are members of the Default organisation */\n caller_is_member: boolean;\n /** The Default Organisation ID\n */\n id: string;\n /** The Default Organisation Name\n */\n name: string;\n /** 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\n */\n private: boolean;\n}\n\nexport interface UsersGetResponse {\n organisation?: OrganisationDetail;\n unit?: UnitDetail;\n /** The list of Organisation Users\n */\n users: UserDetail[];\n}\n\nexport interface OrganisationPostResponse {\n /** The Organisation's unique ID */\n id: string;\n}\n\nexport interface StateGetVersionResponse {\n /** 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\n */\n version: string;\n}\n\nexport interface AssetPostResponse {\n /** The Asset ID\n */\n id: string;\n}\n\nexport interface AssetGetResponse {\n /** A list of Assets\n */\n assets: AssetDetail[];\n}\n\nexport interface AsError {\n /** Brief error text that can be presented to the user */\n error: string;\n}\n"],"mappings":";;;;;;;;AA8DO,IAAM,iCAAiC;AAAA,EAC5C,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,MAAM;AACR;AAWO,IAAM,8BAA8B;AAAA,EACzC,wCACE;AAAA,EACF,mCAAmC;AACrC;AAqCO,IAAM,yBAAyB;AAAA,EACpC,MAAM;AAAA,EACN,SAAS;AAAA,EACT,MAAM;AAAA,EACN,cAAc;AAChB;AAiDO,IAAM,qBAAqB;AAAA,EAChC,cAAc;AAChB;AAyCO,IAAM,yBAAyB;AAAA,EACpC,cAAc;AAChB;AA6BO,IAAM,uBAAuB;AAAA,EAClC,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,MAAM;AACR;AAUO,IAAM,oBAAoB;AAAA,EAC/B,wCACE;AAAA,EACF,mCAAmC;AACrC;AAiGO,IAAM,mBAAmB;AAAA,EAC9B,MAAM;AAAA,EACN,SAAS;AAAA,EACT,MAAM;AAAA,EACN,cAAc;AAChB;","names":[]}
@@ -0,0 +1,48 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
2
+
3
+
4
+ var _chunkNGBTCJWScjs = require('../chunk-NGBTCJWS.cjs');
5
+
6
+ // src/merchant/merchant.ts
7
+
8
+
9
+ var _reactquery = require('react-query');
10
+ var getMerchants = (options, signal) => {
11
+ return _chunkNGBTCJWScjs.customInstance.call(void 0, { url: `/merchant`, method: "get", signal }, options);
12
+ };
13
+ var getGetMerchantsQueryKey = () => [`/merchant`];
14
+ var useGetMerchants = (options) => {
15
+ const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
16
+ const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetMerchantsQueryKey()));
17
+ const queryFn = ({
18
+ signal
19
+ }) => getMerchants(requestOptions, signal);
20
+ const query = _reactquery.useQuery.call(void 0, queryKey, queryFn, queryOptions);
21
+ return _chunkNGBTCJWScjs.__spreadValues.call(void 0, {
22
+ queryKey
23
+ }, query);
24
+ };
25
+ var getService = (mId, options, signal) => {
26
+ return _chunkNGBTCJWScjs.customInstance.call(void 0, { url: `/merchant/${mId}`, method: "get", signal }, options);
27
+ };
28
+ var getGetServiceQueryKey = (mId) => [`/merchant/${mId}`];
29
+ var useGetService = (mId, options) => {
30
+ const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
31
+ const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetServiceQueryKey(mId)));
32
+ const queryFn = ({
33
+ signal
34
+ }) => getService(mId, requestOptions, signal);
35
+ const query = _reactquery.useQuery.call(void 0, queryKey, queryFn, _chunkNGBTCJWScjs.__spreadValues.call(void 0, { enabled: !!mId }, queryOptions));
36
+ return _chunkNGBTCJWScjs.__spreadValues.call(void 0, {
37
+ queryKey
38
+ }, query);
39
+ };
40
+
41
+
42
+
43
+
44
+
45
+
46
+
47
+ exports.getGetMerchantsQueryKey = getGetMerchantsQueryKey; exports.getGetServiceQueryKey = getGetServiceQueryKey; exports.getMerchants = getMerchants; exports.getService = getService; exports.useGetMerchants = useGetMerchants; exports.useGetService = useGetService;
48
+ //# sourceMappingURL=merchant.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/merchant/merchant.ts"],"names":[],"mappings":";;;;;;AAUA;AAAA;AAAA;AA+BO,IAAM,eAAe,CAC1B,SACA,WACG;AACH,SAAO,eACL,EAAE,KAAK,aAAa,QAAQ,OAAO,OAAO,GAC1C,OACF;AACF;AAEO,IAAM,0BAA0B,MAAM,CAAC,WAAW;AAOlD,IAAM,kBAAkB,CAG7B,YAO4D;AAC5D,QAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW,CAAC;AAErE,QAAM,WAAW,8CAAc,aAAY,wBAAwB;AAEnE,QAAM,UAAmE,CAAC;AAAA,IACxE;AAAA,QACI,aAAa,gBAAgB,MAAM;AAEzC,QAAM,QAAQ,SAIZ,UAAU,SAAS,YAAY;AAEjC,SAAO;AAAA,IACL;AAAA,KACG;AAEP;AAOO,IAAM,aAAa,CACxB,KACA,SACA,WACG;AACH,SAAO,eACL,EAAE,KAAK,aAAa,OAAO,QAAQ,OAAO,OAAO,GACjD,OACF;AACF;AAEO,IAAM,wBAAwB,CAAC,QAAgB,CAAC,aAAa,KAAK;AAOlE,IAAM,gBAAgB,CAI3B,KACA,YAQ2D;AAC3D,QAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW,CAAC;AAErE,QAAM,WAAW,8CAAc,aAAY,sBAAsB,GAAG;AAEpE,QAAM,UAAiE,CAAC;AAAA,IACtE;AAAA,QACI,WAAW,KAAK,gBAAgB,MAAM;AAE5C,QAAM,QAAQ,SACZ,UACA,SACA,iBAAE,SAAS,CAAC,CAAC,OAAQ,aACvB;AAEA,SAAO;AAAA,IACL;AAAA,KACG;AAEP","sourcesContent":["/**\n * Generated by orval v6.8.0 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Products**, **Organisations**, **Units** and **Users**.\n\n * OpenAPI spec version: 0.1\n */\nimport {\n useQuery,\n UseQueryOptions,\n QueryFunction,\n UseQueryResult,\n QueryKey,\n} from \"react-query\";\nimport type {\n MerchantsGetResponse,\n AsError,\n MerchantGetResponse,\n} from \"../account-server-api.schemas\";\nimport { customInstance, ErrorType } from \".././custom-instance\";\n\nexport type AwaitedInput<T> = PromiseLike<T> | T;\n\nexport type Awaited<O> = O extends AwaitedInput<infer T> ? T : never;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P\n) => any\n ? P\n : never;\n\n/**\n * Gets merchants known to the Account Server\n\n * @summary Gets all Merchants\n */\nexport const getMerchants = (\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<MerchantsGetResponse>(\n { url: `/merchant`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetMerchantsQueryKey = () => [`/merchant`];\n\nexport type GetMerchantsQueryResult = NonNullable<\n Awaited<ReturnType<typeof getMerchants>>\n>;\nexport type GetMerchantsQueryError = ErrorType<AsError | void>;\n\nexport const useGetMerchants = <\n TData = Awaited<ReturnType<typeof getMerchants>>,\n TError = ErrorType<AsError | void>\n>(options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getMerchants>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetMerchantsQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getMerchants>>> = ({\n signal,\n }) => getMerchants(requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getMerchants>>,\n TError,\n TData\n >(queryKey, queryFn, queryOptions);\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Gets a known merchant\n\n * @summary Gets a specific Merchant\n */\nexport const getService = (\n mId: number,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<MerchantGetResponse>(\n { url: `/merchant/${mId}`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetServiceQueryKey = (mId: number) => [`/merchant/${mId}`];\n\nexport type GetServiceQueryResult = NonNullable<\n Awaited<ReturnType<typeof getService>>\n>;\nexport type GetServiceQueryError = ErrorType<AsError | void>;\n\nexport const useGetService = <\n TData = Awaited<ReturnType<typeof getService>>,\n TError = ErrorType<AsError | void>\n>(\n mId: number,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getService>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetServiceQueryKey(mId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getService>>> = ({\n signal,\n }) => getService(mId, requestOptions, signal);\n\n const query = useQuery<Awaited<ReturnType<typeof getService>>, TError, TData>(\n queryKey,\n queryFn,\n { enabled: !!mId, ...queryOptions }\n );\n\n return {\n queryKey,\n ...query,\n };\n};\n"]}
@@ -0,0 +1,39 @@
1
+ import { a9 as customInstance, o as MerchantsGetResponse, aa as ErrorType, a5 as AsError, m as MerchantDetail } from '../custom-instance-b985e1be.js';
2
+ import { UseQueryOptions, QueryKey, UseQueryResult } from 'react-query';
3
+ import 'axios';
4
+
5
+ declare type AwaitedInput<T> = PromiseLike<T> | T;
6
+ declare type Awaited<O> = O extends AwaitedInput<infer T> ? T : never;
7
+ declare type SecondParameter<T extends (...args: any) => any> = T extends (config: any, args: infer P) => any ? P : never;
8
+ /**
9
+ * Gets merchants known to the Account Server
10
+
11
+ * @summary Gets all Merchants
12
+ */
13
+ declare const getMerchants: (options?: SecondParameter<typeof customInstance>, signal?: AbortSignal | undefined) => Promise<MerchantsGetResponse>;
14
+ declare const getGetMerchantsQueryKey: () => string[];
15
+ declare type GetMerchantsQueryResult = NonNullable<Awaited<ReturnType<typeof getMerchants>>>;
16
+ declare type GetMerchantsQueryError = ErrorType<AsError | void>;
17
+ declare const useGetMerchants: <TData = MerchantsGetResponse, TError = ErrorType<void | AsError>>(options?: {
18
+ query?: UseQueryOptions<MerchantsGetResponse, TError, TData, QueryKey> | undefined;
19
+ request?: SecondParameter<typeof customInstance>;
20
+ } | undefined) => UseQueryResult<TData, TError> & {
21
+ queryKey: QueryKey;
22
+ };
23
+ /**
24
+ * Gets a known merchant
25
+
26
+ * @summary Gets a specific Merchant
27
+ */
28
+ declare const getService: (mId: number, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal | undefined) => Promise<MerchantDetail>;
29
+ declare const getGetServiceQueryKey: (mId: number) => string[];
30
+ declare type GetServiceQueryResult = NonNullable<Awaited<ReturnType<typeof getService>>>;
31
+ declare type GetServiceQueryError = ErrorType<AsError | void>;
32
+ declare const useGetService: <TData = MerchantDetail, TError = ErrorType<void | AsError>>(mId: number, options?: {
33
+ query?: UseQueryOptions<MerchantDetail, TError, TData, QueryKey> | undefined;
34
+ request?: SecondParameter<typeof customInstance>;
35
+ } | undefined) => UseQueryResult<TData, TError> & {
36
+ queryKey: QueryKey;
37
+ };
38
+
39
+ export { Awaited, AwaitedInput, GetMerchantsQueryError, GetMerchantsQueryResult, GetServiceQueryError, GetServiceQueryResult, getGetMerchantsQueryKey, getGetServiceQueryKey, getMerchants, getService, useGetMerchants, useGetService };