@squonk/account-server-client 4.2.5 → 4.4.0-4-4.2174353771

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 (92) hide show
  1. package/actions/actions.cjs +53 -0
  2. package/actions/actions.cjs.map +1 -0
  3. package/actions/actions.d.cts +72 -0
  4. package/actions/actions.d.ts +72 -0
  5. package/actions/actions.js +53 -0
  6. package/actions/actions.js.map +1 -0
  7. package/actions/package.json +7 -0
  8. package/asset/asset.cjs +99 -126
  9. package/asset/asset.cjs.map +1 -1
  10. package/asset/asset.d.cts +99 -99
  11. package/asset/asset.d.ts +99 -99
  12. package/asset/asset.js +107 -134
  13. package/asset/asset.js.map +1 -1
  14. package/charges/charges.cjs +73 -85
  15. package/charges/charges.cjs.map +1 -1
  16. package/charges/charges.d.cts +47 -47
  17. package/charges/charges.d.ts +47 -47
  18. package/charges/charges.js +78 -90
  19. package/charges/charges.js.map +1 -1
  20. package/chunk-76ADQBHZ.js +25 -0
  21. package/chunk-76ADQBHZ.js.map +1 -0
  22. package/chunk-KHB5TJT7.cjs +25 -0
  23. package/chunk-KHB5TJT7.cjs.map +1 -0
  24. package/{chunk-TKLTUR4R.cjs → chunk-RB2KVIEK.cjs} +1 -1
  25. package/chunk-RB2KVIEK.cjs.map +1 -0
  26. package/{chunk-EBOQPVLG.js → chunk-XYDLYMQ2.js} +1 -1
  27. package/chunk-XYDLYMQ2.js.map +1 -0
  28. package/event-stream/event-stream.cjs +53 -61
  29. package/event-stream/event-stream.cjs.map +1 -1
  30. package/event-stream/event-stream.d.cts +44 -44
  31. package/event-stream/event-stream.d.ts +44 -44
  32. package/event-stream/event-stream.js +58 -66
  33. package/event-stream/event-stream.js.map +1 -1
  34. package/index.cjs +56 -58
  35. package/index.cjs.map +1 -1
  36. package/index.d.cts +867 -777
  37. package/index.d.ts +867 -777
  38. package/index.js +55 -57
  39. package/index.js.map +1 -1
  40. package/merchant/merchant.cjs +38 -45
  41. package/merchant/merchant.cjs.map +1 -1
  42. package/merchant/merchant.d.cts +25 -25
  43. package/merchant/merchant.d.ts +25 -25
  44. package/merchant/merchant.js +42 -49
  45. package/merchant/merchant.js.map +1 -1
  46. package/organisation/organisation.cjs +77 -87
  47. package/organisation/organisation.cjs.map +1 -1
  48. package/organisation/organisation.d.cts +72 -70
  49. package/organisation/organisation.d.ts +72 -70
  50. package/organisation/organisation.js +83 -93
  51. package/organisation/organisation.js.map +1 -1
  52. package/package.json +15 -18
  53. package/product/product.cjs +143 -153
  54. package/product/product.cjs.map +1 -1
  55. package/product/product.d.cts +100 -100
  56. package/product/product.d.ts +100 -100
  57. package/product/product.js +153 -163
  58. package/product/product.js.map +1 -1
  59. package/src/{account-server-api.schemas.ts → API_TARGET_NAME.schemas.ts} +931 -849
  60. package/src/actions/actions.ts +249 -0
  61. package/src/asset/asset.ts +899 -634
  62. package/src/charges/charges.ts +822 -498
  63. package/src/custom-instance.ts +3 -3
  64. package/src/event-stream/event-stream.ts +530 -344
  65. package/src/index.ts +3 -3
  66. package/src/merchant/merchant.ts +355 -234
  67. package/src/options-mutator.ts +27 -0
  68. package/src/organisation/organisation.ts +812 -504
  69. package/src/product/product.ts +1373 -841
  70. package/src/state/state.ts +174 -127
  71. package/src/unit/unit.ts +1273 -603
  72. package/src/user/user.ts +895 -564
  73. package/state/state.cjs +22 -24
  74. package/state/state.cjs.map +1 -1
  75. package/state/state.d.cts +14 -14
  76. package/state/state.d.ts +14 -14
  77. package/state/state.js +24 -26
  78. package/state/state.js.map +1 -1
  79. package/unit/unit.cjs +171 -106
  80. package/unit/unit.cjs.map +1 -1
  81. package/unit/unit.d.cts +200 -90
  82. package/unit/unit.d.ts +200 -90
  83. package/unit/unit.js +179 -114
  84. package/unit/unit.js.map +1 -1
  85. package/user/user.cjs +94 -110
  86. package/user/user.cjs.map +1 -1
  87. package/user/user.d.cts +77 -77
  88. package/user/user.d.ts +77 -77
  89. package/user/user.js +101 -117
  90. package/user/user.js.map +1 -1
  91. package/chunk-EBOQPVLG.js.map +0 -1
  92. package/chunk-TKLTUR4R.cjs.map +0 -1
