@squonk/account-server-client 2.1.0-rc.7 → 2.1.0-rc.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/admin/admin.cjs +19 -4
  2. package/admin/admin.cjs.map +1 -1
  3. package/admin/admin.d.cts +23 -6
  4. package/admin/admin.d.ts +23 -6
  5. package/admin/admin.js +19 -4
  6. package/admin/admin.js.map +1 -1
  7. package/asset/asset.cjs +33 -18
  8. package/asset/asset.cjs.map +1 -1
  9. package/asset/asset.d.cts +31 -14
  10. package/asset/asset.d.ts +31 -14
  11. package/asset/asset.js +25 -10
  12. package/asset/asset.js.map +1 -1
  13. package/{chunk-UKA7G3OB.js → chunk-EBOQPVLG.js} +2 -2
  14. package/{chunk-UKA7G3OB.js.map → chunk-EBOQPVLG.js.map} +1 -1
  15. package/{chunk-J22A7LHX.cjs → chunk-TKLTUR4R.cjs} +2 -2
  16. package/chunk-TKLTUR4R.cjs.map +1 -0
  17. package/event-stream/event-stream.cjs +39 -10
  18. package/event-stream/event-stream.cjs.map +1 -1
  19. package/event-stream/event-stream.d.cts +50 -16
  20. package/event-stream/event-stream.d.ts +50 -16
  21. package/event-stream/event-stream.js +36 -7
  22. package/event-stream/event-stream.js.map +1 -1
  23. package/index.cjs +2 -2
  24. package/index.cjs.map +1 -1
  25. package/index.d.cts +700 -2
  26. package/index.d.ts +700 -2
  27. package/index.js +1 -1
  28. package/index.js.map +1 -1
  29. package/merchant/merchant.cjs +35 -6
  30. package/merchant/merchant.cjs.map +1 -1
  31. package/merchant/merchant.d.cts +42 -8
  32. package/merchant/merchant.d.ts +42 -8
  33. package/merchant/merchant.js +34 -5
  34. package/merchant/merchant.js.map +1 -1
  35. package/organisation/organisation.cjs +73 -16
  36. package/organisation/organisation.cjs.map +1 -1
  37. package/organisation/organisation.d.cts +84 -16
  38. package/organisation/organisation.d.ts +84 -16
  39. package/organisation/organisation.js +66 -9
  40. package/organisation/organisation.js.map +1 -1
  41. package/package.json +10 -10
  42. package/product/product.cjs +121 -22
  43. package/product/product.cjs.map +1 -1
  44. package/product/product.d.cts +141 -22
  45. package/product/product.d.ts +141 -22
  46. package/product/product.js +111 -12
  47. package/product/product.js.map +1 -1
  48. package/src/account-server-api.schemas.ts +1 -1
  49. package/src/admin/admin.ts +50 -14
  50. package/src/asset/asset.ts +57 -35
  51. package/src/custom-instance.ts +3 -4
  52. package/src/event-stream/event-stream.ts +99 -28
  53. package/src/merchant/merchant.ts +93 -18
  54. package/src/organisation/organisation.ts +184 -35
  55. package/src/product/product.ts +313 -47
  56. package/src/state/state.ts +50 -14
  57. package/src/unit/unit.ts +190 -45
  58. package/src/user/user.ts +140 -34
  59. package/state/state.cjs +19 -4
  60. package/state/state.cjs.map +1 -1
  61. package/state/state.d.cts +23 -6
  62. package/state/state.d.ts +23 -6
  63. package/state/state.js +19 -4
  64. package/state/state.js.map +1 -1
  65. package/unit/unit.cjs +77 -20
  66. package/unit/unit.cjs.map +1 -1
  67. package/unit/unit.d.cts +91 -23
  68. package/unit/unit.d.ts +91 -23
  69. package/unit/unit.js +68 -11
  70. package/unit/unit.js.map +1 -1
  71. package/user/user.cjs +59 -16
  72. package/user/user.cjs.map +1 -1
  73. package/user/user.d.cts +66 -15
  74. package/user/user.d.ts +66 -15
  75. package/user/user.js +53 -10
  76. package/user/user.js.map +1 -1
  77. package/chunk-J22A7LHX.cjs.map +0 -1
  78. package/custom-instance-6780910b.d.ts +0 -700
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Generated by orval v6.20.0 🍺
2
+ * Generated by orval v6.24.0 🍺
3
3
  * Do not edit manually.
