@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.
- package/asset/asset.cjs +133 -0
- package/asset/asset.cjs.map +1 -0
- package/asset/asset.d.ts +126 -0
- package/asset/asset.js +133 -0
- package/asset/asset.js.map +1 -0
- package/asset/package.json +7 -0
- package/{custom-instance-13412a15.d.ts → custom-instance-b985e1be.d.ts} +127 -40
- package/index.cjs +20 -2
- package/index.cjs.map +1 -1
- package/index.d.ts +1 -1
- package/index.js +20 -2
- package/index.js.map +1 -1
- package/merchant/merchant.cjs +48 -0
- package/merchant/merchant.cjs.map +1 -0
- package/merchant/merchant.d.ts +39 -0
- package/merchant/merchant.js +48 -0
- package/merchant/merchant.js.map +1 -0
- package/merchant/package.json +7 -0
- package/organisation/organisation.cjs +12 -12
- package/organisation/organisation.cjs.map +1 -1
- package/organisation/organisation.d.ts +10 -9
- package/organisation/organisation.js +12 -12
- package/organisation/organisation.js.map +1 -1
- package/package.json +9 -9
- package/product/product.cjs +36 -26
- package/product/product.cjs.map +1 -1
- package/product/product.d.ts +23 -16
- package/product/product.js +36 -26
- package/product/product.js.map +1 -1
- package/src/account-server-api.schemas.ts +155 -52
- package/src/asset/asset.ts +433 -0
- package/src/merchant/merchant.ts +145 -0
- package/src/organisation/organisation.ts +37 -37
- package/src/product/product.ts +97 -74
- package/src/state/state.ts +19 -16
- package/src/unit/unit.ts +64 -56
- package/src/user/user.ts +63 -62
- package/state/state.cjs +6 -4
- package/state/state.cjs.map +1 -1
- package/state/state.d.ts +7 -6
- package/state/state.js +6 -4
- package/state/state.js.map +1 -1
- package/unit/unit.cjs +22 -18
- package/unit/unit.cjs.map +1 -1
- package/unit/unit.d.ts +16 -15
- package/unit/unit.js +22 -18
- package/unit/unit.js.map +1 -1
- package/user/user.cjs +22 -20
- package/user/user.cjs.map +1 -1
- package/user/user.d.ts +14 -13
- package/user/user.js +22 -20
- package/user/user.js.map +1 -1
- package/service/package.json +0 -7
- package/service/service.cjs +0 -44
- package/service/service.cjs.map +0 -1
- package/service/service.d.ts +0 -49
- package/service/service.js +0 -44
- package/service/service.js.map +0 -1
- package/src/service/service.ts +0 -136
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Generated by orval v6.
|
|
2
|
+
* Generated by orval v6.8.0 🍺
|
|
3
3
|
* Do not edit manually.
|
|
4
4
|
* Account Server API
|
|
5
5
|
* The Informatics Matters Account Server API.
|
|
@@ -8,6 +8,42 @@ A service that provides access to the Account Server, which gives *registered* u
|
|
|
8
8
|
|
|
9
9
|
* OpenAPI spec version: 0.1
|
|
10
10
|
*/
|
|
11
|
+
export type DetachAssetParams = { m_id?: QMIdParameter };
|
|
12
|
+
|
|
13
|
+
export type AttachAssetParams = { m_id?: QMIdParameter };
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* A User Identity
|
|
17
|
+
*/
|
|
18
|
+
export type QUserIdParameter = string;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* A Product Identity
|
|
22
|
+
*/
|
|
23
|
+
export type QProductIdParameter = string;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* A Unit Identity
|
|
27
|
+
*/
|
|
28
|
+
export type QUnitIdParameter = string;
|
|
29
|
+
|
|
30
|
+
export type GetAssetParams = {
|
|
31
|
+
user_id?: QUserIdParameter;
|
|
32
|
+
product_id?: QProductIdParameter;
|
|
33
|
+
unit_id?: QUnitIdParameter;
|
|
34
|
+
org_id?: QOrgIdParameter;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* A Merchant Identity
|
|
39
|
+
*/
|
|
40
|
+
export type QMIdParameter = number;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* An Organisation Identity
|
|
44
|
+
*/
|
|
45
|
+
export type QOrgIdParameter = string;
|
|
46
|
+
|
|
11
47
|
export type ProductPatchBodyBody = {
|
|
12
48
|
/** The name you want to give the Product */
|
|
13
49
|
name?: string;
|
|
@@ -21,18 +57,15 @@ export type ProductPatchBodyBody = {
|
|
|
21
57
|
* The Flavour of the Product. Used only for Project Tier Products. Do not set this for Storage products
|
|
22
58
|
*/
|
|
23
59
|
export type UnitProductPostBodyBodyFlavour =
|
|
24
|
-
|
|
25
|
-
| "BRONZE"
|
|
26
|
-
| "SILVER"
|
|
27
|
-
| "GOLD";
|
|
60
|
+
typeof UnitProductPostBodyBodyFlavour[keyof typeof UnitProductPostBodyBodyFlavour];
|
|
28
61
|
|
|
29
62
|
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
30
63
|
export const UnitProductPostBodyBodyFlavour = {
|
|
31
|
-
EVALUATION: "EVALUATION"
|
|
32
|
-
BRONZE: "BRONZE"
|
|
33
|
-
SILVER: "SILVER"
|
|
34
|
-
GOLD: "GOLD"
|
|
35
|
-
};
|
|
64
|
+
EVALUATION: "EVALUATION",
|
|
65
|
+
BRONZE: "BRONZE",
|
|
66
|
+
SILVER: "SILVER",
|
|
67
|
+
GOLD: "GOLD",
|
|
68
|
+
} as const;
|
|
36
69
|
|
|
37
70
|
/**
|
|
38
71
|
* The Type of Product. Storage subscriptions require an **Allowance** to be defined and the **Flavour** must not be provided.
|
|
@@ -40,16 +73,14 @@ export const UnitProductPostBodyBodyFlavour = {
|
|
|
40
73
|
Project Tier subscriptions have built-in allowances and Limits so you must not provide values for these for these products
|
|
41
74
|
*/
|
|
42
75
|
export type UnitProductPostBodyBodyType =
|
|
43
|
-
|
|
44
|
-
| "DATA_MANAGER_STORAGE_SUBSCRIPTION";
|
|
76
|
+
typeof UnitProductPostBodyBodyType[keyof typeof UnitProductPostBodyBodyType];
|
|
45
77
|
|
|
46
78
|
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
47
79
|
export const UnitProductPostBodyBodyType = {
|
|
48
80
|
DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION:
|
|
49
|
-
"DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION"
|
|
50
|
-
DATA_MANAGER_STORAGE_SUBSCRIPTION:
|
|
51
|
-
|
|
52
|
-
};
|
|
81
|
+
"DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION",
|
|
82
|
+
DATA_MANAGER_STORAGE_SUBSCRIPTION: "DATA_MANAGER_STORAGE_SUBSCRIPTION",
|
|
83
|
+
} as const;
|
|
53
84
|
|
|
54
85
|
export type UnitProductPostBodyBody = {
|
|
55
86
|
/** The name you want to give the Product */
|
|
@@ -82,6 +113,33 @@ export type OrganisationPostBodyBody = {
|
|
|
82
113
|
owner: string;
|
|
83
114
|
};
|
|
84
115
|
|
|
116
|
+
export type AssetPostBodyBodyScope =
|
|
117
|
+
typeof AssetPostBodyBodyScope[keyof typeof AssetPostBodyBodyScope];
|
|
118
|
+
|
|
119
|
+
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
120
|
+
export const AssetPostBodyBodyScope = {
|
|
121
|
+
USER: "USER",
|
|
122
|
+
PRODUCT: "PRODUCT",
|
|
123
|
+
UNIT: "UNIT",
|
|
124
|
+
ORGANISATION: "ORGANISATION",
|
|
125
|
+
} as const;
|
|
126
|
+
|
|
127
|
+
export type AssetPostBodyBody = {
|
|
128
|
+
/** 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 */
|
|
129
|
+
name: string;
|
|
130
|
+
/** A file containing the content for the asset. You must provide a value here or in content_string */
|
|
131
|
+
content_file?: Blob;
|
|
132
|
+
/** The textual content of the asset. You must provide a value here or in content_file */
|
|
133
|
+
content_string?: string;
|
|
134
|
+
scope: AssetPostBodyBodyScope;
|
|
135
|
+
/** 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 */
|
|
136
|
+
scope_id?: string;
|
|
137
|
+
/** Is this a secret asset? */
|
|
138
|
+
secret: boolean;
|
|
139
|
+
/** An optional description for the Asset */
|
|
140
|
+
description?: string;
|
|
141
|
+
};
|
|
142
|
+
|
|
85
143
|
export interface UserDetail {
|
|
86
144
|
/** The user identity (username) */
|
|
87
145
|
id: string;
|
|
@@ -109,26 +167,31 @@ export interface UnitDetail {
|
|
|
109
167
|
/**
|
|
110
168
|
* The kind of Service
|
|
111
169
|
*/
|
|
112
|
-
export type
|
|
170
|
+
export type MerchantDetailKind =
|
|
171
|
+
typeof MerchantDetailKind[keyof typeof MerchantDetailKind];
|
|
113
172
|
|
|
114
173
|
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
115
|
-
export const
|
|
116
|
-
DATA_MANAGER: "DATA_MANAGER"
|
|
117
|
-
};
|
|
174
|
+
export const MerchantDetailKind = {
|
|
175
|
+
DATA_MANAGER: "DATA_MANAGER",
|
|
176
|
+
} as const;
|
|
118
177
|
|
|
119
|
-
export interface
|
|
178
|
+
export interface MerchantDetail {
|
|
120
179
|
/** The unique ID of the Service */
|
|
121
180
|
id: number;
|
|
122
181
|
/** The kind of Service */
|
|
123
|
-
kind:
|
|
182
|
+
kind: MerchantDetailKind;
|
|
124
183
|
/** The name assigned to the Service */
|
|
125
|
-
name
|
|
184
|
+
name: string;
|
|
185
|
+
/** The hostname used by the Service */
|
|
186
|
+
api_hostname: string;
|
|
126
187
|
}
|
|
127
188
|
|
|
128
|
-
export
|
|
129
|
-
|
|
189
|
+
export type MerchantGetResponse = MerchantDetail;
|
|
190
|
+
|
|
191
|
+
export interface MerchantsGetResponse {
|
|
192
|
+
/** The list of known Merchants
|
|
130
193
|
*/
|
|
131
|
-
|
|
194
|
+
merchants: MerchantDetail[];
|
|
132
195
|
}
|
|
133
196
|
|
|
134
197
|
export interface OrganisationDetail {
|
|
@@ -144,13 +207,24 @@ export interface OrganisationDetail {
|
|
|
144
207
|
private: boolean;
|
|
145
208
|
}
|
|
146
209
|
|
|
210
|
+
/**
|
|
211
|
+
* The kind of service that can use the Product
|
|
212
|
+
*/
|
|
213
|
+
export type ProductTypeServiceKind =
|
|
214
|
+
typeof ProductTypeServiceKind[keyof typeof ProductTypeServiceKind];
|
|
215
|
+
|
|
216
|
+
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
217
|
+
export const ProductTypeServiceKind = {
|
|
218
|
+
DATA_MANAGER: "DATA_MANAGER",
|
|
219
|
+
} as const;
|
|
220
|
+
|
|
147
221
|
export interface ProductType {
|
|
148
222
|
/** A product type, this is a unique string amongst all types known to the Account Server */
|
|
149
223
|
type: string;
|
|
150
224
|
/** A product flavour. Not all types have a flavour, those that do have a type-specific flavour string */
|
|
151
225
|
flavour?: string;
|
|
152
|
-
/**
|
|
153
|
-
|
|
226
|
+
/** The kind of service that can use the Product */
|
|
227
|
+
service_kind?: ProductTypeServiceKind;
|
|
154
228
|
}
|
|
155
229
|
|
|
156
230
|
export type ProductInstanceDetailCoins = {
|
|
@@ -167,31 +241,30 @@ export interface ProductInstanceDetail {
|
|
|
167
241
|
* The Product Type falvour. Not all products have flavours
|
|
168
242
|
|
|
169
243
|
*/
|
|
170
|
-
export type ProductDetailFlavour =
|
|
244
|
+
export type ProductDetailFlavour =
|
|
245
|
+
typeof ProductDetailFlavour[keyof typeof ProductDetailFlavour];
|
|
171
246
|
|
|
172
247
|
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
173
248
|
export const ProductDetailFlavour = {
|
|
174
|
-
EVALUATION: "EVALUATION"
|
|
175
|
-
BRONZE: "BRONZE"
|
|
176
|
-
SILVER: "SILVER"
|
|
177
|
-
GOLD: "GOLD"
|
|
178
|
-
};
|
|
249
|
+
EVALUATION: "EVALUATION",
|
|
250
|
+
BRONZE: "BRONZE",
|
|
251
|
+
SILVER: "SILVER",
|
|
252
|
+
GOLD: "GOLD",
|
|
253
|
+
} as const;
|
|
179
254
|
|
|
180
255
|
/**
|
|
181
256
|
* The Product Type
|
|
182
257
|
|
|
183
258
|
*/
|
|
184
259
|
export type ProductDetailType =
|
|
185
|
-
|
|
186
|
-
| "DATA_MANAGER_STORAGE_SUBSCRIPTION";
|
|
260
|
+
typeof ProductDetailType[keyof typeof ProductDetailType];
|
|
187
261
|
|
|
188
262
|
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
189
263
|
export const ProductDetailType = {
|
|
190
264
|
DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION:
|
|
191
|
-
"DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION"
|
|
192
|
-
DATA_MANAGER_STORAGE_SUBSCRIPTION:
|
|
193
|
-
|
|
194
|
-
};
|
|
265
|
+
"DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION",
|
|
266
|
+
DATA_MANAGER_STORAGE_SUBSCRIPTION: "DATA_MANAGER_STORAGE_SUBSCRIPTION",
|
|
267
|
+
} as const;
|
|
195
268
|
|
|
196
269
|
export interface ProductDetail {
|
|
197
270
|
/** The Product ID
|
|
@@ -284,17 +357,41 @@ export interface ProductDmStorage {
|
|
|
284
357
|
coins: ProductCoinsDetail;
|
|
285
358
|
}
|
|
286
359
|
|
|
287
|
-
export type
|
|
360
|
+
export type AssetDetailScope =
|
|
361
|
+
typeof AssetDetailScope[keyof typeof AssetDetailScope];
|
|
288
362
|
|
|
289
|
-
|
|
290
|
-
|
|
363
|
+
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
364
|
+
export const AssetDetailScope = {
|
|
365
|
+
USER: "USER",
|
|
366
|
+
PRODUCT: "PRODUCT",
|
|
367
|
+
UNIT: "UNIT",
|
|
368
|
+
ORGANISATION: "ORGANISATION",
|
|
369
|
+
} as const;
|
|
370
|
+
|
|
371
|
+
export interface AssetDetail {
|
|
372
|
+
creator: string;
|
|
291
373
|
id: string;
|
|
292
|
-
/** The Unit's name */
|
|
293
374
|
name: string;
|
|
294
|
-
|
|
295
|
-
|
|
375
|
+
scope: AssetDetailScope;
|
|
376
|
+
scope_id: string;
|
|
377
|
+
secret: boolean;
|
|
378
|
+
disabled: boolean;
|
|
379
|
+
content: string;
|
|
380
|
+
created: string;
|
|
381
|
+
description?: string;
|
|
382
|
+
merchants: MerchantDetail[];
|
|
296
383
|
}
|
|
297
384
|
|
|
385
|
+
export type UserAccountGetResponse = UserAccountDetail;
|
|
386
|
+
|
|
387
|
+
export interface UnitsGetResponse {
|
|
388
|
+
/** A list of Units
|
|
389
|
+
*/
|
|
390
|
+
units: OrganisationUnitsGetResponse[];
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
export type UnitGetResponse = UnitDetail;
|
|
394
|
+
|
|
298
395
|
export interface UnitProductPostResponse {
|
|
299
396
|
/** The Products's unique ID */
|
|
300
397
|
id: string;
|
|
@@ -338,12 +435,6 @@ export interface OrganisationUnitsGetResponse {
|
|
|
338
435
|
units: UnitDetail[];
|
|
339
436
|
}
|
|
340
437
|
|
|
341
|
-
export interface UnitsGetResponse {
|
|
342
|
-
/** A list of Units
|
|
343
|
-
*/
|
|
344
|
-
units: OrganisationUnitsGetResponse[];
|
|
345
|
-
}
|
|
346
|
-
|
|
347
438
|
export interface PersonalUnitPutResponse {
|
|
348
439
|
/** The unit's Organisation. Used to identify the Default organisation */
|
|
349
440
|
organisation_id: string;
|
|
@@ -389,6 +480,18 @@ export interface StateGetVersionResponse {
|
|
|
389
480
|
version: string;
|
|
390
481
|
}
|
|
391
482
|
|
|
483
|
+
export interface AssetPostResponse {
|
|
484
|
+
/** The Asset ID
|
|
485
|
+
*/
|
|
486
|
+
id: string;
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
export interface AssetGetResponse {
|
|
490
|
+
/** A list of Assets
|
|
491
|
+
*/
|
|
492
|
+
assets: AssetDetail[];
|
|
493
|
+
}
|
|
494
|
+
|
|
392
495
|
export interface AsError {
|
|
393
496
|
/** Brief error text that can be presented to the user */
|
|
394
497
|
error: string;
|