@@ -1,163 +1,160 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
- var _chunkTKLTUR4Rcjs = require('../chunk-TKLTUR4R.cjs');
4
-
5
- // src/product/product.ts
6
3
 
4
+ var _chunkKHB5TJT7cjs = require('../chunk-KHB5TJT7.cjs');
7
5
 
8
6
 
7
+ var _chunkRB2KVIEKcjs = require('../chunk-RB2KVIEK.cjs');
9
8
 
9
+ // src/product/product.ts
10
10
  var _reactquery = require('@tanstack/react-query');
11
11
  var getProductTypes = (options, signal) => {
12
- return _chunkTKLTUR4Rcjs.customInstance.call(void 0,
13
- {
14
- url: `/product-type`,
15
- method: "GET",
16
- signal
17
- },
12
+ return _chunkRB2KVIEKcjs.customInstance.call(void 0,
13
+ { url: `/product-type`, method: "GET", signal },
18
14
  options
19
15
  );
20
16
  };
21
17
  var getGetProductTypesQueryKey = () => {
22
- return ["account-server-api", `/product-type`];
18
+ return [`/product-type`];
23
19
  };
24
- var getGetProductTypesQueryOptions = (options) => {
20
+ var useGetProductTypesQueryOptions = (options) => {
25
21
  const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
26
- const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetProductTypesQueryKey()));
22
+ const queryKey = _nullishCoalesce(_optionalChain([queryOptions, 'optionalAccess', _ => _.queryKey]), () => ( getGetProductTypesQueryKey()));
27
23
  const queryFn = ({ signal }) => getProductTypes(requestOptions, signal);
28
- return { queryKey, queryFn, ...queryOptions };
24
+ const customOptions = _chunkKHB5TJT7cjs.queryMutator.call(void 0, { ...queryOptions, queryKey, queryFn });
25
+ return customOptions;
29
26
  };
30
- function useGetProductTypes(options) {
31
- const queryOptions = getGetProductTypesQueryOptions(options);
32
- const query = _reactquery.useQuery.call(void 0, queryOptions);
27
+ function useGetProductTypes(options, queryClient) {
28
+ const queryOptions = useGetProductTypesQueryOptions(options);
29
+ const query = _reactquery.useQuery.call(void 0, queryOptions, queryClient);
33
30
  query.queryKey = queryOptions.queryKey;
34
31
  return query;
35
32
  }
36
- var getGetProductTypesSuspenseQueryOptions = (options) => {
33
+ var useGetProductTypesSuspenseQueryOptions = (options) => {
37
34
  const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
38
- const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetProductTypesQueryKey()));
35
+ const queryKey = _nullishCoalesce(_optionalChain([queryOptions, 'optionalAccess', _2 => _2.queryKey]), () => ( getGetProductTypesQueryKey()));
39
36
  const queryFn = ({ signal }) => getProductTypes(requestOptions, signal);
40
- return { queryKey, queryFn, ...queryOptions };
37
+ const customOptions = _chunkKHB5TJT7cjs.queryMutator.call(void 0, { ...queryOptions, queryKey, queryFn });
38
+ return customOptions;
41
39
  };