4
4
  * Account Server API
5
5
  * The Informatics Matters Account Server API.
@@ -10,7 +10,8 @@ A service that provides access to the Account Server, which gives *registered* u
10
10
  */
11
11
  import {
12
12
  useMutation,
13
- useQuery
13
+ useQuery,
14
+ useSuspenseQuery
14
15
  } from '@tanstack/react-query'
15
16
  import type {
16
17
  MutationFunction,
@@ -18,7 +19,9 @@ import type {
18
19
  QueryKey,
19
20
  UseMutationOptions,
20
21
  UseQueryOptions,
21
- UseQueryResult
22
+ UseQueryResult,
23
+ UseSuspenseQueryOptions,
24
+ UseSuspenseQueryResult
22
25
  } from '@tanstack/react-query'
23
26
  import type {
24
27
  AsError,
@@ -36,13 +39,7 @@ import { customInstance } from '.././custom-instance';
36
39
  import type { ErrorType } from '.././custom-instance';
37
40
 
38
41
 
39
- // eslint-disable-next-line
40
- type SecondParameter<T extends (...args: any) => any> = T extends (
41
- config: any,
42
- args: infer P,
43
- ) => any
44
- ? P
45
- : never;
42
+ type SecondParameter<T extends (...args: any) => any> = Parameters<T>[1];
46
43
 
47
44
 
48
45
  /**
@@ -57,19 +54,18 @@ export const getProductTypes = (
57
54
 
58
55
 
59
56
  return customInstance<ProductsGetTypesResponse>(
60
- {url: `/product-type`, method: 'get', signal
57
+ {url: `/product-type`, method: 'GET', signal
61
58
  },
62
59
  options);
63
60
  }
64
61
 
65
62
 
66
63
  export const getGetProductTypesQueryKey = () => {
67
-
68
64
  return ["account-server-api", `/product-type`] as const;
69
65
  }
70
66
 
71
67
 
72
- export const getGetProductTypesQueryOptions = <TData = Awaited<ReturnType<typeof getProductTypes>>, TError = ErrorType<AsError | void>>( options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getProductTypes>>, TError, TData>, request?: SecondParameter<typeof customInstance>}
68
+ export const getGetProductTypesQueryOptions = <TData = Awaited<ReturnType<typeof getProductTypes>>, TError = ErrorType<AsError | void>>( options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getProductTypes>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
73
69
  ) => {
74
70
 
75
71
  const {query: queryOptions, request: requestOptions} = options ?? {};
@@ -94,7 +90,7 @@ export type GetProductTypesQueryError = ErrorType<AsError | void>
94
90
  * @summary Gets all Product Types
95
91
  */
96
92
  export const useGetProductTypes = <TData = Awaited<ReturnType<typeof getProductTypes>>, TError = ErrorType<AsError | void>>(
97
- options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getProductTypes>>, TError, TData>, request?: SecondParameter<typeof customInstance>}
93
+ options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getProductTypes>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
98
94
 
99
95
  ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
100
96
 
@@ -109,6 +105,46 @@ export const useGetProductTypes = <TData = Awaited<ReturnType<typeof getProductT
109
105
 
110
106
 
111
107
 
108
+ export const getGetProductTypesSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getProductTypes>>, TError = ErrorType<AsError | void>>( options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProductTypes>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
109
+ ) => {
110
+
111
+ const {query: queryOptions, request: requestOptions} = options ?? {};
112
+
113
+ const queryKey = queryOptions?.queryKey ?? getGetProductTypesQueryKey();
114
+
115
+
116
+
117
+ const queryFn: QueryFunction<Awaited<ReturnType<typeof getProductTypes>>> = ({ signal }) => getProductTypes(requestOptions, signal);
118
+
119
+
120
+
121
+
122
+
123
+ return { queryKey, queryFn, ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProductTypes>>, TError, TData> & { queryKey: QueryKey }
124
+ }
125
+
126
+ export type GetProductTypesSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getProductTypes>>>
127
+ export type GetProductTypesSuspenseQueryError = ErrorType<AsError | void>
128
+
129
+ /**
130
+ * @summary Gets all Product Types
131
+ */
132
+ export const useGetProductTypesSuspense = <TData = Awaited<ReturnType<typeof getProductTypes>>, TError = ErrorType<AsError | void>>(
133
+ options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProductTypes>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
134
+
135
+ ): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } => {
136
+
137
+ const queryOptions = getGetProductTypesSuspenseQueryOptions(options)
138
+
139
+ const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };
140
+
141
+ query.queryKey = queryOptions.queryKey ;
142
+
143
+ return query;
144
+ }
145
+
146
+
147
+
112
148
  /**
113
149
  * 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.
114
150
 
@@ -121,19 +157,18 @@ export const getProductDefaultStorageCost = (
121
157
 
122
158
 
123
159
  return customInstance<ProductsGetDefaultStorageCost>(
124
- {url: `/product-default-storage-cost`, method: 'get', signal
160
+ {url: `/product-default-storage-cost`, method: 'GET', signal
125
161
  },
126
162
  options);
127
163
  }
128
164
 
129
165
 
130
166
  export const getGetProductDefaultStorageCostQueryKey = () => {
131
-
132
167
  return ["account-server-api", `/product-default-storage-cost`] as const;
133
168
  }
134
169
 
135
170
 
136
- export const getGetProductDefaultStorageCostQueryOptions = <TData = Awaited<ReturnType<typeof getProductDefaultStorageCost>>, TError = ErrorType<AsError | void>>( options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getProductDefaultStorageCost>>, TError, TData>, request?: SecondParameter<typeof customInstance>}
171
+ export const getGetProductDefaultStorageCostQueryOptions = <TData = Awaited<ReturnType<typeof getProductDefaultStorageCost>>, TError = ErrorType<AsError | void>>( options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getProductDefaultStorageCost>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
137
172
  ) => {
138
173
 
139
174
  const {query: queryOptions, request: requestOptions} = options ?? {};
@@ -158,7 +193,7 @@ export type GetProductDefaultStorageCostQueryError = ErrorType<AsError | void>
158
193
  * @summary Gets the default cross-product storage cost
159
194
  */
160
195
  export const useGetProductDefaultStorageCost = <TData = Awaited<ReturnType<typeof getProductDefaultStorageCost>>, TError = ErrorType<AsError | void>>(
161
- options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getProductDefaultStorageCost>>, TError, TData>, request?: SecondParameter<typeof customInstance>}
196
+ options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getProductDefaultStorageCost>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
162
197
 
163
198
  ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
164
199
 
@@ -173,6 +208,46 @@ export const useGetProductDefaultStorageCost = <TData = Awaited<ReturnType<typeo
173
208
 
174
209
 
175
210
 
211
+ export const getGetProductDefaultStorageCostSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getProductDefaultStorageCost>>, TError = ErrorType<AsError | void>>( options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProductDefaultStorageCost>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
212
+ ) => {
213
+
214
+ const {query: queryOptions, request: requestOptions} = options ?? {};
215
+
216
+ const queryKey = queryOptions?.queryKey ?? getGetProductDefaultStorageCostQueryKey();
217
+
218
+
219
+
220
+ const queryFn: QueryFunction<Awaited<ReturnType<typeof getProductDefaultStorageCost>>> = ({ signal }) => getProductDefaultStorageCost(requestOptions, signal);
221
+
222
+
223
+
224
+
225
+
226
+ return { queryKey, queryFn, ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProductDefaultStorageCost>>, TError, TData> & { queryKey: QueryKey }
227
+ }
228
+
229
+ export type GetProductDefaultStorageCostSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getProductDefaultStorageCost>>>
230
+ export type GetProductDefaultStorageCostSuspenseQueryError = ErrorType<AsError | void>
231
+
232
+ /**
233
+ * @summary Gets the default cross-product storage cost
234
+ */
235
+ export const useGetProductDefaultStorageCostSuspense = <TData = Awaited<ReturnType<typeof getProductDefaultStorageCost>>, TError = ErrorType<AsError | void>>(
236
+ options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProductDefaultStorageCost>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
237
+
238
+ ): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } => {
239
+
240
+ const queryOptions = getGetProductDefaultStorageCostSuspenseQueryOptions(options)
241
+
242
+ const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };
243
+
244
+ query.queryKey = queryOptions.queryKey ;
245
+
246
+ return query;
247
+ }
248
+
249
+
250
+
176
251
  /**
177
252
  * Gets Products you have access to, across all **Units** and **Organisations**
178
253
 
@@ -185,19 +260,18 @@ export const getProducts = (
185
260
 
186
261
 
187
262
  return customInstance<ProductsGetResponse>(
188
- {url: `/product`, method: 'get', signal
263
+ {url: `/product`, method: 'GET', signal
189
264
  },
190
265
  options);
191
266
  }
192
267
 
193
268
 
194
269
  export const getGetProductsQueryKey = () => {
195
-
196
270
  return ["account-server-api", `/product`] as const;
197
271
  }
198
272
 
199
273
 
200
- export const getGetProductsQueryOptions = <TData = Awaited<ReturnType<typeof getProducts>>, TError = ErrorType<AsError | void>>( options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getProducts>>, TError, TData>, request?: SecondParameter<typeof customInstance>}
274
+ export const getGetProductsQueryOptions = <TData = Awaited<ReturnType<typeof getProducts>>, TError = ErrorType<AsError | void>>( options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getProducts>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
201
275
  ) => {
202
276
 
203
277
  const {query: queryOptions, request: requestOptions} = options ?? {};
@@ -222,7 +296,7 @@ export type GetProductsQueryError = ErrorType<AsError | void>
222
296
  * @summary Gets all Products
223
297
  */
