@squonk/account-server-client 4.2.1 → 4.3.1

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 (84) hide show
  1. package/asset/asset.cjs +99 -126
  2. package/asset/asset.cjs.map +1 -1
  3. package/asset/asset.d.cts +99 -99
  4. package/asset/asset.d.ts +99 -99
  5. package/asset/asset.js +107 -134
  6. package/asset/asset.js.map +1 -1
  7. package/charges/charges.cjs +73 -85
  8. package/charges/charges.cjs.map +1 -1
  9. package/charges/charges.d.cts +47 -47
  10. package/charges/charges.d.ts +47 -47
  11. package/charges/charges.js +78 -90
  12. package/charges/charges.js.map +1 -1
  13. package/chunk-3WKSNKHE.js +25 -0
  14. package/chunk-3WKSNKHE.js.map +1 -0
  15. package/chunk-NY2VJJG7.cjs +25 -0
  16. package/chunk-NY2VJJG7.cjs.map +1 -0
  17. package/{chunk-TKLTUR4R.cjs → chunk-RB2KVIEK.cjs} +1 -1
  18. package/chunk-RB2KVIEK.cjs.map +1 -0
  19. package/{chunk-EBOQPVLG.js → chunk-XYDLYMQ2.js} +1 -1
  20. package/chunk-XYDLYMQ2.js.map +1 -0
  21. package/event-stream/event-stream.cjs +53 -61
  22. package/event-stream/event-stream.cjs.map +1 -1
  23. package/event-stream/event-stream.d.cts +45 -45
  24. package/event-stream/event-stream.d.ts +45 -45
  25. package/event-stream/event-stream.js +58 -66
  26. package/event-stream/event-stream.js.map +1 -1
  27. package/index.cjs +49 -57
  28. package/index.cjs.map +1 -1
  29. package/index.d.cts +796 -773
  30. package/index.d.ts +796 -773
  31. package/index.js +48 -56
  32. package/index.js.map +1 -1
  33. package/merchant/merchant.cjs +38 -45
  34. package/merchant/merchant.cjs.map +1 -1
  35. package/merchant/merchant.d.cts +25 -25
  36. package/merchant/merchant.d.ts +25 -25
  37. package/merchant/merchant.js +42 -49
  38. package/merchant/merchant.js.map +1 -1
  39. package/organisation/organisation.cjs +77 -87
  40. package/organisation/organisation.cjs.map +1 -1
  41. package/organisation/organisation.d.cts +72 -70
  42. package/organisation/organisation.d.ts +72 -70
  43. package/organisation/organisation.js +83 -93
  44. package/organisation/organisation.js.map +1 -1
  45. package/package.json +13 -16
  46. package/product/product.cjs +143 -153
  47. package/product/product.cjs.map +1 -1
  48. package/product/product.d.cts +100 -100
  49. package/product/product.d.ts +100 -100
  50. package/product/product.js +153 -163
  51. package/product/product.js.map +1 -1
  52. package/src/account-server-api.schemas.ts +863 -856
  53. package/src/asset/asset.ts +899 -634
  54. package/src/charges/charges.ts +822 -498
  55. package/src/custom-instance.ts +3 -3
  56. package/src/event-stream/event-stream.ts +531 -345
  57. package/src/index.ts +2 -2
  58. package/src/merchant/merchant.ts +355 -234
  59. package/src/options-mutator.ts +27 -0
  60. package/src/organisation/organisation.ts +812 -504
  61. package/src/product/product.ts +1373 -841
  62. package/src/state/state.ts +174 -127
  63. package/src/unit/unit.ts +1273 -603
  64. package/src/user/user.ts +895 -564
  65. package/state/state.cjs +22 -24
  66. package/state/state.cjs.map +1 -1
  67. package/state/state.d.cts +14 -14
  68. package/state/state.d.ts +14 -14
  69. package/state/state.js +24 -26
  70. package/state/state.js.map +1 -1
  71. package/unit/unit.cjs +171 -106
  72. package/unit/unit.cjs.map +1 -1
  73. package/unit/unit.d.cts +200 -90
  74. package/unit/unit.d.ts +200 -90
  75. package/unit/unit.js +179 -114
  76. package/unit/unit.js.map +1 -1
  77. package/user/user.cjs +94 -110
  78. package/user/user.cjs.map +1 -1
  79. package/user/user.d.cts +77 -77
  80. package/user/user.d.ts +77 -77
  81. package/user/user.js +101 -117
  82. package/user/user.js.map +1 -1
  83. package/chunk-EBOQPVLG.js.map +0 -1
  84. package/chunk-TKLTUR4R.cjs.map +0 -1
@@ -1,161 +1,149 @@
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/charges/charges.ts
3
+ var _chunkNY2VJJG7cjs = require('../chunk-NY2VJJG7.cjs');
6
4
 
7
5
 
6
+ var _chunkRB2KVIEKcjs = require('../chunk-RB2KVIEK.cjs');
8
7
 
8
+ // src/charges/charges.ts
9
9
  var _reactquery = require('@tanstack/react-query');
10
10
  var getCharges = (params, options, signal) => {
11
- return _chunkTKLTUR4Rcjs.customInstance.call(void 0,
12
- {
13
- url: `/charges`,
14
- method: "GET",
15
- params,
16
- signal
17
- },
11
+ return _chunkRB2KVIEKcjs.customInstance.call(void 0,
12
+ { url: `/charges`, method: "GET", params, signal },
18
13
  options
19
14
  );
20
15
  };
21
16
  var getGetChargesQueryKey = (params) => {
22
- return ["account-server-api", `/charges`, ...params ? [params] : []];
17
+ return [`/charges`, ...params ? [params] : []];
23
18
  };
24
- var getGetChargesQueryOptions = (params, options) => {
19
+ var useGetChargesQueryOptions = (params, options) => {
25
20
  const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
26
- const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetChargesQueryKey(params)));
21
+ const queryKey = _nullishCoalesce(_optionalChain([queryOptions, 'optionalAccess', _ => _.queryKey]), () => ( getGetChargesQueryKey(params)));
27
22
  const queryFn = ({ signal }) => getCharges(params, requestOptions, signal);
28
- return { queryKey, queryFn, ...queryOptions };
23
+ const customOptions = _chunkNY2VJJG7cjs.queryMutator.call(void 0, { ...queryOptions, queryKey, queryFn });
24
+ return customOptions;
29
25
  };
30
- function useGetCharges(params, options) {
31
- const queryOptions = getGetChargesQueryOptions(params, options);
32
- const query = _reactquery.useQuery.call(void 0, queryOptions);
26
+ function useGetCharges(params, options, queryClient) {
27
+ const queryOptions = useGetChargesQueryOptions(params, options);
28
+ const query = _reactquery.useQuery.call(void 0, queryOptions, queryClient);
33
29
  query.queryKey = queryOptions.queryKey;
34
30
  return query;
35
31
  }
36
- var getGetChargesSuspenseQueryOptions = (params, options) => {
32
+ var useGetChargesSuspenseQueryOptions = (params, options) => {
37
33
  const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
38
- const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetChargesQueryKey(params)));
34
+ const queryKey = _nullishCoalesce(_optionalChain([queryOptions, 'optionalAccess', _2 => _2.queryKey]), () => ( getGetChargesQueryKey(params)));
39
35
  const queryFn = ({ signal }) => getCharges(params, requestOptions, signal);
40
- return { queryKey, queryFn, ...queryOptions };
36
+ const customOptions = _chunkNY2VJJG7cjs.queryMutator.call(void 0, { ...queryOptions, queryKey, queryFn });
37
+ return customOptions;
41
38
  };