42
- function useGetProductTypesSuspense(options) {
43
- const queryOptions = getGetProductTypesSuspenseQueryOptions(options);
44
- const query = _reactquery.useSuspenseQuery.call(void 0, queryOptions);
40
+ function useGetProductTypesSuspense(options, queryClient) {
41
+ const queryOptions = useGetProductTypesSuspenseQueryOptions(options);
42
+ const query = _reactquery.useSuspenseQuery.call(void 0, queryOptions, queryClient);
45
43
  query.queryKey = queryOptions.queryKey;
46
44
  return query;
47
45
  }
48
46
  var getProductDefaultStorageCost = (options, signal) => {
49
- return _chunkTKLTUR4Rcjs.customInstance.call(void 0,
50
- {
51
- url: `/product-default-storage-cost`,
52
- method: "GET",
53
- signal
54
- },
47
+ return _chunkRB2KVIEKcjs.customInstance.call(void 0,
48
+ { url: `/product-default-storage-cost`, method: "GET", signal },
55
49
  options
56
50
  );
57
51
  };
58
52
  var getGetProductDefaultStorageCostQueryKey = () => {
59
- return ["account-server-api", `/product-default-storage-cost`];
53
+ return [`/product-default-storage-cost`];
60
54
  };
61
- var getGetProductDefaultStorageCostQueryOptions = (options) => {
55
+ var useGetProductDefaultStorageCostQueryOptions = (options) => {
62
56
  const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
63
- const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetProductDefaultStorageCostQueryKey()));
64
- const queryFn = ({ signal }) => getProductDefaultStorageCost(requestOptions, signal);
65
- return { queryKey, queryFn, ...queryOptions };
66
- };
67
- function useGetProductDefaultStorageCost(options) {
68
- const queryOptions = getGetProductDefaultStorageCostQueryOptions(options);
69
- const query = _reactquery.useQuery.call(void 0, queryOptions);
57
+ const queryKey = _nullishCoalesce(_optionalChain([queryOptions, 'optionalAccess', _3 => _3.queryKey]), () => ( getGetProductDefaultStorageCostQueryKey()));
58
+ const queryFn = ({
59
+ signal
60
+ }) => getProductDefaultStorageCost(requestOptions, signal);
61
+ const customOptions = _chunkKHB5TJT7cjs.queryMutator.call(void 0, { ...queryOptions, queryKey, queryFn });
62
+ return customOptions;
63
+ };
64
+ function useGetProductDefaultStorageCost(options, queryClient) {
65
+ const queryOptions = useGetProductDefaultStorageCostQueryOptions(options);
66
+ const query = _reactquery.useQuery.call(void 0, queryOptions, queryClient);
70
67
  query.queryKey = queryOptions.queryKey;
71
68
  return query;
72
69
  }
73
- var getGetProductDefaultStorageCostSuspenseQueryOptions = (options) => {
70
+ var useGetProductDefaultStorageCostSuspenseQueryOptions = (options) => {
74
71
  const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
75
- const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetProductDefaultStorageCostQueryKey()));
76
- const queryFn = ({ signal }) => getProductDefaultStorageCost(requestOptions, signal);
77
- return { queryKey, queryFn, ...queryOptions };
78
- };
79
- function useGetProductDefaultStorageCostSuspense(options) {
80
- const queryOptions = getGetProductDefaultStorageCostSuspenseQueryOptions(options);
81
- const query = _reactquery.useSuspenseQuery.call(void 0, queryOptions);
72
+ const queryKey = _nullishCoalesce(_optionalChain([queryOptions, 'optionalAccess', _4 => _4.queryKey]), () => ( getGetProductDefaultStorageCostQueryKey()));
73
+ const queryFn = ({
74
+ signal
75
+ }) => getProductDefaultStorageCost(requestOptions, signal);
76
+ const customOptions = _chunkKHB5TJT7cjs.queryMutator.call(void 0, { ...queryOptions, queryKey, queryFn });
77
+ return customOptions;
78
+ };
79
+ function useGetProductDefaultStorageCostSuspense(options, queryClient) {
80
+ const queryOptions = useGetProductDefaultStorageCostSuspenseQueryOptions(options);
81
+ const query = _reactquery.useSuspenseQuery.call(void 0, queryOptions, queryClient);
82
82
  query.queryKey = queryOptions.queryKey;
83
83
  return query;
84
84
  }
85
85
  var getProducts = (options, signal) => {
86
- return _chunkTKLTUR4Rcjs.customInstance.call(void 0,
87
- {
88
- url: `/product`,
89
- method: "GET",
90
- signal
91
- },
92
- options
93
- );
86
+ return _chunkRB2KVIEKcjs.customInstance.call(void 0, { url: `/product`, method: "GET", signal }, options);
94
87
  };
95
88
  var getGetProductsQueryKey = () => {
96
- return ["account-server-api", `/product`];
89
+ return [`/product`];
97
90
  };
98
- var getGetProductsQueryOptions = (options) => {
91
+ var useGetProductsQueryOptions = (options) => {
99
92
  const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
100
- const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetProductsQueryKey()));
93
+ const queryKey = _nullishCoalesce(_optionalChain([queryOptions, 'optionalAccess', _5 => _5.queryKey]), () => ( getGetProductsQueryKey()));
101
94
  const queryFn = ({ signal }) => getProducts(requestOptions, signal);
102
- return { queryKey, queryFn, ...queryOptions };
95
+ const customOptions = _chunkKHB5TJT7cjs.queryMutator.call(void 0, { ...queryOptions, queryKey, queryFn });
96
+ return customOptions;
103
97
  };