224
298
  export const useGetProducts = <TData = Awaited<ReturnType<typeof getProducts>>, TError = ErrorType<AsError | void>>(
225
- options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getProducts>>, TError, TData>, request?: SecondParameter<typeof customInstance>}
299
+ options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getProducts>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
226
300
 
227
301
  ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
228
302
 
@@ -237,6 +311,46 @@ export const useGetProducts = <TData = Awaited<ReturnType<typeof getProducts>>,
237
311
 
238
312
 
239
313
 
314
+ export const getGetProductsSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getProducts>>, TError = ErrorType<AsError | void>>( options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProducts>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
315
+ ) => {
316
+
317
+ const {query: queryOptions, request: requestOptions} = options ?? {};
318
+
319
+ const queryKey = queryOptions?.queryKey ?? getGetProductsQueryKey();
320
+
321
+
322
+
323
+ const queryFn: QueryFunction<Awaited<ReturnType<typeof getProducts>>> = ({ signal }) => getProducts(requestOptions, signal);
324
+
325
+
326
+
327
+
328
+
329
+ return { queryKey, queryFn, ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProducts>>, TError, TData> & { queryKey: QueryKey }
330
+ }
331
+
332
+ export type GetProductsSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getProducts>>>
333
+ export type GetProductsSuspenseQueryError = ErrorType<AsError | void>
334
+
335
+ /**
336
+ * @summary Gets all Products
337
+ */
338
+ export const useGetProductsSuspense = <TData = Awaited<ReturnType<typeof getProducts>>, TError = ErrorType<AsError | void>>(
339
+ options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProducts>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
340
+
341
+ ): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } => {
342
+
343
+ const queryOptions = getGetProductsSuspenseQueryOptions(options)
344
+
345
+ const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };
346
+
347
+ query.queryKey = queryOptions.queryKey ;
348
+
349
+ return query;
350
+ }
351
+
352
+
353
+
240
354
  /**
241
355
  * Gets Products you have access to based on an **Organisation**
242
356
 
@@ -249,19 +363,18 @@ export const getProductsForOrganisation = (
249
363
 
250
364
 
251
365
  return customInstance<ProductsGetResponse>(
252
- {url: `/product/organisation/${orgId}`, method: 'get', signal
366
+ {url: `/product/organisation/${orgId}`, method: 'GET', signal
253
367
  },
254
368
  options);
255
369
  }
256
370
 
257
371
 
258
372
  export const getGetProductsForOrganisationQueryKey = (orgId: string,) => {
259
-
260
373
  return ["account-server-api", `/product/organisation/${orgId}`] as const;
261
374
  }
262
375
 
263
376
 
264
- export const getGetProductsForOrganisationQueryOptions = <TData = Awaited<ReturnType<typeof getProductsForOrganisation>>, TError = ErrorType<void | AsError>>(orgId: string, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getProductsForOrganisation>>, TError, TData>, request?: SecondParameter<typeof customInstance>}
377
+ export const getGetProductsForOrganisationQueryOptions = <TData = Awaited<ReturnType<typeof getProductsForOrganisation>>, TError = ErrorType<void | AsError>>(orgId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getProductsForOrganisation>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
265
378
  ) => {
266
379
 
267
380
  const {query: queryOptions, request: requestOptions} = options ?? {};
@@ -286,7 +399,7 @@ export type GetProductsForOrganisationQueryError = ErrorType<void | AsError>
286
399
  * @summary Gets Products for an Organisation
287
400
  */
