@squonk/account-server-client 2.0.4 → 2.0.5-rc.2
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/admin/admin.cjs.map +1 -1
- package/admin/admin.d.ts +3 -3
- package/admin/admin.js.map +1 -1
- package/asset/asset.cjs.map +1 -1
- package/asset/asset.d.ts +13 -7
- package/asset/asset.js.map +1 -1
- package/{custom-instance-8a11f2d1.d.ts → custom-instance-f32f6506.d.ts} +3 -1
- package/index.cjs.map +1 -1
- package/index.d.ts +1 -1
- package/index.js.map +1 -1
- package/merchant/merchant.cjs.map +1 -1
- package/merchant/merchant.d.ts +5 -3
- package/merchant/merchant.js.map +1 -1
- package/organisation/organisation.cjs.map +1 -1
- package/organisation/organisation.d.ts +16 -10
- package/organisation/organisation.js.map +1 -1
- package/package.json +1 -1
- package/product/product.cjs.map +1 -1
- package/product/product.d.ts +19 -11
- package/product/product.js.map +1 -1
- package/src/account-server-api.schemas.ts +3 -1
- package/src/admin/admin.ts +3 -3
- package/src/asset/asset.ts +13 -7
- package/src/merchant/merchant.ts +5 -3
- package/src/organisation/organisation.ts +16 -10
- package/src/product/product.ts +19 -11
- package/src/state/state.ts +1 -1
- package/src/unit/unit.ts +17 -12
- package/src/user/user.ts +18 -10
- package/state/state.cjs.map +1 -1
- package/state/state.d.ts +1 -1
- package/state/state.js.map +1 -1
- package/unit/unit.cjs.map +1 -1
- package/unit/unit.d.ts +17 -12
- package/unit/unit.js.map +1 -1
- package/user/user.cjs.map +1 -1
- package/user/user.d.ts +18 -10
- package/user/user.js.map +1 -1
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Account Server API
|
|
5
5
|
* The Informatics Matters Account Server API.
|
|
6
6
|
|
|
7
|
-
A service that provides access to the Account Server, which gives *registered* users access to and management of **
|
|
7
|
+
A service that provides access to the Account Server, which gives *registered* users access to and management of **Organisations**, **Units**, **Products**, **Users**, and **Assets**.
|
|
8
8
|
|
|
9
9
|
* OpenAPI spec version: 2.0
|
|
10
10
|
*/
|
|
@@ -40,7 +40,7 @@ type SecondParameter<T extends (...args: any) => any> = T extends (
|
|
|
40
40
|
: never;
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
|
-
* Gets all the Organisations that you are a member of or are public. Admin users are members of all
|
|
43
|
+
* Gets all the Organisations that you are a member of or are public. Admin users are members of all Organisations
|
|
44
44
|
|
|
45
45
|
* @summary Gets Organisations
|
|
46
46
|
*/
|
|
@@ -112,7 +112,7 @@ export const useGetOrganisations = <
|
|
|
112
112
|
/**
|
|
113
113
|
* Creates a new Organisation
|
|
114
114
|
|
|
115
|
-
You need
|
|
115
|
+
You need admin rights to use this method
|
|
116
116
|
|
|
117
117
|
* @summary Create a new organisation
|
|
118
118
|
*/
|
|
@@ -185,7 +185,9 @@ export const useCreateOrganisation = <
|
|
|
185
185
|
return useMutation(mutationOptions);
|
|
186
186
|
};
|
|
187
187
|
/**
|
|
188
|
-
* Gets a specific Organisation
|
|
188
|
+
* Gets a specific Organisation. To see the Organisation you need admin rights or need to be a member of the Organisation.
|
|
189
|
+
|
|
190
|
+
Members of an Organisation's **Unit** do not necessarily have access to the Organisation.
|
|
189
191
|
|
|
190
192
|
* @summary Gets an Organisation
|
|
191
193
|
*/
|
|
@@ -263,7 +265,7 @@ export const useGetOrganisation = <
|
|
|
263
265
|
};
|
|
264
266
|
|
|
265
267
|
/**
|
|
266
|
-
* Used to update existing
|
|
268
|
+
* Used to update existing Organisation.
|
|
267
269
|
|
|
268
270
|
You have to be the Organisation owner (or an administrator) to patch an Organisation.
|
|
269
271
|
|
|
@@ -339,9 +341,9 @@ export const usePatchOrganisation = <
|
|
|
339
341
|
return useMutation(mutationOptions);
|
|
340
342
|
};
|
|
341
343
|
/**
|
|
342
|
-
* Units must
|
|
344
|
+
* Before an Organisation can be deleted all its underlying **Units** must also be deleted, remembering that **Units** that have undeleted **Products** cannot be deleted.
|
|
343
345
|
|
|
344
|
-
You need
|
|
346
|
+
You need admin rights to use this method
|
|
345
347
|
|
|
346
348
|
* @summary Deletes an Organisation
|
|
347
349
|
*/
|
|
@@ -409,7 +411,9 @@ export const useDeleteOrganisation = <
|
|
|
409
411
|
return useMutation(mutationOptions);
|
|
410
412
|
};
|
|
411
413
|
/**
|
|
412
|
-
* Gets a Organisation charges.
|
|
414
|
+
* Gets a Organisation charges.
|
|
415
|
+
|
|
416
|
+
The Organisation cannot be the **Default Organisation** and you need to be a member of the Organisation to use this endpoint
|
|
413
417
|
|
|
414
418
|
* @summary Gets charges for all Units in an Organisation
|
|
415
419
|
*/
|
|
@@ -498,9 +502,11 @@ export const useGetOrganisationCharges = <
|
|
|
498
502
|
};
|
|
499
503
|
|
|
500
504
|
/**
|
|
501
|
-
* Gets the built-in
|
|
505
|
+
* Gets the Default Organisation, a built-in Organisation used exclusively for **Personal Units**.
|
|
506
|
+
|
|
507
|
+
Any authorised user can see the Default Organisation.
|
|
502
508
|
|
|
503
|
-
* @summary Gets the
|
|
509
|
+
* @summary Gets the Default Organisation
|
|
504
510
|
*/
|
|
505
511
|
export const getDefaultOrganisation = (
|
|
506
512
|
options?: SecondParameter<typeof customInstance>,
|
package/src/product/product.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Account Server API
|
|
5
5
|
* The Informatics Matters Account Server API.
|
|
6
6
|
|
|
7
|
-
A service that provides access to the Account Server, which gives *registered* users access to and management of **
|
|
7
|
+
A service that provides access to the Account Server, which gives *registered* users access to and management of **Organisations**, **Units**, **Products**, **Users**, and **Assets**.
|
|
8
8
|
|
|
9
9
|
* OpenAPI spec version: 2.0
|
|
10
10
|
*/
|
|
@@ -41,7 +41,7 @@ type SecondParameter<T extends (...args: any) => any> = T extends (
|
|
|
41
41
|
: never;
|
|
42
42
|
|
|
43
43
|
/**
|
|
44
|
-
* Gets
|
|
44
|
+
* Gets Product Types you can purchase (subscribe to)
|
|
45
45
|
|
|
46
46
|
* @summary Gets all Product Types
|
|
47
47
|
*/
|
|
@@ -111,6 +111,8 @@ export const useGetProductTypes = <
|
|
|
111
111
|
};
|
|
112
112
|
|
|
113
113
|
/**
|
|
114
|
+
* The storage cost is returned along with its measurement units, typically a Coin value based on the the peak storage that was measured on each billable day.
|
|
115
|
+
|
|
114
116
|
* @summary Gets the default cross-product storage cost
|
|
115
117
|
*/
|
|
116
118
|
export const getProductDefaultStorageCost = (
|
|
@@ -181,7 +183,7 @@ export const useGetProductDefaultStorageCost = <
|
|
|
181
183
|
};
|
|
182
184
|
|
|
183
185
|
/**
|
|
184
|
-
* Gets
|
|
186
|
+
* Gets Products you have access to, across all **Units** and **Organisations**
|
|
185
187
|
|
|
186
188
|
* @summary Gets all Products
|
|
187
189
|
*/
|
|
@@ -249,7 +251,7 @@ export const useGetProducts = <
|
|
|
249
251
|
};
|
|
250
252
|
|
|
251
253
|
/**
|
|
252
|
-
* Gets
|
|
254
|
+
* Gets Products you have access to based on an **Organisation**
|
|
253
255
|
|
|
254
256
|
* @summary Gets Products for an Organisation
|
|
255
257
|
*/
|
|
@@ -335,7 +337,9 @@ export const useGetProductsForOrganisation = <
|
|
|
335
337
|
|
|
336
338
|
Typical subscriptions include `DATA_MANAGER_STORAGE_SUBSCRIPTION` and `DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION`.
|
|
337
339
|
|
|
338
|
-
Some subscriptions, like the `DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION` are available
|
|
340
|
+
Some subscriptions, like the `DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION` are available in various **flavours** that influence their capabilities. Flavours are typically referred to using the names `BRONZE`, `SILVER` and `GOLD`
|
|
341
|
+
|
|
342
|
+
To do this you need to be a member of the **Unit** or the **Organisation**.
|
|
339
343
|
|
|
340
344
|
* @summary Creates a Product for an Organisational Unit
|
|
341
345
|
*/
|
|
@@ -409,7 +413,7 @@ export const useCreateUnitProduct = <
|
|
|
409
413
|
return useMutation(mutationOptions);
|
|
410
414
|
};
|
|
411
415
|
/**
|
|
412
|
-
* Gets products you have access to based on an Organisational Unit
|
|
416
|
+
* Gets products you have access to based on an Organisational **Unit**
|
|
413
417
|
|
|
414
418
|
* @summary Gets Products for an Organisational Unit
|
|
415
419
|
*/
|
|
@@ -488,7 +492,7 @@ export const useGetProductsForUnit = <
|
|
|
488
492
|
};
|
|
489
493
|
|
|
490
494
|
/**
|
|
491
|
-
* Gets a Product
|
|
495
|
+
* Gets details of a specific Product that you have access to.
|
|
492
496
|
|
|
493
497
|
* @summary Gets a Product
|
|
494
498
|
*/
|
|
@@ -564,6 +568,8 @@ export const useGetProduct = <
|
|
|
564
568
|
};
|
|
565
569
|
|
|
566
570
|
/**
|
|
571
|
+
* You need access to the Product and, if the Product is *claimable* the claim must be removed before the Product can be removed. An example claimable Product is a `DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION` where the *claimable* commodity is a Data Manager **Project**. In this case you will need to delete the Data Manager **Project** before you can delete the Account Server **Product**.
|
|
572
|
+
|
|
567
573
|
* @summary Deletes an existing Product
|
|
568
574
|
*/
|
|
569
575
|
export const deleteProduct = (
|
|
@@ -630,7 +636,9 @@ export const useDeleteProduct = <
|
|
|
630
636
|
return useMutation(mutationOptions);
|
|
631
637
|
};
|
|
632
638
|
/**
|
|
633
|
-
* Used to update some adjustable parameters of a Product, i.e. to extend
|
|
639
|
+
* Used to update some adjustable parameters of a Product, i.e. to extend its **Allowance** or **Limit**.
|
|
640
|
+
|
|
641
|
+
At the moment we only support Products associated with the Data Manager, and these can be patched by changing the `name`, its coin `allowance` or `limit`
|
|
634
642
|
|
|
635
643
|
* @summary Adjust an existing Product
|
|
636
644
|
*/
|
|
@@ -704,11 +712,11 @@ export const usePatchProduct = <
|
|
|
704
712
|
return useMutation(mutationOptions);
|
|
705
713
|
};
|
|
706
714
|
/**
|
|
707
|
-
* Get the charges made against a
|
|
715
|
+
* Get the charges made against a Product with optional **from** (inclusive) and **until** (exclusive) dates. If no dates are provided, the charges for the current billing period are returned.
|
|
708
716
|
|
|
709
|
-
Dates are interpreted using the Python dateutil parser so the input strings are extremely flexible,
|
|
717
|
+
Dates are interpreted using the Python `dateutil` parser, so the input strings are extremely flexible with, for example, `1 December 2021` as an acceptable input.
|
|
710
718
|
|
|
711
|
-
**
|
|
719
|
+
**From** must be a date (day) prior to **until**. For example, to see the charges for the 11th July 2022 set **from** to `11 July 2022` and **until** to `12 July 2022`. As an alternative to **From** and **Until** you can provide a **Prior Billing Period**, a value that identifies the prior period to retrieve. A value of `-1` would indicate the *prior period* (month) with an oldest retrieval value of `-23` allowing you to obtain charges for up to two years.
|
|
712
720
|
|
|
713
721
|
You need to be part of the **Unit** or **Organisation** to use this method
|
|
714
722
|
* @summary Get charges made against a Product
|
package/src/state/state.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Account Server API
|
|
5
5
|
* The Informatics Matters Account Server API.
|
|
6
6
|
|
|
7
|
-
A service that provides access to the Account Server, which gives *registered* users access to and management of **
|
|
7
|
+
A service that provides access to the Account Server, which gives *registered* users access to and management of **Organisations**, **Units**, **Products**, **Users**, and **Assets**.
|
|
8
8
|
|
|
9
9
|
* OpenAPI spec version: 2.0
|
|
10
10
|
*/
|
package/src/unit/unit.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Account Server API
|
|
5
5
|
* The Informatics Matters Account Server API.
|
|
6
6
|
|
|
7
|
-
A service that provides access to the Account Server, which gives *registered* users access to and management of **
|
|
7
|
+
A service that provides access to the Account Server, which gives *registered* users access to and management of **Organisations**, **Units**, **Products**, **Users**, and **Assets**.
|
|
8
8
|
|
|
9
9
|
* OpenAPI spec version: 2.0
|
|
10
10
|
*/
|
|
@@ -121,7 +121,7 @@ export const useGetOrganisationUnits = <
|
|
|
121
121
|
};
|
|
122
122
|
|
|
123
123
|
/**
|
|
124
|
-
* Creates a new
|
|
124
|
+
* Creates a new Organisation Unit. You need to be a member of the **Organisation** or have administration rights to use this endpoint
|
|
125
125
|
|
|
126
126
|
* @summary Create a new Organisational Unit
|
|
127
127
|
*/
|
|
@@ -195,7 +195,7 @@ export const useCreateOrganisationUnit = <
|
|
|
195
195
|
return useMutation(mutationOptions);
|
|
196
196
|
};
|
|
197
197
|
/**
|
|
198
|
-
* Gets
|
|
198
|
+
* Gets a Unit, assuming it is public, you are a member of it or its **Organisation**. Admin users have access to all Units
|
|
199
199
|
|
|
200
200
|
* @summary Gets an Organisational Unit
|
|
201
201
|
*/
|
|
@@ -263,9 +263,9 @@ export const useGetUnit = <
|
|
|
263
263
|
};
|
|
264
264
|
|
|
265
265
|
/**
|
|
266
|
-
* Used to update existing
|
|
266
|
+
* Used to update existing Unit.
|
|
267
267
|
|
|
268
|
-
You have to be the Unit owner
|
|
268
|
+
You have to be the Unit owner, a member of its **Organisation** or an administrator to patch a Unit.
|
|
269
269
|
|
|
270
270
|
* @summary Adjust an existing Unit
|
|
271
271
|
*/
|
|
@@ -339,7 +339,11 @@ export const usePatchUnit = <
|
|
|
339
339
|
return useMutation(mutationOptions);
|
|
340
340
|
};
|
|
341
341
|
/**
|
|
342
|
-
* Deletes an Organisational Unit you have access to. Units can only be deleted by Organisation users or
|
|
342
|
+
* Deletes an Organisational Unit you have access to. Units can only be deleted by members of the Unit, its Organisation users or admin users.
|
|
343
|
+
|
|
344
|
+
You cannot delete Units in the **Default Organisation**. These Units are **Personal Units** and need to be deleted using the `DELETE /unit` endpoint.
|
|
345
|
+
|
|
346
|
+
You cannot delete a Unit that contains undeleted **Products**
|
|
343
347
|
|
|
344
348
|
* @summary Deletes an Organisational Unit
|
|
345
349
|
*/
|
|
@@ -407,7 +411,7 @@ export const useDeleteOrganisationUnit = <
|
|
|
407
411
|
return useMutation(mutationOptions);
|
|
408
412
|
};
|
|
409
413
|
/**
|
|
410
|
-
* Gets all the Units that are public or you are a member of. Admin users can see all Units
|
|
414
|
+
* Gets all the Units that are public or you are a member of. Admin users can see all Units.
|
|
411
415
|
|
|
412
416
|
* @summary Gets Units
|
|
413
417
|
*/
|
|
@@ -467,7 +471,9 @@ export const useGetUnits = <
|
|
|
467
471
|
};
|
|
468
472
|
|
|
469
473
|
/**
|
|
470
|
-
* Creates a
|
|
474
|
+
* Creates a Personal Unit for a User. The unit will belong to the built-in **Default Organisation**.
|
|
475
|
+
|
|
476
|
+
Users can only create one Personal unit and you cannot add other Users to a Personal Unit.
|
|
471
477
|
|
|
472
478
|
* @summary Create a new Personal Unit
|
|
473
479
|
*/
|
|
@@ -540,7 +546,7 @@ export const useCreateDefaultUnit = <
|
|
|
540
546
|
return useMutation(mutationOptions);
|
|
541
547
|
};
|
|
542
548
|
/**
|
|
543
|
-
* Deletes a
|
|
549
|
+
* Deletes a Personal Unit. The Unit is *your* Unit, and belongs to the **Default Organisation**
|
|
544
550
|
|
|
545
551
|
* @summary Deletes a Personal Unit
|
|
546
552
|
*/
|
|
@@ -605,10 +611,9 @@ export const useDeleteDefaultUnit = <
|
|
|
605
611
|
};
|
|
606
612
|
/**
|
|
607
613
|
* Get the charges made against a Unit with optional **from** (inclusive) and **until** (exclusive) dates. If no dates are provided, the charges for the current billing period are returned.
|
|
614
|
+
Dates are interpreted using the Python `dateutil` parser, so the input strings are extremely flexible with, for example, `1 December 2021` as an acceptable input.
|
|
608
615
|
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
**from** must be a date (day) prior to **until**. For example, to see the charges for the 11th July 2022 set **from** to `11 July 2022` and **until** to `12 July 2022`. As an alternative to **From** and **Until** you can provide a **Prior Billing Period**, a value that identifies the prior period to retrieve. A value of `-1` would indicate the *prior period* (month) with an oldest retrieval value of `-23` (approximately two years).
|
|
616
|
+
**From** must be a date (day) prior to **until**. For example, to see the charges for the 11th July 2022 set **from** to `11 July 2022` and **until** to `12 July 2022`. As an alternative to **From** and **Until** you can provide a **Prior Billing Period**, a value that identifies the prior period to retrieve. A value of `-1` would indicate the *prior period* (month) with an oldest retrieval value of `-23` allowing you to obtain charges for up to two years.
|
|
612
617
|
|
|
613
618
|
You need to be part of the **Unit** or **Organisation** to use this method
|
|
614
619
|
* @summary Get charges made against a Unit
|
package/src/user/user.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Account Server API
|
|
5
5
|
* The Informatics Matters Account Server API.
|
|
6
6
|
|
|
7
|
-
A service that provides access to the Account Server, which gives *registered* users access to and management of **
|
|
7
|
+
A service that provides access to the Account Server, which gives *registered* users access to and management of **Organisations**, **Units**, **Products**, **Users**, and **Assets**.
|
|
8
8
|
|
|
9
9
|
* OpenAPI spec version: 2.0
|
|
10
10
|
*/
|
|
@@ -104,9 +104,11 @@ export const useGetUserAccount = <
|
|
|
104
104
|
};
|
|
105
105
|
|
|
106
106
|
/**
|
|
107
|
-
* Gets
|
|
107
|
+
* Gets Users in an Organisation.
|
|
108
108
|
|
|
109
|
-
|
|
109
|
+
You have to be a member of the Organisation or an admin user to use this endpoint
|
|
110
|
+
|
|
111
|
+
* @summary Gets users in an Organisation
|
|
110
112
|
*/
|
|
111
113
|
export const getOrganisationUsers = (
|
|
112
114
|
orgId: string,
|
|
@@ -183,9 +185,11 @@ export const useGetOrganisationUsers = <
|
|
|
183
185
|
};
|
|
184
186
|
|
|
185
187
|
/**
|
|
186
|
-
* Adds a
|
|
188
|
+
* Adds a User to an **Organisation**.
|
|
189
|
+
|
|
190
|
+
You have to be in the Organisation or an admin user to use this endpoint
|
|
187
191
|
|
|
188
|
-
* @summary Adds a
|
|
192
|
+
* @summary Adds a User to an Organisation
|
|
189
193
|
*/
|
|
190
194
|
export const addOrganisationUser = (
|
|
191
195
|
orgId: string,
|
|
@@ -252,9 +256,11 @@ export const useAddOrganisationUser = <
|
|
|
252
256
|
return useMutation(mutationOptions);
|
|
253
257
|
};
|
|
254
258
|
/**
|
|
255
|
-
* Removes a
|
|
259
|
+
* Removes a User from an **Organisation**.
|
|
260
|
+
|
|
261
|
+
You have to be in the Organisation or an admin user to use this endpoint
|
|
256
262
|
|
|
257
|
-
* @summary Deletes a
|
|
263
|
+
* @summary Deletes a User from an Organisation
|
|
258
264
|
*/
|
|
259
265
|
export const deleteOrganisationUser = (
|
|
260
266
|
orgId: string,
|
|
@@ -321,7 +327,9 @@ export const useDeleteOrganisationUser = <
|
|
|
321
327
|
return useMutation(mutationOptions);
|
|
322
328
|
};
|
|
323
329
|
/**
|
|
324
|
-
* Gets users in an Organisational Unit.
|
|
330
|
+
* Gets users in an Organisational Unit.
|
|
331
|
+
|
|
332
|
+
You have to be in the Organisation or Unit or an Admin user to use this endpoint
|
|
325
333
|
|
|
326
334
|
* @summary Gets users in an Organisational Unit
|
|
327
335
|
*/
|
|
@@ -473,13 +481,13 @@ export const useAddOrganisationUnitUser = <
|
|
|
473
481
|
return useMutation(mutationOptions);
|
|
474
482
|
};
|
|
475
483
|
/**
|
|
476
|
-
* Removes a
|
|
484
|
+
* Removes a User from an Organisational Unit.
|
|
477
485
|
|
|
478
486
|
Users cannot be removed from **Personal Units** (Units that are part of the ***Default** Organisation).
|
|
479
487
|
|
|
480
488
|
You have to be in the Organisation or Unit or an Admin user to use this endpoint
|
|
481
489
|
|
|
482
|
-
* @summary Deletes a
|
|
490
|
+
* @summary Deletes a User from an Organisational Unit
|
|
483
491
|
*/
|
|
484
492
|
export const deleteOrganisationUnitUser = (
|
|
485
493
|
unitId: string,
|
package/state/state.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/state/state.ts"],"names":[],"mappings":";;;;;AAUA,SAAS,gBAAgB;AAyBlB,IAAM,aAAa,CACxB,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,YAAY,QAAQ,OAAO,OAAO;AAAA,IACzC;AAAA,EACF;AACF;AAEO,IAAM,wBAAwB,MAAM,CAAC,sBAAsB,UAAU;AAErE,IAAM,4BAA4B,CAGvC,YASG;AACH,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YAAW,6CAAc,aAAY,sBAAsB;AAEjE,QAAM,UAAiE,CAAC;AAAA,IACtE;AAAA,EACF,MAAM,WAAW,gBAAgB,MAAM;AAEvC,SAAO,EAAE,UAAU,SAAS,GAAG,aAAa;AAC9C;AAOO,IAAM,gBAAgB,CAG3B,YAO4D;AAC5D,QAAM,eAAe,0BAA0B,OAAO;AAEtD,QAAM,QAAQ,SAAS,YAAY;AAInC,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT","sourcesContent":["/**\n * Generated by orval v6.15.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 **
|
|
1
|
+
{"version":3,"sources":["../../src/state/state.ts"],"names":[],"mappings":";;;;;AAUA,SAAS,gBAAgB;AAyBlB,IAAM,aAAa,CACxB,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,YAAY,QAAQ,OAAO,OAAO;AAAA,IACzC;AAAA,EACF;AACF;AAEO,IAAM,wBAAwB,MAAM,CAAC,sBAAsB,UAAU;AAErE,IAAM,4BAA4B,CAGvC,YASG;AACH,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YAAW,6CAAc,aAAY,sBAAsB;AAEjE,QAAM,UAAiE,CAAC;AAAA,IACtE;AAAA,EACF,MAAM,WAAW,gBAAgB,MAAM;AAEvC,SAAO,EAAE,UAAU,SAAS,GAAG,aAAa;AAC9C;AAOO,IAAM,gBAAgB,CAG3B,YAO4D;AAC5D,QAAM,eAAe,0BAA0B,OAAO;AAEtD,QAAM,QAAQ,SAAS,YAAY;AAInC,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT","sourcesContent":["/**\n * Generated by orval v6.15.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 **Organisations**, **Units**, **Products**, **Users**, and **Assets**.\n\n * OpenAPI spec version: 2.0\n */\nimport { useQuery } from \"@tanstack/react-query\";\nimport type {\n UseQueryOptions,\n QueryFunction,\n UseQueryResult,\n QueryKey,\n} from \"@tanstack/react-query\";\nimport type {\n StateGetVersionResponse,\n AsError,\n} from \"../account-server-api.schemas\";\nimport { customInstance } from \".././custom-instance\";\nimport type { ErrorType } from \".././custom-instance\";\n\n// eslint-disable-next-line\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 * @summary Gets the Account Server version\n */\nexport const getVersion = (\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<StateGetVersionResponse>(\n { url: `/version`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetVersionQueryKey = () => [\"account-server-api\", `/version`] as const;\n\nexport const getGetVersionQueryOptions = <\n TData = Awaited<ReturnType<typeof getVersion>>,\n TError = ErrorType<AsError | void>\n>(options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getVersion>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryOptions<Awaited<ReturnType<typeof getVersion>>, TError, TData> & {\n queryKey: QueryKey;\n} => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetVersionQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getVersion>>> = ({\n signal,\n }) => getVersion(requestOptions, signal);\n\n return { queryKey, queryFn, ...queryOptions };\n};\n\nexport type GetVersionQueryResult = NonNullable<\n Awaited<ReturnType<typeof getVersion>>\n>;\nexport type GetVersionQueryError = ErrorType<AsError | void>;\n\nexport const useGetVersion = <\n TData = Awaited<ReturnType<typeof getVersion>>,\n TError = ErrorType<AsError | void>\n>(options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getVersion>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetVersionQueryOptions(options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n"]}
|
package/state/state.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UseQueryOptions, QueryKey, UseQueryResult } from '@tanstack/react-query';
|
|
2
|
-
import { aE as customInstance, aw as StateGetVersionResponse, aF as ErrorType, aA as AsError } from '../custom-instance-
|
|
2
|
+
import { aE as customInstance, aw as StateGetVersionResponse, aF as ErrorType, aA as AsError } from '../custom-instance-f32f6506.js';
|
|
3
3
|
import 'axios';
|
|
4
4
|
|
|
5
5
|
type SecondParameter<T extends (...args: any) => any> = T extends (config: any, args: infer P) => any ? P : never;
|
package/state/state.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/state/state.ts"],"sourcesContent":["/**\n * Generated by orval v6.15.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 **
|
|
1
|
+
{"version":3,"sources":["../../src/state/state.ts"],"sourcesContent":["/**\n * Generated by orval v6.15.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 **Organisations**, **Units**, **Products**, **Users**, and **Assets**.\n\n * OpenAPI spec version: 2.0\n */\nimport { useQuery } from \"@tanstack/react-query\";\nimport type {\n UseQueryOptions,\n QueryFunction,\n UseQueryResult,\n QueryKey,\n} from \"@tanstack/react-query\";\nimport type {\n StateGetVersionResponse,\n AsError,\n} from \"../account-server-api.schemas\";\nimport { customInstance } from \".././custom-instance\";\nimport type { ErrorType } from \".././custom-instance\";\n\n// eslint-disable-next-line\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 * @summary Gets the Account Server version\n */\nexport const getVersion = (\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<StateGetVersionResponse>(\n { url: `/version`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetVersionQueryKey = () => [\"account-server-api\", `/version`] as const;\n\nexport const getGetVersionQueryOptions = <\n TData = Awaited<ReturnType<typeof getVersion>>,\n TError = ErrorType<AsError | void>\n>(options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getVersion>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryOptions<Awaited<ReturnType<typeof getVersion>>, TError, TData> & {\n queryKey: QueryKey;\n} => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetVersionQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getVersion>>> = ({\n signal,\n }) => getVersion(requestOptions, signal);\n\n return { queryKey, queryFn, ...queryOptions };\n};\n\nexport type GetVersionQueryResult = NonNullable<\n Awaited<ReturnType<typeof getVersion>>\n>;\nexport type GetVersionQueryError = ErrorType<AsError | void>;\n\nexport const useGetVersion = <\n TData = Awaited<ReturnType<typeof getVersion>>,\n TError = ErrorType<AsError | void>\n>(options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getVersion>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetVersionQueryOptions(options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n"],"mappings":";;;;;AAUA,SAAS,gBAAgB;AAyBlB,IAAM,aAAa,CACxB,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,YAAY,QAAQ,OAAO,OAAO;AAAA,IACzC;AAAA,EACF;AACF;AAEO,IAAM,wBAAwB,MAAM,CAAC,sBAAsB,UAAU;AAErE,IAAM,4BAA4B,CAGvC,YASG;AACH,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QA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G;AACH,SAAO;AAAA,IACL,EAAE,KAAK,SAAS,kBAAkB,QAAQ,OAAO,QAAQ,OAAO;AAAA,IAChE;AAAA,EACF;AACF;AAEO,IAAM,4BAA4B,CACvC,QACA,WACG,CAAC,sBAAsB,SAAS,kBAAkB,GAAI,SAAS,CAAC,MAAM,IAAI,CAAC,CAAE;AAE3E,IAAM,gCAAgC,CAI3C,QACA,QACA,YAY4B;AAC5B,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YACJ,6CAAc,aAAY,0BAA0B,QAAQ,MAAM;AAEpE,QAAM,UAAqE,CAAC;AAAA,IAC1E;AAAA,EACF,MAAM,eAAe,QAAQ,QAAQ,gBAAgB,MAAM;AAE3D,SAAO,EAAE,UAAU,SAAS,SAAS,CAAC,CAAC,QAAQ,GAAG,aAAa;AACjE;AAOO,IAAM,oBAAoB,CAI/B,QACA,QACA,YAQ2D;AAC3D,QAAM,eAAe,8BAA8B,QAAQ,QAAQ,OAAO;AAE1E,QAAM,QAAQ,SAAS,YAAY;AAInC,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT","sourcesContent":["/**\n * Generated by orval v6.15.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: 2.0\n */\nimport { useQuery, useMutation } from \"@tanstack/react-query\";\nimport type {\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"@tanstack/react-query\";\nimport type {\n OrganisationUnitsGetResponse,\n AsError,\n OrganisationUnitPostResponse,\n OrganisationUnitPostBodyBody,\n UnitGetResponse,\n UnitPatchBodyBody,\n UnitsGetResponse,\n PersonalUnitPutResponse,\n PersonalUnitPutBodyBody,\n UnitChargesGetResponse,\n GetUnitChargesParams,\n} from \"../account-server-api.schemas\";\nimport { customInstance } from \".././custom-instance\";\nimport type { ErrorType } from \".././custom-instance\";\n\n// eslint-disable-next-line\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 Organisational Units you have access to or that are public\n\n * @summary Gets Organisational Units\n */\nexport const getOrganisationUnits = (\n orgId: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<OrganisationUnitsGetResponse>(\n { url: `/organisation/${orgId}/unit`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetOrganisationUnitsQueryKey = (orgId: string) =>\n [\"account-server-api\", `/organisation/${orgId}/unit`] as const;\n\nexport const getGetOrganisationUnitsQueryOptions = <\n TData = Awaited<ReturnType<typeof getOrganisationUnits>>,\n TError = ErrorType<void | AsError>\n>(\n orgId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationUnits>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationUnits>>,\n TError,\n TData\n> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetOrganisationUnitsQueryKey(orgId);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getOrganisationUnits>>\n > = ({ signal }) => getOrganisationUnits(orgId, requestOptions, signal);\n\n return { queryKey, queryFn, enabled: !!orgId, ...queryOptions };\n};\n\nexport type GetOrganisationUnitsQueryResult = NonNullable<\n Awaited<ReturnType<typeof getOrganisationUnits>>\n>;\nexport type GetOrganisationUnitsQueryError = ErrorType<void | AsError>;\n\nexport const useGetOrganisationUnits = <\n TData = Awaited<ReturnType<typeof getOrganisationUnits>>,\n TError = ErrorType<void | AsError>\n>(\n orgId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationUnits>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetOrganisationUnitsQueryOptions(orgId, options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n\n/**\n * Creates a new organisation unit. You need to be in the Organisation or an Admin user to use this endpoint\n\n * @summary Create a new Organisational Unit\n */\nexport const createOrganisationUnit = (\n orgId: string,\n organisationUnitPostBodyBody: OrganisationUnitPostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<OrganisationUnitPostResponse>(\n {\n url: `/organisation/${orgId}/unit`,\n method: \"post\",\n headers: { \"Content-Type\": \"application/json\" },\n data: organisationUnitPostBodyBody,\n },\n options\n );\n};\n\nexport const getCreateOrganisationUnitMutationOptions = <\n TError = ErrorType<AsError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createOrganisationUnit>>,\n TError,\n { orgId: string; data: OrganisationUnitPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof createOrganisationUnit>>,\n TError,\n { orgId: string; data: OrganisationUnitPostBodyBody },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof createOrganisationUnit>>,\n { orgId: string; data: OrganisationUnitPostBodyBody }\n > = (props) => {\n const { orgId, data } = props ?? {};\n\n return createOrganisationUnit(orgId, data, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type CreateOrganisationUnitMutationResult = NonNullable<\n Awaited<ReturnType<typeof createOrganisationUnit>>\n>;\nexport type CreateOrganisationUnitMutationBody = OrganisationUnitPostBodyBody;\nexport type CreateOrganisationUnitMutationError = ErrorType<AsError | void>;\n\nexport const useCreateOrganisationUnit = <\n TError = ErrorType<AsError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createOrganisationUnit>>,\n TError,\n { orgId: string; data: OrganisationUnitPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getCreateOrganisationUnitMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Gets the Unit, assuming you are a member of it or it is public. Admin users can see all Units\n\n * @summary Gets an Organisational Unit\n */\nexport const getUnit = (\n unitId: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<UnitGetResponse>(\n { url: `/unit/${unitId}`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetUnitQueryKey = (unitId: string) =>\n [\"account-server-api\", `/unit/${unitId}`] as const;\n\nexport const getGetUnitQueryOptions = <\n TData = Awaited<ReturnType<typeof getUnit>>,\n TError = ErrorType<void | AsError>\n>(\n unitId: string,\n options?: {\n query?: UseQueryOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData> & {\n queryKey: QueryKey;\n} => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUnitQueryKey(unitId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getUnit>>> = ({\n signal,\n }) => getUnit(unitId, requestOptions, signal);\n\n return { queryKey, queryFn, enabled: !!unitId, ...queryOptions };\n};\n\nexport type GetUnitQueryResult = NonNullable<\n Awaited<ReturnType<typeof getUnit>>\n>;\nexport type GetUnitQueryError = ErrorType<void | AsError>;\n\nexport const useGetUnit = <\n TData = Awaited<ReturnType<typeof getUnit>>,\n TError = ErrorType<void | AsError>\n>(\n unitId: string,\n options?: {\n query?: UseQueryOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetUnitQueryOptions(unitId, options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n\n/**\n * Used to update existing **Unit**.\n\nYou have to be the Unit owner (or an administrator) to patch a Unit.\n\n * @summary Adjust an existing Unit\n */\nexport const patchUnit = (\n unitId: string,\n unitPatchBodyBody: UnitPatchBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n {\n url: `/unit/${unitId}`,\n method: \"patch\",\n headers: { \"Content-Type\": \"application/json\" },\n data: unitPatchBodyBody,\n },\n options\n );\n};\n\nexport const getPatchUnitMutationOptions = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof patchUnit>>,\n TError,\n { unitId: string; data: UnitPatchBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof patchUnit>>,\n TError,\n { unitId: string; data: UnitPatchBodyBody },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof patchUnit>>,\n { unitId: string; data: UnitPatchBodyBody }\n > = (props) => {\n const { unitId, data } = props ?? {};\n\n return patchUnit(unitId, data, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type PatchUnitMutationResult = NonNullable<\n Awaited<ReturnType<typeof patchUnit>>\n>;\nexport type PatchUnitMutationBody = UnitPatchBodyBody;\nexport type PatchUnitMutationError = ErrorType<AsError>;\n\nexport const usePatchUnit = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof patchUnit>>,\n TError,\n { unitId: string; data: UnitPatchBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getPatchUnitMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Deletes an Organisational Unit you have access to. Units can only be deleted by Organisation users or Admin users. You cannot delete a Unit that contains Products\n\n * @summary Deletes an Organisational Unit\n */\nexport const deleteOrganisationUnit = (\n unitId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/unit/${unitId}`, method: \"delete\" },\n options\n );\n};\n\nexport const getDeleteOrganisationUnitMutationOptions = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteOrganisationUnit>>,\n TError,\n { unitId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof deleteOrganisationUnit>>,\n TError,\n { unitId: string },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteOrganisationUnit>>,\n { unitId: string }\n > = (props) => {\n const { unitId } = props ?? {};\n\n return deleteOrganisationUnit(unitId, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type DeleteOrganisationUnitMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteOrganisationUnit>>\n>;\n\nexport type DeleteOrganisationUnitMutationError = ErrorType<AsError>;\n\nexport const useDeleteOrganisationUnit = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteOrganisationUnit>>,\n TError,\n { unitId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getDeleteOrganisationUnitMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Gets all the Units that are public or you are a member of. Admin users can see all Units\n\n * @summary Gets Units\n */\nexport const getUnits = (\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<UnitsGetResponse>(\n { url: `/unit`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetUnitsQueryKey = () => [\"account-server-api\", `/unit`] as const;\n\nexport const getGetUnitsQueryOptions = <\n TData = Awaited<ReturnType<typeof getUnits>>,\n TError = ErrorType<void | AsError>\n>(options?: {\n query?: UseQueryOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData> & {\n queryKey: QueryKey;\n} => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUnitsQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getUnits>>> = ({\n signal,\n }) => getUnits(requestOptions, signal);\n\n return { queryKey, queryFn, ...queryOptions };\n};\n\nexport type GetUnitsQueryResult = NonNullable<\n Awaited<ReturnType<typeof getUnits>>\n>;\nexport type GetUnitsQueryError = ErrorType<void | AsError>;\n\nexport const useGetUnits = <\n TData = Awaited<ReturnType<typeof getUnits>>,\n TError = ErrorType<void | AsError>\n>(options?: {\n query?: UseQueryOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetUnitsQueryOptions(options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n\n/**\n * Creates a 'Personal' Unit for a User. The unit will belong to the built-in **Default** Organisation. Users can only have one Personal Unit and Personal Units cannot have other Users\n\n * @summary Create a new Personal Unit\n */\nexport const createDefaultUnit = (\n personalUnitPutBodyBody: PersonalUnitPutBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<PersonalUnitPutResponse>(\n {\n url: `/unit`,\n method: \"put\",\n headers: { \"Content-Type\": \"application/json\" },\n data: personalUnitPutBodyBody,\n },\n options\n );\n};\n\nexport const getCreateDefaultUnitMutationOptions = <\n TError = ErrorType<AsError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createDefaultUnit>>,\n TError,\n { data: PersonalUnitPutBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof createDefaultUnit>>,\n TError,\n { data: PersonalUnitPutBodyBody },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof createDefaultUnit>>,\n { data: PersonalUnitPutBodyBody }\n > = (props) => {\n const { data } = props ?? {};\n\n return createDefaultUnit(data, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type CreateDefaultUnitMutationResult = NonNullable<\n Awaited<ReturnType<typeof createDefaultUnit>>\n>;\nexport type CreateDefaultUnitMutationBody = PersonalUnitPutBodyBody;\nexport type CreateDefaultUnitMutationError = ErrorType<AsError | void>;\n\nexport const useCreateDefaultUnit = <\n TError = ErrorType<AsError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createDefaultUnit>>,\n TError,\n { data: PersonalUnitPutBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getCreateDefaultUnitMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Deletes a 'Personal' Unit. It must be your Unit, which belongs to the Default Organisation\n\n * @summary Deletes a Personal Unit\n */\nexport const deleteDefaultUnit = (\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>({ url: `/unit`, method: \"delete\" }, options);\n};\n\nexport const getDeleteDefaultUnitMutationOptions = <\n TError = ErrorType<AsError>,\n TVariables = void,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteDefaultUnit>>,\n TError,\n TVariables,\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof deleteDefaultUnit>>,\n TError,\n TVariables,\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteDefaultUnit>>,\n TVariables\n > = () => {\n return deleteDefaultUnit(requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type DeleteDefaultUnitMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteDefaultUnit>>\n>;\n\nexport type DeleteDefaultUnitMutationError = ErrorType<AsError>;\n\nexport const useDeleteDefaultUnit = <\n TError = ErrorType<AsError>,\n TVariables = void,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteDefaultUnit>>,\n TError,\n TVariables,\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getDeleteDefaultUnitMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Get the charges made against a Unit with optional **from** (inclusive) and **until** (exclusive) dates. If no dates are provided, the charges for the current billing period are returned.\n\nDates are interpreted using the Python dateutil parser so the input strings are extremely flexible, i.e. `1 December 2021` is an acceptable format.\n\n**from** must be a date (day) prior to **until**. For example, to see the charges for the 11th July 2022 set **from** to `11 July 2022` and **until** to `12 July 2022`. As an alternative to **From** and **Until** you can provide a **Prior Billing Period**, a value that identifies the prior period to retrieve. A value of `-1` would indicate the *prior period* (month) with an oldest retrieval value of `-23` (approximately two years).\n\nYou need to be part of the **Unit** or **Organisation** to use this method\n * @summary Get charges made against a Unit\n */\nexport const getUnitCharges = (\n unitId: string,\n params?: GetUnitChargesParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<UnitChargesGetResponse>(\n { url: `/unit/${unitId}/charges`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetUnitChargesQueryKey = (\n unitId: string,\n params?: GetUnitChargesParams\n) => [\"account-server-api\", `/unit/${unitId}/charges`, ...(params ? [params] : [])] as const;\n\nexport const getGetUnitChargesQueryOptions = <\n TData = Awaited<ReturnType<typeof getUnitCharges>>,\n TError = ErrorType<AsError | void>\n>(\n unitId: string,\n params?: GetUnitChargesParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getUnitCharges>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryOptions<\n Awaited<ReturnType<typeof getUnitCharges>>,\n TError,\n TData\n> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetUnitChargesQueryKey(unitId, params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getUnitCharges>>> = ({\n signal,\n }) => getUnitCharges(unitId, params, requestOptions, signal);\n\n return { queryKey, queryFn, enabled: !!unitId, ...queryOptions };\n};\n\nexport type GetUnitChargesQueryResult = NonNullable<\n Awaited<ReturnType<typeof getUnitCharges>>\n>;\nexport type GetUnitChargesQueryError = ErrorType<AsError | void>;\n\nexport const useGetUnitCharges = <\n TData = Awaited<ReturnType<typeof getUnitCharges>>,\n TError = ErrorType<AsError | void>\n>(\n unitId: string,\n params?: GetUnitChargesParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getUnitCharges>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetUnitChargesQueryOptions(unitId, params, options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../../src/unit/unit.ts"],"names":[],"mappings":";;;;;AAUA,SAAS,UAAU,mBAAmB;AAsC/B,IAAM,uBAAuB,CAClC,OACA,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,iBAAi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aAAa;AACjE;AAOO,IAAM,oBAAoB,CAI/B,QACA,QACA,YAQ2D;AAC3D,QAAM,eAAe,8BAA8B,QAAQ,QAAQ,OAAO;AAE1E,QAAM,QAAQ,SAAS,YAAY;AAInC,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT","sourcesContent":["/**\n * Generated by orval v6.15.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 **Organisations**, **Units**, **Products**, **Users**, and **Assets**.\n\n * OpenAPI spec version: 2.0\n */\nimport { useQuery, useMutation } from \"@tanstack/react-query\";\nimport type {\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"@tanstack/react-query\";\nimport type {\n OrganisationUnitsGetResponse,\n AsError,\n OrganisationUnitPostResponse,\n OrganisationUnitPostBodyBody,\n UnitGetResponse,\n UnitPatchBodyBody,\n UnitsGetResponse,\n PersonalUnitPutResponse,\n PersonalUnitPutBodyBody,\n UnitChargesGetResponse,\n GetUnitChargesParams,\n} from \"../account-server-api.schemas\";\nimport { customInstance } from \".././custom-instance\";\nimport type { ErrorType } from \".././custom-instance\";\n\n// eslint-disable-next-line\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 Organisational Units you have access to or that are public\n\n * @summary Gets Organisational Units\n */\nexport const getOrganisationUnits = (\n orgId: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<OrganisationUnitsGetResponse>(\n { url: `/organisation/${orgId}/unit`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetOrganisationUnitsQueryKey = (orgId: string) =>\n [\"account-server-api\", `/organisation/${orgId}/unit`] as const;\n\nexport const getGetOrganisationUnitsQueryOptions = <\n TData = Awaited<ReturnType<typeof getOrganisationUnits>>,\n TError = ErrorType<void | AsError>\n>(\n orgId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationUnits>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationUnits>>,\n TError,\n TData\n> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetOrganisationUnitsQueryKey(orgId);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getOrganisationUnits>>\n > = ({ signal }) => getOrganisationUnits(orgId, requestOptions, signal);\n\n return { queryKey, queryFn, enabled: !!orgId, ...queryOptions };\n};\n\nexport type GetOrganisationUnitsQueryResult = NonNullable<\n Awaited<ReturnType<typeof getOrganisationUnits>>\n>;\nexport type GetOrganisationUnitsQueryError = ErrorType<void | AsError>;\n\nexport const useGetOrganisationUnits = <\n TData = Awaited<ReturnType<typeof getOrganisationUnits>>,\n TError = ErrorType<void | AsError>\n>(\n orgId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationUnits>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetOrganisationUnitsQueryOptions(orgId, options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n\n/**\n * Creates a new Organisation Unit. You need to be a member of the **Organisation** or have administration rights to use this endpoint\n\n * @summary Create a new Organisational Unit\n */\nexport const createOrganisationUnit = (\n orgId: string,\n organisationUnitPostBodyBody: OrganisationUnitPostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<OrganisationUnitPostResponse>(\n {\n url: `/organisation/${orgId}/unit`,\n method: \"post\",\n headers: { \"Content-Type\": \"application/json\" },\n data: organisationUnitPostBodyBody,\n },\n options\n );\n};\n\nexport const getCreateOrganisationUnitMutationOptions = <\n TError = ErrorType<AsError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createOrganisationUnit>>,\n TError,\n { orgId: string; data: OrganisationUnitPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof createOrganisationUnit>>,\n TError,\n { orgId: string; data: OrganisationUnitPostBodyBody },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof createOrganisationUnit>>,\n { orgId: string; data: OrganisationUnitPostBodyBody }\n > = (props) => {\n const { orgId, data } = props ?? {};\n\n return createOrganisationUnit(orgId, data, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type CreateOrganisationUnitMutationResult = NonNullable<\n Awaited<ReturnType<typeof createOrganisationUnit>>\n>;\nexport type CreateOrganisationUnitMutationBody = OrganisationUnitPostBodyBody;\nexport type CreateOrganisationUnitMutationError = ErrorType<AsError | void>;\n\nexport const useCreateOrganisationUnit = <\n TError = ErrorType<AsError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createOrganisationUnit>>,\n TError,\n { orgId: string; data: OrganisationUnitPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getCreateOrganisationUnitMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Gets a Unit, assuming it is public, you are a member of it or its **Organisation**. Admin users have access to all Units\n\n * @summary Gets an Organisational Unit\n */\nexport const getUnit = (\n unitId: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<UnitGetResponse>(\n { url: `/unit/${unitId}`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetUnitQueryKey = (unitId: string) =>\n [\"account-server-api\", `/unit/${unitId}`] as const;\n\nexport const getGetUnitQueryOptions = <\n TData = Awaited<ReturnType<typeof getUnit>>,\n TError = ErrorType<void | AsError>\n>(\n unitId: string,\n options?: {\n query?: UseQueryOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData> & {\n queryKey: QueryKey;\n} => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUnitQueryKey(unitId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getUnit>>> = ({\n signal,\n }) => getUnit(unitId, requestOptions, signal);\n\n return { queryKey, queryFn, enabled: !!unitId, ...queryOptions };\n};\n\nexport type GetUnitQueryResult = NonNullable<\n Awaited<ReturnType<typeof getUnit>>\n>;\nexport type GetUnitQueryError = ErrorType<void | AsError>;\n\nexport const useGetUnit = <\n TData = Awaited<ReturnType<typeof getUnit>>,\n TError = ErrorType<void | AsError>\n>(\n unitId: string,\n options?: {\n query?: UseQueryOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetUnitQueryOptions(unitId, options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n\n/**\n * Used to update existing Unit.\n\nYou have to be the Unit owner, a member of its **Organisation** or an administrator to patch a Unit.\n\n * @summary Adjust an existing Unit\n */\nexport const patchUnit = (\n unitId: string,\n unitPatchBodyBody: UnitPatchBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n {\n url: `/unit/${unitId}`,\n method: \"patch\",\n headers: { \"Content-Type\": \"application/json\" },\n data: unitPatchBodyBody,\n },\n options\n );\n};\n\nexport const getPatchUnitMutationOptions = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof patchUnit>>,\n TError,\n { unitId: string; data: UnitPatchBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof patchUnit>>,\n TError,\n { unitId: string; data: UnitPatchBodyBody },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof patchUnit>>,\n { unitId: string; data: UnitPatchBodyBody }\n > = (props) => {\n const { unitId, data } = props ?? {};\n\n return patchUnit(unitId, data, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type PatchUnitMutationResult = NonNullable<\n Awaited<ReturnType<typeof patchUnit>>\n>;\nexport type PatchUnitMutationBody = UnitPatchBodyBody;\nexport type PatchUnitMutationError = ErrorType<AsError>;\n\nexport const usePatchUnit = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof patchUnit>>,\n TError,\n { unitId: string; data: UnitPatchBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getPatchUnitMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Deletes an Organisational Unit you have access to. Units can only be deleted by members of the Unit, its Organisation users or admin users.\n\nYou cannot delete Units in the **Default Organisation**. These Units are **Personal Units** and need to be deleted using the `DELETE /unit` endpoint.\n\nYou cannot delete a Unit that contains undeleted **Products**\n\n * @summary Deletes an Organisational Unit\n */\nexport const deleteOrganisationUnit = (\n unitId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/unit/${unitId}`, method: \"delete\" },\n options\n );\n};\n\nexport const getDeleteOrganisationUnitMutationOptions = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteOrganisationUnit>>,\n TError,\n { unitId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof deleteOrganisationUnit>>,\n TError,\n { unitId: string },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteOrganisationUnit>>,\n { unitId: string }\n > = (props) => {\n const { unitId } = props ?? {};\n\n return deleteOrganisationUnit(unitId, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type DeleteOrganisationUnitMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteOrganisationUnit>>\n>;\n\nexport type DeleteOrganisationUnitMutationError = ErrorType<AsError>;\n\nexport const useDeleteOrganisationUnit = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteOrganisationUnit>>,\n TError,\n { unitId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getDeleteOrganisationUnitMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Gets all the Units that are public or you are a member of. Admin users can see all Units.\n\n * @summary Gets Units\n */\nexport const getUnits = (\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<UnitsGetResponse>(\n { url: `/unit`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetUnitsQueryKey = () => [\"account-server-api\", `/unit`] as const;\n\nexport const getGetUnitsQueryOptions = <\n TData = Awaited<ReturnType<typeof getUnits>>,\n TError = ErrorType<void | AsError>\n>(options?: {\n query?: UseQueryOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData> & {\n queryKey: QueryKey;\n} => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUnitsQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getUnits>>> = ({\n signal,\n }) => getUnits(requestOptions, signal);\n\n return { queryKey, queryFn, ...queryOptions };\n};\n\nexport type GetUnitsQueryResult = NonNullable<\n Awaited<ReturnType<typeof getUnits>>\n>;\nexport type GetUnitsQueryError = ErrorType<void | AsError>;\n\nexport const useGetUnits = <\n TData = Awaited<ReturnType<typeof getUnits>>,\n TError = ErrorType<void | AsError>\n>(options?: {\n query?: UseQueryOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetUnitsQueryOptions(options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n\n/**\n * Creates a Personal Unit for a User. The unit will belong to the built-in **Default Organisation**.\n\nUsers can only create one Personal unit and you cannot add other Users to a Personal Unit.\n\n * @summary Create a new Personal Unit\n */\nexport const createDefaultUnit = (\n personalUnitPutBodyBody: PersonalUnitPutBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<PersonalUnitPutResponse>(\n {\n url: `/unit`,\n method: \"put\",\n headers: { \"Content-Type\": \"application/json\" },\n data: personalUnitPutBodyBody,\n },\n options\n );\n};\n\nexport const getCreateDefaultUnitMutationOptions = <\n TError = ErrorType<AsError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createDefaultUnit>>,\n TError,\n { data: PersonalUnitPutBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof createDefaultUnit>>,\n TError,\n { data: PersonalUnitPutBodyBody },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof createDefaultUnit>>,\n { data: PersonalUnitPutBodyBody }\n > = (props) => {\n const { data } = props ?? {};\n\n return createDefaultUnit(data, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type CreateDefaultUnitMutationResult = NonNullable<\n Awaited<ReturnType<typeof createDefaultUnit>>\n>;\nexport type CreateDefaultUnitMutationBody = PersonalUnitPutBodyBody;\nexport type CreateDefaultUnitMutationError = ErrorType<AsError | void>;\n\nexport const useCreateDefaultUnit = <\n TError = ErrorType<AsError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createDefaultUnit>>,\n TError,\n { data: PersonalUnitPutBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getCreateDefaultUnitMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Deletes a Personal Unit. The Unit is *your* Unit, and belongs to the **Default Organisation**\n\n * @summary Deletes a Personal Unit\n */\nexport const deleteDefaultUnit = (\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>({ url: `/unit`, method: \"delete\" }, options);\n};\n\nexport const getDeleteDefaultUnitMutationOptions = <\n TError = ErrorType<AsError>,\n TVariables = void,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteDefaultUnit>>,\n TError,\n TVariables,\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof deleteDefaultUnit>>,\n TError,\n TVariables,\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteDefaultUnit>>,\n TVariables\n > = () => {\n return deleteDefaultUnit(requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type DeleteDefaultUnitMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteDefaultUnit>>\n>;\n\nexport type DeleteDefaultUnitMutationError = ErrorType<AsError>;\n\nexport const useDeleteDefaultUnit = <\n TError = ErrorType<AsError>,\n TVariables = void,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteDefaultUnit>>,\n TError,\n TVariables,\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getDeleteDefaultUnitMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Get the charges made against a Unit with optional **from** (inclusive) and **until** (exclusive) dates. If no dates are provided, the charges for the current billing period are returned.\nDates are interpreted using the Python `dateutil` parser, so the input strings are extremely flexible with, for example, `1 December 2021` as an acceptable input.\n\n**From** must be a date (day) prior to **until**. For example, to see the charges for the 11th July 2022 set **from** to `11 July 2022` and **until** to `12 July 2022`. As an alternative to **From** and **Until** you can provide a **Prior Billing Period**, a value that identifies the prior period to retrieve. A value of `-1` would indicate the *prior period* (month) with an oldest retrieval value of `-23` allowing you to obtain charges for up to two years.\n\nYou need to be part of the **Unit** or **Organisation** to use this method\n * @summary Get charges made against a Unit\n */\nexport const getUnitCharges = (\n unitId: string,\n params?: GetUnitChargesParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<UnitChargesGetResponse>(\n { url: `/unit/${unitId}/charges`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetUnitChargesQueryKey = (\n unitId: string,\n params?: GetUnitChargesParams\n) => [\"account-server-api\", `/unit/${unitId}/charges`, ...(params ? [params] : [])] as const;\n\nexport const getGetUnitChargesQueryOptions = <\n TData = Awaited<ReturnType<typeof getUnitCharges>>,\n TError = ErrorType<AsError | void>\n>(\n unitId: string,\n params?: GetUnitChargesParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getUnitCharges>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryOptions<\n Awaited<ReturnType<typeof getUnitCharges>>,\n TError,\n TData\n> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetUnitChargesQueryKey(unitId, params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getUnitCharges>>> = ({\n signal,\n }) => getUnitCharges(unitId, params, requestOptions, signal);\n\n return { queryKey, queryFn, enabled: !!unitId, ...queryOptions };\n};\n\nexport type GetUnitChargesQueryResult = NonNullable<\n Awaited<ReturnType<typeof getUnitCharges>>\n>;\nexport type GetUnitChargesQueryError = ErrorType<AsError | void>;\n\nexport const useGetUnitCharges = <\n TData = Awaited<ReturnType<typeof getUnitCharges>>,\n TError = ErrorType<AsError | void>\n>(\n unitId: string,\n params?: GetUnitChargesParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getUnitCharges>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetUnitChargesQueryOptions(unitId, params, options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n"]}
|