@squonk/account-server-client 2.1.0-rc.1 → 2.1.0-rc.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/README.md +1 -1
  2. package/admin/admin.cjs +30 -8
  3. package/admin/admin.cjs.map +1 -1
  4. package/admin/admin.d.cts +50 -0
  5. package/admin/admin.d.ts +26 -6
  6. package/admin/admin.js +30 -8
  7. package/admin/admin.js.map +1 -1
  8. package/asset/asset.cjs +62 -22
  9. package/asset/asset.cjs.map +1 -1
  10. package/asset/asset.d.cts +260 -0
  11. package/asset/asset.d.ts +79 -36
  12. package/asset/asset.js +54 -14
  13. package/asset/asset.js.map +1 -1
  14. package/{chunk-3RNIDX7T.js → chunk-EBOQPVLG.js} +2 -2
  15. package/{chunk-3RNIDX7T.js.map → chunk-EBOQPVLG.js.map} +1 -1
  16. package/{chunk-UZTHSGDT.cjs → chunk-TKLTUR4R.cjs} +2 -2
  17. package/chunk-TKLTUR4R.cjs.map +1 -0
  18. package/event-stream/event-stream.cjs +64 -19
  19. package/event-stream/event-stream.cjs.map +1 -1
  20. package/event-stream/event-stream.d.cts +142 -0
  21. package/event-stream/event-stream.d.ts +66 -20
  22. package/event-stream/event-stream.js +61 -16
  23. package/event-stream/event-stream.js.map +1 -1
  24. package/index.cjs +10 -10
  25. package/index.cjs.map +1 -1
  26. package/{custom-instance-35e5d4fd.d.ts → index.d.cts} +163 -163
  27. package/index.d.ts +700 -2
  28. package/index.js +9 -9
  29. package/index.js.map +1 -1
  30. package/merchant/merchant.cjs +53 -14
  31. package/merchant/merchant.cjs.map +1 -1
  32. package/merchant/merchant.d.cts +91 -0
  33. package/merchant/merchant.d.ts +48 -8
  34. package/merchant/merchant.js +52 -13
  35. package/merchant/merchant.js.map +1 -1
  36. package/organisation/organisation.cjs +110 -28
  37. package/organisation/organisation.cjs.map +1 -1
  38. package/organisation/organisation.d.cts +271 -0
  39. package/organisation/organisation.d.ts +114 -25
  40. package/organisation/organisation.js +103 -21
  41. package/organisation/organisation.js.map +1 -1
  42. package/package.json +12 -12
  43. package/product/product.cjs +182 -47
  44. package/product/product.cjs.map +1 -1
  45. package/product/product.d.cts +399 -0
  46. package/product/product.d.ts +180 -31
  47. package/product/product.js +172 -37
  48. package/product/product.js.map +1 -1
  49. package/src/account-server-api.schemas.ts +272 -280
  50. package/src/admin/admin.ts +114 -84
  51. package/src/asset/asset.ts +480 -565
  52. package/src/custom-instance.ts +3 -4
  53. package/src/event-stream/event-stream.ts +300 -275
  54. package/src/merchant/merchant.ts +206 -142
  55. package/src/organisation/organisation.ts +549 -490
  56. package/src/product/product.ts +829 -688
  57. package/src/state/state.ts +112 -75
  58. package/src/unit/unit.ts +645 -599
  59. package/src/user/user.ts +489 -469
  60. package/state/state.cjs +29 -8
  61. package/state/state.cjs.map +1 -1
  62. package/state/state.d.cts +46 -0
  63. package/state/state.d.ts +26 -6
  64. package/state/state.js +29 -8
  65. package/state/state.js.map +1 -1
  66. package/unit/unit.cjs +120 -32
  67. package/unit/unit.cjs.map +1 -1
  68. package/unit/unit.d.cts +322 -0
  69. package/unit/unit.d.ts +133 -38
  70. package/unit/unit.js +112 -24
  71. package/unit/unit.js.map +1 -1
  72. package/user/user.cjs +96 -22
  73. package/user/user.cjs.map +1 -1
  74. package/user/user.d.cts +271 -0
  75. package/user/user.d.ts +96 -24
  76. package/user/user.js +90 -16
  77. package/user/user.js.map +1 -1
  78. package/chunk-UZTHSGDT.cjs.map +0 -1