288
401
  export const useGetProductsForOrganisation = <TData = Awaited<ReturnType<typeof getProductsForOrganisation>>, TError = ErrorType<void | AsError>>(
289
- orgId: string, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getProductsForOrganisation>>, TError, TData>, request?: SecondParameter<typeof customInstance>}
402
+ orgId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getProductsForOrganisation>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
290
403
 
291
404
  ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
292
405
 
@@ -301,6 +414,46 @@ export const useGetProductsForOrganisation = <TData = Awaited<ReturnType<typeof
301
414
 
302
415
 
303
416
 
417
+ export const getGetProductsForOrganisationSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getProductsForOrganisation>>, TError = ErrorType<void | AsError>>(orgId: string, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProductsForOrganisation>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
418
+ ) => {
419
+
420
+ const {query: queryOptions, request: requestOptions} = options ?? {};
421
+
422
+ const queryKey = queryOptions?.queryKey ?? getGetProductsForOrganisationQueryKey(orgId);
423
+
424
+
425
+
426
+ const queryFn: QueryFunction<Awaited<ReturnType<typeof getProductsForOrganisation>>> = ({ signal }) => getProductsForOrganisation(orgId, requestOptions, signal);
427
+
428
+
429
+
430
+
431
+
432
+ return { queryKey, queryFn, enabled: !!(orgId), ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProductsForOrganisation>>, TError, TData> & { queryKey: QueryKey }
433
+ }
434
+
435
+ export type GetProductsForOrganisationSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getProductsForOrganisation>>>
436
+ export type GetProductsForOrganisationSuspenseQueryError = ErrorType<void | AsError>
437
+
438
+ /**
439
+ * @summary Gets Products for an Organisation
440
+ */
441
+ export const useGetProductsForOrganisationSuspense = <TData = Awaited<ReturnType<typeof getProductsForOrganisation>>, TError = ErrorType<void | AsError>>(
442
+ orgId: string, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProductsForOrganisation>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
443
+
444
+ ): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } => {
445
+
446
+ const queryOptions = getGetProductsForOrganisationSuspenseQueryOptions(orgId,options)
447
+
448
+ const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };
449
+
450
+ query.queryKey = queryOptions.queryKey ;
451
+
452
+ return query;
453
+ }
454
+
455
+
456
+
304
457
  /**
305
458
  * Products are **Subscriptions** that you create in a Unit and use **Merchant** services like the `DATA_MANAGER`.
306
459
 
@@ -319,7 +472,7 @@ export const createUnitProduct = (
319
472
 
320
473
 
321
474
  return customInstance<UnitProductPostResponse>(
322
- {url: `/product/unit/${unitId}`, method: 'post',
475
+ {url: `/product/unit/${unitId}`, method: 'POST',
323
476
  headers: {'Content-Type': 'application/json', },
324
477
  data: unitProductPostBodyBody
325
478
  },
@@ -329,7 +482,6 @@ export const createUnitProduct = (
329
482
 
330
483
 
331
484
  export const getCreateUnitProductMutationOptions = <TError = ErrorType<AsError | void>,
332
-
333
485
  TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createUnitProduct>>, TError,{unitId: string;data: UnitProductPostBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}
334
486
  ): UseMutationOptions<Awaited<ReturnType<typeof createUnitProduct>>, TError,{unitId: string;data: UnitProductPostBodyBody}, TContext> => {
335
487
  const {mutation: mutationOptions, request: requestOptions} = options ?? {};
@@ -356,7 +508,6 @@ export const getCreateUnitProductMutationOptions = <TError = ErrorType<AsError |
356
508
  * @summary Creates a Product for an Organisational Unit
357
509
  */