42
- function useGetChargesSuspense(params, options) {
43
- const queryOptions = getGetChargesSuspenseQueryOptions(params, options);
44
- const query = _reactquery.useSuspenseQuery.call(void 0, queryOptions);
39
+ function useGetChargesSuspense(params, options, queryClient) {
40
+ const queryOptions = useGetChargesSuspenseQueryOptions(params, options);
41
+ const query = _reactquery.useSuspenseQuery.call(void 0, queryOptions, queryClient);
45
42
  query.queryKey = queryOptions.queryKey;
46
43
  return query;
47
44
  }
48
45
  var getOrganisationCharges = (orgId, params, options, signal) => {
49
- return _chunkTKLTUR4Rcjs.customInstance.call(void 0,
50
- {
51
- url: `/charges/organisation/${orgId}`,
52
- method: "GET",
53
- params,
54
- signal
55
- },
46
+ return _chunkRB2KVIEKcjs.customInstance.call(void 0,
47
+ { url: `/charges/organisation/${orgId}`, method: "GET", params, signal },
56
48
  options
57
49
  );
58
50
  };
59
51
  var getGetOrganisationChargesQueryKey = (orgId, params) => {
60
- return ["account-server-api", `/charges/organisation/${orgId}`, ...params ? [params] : []];
52
+ return [`/charges/organisation/${orgId}`, ...params ? [params] : []];
61
53
  };
62
- var getGetOrganisationChargesQueryOptions = (orgId, params, options) => {
54
+ var useGetOrganisationChargesQueryOptions = (orgId, params, options) => {
63
55
  const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
64
- const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetOrganisationChargesQueryKey(orgId, params)));
56
+ const queryKey = _nullishCoalesce(_optionalChain([queryOptions, 'optionalAccess', _3 => _3.queryKey]), () => ( getGetOrganisationChargesQueryKey(orgId, params)));
65
57
  const queryFn = ({ signal }) => getOrganisationCharges(orgId, params, requestOptions, signal);
66
- return { queryKey, queryFn, enabled: !!orgId, ...queryOptions };
58
+ const customOptions = _chunkNY2VJJG7cjs.queryMutator.call(void 0, { ...queryOptions, queryKey, queryFn });
59
+ return customOptions;
67
60
  };
68
- function useGetOrganisationCharges(orgId, params, options) {
69
- const queryOptions = getGetOrganisationChargesQueryOptions(orgId, params, options);
70
- const query = _reactquery.useQuery.call(void 0, queryOptions);
61
+ function useGetOrganisationCharges(orgId, params, options, queryClient) {
62
+ const queryOptions = useGetOrganisationChargesQueryOptions(orgId, params, options);
63
+ const query = _reactquery.useQuery.call(void 0, queryOptions, queryClient);
71
64
  query.queryKey = queryOptions.queryKey;
72
65
  return query;
73
66
  }
74
- var getGetOrganisationChargesSuspenseQueryOptions = (orgId, params, options) => {
67
+ var useGetOrganisationChargesSuspenseQueryOptions = (orgId, params, options) => {
75
68
  const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
76
- const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetOrganisationChargesQueryKey(orgId, params)));
69
+ const queryKey = _nullishCoalesce(_optionalChain([queryOptions, 'optionalAccess', _4 => _4.queryKey]), () => ( getGetOrganisationChargesQueryKey(orgId, params)));
77
70
  const queryFn = ({ signal }) => getOrganisationCharges(orgId, params, requestOptions, signal);
78
- return { queryKey, queryFn, ...queryOptions };
71
+ const customOptions = _chunkNY2VJJG7cjs.queryMutator.call(void 0, { ...queryOptions, queryKey, queryFn });
72
+ return customOptions;
79
73
  };
80
- function useGetOrganisationChargesSuspense(orgId, params, options) {
81
- const queryOptions = getGetOrganisationChargesSuspenseQueryOptions(orgId, params, options);
82
- const query = _reactquery.useSuspenseQuery.call(void 0, queryOptions);
74
+ function useGetOrganisationChargesSuspense(orgId, params, options, queryClient) {
75
+ const queryOptions = useGetOrganisationChargesSuspenseQueryOptions(orgId, params, options);
76
+ const query = _reactquery.useSuspenseQuery.call(void 0, queryOptions, queryClient);
83
77
  query.queryKey = queryOptions.queryKey;
84
78
  return query;
85
79
  }
86
80
  var getProductCharges = (productId, params, options, signal) => {
87
- return _chunkTKLTUR4Rcjs.customInstance.call(void 0,
88
- {
89
- url: `/charges/product/${productId}`,
90
- method: "GET",
91
- params,
92
- signal
93
- },
81
+ return _chunkRB2KVIEKcjs.customInstance.call(void 0,
82
+ { url: `/charges/product/${productId}`, method: "GET", params, signal },
94
83
  options
95
84
  );
96
85
  };
97
86
  var getGetProductChargesQueryKey = (productId, params) => {
98
- return ["account-server-api", `/charges/product/${productId}`, ...params ? [params] : []];
87
+ return [`/charges/product/${productId}`, ...params ? [params] : []];
99
88
  };
100
- var getGetProductChargesQueryOptions = (productId, params, options) => {
89
+ var useGetProductChargesQueryOptions = (productId, params, options) => {
101
90
  const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
102
- const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetProductChargesQueryKey(productId, params)));
91
+ const queryKey = _nullishCoalesce(_optionalChain([queryOptions, 'optionalAccess', _5 => _5.queryKey]), () => ( getGetProductChargesQueryKey(productId, params)));
103
92
  const queryFn = ({ signal }) => getProductCharges(productId, params, requestOptions, signal);
104
- return { queryKey, queryFn, enabled: !!productId, ...queryOptions };
93
+ const customOptions = _chunkNY2VJJG7cjs.queryMutator.call(void 0, { ...queryOptions, queryKey, queryFn });
94
+ return customOptions;
105
95
  };
106
- function useGetProductCharges(productId, params, options) {
107
- const queryOptions = getGetProductChargesQueryOptions(productId, params, options);
108
- const query = _reactquery.useQuery.call(void 0, queryOptions);
96
+ function useGetProductCharges(productId, params, options, queryClient) {
97
+ const queryOptions = useGetProductChargesQueryOptions(productId, params, options);
98
+ const query = _reactquery.useQuery.call(void 0, queryOptions, queryClient);
109
99
  query.queryKey = queryOptions.queryKey;
110
100
  return query;
111
101
  }
112
- var getGetProductChargesSuspenseQueryOptions = (productId, params, options) => {
102
+ var useGetProductChargesSuspenseQueryOptions = (productId, params, options) => {
113
103
  const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
114
- const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetProductChargesQueryKey(productId, params)));
104
+ const queryKey = _nullishCoalesce(_optionalChain([queryOptions, 'optionalAccess', _6 => _6.queryKey]), () => ( getGetProductChargesQueryKey(productId, params)));
115
105
  const queryFn = ({ signal }) => getProductCharges(productId, params, requestOptions, signal);
116
- return { queryKey, queryFn, ...queryOptions };
106
+ const customOptions = _chunkNY2VJJG7cjs.queryMutator.call(void 0, { ...queryOptions, queryKey, queryFn });
107
+ return customOptions;
117
108
  };
118
- function useGetProductChargesSuspense(productId, params, options) {
119
- const queryOptions = getGetProductChargesSuspenseQueryOptions(productId, params, options);
120
- const query = _reactquery.useSuspenseQuery.call(void 0, queryOptions);
109
+ function useGetProductChargesSuspense(productId, params, options, queryClient) {
110
+ const queryOptions = useGetProductChargesSuspenseQueryOptions(productId, params, options);
111
+ const query = _reactquery.useSuspenseQuery.call(void 0, queryOptions, queryClient);
121
112
  query.queryKey = queryOptions.queryKey;
122
113
  return query;
123
114
  }
124
115
  var getUnitCharges = (unitId, params, options, signal) => {
125
- return _chunkTKLTUR4Rcjs.customInstance.call(void 0,
126
- {
127
- url: `/charges/unit/${unitId}`,
128
- method: "GET",
129
- params,
130
- signal
131
- },
116
+ return _chunkRB2KVIEKcjs.customInstance.call(void 0,
117
+ { url: `/charges/unit/${unitId}`, method: "GET", params, signal },
132
118
  options
133
119
  );
134
120
  };
135
121
  var getGetUnitChargesQueryKey = (unitId, params) => {
136
- return ["account-server-api", `/charges/unit/${unitId}`, ...params ? [params] : []];
122
+ return [`/charges/unit/${unitId}`, ...params ? [params] : []];
137
123
  };
138
- var getGetUnitChargesQueryOptions = (unitId, params, options) => {
124
+ var useGetUnitChargesQueryOptions = (unitId, params, options) => {
139
125
  const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
140
- const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetUnitChargesQueryKey(unitId, params)));
126
+ const queryKey = _nullishCoalesce(_optionalChain([queryOptions, 'optionalAccess', _7 => _7.queryKey]), () => ( getGetUnitChargesQueryKey(unitId, params)));
141
127
  const queryFn = ({ signal }) => getUnitCharges(unitId, params, requestOptions, signal);
142
- return { queryKey, queryFn, enabled: !!unitId, ...queryOptions };
128
+ const customOptions = _chunkNY2VJJG7cjs.queryMutator.call(void 0, { ...queryOptions, queryKey, queryFn });
129
+ return customOptions;
143
130
  };
144
- function useGetUnitCharges(unitId, params, options) {
145
- const queryOptions = getGetUnitChargesQueryOptions(unitId, params, options);
146
- const query = _reactquery.useQuery.call(void 0, queryOptions);
131
+ function useGetUnitCharges(unitId, params, options, queryClient) {
132
+ const queryOptions = useGetUnitChargesQueryOptions(unitId, params, options);
133
+ const query = _reactquery.useQuery.call(void 0, queryOptions, queryClient);
147
134
  query.queryKey = queryOptions.queryKey;
148
135
  return query;
149
136
  }
150
- var getGetUnitChargesSuspenseQueryOptions = (unitId, params, options) => {
137
+ var useGetUnitChargesSuspenseQueryOptions = (unitId, params, options) => {
151
138
  const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
152
- const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetUnitChargesQueryKey(unitId, params)));
139
+ const queryKey = _nullishCoalesce(_optionalChain([queryOptions, 'optionalAccess', _8 => _8.queryKey]), () => ( getGetUnitChargesQueryKey(unitId, params)));
153
140
  const queryFn = ({ signal }) => getUnitCharges(unitId, params, requestOptions, signal);
154
- return { queryKey, queryFn, ...queryOptions };
141
+ const customOptions = _chunkNY2VJJG7cjs.queryMutator.call(void 0, { ...queryOptions, queryKey, queryFn });
142
+ return customOptions;
155
143
  };
156
- function useGetUnitChargesSuspense(unitId, params, options) {
157
- const queryOptions = getGetUnitChargesSuspenseQueryOptions(unitId, params, options);
158
- const query = _reactquery.useSuspenseQuery.call(void 0, queryOptions);
144
+ function useGetUnitChargesSuspense(unitId, params, options, queryClient) {
145
+ const queryOptions = useGetUnitChargesSuspenseQueryOptions(unitId, params, options);
146
+ const query = _reactquery.useSuspenseQuery.call(void 0, queryOptions, queryClient);
159
147
  query.queryKey = queryOptions.queryKey;
160
148
  return query;
161
149
  }
@@ -184,5 +172,5 @@ function useGetUnitChargesSuspense(unitId, params, options) {
184
172
 
185
173
 
186
174
 
187
- exports.getCharges = getCharges; exports.getGetChargesQueryKey = getGetChargesQueryKey; exports.getGetChargesQueryOptions = getGetChargesQueryOptions; exports.getGetChargesSuspenseQueryOptions = getGetChargesSuspenseQueryOptions; exports.getGetOrganisationChargesQueryKey = getGetOrganisationChargesQueryKey; exports.getGetOrganisationChargesQueryOptions = getGetOrganisationChargesQueryOptions; exports.getGetOrganisationChargesSuspenseQueryOptions = getGetOrganisationChargesSuspenseQueryOptions; exports.getGetProductChargesQueryKey = getGetProductChargesQueryKey; exports.getGetProductChargesQueryOptions = getGetProductChargesQueryOptions; exports.getGetProductChargesSuspenseQueryOptions = getGetProductChargesSuspenseQueryOptions; exports.getGetUnitChargesQueryKey = getGetUnitChargesQueryKey; exports.getGetUnitChargesQueryOptions = getGetUnitChargesQueryOptions; exports.getGetUnitChargesSuspenseQueryOptions = getGetUnitChargesSuspenseQueryOptions; exports.getOrganisationCharges = getOrganisationCharges; exports.getProductCharges = getProductCharges; exports.getUnitCharges = getUnitCharges; exports.useGetCharges = useGetCharges; exports.useGetChargesSuspense = useGetChargesSuspense; exports.useGetOrganisationCharges = useGetOrganisationCharges; exports.useGetOrganisationChargesSuspense = useGetOrganisationChargesSuspense; exports.useGetProductCharges = useGetProductCharges; exports.useGetProductChargesSuspense = useGetProductChargesSuspense; exports.useGetUnitCharges = useGetUnitCharges; exports.useGetUnitChargesSuspense = useGetUnitChargesSuspense;
175
+ exports.getCharges = getCharges; exports.getGetChargesQueryKey = getGetChargesQueryKey; exports.getGetOrganisationChargesQueryKey = getGetOrganisationChargesQueryKey; exports.getGetProductChargesQueryKey = getGetProductChargesQueryKey; exports.getGetUnitChargesQueryKey = getGetUnitChargesQueryKey; exports.getOrganisationCharges = getOrganisationCharges; exports.getProductCharges = getProductCharges; exports.getUnitCharges = getUnitCharges; exports.useGetCharges = useGetCharges; exports.useGetChargesQueryOptions = useGetChargesQueryOptions; exports.useGetChargesSuspense = useGetChargesSuspense; exports.useGetChargesSuspenseQueryOptions = useGetChargesSuspenseQueryOptions; exports.useGetOrganisationCharges = useGetOrganisationCharges; exports.useGetOrganisationChargesQueryOptions = useGetOrganisationChargesQueryOptions; exports.useGetOrganisationChargesSuspense = useGetOrganisationChargesSuspense; exports.useGetOrganisationChargesSuspenseQueryOptions = useGetOrganisationChargesSuspenseQueryOptions; exports.useGetProductCharges = useGetProductCharges; exports.useGetProductChargesQueryOptions = useGetProductChargesQueryOptions; exports.useGetProductChargesSuspense = useGetProductChargesSuspense; exports.useGetProductChargesSuspenseQueryOptions = useGetProductChargesSuspenseQueryOptions; exports.useGetUnitCharges = useGetUnitCharges; exports.useGetUnitChargesQueryOptions = useGetUnitChargesQueryOptions; exports.useGetUnitChargesSuspense = useGetUnitChargesSuspense; exports.useGetUnitChargesSuspenseQueryOptions = useGetUnitChargesSuspenseQueryOptions;
188
176
  //# sourceMappingURL=charges.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/squonk2-account-server-js-client/squonk2-account-server-js-client/dist/charges/charges.cjs","../../src/charges/charges.ts"],"names":[],"mappings":"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","file":"/home/runner/work/squonk2-account-server-js-client/squonk2-account-server-js-client/dist/charges/charges.cjs","sourcesContent":[null,"// @ts-nocheck\n/**\n * Generated by orval v7.4.1 🍺\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.2\n */\nimport {\n useQuery,\n useSuspenseQuery\n} from '@tanstack/react-query'\nimport type {\n DataTag,\n DefinedInitialDataOptions,\n DefinedUseQueryResult,\n QueryFunction,\n QueryKey,\n UndefinedInitialDataOptions,\n UseQueryOptions,\n UseQueryResult,\n UseSuspenseQueryOptions,\n UseSuspenseQueryResult\n} from '@tanstack/react-query'\nimport type {\n AsError,\n ChargesGetResponse,\n GetChargesParams,\n GetOrganisationChargesParams,\n GetProductChargesParams,\n GetUnitChargesParams,\n OrganisationChargesGetResponse,\n ProductChargesGetResponse,\n UnitChargesGetResponse\n} from '../account-server-api.schemas'\nimport { customInstance } from '.././custom-instance';\nimport type { ErrorType } from '.././custom-instance';\n\n\ntype SecondParameter<T extends (...args: any) => any> = Parameters<T>[1];\n\n\n/**\n * Gets global Charges.\n\nYou need admin rights to use this path.\n\n * @summary Gets charges for all Organisations\n */\nexport const getCharges = (\n params?: GetChargesParams,\n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n \n \n return customInstance<ChargesGetResponse>(\n {url: `/charges`, method: 'GET',\n params, signal\n },\n options);\n }\n \n\nexport const getGetChargesQueryKey = (params?: GetChargesParams,) => {\n return [\"account-server-api\", `/charges`, ...(params ? [params]: [])] as const;\n }\n\n \nexport const getGetChargesQueryOptions = <TData = Awaited<ReturnType<typeof getCharges>>, TError = ErrorType<void | AsError>>(params?: GetChargesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetChargesQueryKey(params);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getCharges>>> = ({ signal }) => getCharges(params, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type GetChargesQueryResult = NonNullable<Awaited<ReturnType<typeof getCharges>>>\nexport type GetChargesQueryError = ErrorType<void | AsError>\n\n\nexport function useGetCharges<TData = Awaited<ReturnType<typeof getCharges>>, TError = ErrorType<void | AsError>>(\n params: undefined | GetChargesParams, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>> & Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getCharges>>,\n TError,\n TData\n > , 'initialData'\n >, request?: SecondParameter<typeof customInstance>}\n\n ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useGetCharges<TData = Awaited<ReturnType<typeof getCharges>>, TError = ErrorType<void | AsError>>(\n params?: GetChargesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>> & Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getCharges>>,\n TError,\n TData\n > , 'initialData'\n >, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useGetCharges<TData = Awaited<ReturnType<typeof getCharges>>, TError = ErrorType<void | AsError>>(\n params?: GetChargesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary Gets charges for all Organisations\n */\n\nexport function useGetCharges<TData = Awaited<ReturnType<typeof getCharges>>, TError = ErrorType<void | AsError>>(\n params?: GetChargesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getGetChargesQueryOptions(params,options)\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\nexport const getGetChargesSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getCharges>>, TError = ErrorType<void | AsError>>(params?: GetChargesParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetChargesQueryKey(params);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getCharges>>> = ({ signal }) => getCharges(params, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type GetChargesSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getCharges>>>\nexport type GetChargesSuspenseQueryError = ErrorType<void | AsError>\n\n\nexport function useGetChargesSuspense<TData = Awaited<ReturnType<typeof getCharges>>, TError = ErrorType<void | AsError>>(\n params: undefined | GetChargesParams, options: { query:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useGetChargesSuspense<TData = Awaited<ReturnType<typeof getCharges>>, TError = ErrorType<void | AsError>>(\n params?: GetChargesParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useGetChargesSuspense<TData = Awaited<ReturnType<typeof getCharges>>, TError = ErrorType<void | AsError>>(\n params?: GetChargesParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary Gets charges for all Organisations\n */\n\nexport function useGetChargesSuspense<TData = Awaited<ReturnType<typeof getCharges>>, TError = ErrorType<void | AsError>>(\n params?: GetChargesParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getGetChargesSuspenseQueryOptions(params,options)\n\n const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\n/**\n * Gets a Organisation charges.\n\nThe Organisation cannot be the **Default Organisation** and you need to be a member of the Organisation to use this endpoint\n\n * @summary Gets charges for all Units in an Organisation\n */\nexport const getOrganisationCharges = (\n orgId: string,\n params?: GetOrganisationChargesParams,\n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n \n \n return customInstance<OrganisationChargesGetResponse>(\n {url: `/charges/organisation/${orgId}`, method: 'GET',\n params, signal\n },\n options);\n }\n \n\nexport const getGetOrganisationChargesQueryKey = (orgId: string,\n params?: GetOrganisationChargesParams,) => {\n return [\"account-server-api\", `/charges/organisation/${orgId}`, ...(params ? [params]: [])] as const;\n }\n\n \nexport const getGetOrganisationChargesQueryOptions = <TData = Awaited<ReturnType<typeof getOrganisationCharges>>, TError = ErrorType<void | AsError>>(orgId: string,\n params?: GetOrganisationChargesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetOrganisationChargesQueryKey(orgId,params);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisationCharges>>> = ({ signal }) => getOrganisationCharges(orgId,params, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, enabled: !!(orgId), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type GetOrganisationChargesQueryResult = NonNullable<Awaited<ReturnType<typeof getOrganisationCharges>>>\nexport type GetOrganisationChargesQueryError = ErrorType<void | AsError>\n\n\nexport function useGetOrganisationCharges<TData = Awaited<ReturnType<typeof getOrganisationCharges>>, TError = ErrorType<void | AsError>>(\n orgId: string,\n params: undefined | GetOrganisationChargesParams, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>> & Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getOrganisationCharges>>,\n TError,\n TData\n > , 'initialData'\n >, request?: SecondParameter<typeof customInstance>}\n\n ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useGetOrganisationCharges<TData = Awaited<ReturnType<typeof getOrganisationCharges>>, TError = ErrorType<void | AsError>>(\n orgId: string,\n params?: GetOrganisationChargesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>> & Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getOrganisationCharges>>,\n TError,\n TData\n > , 'initialData'\n >, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useGetOrganisationCharges<TData = Awaited<ReturnType<typeof getOrganisationCharges>>, TError = ErrorType<void | AsError>>(\n orgId: string,\n params?: GetOrganisationChargesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary Gets charges for all Units in an Organisation\n */\n\nexport function useGetOrganisationCharges<TData = Awaited<ReturnType<typeof getOrganisationCharges>>, TError = ErrorType<void | AsError>>(\n orgId: string,\n params?: GetOrganisationChargesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getGetOrganisationChargesQueryOptions(orgId,params,options)\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\nexport const getGetOrganisationChargesSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getOrganisationCharges>>, TError = ErrorType<void | AsError>>(orgId: string,\n params?: GetOrganisationChargesParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetOrganisationChargesQueryKey(orgId,params);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisationCharges>>> = ({ signal }) => getOrganisationCharges(orgId,params, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type GetOrganisationChargesSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getOrganisationCharges>>>\nexport type GetOrganisationChargesSuspenseQueryError = ErrorType<void | AsError>\n\n\nexport function useGetOrganisationChargesSuspense<TData = Awaited<ReturnType<typeof getOrganisationCharges>>, TError = ErrorType<void | AsError>>(\n orgId: string,\n params: undefined | GetOrganisationChargesParams, options: { query:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useGetOrganisationChargesSuspense<TData = Awaited<ReturnType<typeof getOrganisationCharges>>, TError = ErrorType<void | AsError>>(\n orgId: string,\n params?: GetOrganisationChargesParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useGetOrganisationChargesSuspense<TData = Awaited<ReturnType<typeof getOrganisationCharges>>, TError = ErrorType<void | AsError>>(\n orgId: string,\n params?: GetOrganisationChargesParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary Gets charges for all Units in an Organisation\n */\n\nexport function useGetOrganisationChargesSuspense<TData = Awaited<ReturnType<typeof getOrganisationCharges>>, TError = ErrorType<void | AsError>>(\n orgId: string,\n params?: GetOrganisationChargesParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getGetOrganisationChargesSuspenseQueryOptions(orgId,params,options)\n\n const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\n/**\n * Get the charges made against a Product with optional **from** (inclusive) and **until** (exclusive) dates. If no dates are provided, the charges for the current billing period are returned.\n\nDates are interpreted using the Python `dateutil` parser, so the input strings are extremely flexible with, for example, `1 December 2021` as an acceptable input.\n\n**From** must be a date (day) prior to **until**. For example, to see the charges for the 11th July 2022 set **from** to `11 July 2022` and **until** to `12 July 2022`. As an alternative to **From** and **Until** you can provide a **Prior Billing Period**, a value that identifies the prior period to retrieve. A value of `-1` would indicate the *prior period* (month) with an oldest retrieval value of `-23` allowing you to obtain charges for up to two years.\n\nYou need to be part of the **Unit** or **Organisation** to use this method\n * @summary Get charges made against a Product\n */\nexport const getProductCharges = (\n productId: string,\n params?: GetProductChargesParams,\n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n \n \n return customInstance<ProductChargesGetResponse>(\n {url: `/charges/product/${productId}`, method: 'GET',\n params, signal\n },\n options);\n }\n \n\nexport const getGetProductChargesQueryKey = (productId: string,\n params?: GetProductChargesParams,) => {\n return [\"account-server-api\", `/charges/product/${productId}`, ...(params ? [params]: [])] as const;\n }\n\n \nexport const getGetProductChargesQueryOptions = <TData = Awaited<ReturnType<typeof getProductCharges>>, TError = ErrorType<AsError | void>>(productId: string,\n params?: GetProductChargesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetProductChargesQueryKey(productId,params);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getProductCharges>>> = ({ signal }) => getProductCharges(productId,params, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, enabled: !!(productId), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type GetProductChargesQueryResult = NonNullable<Awaited<ReturnType<typeof getProductCharges>>>\nexport type GetProductChargesQueryError = ErrorType<AsError | void>\n\n\nexport function useGetProductCharges<TData = Awaited<ReturnType<typeof getProductCharges>>, TError = ErrorType<AsError | void>>(\n productId: string,\n params: undefined | GetProductChargesParams, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>> & Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getProductCharges>>,\n TError,\n TData\n > , 'initialData'\n >, request?: SecondParameter<typeof customInstance>}\n\n ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useGetProductCharges<TData = Awaited<ReturnType<typeof getProductCharges>>, TError = ErrorType<AsError | void>>(\n productId: string,\n params?: GetProductChargesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>> & Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getProductCharges>>,\n TError,\n TData\n > , 'initialData'\n >, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useGetProductCharges<TData = Awaited<ReturnType<typeof getProductCharges>>, TError = ErrorType<AsError | void>>(\n productId: string,\n params?: GetProductChargesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary Get charges made against a Product\n */\n\nexport function useGetProductCharges<TData = Awaited<ReturnType<typeof getProductCharges>>, TError = ErrorType<AsError | void>>(\n productId: string,\n params?: GetProductChargesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getGetProductChargesQueryOptions(productId,params,options)\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\nexport const getGetProductChargesSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getProductCharges>>, TError = ErrorType<AsError | void>>(productId: string,\n params?: GetProductChargesParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetProductChargesQueryKey(productId,params);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getProductCharges>>> = ({ signal }) => getProductCharges(productId,params, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type GetProductChargesSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getProductCharges>>>\nexport type GetProductChargesSuspenseQueryError = ErrorType<AsError | void>\n\n\nexport function useGetProductChargesSuspense<TData = Awaited<ReturnType<typeof getProductCharges>>, TError = ErrorType<AsError | void>>(\n productId: string,\n params: undefined | GetProductChargesParams, options: { query:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useGetProductChargesSuspense<TData = Awaited<ReturnType<typeof getProductCharges>>, TError = ErrorType<AsError | void>>(\n productId: string,\n params?: GetProductChargesParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useGetProductChargesSuspense<TData = Awaited<ReturnType<typeof getProductCharges>>, TError = ErrorType<AsError | void>>(\n productId: string,\n params?: GetProductChargesParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary Get charges made against a Product\n */\n\nexport function useGetProductChargesSuspense<TData = Awaited<ReturnType<typeof getProductCharges>>, TError = ErrorType<AsError | void>>(\n productId: string,\n params?: GetProductChargesParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getGetProductChargesSuspenseQueryOptions(productId,params,options)\n\n const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\n/**\n * Get the charges made against a Unit with optional **from** (inclusive) and **until** (exclusive) dates. If no dates are provided, the charges for the current billing period are returned.\nDates are interpreted using the Python `dateutil` parser, so the input strings are extremely flexible with, for example, `1 December 2021` as an acceptable input.\n\n**From** must be a date (day) prior to **until**. For example, to see the charges for the 11th July 2022 set **from** to `11 July 2022` and **until** to `12 July 2022`. As an alternative to **From** and **Until** you can provide a **Prior Billing Period**, a value that identifies the prior period to retrieve. A value of `-1` would indicate the *prior period* (month) with an oldest retrieval value of `-23` allowing you to obtain charges for up to two years.\n\nYou need to be part of the **Unit** or **Organisation** to use this method\n * @summary Get charges made against a Unit\n */\nexport const getUnitCharges = (\n unitId: string,\n params?: GetUnitChargesParams,\n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n \n \n return customInstance<UnitChargesGetResponse>(\n {url: `/charges/unit/${unitId}`, method: 'GET',\n params, signal\n },\n options);\n }\n \n\nexport const getGetUnitChargesQueryKey = (unitId: string,\n params?: GetUnitChargesParams,) => {\n return [\"account-server-api\", `/charges/unit/${unitId}`, ...(params ? [params]: [])] as const;\n }\n\n \nexport const getGetUnitChargesQueryOptions = <TData = Awaited<ReturnType<typeof getUnitCharges>>, TError = ErrorType<AsError | void>>(unitId: string,\n params?: GetUnitChargesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUnitChargesQueryKey(unitId,params);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getUnitCharges>>> = ({ signal }) => getUnitCharges(unitId,params, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, enabled: !!(unitId), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type GetUnitChargesQueryResult = NonNullable<Awaited<ReturnType<typeof getUnitCharges>>>\nexport type GetUnitChargesQueryError = ErrorType<AsError | void>\n\n\nexport function useGetUnitCharges<TData = Awaited<ReturnType<typeof getUnitCharges>>, TError = ErrorType<AsError | void>>(\n unitId: string,\n params: undefined | GetUnitChargesParams, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>> & Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getUnitCharges>>,\n TError,\n TData\n > , 'initialData'\n >, request?: SecondParameter<typeof customInstance>}\n\n ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useGetUnitCharges<TData = Awaited<ReturnType<typeof getUnitCharges>>, TError = ErrorType<AsError | void>>(\n unitId: string,\n params?: GetUnitChargesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>> & Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getUnitCharges>>,\n TError,\n TData\n > , 'initialData'\n >, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useGetUnitCharges<TData = Awaited<ReturnType<typeof getUnitCharges>>, TError = ErrorType<AsError | void>>(\n unitId: string,\n params?: GetUnitChargesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary Get charges made against a Unit\n */\n\nexport function useGetUnitCharges<TData = Awaited<ReturnType<typeof getUnitCharges>>, TError = ErrorType<AsError | void>>(\n unitId: string,\n params?: GetUnitChargesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getGetUnitChargesQueryOptions(unitId,params,options)\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\nexport const getGetUnitChargesSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getUnitCharges>>, TError = ErrorType<AsError | void>>(unitId: string,\n params?: GetUnitChargesParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUnitChargesQueryKey(unitId,params);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getUnitCharges>>> = ({ signal }) => getUnitCharges(unitId,params, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }\n}\n\nexport type GetUnitChargesSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getUnitCharges>>>\nexport type GetUnitChargesSuspenseQueryError = ErrorType<AsError | void>\n\n\nexport function useGetUnitChargesSuspense<TData = Awaited<ReturnType<typeof getUnitCharges>>, TError = ErrorType<AsError | void>>(\n unitId: string,\n params: undefined | GetUnitChargesParams, options: { query:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useGetUnitChargesSuspense<TData = Awaited<ReturnType<typeof getUnitCharges>>, TError = ErrorType<AsError | void>>(\n unitId: string,\n params?: GetUnitChargesParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\nexport function useGetUnitChargesSuspense<TData = Awaited<ReturnType<typeof getUnitCharges>>, TError = ErrorType<AsError | void>>(\n unitId: string,\n params?: GetUnitChargesParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }\n/**\n * @summary Get charges made against a Unit\n */\n\nexport function useGetUnitChargesSuspense<TData = Awaited<ReturnType<typeof getUnitCharges>>, TError = ErrorType<AsError | void>>(\n unitId: string,\n params?: GetUnitChargesParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n\n const queryOptions = getGetUnitChargesSuspenseQueryOptions(unitId,params,options)\n\n const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\n"]}
1
+ {"version":3,"sources":["/home/runner/work/squonk2-account-server-js-client/squonk2-account-server-js-client/dist/charges/charges.cjs","../../src/charges/charges.ts"],"names":[],"mappings":"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","file":"/home/runner/work/squonk2-account-server-js-client/squonk2-account-server-js-client/dist/charges/charges.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 { useQuery, useSuspenseQuery } from \"@tanstack/react-query\";\nimport type {\n DataTag,\n DefinedInitialDataOptions,\n DefinedUseQueryResult,\n QueryClient,\n QueryFunction,\n QueryKey,\n UndefinedInitialDataOptions,\n UseQueryOptions,\n UseQueryResult,\n UseSuspenseQueryOptions,\n UseSuspenseQueryResult,\n} from \"@tanstack/react-query\";\n\nimport type {\n AsError,\n ChargesGetResponse,\n GetChargesParams,\n GetOrganisationChargesParams,\n GetProductChargesParams,\n GetUnitChargesParams,\n OrganisationChargesGetResponse,\n ProductChargesGetResponse,\n UnitChargesGetResponse,\n} from \"../account-server-api.schemas\";\n\nimport { customInstance } from \".././custom-instance\";\nimport type { ErrorType } from \".././custom-instance\";\nimport { queryMutator } from \".././options-mutator\";\n\ntype SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];\n\n/**\n * Gets global Charges.\n\nYou need admin rights to use this path.\n\n * @summary Gets charges for all Organisations\n */\nexport const getCharges = (\n params?: GetChargesParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\n return customInstance<ChargesGetResponse>(\n { url: `/charges`, method: \"GET\", params, signal },\n options,\n );\n};\n\nexport const getGetChargesQueryKey = (params?: GetChargesParams) => {\n return [`/charges`, ...(params ? [params] : [])] as const;\n};\n\nexport const useGetChargesQueryOptions = <\n TData = Awaited<ReturnType<typeof getCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n params?: GetChargesParams,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetChargesQueryKey(params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getCharges>>> = ({ signal }) =>\n getCharges(params, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData> & {\n queryKey: DataTag<QueryKey, TData, TError>;\n };\n};\n\nexport type GetChargesQueryResult = NonNullable<Awaited<ReturnType<typeof getCharges>>>;\nexport type GetChargesQueryError = ErrorType<void | AsError>;\n\nexport function useGetCharges<\n TData = Awaited<ReturnType<typeof getCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n params: undefined | GetChargesParams,\n options: {\n query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>> &\n Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getCharges>>,\n TError,\n Awaited<ReturnType<typeof getCharges>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetCharges<\n TData = Awaited<ReturnType<typeof getCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n params?: GetChargesParams,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>> &\n Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getCharges>>,\n TError,\n Awaited<ReturnType<typeof getCharges>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetCharges<\n TData = Awaited<ReturnType<typeof getCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n params?: GetChargesParams,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n/**\n * @summary Gets charges for all Organisations\n */\n\nexport function useGetCharges<\n TData = Awaited<ReturnType<typeof getCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n params?: GetChargesParams,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = useGetChargesQueryOptions(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 useGetChargesSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n params?: GetChargesParams,\n options?: {\n query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetChargesQueryKey(params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getCharges>>> = ({ signal }) =>\n getCharges(params, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getCharges>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n};\n\nexport type GetChargesSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getCharges>>>;\nexport type GetChargesSuspenseQueryError = ErrorType<void | AsError>;\n\nexport function useGetChargesSuspense<\n TData = Awaited<ReturnType<typeof getCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n params: undefined | GetChargesParams,\n options: {\n query: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetChargesSuspense<\n TData = Awaited<ReturnType<typeof getCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n params?: GetChargesParams,\n options?: {\n query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetChargesSuspense<\n TData = Awaited<ReturnType<typeof getCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n params?: GetChargesParams,\n options?: {\n query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n/**\n * @summary Gets charges for all Organisations\n */\n\nexport function useGetChargesSuspense<\n TData = Awaited<ReturnType<typeof getCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n params?: GetChargesParams,\n options?: {\n query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = useGetChargesSuspenseQueryOptions(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 * Gets a Organisation charges.\n\nThe Organisation cannot be the **Default Organisation** and you need to be a member of the Organisation to use this endpoint\n\n * @summary Gets charges for all Units in an Organisation\n */\nexport const getOrganisationCharges = (\n orgId: string,\n params?: GetOrganisationChargesParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\n return customInstance<OrganisationChargesGetResponse>(\n { url: `/charges/organisation/${orgId}`, method: \"GET\", params, signal },\n options,\n );\n};\n\nexport const getGetOrganisationChargesQueryKey = (\n orgId: string,\n params?: GetOrganisationChargesParams,\n) => {\n return [`/charges/organisation/${orgId}`, ...(params ? [params] : [])] as const;\n};\n\nexport const useGetOrganisationChargesQueryOptions = <\n TData = Awaited<ReturnType<typeof getOrganisationCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n params?: GetOrganisationChargesParams,\n options?: {\n query?: Partial<\n UseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetOrganisationChargesQueryKey(orgId, params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisationCharges>>> = ({ signal }) =>\n getOrganisationCharges(orgId, params, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationCharges>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n};\n\nexport type GetOrganisationChargesQueryResult = NonNullable<\n Awaited<ReturnType<typeof getOrganisationCharges>>\n>;\nexport type GetOrganisationChargesQueryError = ErrorType<void | AsError>;\n\nexport function useGetOrganisationCharges<\n TData = Awaited<ReturnType<typeof getOrganisationCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n params: undefined | GetOrganisationChargesParams,\n options: {\n query: Partial<\n UseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>\n > &\n Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getOrganisationCharges>>,\n TError,\n Awaited<ReturnType<typeof getOrganisationCharges>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetOrganisationCharges<\n TData = Awaited<ReturnType<typeof getOrganisationCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n params?: GetOrganisationChargesParams,\n options?: {\n query?: Partial<\n UseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>\n > &\n Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getOrganisationCharges>>,\n TError,\n Awaited<ReturnType<typeof getOrganisationCharges>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetOrganisationCharges<\n TData = Awaited<ReturnType<typeof getOrganisationCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n params?: GetOrganisationChargesParams,\n options?: {\n query?: Partial<\n UseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n/**\n * @summary Gets charges for all Units in an Organisation\n */\n\nexport function useGetOrganisationCharges<\n TData = Awaited<ReturnType<typeof getOrganisationCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n params?: GetOrganisationChargesParams,\n options?: {\n query?: Partial<\n UseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = useGetOrganisationChargesQueryOptions(orgId, 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 useGetOrganisationChargesSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getOrganisationCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n params?: GetOrganisationChargesParams,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetOrganisationChargesQueryKey(orgId, params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisationCharges>>> = ({ signal }) =>\n getOrganisationCharges(orgId, params, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationCharges>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n};\n\nexport type GetOrganisationChargesSuspenseQueryResult = NonNullable<\n Awaited<ReturnType<typeof getOrganisationCharges>>\n>;\nexport type GetOrganisationChargesSuspenseQueryError = ErrorType<void | AsError>;\n\nexport function useGetOrganisationChargesSuspense<\n TData = Awaited<ReturnType<typeof getOrganisationCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n params: undefined | GetOrganisationChargesParams,\n options: {\n query: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetOrganisationChargesSuspense<\n TData = Awaited<ReturnType<typeof getOrganisationCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n params?: GetOrganisationChargesParams,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetOrganisationChargesSuspense<\n TData = Awaited<ReturnType<typeof getOrganisationCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n params?: GetOrganisationChargesParams,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, 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 charges for all Units in an Organisation\n */\n\nexport function useGetOrganisationChargesSuspense<\n TData = Awaited<ReturnType<typeof getOrganisationCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n params?: GetOrganisationChargesParams,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = useGetOrganisationChargesSuspenseQueryOptions(orgId, 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 * Get the charges made against a Product with optional **from** (inclusive) and **until** (exclusive) dates. If no dates are provided, the charges for the current billing period are returned.\n\nDates are interpreted using the Python `dateutil` parser, so the input strings are extremely flexible with, for example, `1 December 2021` as an acceptable input.\n\n**From** must be a date (day) prior to **until**. For example, to see the charges for the 11th July 2022 set **from** to `11 July 2022` and **until** to `12 July 2022`. As an alternative to **From** and **Until** you can provide a **Prior Billing Period**, a value that identifies the prior period to retrieve. A value of `-1` would indicate the *prior period* (month) with an oldest retrieval value of `-23` allowing you to obtain charges for up to two years.\n\nYou need to be part of the **Unit** or **Organisation** to use this method\n * @summary Get charges made against a Product\n */\nexport const getProductCharges = (\n productId: string,\n params?: GetProductChargesParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\n return customInstance<ProductChargesGetResponse>(\n { url: `/charges/product/${productId}`, method: \"GET\", params, signal },\n options,\n );\n};\n\nexport const getGetProductChargesQueryKey = (\n productId: string,\n params?: GetProductChargesParams,\n) => {\n return [`/charges/product/${productId}`, ...(params ? [params] : [])] as const;\n};\n\nexport const useGetProductChargesQueryOptions = <\n TData = Awaited<ReturnType<typeof getProductCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n productId: string,\n params?: GetProductChargesParams,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetProductChargesQueryKey(productId, params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getProductCharges>>> = ({ signal }) =>\n getProductCharges(productId, params, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseQueryOptions<\n Awaited<ReturnType<typeof getProductCharges>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n};\n\nexport type GetProductChargesQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProductCharges>>\n>;\nexport type GetProductChargesQueryError = ErrorType<AsError | void>;\n\nexport function useGetProductCharges<\n TData = Awaited<ReturnType<typeof getProductCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n productId: string,\n params: undefined | GetProductChargesParams,\n options: {\n query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>> &\n Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getProductCharges>>,\n TError,\n Awaited<ReturnType<typeof getProductCharges>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetProductCharges<\n TData = Awaited<ReturnType<typeof getProductCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n productId: string,\n params?: GetProductChargesParams,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>> &\n Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getProductCharges>>,\n TError,\n Awaited<ReturnType<typeof getProductCharges>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetProductCharges<\n TData = Awaited<ReturnType<typeof getProductCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n productId: string,\n params?: GetProductChargesParams,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n/**\n * @summary Get charges made against a Product\n */\n\nexport function useGetProductCharges<\n TData = Awaited<ReturnType<typeof getProductCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n productId: string,\n params?: GetProductChargesParams,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = useGetProductChargesQueryOptions(productId, 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 useGetProductChargesSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getProductCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n productId: string,\n params?: GetProductChargesParams,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetProductChargesQueryKey(productId, params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getProductCharges>>> = ({ signal }) =>\n getProductCharges(productId, params, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getProductCharges>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n};\n\nexport type GetProductChargesSuspenseQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProductCharges>>\n>;\nexport type GetProductChargesSuspenseQueryError = ErrorType<AsError | void>;\n\nexport function useGetProductChargesSuspense<\n TData = Awaited<ReturnType<typeof getProductCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n productId: string,\n params: undefined | GetProductChargesParams,\n options: {\n query: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetProductChargesSuspense<\n TData = Awaited<ReturnType<typeof getProductCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n productId: string,\n params?: GetProductChargesParams,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetProductChargesSuspense<\n TData = Awaited<ReturnType<typeof getProductCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n productId: string,\n params?: GetProductChargesParams,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n/**\n * @summary Get charges made against a Product\n */\n\nexport function useGetProductChargesSuspense<\n TData = Awaited<ReturnType<typeof getProductCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n productId: string,\n params?: GetProductChargesParams,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = useGetProductChargesSuspenseQueryOptions(productId, 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 * Get the charges made against a Unit with optional **from** (inclusive) and **until** (exclusive) dates. If no dates are provided, the charges for the current billing period are returned.\nDates are interpreted using the Python `dateutil` parser, so the input strings are extremely flexible with, for example, `1 December 2021` as an acceptable input.\n\n**From** must be a date (day) prior to **until**. For example, to see the charges for the 11th July 2022 set **from** to `11 July 2022` and **until** to `12 July 2022`. As an alternative to **From** and **Until** you can provide a **Prior Billing Period**, a value that identifies the prior period to retrieve. A value of `-1` would indicate the *prior period* (month) with an oldest retrieval value of `-23` allowing you to obtain charges for up to two years.\n\nYou need to be part of the **Unit** or **Organisation** to use this method\n * @summary Get charges made against a Unit\n */\nexport const getUnitCharges = (\n unitId: string,\n params?: GetUnitChargesParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\n return customInstance<UnitChargesGetResponse>(\n { url: `/charges/unit/${unitId}`, method: \"GET\", params, signal },\n options,\n );\n};\n\nexport const getGetUnitChargesQueryKey = (unitId: string, params?: GetUnitChargesParams) => {\n return [`/charges/unit/${unitId}`, ...(params ? [params] : [])] as const;\n};\n\nexport const useGetUnitChargesQueryOptions = <\n TData = Awaited<ReturnType<typeof getUnitCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n unitId: string,\n params?: GetUnitChargesParams,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUnitChargesQueryKey(unitId, params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getUnitCharges>>> = ({ signal }) =>\n getUnitCharges(unitId, params, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseQueryOptions<\n Awaited<ReturnType<typeof getUnitCharges>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n};\n\nexport type GetUnitChargesQueryResult = NonNullable<Awaited<ReturnType<typeof getUnitCharges>>>;\nexport type GetUnitChargesQueryError = ErrorType<AsError | void>;\n\nexport function useGetUnitCharges<\n TData = Awaited<ReturnType<typeof getUnitCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n unitId: string,\n params: undefined | GetUnitChargesParams,\n options: {\n query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>> &\n Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getUnitCharges>>,\n TError,\n Awaited<ReturnType<typeof getUnitCharges>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetUnitCharges<\n TData = Awaited<ReturnType<typeof getUnitCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n unitId: string,\n params?: GetUnitChargesParams,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>> &\n Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getUnitCharges>>,\n TError,\n Awaited<ReturnType<typeof getUnitCharges>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetUnitCharges<\n TData = Awaited<ReturnType<typeof getUnitCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n unitId: string,\n params?: GetUnitChargesParams,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n/**\n * @summary Get charges made against a Unit\n */\n\nexport function useGetUnitCharges<\n TData = Awaited<ReturnType<typeof getUnitCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n unitId: string,\n params?: GetUnitChargesParams,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = useGetUnitChargesQueryOptions(unitId, 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 useGetUnitChargesSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getUnitCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n unitId: string,\n params?: GetUnitChargesParams,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUnitChargesQueryKey(unitId, params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getUnitCharges>>> = ({ signal }) =>\n getUnitCharges(unitId, params, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getUnitCharges>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n};\n\nexport type GetUnitChargesSuspenseQueryResult = NonNullable<\n Awaited<ReturnType<typeof getUnitCharges>>\n>;\nexport type GetUnitChargesSuspenseQueryError = ErrorType<AsError | void>;\n\nexport function useGetUnitChargesSuspense<\n TData = Awaited<ReturnType<typeof getUnitCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n unitId: string,\n params: undefined | GetUnitChargesParams,\n options: {\n query: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetUnitChargesSuspense<\n TData = Awaited<ReturnType<typeof getUnitCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n unitId: string,\n params?: GetUnitChargesParams,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetUnitChargesSuspense<\n TData = Awaited<ReturnType<typeof getUnitCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n unitId: string,\n params?: GetUnitChargesParams,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n/**\n * @summary Get charges made against a Unit\n */\n\nexport function useGetUnitChargesSuspense<\n TData = Awaited<ReturnType<typeof getUnitCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n unitId: string,\n params?: GetUnitChargesParams,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = useGetUnitChargesSuspenseQueryOptions(unitId, 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"]}