@squonk/account-server-client 4.3.1 → 4.4.0-4-4.2174798239

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 (184) hide show
  1. package/dist/_virtual/rolldown_runtime.cjs +29 -0
  2. package/dist/api/actions/actions.cjs +85 -0
  3. package/dist/api/actions/actions.cjs.map +1 -0
  4. package/dist/api/actions/actions.d.cts +74 -0
  5. package/dist/api/actions/actions.d.cts.map +1 -0
  6. package/dist/api/actions/actions.d.ts +74 -0
  7. package/dist/api/actions/actions.d.ts.map +1 -0
  8. package/dist/api/actions/actions.js +79 -0
  9. package/dist/api/actions/actions.js.map +1 -0
  10. package/dist/api/api.schemas.cjs +142 -0
  11. package/dist/api/api.schemas.cjs.map +1 -0
  12. package/dist/api/api.schemas.d.cts +1032 -0
  13. package/dist/api/api.schemas.d.cts.map +1 -0
  14. package/dist/api/api.schemas.d.ts +1032 -0
  15. package/dist/api/api.schemas.d.ts.map +1 -0
  16. package/dist/api/api.schemas.js +118 -0
  17. package/dist/api/api.schemas.js.map +1 -0
  18. package/dist/api/asset/asset.cjs +464 -0
  19. package/dist/api/asset/asset.cjs.map +1 -0
  20. package/{asset → dist/api/asset}/asset.d.cts +132 -130
  21. package/dist/api/asset/asset.d.cts.map +1 -0
  22. package/{asset → dist/api/asset}/asset.d.ts +132 -130
  23. package/dist/api/asset/asset.d.ts.map +1 -0
  24. package/dist/api/asset/asset.js +431 -0
  25. package/dist/api/asset/asset.js.map +1 -0
  26. package/dist/api/charges/charges.cjs +272 -0
  27. package/dist/api/charges/charges.cjs.map +1 -0
  28. package/{charges → dist/api/charges}/charges.d.cts +106 -104
  29. package/dist/api/charges/charges.d.cts.map +1 -0
  30. package/{charges → dist/api/charges}/charges.d.ts +106 -104
  31. package/dist/api/charges/charges.d.ts.map +1 -0
  32. package/dist/api/charges/charges.js +248 -0
  33. package/dist/api/charges/charges.js.map +1 -0
  34. package/dist/api/event-stream/event-stream.cjs +230 -0
  35. package/dist/api/event-stream/event-stream.cjs.map +1 -0
  36. package/{event-stream → dist/api/event-stream}/event-stream.d.cts +75 -73
  37. package/dist/api/event-stream/event-stream.d.cts.map +1 -0
  38. package/{event-stream → dist/api/event-stream}/event-stream.d.ts +75 -73
  39. package/dist/api/event-stream/event-stream.d.ts.map +1 -0
  40. package/dist/api/event-stream/event-stream.js +212 -0
  41. package/dist/api/event-stream/event-stream.js.map +1 -0
  42. package/dist/api/merchant/merchant.cjs +139 -0
  43. package/dist/api/merchant/merchant.cjs.map +1 -0
  44. package/{merchant → dist/api/merchant}/merchant.d.cts +56 -54
  45. package/dist/api/merchant/merchant.d.cts.map +1 -0
  46. package/{merchant → dist/api/merchant}/merchant.d.ts +56 -54
  47. package/dist/api/merchant/merchant.d.ts.map +1 -0
  48. package/dist/api/merchant/merchant.js +127 -0
  49. package/dist/api/merchant/merchant.js.map +1 -0
  50. package/dist/api/organisation/organisation.cjs +341 -0
  51. package/dist/api/organisation/organisation.cjs.map +1 -0
  52. package/{organisation → dist/api/organisation}/organisation.d.cts +112 -110
  53. package/dist/api/organisation/organisation.d.cts.map +1 -0
  54. package/{organisation → dist/api/organisation}/organisation.d.ts +112 -110
  55. package/dist/api/organisation/organisation.d.ts.map +1 -0
  56. package/dist/api/organisation/organisation.js +314 -0
  57. package/dist/api/organisation/organisation.js.map +1 -0
  58. package/dist/api/product/product.cjs +513 -0
  59. package/dist/api/product/product.cjs.map +1 -0
  60. package/{product → dist/api/product}/product.d.cts +188 -186
  61. package/dist/api/product/product.d.cts.map +1 -0
  62. package/{product → dist/api/product}/product.d.ts +188 -186
  63. package/dist/api/product/product.d.ts.map +1 -0
  64. package/dist/api/product/product.js +468 -0
  65. package/dist/api/product/product.js.map +1 -0
  66. package/dist/api/state/state.cjs +76 -0
  67. package/dist/api/state/state.cjs.map +1 -0
  68. package/dist/api/state/state.d.cts +66 -0
  69. package/dist/api/state/state.d.cts.map +1 -0
  70. package/dist/api/state/state.d.ts +66 -0
  71. package/dist/api/state/state.d.ts.map +1 -0
  72. package/dist/api/state/state.js +70 -0
  73. package/dist/api/state/state.js.map +1 -0
  74. package/dist/api/unit/unit.cjs +568 -0
  75. package/dist/api/unit/unit.cjs.map +1 -0
  76. package/{unit → dist/api/unit}/unit.d.cts +167 -165
  77. package/dist/api/unit/unit.d.cts.map +1 -0
  78. package/{unit → dist/api/unit}/unit.d.ts +167 -165
  79. package/dist/api/unit/unit.d.ts.map +1 -0
  80. package/dist/api/unit/unit.js +523 -0
  81. package/dist/api/unit/unit.js.map +1 -0
  82. package/dist/api/user/user.cjs +380 -0
  83. package/dist/api/user/user.cjs.map +1 -0
  84. package/{user → dist/api/user}/user.d.cts +129 -127
  85. package/dist/api/user/user.d.cts.map +1 -0
  86. package/{user → dist/api/user}/user.d.ts +129 -127
  87. package/dist/api/user/user.d.ts.map +1 -0
  88. package/dist/api/user/user.js +350 -0
  89. package/dist/api/user/user.js.map +1 -0
  90. package/dist/custom-instance.cjs +49 -0
  91. package/dist/custom-instance.cjs.map +1 -0
  92. package/dist/custom-instance.d.cts +22 -0
  93. package/dist/custom-instance.d.cts.map +1 -0
  94. package/dist/custom-instance.d.ts +22 -0
  95. package/dist/custom-instance.d.ts.map +1 -0
  96. package/dist/custom-instance.js +44 -0
  97. package/dist/custom-instance.js.map +1 -0
  98. package/dist/index.cjs +31 -0
  99. package/dist/index.d.cts +3 -0
  100. package/dist/index.d.ts +3 -0
  101. package/dist/index.js +4 -0
  102. package/dist/options-mutator.cjs +24 -0
  103. package/dist/options-mutator.cjs.map +1 -0
  104. package/dist/options-mutator.js +23 -0
  105. package/dist/options-mutator.js.map +1 -0
  106. package/orval.config.ts +24 -0
  107. package/package.json +163 -16
  108. package/pnpm-workspace.yaml +3 -0
  109. package/src/api/actions/actions.ts +249 -0
  110. package/src/{account-server-api.schemas.ts → api/api.schemas.ts} +82 -2
  111. package/src/{asset → api/asset}/asset.ts +8 -8
  112. package/src/{charges → api/charges}/charges.ts +9 -9
  113. package/src/{event-stream → api/event-stream}/event-stream.ts +7 -7
  114. package/src/{merchant → api/merchant}/merchant.ts +7 -7
  115. package/src/{organisation → api/organisation}/organisation.ts +8 -8
  116. package/src/{product → api/product}/product.ts +10 -10
  117. package/src/{state → api/state}/state.ts +6 -6
  118. package/src/{unit → api/unit}/unit.ts +9 -9
  119. package/src/{user → api/user}/user.ts +9 -9
  120. package/src/index.ts +2 -2
  121. package/src/options-mutator.ts +2 -2
  122. package/tsconfig.json +29 -0
  123. package/tsdown.config.ts +52 -0
  124. package/asset/asset.cjs +0 -281
  125. package/asset/asset.cjs.map +0 -1
  126. package/asset/asset.js +0 -281
  127. package/asset/asset.js.map +0 -1
  128. package/asset/package.json +0 -7
  129. package/charges/charges.cjs +0 -176
  130. package/charges/charges.cjs.map +0 -1
  131. package/charges/charges.js +0 -176
  132. package/charges/charges.js.map +0 -1
  133. package/charges/package.json +0 -7
  134. package/chunk-3WKSNKHE.js +0 -25
  135. package/chunk-3WKSNKHE.js.map +0 -1
  136. package/chunk-NY2VJJG7.cjs +0 -25
  137. package/chunk-NY2VJJG7.cjs.map +0 -1
  138. package/chunk-RB2KVIEK.cjs +0 -27
  139. package/chunk-RB2KVIEK.cjs.map +0 -1
  140. package/chunk-XYDLYMQ2.js +0 -27
  141. package/chunk-XYDLYMQ2.js.map +0 -1
  142. package/event-stream/event-stream.cjs +0 -144
  143. package/event-stream/event-stream.cjs.map +0 -1
  144. package/event-stream/event-stream.js +0 -144
  145. package/event-stream/event-stream.js.map +0 -1
  146. package/event-stream/package.json +0 -7
  147. package/index.cjs +0 -142
  148. package/index.cjs.map +0 -1
  149. package/index.d.cts +0 -979
  150. package/index.d.ts +0 -979
  151. package/index.js +0 -142
  152. package/index.js.map +0 -1
  153. package/merchant/merchant.cjs +0 -91
  154. package/merchant/merchant.cjs.map +0 -1
  155. package/merchant/merchant.js +0 -91
  156. package/merchant/merchant.js.map +0 -1
  157. package/merchant/package.json +0 -7
  158. package/organisation/organisation.cjs +0 -213
  159. package/organisation/organisation.cjs.map +0 -1
  160. package/organisation/organisation.js +0 -213
  161. package/organisation/organisation.js.map +0 -1
  162. package/organisation/package.json +0 -7
  163. package/product/package.json +0 -7
  164. package/product/product.cjs +0 -341
  165. package/product/product.cjs.map +0 -1
  166. package/product/product.js +0 -341
  167. package/product/product.js.map +0 -1
  168. package/state/package.json +0 -7
  169. package/state/state.cjs +0 -53
  170. package/state/state.cjs.map +0 -1
  171. package/state/state.d.cts +0 -64
  172. package/state/state.d.ts +0 -64
  173. package/state/state.js +0 -53
  174. package/state/state.js.map +0 -1
  175. package/unit/package.json +0 -7
  176. package/unit/unit.cjs +0 -339
  177. package/unit/unit.cjs.map +0 -1
  178. package/unit/unit.js +0 -339
  179. package/unit/unit.js.map +0 -1
  180. package/user/package.json +0 -7
  181. package/user/user.cjs +0 -226
  182. package/user/user.cjs.map +0 -1
  183. package/user/user.js +0 -226
  184. package/user/user.js.map +0 -1