104
- function useGetProducts(options) {
105
- const queryOptions = getGetProductsQueryOptions(options);
106
- const query = _reactquery.useQuery.call(void 0, queryOptions);
98
+ function useGetProducts(options, queryClient) {
99
+ const queryOptions = useGetProductsQueryOptions(options);
100
+ const query = _reactquery.useQuery.call(void 0, queryOptions, queryClient);
107
101
  query.queryKey = queryOptions.queryKey;
108
102
  return query;
109
103
  }
110
- var getGetProductsSuspenseQueryOptions = (options) => {
104
+ var useGetProductsSuspenseQueryOptions = (options) => {
111
105
  const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
112
- const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetProductsQueryKey()));
106
+ const queryKey = _nullishCoalesce(_optionalChain([queryOptions, 'optionalAccess', _6 => _6.queryKey]), () => ( getGetProductsQueryKey()));
113
107
  const queryFn = ({ signal }) => getProducts(requestOptions, signal);
114
- return { queryKey, queryFn, ...queryOptions };
108
+ const customOptions = _chunkKHB5TJT7cjs.queryMutator.call(void 0, { ...queryOptions, queryKey, queryFn });
109
+ return customOptions;
115
110
  };
116
- function useGetProductsSuspense(options) {
117
- const queryOptions = getGetProductsSuspenseQueryOptions(options);
118
- const query = _reactquery.useSuspenseQuery.call(void 0, queryOptions);
111
+ function useGetProductsSuspense(options, queryClient) {
112
+ const queryOptions = useGetProductsSuspenseQueryOptions(options);
113
+ const query = _reactquery.useSuspenseQuery.call(void 0, queryOptions, queryClient);
119
114
  query.queryKey = queryOptions.queryKey;
120
115
  return query;
121
116
  }
122
117
  var getProductsForOrganisation = (orgId, options, signal) => {
123
- return _chunkTKLTUR4Rcjs.customInstance.call(void 0,
124
- {
125
- url: `/product/organisation/${orgId}`,
126
- method: "GET",
127
- signal
128
- },
118
+ return _chunkRB2KVIEKcjs.customInstance.call(void 0,
119
+ { url: `/product/organisation/${orgId}`, method: "GET", signal },
129
120
  options
130
121
  );
131
122
  };
132
123
  var getGetProductsForOrganisationQueryKey = (orgId) => {
133
- return ["account-server-api", `/product/organisation/${orgId}`];
124
+ return [`/product/organisation/${orgId}`];
134
125
  };
135
- var getGetProductsForOrganisationQueryOptions = (orgId, options) => {
126
+ var useGetProductsForOrganisationQueryOptions = (orgId, options) => {
136
127
  const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
137
- const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetProductsForOrganisationQueryKey(orgId)));
138
- const queryFn = ({ signal }) => getProductsForOrganisation(orgId, requestOptions, signal);
139
- return { queryKey, queryFn, enabled: !!orgId, ...queryOptions };
140
- };
141
- function useGetProductsForOrganisation(orgId, options) {
142
- const queryOptions = getGetProductsForOrganisationQueryOptions(orgId, options);
143
- const query = _reactquery.useQuery.call(void 0, queryOptions);
128
+ const queryKey = _nullishCoalesce(_optionalChain([queryOptions, 'optionalAccess', _7 => _7.queryKey]), () => ( getGetProductsForOrganisationQueryKey(orgId)));
129
+ const queryFn = ({
130
+ signal
131
+ }) => getProductsForOrganisation(orgId, requestOptions, signal);
132
+ const customOptions = _chunkKHB5TJT7cjs.queryMutator.call(void 0, { ...queryOptions, queryKey, queryFn });
133
+ return customOptions;
134
+ };
135
+ function useGetProductsForOrganisation(orgId, options, queryClient) {
136
+ const queryOptions = useGetProductsForOrganisationQueryOptions(orgId, options);
137
+ const query = _reactquery.useQuery.call(void 0, queryOptions, queryClient);
144
138
  query.queryKey = queryOptions.queryKey;
145
139
  return query;
146
140
  }
147
- var getGetProductsForOrganisationSuspenseQueryOptions = (orgId, options) => {
141
+ var useGetProductsForOrganisationSuspenseQueryOptions = (orgId, options) => {
148
142
  const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
149
- const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetProductsForOrganisationQueryKey(orgId)));
150
- const queryFn = ({ signal }) => getProductsForOrganisation(orgId, requestOptions, signal);
151
- return { queryKey, queryFn, ...queryOptions };
152
- };
153
- function useGetProductsForOrganisationSuspense(orgId, options) {
154
- const queryOptions = getGetProductsForOrganisationSuspenseQueryOptions(orgId, options);
155
- const query = _reactquery.useSuspenseQuery.call(void 0, queryOptions);
143
+ const queryKey = _nullishCoalesce(_optionalChain([queryOptions, 'optionalAccess', _8 => _8.queryKey]), () => ( getGetProductsForOrganisationQueryKey(orgId)));
144
+ const queryFn = ({
145
+ signal
146
+ }) => getProductsForOrganisation(orgId, requestOptions, signal);
147
+ const customOptions = _chunkKHB5TJT7cjs.queryMutator.call(void 0, { ...queryOptions, queryKey, queryFn });
148
+ return customOptions;
149
+ };
150
+ function useGetProductsForOrganisationSuspense(orgId, options, queryClient) {
151
+ const queryOptions = useGetProductsForOrganisationSuspenseQueryOptions(orgId, options);
152
+ const query = _reactquery.useSuspenseQuery.call(void 0, queryOptions, queryClient);
156
153
  query.queryKey = queryOptions.queryKey;
157
154
  return query;
158
155
  }