@@ -0,0 +1,399 @@
1
+ import * as _tanstack_react_query_build_legacy_types from '@tanstack/react-query/build/legacy/types';
2
+ import { UseQueryOptions, QueryKey, UseQueryResult, UseSuspenseQueryOptions, UseSuspenseQueryResult, UseMutationOptions } from '@tanstack/react-query';
3
+ import { customInstance, ProductsGetTypesResponse, ErrorType, AsError, ProductsGetDefaultStorageCost, ProductsGetResponse, UnitProductPostBodyBody, UnitProductPostResponse, ProductUnitGetResponse, ProductPatchBodyBody, GetProductChargesParams, ProductChargesGetResponse } from '../index.cjs';
4
+ import 'axios';
5
+
6
+ type SecondParameter<T extends (...args: any) => any> = Parameters<T>[1];
7
+ /**
8
+ * Gets Product Types you can purchase (subscribe to)
9
+
10
+ * @summary Gets all Product Types
11
+ */
12
+ declare const getProductTypes: (options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<ProductsGetTypesResponse>;
13
+ declare const getGetProductTypesQueryKey: () => readonly ["account-server-api", "/product-type"];
14
+ declare const getGetProductTypesQueryOptions: <TData = ProductsGetTypesResponse, TError = ErrorType<void | AsError>>(options?: {
15
+ query?: Partial<UseQueryOptions<ProductsGetTypesResponse, TError, TData, QueryKey>> | undefined;
16
+ request?: SecondParameter<typeof customInstance>;
17
+ } | undefined) => UseQueryOptions<ProductsGetTypesResponse, TError, TData, QueryKey> & {
18
+ queryKey: QueryKey;
19
+ };
20
+ type GetProductTypesQueryResult = NonNullable<Awaited<ReturnType<typeof getProductTypes>>>;
21
+ type GetProductTypesQueryError = ErrorType<AsError | void>;
22
+ /**
23
+ * @summary Gets all Product Types
24
+ */
25
+ declare const useGetProductTypes: <TData = ProductsGetTypesResponse, TError = ErrorType<void | AsError>>(options?: {
26
+ query?: Partial<UseQueryOptions<ProductsGetTypesResponse, TError, TData, QueryKey>> | undefined;
27
+ request?: SecondParameter<typeof customInstance>;
28
+ } | undefined) => UseQueryResult<TData, TError> & {
29
+ queryKey: QueryKey;
30
+ };
31
+ declare const getGetProductTypesSuspenseQueryOptions: <TData = ProductsGetTypesResponse, TError = ErrorType<void | AsError>>(options?: {
32
+ query?: Partial<UseSuspenseQueryOptions<ProductsGetTypesResponse, TError, TData, QueryKey>> | undefined;
33
+ request?: SecondParameter<typeof customInstance>;
34
+ } | undefined) => UseSuspenseQueryOptions<ProductsGetTypesResponse, TError, TData, QueryKey> & {
35
+ queryKey: QueryKey;
36
+ };
37
+ type GetProductTypesSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getProductTypes>>>;
38
+ type GetProductTypesSuspenseQueryError = ErrorType<AsError | void>;
39
+ /**
40
+ * @summary Gets all Product Types
41
+ */
42
+ declare const useGetProductTypesSuspense: <TData = ProductsGetTypesResponse, TError = ErrorType<void | AsError>>(options?: {
43
+ query?: Partial<UseSuspenseQueryOptions<ProductsGetTypesResponse, TError, TData, QueryKey>> | undefined;
44
+ request?: SecondParameter<typeof customInstance>;
45
+ } | undefined) => UseSuspenseQueryResult<TData, TError> & {
46
+ queryKey: QueryKey;
47
+ };
48
+ /**
49
+ * 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.
50
+
51
+ * @summary Gets the default cross-product storage cost
52
+ */
53
+ declare const getProductDefaultStorageCost: (options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<ProductsGetDefaultStorageCost>;
54
+ declare const getGetProductDefaultStorageCostQueryKey: () => readonly ["account-server-api", "/product-default-storage-cost"];
55
+ declare const getGetProductDefaultStorageCostQueryOptions: <TData = ProductsGetDefaultStorageCost, TError = ErrorType<void | AsError>>(options?: {
56
+ query?: Partial<UseQueryOptions<ProductsGetDefaultStorageCost, TError, TData, QueryKey>> | undefined;
57
+ request?: SecondParameter<typeof customInstance>;
58
+ } | undefined) => UseQueryOptions<ProductsGetDefaultStorageCost, TError, TData, QueryKey> & {
59
+ queryKey: QueryKey;
60
+ };
61
+ type GetProductDefaultStorageCostQueryResult = NonNullable<Awaited<ReturnType<typeof getProductDefaultStorageCost>>>;
62
+ type GetProductDefaultStorageCostQueryError = ErrorType<AsError | void>;
63
+ /**
64
+ * @summary Gets the default cross-product storage cost
65
+ */
66
+ declare const useGetProductDefaultStorageCost: <TData = ProductsGetDefaultStorageCost, TError = ErrorType<void | AsError>>(options?: {
67
+ query?: Partial<UseQueryOptions<ProductsGetDefaultStorageCost, TError, TData, QueryKey>> | undefined;
68
+ request?: SecondParameter<typeof customInstance>;
69
+ } | undefined) => UseQueryResult<TData, TError> & {
70
+ queryKey: QueryKey;
71
+ };
72
+ declare const getGetProductDefaultStorageCostSuspenseQueryOptions: <TData = ProductsGetDefaultStorageCost, TError = ErrorType<void | AsError>>(options?: {
73
+ query?: Partial<UseSuspenseQueryOptions<ProductsGetDefaultStorageCost, TError, TData, QueryKey>> | undefined;
74
+ request?: SecondParameter<typeof customInstance>;
75
+ } | undefined) => UseSuspenseQueryOptions<ProductsGetDefaultStorageCost, TError, TData, QueryKey> & {
76
+ queryKey: QueryKey;
77
+ };
78
+ type GetProductDefaultStorageCostSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getProductDefaultStorageCost>>>;
79
+ type GetProductDefaultStorageCostSuspenseQueryError = ErrorType<AsError | void>;
80
+ /**
81
+ * @summary Gets the default cross-product storage cost
82
+ */
83
+ declare const useGetProductDefaultStorageCostSuspense: <TData = ProductsGetDefaultStorageCost, TError = ErrorType<void | AsError>>(options?: {
84
+ query?: Partial<UseSuspenseQueryOptions<ProductsGetDefaultStorageCost, TError, TData, QueryKey>> | undefined;
85
+ request?: SecondParameter<typeof customInstance>;
86
+ } | undefined) => UseSuspenseQueryResult<TData, TError> & {
87
+ queryKey: QueryKey;
88
+ };
89
+ /**
90
+ * Gets Products you have access to, across all **Units** and **Organisations**
91
+
92
+ * @summary Gets all Products
93
+ */
94
+ declare const getProducts: (options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<ProductsGetResponse>;
95
+ declare const getGetProductsQueryKey: () => readonly ["account-server-api", "/product"];
96
+ declare const getGetProductsQueryOptions: <TData = ProductsGetResponse, TError = ErrorType<void | AsError>>(options?: {
97
+ query?: Partial<UseQueryOptions<ProductsGetResponse, TError, TData, QueryKey>> | undefined;
98
+ request?: SecondParameter<typeof customInstance>;
99
+ } | undefined) => UseQueryOptions<ProductsGetResponse, TError, TData, QueryKey> & {
100
+ queryKey: QueryKey;
101
+ };
102
+ type GetProductsQueryResult = NonNullable<Awaited<ReturnType<typeof getProducts>>>;
103
+ type GetProductsQueryError = ErrorType<AsError | void>;
104
+ /**
105
+ * @summary Gets all Products
106
+ */
107
+ declare const useGetProducts: <TData = ProductsGetResponse, TError = ErrorType<void | AsError>>(options?: {
108
+ query?: Partial<UseQueryOptions<ProductsGetResponse, TError, TData, QueryKey>> | undefined;
109
+ request?: SecondParameter<typeof customInstance>;
110
+ } | undefined) => UseQueryResult<TData, TError> & {
111
+ queryKey: QueryKey;
112
+ };
113
+ declare const getGetProductsSuspenseQueryOptions: <TData = ProductsGetResponse, TError = ErrorType<void | AsError>>(options?: {
114
+ query?: Partial<UseSuspenseQueryOptions<ProductsGetResponse, TError, TData, QueryKey>> | undefined;
115
+ request?: SecondParameter<typeof customInstance>;
116
+ } | undefined) => UseSuspenseQueryOptions<ProductsGetResponse, TError, TData, QueryKey> & {
117
+ queryKey: QueryKey;
118
+ };
119
+ type GetProductsSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getProducts>>>;
120
+ type GetProductsSuspenseQueryError = ErrorType<AsError | void>;
121
+ /**
122
+ * @summary Gets all Products
123
+ */
124
+ declare const useGetProductsSuspense: <TData = ProductsGetResponse, TError = ErrorType<void | AsError>>(options?: {
125
+ query?: Partial<UseSuspenseQueryOptions<ProductsGetResponse, TError, TData, QueryKey>> | undefined;
126
+ request?: SecondParameter<typeof customInstance>;
127
+ } | undefined) => UseSuspenseQueryResult<TData, TError> & {
128
+ queryKey: QueryKey;
129
+ };
130
+ /**
131
+ * Gets Products you have access to based on an **Organisation**
132
+
133
+ * @summary Gets Products for an Organisation
134
+ */
135
+ declare const getProductsForOrganisation: (orgId: string, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<ProductsGetResponse>;
136
+ declare const getGetProductsForOrganisationQueryKey: (orgId: string) => readonly ["account-server-api", `/product/organisation/${string}`];
137
+ declare const getGetProductsForOrganisationQueryOptions: <TData = ProductsGetResponse, TError = ErrorType<void | AsError>>(orgId: string, options?: {
138
+ query?: Partial<UseQueryOptions<ProductsGetResponse, TError, TData, QueryKey>> | undefined;
139
+ request?: SecondParameter<typeof customInstance>;
140
+ } | undefined) => UseQueryOptions<ProductsGetResponse, TError, TData, QueryKey> & {
141
+ queryKey: QueryKey;
142
+ };
143
+ type GetProductsForOrganisationQueryResult = NonNullable<Awaited<ReturnType<typeof getProductsForOrganisation>>>;
144
+ type GetProductsForOrganisationQueryError = ErrorType<void | AsError>;
145
+ /**
146
+ * @summary Gets Products for an Organisation
147
+ */
148
+ declare const useGetProductsForOrganisation: <TData = ProductsGetResponse, TError = ErrorType<void | AsError>>(orgId: string, options?: {
149
+ query?: Partial<UseQueryOptions<ProductsGetResponse, TError, TData, QueryKey>> | undefined;
150
+ request?: SecondParameter<typeof customInstance>;
151
+ } | undefined) => UseQueryResult<TData, TError> & {
152
+ queryKey: QueryKey;
153
+ };
154
+ declare const getGetProductsForOrganisationSuspenseQueryOptions: <TData = ProductsGetResponse, TError = ErrorType<void | AsError>>(orgId: string, options?: {
155
+ query?: Partial<UseSuspenseQueryOptions<ProductsGetResponse, TError, TData, QueryKey>> | undefined;
156
+ request?: SecondParameter<typeof customInstance>;
157
+ } | undefined) => UseSuspenseQueryOptions<ProductsGetResponse, TError, TData, QueryKey> & {
158
+ queryKey: QueryKey;
159
+ };
160
+ type GetProductsForOrganisationSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getProductsForOrganisation>>>;
161
+ type GetProductsForOrganisationSuspenseQueryError = ErrorType<void | AsError>;
162
+ /**
163
+ * @summary Gets Products for an Organisation
164
+ */
165
+ declare const useGetProductsForOrganisationSuspense: <TData = ProductsGetResponse, TError = ErrorType<void | AsError>>(orgId: string, options?: {
166
+ query?: Partial<UseSuspenseQueryOptions<ProductsGetResponse, TError, TData, QueryKey>> | undefined;
167
+ request?: SecondParameter<typeof customInstance>;
168
+ } | undefined) => UseSuspenseQueryResult<TData, TError> & {
169
+ queryKey: QueryKey;
170
+ };
171
+ /**
172
+ * Products are **Subscriptions** that you create in a Unit and use **Merchant** services like the `DATA_MANAGER`.
173
+
174
+ Typical subscriptions include `DATA_MANAGER_STORAGE_SUBSCRIPTION` and `DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION`.
175
+
176
+ 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`
177
+
178
+ To do this you need to be a member of the **Unit** or the **Organisation**.
179
+
180
+ * @summary Creates a Product for an Organisational Unit
181
+ */
182
+ declare const createUnitProduct: (unitId: string, unitProductPostBodyBody: UnitProductPostBodyBody, options?: SecondParameter<typeof customInstance>) => Promise<UnitProductPostResponse>;
183
+ declare const getCreateUnitProductMutationOptions: <TError = ErrorType<void | AsError>, TContext = unknown>(options?: {
184
+ mutation?: UseMutationOptions<UnitProductPostResponse, TError, {
185
+ unitId: string;
186
+ data: UnitProductPostBodyBody;
187
+ }, TContext> | undefined;
188
+ request?: SecondParameter<typeof customInstance>;
189
+ } | undefined) => UseMutationOptions<UnitProductPostResponse, TError, {
190
+ unitId: string;
191
+ data: UnitProductPostBodyBody;
192
+ }, TContext>;
193
+ type CreateUnitProductMutationResult = NonNullable<Awaited<ReturnType<typeof createUnitProduct>>>;
194
+ type CreateUnitProductMutationBody = UnitProductPostBodyBody;
195
+ type CreateUnitProductMutationError = ErrorType<AsError | void>;
196
+ /**
197
+ * @summary Creates a Product for an Organisational Unit
198
+ */
199
+ declare const useCreateUnitProduct: <TError = ErrorType<void | AsError>, TContext = unknown>(options?: {
200
+ mutation?: UseMutationOptions<UnitProductPostResponse, TError, {
201
+ unitId: string;
202
+ data: UnitProductPostBodyBody;
203
+ }, TContext> | undefined;
204
+ request?: SecondParameter<typeof customInstance>;
205
+ } | undefined) => _tanstack_react_query_build_legacy_types.UseMutationResult<UnitProductPostResponse, TError, {
206
+ unitId: string;
207
+ data: UnitProductPostBodyBody;
208
+ }, TContext>;
209
+ /**
210
+ * Gets products you have access to based on an Organisational **Unit**
211
+
212
+ * @summary Gets Products for an Organisational Unit
213
+ */
214
+ declare const getProductsForUnit: (unitId: string, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<ProductsGetResponse>;
215
+ declare const getGetProductsForUnitQueryKey: (unitId: string) => readonly ["account-server-api", `/product/unit/${string}`];
216
+ declare const getGetProductsForUnitQueryOptions: <TData = ProductsGetResponse, TError = ErrorType<void | AsError>>(unitId: string, options?: {
217
+ query?: Partial<UseQueryOptions<ProductsGetResponse, TError, TData, QueryKey>> | undefined;
218
+ request?: SecondParameter<typeof customInstance>;
219
+ } | undefined) => UseQueryOptions<ProductsGetResponse, TError, TData, QueryKey> & {
220
+ queryKey: QueryKey;
221
+ };
222
+ type GetProductsForUnitQueryResult = NonNullable<Awaited<ReturnType<typeof getProductsForUnit>>>;
223
+ type GetProductsForUnitQueryError = ErrorType<void | AsError>;
224
+ /**
225
+ * @summary Gets Products for an Organisational Unit
226
+ */
227
+ declare const useGetProductsForUnit: <TData = ProductsGetResponse, TError = ErrorType<void | AsError>>(unitId: string, options?: {
228
+ query?: Partial<UseQueryOptions<ProductsGetResponse, TError, TData, QueryKey>> | undefined;
229
+ request?: SecondParameter<typeof customInstance>;
230
+ } | undefined) => UseQueryResult<TData, TError> & {
231
+ queryKey: QueryKey;
232
+ };
233
+ declare const getGetProductsForUnitSuspenseQueryOptions: <TData = ProductsGetResponse, TError = ErrorType<void | AsError>>(unitId: string, options?: {
234
+ query?: Partial<UseSuspenseQueryOptions<ProductsGetResponse, TError, TData, QueryKey>> | undefined;
235
+ request?: SecondParameter<typeof customInstance>;
236
+ } | undefined) => UseSuspenseQueryOptions<ProductsGetResponse, TError, TData, QueryKey> & {
237
+ queryKey: QueryKey;
238
+ };
239
+ type GetProductsForUnitSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getProductsForUnit>>>;
240
+ type GetProductsForUnitSuspenseQueryError = ErrorType<void | AsError>;
241
+ /**
242
+ * @summary Gets Products for an Organisational Unit
243
+ */
244
+ declare const useGetProductsForUnitSuspense: <TData = ProductsGetResponse, TError = ErrorType<void | AsError>>(unitId: string, options?: {
245
+ query?: Partial<UseSuspenseQueryOptions<ProductsGetResponse, TError, TData, QueryKey>> | undefined;
246
+ request?: SecondParameter<typeof customInstance>;
247
+ } | undefined) => UseSuspenseQueryResult<TData, TError> & {
248
+ queryKey: QueryKey;
249
+ };
250
+ /**
251
+ * Gets details of a specific Product that you have access to.
252
+
253
+ * @summary Gets a Product
254
+ */
255
+ declare const getProduct: (productId: string, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<ProductUnitGetResponse>;
256
+ declare const getGetProductQueryKey: (productId: string) => readonly ["account-server-api", `/product/${string}`];
257
+ declare const getGetProductQueryOptions: <TData = ProductUnitGetResponse, TError = ErrorType<void | AsError>>(productId: string, options?: {
258
+ query?: Partial<UseQueryOptions<ProductUnitGetResponse, TError, TData, QueryKey>> | undefined;
259
+ request?: SecondParameter<typeof customInstance>;
260
+ } | undefined) => UseQueryOptions<ProductUnitGetResponse, TError, TData, QueryKey> & {
261
+ queryKey: QueryKey;
262
+ };
263
+ type GetProductQueryResult = NonNullable<Awaited<ReturnType<typeof getProduct>>>;
264
+ type GetProductQueryError = ErrorType<AsError | void>;
265
+ /**
266
+ * @summary Gets a Product
267
+ */
268
+ declare const useGetProduct: <TData = ProductUnitGetResponse, TError = ErrorType<void | AsError>>(productId: string, options?: {
269
+ query?: Partial<UseQueryOptions<ProductUnitGetResponse, TError, TData, QueryKey>> | undefined;
270
+ request?: SecondParameter<typeof customInstance>;
271
+ } | undefined) => UseQueryResult<TData, TError> & {
272
+ queryKey: QueryKey;
273
+ };
274
+ declare const getGetProductSuspenseQueryOptions: <TData = ProductUnitGetResponse, TError = ErrorType<void | AsError>>(productId: string, options?: {
275
+ query?: Partial<UseSuspenseQueryOptions<ProductUnitGetResponse, TError, TData, QueryKey>> | undefined;
276
+ request?: SecondParameter<typeof customInstance>;
277
+ } | undefined) => UseSuspenseQueryOptions<ProductUnitGetResponse, TError, TData, QueryKey> & {
278
+ queryKey: QueryKey;
279
+ };
280
+ type GetProductSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getProduct>>>;
281
+ type GetProductSuspenseQueryError = ErrorType<AsError | void>;
282
+ /**
283
+ * @summary Gets a Product
284
+ */
285
+ declare const useGetProductSuspense: <TData = ProductUnitGetResponse, TError = ErrorType<void | AsError>>(productId: string, options?: {
286
+ query?: Partial<UseSuspenseQueryOptions<ProductUnitGetResponse, TError, TData, QueryKey>> | undefined;
287
+ request?: SecondParameter<typeof customInstance>;
288
+ } | undefined) => UseSuspenseQueryResult<TData, TError> & {
289
+ queryKey: QueryKey;
290
+ };
291
+ /**
292
+ * 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**.
293
+
294
+ * @summary Deletes an existing Product
295
+ */
296
+ declare const deleteProduct: (productId: string, options?: SecondParameter<typeof customInstance>) => Promise<void>;
297
+ declare const getDeleteProductMutationOptions: <TError = ErrorType<AsError>, TContext = unknown>(options?: {
298
+ mutation?: UseMutationOptions<void, TError, {
299
+ productId: string;
300
+ }, TContext> | undefined;
301
+ request?: SecondParameter<typeof customInstance>;
302
+ } | undefined) => UseMutationOptions<void, TError, {
303
+ productId: string;
304
+ }, TContext>;
305
+ type DeleteProductMutationResult = NonNullable<Awaited<ReturnType<typeof deleteProduct>>>;
306
+ type DeleteProductMutationError = ErrorType<AsError>;
307
+ /**
308
+ * @summary Deletes an existing Product
309
+ */
310
+ declare const useDeleteProduct: <TError = ErrorType<AsError>, TContext = unknown>(options?: {
311
+ mutation?: UseMutationOptions<void, TError, {
312
+ productId: string;
313
+ }, TContext> | undefined;
314
+ request?: SecondParameter<typeof customInstance>;
315
+ } | undefined) => _tanstack_react_query_build_legacy_types.UseMutationResult<void, TError, {
316
+ productId: string;
317
+ }, TContext>;
318
+ /**
319
+ * Used to update some adjustable parameters of a Product, i.e. to extend its **Allowance** or **Limit**.
320
+
321
+ 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`
322
+
323
+ * @summary Adjust an existing Product
324
+ */
325
+ declare const patchProduct: (productId: string, productPatchBodyBody: ProductPatchBodyBody, options?: SecondParameter<typeof customInstance>) => Promise<void>;
326
+ declare const getPatchProductMutationOptions: <TError = ErrorType<AsError>, TContext = unknown>(options?: {
327
+ mutation?: UseMutationOptions<void, TError, {
328
+ productId: string;
329
+ data: ProductPatchBodyBody;
330
+ }, TContext> | undefined;
331
+ request?: SecondParameter<typeof customInstance>;
332
+ } | undefined) => UseMutationOptions<void, TError, {
333
+ productId: string;
334
+ data: ProductPatchBodyBody;
335
+ }, TContext>;
336
+ type PatchProductMutationResult = NonNullable<Awaited<ReturnType<typeof patchProduct>>>;
337
+ type PatchProductMutationBody = ProductPatchBodyBody;
338
+ type PatchProductMutationError = ErrorType<AsError>;
339
+ /**
340
+ * @summary Adjust an existing Product
341
+ */
342
+ declare const usePatchProduct: <TError = ErrorType<AsError>, TContext = unknown>(options?: {
343
+ mutation?: UseMutationOptions<void, TError, {
344
+ productId: string;
345
+ data: ProductPatchBodyBody;
346
+ }, TContext> | undefined;
347
+ request?: SecondParameter<typeof customInstance>;
348
+ } | undefined) => _tanstack_react_query_build_legacy_types.UseMutationResult<void, TError, {
349
+ productId: string;
350
+ data: ProductPatchBodyBody;
351
+ }, TContext>;
352
+ /**
353
+ * 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.
354
+
355
+ 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.
356
+
357
+ **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.
358
+
359
+ You need to be part of the **Unit** or **Organisation** to use this method
360
+ * @summary Get charges made against a Product
361
+ */
362
+ declare const getProductCharges: (productId: string, params?: GetProductChargesParams, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<ProductChargesGetResponse>;
363
+ declare const getGetProductChargesQueryKey: (productId: string, params?: GetProductChargesParams) => readonly ["account-server-api", `/product/${string}/charges`, ...GetProductChargesParams[]];
364
+ declare const getGetProductChargesQueryOptions: <TData = ProductChargesGetResponse, TError = ErrorType<void | AsError>>(productId: string, params?: GetProductChargesParams, options?: {
365
+ query?: Partial<UseQueryOptions<ProductChargesGetResponse, TError, TData, QueryKey>> | undefined;
366
+ request?: SecondParameter<typeof customInstance>;
367
+ } | undefined) => UseQueryOptions<ProductChargesGetResponse, TError, TData, QueryKey> & {
368
+ queryKey: QueryKey;
369
+ };
370
+ type GetProductChargesQueryResult = NonNullable<Awaited<ReturnType<typeof getProductCharges>>>;
371
+ type GetProductChargesQueryError = ErrorType<AsError | void>;
372
+ /**
373
+ * @summary Get charges made against a Product
374
+ */
375
+ declare const useGetProductCharges: <TData = ProductChargesGetResponse, TError = ErrorType<void | AsError>>(productId: string, params?: GetProductChargesParams, options?: {
376
+ query?: Partial<UseQueryOptions<ProductChargesGetResponse, TError, TData, QueryKey>> | undefined;
377
+ request?: SecondParameter<typeof customInstance>;
378
+ } | undefined) => UseQueryResult<TData, TError> & {
379
+ queryKey: QueryKey;
380
+ };
381
+ declare const getGetProductChargesSuspenseQueryOptions: <TData = ProductChargesGetResponse, TError = ErrorType<void | AsError>>(productId: string, params?: GetProductChargesParams, options?: {
382
+ query?: Partial<UseSuspenseQueryOptions<ProductChargesGetResponse, TError, TData, QueryKey>> | undefined;
383
+ request?: SecondParameter<typeof customInstance>;
384
+ } | undefined) => UseSuspenseQueryOptions<ProductChargesGetResponse, TError, TData, QueryKey> & {
385
+ queryKey: QueryKey;
386
+ };
387
+ type GetProductChargesSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getProductCharges>>>;
388
+ type GetProductChargesSuspenseQueryError = ErrorType<AsError | void>;
389
+ /**
390
+ * @summary Get charges made against a Product
391
+ */
392
+ declare const useGetProductChargesSuspense: <TData = ProductChargesGetResponse, TError = ErrorType<void | AsError>>(productId: string, params?: GetProductChargesParams, options?: {
393
+ query?: Partial<UseSuspenseQueryOptions<ProductChargesGetResponse, TError, TData, QueryKey>> | undefined;
394
+ request?: SecondParameter<typeof customInstance>;
395
+ } | undefined) => UseSuspenseQueryResult<TData, TError> & {
396
+ queryKey: QueryKey;
397
+ };
398
+
399
+ export { type CreateUnitProductMutationBody, type CreateUnitProductMutationError, type CreateUnitProductMutationResult, type DeleteProductMutationError, type DeleteProductMutationResult, type GetProductChargesQueryError, type GetProductChargesQueryResult, type GetProductChargesSuspenseQueryError, type GetProductChargesSuspenseQueryResult, type GetProductDefaultStorageCostQueryError, type GetProductDefaultStorageCostQueryResult, type GetProductDefaultStorageCostSuspenseQueryError, type GetProductDefaultStorageCostSuspenseQueryResult, type GetProductQueryError, type GetProductQueryResult, type GetProductSuspenseQueryError, type GetProductSuspenseQueryResult, type GetProductTypesQueryError, type GetProductTypesQueryResult, type GetProductTypesSuspenseQueryError, type GetProductTypesSuspenseQueryResult, type GetProductsForOrganisationQueryError, type GetProductsForOrganisationQueryResult, type GetProductsForOrganisationSuspenseQueryError, type GetProductsForOrganisationSuspenseQueryResult, type GetProductsForUnitQueryError, type GetProductsForUnitQueryResult, type GetProductsForUnitSuspenseQueryError, type GetProductsForUnitSuspenseQueryResult, type GetProductsQueryError, type GetProductsQueryResult, type GetProductsSuspenseQueryError, type GetProductsSuspenseQueryResult, type PatchProductMutationBody, type PatchProductMutationError, type PatchProductMutationResult, createUnitProduct, deleteProduct, getCreateUnitProductMutationOptions, getDeleteProductMutationOptions, getGetProductChargesQueryKey, getGetProductChargesQueryOptions, getGetProductChargesSuspenseQueryOptions, getGetProductDefaultStorageCostQueryKey, getGetProductDefaultStorageCostQueryOptions, getGetProductDefaultStorageCostSuspenseQueryOptions, getGetProductQueryKey, getGetProductQueryOptions, getGetProductSuspenseQueryOptions, getGetProductTypesQueryKey, getGetProductTypesQueryOptions, getGetProductTypesSuspenseQueryOptions, getGetProductsForOrganisationQueryKey, getGetProductsForOrganisationQueryOptions, getGetProductsForOrganisationSuspenseQueryOptions, getGetProductsForUnitQueryKey, getGetProductsForUnitQueryOptions, getGetProductsForUnitSuspenseQueryOptions, getGetProductsQueryKey, getGetProductsQueryOptions, getGetProductsSuspenseQueryOptions, getPatchProductMutationOptions, getProduct, getProductCharges, getProductDefaultStorageCost, getProductTypes, getProducts, getProductsForOrganisation, getProductsForUnit, patchProduct, useCreateUnitProduct, useDeleteProduct, useGetProduct, useGetProductCharges, useGetProductChargesSuspense, useGetProductDefaultStorageCost, useGetProductDefaultStorageCostSuspense, useGetProductSuspense, useGetProductTypes, useGetProductTypesSuspense, useGetProducts, useGetProductsForOrganisation, useGetProductsForOrganisationSuspense, useGetProductsForUnit, useGetProductsForUnitSuspense, useGetProductsSuspense, usePatchProduct };