package/asset/asset.cjs DELETED
@@ -1,281 +0,0 @@
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
-
3
-
4
- var _chunkNY2VJJG7cjs = require('../chunk-NY2VJJG7.cjs');
5
-
6
-
7
- var _chunkRB2KVIEKcjs = require('../chunk-RB2KVIEK.cjs');
8
-
9
- // src/asset/asset.ts
10
- var _reactquery = require('@tanstack/react-query');
11
- var getAsset = (params, options, signal) => {
12
- return _chunkRB2KVIEKcjs.customInstance.call(void 0,
13
- { url: `/asset`, method: "GET", params, signal },
14
- options
15
- );
16
- };
17
- var getGetAssetQueryKey = (params) => {
18
- return [`/asset`, ...params ? [params] : []];
19
- };
20
- var useGetAssetQueryOptions = (params, options) => {
21
- const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
22
- const queryKey = _nullishCoalesce(_optionalChain([queryOptions, 'optionalAccess', _ => _.queryKey]), () => ( getGetAssetQueryKey(params)));
23
- const queryFn = ({ signal }) => getAsset(params, requestOptions, signal);
24
- const customOptions = _chunkNY2VJJG7cjs.queryMutator.call(void 0, { ...queryOptions, queryKey, queryFn });
25
- return customOptions;
26
- };
27
- function useGetAsset(params, options, queryClient) {
28
- const queryOptions = useGetAssetQueryOptions(params, options);
29
- const query = _reactquery.useQuery.call(void 0, queryOptions, queryClient);
30
- query.queryKey = queryOptions.queryKey;
31
- return query;
32
- }
33
- var useGetAssetSuspenseQueryOptions = (params, options) => {
34
- const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
35
- const queryKey = _nullishCoalesce(_optionalChain([queryOptions, 'optionalAccess', _2 => _2.queryKey]), () => ( getGetAssetQueryKey(params)));
36
- const queryFn = ({ signal }) => getAsset(params, requestOptions, signal);
37
- const customOptions = _chunkNY2VJJG7cjs.queryMutator.call(void 0, { ...queryOptions, queryKey, queryFn });
38
- return customOptions;
39
- };
40
- function useGetAssetSuspense(params, options, queryClient) {
41
- const queryOptions = useGetAssetSuspenseQueryOptions(params, options);
42
- const query = _reactquery.useSuspenseQuery.call(void 0, queryOptions, queryClient);
43
- query.queryKey = queryOptions.queryKey;
44
- return query;
45
- }
46
- var createAsset = (assetPostBodyBody, options, signal) => {
47
- const formData = new FormData();
48
- formData.append(`name`, assetPostBodyBody.name);
49
- if (assetPostBodyBody.content_file !== void 0) {
50
- formData.append(`content_file`, assetPostBodyBody.content_file);
51
- }
52
- if (assetPostBodyBody.content_string !== void 0) {
53
- formData.append(`content_string`, assetPostBodyBody.content_string);
54
- }
55
- formData.append(`scope`, assetPostBodyBody.scope);
56
- if (assetPostBodyBody.scope_id !== void 0) {
57
- formData.append(`scope_id`, assetPostBodyBody.scope_id);
58
- }
59
- formData.append(`secret`, assetPostBodyBody.secret.toString());
60
- if (assetPostBodyBody.description !== void 0) {
61
- formData.append(`description`, assetPostBodyBody.description);
62
- }
63
- return _chunkRB2KVIEKcjs.customInstance.call(void 0,
64
- {
65
- url: `/asset`,
66
- method: "POST",
67
- headers: { "Content-Type": "multipart/form-data" },
68
- data: formData,
69
- signal
70
- },
71
- options
72
- );
73
- };
74
- var useCreateAssetMutationOptions = (options) => {
75
- const mutationKey = ["createAsset"];
76
- 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 };
77
- const mutationFn = (props) => {
78
- const { data } = _nullishCoalesce(props, () => ( {}));
79
- return createAsset(data, requestOptions);
80
- };
81
- const customOptions = _chunkNY2VJJG7cjs.mutationMutator.call(void 0, { ...mutationOptions, mutationFn });
82
- return customOptions;
83
- };
84
- var useCreateAsset = (options, queryClient) => {
85
- const mutationOptions = useCreateAssetMutationOptions(options);
86
- return _reactquery.useMutation.call(void 0, mutationOptions, queryClient);
87
- };
88
- var getSpecificAsset = (assetId, options, signal) => {
89
- return _chunkRB2KVIEKcjs.customInstance.call(void 0, { url: `/asset/${assetId}`, method: "GET", signal }, options);
90
- };
91
- var getGetSpecificAssetQueryKey = (assetId) => {
92
- return [`/asset/${assetId}`];
93
- };
94
- var useGetSpecificAssetQueryOptions = (assetId, options) => {
95
- const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
96
- const queryKey = _nullishCoalesce(_optionalChain([queryOptions, 'optionalAccess', _3 => _3.queryKey]), () => ( getGetSpecificAssetQueryKey(assetId)));
97
- const queryFn = ({ signal }) => getSpecificAsset(assetId, requestOptions, signal);
98
- const customOptions = _chunkNY2VJJG7cjs.queryMutator.call(void 0, { ...queryOptions, queryKey, queryFn });
99
- return customOptions;
100
- };
101
- function useGetSpecificAsset(assetId, options, queryClient) {
102
- const queryOptions = useGetSpecificAssetQueryOptions(assetId, options);
103
- const query = _reactquery.useQuery.call(void 0, queryOptions, queryClient);
104
- query.queryKey = queryOptions.queryKey;
105
- return query;
106
- }
107
- var useGetSpecificAssetSuspenseQueryOptions = (assetId, options) => {
108
- const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
109
- const queryKey = _nullishCoalesce(_optionalChain([queryOptions, 'optionalAccess', _4 => _4.queryKey]), () => ( getGetSpecificAssetQueryKey(assetId)));
110
- const queryFn = ({ signal }) => getSpecificAsset(assetId, requestOptions, signal);
111
- const customOptions = _chunkNY2VJJG7cjs.queryMutator.call(void 0, { ...queryOptions, queryKey, queryFn });
112
- return customOptions;
113
- };
114
- function useGetSpecificAssetSuspense(assetId, options, queryClient) {
115
- const queryOptions = useGetSpecificAssetSuspenseQueryOptions(assetId, options);
116
- const query = _reactquery.useSuspenseQuery.call(void 0, queryOptions, queryClient);
117
- query.queryKey = queryOptions.queryKey;
118
- return query;
119
- }
120
- var patchAsset = (assetId, assetPatchBodyBody, options) => {
121
- const formData = new FormData();
122
- if (assetPatchBodyBody.content_file !== void 0) {
123
- formData.append(`content_file`, assetPatchBodyBody.content_file);
124
- }
125
- if (assetPatchBodyBody.content_string !== void 0) {
126
- formData.append(`content_string`, assetPatchBodyBody.content_string);
127
- }
128
- if (assetPatchBodyBody.description !== void 0) {
129
- formData.append(`description`, assetPatchBodyBody.description);
130
- }
131
- return _chunkRB2KVIEKcjs.customInstance.call(void 0,
132
- {
133
- url: `/asset/${assetId}`,
134
- method: "PATCH",
135
- headers: { "Content-Type": "multipart/form-data" },
136
- data: formData
137
- },
138
- options
139
- );
140
- };
141
- var usePatchAssetMutationOptions = (options) => {
142
- const mutationKey = ["patchAsset"];
143
- 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 };
144
- const mutationFn = (props) => {
145
- const { assetId, data } = _nullishCoalesce(props, () => ( {}));
146
- return patchAsset(assetId, data, requestOptions);
147
- };
148
- const customOptions = _chunkNY2VJJG7cjs.mutationMutator.call(void 0, { ...mutationOptions, mutationFn });
149
- return customOptions;
150
- };
151
- var usePatchAsset = (options, queryClient) => {
152
- const mutationOptions = usePatchAssetMutationOptions(options);
153
- return _reactquery.useMutation.call(void 0, mutationOptions, queryClient);
154
- };
155
- var deleteAsset = (assetId, options) => {
156
- return _chunkRB2KVIEKcjs.customInstance.call(void 0, { url: `/asset/${assetId}`, method: "DELETE" }, options);
157
- };
158
- var useDeleteAssetMutationOptions = (options) => {
159
- const mutationKey = ["deleteAsset"];
160
- 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 };
161
- const mutationFn = (props) => {
162
- const { assetId } = _nullishCoalesce(props, () => ( {}));
163
- return deleteAsset(assetId, requestOptions);
164
- };
165
- const customOptions = _chunkNY2VJJG7cjs.mutationMutator.call(void 0, { ...mutationOptions, mutationFn });
166
- return customOptions;
167
- };
168
- var useDeleteAsset = (options, queryClient) => {
169
- const mutationOptions = useDeleteAssetMutationOptions(options);
170
- return _reactquery.useMutation.call(void 0, mutationOptions, queryClient);
171
- };
172
- var disableAsset = (assetId, options) => {
173
- return _chunkRB2KVIEKcjs.customInstance.call(void 0, { url: `/asset/${assetId}/disable`, method: "PATCH" }, options);
174
- };
175
- var useDisableAssetMutationOptions = (options) => {
176
- const mutationKey = ["disableAsset"];
177
- 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 };
178
- const mutationFn = (props) => {
179
- const { assetId } = _nullishCoalesce(props, () => ( {}));
180
- return disableAsset(assetId, requestOptions);
181
- };
182
- const customOptions = _chunkNY2VJJG7cjs.mutationMutator.call(void 0, { ...mutationOptions, mutationFn });
183
- return customOptions;
184
- };
185
- var useDisableAsset = (options, queryClient) => {
186
- const mutationOptions = useDisableAssetMutationOptions(options);
187
- return _reactquery.useMutation.call(void 0, mutationOptions, queryClient);
188
- };
189
- var enableAsset = (assetId, options) => {
190
- return _chunkRB2KVIEKcjs.customInstance.call(void 0, { url: `/asset/${assetId}/enable`, method: "PATCH" }, options);
191
- };
192
- var useEnableAssetMutationOptions = (options) => {
193
- const mutationKey = ["enableAsset"];
194
- 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 };
195
- const mutationFn = (props) => {
196
- const { assetId } = _nullishCoalesce(props, () => ( {}));
197
- return enableAsset(assetId, requestOptions);
198
- };
199
- const customOptions = _chunkNY2VJJG7cjs.mutationMutator.call(void 0, { ...mutationOptions, mutationFn });
200
- return customOptions;
201
- };
202
- var useEnableAsset = (options, queryClient) => {
203
- const mutationOptions = useEnableAssetMutationOptions(options);
204
- return _reactquery.useMutation.call(void 0, mutationOptions, queryClient);
205
- };
206
- var attachAsset = (assetId, params, options) => {
207
- return _chunkRB2KVIEKcjs.customInstance.call(void 0,
208
- { url: `/asset/${assetId}/attach`, method: "PATCH", params },
209
- options
210
- );
211
- };
212
- var useAttachAssetMutationOptions = (options) => {
213
- const mutationKey = ["attachAsset"];
214
- 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 };
215
- const mutationFn = (props) => {
216
- const { assetId, params } = _nullishCoalesce(props, () => ( {}));
217
- return attachAsset(assetId, params, requestOptions);
218
- };
219
- const customOptions = _chunkNY2VJJG7cjs.mutationMutator.call(void 0, { ...mutationOptions, mutationFn });
220
- return customOptions;
221
- };
222
- var useAttachAsset = (options, queryClient) => {
223
- const mutationOptions = useAttachAssetMutationOptions(options);
224
- return _reactquery.useMutation.call(void 0, mutationOptions, queryClient);
225
- };
226
- var detachAsset = (assetId, params, options) => {
227
- return _chunkRB2KVIEKcjs.customInstance.call(void 0,
228
- { url: `/asset/${assetId}/detach`, method: "PATCH", params },
229
- options
230
- );
231
- };
232
- var useDetachAssetMutationOptions = (options) => {
233
- const mutationKey = ["detachAsset"];
234
- 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 };
235
- const mutationFn = (props) => {
236
- const { assetId, params } = _nullishCoalesce(props, () => ( {}));
237
- return detachAsset(assetId, params, requestOptions);
238
- };
239
- const customOptions = _chunkNY2VJJG7cjs.mutationMutator.call(void 0, { ...mutationOptions, mutationFn });
240
- return customOptions;
241
- };
242
- var useDetachAsset = (options, queryClient) => {
243
- const mutationOptions = useDetachAssetMutationOptions(options);
244
- return _reactquery.useMutation.call(void 0, mutationOptions, queryClient);
245
- };
246
-
247
-
248
-
249
-
250
-
251
-
252
-
253
-
254
-
255
-
256
-
257
-
258
-
259
-
260
-
261
-
262
-
263
-
264
-
265
-
266
-
267
-
268
-
269
-
270
-
271
-
272
-
273
-
274
-
275
-
276
-
277
-
278
-
279
-
280
- exports.attachAsset = attachAsset; exports.createAsset = createAsset; exports.deleteAsset = deleteAsset; exports.detachAsset = detachAsset; exports.disableAsset = disableAsset; exports.enableAsset = enableAsset; exports.getAsset = getAsset; exports.getGetAssetQueryKey = getGetAssetQueryKey; exports.getGetSpecificAssetQueryKey = getGetSpecificAssetQueryKey; exports.getSpecificAsset = getSpecificAsset; exports.patchAsset = patchAsset; exports.useAttachAsset = useAttachAsset; exports.useAttachAssetMutationOptions = useAttachAssetMutationOptions; exports.useCreateAsset = useCreateAsset; exports.useCreateAssetMutationOptions = useCreateAssetMutationOptions; exports.useDeleteAsset = useDeleteAsset; exports.useDeleteAssetMutationOptions = useDeleteAssetMutationOptions; exports.useDetachAsset = useDetachAsset; exports.useDetachAssetMutationOptions = useDetachAssetMutationOptions; exports.useDisableAsset = useDisableAsset; exports.useDisableAssetMutationOptions = useDisableAssetMutationOptions; exports.useEnableAsset = useEnableAsset; exports.useEnableAssetMutationOptions = useEnableAssetMutationOptions; exports.useGetAsset = useGetAsset; exports.useGetAssetQueryOptions = useGetAssetQueryOptions; exports.useGetAssetSuspense = useGetAssetSuspense; exports.useGetAssetSuspenseQueryOptions = useGetAssetSuspenseQueryOptions; exports.useGetSpecificAsset = useGetSpecificAsset; exports.useGetSpecificAssetQueryOptions = useGetSpecificAssetQueryOptions; exports.useGetSpecificAssetSuspense = useGetSpecificAssetSuspense; exports.useGetSpecificAssetSuspenseQueryOptions = useGetSpecificAssetSuspenseQueryOptions; exports.usePatchAsset = usePatchAsset; exports.usePatchAssetMutationOptions = usePatchAssetMutationOptions;
281
- //# sourceMappingURL=asset.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["/home/runner/work/squonk2-account-server-js-client/squonk2-account-server-js-client/dist/asset/asset.cjs","../../src/asset/asset.ts"],"names":[],"mappings":"AAAA;AACE;AACA;AACF,yDAA8B;AAC9B;AACE;AACF,yDAA8B;AAC9B;AACA;ACEA,mDAAwD;AA0CjD,IAAM,SAAA,EAAW,CACtB,MAAA,EACA,OAAA,EACA,MAAA,EAAA,GACG;AACH,EAAA,OAAO,8CAAA;AAAA,IACL,EAAE,GAAA,EAAK,CAAA,MAAA,CAAA,EAAU,MAAA,EAAQ,KAAA,EAAO,MAAA,EAAQ,OAAO,CAAA;AAAA,IAC/C;AAAA,EACF,CAAA;AACF,CAAA;AAEO,IAAM,oBAAA,EAAsB,CAAC,MAAA,EAAA,GAA4B;AAC9D,EAAA,OAAO,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AAA;AAE2C,EAAA;AAEpC,EAAA;AACT;AAyBK;AACqB,EAAA;AAEuB,EAAA;AACjD;AAQmG;AAC7C,EAAA;AACtD;AAKE;AAcmC,EAAA;AACS,EAAA;AAS7B,EAAA;AACiB,IAAA;AAEa,IAAA;AAC7C,EAAA;AAE2C,EAAA;AAEpC,EAAA;AACT;AAyBK;AACqB,EAAA;AAEuB,EAAA;AACjD;AAQkG;AAC5C,EAAA;AACtD;AAkBK;AAC+B,EAAA;AACU,EAAA;AAS7B,EAAA;AACiB,IAAA;AAEY,IAAA;AAC5C,EAAA;AAE2C,EAAA;AAEpC,EAAA;AACT;AAyBK;AACqB,EAAA;AAEuB,EAAA;AACjD;AAYK;AACI,EAAA;AACsC,IAAA;AAC3C,IAAA;AACF,EAAA;AACF;AAkBK;AAC+B,EAAA;AACU,EAAA;AAS7B,EAAA;AACyB,IAAA;AAEF,IAAA;AACtC,EAAA;AAE2C,EAAA;AAEpC,EAAA;AACT;AAyBK;AACqB,EAAA;AAEuB,EAAA;AACjD;AAYK;AACI,EAAA;AACsC,IAAA;AAC3C,IAAA;AACF,EAAA;AACF;AAkBK;AAC+B,EAAA;AACU,EAAA;AAS7B,EAAA;AACyB,IAAA;AAEF,IAAA;AACtC,EAAA;AAE2C,EAAA;AAEpC,EAAA;AACT;AAyBK;AACqB,EAAA;AAEuB,EAAA;AACjD;AD90BiD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/squonk2-account-server-js-client/squonk2-account-server-js-client/dist/asset/asset.cjs","sourcesContent":[null,"/**\n * Generated by orval v7.10.0 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Organisations**, **Units**, **Products**, **Users**, and **Assets**.\n\n * OpenAPI spec version: 4.3\n */\nimport { useMutation, useQuery, useSuspenseQuery } from \"@tanstack/react-query\";\nimport type {\n DataTag,\n DefinedInitialDataOptions,\n DefinedUseQueryResult,\n MutationFunction,\n QueryClient,\n QueryFunction,\n QueryKey,\n UndefinedInitialDataOptions,\n UseMutationOptions,\n UseMutationResult,\n UseQueryOptions,\n UseQueryResult,\n UseSuspenseQueryOptions,\n UseSuspenseQueryResult,\n} from \"@tanstack/react-query\";\n\nimport type {\n AsError,\n AssetDetail,\n AssetGetResponse,\n AssetPatchBodyBody,\n AssetPostBodyBody,\n AssetPostResponse,\n AttachAssetParams,\n DetachAssetParams,\n GetAssetParams,\n} from \"../account-server-api.schemas\";\n\nimport { customInstance } from \".././custom-instance\";\nimport type { ErrorType } from \".././custom-instance\";\nimport { queryMutator } from \".././options-mutator\";\nimport { mutationMutator } from \".././options-mutator\";\n\ntype SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];\n\n/**\n * Gets Assets you have access to.\n\n * @summary Gets Assets\n */\nexport const getAsset = (\n params?: GetAssetParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\n return customInstance<AssetGetResponse>(\n { url: `/asset`, method: \"GET\", params, signal },\n options,\n );\n};\n\nexport const getGetAssetQueryKey = (params?: GetAssetParams) => {\n return [`/asset`, ...(params ? [params] : [])] as const;\n};\n\nexport const useGetAssetQueryOptions = <\n TData = Awaited<ReturnType<typeof getAsset>>,\n TError = ErrorType<AsError | void>,\n>(\n params?: GetAssetParams,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetAssetQueryKey(params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getAsset>>> = ({ signal }) =>\n getAsset(params, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData> & {\n queryKey: DataTag<QueryKey, TData, TError>;\n };\n};\n\nexport type GetAssetQueryResult = NonNullable<Awaited<ReturnType<typeof getAsset>>>;\nexport type GetAssetQueryError = ErrorType<AsError | void>;\n\nexport function useGetAsset<\n TData = Awaited<ReturnType<typeof getAsset>>,\n TError = ErrorType<AsError | void>,\n>(\n params: undefined | GetAssetParams,\n options: {\n query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>> &\n Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getAsset>>,\n TError,\n Awaited<ReturnType<typeof getAsset>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetAsset<\n TData = Awaited<ReturnType<typeof getAsset>>,\n TError = ErrorType<AsError | void>,\n>(\n params?: GetAssetParams,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>> &\n Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getAsset>>,\n TError,\n Awaited<ReturnType<typeof getAsset>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetAsset<\n TData = Awaited<ReturnType<typeof getAsset>>,\n TError = ErrorType<AsError | void>,\n>(\n params?: GetAssetParams,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n/**\n * @summary Gets Assets\n */\n\nexport function useGetAsset<\n TData = Awaited<ReturnType<typeof getAsset>>,\n TError = ErrorType<AsError | void>,\n>(\n params?: GetAssetParams,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = useGetAssetQueryOptions(params, options);\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {\n queryKey: DataTag<QueryKey, TData, TError>;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\nexport const useGetAssetSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getAsset>>,\n TError = ErrorType<AsError | void>,\n>(\n params?: GetAssetParams,\n options?: {\n query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetAssetQueryKey(params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getAsset>>> = ({ signal }) =>\n getAsset(params, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getAsset>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n};\n\nexport type GetAssetSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getAsset>>>;\nexport type GetAssetSuspenseQueryError = ErrorType<AsError | void>;\n\nexport function useGetAssetSuspense<\n TData = Awaited<ReturnType<typeof getAsset>>,\n TError = ErrorType<AsError | void>,\n>(\n params: undefined | GetAssetParams,\n options: {\n query: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetAssetSuspense<\n TData = Awaited<ReturnType<typeof getAsset>>,\n TError = ErrorType<AsError | void>,\n>(\n params?: GetAssetParams,\n options?: {\n query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetAssetSuspense<\n TData = Awaited<ReturnType<typeof getAsset>>,\n TError = ErrorType<AsError | void>,\n>(\n params?: GetAssetParams,\n options?: {\n query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n/**\n * @summary Gets Assets\n */\n\nexport function useGetAssetSuspense<\n TData = Awaited<ReturnType<typeof getAsset>>,\n TError = ErrorType<AsError | void>,\n>(\n params?: GetAssetParams,\n options?: {\n query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = useGetAssetSuspenseQueryOptions(params, options);\n\n const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<\n TData,\n TError\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\n/**\n * Creates an Asset, which can be attached to a **User** account, a **Product**, **Unit**, **Organisation** or can be made **Global**\n\nAssets are text and file resources that can be requested by **Merchants**. The Data Manager **Merchant** uses assets to provide additional information that's often sensitive to **Job** (and **Application**) **Instances**.\n\nAssets must be *enabled* before they can be used.\n\nThey must also be *attached* to a **Merchant** before the **Merchant** can ue them. Assets are only available to merchants if they are enabled and attached.\n\n * @summary Create an Asset\n */\nexport const createAsset = (\n assetPostBodyBody: AssetPostBodyBody,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\n const formData = new FormData();\n formData.append(`name`, assetPostBodyBody.name);\n if (assetPostBodyBody.content_file !== undefined) {\n formData.append(`content_file`, assetPostBodyBody.content_file);\n }\n if (assetPostBodyBody.content_string !== undefined) {\n formData.append(`content_string`, assetPostBodyBody.content_string);\n }\n formData.append(`scope`, assetPostBodyBody.scope);\n if (assetPostBodyBody.scope_id !== undefined) {\n formData.append(`scope_id`, assetPostBodyBody.scope_id);\n }\n formData.append(`secret`, assetPostBodyBody.secret.toString());\n if (assetPostBodyBody.description !== undefined) {\n formData.append(`description`, assetPostBodyBody.description);\n }\n\n return customInstance<AssetPostResponse>(\n {\n url: `/asset`,\n method: \"POST\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n signal,\n },\n options,\n );\n};\n\nexport const useCreateAssetMutationOptions = <\n TError = ErrorType<AsError | void>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createAsset>>,\n TError,\n { data: AssetPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof createAsset>>,\n TError,\n { data: AssetPostBodyBody },\n TContext\n> => {\n const mutationKey = [\"createAsset\"];\n const { mutation: mutationOptions, request: requestOptions } = options\n ? options.mutation && \"mutationKey\" in options.mutation && options.mutation.mutationKey\n ? options\n : { ...options, mutation: { ...options.mutation, mutationKey } }\n : { mutation: { mutationKey }, request: undefined };\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof createAsset>>,\n { data: AssetPostBodyBody }\n > = (props) => {\n const { data } = props ?? {};\n\n return createAsset(data, requestOptions);\n };\n\n const customOptions = mutationMutator({ ...mutationOptions, mutationFn });\n\n return customOptions;\n};\n\nexport type CreateAssetMutationResult = NonNullable<Awaited<ReturnType<typeof createAsset>>>;\nexport type CreateAssetMutationBody = AssetPostBodyBody;\nexport type CreateAssetMutationError = ErrorType<AsError | void>;\n\n/**\n * @summary Create an Asset\n */\nexport const useCreateAsset = <TError = ErrorType<AsError | void>, TContext = unknown>(\n options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createAsset>>,\n TError,\n { data: AssetPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof createAsset>>,\n TError,\n { data: AssetPostBodyBody },\n TContext\n> => {\n const mutationOptions = useCreateAssetMutationOptions(options);\n\n return useMutation(mutationOptions, queryClient);\n};\n/**\n * Gets a known Asset\n\n * @summary Gets an Asset\n */\nexport const getSpecificAsset = (\n assetId: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\n return customInstance<AssetDetail>({ url: `/asset/${assetId}`, method: \"GET\", signal }, options);\n};\n\nexport const getGetSpecificAssetQueryKey = (assetId: string) => {\n return [`/asset/${assetId}`] as const;\n};\n\nexport const useGetSpecificAssetQueryOptions = <\n TData = Awaited<ReturnType<typeof getSpecificAsset>>,\n TError = ErrorType<AsError | void>,\n>(\n assetId: string,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetSpecificAssetQueryKey(assetId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getSpecificAsset>>> = ({ signal }) =>\n getSpecificAsset(assetId, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseQueryOptions<\n Awaited<ReturnType<typeof getSpecificAsset>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n};\n\nexport type GetSpecificAssetQueryResult = NonNullable<Awaited<ReturnType<typeof getSpecificAsset>>>;\nexport type GetSpecificAssetQueryError = ErrorType<AsError | void>;\n\nexport function useGetSpecificAsset<\n TData = Awaited<ReturnType<typeof getSpecificAsset>>,\n TError = ErrorType<AsError | void>,\n>(\n assetId: string,\n options: {\n query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData>> &\n Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getSpecificAsset>>,\n TError,\n Awaited<ReturnType<typeof getSpecificAsset>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetSpecificAsset<\n TData = Awaited<ReturnType<typeof getSpecificAsset>>,\n TError = ErrorType<AsError | void>,\n>(\n assetId: string,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData>> &\n Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getSpecificAsset>>,\n TError,\n Awaited<ReturnType<typeof getSpecificAsset>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetSpecificAsset<\n TData = Awaited<ReturnType<typeof getSpecificAsset>>,\n TError = ErrorType<AsError | void>,\n>(\n assetId: string,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n/**\n * @summary Gets an Asset\n */\n\nexport function useGetSpecificAsset<\n TData = Awaited<ReturnType<typeof getSpecificAsset>>,\n TError = ErrorType<AsError | void>,\n>(\n assetId: string,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = useGetSpecificAssetQueryOptions(assetId, options);\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {\n queryKey: DataTag<QueryKey, TData, TError>;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\nexport const useGetSpecificAssetSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getSpecificAsset>>,\n TError = ErrorType<AsError | void>,\n>(\n assetId: string,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetSpecificAssetQueryKey(assetId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getSpecificAsset>>> = ({ signal }) =>\n getSpecificAsset(assetId, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getSpecificAsset>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n};\n\nexport type GetSpecificAssetSuspenseQueryResult = NonNullable<\n Awaited<ReturnType<typeof getSpecificAsset>>\n>;\nexport type GetSpecificAssetSuspenseQueryError = ErrorType<AsError | void>;\n\nexport function useGetSpecificAssetSuspense<\n TData = Awaited<ReturnType<typeof getSpecificAsset>>,\n TError = ErrorType<AsError | void>,\n>(\n assetId: string,\n options: {\n query: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetSpecificAssetSuspense<\n TData = Awaited<ReturnType<typeof getSpecificAsset>>,\n TError = ErrorType<AsError | void>,\n>(\n assetId: string,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetSpecificAssetSuspense<\n TData = Awaited<ReturnType<typeof getSpecificAsset>>,\n TError = ErrorType<AsError | void>,\n>(\n assetId: string,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n/**\n * @summary Gets an Asset\n */\n\nexport function useGetSpecificAssetSuspense<\n TData = Awaited<ReturnType<typeof getSpecificAsset>>,\n TError = ErrorType<AsError | void>,\n>(\n assetId: string,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = useGetSpecificAssetSuspenseQueryOptions(assetId, options);\n\n const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<\n TData,\n TError\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\n/**\n * Used to update or replace Asset *Content* or *Description*.\n\nThe content of an Asset currently in use will not be affected by a change made here. If a **Merchant** has already obtained the Asset it may continue to use the original value until the **Merchant** requests the **Asset** again.\n\nAnyone can alter a `GLOBAL` asset. For other *scopes* you will need to be the user for `USER` scoped assets, a member of the **Unit** for `UNIT` and `PRODUCT` scoped assets, or a member of the **Organisation** for `ORGANISATION` scoped assets. Administrators can patch any asset.\n\n * @summary Adjust an existing Asset\n */\nexport const patchAsset = (\n assetId: string,\n assetPatchBodyBody: AssetPatchBodyBody,\n options?: SecondParameter<typeof customInstance>,\n) => {\n const formData = new FormData();\n if (assetPatchBodyBody.content_file !== undefined) {\n formData.append(`content_file`, assetPatchBodyBody.content_file);\n }\n if (assetPatchBodyBody.content_string !== undefined) {\n formData.append(`content_string`, assetPatchBodyBody.content_string);\n }\n if (assetPatchBodyBody.description !== undefined) {\n formData.append(`description`, assetPatchBodyBody.description);\n }\n\n return customInstance<void>(\n {\n url: `/asset/${assetId}`,\n method: \"PATCH\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options,\n );\n};\n\nexport const usePatchAssetMutationOptions = <\n TError = ErrorType<void | AsError>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof patchAsset>>,\n TError,\n { assetId: string; data: AssetPatchBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof patchAsset>>,\n TError,\n { assetId: string; data: AssetPatchBodyBody },\n TContext\n> => {\n const mutationKey = [\"patchAsset\"];\n const { mutation: mutationOptions, request: requestOptions } = options\n ? options.mutation && \"mutationKey\" in options.mutation && options.mutation.mutationKey\n ? options\n : { ...options, mutation: { ...options.mutation, mutationKey } }\n : { mutation: { mutationKey }, request: undefined };\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof patchAsset>>,\n { assetId: string; data: AssetPatchBodyBody }\n > = (props) => {\n const { assetId, data } = props ?? {};\n\n return patchAsset(assetId, data, requestOptions);\n };\n\n const customOptions = mutationMutator({ ...mutationOptions, mutationFn });\n\n return customOptions;\n};\n\nexport type PatchAssetMutationResult = NonNullable<Awaited<ReturnType<typeof patchAsset>>>;\nexport type PatchAssetMutationBody = AssetPatchBodyBody;\nexport type PatchAssetMutationError = ErrorType<void | AsError>;\n\n/**\n * @summary Adjust an existing Asset\n */\nexport const usePatchAsset = <TError = ErrorType<void | AsError>, TContext = unknown>(\n options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof patchAsset>>,\n TError,\n { assetId: string; data: AssetPatchBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof patchAsset>>,\n TError,\n { assetId: string; data: AssetPatchBodyBody },\n TContext\n> => {\n const mutationOptions = usePatchAssetMutationOptions(options);\n\n return useMutation(mutationOptions, queryClient);\n};\n/**\n * Deletes a known Asset. Assets that are attached to **Merchants** cannot be deleted\n\nAnyone can alter a `GLOBAL` asset. For other *scopes* you will need to be the user for `USER` scoped assets, a member of the **Unit** for `UNIT` and `PRODUCT` scoped assets, or a member of the **Organisation** for `ORGANISATION` scoped assets. Administrators can patch any asset.\n\n * @summary Deletes an Asset\n */\nexport const deleteAsset = (assetId: string, options?: SecondParameter<typeof customInstance>) => {\n return customInstance<void>({ url: `/asset/${assetId}`, method: \"DELETE\" }, options);\n};\n\nexport const useDeleteAssetMutationOptions = <\n TError = ErrorType<AsError | void>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteAsset>>,\n TError,\n { assetId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof deleteAsset>>,\n TError,\n { assetId: string },\n TContext\n> => {\n const mutationKey = [\"deleteAsset\"];\n const { mutation: mutationOptions, request: requestOptions } = options\n ? options.mutation && \"mutationKey\" in options.mutation && options.mutation.mutationKey\n ? options\n : { ...options, mutation: { ...options.mutation, mutationKey } }\n : { mutation: { mutationKey }, request: undefined };\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteAsset>>,\n { assetId: string }\n > = (props) => {\n const { assetId } = props ?? {};\n\n return deleteAsset(assetId, requestOptions);\n };\n\n const customOptions = mutationMutator({ ...mutationOptions, mutationFn });\n\n return customOptions;\n};\n\nexport type DeleteAssetMutationResult = NonNullable<Awaited<ReturnType<typeof deleteAsset>>>;\n\nexport type DeleteAssetMutationError = ErrorType<AsError | void>;\n\n/**\n * @summary Deletes an Asset\n */\nexport const useDeleteAsset = <TError = ErrorType<AsError | void>, TContext = unknown>(\n options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteAsset>>,\n TError,\n { assetId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof deleteAsset>>,\n TError,\n { assetId: string },\n TContext\n> => {\n const mutationOptions = useDeleteAssetMutationOptions(options);\n\n return useMutation(mutationOptions, queryClient);\n};\n/**\n * Disables a known Asset\n\nAnyone can alter a `GLOBAL` asset. For other *scopes* you will need to be the user for `USER` scoped assets, a member of the **Unit** for `UNIT` and `PRODUCT` scoped assets, or a member of the **Organisation** for `ORGANISATION` scoped assets. Administrators can patch any asset.\n\n * @summary Disables an Asset\n */\nexport const disableAsset = (assetId: string, options?: SecondParameter<typeof customInstance>) => {\n return customInstance<void>({ url: `/asset/${assetId}/disable`, method: \"PATCH\" }, options);\n};\n\nexport const useDisableAssetMutationOptions = <\n TError = ErrorType<AsError | void>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof disableAsset>>,\n TError,\n { assetId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof disableAsset>>,\n TError,\n { assetId: string },\n TContext\n> => {\n const mutationKey = [\"disableAsset\"];\n const { mutation: mutationOptions, request: requestOptions } = options\n ? options.mutation && \"mutationKey\" in options.mutation && options.mutation.mutationKey\n ? options\n : { ...options, mutation: { ...options.mutation, mutationKey } }\n : { mutation: { mutationKey }, request: undefined };\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof disableAsset>>,\n { assetId: string }\n > = (props) => {\n const { assetId } = props ?? {};\n\n return disableAsset(assetId, requestOptions);\n };\n\n const customOptions = mutationMutator({ ...mutationOptions, mutationFn });\n\n return customOptions;\n};\n\nexport type DisableAssetMutationResult = NonNullable<Awaited<ReturnType<typeof disableAsset>>>;\n\nexport type DisableAssetMutationError = ErrorType<AsError | void>;\n\n/**\n * @summary Disables an Asset\n */\nexport const useDisableAsset = <TError = ErrorType<AsError | void>, TContext = unknown>(\n options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof disableAsset>>,\n TError,\n { assetId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof disableAsset>>,\n TError,\n { assetId: string },\n TContext\n> => {\n const mutationOptions = useDisableAssetMutationOptions(options);\n\n return useMutation(mutationOptions, queryClient);\n};\n/**\n * Enables a known Asset\n\nAnyone can alter a `GLOBAL` asset. For other *scopes* you will need to be the user for `USER` scoped assets, a member of the **Unit** for `UNIT` and `PRODUCT` scoped assets, or a member of the **Organisation** for `ORGANISATION` scoped assets. Administrators can patch any asset.\n\n * @summary Enables an Asset\n */\nexport const enableAsset = (assetId: string, options?: SecondParameter<typeof customInstance>) => {\n return customInstance<void>({ url: `/asset/${assetId}/enable`, method: \"PATCH\" }, options);\n};\n\nexport const useEnableAssetMutationOptions = <\n TError = ErrorType<AsError | void>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof enableAsset>>,\n TError,\n { assetId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof enableAsset>>,\n TError,\n { assetId: string },\n TContext\n> => {\n const mutationKey = [\"enableAsset\"];\n const { mutation: mutationOptions, request: requestOptions } = options\n ? options.mutation && \"mutationKey\" in options.mutation && options.mutation.mutationKey\n ? options\n : { ...options, mutation: { ...options.mutation, mutationKey } }\n : { mutation: { mutationKey }, request: undefined };\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof enableAsset>>,\n { assetId: string }\n > = (props) => {\n const { assetId } = props ?? {};\n\n return enableAsset(assetId, requestOptions);\n };\n\n const customOptions = mutationMutator({ ...mutationOptions, mutationFn });\n\n return customOptions;\n};\n\nexport type EnableAssetMutationResult = NonNullable<Awaited<ReturnType<typeof enableAsset>>>;\n\nexport type EnableAssetMutationError = ErrorType<AsError | void>;\n\n/**\n * @summary Enables an Asset\n */\nexport const useEnableAsset = <TError = ErrorType<AsError | void>, TContext = unknown>(\n options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof enableAsset>>,\n TError,\n { assetId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof enableAsset>>,\n TError,\n { assetId: string },\n TContext\n> => {\n const mutationOptions = useEnableAssetMutationOptions(options);\n\n return useMutation(mutationOptions, queryClient);\n};\n/**\n * Attaches an Asset to a **Merchant**. This allows the **Merchant** to query the Asset. **Merchants** cannot obtain Assets that are not attached to them.\n\nAnyone can alter a `GLOBAL` asset. For other *scopes* you will need to be the user for `USER` scoped assets, a member of the **Unit** for `UNIT` and `PRODUCT` scoped assets, or a member of the **Organisation** for `ORGANISATION` scoped assets. Administrators can patch any asset.\n\n * @summary Attaches an Asset to a Merchant\n */\nexport const attachAsset = (\n assetId: string,\n params?: AttachAssetParams,\n options?: SecondParameter<typeof customInstance>,\n) => {\n return customInstance<void>(\n { url: `/asset/${assetId}/attach`, method: \"PATCH\", params },\n options,\n );\n};\n\nexport const useAttachAssetMutationOptions = <\n TError = ErrorType<AsError | void>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof attachAsset>>,\n TError,\n { assetId: string; params?: AttachAssetParams },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof attachAsset>>,\n TError,\n { assetId: string; params?: AttachAssetParams },\n TContext\n> => {\n const mutationKey = [\"attachAsset\"];\n const { mutation: mutationOptions, request: requestOptions } = options\n ? options.mutation && \"mutationKey\" in options.mutation && options.mutation.mutationKey\n ? options\n : { ...options, mutation: { ...options.mutation, mutationKey } }\n : { mutation: { mutationKey }, request: undefined };\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof attachAsset>>,\n { assetId: string; params?: AttachAssetParams }\n > = (props) => {\n const { assetId, params } = props ?? {};\n\n return attachAsset(assetId, params, requestOptions);\n };\n\n const customOptions = mutationMutator({ ...mutationOptions, mutationFn });\n\n return customOptions;\n};\n\nexport type AttachAssetMutationResult = NonNullable<Awaited<ReturnType<typeof attachAsset>>>;\n\nexport type AttachAssetMutationError = ErrorType<AsError | void>;\n\n/**\n * @summary Attaches an Asset to a Merchant\n */\nexport const useAttachAsset = <TError = ErrorType<AsError | void>, TContext = unknown>(\n options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof attachAsset>>,\n TError,\n { assetId: string; params?: AttachAssetParams },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof attachAsset>>,\n TError,\n { assetId: string; params?: AttachAssetParams },\n TContext\n> => {\n const mutationOptions = useAttachAssetMutationOptions(options);\n\n return useMutation(mutationOptions, queryClient);\n};\n/**\n * Detaches an Asset from a **Merchant**\n\nAnyone can alter a `GLOBAL` asset. For other *scopes* you will need to be the user for `USER` scoped assets, a member of the **Unit** for `UNIT` and `PRODUCT` scoped assets, or a member of the **Organisation** for `ORGANISATION` scoped assets. Administrators can patch any asset.\n\n * @summary Detaches an Asset from a Merchant\n */\nexport const detachAsset = (\n assetId: string,\n params?: DetachAssetParams,\n options?: SecondParameter<typeof customInstance>,\n) => {\n return customInstance<void>(\n { url: `/asset/${assetId}/detach`, method: \"PATCH\", params },\n options,\n );\n};\n\nexport const useDetachAssetMutationOptions = <\n TError = ErrorType<AsError | void>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof detachAsset>>,\n TError,\n { assetId: string; params?: DetachAssetParams },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof detachAsset>>,\n TError,\n { assetId: string; params?: DetachAssetParams },\n TContext\n> => {\n const mutationKey = [\"detachAsset\"];\n const { mutation: mutationOptions, request: requestOptions } = options\n ? options.mutation && \"mutationKey\" in options.mutation && options.mutation.mutationKey\n ? options\n : { ...options, mutation: { ...options.mutation, mutationKey } }\n : { mutation: { mutationKey }, request: undefined };\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof detachAsset>>,\n { assetId: string; params?: DetachAssetParams }\n > = (props) => {\n const { assetId, params } = props ?? {};\n\n return detachAsset(assetId, params, requestOptions);\n };\n\n const customOptions = mutationMutator({ ...mutationOptions, mutationFn });\n\n return customOptions;\n};\n\nexport type DetachAssetMutationResult = NonNullable<Awaited<ReturnType<typeof detachAsset>>>;\n\nexport type DetachAssetMutationError = ErrorType<AsError | void>;\n\n/**\n * @summary Detaches an Asset from a Merchant\n */\nexport const useDetachAsset = <TError = ErrorType<AsError | void>, TContext = unknown>(\n options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof detachAsset>>,\n TError,\n { assetId: string; params?: DetachAssetParams },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof detachAsset>>,\n TError,\n { assetId: string; params?: DetachAssetParams },\n TContext\n> => {\n const mutationOptions = useDetachAssetMutationOptions(options);\n\n return useMutation(mutationOptions, queryClient);\n};\n"]}