358
510
  export const useCreateUnitProduct = <TError = ErrorType<AsError | void>,
359
-
360
511
  TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createUnitProduct>>, TError,{unitId: string;data: UnitProductPostBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}
361
512
  ) => {
362
513
 
@@ -376,19 +527,18 @@ export const getProductsForUnit = (
376
527
 
377
528
 
378
529
  return customInstance<ProductsGetResponse>(
379
- {url: `/product/unit/${unitId}`, method: 'get', signal
530
+ {url: `/product/unit/${unitId}`, method: 'GET', signal
380
531
  },
381
532
  options);
382
533
  }
383
534
 
384
535
 
385
536
  export const getGetProductsForUnitQueryKey = (unitId: string,) => {
386
-
387
537
  return ["account-server-api", `/product/unit/${unitId}`] as const;
388
538
  }
389
539
 
390
540
 
391
- export const getGetProductsForUnitQueryOptions = <TData = Awaited<ReturnType<typeof getProductsForUnit>>, TError = ErrorType<void | AsError>>(unitId: string, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getProductsForUnit>>, TError, TData>, request?: SecondParameter<typeof customInstance>}
541
+ export const getGetProductsForUnitQueryOptions = <TData = Awaited<ReturnType<typeof getProductsForUnit>>, TError = ErrorType<void | AsError>>(unitId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getProductsForUnit>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
392
542
  ) => {
393
543
 
394
544
  const {query: queryOptions, request: requestOptions} = options ?? {};
@@ -413,7 +563,7 @@ export type GetProductsForUnitQueryError = ErrorType<void | AsError>
413
563
  * @summary Gets Products for an Organisational Unit
414
564
  */
415
565
  export const useGetProductsForUnit = <TData = Awaited<ReturnType<typeof getProductsForUnit>>, TError = ErrorType<void | AsError>>(
416
- unitId: string, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getProductsForUnit>>, TError, TData>, request?: SecondParameter<typeof customInstance>}
566
+ unitId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getProductsForUnit>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
417
567
 
418
568
  ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
419
569
 
@@ -428,6 +578,46 @@ export const useGetProductsForUnit = <TData = Awaited<ReturnType<typeof getProdu
428
578
 
429
579
 
430
580
 
581
+ export const getGetProductsForUnitSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getProductsForUnit>>, TError = ErrorType<void | AsError>>(unitId: string, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProductsForUnit>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
582
+ ) => {
583
+
584
+ const {query: queryOptions, request: requestOptions} = options ?? {};
585
+
586
+ const queryKey = queryOptions?.queryKey ?? getGetProductsForUnitQueryKey(unitId);
587
+
588
+
589
+
590
+ const queryFn: QueryFunction<Awaited<ReturnType<typeof getProductsForUnit>>> = ({ signal }) => getProductsForUnit(unitId, requestOptions, signal);
591
+
592
+
593
+
594
+
595
+
596
+ return { queryKey, queryFn, enabled: !!(unitId), ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProductsForUnit>>, TError, TData> & { queryKey: QueryKey }
597
+ }
598
+
599
+ export type GetProductsForUnitSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getProductsForUnit>>>
600
+ export type GetProductsForUnitSuspenseQueryError = ErrorType<void | AsError>
601
+
602
+ /**
603
+ * @summary Gets Products for an Organisational Unit
604
+ */
605
+ export const useGetProductsForUnitSuspense = <TData = Awaited<ReturnType<typeof getProductsForUnit>>, TError = ErrorType<void | AsError>>(
606
+ unitId: string, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProductsForUnit>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
607
+
608
+ ): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } => {
609
+
610
+ const queryOptions = getGetProductsForUnitSuspenseQueryOptions(unitId,options)
611
+
612
+ const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };
613
+
614
+ query.queryKey = queryOptions.queryKey ;
615
+
616
+ return query;
617
+ }
618
+
619
+
620
+
431
621
  /**
432
622
  * Gets details of a specific Product that you have access to.
433
623
 
@@ -440,19 +630,18 @@ export const getProduct = (
440
630
 
441
631
 
442
632
  return customInstance<ProductUnitGetResponse>(
443
- {url: `/product/${productId}`, method: 'get', signal
633
+ {url: `/product/${productId}`, method: 'GET', signal
444
634
  },
445
635
  options);
446
636
  }
447
637
 
448
638
 
449
639
  export const getGetProductQueryKey = (productId: string,) => {
450
-
451
640
  return ["account-server-api", `/product/${productId}`] as const;
452
641
  }
453
642
 
454
643
 
455
- export const getGetProductQueryOptions = <TData = Awaited<ReturnType<typeof getProduct>>, TError = ErrorType<AsError | void>>(productId: string, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getProduct>>, TError, TData>, request?: SecondParameter<typeof customInstance>}
644
+ export const getGetProductQueryOptions = <TData = Awaited<ReturnType<typeof getProduct>>, TError = ErrorType<AsError | void>>(productId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getProduct>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
456
645
  ) => {
457
646
 
458
647
  const {query: queryOptions, request: requestOptions} = options ?? {};
@@ -477,7 +666,7 @@ export type GetProductQueryError = ErrorType<AsError | void>
477
666
  * @summary Gets a Product
478
667
  */
479
668
  export const useGetProduct = <TData = Awaited<ReturnType<typeof getProduct>>, TError = ErrorType<AsError | void>>(
480
- productId: string, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getProduct>>, TError, TData>, request?: SecondParameter<typeof customInstance>}
669
+ productId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getProduct>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
481
670
 
482
671
  ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
483
672
 
@@ -492,6 +681,46 @@ export const useGetProduct = <TData = Awaited<ReturnType<typeof getProduct>>, TE
492
681
 
493
682
 
494
683
 
684
+ export const getGetProductSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getProduct>>, TError = ErrorType<AsError | void>>(productId: string, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProduct>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
685
+ ) => {
686
+
687
+ const {query: queryOptions, request: requestOptions} = options ?? {};
688
+
689
+ const queryKey = queryOptions?.queryKey ?? getGetProductQueryKey(productId);
690
+
691
+
692
+
693
+ const queryFn: QueryFunction<Awaited<ReturnType<typeof getProduct>>> = ({ signal }) => getProduct(productId, requestOptions, signal);
694
+
695
+
696
+
697
+
698
+
699
+ return { queryKey, queryFn, enabled: !!(productId), ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProduct>>, TError, TData> & { queryKey: QueryKey }
700
+ }
701
+
702
+ export type GetProductSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getProduct>>>
703
+ export type GetProductSuspenseQueryError = ErrorType<AsError | void>
704
+
705
+ /**
706
+ * @summary Gets a Product
707
+ */
708
+ export const useGetProductSuspense = <TData = Awaited<ReturnType<typeof getProduct>>, TError = ErrorType<AsError | void>>(
709
+ productId: string, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProduct>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
710
+
711
+ ): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } => {
712
+
713
+ const queryOptions = getGetProductSuspenseQueryOptions(productId,options)
714
+
715
+ const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };
716
+
717
+ query.queryKey = queryOptions.queryKey ;
718
+
719
+ return query;
720
+ }
721
+
722
+
723
+
495
724
  /**
496
725
  * 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**.
497
726
 
@@ -503,7 +732,7 @@ export const deleteProduct = (
503
732
 
504
733
 
505
734
  return customInstance<void>(
506
- {url: `/product/${productId}`, method: 'delete'
735
+ {url: `/product/${productId}`, method: 'DELETE'
507
736
  },
508
737
  options);
509
738
  }
@@ -511,7 +740,6 @@ export const deleteProduct = (
511
740
 
512
741
 
513
742
  export const getDeleteProductMutationOptions = <TError = ErrorType<AsError>,
514
-
515
743
  TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteProduct>>, TError,{productId: string}, TContext>, request?: SecondParameter<typeof customInstance>}
516
744
  ): UseMutationOptions<Awaited<ReturnType<typeof deleteProduct>>, TError,{productId: string}, TContext> => {
517
745
  const {mutation: mutationOptions, request: requestOptions} = options ?? {};
@@ -538,7 +766,6 @@ export const getDeleteProductMutationOptions = <TError = ErrorType<AsError>,
538
766
  * @summary Deletes an existing Product
539
767
  */
540
768
  export const useDeleteProduct = <TError = ErrorType<AsError>,
541
-
542
769
  TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteProduct>>, TError,{productId: string}, TContext>, request?: SecondParameter<typeof customInstance>}