159
156
  var createUnitProduct = (unitId, unitProductPostBodyBody, options, signal) => {
160
- return _chunkTKLTUR4Rcjs.customInstance.call(void 0,
157
+ return _chunkRB2KVIEKcjs.customInstance.call(void 0,
161
158
  {
162
159
  url: `/product/unit/${unitId}`,
163
160
  method: "POST",
@@ -168,117 +165,109 @@ var createUnitProduct = (unitId, unitProductPostBodyBody, options, signal) => {
168
165
  options
169
166
  );
170
167
  };
171
- var getCreateUnitProductMutationOptions = (options) => {
168
+ var useCreateUnitProductMutationOptions = (options) => {
172
169
  const mutationKey = ["createUnitProduct"];
173
170
  const { mutation: mutationOptions, request: requestOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey }, request: void 0 };
174
171
  const mutationFn = (props) => {
175
172
  const { unitId, data } = _nullishCoalesce(props, () => ( {}));
176
173
  return createUnitProduct(unitId, data, requestOptions);
177
174
  };
178
- return { mutationFn, ...mutationOptions };
175
+ const customOptions = _chunkKHB5TJT7cjs.mutationMutator.call(void 0, { ...mutationOptions, mutationFn });
176
+ return customOptions;
179
177
  };
180
- var useCreateUnitProduct = (options) => {
181
- const mutationOptions = getCreateUnitProductMutationOptions(options);
182
- return _reactquery.useMutation.call(void 0, mutationOptions);
178
+ var useCreateUnitProduct = (options, queryClient) => {
179
+ const mutationOptions = useCreateUnitProductMutationOptions(options);
180
+ return _reactquery.useMutation.call(void 0, mutationOptions, queryClient);
183
181
  };
184
182
  var getProductsForUnit = (unitId, options, signal) => {
185
- return _chunkTKLTUR4Rcjs.customInstance.call(void 0,
186
- {
187
- url: `/product/unit/${unitId}`,
188
- method: "GET",
189
- signal
190
- },
183
+ return _chunkRB2KVIEKcjs.customInstance.call(void 0,
184
+ { url: `/product/unit/${unitId}`, method: "GET", signal },
191
185
  options
192
186
  );
193
187
  };
194
188
  var getGetProductsForUnitQueryKey = (unitId) => {
195
- return ["account-server-api", `/product/unit/${unitId}`];
189
+ return [`/product/unit/${unitId}`];
196
190
  };
197
- var getGetProductsForUnitQueryOptions = (unitId, options) => {
191
+ var useGetProductsForUnitQueryOptions = (unitId, options) => {
198
192
  const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
199
- const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetProductsForUnitQueryKey(unitId)));
193
+ const queryKey = _nullishCoalesce(_optionalChain([queryOptions, 'optionalAccess', _9 => _9.queryKey]), () => ( getGetProductsForUnitQueryKey(unitId)));
200
194
  const queryFn = ({ signal }) => getProductsForUnit(unitId, requestOptions, signal);
201
- return { queryKey, queryFn, enabled: !!unitId, ...queryOptions };
195
+ const customOptions = _chunkKHB5TJT7cjs.queryMutator.call(void 0, { ...queryOptions, queryKey, queryFn });
196
+ return customOptions;
202
197
  };
203
- function useGetProductsForUnit(unitId, options) {
204
- const queryOptions = getGetProductsForUnitQueryOptions(unitId, options);
205
- const query = _reactquery.useQuery.call(void 0, queryOptions);
198
+ function useGetProductsForUnit(unitId, options, queryClient) {
199
+ const queryOptions = useGetProductsForUnitQueryOptions(unitId, options);
200
+ const query = _reactquery.useQuery.call(void 0, queryOptions, queryClient);
206
201
  query.queryKey = queryOptions.queryKey;
207
202
  return query;
208
203
  }
209
- var getGetProductsForUnitSuspenseQueryOptions = (unitId, options) => {
204
+ var useGetProductsForUnitSuspenseQueryOptions = (unitId, options) => {
210
205
  const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
211
- const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetProductsForUnitQueryKey(unitId)));
206
+ const queryKey = _nullishCoalesce(_optionalChain([queryOptions, 'optionalAccess', _10 => _10.queryKey]), () => ( getGetProductsForUnitQueryKey(unitId)));
212
207
  const queryFn = ({ signal }) => getProductsForUnit(unitId, requestOptions, signal);
213
- return { queryKey, queryFn, ...queryOptions };
208
+ const customOptions = _chunkKHB5TJT7cjs.queryMutator.call(void 0, { ...queryOptions, queryKey, queryFn });
209
+ return customOptions;
214
210
  };
215
- function useGetProductsForUnitSuspense(unitId, options) {
216
- const queryOptions = getGetProductsForUnitSuspenseQueryOptions(unitId, options);
217
- const query = _reactquery.useSuspenseQuery.call(void 0, queryOptions);
211
+ function useGetProductsForUnitSuspense(unitId, options, queryClient) {
212
+ const queryOptions = useGetProductsForUnitSuspenseQueryOptions(unitId, options);
213
+ const query = _reactquery.useSuspenseQuery.call(void 0, queryOptions, queryClient);
218
214
  query.queryKey = queryOptions.queryKey;
219
215
  return query;
220
216
  }
221
217
  var getProduct = (productId, options, signal) => {
222
- return _chunkTKLTUR4Rcjs.customInstance.call(void 0,
223
- {
224
- url: `/product/${productId}`,
225
- method: "GET",
226
- signal
227
- },
218
+ return _chunkRB2KVIEKcjs.customInstance.call(void 0,
219
+ { url: `/product/${productId}`, method: "GET", signal },
228
220
  options
229
221
  );
230
222
  };
231
223
  var getGetProductQueryKey = (productId) => {
232
- return ["account-server-api", `/product/${productId}`];
224
+ return [`/product/${productId}`];
233
225
  };
234
- var getGetProductQueryOptions = (productId, options) => {
226
+ var useGetProductQueryOptions = (productId, options) => {
235
227
  const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
236
- const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetProductQueryKey(productId)));
228
+ const queryKey = _nullishCoalesce(_optionalChain([queryOptions, 'optionalAccess', _11 => _11.queryKey]), () => ( getGetProductQueryKey(productId)));
237
229
  const queryFn = ({ signal }) => getProduct(productId, requestOptions, signal);
238
- return { queryKey, queryFn, enabled: !!productId, ...queryOptions };
230
+ const customOptions = _chunkKHB5TJT7cjs.queryMutator.call(void 0, { ...queryOptions, queryKey, queryFn });
231
+ return customOptions;
239
232
  };
240
- function useGetProduct(productId, options) {
241
- const queryOptions = getGetProductQueryOptions(productId, options);
242
- const query = _reactquery.useQuery.call(void 0, queryOptions);
233
+ function useGetProduct(productId, options, queryClient) {
234
+ const queryOptions = useGetProductQueryOptions(productId, options);
235
+ const query = _reactquery.useQuery.call(void 0, queryOptions, queryClient);
243
236
  query.queryKey = queryOptions.queryKey;
244
237
  return query;
245
238
  }
246
- var getGetProductSuspenseQueryOptions = (productId, options) => {
239
+ var useGetProductSuspenseQueryOptions = (productId, options) => {
247
240
  const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
248
- const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetProductQueryKey(productId)));
241
+ const queryKey = _nullishCoalesce(_optionalChain([queryOptions, 'optionalAccess', _12 => _12.queryKey]), () => ( getGetProductQueryKey(productId)));
249
242
  const queryFn = ({ signal }) => getProduct(productId, requestOptions, signal);
250
- return { queryKey, queryFn, ...queryOptions };
243
+ const customOptions = _chunkKHB5TJT7cjs.queryMutator.call(void 0, { ...queryOptions, queryKey, queryFn });
244
+ return customOptions;
251
245
  };
252
- function useGetProductSuspense(productId, options) {
253
- const queryOptions = getGetProductSuspenseQueryOptions(productId, options);
254
- const query = _reactquery.useSuspenseQuery.call(void 0, queryOptions);
246
+ function useGetProductSuspense(productId, options, queryClient) {
247
+ const queryOptions = useGetProductSuspenseQueryOptions(productId, options);
248
+ const query = _reactquery.useSuspenseQuery.call(void 0, queryOptions, queryClient);
255
249
  query.queryKey = queryOptions.queryKey;
256
250
  return query;
257
251
  }
258
252
  var deleteProduct = (productId, options) => {
259
- return _chunkTKLTUR4Rcjs.customInstance.call(void 0,
260
- {
261
- url: `/product/${productId}`,
262
- method: "DELETE"
263
- },
264
- options
265
- );
253
+ return _chunkRB2KVIEKcjs.customInstance.call(void 0, { url: `/product/${productId}`, method: "DELETE" }, options);
266
254
  };
267
- var getDeleteProductMutationOptions = (options) => {
255
+ var useDeleteProductMutationOptions = (options) => {
268
256
  const mutationKey = ["deleteProduct"];
269
257
  const { mutation: mutationOptions, request: requestOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey }, request: void 0 };
270
258
  const mutationFn = (props) => {
271
259
  const { productId } = _nullishCoalesce(props, () => ( {}));
272
260
  return deleteProduct(productId, requestOptions);
273
261
  };
274
- return { mutationFn, ...mutationOptions };
262
+ const customOptions = _chunkKHB5TJT7cjs.mutationMutator.call(void 0, { ...mutationOptions, mutationFn });
263
+ return customOptions;
275
264
  };
276
- var useDeleteProduct = (options) => {
277
- const mutationOptions = getDeleteProductMutationOptions(options);
278
- return _reactquery.useMutation.call(void 0, mutationOptions);
265
+ var useDeleteProduct = (options, queryClient) => {
266
+ const mutationOptions = useDeleteProductMutationOptions(options);
267
+ return _reactquery.useMutation.call(void 0, mutationOptions, queryClient);
279
268
  };
280
269
  var patchProduct = (productId, productPatchBodyBody, options) => {
281
- return _chunkTKLTUR4Rcjs.customInstance.call(void 0,
270
+ return _chunkRB2KVIEKcjs.customInstance.call(void 0,
282
271
  {
283
272
  url: `/product/${productId}`,
284
273
  method: "PATCH",
@@ -288,18 +277,19 @@ var patchProduct = (productId, productPatchBodyBody, options) => {
288
277
  options
289
278
  );
290
279
  };
291
- var getPatchProductMutationOptions = (options) => {
280
+ var usePatchProductMutationOptions = (options) => {
292
281
  const mutationKey = ["patchProduct"];
293
282
  const { mutation: mutationOptions, request: requestOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey }, request: void 0 };
294
283
  const mutationFn = (props) => {
295
284
  const { productId, data } = _nullishCoalesce(props, () => ( {}));
296
285
  return patchProduct(productId, data, requestOptions);
297
286
  };
298
- return { mutationFn, ...mutationOptions };
287
+ const customOptions = _chunkKHB5TJT7cjs.mutationMutator.call(void 0, { ...mutationOptions, mutationFn });
288
+ return customOptions;
299
289
  };
300
- var usePatchProduct = (options) => {
301
- const mutationOptions = getPatchProductMutationOptions(options);
302
- return _reactquery.useMutation.call(void 0, mutationOptions);
290
+ var usePatchProduct = (options, queryClient) => {
291
+ const mutationOptions = usePatchProductMutationOptions(options);
292
+ return _reactquery.useMutation.call(void 0, mutationOptions, queryClient);
303
293
  };
304
294
 
305
295
 
@@ -347,5 +337,5 @@ var usePatchProduct = (options) => {
347
337
 
348
338
 
349
339
 
350
- exports.createUnitProduct = createUnitProduct; exports.deleteProduct = deleteProduct; exports.getCreateUnitProductMutationOptions = getCreateUnitProductMutationOptions; exports.getDeleteProductMutationOptions = getDeleteProductMutationOptions; exports.getGetProductDefaultStorageCostQueryKey = getGetProductDefaultStorageCostQueryKey; exports.getGetProductDefaultStorageCostQueryOptions = getGetProductDefaultStorageCostQueryOptions; exports.getGetProductDefaultStorageCostSuspenseQueryOptions = getGetProductDefaultStorageCostSuspenseQueryOptions; exports.getGetProductQueryKey = getGetProductQueryKey; exports.getGetProductQueryOptions = getGetProductQueryOptions; exports.getGetProductSuspenseQueryOptions = getGetProductSuspenseQueryOptions; exports.getGetProductTypesQueryKey = getGetProductTypesQueryKey; exports.getGetProductTypesQueryOptions = getGetProductTypesQueryOptions; exports.getGetProductTypesSuspenseQueryOptions = getGetProductTypesSuspenseQueryOptions; exports.getGetProductsForOrganisationQueryKey = getGetProductsForOrganisationQueryKey; exports.getGetProductsForOrganisationQueryOptions = getGetProductsForOrganisationQueryOptions; exports.getGetProductsForOrganisationSuspenseQueryOptions = getGetProductsForOrganisationSuspenseQueryOptions; exports.getGetProductsForUnitQueryKey = getGetProductsForUnitQueryKey; exports.getGetProductsForUnitQueryOptions = getGetProductsForUnitQueryOptions; exports.getGetProductsForUnitSuspenseQueryOptions = getGetProductsForUnitSuspenseQueryOptions; exports.getGetProductsQueryKey = getGetProductsQueryKey; exports.getGetProductsQueryOptions = getGetProductsQueryOptions; exports.getGetProductsSuspenseQueryOptions = getGetProductsSuspenseQueryOptions; exports.getPatchProductMutationOptions = getPatchProductMutationOptions; exports.getProduct = getProduct; exports.getProductDefaultStorageCost = getProductDefaultStorageCost; exports.getProductTypes = getProductTypes; exports.getProducts = getProducts; exports.getProductsForOrganisation = getProductsForOrganisation; exports.getProductsForUnit = getProductsForUnit; exports.patchProduct = patchProduct; exports.useCreateUnitProduct = useCreateUnitProduct; exports.useDeleteProduct = useDeleteProduct; exports.useGetProduct = useGetProduct; exports.useGetProductDefaultStorageCost = useGetProductDefaultStorageCost; exports.useGetProductDefaultStorageCostSuspense = useGetProductDefaultStorageCostSuspense; exports.useGetProductSuspense = useGetProductSuspense; exports.useGetProductTypes = useGetProductTypes; exports.useGetProductTypesSuspense = useGetProductTypesSuspense; exports.useGetProducts = useGetProducts; exports.useGetProductsForOrganisation = useGetProductsForOrganisation; exports.useGetProductsForOrganisationSuspense = useGetProductsForOrganisationSuspense; exports.useGetProductsForUnit = useGetProductsForUnit; exports.useGetProductsForUnitSuspense = useGetProductsForUnitSuspense; exports.useGetProductsSuspense = useGetProductsSuspense; exports.usePatchProduct = usePatchProduct;
340
+ exports.createUnitProduct = createUnitProduct; exports.deleteProduct = deleteProduct; exports.getGetProductDefaultStorageCostQueryKey = getGetProductDefaultStorageCostQueryKey; exports.getGetProductQueryKey = getGetProductQueryKey; exports.getGetProductTypesQueryKey = getGetProductTypesQueryKey; exports.getGetProductsForOrganisationQueryKey = getGetProductsForOrganisationQueryKey; exports.getGetProductsForUnitQueryKey = getGetProductsForUnitQueryKey; exports.getGetProductsQueryKey = getGetProductsQueryKey; exports.getProduct = getProduct; exports.getProductDefaultStorageCost = getProductDefaultStorageCost; exports.getProductTypes = getProductTypes; exports.getProducts = getProducts; exports.getProductsForOrganisation = getProductsForOrganisation; exports.getProductsForUnit = getProductsForUnit; exports.patchProduct = patchProduct; exports.useCreateUnitProduct = useCreateUnitProduct; exports.useCreateUnitProductMutationOptions = useCreateUnitProductMutationOptions; exports.useDeleteProduct = useDeleteProduct; exports.useDeleteProductMutationOptions = useDeleteProductMutationOptions; exports.useGetProduct = useGetProduct; exports.useGetProductDefaultStorageCost = useGetProductDefaultStorageCost; exports.useGetProductDefaultStorageCostQueryOptions = useGetProductDefaultStorageCostQueryOptions; exports.useGetProductDefaultStorageCostSuspense = useGetProductDefaultStorageCostSuspense; exports.useGetProductDefaultStorageCostSuspenseQueryOptions = useGetProductDefaultStorageCostSuspenseQueryOptions; exports.useGetProductQueryOptions = useGetProductQueryOptions; exports.useGetProductSuspense = useGetProductSuspense; exports.useGetProductSuspenseQueryOptions = useGetProductSuspenseQueryOptions; exports.useGetProductTypes = useGetProductTypes; exports.useGetProductTypesQueryOptions = useGetProductTypesQueryOptions; exports.useGetProductTypesSuspense = useGetProductTypesSuspense; exports.useGetProductTypesSuspenseQueryOptions = useGetProductTypesSuspenseQueryOptions; exports.useGetProducts = useGetProducts; exports.useGetProductsForOrganisation = useGetProductsForOrganisation; exports.useGetProductsForOrganisationQueryOptions = useGetProductsForOrganisationQueryOptions; exports.useGetProductsForOrganisationSuspense = useGetProductsForOrganisationSuspense; exports.useGetProductsForOrganisationSuspenseQueryOptions = useGetProductsForOrganisationSuspenseQueryOptions; exports.useGetProductsForUnit = useGetProductsForUnit; exports.useGetProductsForUnitQueryOptions = useGetProductsForUnitQueryOptions; exports.useGetProductsForUnitSuspense = useGetProductsForUnitSuspense; exports.useGetProductsForUnitSuspenseQueryOptions = useGetProductsForUnitSuspenseQueryOptions; exports.useGetProductsQueryOptions = useGetProductsQueryOptions; exports.useGetProductsSuspense = useGetProductsSuspense; exports.useGetProductsSuspenseQueryOptions = useGetProductsSuspenseQueryOptions; exports.usePatchProduct = usePatchProduct; exports.usePatchProductMutationOptions = usePatchProductMutationOptions;
351
341
  //# sourceMappingURL=product.cjs.map