543
770
  ) => {
544
771
 
@@ -560,7 +787,7 @@ export const patchProduct = (
560
787
 
561
788
 
562
789
  return customInstance<void>(
563
- {url: `/product/${productId}`, method: 'patch',
790
+ {url: `/product/${productId}`, method: 'PATCH',
564
791
  headers: {'Content-Type': 'application/json', },
565
792
  data: productPatchBodyBody
566
793
  },
@@ -570,7 +797,6 @@ export const patchProduct = (
570
797
 
571
798
 
572
799
  export const getPatchProductMutationOptions = <TError = ErrorType<AsError>,
573
-
574
800
  TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof patchProduct>>, TError,{productId: string;data: ProductPatchBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}
575
801
  ): UseMutationOptions<Awaited<ReturnType<typeof patchProduct>>, TError,{productId: string;data: ProductPatchBodyBody}, TContext> => {
576
802
  const {mutation: mutationOptions, request: requestOptions} = options ?? {};
@@ -597,7 +823,6 @@ export const getPatchProductMutationOptions = <TError = ErrorType<AsError>,
597
823
  * @summary Adjust an existing Product
598
824
  */
599
825
  export const usePatchProduct = <TError = ErrorType<AsError>,
600
-
601
826
  TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof patchProduct>>, TError,{productId: string;data: ProductPatchBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}
602
827
  ) => {
603
828
 
@@ -623,7 +848,7 @@ export const getProductCharges = (
623
848
 
624
849
 
625
850
  return customInstance<ProductChargesGetResponse>(
626
- {url: `/product/${productId}/charges`, method: 'get',
851
+ {url: `/product/${productId}/charges`, method: 'GET',
627
852
  params, signal
628
853
  },
629
854
  options);
@@ -632,13 +857,12 @@ export const getProductCharges = (
632
857
 
633
858
  export const getGetProductChargesQueryKey = (productId: string,
634
859
  params?: GetProductChargesParams,) => {
635
-
636
860
  return ["account-server-api", `/product/${productId}/charges`, ...(params ? [params]: [])] as const;
637
861
  }
638
862
 
639
863
 
640
864
  export const getGetProductChargesQueryOptions = <TData = Awaited<ReturnType<typeof getProductCharges>>, TError = ErrorType<AsError | void>>(productId: string,
641
- params?: GetProductChargesParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>, request?: SecondParameter<typeof customInstance>}
865
+ params?: GetProductChargesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
642
866
  ) => {
643
867
 
644
868
  const {query: queryOptions, request: requestOptions} = options ?? {};
@@ -664,7 +888,7 @@ export type GetProductChargesQueryError = ErrorType<AsError | void>
664
888
  */
665
889
  export const useGetProductCharges = <TData = Awaited<ReturnType<typeof getProductCharges>>, TError = ErrorType<AsError | void>>(
666
890
  productId: string,
667
- params?: GetProductChargesParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>, request?: SecondParameter<typeof customInstance>}
891
+ params?: GetProductChargesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
668
892
 
669
893
  ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
670
894
 
@@ -679,3 +903,45 @@ export const useGetProductCharges = <TData = Awaited<ReturnType<typeof getProduc
679
903
 
680
904
 
681
905
 
906
+ export const getGetProductChargesSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getProductCharges>>, TError = ErrorType<AsError | void>>(productId: string,
907
+ params?: GetProductChargesParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
908
+ ) => {
909
+
910
+ const {query: queryOptions, request: requestOptions} = options ?? {};
911
+
912
+ const queryKey = queryOptions?.queryKey ?? getGetProductChargesQueryKey(productId,params);
913
+
914
+
915
+
916
+ const queryFn: QueryFunction<Awaited<ReturnType<typeof getProductCharges>>> = ({ signal }) => getProductCharges(productId,params, requestOptions, signal);
917
+
918
+
919
+
920
+
921
+
922
+ return { queryKey, queryFn, enabled: !!(productId), ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData> & { queryKey: QueryKey }
923
+ }
924
+
925
+ export type GetProductChargesSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getProductCharges>>>
926
+ export type GetProductChargesSuspenseQueryError = ErrorType<AsError | void>
927
+
928
+ /**
929
+ * @summary Get charges made against a Product
930
+ */
931
+ export const useGetProductChargesSuspense = <TData = Awaited<ReturnType<typeof getProductCharges>>, TError = ErrorType<AsError | void>>(
932
+ productId: string,
933
+ params?: GetProductChargesParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
934
+
935
+ ): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } => {
936
+
937
+ const queryOptions = getGetProductChargesSuspenseQueryOptions(productId,params,options)
938
+
939
+ const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };
940
+
941
+ query.queryKey = queryOptions.queryKey ;
942
+
943
+ return query;
944
+ }
945
+
946
+
947
+