@squonk/account-server-client 0.1.3-rc.1 → 0.1.6-rc.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.
@@ -0,0 +1,2 @@
1
+ var A=Object.defineProperty,l=Object.defineProperties;var p=Object.getOwnPropertyDescriptors;var c=Object.getOwnPropertySymbols;var T=Object.prototype.hasOwnProperty,R=Object.prototype.propertyIsEnumerable;var a=(e,o,r)=>o in e?A(e,o,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[o]=r,s=(e,o)=>{for(var r in o||(o={}))T.call(o,r)&&a(e,r,o[r]);if(c)for(var r of c(o))R.call(o,r)&&a(e,r,o[r]);return e},i=(e,o)=>l(e,p(o));import u from"axios";var t=u.create({baseURL:""}),g=e=>{t.defaults.headers.common.Authorization=`Bearer ${e}`},C=e=>{t.defaults.baseURL=e},d=(e,o)=>{let r=u.CancelToken.source(),n=t(i(s(s({},e),o),{cancelToken:r.token})).then(({data:x})=>x);return n.cancel=()=>{r.cancel("Query was cancelled by React Query")},n};export{s as a,t as b,g as c,C as d,d as e};
2
+ //# sourceMappingURL=chunk-33VR3IML.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/custom-instance.ts"],
4
+ "sourcesContent": ["/** Based off the example custom-instance from Orval docs\n * https://github.com/anymaniax/orval/blob/master/samples/react-app-with-react-query/src/api/mutator/custom-instance.ts\n *\n * See https://react-query.tanstack.com/guides/query-cancellation\n *\n * TODO: Considering using Fetch-API instead of axios. This instance will have to change. Could be\n * achieved without changing much using `redaxios`\n * Or use 'ky'\n */\n\nimport Axios, { AxiosError, AxiosRequestConfig } from 'axios';\n\n// ? Need the baseUrl or does it default to ''?\nexport const AXIOS_INSTANCE = Axios.create({ baseURL: '' });\n\n/**\n * Set the access token to be added as the `Authorization: Bearer 'token'` header\n * Useful for client only apps where a proxy API route isn't involved to securely add the access token\n * @param token access token\n */\nexport const setAuthToken = (token: string) => {\n AXIOS_INSTANCE.defaults.headers.common['Authorization'] = `Bearer ${token}`;\n};\n\n/**\n * Set the url to which request paths are added to.\n * @param baseUrl origin + subpath e.g. 'https://example.com/subpath' or '/subpath'\n */\nexport const setBaseUrl = (baseUrl: string) => {\n AXIOS_INSTANCE.defaults.baseURL = baseUrl;\n};\n\nexport const customInstance = <TReturn>(\n config: AxiosRequestConfig,\n options?: AxiosRequestConfig,\n): Promise<TReturn> => {\n const source = Axios.CancelToken.source();\n\n const promise = AXIOS_INSTANCE({ ...config, ...options, cancelToken: source.token }).then(\n ({ data }) => data,\n );\n\n // Promise doesn't have a cancel method but react-query requires this method to make cancellations general.\n // This can either be a any assertion or a @ts-ignore comment.\n (promise as any).cancel = () => {\n source.cancel('Query was cancelled by React Query');\n };\n\n return promise;\n};\n\nexport type ErrorType<TError> = AxiosError<TError>;\n"],
5
+ "mappings": "6aAUA,qBAGO,GAAM,GAAiB,EAAM,OAAO,CAAE,QAAS,KAOzC,EAAe,AAAC,GAAkB,CAC7C,EAAe,SAAS,QAAQ,OAAO,cAAmB,UAAU,KAOzD,EAAa,AAAC,GAAoB,CAC7C,EAAe,SAAS,QAAU,GAGvB,EAAiB,CAC5B,EACA,IACqB,CACrB,GAAM,GAAS,EAAM,YAAY,SAE3B,EAAU,EAAe,SAAK,GAAW,GAAhB,CAAyB,YAAa,EAAO,SAAS,KACnF,CAAC,CAAE,UAAW,GAKhB,MAAC,GAAgB,OAAS,IAAM,CAC9B,EAAO,OAAO,uCAGT",
6
+ "names": []
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var A=Object.defineProperty,l=Object.defineProperties;var p=Object.getOwnPropertyDescriptors;var c=Object.getOwnPropertySymbols;var T=Object.prototype.hasOwnProperty,R=Object.prototype.propertyIsEnumerable;var a=(e,o,r)=>o in e?A(e,o,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[o]=r,s= exports.a =(e,o)=>{for(var r in o||(o={}))T.call(o,r)&&a(e,r,o[r]);if(c)for(var r of c(o))R.call(o,r)&&a(e,r,o[r]);return e},i=(e,o)=>l(e,p(o));var _axios = require('axios'); var _axios2 = _interopRequireDefault(_axios);var t=_axios2.default.create({baseURL:""}),C= exports.c =e=>{t.defaults.headers.common.Authorization=`Bearer ${e}`},d= exports.d =e=>{t.defaults.baseURL=e},h= exports.e =(e,o)=>{let r=_axios2.default.CancelToken.source(),n=t(i(s(s({},e),o),{cancelToken:r.token})).then(({data:x})=>x);return n.cancel=()=>{r.cancel("Query was cancelled by React Query")},n};exports.a = s; exports.b = t; exports.c = C; exports.d = d; exports.e = h;
2
+ //# sourceMappingURL=chunk-3KO3PKBX.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/custom-instance.ts"],
4
+ "sourcesContent": ["/** Based off the example custom-instance from Orval docs\n * https://github.com/anymaniax/orval/blob/master/samples/react-app-with-react-query/src/api/mutator/custom-instance.ts\n *\n * See https://react-query.tanstack.com/guides/query-cancellation\n *\n * TODO: Considering using Fetch-API instead of axios. This instance will have to change. Could be\n * achieved without changing much using `redaxios`\n * Or use 'ky'\n */\n\nimport Axios, { AxiosError, AxiosRequestConfig } from 'axios';\n\n// ? Need the baseUrl or does it default to ''?\nexport const AXIOS_INSTANCE = Axios.create({ baseURL: '' });\n\n/**\n * Set the access token to be added as the `Authorization: Bearer 'token'` header\n * Useful for client only apps where a proxy API route isn't involved to securely add the access token\n * @param token access token\n */\nexport const setAuthToken = (token: string) => {\n AXIOS_INSTANCE.defaults.headers.common['Authorization'] = `Bearer ${token}`;\n};\n\n/**\n * Set the url to which request paths are added to.\n * @param baseUrl origin + subpath e.g. 'https://example.com/subpath' or '/subpath'\n */\nexport const setBaseUrl = (baseUrl: string) => {\n AXIOS_INSTANCE.defaults.baseURL = baseUrl;\n};\n\nexport const customInstance = <TReturn>(\n config: AxiosRequestConfig,\n options?: AxiosRequestConfig,\n): Promise<TReturn> => {\n const source = Axios.CancelToken.source();\n\n const promise = AXIOS_INSTANCE({ ...config, ...options, cancelToken: source.token }).then(\n ({ data }) => data,\n );\n\n // Promise doesn't have a cancel method but react-query requires this method to make cancellations general.\n // This can either be a any assertion or a @ts-ignore comment.\n (promise as any).cancel = () => {\n source.cancel('Query was cancelled by React Query');\n };\n\n return promise;\n};\n\nexport type ErrorType<TError> = AxiosError<TError>;\n"],
5
+ "mappings": "6aAUA,qBAGO,GAAM,GAAiB,EAAM,OAAO,CAAE,QAAS,KAOzC,EAAe,AAAC,GAAkB,CAC7C,EAAe,SAAS,QAAQ,OAAO,cAAmB,UAAU,KAOzD,EAAa,AAAC,GAAoB,CAC7C,EAAe,SAAS,QAAU,GAGvB,EAAiB,CAC5B,EACA,IACqB,CACrB,GAAM,GAAS,EAAM,YAAY,SAE3B,EAAU,EAAe,SAAK,GAAW,GAAhB,CAAyB,YAAa,EAAO,SAAS,KACnF,CAAC,CAAE,UAAW,GAKhB,MAAC,GAAgB,OAAS,IAAM,CAC9B,EAAO,OAAO,uCAGT",
6
+ "names": []
7
+ }
@@ -1,8 +1,8 @@
1
1
  import * as axios from 'axios';
2
- import { AxiosRequestConfig } from 'axios';
2
+ import { AxiosRequestConfig, AxiosError } from 'axios';
3
3
 
4
4
  /**
5
- * Generated by orval v6.3.0 🍺
5
+ * Generated by orval v6.4.0 🍺
6
6
  * Do not edit manually.
7
7
  * Account Server API
8
8
  * The Informatics Matters Account Server API.
@@ -11,167 +11,210 @@ A service that provides access to the Account Server, which gives *registered* u
11
11
 
12
12
  * OpenAPI spec version: 0.1
13
13
  */
14
- interface Error {
15
- /** Brief error text that can be presented to the user
16
- */
17
- error: string;
18
- }
19
- interface OrganisationPostResponse {
20
- /** The organisation's unique ID
21
- */
14
+ /**
15
+ * A dummy
16
+
17
+ */
18
+ declare type QDummyParameter = boolean;
19
+ declare type ProductPatchBodyBody = {
20
+ /** The name you want to give the Product */
21
+ name?: string;
22
+ /** The Product's built-in coin alloance. */
23
+ allowance?: number;
24
+ /** The Product's built-in coin limit. If set it must not be less than the allowance. If not set the allowance is used */
25
+ limit?: number;
26
+ };
27
+ /**
28
+ * The Flavour of the Product. Used only for Project Tier Products. Do nto set this for Storage products
29
+ */
30
+ declare type UnitProductPostBodyBodyFlavour = "EVALUATION" | "BRONZE" | "SILVER" | "GOLD";
31
+ declare const UnitProductPostBodyBodyFlavour: {
32
+ EVALUATION: UnitProductPostBodyBodyFlavour;
33
+ BRONZE: UnitProductPostBodyBodyFlavour;
34
+ SILVER: UnitProductPostBodyBodyFlavour;
35
+ GOLD: UnitProductPostBodyBodyFlavour;
36
+ };
37
+ /**
38
+ * The Type of Product. Storage subscriptions require an **Allowance** to be defined and the **Flavour** must not be providec. Project Tier subscriptions have built-in allowances and Limits so you must not provide values for these for these products
39
+ */
40
+ declare type UnitProductPostBodyBodyType = "DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION" | "DATA_MANAGER_STORAGE_SUBSCRIPTION";
41
+ declare const UnitProductPostBodyBodyType: {
42
+ DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION: UnitProductPostBodyBodyType;
43
+ DATA_MANAGER_STORAGE_SUBSCRIPTION: UnitProductPostBodyBodyType;
44
+ };
45
+ declare type UnitProductPostBodyBody = {
46
+ /** The name you want to give the Product */
47
+ name: string;
48
+ /** The Type of Product. Storage subscriptions require an **Allowance** to be defined and the **Flavour** must not be providec. Project Tier subscriptions have built-in allowances and Limits so you must not provide values for these for these products */
49
+ type: UnitProductPostBodyBodyType;
50
+ /** The Flavour of the Product. Used only for Project Tier Products. Do nto set this for Storage products */
51
+ flavour?: UnitProductPostBodyBodyFlavour;
52
+ /** The Product's coin alloance. You must provide this for Storage products but you must not provide a value for Project Tier Products */
53
+ allowance?: number;
54
+ /** The Product's built-in coin limit. If set it must not be less than the allowance. If not set the allowance is used. You can provide this for Storage products but you must not provide a value for Project Tier Products */
55
+ limit?: number;
56
+ /** The day you would like to be billed for the Product's subscription (a value from 1 and 28) */
57
+ billing_day: number;
58
+ };
59
+ declare type OrganisationUnitPostBodyBody = {
60
+ /** The name of the unit */
61
+ name: string;
62
+ };
63
+ declare type OrganisationPostBodyBody = {
64
+ /** The name of the organisaion */
65
+ name: string;
66
+ };
67
+ interface UserDetail {
22
68
  id: string;
23
69
  }
24
- interface UsersGetResponse {
25
- organisation?: OrganisationDetail;
26
- unit?: UnitDetail;
27
- /** The list of Organisation Users
28
- */
29
- users: UserDetail[];
30
- }
31
- interface OrganisationUnitPostResponse {
32
- /** The unit's unique ID
33
- */
70
+ interface UnitDetail {
34
71
  id: string;
72
+ name: string;
73
+ owner_id: string;
35
74
  }
36
- interface OrganisationUnitsGetResponse {
37
- organisation: OrganisationDetail;
38
- /** A list of Units
39
- */
40
- units: UnitDetail[];
41
- }
42
- interface OrganisationsGetResponse {
43
- /** A list of Organisaions
44
- */
45
- organisations: OrganisationDetail[];
46
- }
47
- declare type ProductGetResponseProductsItem = ProductDmStorage | ProductDmProjectTier;
48
- interface ProductGetResponse {
49
- /** All the Products you have access to
50
- */
51
- products: ProductGetResponseProductsItem[];
52
- }
53
- declare type ProductUnitGetResponseProductsItem = ProductDmStorage | ProductDmProjectTier;
54
- interface ProductUnitGetResponse {
55
- /** The Unit's Products you have access to
56
- */
57
- products: ProductUnitGetResponseProductsItem[];
58
- }
59
- interface ProductDmStorage {
60
- product: ProductDetail;
61
- organisation: OrganisationDetail;
62
- unit: UnitDetail;
63
- storage: ProductDmStorageDetail;
64
- coins: ProductCoinsDetail;
65
- }
66
- interface ProductDmProjectTier {
67
- product: ProductDetail;
68
- organisation: OrganisationDetail;
69
- unit: UnitDetail;
70
- storage: ProductDmStorageDetail;
71
- coins: ProductCoinsDetail;
72
- instance: ProductInstanceDetail;
73
- claim?: ProductClaimDetail;
75
+ interface OrganisationDetail {
76
+ id: string;
77
+ name: string;
78
+ owner_id: string;
74
79
  }
75
- declare type ProductDmStorageDetailSize = {
76
- /** The humanised size of the peak storage used for the current day. The value is reset at the start of each day */
77
- peak: string;
78
- /** The humanised size of the current storage used for the current day and used to calculate the 'burn rate' */
79
- current: string;
80
- /** The humanised storage unit. The cost of storage is based on the daily peak of the number of units (or part thereof) used */
81
- unit_size: string;
82
- /** The peak number of storage units used today */
83
- units_used: number;
84
- };
85
- declare type ProductDmStorageDetailCoins = {
86
- /** The number of coins currently committed for the current day. This is added to the acumulated coins at the start of each day */
80
+ declare type ProductInstanceDetailCoins = {
87
81
  used: number;
88
- /** The coin cost of a 'unit' of strage or part thereof. The unit size is defined in the storage section of the response */
89
- unit_cost: number;
90
82
  };
91
- interface ProductDmStorageDetail {
92
- size: ProductDmStorageDetailSize;
93
- coins: ProductDmStorageDetailCoins;
83
+ interface ProductInstanceDetail {
84
+ coins: ProductInstanceDetailCoins;
94
85
  }
95
- interface ProductClaimDetail {
96
- /** The service ID using this Subscription.
86
+ declare type ProductDetailFlavour = "EVALUATION" | "BRONZE" | "SILVER" | "GOLD";
87
+ declare const ProductDetailFlavour: {
88
+ EVALUATION: ProductDetailFlavour;
89
+ BRONZE: ProductDetailFlavour;
90
+ SILVER: ProductDetailFlavour;
91
+ GOLD: ProductDetailFlavour;
92
+ };
93
+ declare type ProductDetailType = "DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION" | "DATA_MANAGER_STORAGE_SUBSCRIPTION";
94
+ declare const ProductDetailType: {
95
+ DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION: ProductDetailType;
96
+ DATA_MANAGER_STORAGE_SUBSCRIPTION: ProductDetailType;
97
+ };
98
+ interface ProductDetail {
99
+ /** The Product ID
97
100
  */
98
101
  id: string;
99
- /** A name for the service
100
- */
102
+ type: ProductDetailType;
103
+ flavour?: ProductDetailFlavour;
101
104
  name?: string;
102
105
  }
103
106
  interface ProductCoinsDetail {
104
107
  /** The billing allowance. When you exceed this during the current billign period the *cost multipler* will increase */
105
108
  allowance: number;
106
109
  /** The limit on your billing period spend. You can exceed the allowance but you cannot exceed the spend limit. Once reached the dependent may be restricted */
107
- limit?: number;
110
+ limit: number;
108
111
  /** The total number of coins consumed (in this billing period), exclding the coins that have been consumed for the current day */
109
112
  used: number;
113
+ /** True if the product is oeprating at or beyond its coin limit. When it is authority to perform actions using the product are severly limited. */
114
+ at_limit: boolean;
110
115
  /** The current burn rate, the approximate amount of coins you are currently consuming each day */
111
116
  current_burn_rate: number;
112
117
  /** The predicted billing period amount, if costs continue at the current burn rate until the end of the billing period */
113
118
  billing_prediction: number;
114
119
  /** The day of the month when the bill is due, and the end of the current billign period */
115
120
  billing_day: number;
116
- /** A multipler applied to your coin usage. If you are below your allowance for the billign period it wil be 1.0. When you exceed your allowance the mutiplier is likely to increase */
117
- cost_multiplier: number;
118
- /** A multipler that will be applied to your coin usage if you exceed your allowance */
119
- next_cost_multiplier: number;
121
+ /** A multipler applied to your coin usage within yoru allowance */
122
+ allowance_multiplier: number;
123
+ /** A multipler that will be applied to coin used beyond your allowance */
124
+ overspend_multiplier: number;
120
125
  /** The number of days remaining, in the current billing period */
121
126
  remaining_days: number;
122
127
  }
123
- declare type ProductDetailType = "DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION" | "DATA_MANAGER_STORAGE_SUBSCRIPTION";
124
- declare const ProductDetailType: {
125
- DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION: ProductDetailType;
126
- DATA_MANAGER_STORAGE_SUBSCRIPTION: ProductDetailType;
127
- };
128
- declare type ProductDetailFlavour = "EVALUATION" | "BRONZE" | "SILVER" | "GOLD";
129
- declare const ProductDetailFlavour: {
130
- EVALUATION: ProductDetailFlavour;
131
- BRONZE: ProductDetailFlavour;
132
- SILVER: ProductDetailFlavour;
133
- GOLD: ProductDetailFlavour;
134
- };
135
- interface ProductDetail {
136
- /** The Product ID
128
+ interface ProductClaimDetail {
129
+ /** The service ID using this Subscription.
137
130
  */
138
131
  id: string;
139
- type: ProductDetailType;
140
- flavour?: ProductDetailFlavour;
132
+ /** A name for the service
133
+ */
141
134
  name?: string;
142
135
  }
143
- declare type ProductInstanceDetailCoins = {
136
+ declare type ProductDmStorageDetailCoins = {
137
+ /** The number of coins currently committed for the current day. This is added to the acumulated coins at the start of each day */
144
138
  used: number;
139
+ /** The coin cost of a 'unit' of strage or part thereof. The unit size is defined in the storage section of the response */
140
+ unit_cost: number;
145
141
  };
146
- interface ProductInstanceDetail {
147
- coins: ProductInstanceDetailCoins;
142
+ declare type ProductDmStorageDetailSize = {
143
+ /** The humanised size of the peak storage used for the current day. The value is reset at the start of each day */
144
+ peak: string;
145
+ /** The humanised size of the current storage used for the current day and used to calculate the 'burn rate' */
146
+ current: string;
147
+ /** The humanised storage unit. The cost of storage is based on the daily peak of the number of units (or part thereof) used */
148
+ unit_size: string;
149
+ /** The peak number of storage units used today */
150
+ units_used: number;
151
+ };
152
+ interface ProductDmStorageDetail {
153
+ size: ProductDmStorageDetailSize;
154
+ coins: ProductDmStorageDetailCoins;
148
155
  }
149
- interface OrganisationDetail {
150
- id: string;
151
- name: string;
156
+ interface ProductDmProjectTier {
157
+ product: ProductDetail;
158
+ organisation: OrganisationDetail;
159
+ unit: UnitDetail;
160
+ storage: ProductDmStorageDetail;
161
+ coins: ProductCoinsDetail;
162
+ instance: ProductInstanceDetail;
163
+ claim?: ProductClaimDetail;
152
164
  }
153
- interface UnitDetail {
154
- id: string;
155
- name: string;
165
+ interface ProductDmStorage {
166
+ product: ProductDetail;
167
+ organisation: OrganisationDetail;
168
+ unit: UnitDetail;
169
+ storage: ProductDmStorageDetail;
170
+ coins: ProductCoinsDetail;
156
171
  }
157
- interface UserDetail {
172
+ interface UnitProductPostResponse {
173
+ /** The products's unique ID */
158
174
  id: string;
159
175
  }
160
- declare type OrganisationPostBodyBody = {
161
- /** The name of the organisaion
162
- */
163
- name: string;
164
- };
165
- declare type OrganisationUnitPostBodyBody = {
166
- /** The name of the unit
167
- */
168
- name: string;
169
- };
170
176
  /**
171
- * A dummy
172
-
177
+ * The Unit's Product
173
178
  */
174
- declare type QDummyParameter = boolean;
179
+ declare type ProductUnitGetResponseProduct = ProductDmStorage | ProductDmProjectTier;
180
+ interface ProductUnitGetResponse {
181
+ /** The Unit's Product */
182
+ product: ProductUnitGetResponseProduct;
183
+ }
184
+ declare type ProductsGetResponseProductsItem = ProductDmStorage | ProductDmProjectTier;
185
+ interface ProductsGetResponse {
186
+ /** All the Products you have access to */
187
+ products: ProductsGetResponseProductsItem[];
188
+ }
189
+ interface OrganisationsGetResponse {
190
+ /** A list of Organisaions */
191
+ organisations: OrganisationDetail[];
192
+ }
193
+ interface OrganisationUnitsGetResponse {
194
+ organisation: OrganisationDetail;
195
+ /** A list of Units
196
+ */
197
+ units: UnitDetail[];
198
+ }
199
+ interface OrganisationUnitPostResponse {
200
+ /** The unit's unique ID */
201
+ id: string;
202
+ }
203
+ interface UsersGetResponse {
204
+ organisation?: OrganisationDetail;
205
+ unit?: UnitDetail;
206
+ /** The list of Organisation Users
207
+ */
208
+ users: UserDetail[];
209
+ }
210
+ interface OrganisationPostResponse {
211
+ /** The organisation's unique ID */
212
+ id: string;
213
+ }
214
+ interface Error {
215
+ /** Brief error text that can be presented to the user */
216
+ error: string;
217
+ }
175
218
 
176
219
  declare const AXIOS_INSTANCE: axios.AxiosInstance;
177
220
  /**
@@ -186,5 +229,6 @@ declare const setAuthToken: (token: string) => void;
186
229
  */
187
230
  declare const setBaseUrl: (baseUrl: string) => void;
188
231
  declare const customInstance: <TReturn>(config: AxiosRequestConfig, options?: AxiosRequestConfig<any> | undefined) => Promise<TReturn>;
232
+ declare type ErrorType<TError> = AxiosError<TError>;
189
233
 
190
- export { AXIOS_INSTANCE as A, Error as E, OrganisationPostResponse as O, ProductGetResponseProductsItem as P, QDummyParameter as Q, UsersGetResponse as U, OrganisationUnitPostResponse as a, OrganisationUnitsGetResponse as b, OrganisationsGetResponse as c, ProductGetResponse as d, ProductUnitGetResponseProductsItem as e, ProductUnitGetResponse as f, ProductDmStorage as g, ProductDmProjectTier as h, ProductDmStorageDetailSize as i, ProductDmStorageDetailCoins as j, ProductDmStorageDetail as k, ProductClaimDetail as l, ProductCoinsDetail as m, ProductDetailType as n, ProductDetailFlavour as o, ProductDetail as p, ProductInstanceDetailCoins as q, ProductInstanceDetail as r, OrganisationDetail as s, UnitDetail as t, UserDetail as u, OrganisationPostBodyBody as v, OrganisationUnitPostBodyBody as w, setAuthToken as x, setBaseUrl as y, customInstance as z };
234
+ export { UsersGetResponse as A, OrganisationPostResponse as B, AXIOS_INSTANCE as C, setAuthToken as D, Error as E, setBaseUrl as F, customInstance as G, ErrorType as H, OrganisationUnitPostBodyBody as O, ProductPatchBodyBody as P, QDummyParameter as Q, UnitProductPostBodyBodyFlavour as U, UnitProductPostBodyBodyType as a, UnitProductPostBodyBody as b, OrganisationPostBodyBody as c, UserDetail as d, UnitDetail as e, OrganisationDetail as f, ProductInstanceDetailCoins as g, ProductInstanceDetail as h, ProductDetailFlavour as i, ProductDetailType as j, ProductDetail as k, ProductCoinsDetail as l, ProductClaimDetail as m, ProductDmStorageDetailCoins as n, ProductDmStorageDetailSize as o, ProductDmStorageDetail as p, ProductDmProjectTier as q, ProductDmStorage as r, UnitProductPostResponse as s, ProductUnitGetResponseProduct as t, ProductUnitGetResponse as u, ProductsGetResponseProductsItem as v, ProductsGetResponse as w, OrganisationsGetResponse as x, OrganisationUnitsGetResponse as y, OrganisationUnitPostResponse as z };
package/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkOULWOQLWcjs = require('./chunk-OULWOQLW.cjs');var n={DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION:"DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION",DATA_MANAGER_STORAGE_SUBSCRIPTION:"DATA_MANAGER_STORAGE_SUBSCRIPTION"},a= exports.ProductDetailFlavour ={EVALUATION:"EVALUATION",BRONZE:"BRONZE",SILVER:"SILVER",GOLD:"GOLD"};exports.AXIOS_INSTANCE = _chunkOULWOQLWcjs.b; exports.ProductDetailFlavour = a; exports.ProductDetailType = n; exports.customInstance = _chunkOULWOQLWcjs.e; exports.setAuthToken = _chunkOULWOQLWcjs.c; exports.setBaseUrl = _chunkOULWOQLWcjs.d;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk3KO3PKBXcjs = require('./chunk-3KO3PKBX.cjs');var n={EVALUATION:"EVALUATION",BRONZE:"BRONZE",SILVER:"SILVER",GOLD:"GOLD"},a= exports.UnitProductPostBodyBodyType ={DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION:"DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION",DATA_MANAGER_STORAGE_SUBSCRIPTION:"DATA_MANAGER_STORAGE_SUBSCRIPTION"},s= exports.ProductDetailFlavour ={EVALUATION:"EVALUATION",BRONZE:"BRONZE",SILVER:"SILVER",GOLD:"GOLD"},u= exports.ProductDetailType ={DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION:"DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION",DATA_MANAGER_STORAGE_SUBSCRIPTION:"DATA_MANAGER_STORAGE_SUBSCRIPTION"};exports.AXIOS_INSTANCE = _chunk3KO3PKBXcjs.b; exports.ProductDetailFlavour = s; exports.ProductDetailType = u; exports.UnitProductPostBodyBodyFlavour = n; exports.UnitProductPostBodyBodyType = a; exports.customInstance = _chunk3KO3PKBXcjs.e; exports.setAuthToken = _chunk3KO3PKBXcjs.c; exports.setBaseUrl = _chunk3KO3PKBXcjs.d;
2
2
  //# sourceMappingURL=index.cjs.map
package/index.cjs.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/account-server-api.schemas.ts"],
4
- "sourcesContent": ["/**\n * Generated by orval v6.3.0 \uD83C\uDF7A\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 **Products**, **Organisations**, **Units** and **Users**.\n\n * OpenAPI spec version: 0.1\n */\nexport interface Error {\n /** Brief error text that can be presented to the user\n */\n error: string;\n}\n\nexport interface OrganisationPostResponse {\n /** The organisation's unique ID\n */\n id: string;\n}\n\nexport interface UsersGetResponse {\n organisation?: OrganisationDetail;\n unit?: UnitDetail;\n /** The list of Organisation Users\n */\n users: UserDetail[];\n}\n\nexport interface OrganisationUnitPostResponse {\n /** The unit's unique ID\n */\n id: string;\n}\n\nexport interface OrganisationUnitsGetResponse {\n organisation: OrganisationDetail;\n /** A list of Units\n */\n units: UnitDetail[];\n}\n\nexport interface OrganisationsGetResponse {\n /** A list of Organisaions\n */\n organisations: OrganisationDetail[];\n}\n\nexport type ProductGetResponseProductsItem =\n | ProductDmStorage\n | ProductDmProjectTier;\n\nexport interface ProductGetResponse {\n /** All the Products you have access to\n */\n products: ProductGetResponseProductsItem[];\n}\n\nexport type ProductUnitGetResponseProductsItem =\n | ProductDmStorage\n | ProductDmProjectTier;\n\nexport interface ProductUnitGetResponse {\n /** The Unit's Products you have access to\n */\n products: ProductUnitGetResponseProductsItem[];\n}\n\nexport interface ProductDmStorage {\n product: ProductDetail;\n organisation: OrganisationDetail;\n unit: UnitDetail;\n storage: ProductDmStorageDetail;\n coins: ProductCoinsDetail;\n}\n\nexport interface ProductDmProjectTier {\n product: ProductDetail;\n organisation: OrganisationDetail;\n unit: UnitDetail;\n storage: ProductDmStorageDetail;\n coins: ProductCoinsDetail;\n instance: ProductInstanceDetail;\n claim?: ProductClaimDetail;\n}\n\nexport type ProductDmStorageDetailSize = {\n /** The humanised size of the peak storage used for the current day. The value is reset at the start of each day */\n peak: string;\n /** The humanised size of the current storage used for the current day and used to calculate the 'burn rate' */\n current: string;\n /** The humanised storage unit. The cost of storage is based on the daily peak of the number of units (or part thereof) used */\n unit_size: string;\n /** The peak number of storage units used today */\n units_used: number;\n};\n\nexport type ProductDmStorageDetailCoins = {\n /** The number of coins currently committed for the current day. This is added to the acumulated coins at the start of each day */\n used: number;\n /** The coin cost of a 'unit' of strage or part thereof. The unit size is defined in the storage section of the response */\n unit_cost: number;\n};\n\nexport interface ProductDmStorageDetail {\n size: ProductDmStorageDetailSize;\n coins: ProductDmStorageDetailCoins;\n}\n\nexport interface ProductClaimDetail {\n /** The service ID using this Subscription.\n */\n id: string;\n /** A name for the service\n */\n name?: string;\n}\n\nexport interface ProductCoinsDetail {\n /** The billing allowance. When you exceed this during the current billign period the *cost multipler* will increase */\n allowance: number;\n /** The limit on your billing period spend. You can exceed the allowance but you cannot exceed the spend limit. Once reached the dependent may be restricted */\n limit?: number;\n /** The total number of coins consumed (in this billing period), exclding the coins that have been consumed for the current day */\n used: number;\n /** The current burn rate, the approximate amount of coins you are currently consuming each day */\n current_burn_rate: number;\n /** The predicted billing period amount, if costs continue at the current burn rate until the end of the billing period */\n billing_prediction: number;\n /** The day of the month when the bill is due, and the end of the current billign period */\n billing_day: number;\n /** A multipler applied to your coin usage. If you are below your allowance for the billign period it wil be 1.0. When you exceed your allowance the mutiplier is likely to increase */\n cost_multiplier: number;\n /** A multipler that will be applied to your coin usage if you exceed your allowance */\n next_cost_multiplier: number;\n /** The number of days remaining, in the current billing period */\n remaining_days: number;\n}\n\nexport type ProductDetailType =\n | \"DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION\"\n | \"DATA_MANAGER_STORAGE_SUBSCRIPTION\";\n\nexport const ProductDetailType = {\n DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION:\n \"DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION\" as ProductDetailType,\n DATA_MANAGER_STORAGE_SUBSCRIPTION:\n \"DATA_MANAGER_STORAGE_SUBSCRIPTION\" as ProductDetailType,\n};\n\nexport type ProductDetailFlavour = \"EVALUATION\" | \"BRONZE\" | \"SILVER\" | \"GOLD\";\n\nexport const ProductDetailFlavour = {\n EVALUATION: \"EVALUATION\" as ProductDetailFlavour,\n BRONZE: \"BRONZE\" as ProductDetailFlavour,\n SILVER: \"SILVER\" as ProductDetailFlavour,\n GOLD: \"GOLD\" as ProductDetailFlavour,\n};\n\nexport interface ProductDetail {\n /** The Product ID\n */\n id: string;\n type: ProductDetailType;\n flavour?: ProductDetailFlavour;\n name?: string;\n}\n\nexport type ProductInstanceDetailCoins = {\n used: number;\n};\n\nexport interface ProductInstanceDetail {\n coins: ProductInstanceDetailCoins;\n}\n\nexport interface OrganisationDetail {\n id: string;\n name: string;\n}\n\nexport interface UnitDetail {\n id: string;\n name: string;\n}\n\nexport interface UserDetail {\n id: string;\n}\n\nexport type OrganisationPostBodyBody = {\n /** The name of the organisaion\n */\n name: string;\n};\n\nexport type OrganisationUnitPostBodyBody = {\n /** The name of the unit\n */\n name: string;\n};\n\n/**\n * A dummy\n\n */\nexport type QDummyParameter = boolean;\n"],
5
- "mappings": "8DAgJO,GAAM,GAAoB,CAC/B,uCACE,yCACF,kCACE,qCAKS,EAAuB,CAClC,WAAY,aACZ,OAAQ,SACR,OAAQ,SACR,KAAM",
4
+ "sourcesContent": ["/**\n * Generated by orval v6.4.0 \uD83C\uDF7A\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 **Products**, **Organisations**, **Units** and **Users**.\n\n * OpenAPI spec version: 0.1\n */\n/**\n * A dummy\n\n */\nexport type QDummyParameter = boolean;\n\nexport type ProductPatchBodyBody = {\n /** The name you want to give the Product */\n name?: string;\n /** The Product's built-in coin alloance. */\n allowance?: number;\n /** The Product's built-in coin limit. If set it must not be less than the allowance. If not set the allowance is used */\n limit?: number;\n};\n\n/**\n * The Flavour of the Product. Used only for Project Tier Products. Do nto set this for Storage products\n */\nexport type UnitProductPostBodyBodyFlavour =\n | \"EVALUATION\"\n | \"BRONZE\"\n | \"SILVER\"\n | \"GOLD\";\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const UnitProductPostBodyBodyFlavour = {\n EVALUATION: \"EVALUATION\" as UnitProductPostBodyBodyFlavour,\n BRONZE: \"BRONZE\" as UnitProductPostBodyBodyFlavour,\n SILVER: \"SILVER\" as UnitProductPostBodyBodyFlavour,\n GOLD: \"GOLD\" as UnitProductPostBodyBodyFlavour,\n};\n\n/**\n * The Type of Product. Storage subscriptions require an **Allowance** to be defined and the **Flavour** must not be providec. Project Tier subscriptions have built-in allowances and Limits so you must not provide values for these for these products\n */\nexport type UnitProductPostBodyBodyType =\n | \"DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION\"\n | \"DATA_MANAGER_STORAGE_SUBSCRIPTION\";\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const UnitProductPostBodyBodyType = {\n DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION:\n \"DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION\" as UnitProductPostBodyBodyType,\n DATA_MANAGER_STORAGE_SUBSCRIPTION:\n \"DATA_MANAGER_STORAGE_SUBSCRIPTION\" as UnitProductPostBodyBodyType,\n};\n\nexport type UnitProductPostBodyBody = {\n /** The name you want to give the Product */\n name: string;\n /** The Type of Product. Storage subscriptions require an **Allowance** to be defined and the **Flavour** must not be providec. Project Tier subscriptions have built-in allowances and Limits so you must not provide values for these for these products */\n type: UnitProductPostBodyBodyType;\n /** The Flavour of the Product. Used only for Project Tier Products. Do nto set this for Storage products */\n flavour?: UnitProductPostBodyBodyFlavour;\n /** The Product's coin alloance. You must provide this for Storage products but you must not provide a value for Project Tier Products */\n allowance?: number;\n /** The Product's built-in coin limit. If set it must not be less than the allowance. If not set the allowance is used. You can provide this for Storage products but you must not provide a value for Project Tier Products */\n limit?: number;\n /** The day you would like to be billed for the Product's subscription (a value from 1 and 28) */\n billing_day: number;\n};\n\nexport type OrganisationUnitPostBodyBody = {\n /** The name of the unit */\n name: string;\n};\n\nexport type OrganisationPostBodyBody = {\n /** The name of the organisaion */\n name: string;\n};\n\nexport interface UserDetail {\n id: string;\n}\n\nexport interface UnitDetail {\n id: string;\n name: string;\n owner_id: string;\n}\n\nexport interface OrganisationDetail {\n id: string;\n name: string;\n owner_id: string;\n}\n\nexport type ProductInstanceDetailCoins = {\n used: number;\n};\n\nexport interface ProductInstanceDetail {\n coins: ProductInstanceDetailCoins;\n}\n\nexport type ProductDetailFlavour = \"EVALUATION\" | \"BRONZE\" | \"SILVER\" | \"GOLD\";\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const ProductDetailFlavour = {\n EVALUATION: \"EVALUATION\" as ProductDetailFlavour,\n BRONZE: \"BRONZE\" as ProductDetailFlavour,\n SILVER: \"SILVER\" as ProductDetailFlavour,\n GOLD: \"GOLD\" as ProductDetailFlavour,\n};\n\nexport type ProductDetailType =\n | \"DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION\"\n | \"DATA_MANAGER_STORAGE_SUBSCRIPTION\";\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const ProductDetailType = {\n DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION:\n \"DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION\" as ProductDetailType,\n DATA_MANAGER_STORAGE_SUBSCRIPTION:\n \"DATA_MANAGER_STORAGE_SUBSCRIPTION\" as ProductDetailType,\n};\n\nexport interface ProductDetail {\n /** The Product ID\n */\n id: string;\n type: ProductDetailType;\n flavour?: ProductDetailFlavour;\n name?: string;\n}\n\nexport interface ProductCoinsDetail {\n /** The billing allowance. When you exceed this during the current billign period the *cost multipler* will increase */\n allowance: number;\n /** The limit on your billing period spend. You can exceed the allowance but you cannot exceed the spend limit. Once reached the dependent may be restricted */\n limit: number;\n /** The total number of coins consumed (in this billing period), exclding the coins that have been consumed for the current day */\n used: number;\n /** True if the product is oeprating at or beyond its coin limit. When it is authority to perform actions using the product are severly limited. */\n at_limit: boolean;\n /** The current burn rate, the approximate amount of coins you are currently consuming each day */\n current_burn_rate: number;\n /** The predicted billing period amount, if costs continue at the current burn rate until the end of the billing period */\n billing_prediction: number;\n /** The day of the month when the bill is due, and the end of the current billign period */\n billing_day: number;\n /** A multipler applied to your coin usage within yoru allowance */\n allowance_multiplier: number;\n /** A multipler that will be applied to coin used beyond your allowance */\n overspend_multiplier: number;\n /** The number of days remaining, in the current billing period */\n remaining_days: number;\n}\n\nexport interface ProductClaimDetail {\n /** The service ID using this Subscription.\n */\n id: string;\n /** A name for the service\n */\n name?: string;\n}\n\nexport type ProductDmStorageDetailCoins = {\n /** The number of coins currently committed for the current day. This is added to the acumulated coins at the start of each day */\n used: number;\n /** The coin cost of a 'unit' of strage or part thereof. The unit size is defined in the storage section of the response */\n unit_cost: number;\n};\n\nexport type ProductDmStorageDetailSize = {\n /** The humanised size of the peak storage used for the current day. The value is reset at the start of each day */\n peak: string;\n /** The humanised size of the current storage used for the current day and used to calculate the 'burn rate' */\n current: string;\n /** The humanised storage unit. The cost of storage is based on the daily peak of the number of units (or part thereof) used */\n unit_size: string;\n /** The peak number of storage units used today */\n units_used: number;\n};\n\nexport interface ProductDmStorageDetail {\n size: ProductDmStorageDetailSize;\n coins: ProductDmStorageDetailCoins;\n}\n\nexport interface ProductDmProjectTier {\n product: ProductDetail;\n organisation: OrganisationDetail;\n unit: UnitDetail;\n storage: ProductDmStorageDetail;\n coins: ProductCoinsDetail;\n instance: ProductInstanceDetail;\n claim?: ProductClaimDetail;\n}\n\nexport interface ProductDmStorage {\n product: ProductDetail;\n organisation: OrganisationDetail;\n unit: UnitDetail;\n storage: ProductDmStorageDetail;\n coins: ProductCoinsDetail;\n}\n\nexport interface UnitProductPostResponse {\n /** The products's unique ID */\n id: string;\n}\n\n/**\n * The Unit's Product\n */\nexport type ProductUnitGetResponseProduct =\n | ProductDmStorage\n | ProductDmProjectTier;\n\nexport interface ProductUnitGetResponse {\n /** The Unit's Product */\n product: ProductUnitGetResponseProduct;\n}\n\nexport type ProductsGetResponseProductsItem =\n | ProductDmStorage\n | ProductDmProjectTier;\n\nexport interface ProductsGetResponse {\n /** All the Products you have access to */\n products: ProductsGetResponseProductsItem[];\n}\n\nexport interface OrganisationsGetResponse {\n /** A list of Organisaions */\n organisations: OrganisationDetail[];\n}\n\nexport interface OrganisationUnitsGetResponse {\n organisation: OrganisationDetail;\n /** A list of Units\n */\n units: UnitDetail[];\n}\n\nexport interface OrganisationUnitPostResponse {\n /** The unit's unique ID */\n id: string;\n}\n\nexport interface UsersGetResponse {\n organisation?: OrganisationDetail;\n unit?: UnitDetail;\n /** The list of Organisation Users\n */\n users: UserDetail[];\n}\n\nexport interface OrganisationPostResponse {\n /** The organisation's unique ID */\n id: string;\n}\n\nexport interface Error {\n /** Brief error text that can be presented to the user */\n error: string;\n}\n"],
5
+ "mappings": "8DAmCO,GAAM,GAAiC,CAC5C,WAAY,aACZ,OAAQ,SACR,OAAQ,SACR,KAAM,QAWK,EAA8B,CACzC,uCACE,yCACF,kCACE,qCAuDS,EAAuB,CAClC,WAAY,aACZ,OAAQ,SACR,OAAQ,SACR,KAAM,QAQK,EAAoB,CAC/B,uCACE,yCACF,kCACE",
6
6
  "names": []
7
7
  }
package/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export { A as AXIOS_INSTANCE, E as Error, s as OrganisationDetail, v as OrganisationPostBodyBody, O as OrganisationPostResponse, w as OrganisationUnitPostBodyBody, a as OrganisationUnitPostResponse, b as OrganisationUnitsGetResponse, c as OrganisationsGetResponse, l as ProductClaimDetail, m as ProductCoinsDetail, p as ProductDetail, o as ProductDetailFlavour, n as ProductDetailType, h as ProductDmProjectTier, g as ProductDmStorage, k as ProductDmStorageDetail, j as ProductDmStorageDetailCoins, i as ProductDmStorageDetailSize, d as ProductGetResponse, P as ProductGetResponseProductsItem, r as ProductInstanceDetail, q as ProductInstanceDetailCoins, f as ProductUnitGetResponse, e as ProductUnitGetResponseProductsItem, Q as QDummyParameter, t as UnitDetail, u as UserDetail, U as UsersGetResponse, z as customInstance, x as setAuthToken, y as setBaseUrl } from './custom-instance-ac65127d';
1
+ export { C as AXIOS_INSTANCE, E as Error, H as ErrorType, f as OrganisationDetail, c as OrganisationPostBodyBody, B as OrganisationPostResponse, O as OrganisationUnitPostBodyBody, z as OrganisationUnitPostResponse, y as OrganisationUnitsGetResponse, x as OrganisationsGetResponse, m as ProductClaimDetail, l as ProductCoinsDetail, k as ProductDetail, i as ProductDetailFlavour, j as ProductDetailType, q as ProductDmProjectTier, r as ProductDmStorage, p as ProductDmStorageDetail, n as ProductDmStorageDetailCoins, o as ProductDmStorageDetailSize, h as ProductInstanceDetail, g as ProductInstanceDetailCoins, P as ProductPatchBodyBody, u as ProductUnitGetResponse, t as ProductUnitGetResponseProduct, w as ProductsGetResponse, v as ProductsGetResponseProductsItem, Q as QDummyParameter, e as UnitDetail, b as UnitProductPostBodyBody, U as UnitProductPostBodyBodyFlavour, a as UnitProductPostBodyBodyType, s as UnitProductPostResponse, d as UserDetail, A as UsersGetResponse, G as customInstance, D as setAuthToken, F as setBaseUrl } from './custom-instance-d52e4104';
2
2
  import 'axios';
package/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import{b as t,c as e,d as r,e as i}from"./chunk-WMX3LCLR.js";var o={DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION:"DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION",DATA_MANAGER_STORAGE_SUBSCRIPTION:"DATA_MANAGER_STORAGE_SUBSCRIPTION"},n={EVALUATION:"EVALUATION",BRONZE:"BRONZE",SILVER:"SILVER",GOLD:"GOLD"};export{t as AXIOS_INSTANCE,n as ProductDetailFlavour,o as ProductDetailType,i as customInstance,e as setAuthToken,r as setBaseUrl};
1
+ import{b as t,c as e,d as o,e as r}from"./chunk-33VR3IML.js";var i={EVALUATION:"EVALUATION",BRONZE:"BRONZE",SILVER:"SILVER",GOLD:"GOLD"},n={DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION:"DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION",DATA_MANAGER_STORAGE_SUBSCRIPTION:"DATA_MANAGER_STORAGE_SUBSCRIPTION"},a={EVALUATION:"EVALUATION",BRONZE:"BRONZE",SILVER:"SILVER",GOLD:"GOLD"},s={DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION:"DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION",DATA_MANAGER_STORAGE_SUBSCRIPTION:"DATA_MANAGER_STORAGE_SUBSCRIPTION"};export{t as AXIOS_INSTANCE,a as ProductDetailFlavour,s as ProductDetailType,i as UnitProductPostBodyBodyFlavour,n as UnitProductPostBodyBodyType,r as customInstance,e as setAuthToken,o as setBaseUrl};
2
2
  //# sourceMappingURL=index.js.map
package/index.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/account-server-api.schemas.ts"],
4
- "sourcesContent": ["/**\n * Generated by orval v6.3.0 \uD83C\uDF7A\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 **Products**, **Organisations**, **Units** and **Users**.\n\n * OpenAPI spec version: 0.1\n */\nexport interface Error {\n /** Brief error text that can be presented to the user\n */\n error: string;\n}\n\nexport interface OrganisationPostResponse {\n /** The organisation's unique ID\n */\n id: string;\n}\n\nexport interface UsersGetResponse {\n organisation?: OrganisationDetail;\n unit?: UnitDetail;\n /** The list of Organisation Users\n */\n users: UserDetail[];\n}\n\nexport interface OrganisationUnitPostResponse {\n /** The unit's unique ID\n */\n id: string;\n}\n\nexport interface OrganisationUnitsGetResponse {\n organisation: OrganisationDetail;\n /** A list of Units\n */\n units: UnitDetail[];\n}\n\nexport interface OrganisationsGetResponse {\n /** A list of Organisaions\n */\n organisations: OrganisationDetail[];\n}\n\nexport type ProductGetResponseProductsItem =\n | ProductDmStorage\n | ProductDmProjectTier;\n\nexport interface ProductGetResponse {\n /** All the Products you have access to\n */\n products: ProductGetResponseProductsItem[];\n}\n\nexport type ProductUnitGetResponseProductsItem =\n | ProductDmStorage\n | ProductDmProjectTier;\n\nexport interface ProductUnitGetResponse {\n /** The Unit's Products you have access to\n */\n products: ProductUnitGetResponseProductsItem[];\n}\n\nexport interface ProductDmStorage {\n product: ProductDetail;\n organisation: OrganisationDetail;\n unit: UnitDetail;\n storage: ProductDmStorageDetail;\n coins: ProductCoinsDetail;\n}\n\nexport interface ProductDmProjectTier {\n product: ProductDetail;\n organisation: OrganisationDetail;\n unit: UnitDetail;\n storage: ProductDmStorageDetail;\n coins: ProductCoinsDetail;\n instance: ProductInstanceDetail;\n claim?: ProductClaimDetail;\n}\n\nexport type ProductDmStorageDetailSize = {\n /** The humanised size of the peak storage used for the current day. The value is reset at the start of each day */\n peak: string;\n /** The humanised size of the current storage used for the current day and used to calculate the 'burn rate' */\n current: string;\n /** The humanised storage unit. The cost of storage is based on the daily peak of the number of units (or part thereof) used */\n unit_size: string;\n /** The peak number of storage units used today */\n units_used: number;\n};\n\nexport type ProductDmStorageDetailCoins = {\n /** The number of coins currently committed for the current day. This is added to the acumulated coins at the start of each day */\n used: number;\n /** The coin cost of a 'unit' of strage or part thereof. The unit size is defined in the storage section of the response */\n unit_cost: number;\n};\n\nexport interface ProductDmStorageDetail {\n size: ProductDmStorageDetailSize;\n coins: ProductDmStorageDetailCoins;\n}\n\nexport interface ProductClaimDetail {\n /** The service ID using this Subscription.\n */\n id: string;\n /** A name for the service\n */\n name?: string;\n}\n\nexport interface ProductCoinsDetail {\n /** The billing allowance. When you exceed this during the current billign period the *cost multipler* will increase */\n allowance: number;\n /** The limit on your billing period spend. You can exceed the allowance but you cannot exceed the spend limit. Once reached the dependent may be restricted */\n limit?: number;\n /** The total number of coins consumed (in this billing period), exclding the coins that have been consumed for the current day */\n used: number;\n /** The current burn rate, the approximate amount of coins you are currently consuming each day */\n current_burn_rate: number;\n /** The predicted billing period amount, if costs continue at the current burn rate until the end of the billing period */\n billing_prediction: number;\n /** The day of the month when the bill is due, and the end of the current billign period */\n billing_day: number;\n /** A multipler applied to your coin usage. If you are below your allowance for the billign period it wil be 1.0. When you exceed your allowance the mutiplier is likely to increase */\n cost_multiplier: number;\n /** A multipler that will be applied to your coin usage if you exceed your allowance */\n next_cost_multiplier: number;\n /** The number of days remaining, in the current billing period */\n remaining_days: number;\n}\n\nexport type ProductDetailType =\n | \"DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION\"\n | \"DATA_MANAGER_STORAGE_SUBSCRIPTION\";\n\nexport const ProductDetailType = {\n DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION:\n \"DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION\" as ProductDetailType,\n DATA_MANAGER_STORAGE_SUBSCRIPTION:\n \"DATA_MANAGER_STORAGE_SUBSCRIPTION\" as ProductDetailType,\n};\n\nexport type ProductDetailFlavour = \"EVALUATION\" | \"BRONZE\" | \"SILVER\" | \"GOLD\";\n\nexport const ProductDetailFlavour = {\n EVALUATION: \"EVALUATION\" as ProductDetailFlavour,\n BRONZE: \"BRONZE\" as ProductDetailFlavour,\n SILVER: \"SILVER\" as ProductDetailFlavour,\n GOLD: \"GOLD\" as ProductDetailFlavour,\n};\n\nexport interface ProductDetail {\n /** The Product ID\n */\n id: string;\n type: ProductDetailType;\n flavour?: ProductDetailFlavour;\n name?: string;\n}\n\nexport type ProductInstanceDetailCoins = {\n used: number;\n};\n\nexport interface ProductInstanceDetail {\n coins: ProductInstanceDetailCoins;\n}\n\nexport interface OrganisationDetail {\n id: string;\n name: string;\n}\n\nexport interface UnitDetail {\n id: string;\n name: string;\n}\n\nexport interface UserDetail {\n id: string;\n}\n\nexport type OrganisationPostBodyBody = {\n /** The name of the organisaion\n */\n name: string;\n};\n\nexport type OrganisationUnitPostBodyBody = {\n /** The name of the unit\n */\n name: string;\n};\n\n/**\n * A dummy\n\n */\nexport type QDummyParameter = boolean;\n"],
5
- "mappings": "6DAgJO,GAAM,GAAoB,CAC/B,uCACE,yCACF,kCACE,qCAKS,EAAuB,CAClC,WAAY,aACZ,OAAQ,SACR,OAAQ,SACR,KAAM",
4
+ "sourcesContent": ["/**\n * Generated by orval v6.4.0 \uD83C\uDF7A\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 **Products**, **Organisations**, **Units** and **Users**.\n\n * OpenAPI spec version: 0.1\n */\n/**\n * A dummy\n\n */\nexport type QDummyParameter = boolean;\n\nexport type ProductPatchBodyBody = {\n /** The name you want to give the Product */\n name?: string;\n /** The Product's built-in coin alloance. */\n allowance?: number;\n /** The Product's built-in coin limit. If set it must not be less than the allowance. If not set the allowance is used */\n limit?: number;\n};\n\n/**\n * The Flavour of the Product. Used only for Project Tier Products. Do nto set this for Storage products\n */\nexport type UnitProductPostBodyBodyFlavour =\n | \"EVALUATION\"\n | \"BRONZE\"\n | \"SILVER\"\n | \"GOLD\";\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const UnitProductPostBodyBodyFlavour = {\n EVALUATION: \"EVALUATION\" as UnitProductPostBodyBodyFlavour,\n BRONZE: \"BRONZE\" as UnitProductPostBodyBodyFlavour,\n SILVER: \"SILVER\" as UnitProductPostBodyBodyFlavour,\n GOLD: \"GOLD\" as UnitProductPostBodyBodyFlavour,\n};\n\n/**\n * The Type of Product. Storage subscriptions require an **Allowance** to be defined and the **Flavour** must not be providec. Project Tier subscriptions have built-in allowances and Limits so you must not provide values for these for these products\n */\nexport type UnitProductPostBodyBodyType =\n | \"DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION\"\n | \"DATA_MANAGER_STORAGE_SUBSCRIPTION\";\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const UnitProductPostBodyBodyType = {\n DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION:\n \"DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION\" as UnitProductPostBodyBodyType,\n DATA_MANAGER_STORAGE_SUBSCRIPTION:\n \"DATA_MANAGER_STORAGE_SUBSCRIPTION\" as UnitProductPostBodyBodyType,\n};\n\nexport type UnitProductPostBodyBody = {\n /** The name you want to give the Product */\n name: string;\n /** The Type of Product. Storage subscriptions require an **Allowance** to be defined and the **Flavour** must not be providec. Project Tier subscriptions have built-in allowances and Limits so you must not provide values for these for these products */\n type: UnitProductPostBodyBodyType;\n /** The Flavour of the Product. Used only for Project Tier Products. Do nto set this for Storage products */\n flavour?: UnitProductPostBodyBodyFlavour;\n /** The Product's coin alloance. You must provide this for Storage products but you must not provide a value for Project Tier Products */\n allowance?: number;\n /** The Product's built-in coin limit. If set it must not be less than the allowance. If not set the allowance is used. You can provide this for Storage products but you must not provide a value for Project Tier Products */\n limit?: number;\n /** The day you would like to be billed for the Product's subscription (a value from 1 and 28) */\n billing_day: number;\n};\n\nexport type OrganisationUnitPostBodyBody = {\n /** The name of the unit */\n name: string;\n};\n\nexport type OrganisationPostBodyBody = {\n /** The name of the organisaion */\n name: string;\n};\n\nexport interface UserDetail {\n id: string;\n}\n\nexport interface UnitDetail {\n id: string;\n name: string;\n owner_id: string;\n}\n\nexport interface OrganisationDetail {\n id: string;\n name: string;\n owner_id: string;\n}\n\nexport type ProductInstanceDetailCoins = {\n used: number;\n};\n\nexport interface ProductInstanceDetail {\n coins: ProductInstanceDetailCoins;\n}\n\nexport type ProductDetailFlavour = \"EVALUATION\" | \"BRONZE\" | \"SILVER\" | \"GOLD\";\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const ProductDetailFlavour = {\n EVALUATION: \"EVALUATION\" as ProductDetailFlavour,\n BRONZE: \"BRONZE\" as ProductDetailFlavour,\n SILVER: \"SILVER\" as ProductDetailFlavour,\n GOLD: \"GOLD\" as ProductDetailFlavour,\n};\n\nexport type ProductDetailType =\n | \"DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION\"\n | \"DATA_MANAGER_STORAGE_SUBSCRIPTION\";\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const ProductDetailType = {\n DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION:\n \"DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION\" as ProductDetailType,\n DATA_MANAGER_STORAGE_SUBSCRIPTION:\n \"DATA_MANAGER_STORAGE_SUBSCRIPTION\" as ProductDetailType,\n};\n\nexport interface ProductDetail {\n /** The Product ID\n */\n id: string;\n type: ProductDetailType;\n flavour?: ProductDetailFlavour;\n name?: string;\n}\n\nexport interface ProductCoinsDetail {\n /** The billing allowance. When you exceed this during the current billign period the *cost multipler* will increase */\n allowance: number;\n /** The limit on your billing period spend. You can exceed the allowance but you cannot exceed the spend limit. Once reached the dependent may be restricted */\n limit: number;\n /** The total number of coins consumed (in this billing period), exclding the coins that have been consumed for the current day */\n used: number;\n /** True if the product is oeprating at or beyond its coin limit. When it is authority to perform actions using the product are severly limited. */\n at_limit: boolean;\n /** The current burn rate, the approximate amount of coins you are currently consuming each day */\n current_burn_rate: number;\n /** The predicted billing period amount, if costs continue at the current burn rate until the end of the billing period */\n billing_prediction: number;\n /** The day of the month when the bill is due, and the end of the current billign period */\n billing_day: number;\n /** A multipler applied to your coin usage within yoru allowance */\n allowance_multiplier: number;\n /** A multipler that will be applied to coin used beyond your allowance */\n overspend_multiplier: number;\n /** The number of days remaining, in the current billing period */\n remaining_days: number;\n}\n\nexport interface ProductClaimDetail {\n /** The service ID using this Subscription.\n */\n id: string;\n /** A name for the service\n */\n name?: string;\n}\n\nexport type ProductDmStorageDetailCoins = {\n /** The number of coins currently committed for the current day. This is added to the acumulated coins at the start of each day */\n used: number;\n /** The coin cost of a 'unit' of strage or part thereof. The unit size is defined in the storage section of the response */\n unit_cost: number;\n};\n\nexport type ProductDmStorageDetailSize = {\n /** The humanised size of the peak storage used for the current day. The value is reset at the start of each day */\n peak: string;\n /** The humanised size of the current storage used for the current day and used to calculate the 'burn rate' */\n current: string;\n /** The humanised storage unit. The cost of storage is based on the daily peak of the number of units (or part thereof) used */\n unit_size: string;\n /** The peak number of storage units used today */\n units_used: number;\n};\n\nexport interface ProductDmStorageDetail {\n size: ProductDmStorageDetailSize;\n coins: ProductDmStorageDetailCoins;\n}\n\nexport interface ProductDmProjectTier {\n product: ProductDetail;\n organisation: OrganisationDetail;\n unit: UnitDetail;\n storage: ProductDmStorageDetail;\n coins: ProductCoinsDetail;\n instance: ProductInstanceDetail;\n claim?: ProductClaimDetail;\n}\n\nexport interface ProductDmStorage {\n product: ProductDetail;\n organisation: OrganisationDetail;\n unit: UnitDetail;\n storage: ProductDmStorageDetail;\n coins: ProductCoinsDetail;\n}\n\nexport interface UnitProductPostResponse {\n /** The products's unique ID */\n id: string;\n}\n\n/**\n * The Unit's Product\n */\nexport type ProductUnitGetResponseProduct =\n | ProductDmStorage\n | ProductDmProjectTier;\n\nexport interface ProductUnitGetResponse {\n /** The Unit's Product */\n product: ProductUnitGetResponseProduct;\n}\n\nexport type ProductsGetResponseProductsItem =\n | ProductDmStorage\n | ProductDmProjectTier;\n\nexport interface ProductsGetResponse {\n /** All the Products you have access to */\n products: ProductsGetResponseProductsItem[];\n}\n\nexport interface OrganisationsGetResponse {\n /** A list of Organisaions */\n organisations: OrganisationDetail[];\n}\n\nexport interface OrganisationUnitsGetResponse {\n organisation: OrganisationDetail;\n /** A list of Units\n */\n units: UnitDetail[];\n}\n\nexport interface OrganisationUnitPostResponse {\n /** The unit's unique ID */\n id: string;\n}\n\nexport interface UsersGetResponse {\n organisation?: OrganisationDetail;\n unit?: UnitDetail;\n /** The list of Organisation Users\n */\n users: UserDetail[];\n}\n\nexport interface OrganisationPostResponse {\n /** The organisation's unique ID */\n id: string;\n}\n\nexport interface Error {\n /** Brief error text that can be presented to the user */\n error: string;\n}\n"],
5
+ "mappings": "6DAmCO,GAAM,GAAiC,CAC5C,WAAY,aACZ,OAAQ,SACR,OAAQ,SACR,KAAM,QAWK,EAA8B,CACzC,uCACE,yCACF,kCACE,qCAuDS,EAAuB,CAClC,WAAY,aACZ,OAAQ,SACR,OAAQ,SACR,KAAM,QAQK,EAAoB,CAC/B,uCACE,yCACF,kCACE",
6
6
  "names": []
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkOULWOQLWcjs = require('../chunk-OULWOQLW.cjs');var _reactquery = require('react-query');var p=n=>_chunkOULWOQLWcjs.e.call(void 0, {url:"/organisation",method:"get"},n),g= exports.getGetOrganisationsQueryKey =()=>["/organisation"],x= exports.useGetOrganisations =n=>{var i;let{query:t,request:e}=n||{},o=(i=t==null?void 0:t.queryKey)!=null?i:g(),r=_reactquery.useQuery.call(void 0, o,()=>p(e),t);return _chunkOULWOQLWcjs.a.call(void 0, {queryKey:o},r)},d= exports.createOrganisation =(n,t)=>_chunkOULWOQLWcjs.e.call(void 0, {url:"/organisation",method:"post",data:n},t),B= exports.useCreateOrganisation =n=>{let{mutation:t,request:e}=n||{};return _reactquery.useMutation.call(void 0, a=>{let{data:r}=a||{};return d(r,e)},t)};exports.createOrganisation = d; exports.getGetOrganisationsQueryKey = g; exports.getOrganisations = p; exports.useCreateOrganisation = B; exports.useGetOrganisations = x;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk3KO3PKBXcjs = require('../chunk-3KO3PKBX.cjs');var _reactquery = require('react-query');var p=e=>_chunk3KO3PKBXcjs.e.call(void 0, {url:"/organisation",method:"get"},e),g= exports.getGetOrganisationsQueryKey =()=>["/organisation"],Q= exports.useGetOrganisations =e=>{var i;let{query:t,request:n}=e||{},r=(i=t==null?void 0:t.queryKey)!=null?i:g(),o=_reactquery.useQuery.call(void 0, r,()=>p(n),t);return _chunk3KO3PKBXcjs.a.call(void 0, {queryKey:r},o)},T= exports.createOrganisation =(e,t)=>_chunk3KO3PKBXcjs.e.call(void 0, {url:"/organisation",method:"post",data:e},t),A= exports.useCreateOrganisation =e=>{let{mutation:t,request:n}=e||{};return _reactquery.useMutation.call(void 0, a=>{let{data:o}=a||{};return T(o,n)},t)};exports.createOrganisation = T; exports.getGetOrganisationsQueryKey = g; exports.getOrganisations = p; exports.useCreateOrganisation = A; exports.useGetOrganisations = Q;
2
2
  //# sourceMappingURL=organisation.cjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/organisation/organisation.ts"],
4
- "sourcesContent": ["/**\n * Generated by orval v6.3.0 \uD83C\uDF7A\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 **Products**, **Organisations**, **Units** and **Users**.\n\n * OpenAPI spec version: 0.1\n */\nimport {\n useQuery,\n useMutation,\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n} from \"react-query\";\nimport type {\n OrganisationsGetResponse,\n Error,\n OrganisationPostResponse,\n OrganisationPostBodyBody,\n} from \"../account-server-api.schemas\";\nimport { customInstance } from \".././custom-instance\";\n\ntype AsyncReturnType<T extends (...args: any) => Promise<any>> = T extends (\n ...args: any\n) => Promise<infer R>\n ? R\n : any;\n\ntype SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P\n) => any\n ? P\n : never;\n\n/**\n * Gets Organisation you have access to\n\n * @summary Gets Organisations\n */\nexport const getOrganisations = (\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<OrganisationsGetResponse>(\n { url: `/organisation`, method: \"get\" },\n options\n );\n};\n\nexport const getGetOrganisationsQueryKey = () => [`/organisation`];\n\nexport const useGetOrganisations = <\n TData = AsyncReturnType<typeof getOrganisations>,\n TError = void | Error\n>(options?: {\n query?: UseQueryOptions<\n AsyncReturnType<typeof getOrganisations>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey = queryOptions?.queryKey ?? getGetOrganisationsQueryKey();\n\n const queryFn: QueryFunction<AsyncReturnType<typeof getOrganisations>> = () =>\n getOrganisations(requestOptions);\n\n const query = useQuery<\n AsyncReturnType<typeof getOrganisations>,\n TError,\n TData\n >(queryKey, queryFn, queryOptions);\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Creates a new organisation\n\n * @summary Create a new organisation\n */\nexport const createOrganisation = (\n organisationPostBodyBody: OrganisationPostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<OrganisationPostResponse>(\n { url: `/organisation`, method: \"post\", data: organisationPostBodyBody },\n options\n );\n};\n\nexport const useCreateOrganisation = <\n TError = Error | void,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof createOrganisation>,\n TError,\n { data: OrganisationPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof createOrganisation>,\n { data: OrganisationPostBodyBody }\n > = (props) => {\n const { data } = props || {};\n\n return createOrganisation(data, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof createOrganisation>,\n TError,\n { data: OrganisationPostBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n"],
5
- "mappings": "iDAUA,wDAkCO,GAAM,GAAmB,AAC9B,GAEO,EACL,CAAE,IAAK,gBAAiB,OAAQ,OAChC,GAIS,EAA8B,IAAM,CAAC,iBAErC,EAAsB,AAGjC,GAOI,CAjEN,MAkEE,GAAM,CAAE,MAAO,EAAc,QAAS,GAAmB,GAAW,GAE9D,EAAW,oBAAc,WAAd,OAA0B,IAKrC,EAAQ,EAIZ,EAPuE,IACvE,EAAiB,GAME,GAErB,MAAO,IACL,YACG,IASM,EAAqB,CAChC,EACA,IAEO,EACL,CAAE,IAAK,gBAAiB,OAAQ,OAAQ,KAAM,GAC9C,GAIS,EAAwB,AAGnC,GAQI,CACJ,GAAM,CAAE,SAAU,EAAiB,QAAS,GAAmB,GAAW,GAW1E,MAAO,GANH,AAAC,GAAU,CACb,GAAM,CAAE,QAAS,GAAS,GAE1B,MAAO,GAAmB,EAAM,IAQpB",
4
+ "sourcesContent": ["/**\n * Generated by orval v6.4.0 \uD83C\uDF7A\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 **Products**, **Organisations**, **Units** and **Users**.\n\n * OpenAPI spec version: 0.1\n */\nimport {\n useQuery,\n useMutation,\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"react-query\";\nimport type {\n OrganisationsGetResponse,\n Error,\n OrganisationPostResponse,\n OrganisationPostBodyBody,\n} from \"../account-server-api.schemas\";\nimport { customInstance, ErrorType } from \".././custom-instance\";\n\ntype AsyncReturnType<T extends (...args: any) => Promise<any>> = T extends (\n ...args: any\n) => Promise<infer R>\n ? R\n : any;\n\ntype SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P\n) => any\n ? P\n : never;\n\n/**\n * Gets all the Organisations\n\nYou need **admin** rights to use this method\n\n * @summary Gets Organisations\n */\nexport const getOrganisations = (\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<OrganisationsGetResponse>(\n { url: `/organisation`, method: \"get\" },\n options\n );\n};\n\nexport const getGetOrganisationsQueryKey = () => [`/organisation`];\n\nexport const useGetOrganisations = <\n TData = AsyncReturnType<typeof getOrganisations>,\n TError = ErrorType<void | Error>\n>(options?: {\n query?: UseQueryOptions<\n AsyncReturnType<typeof getOrganisations>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey = queryOptions?.queryKey ?? getGetOrganisationsQueryKey();\n\n const queryFn: QueryFunction<AsyncReturnType<typeof getOrganisations>> = () =>\n getOrganisations(requestOptions);\n\n const query = useQuery<\n AsyncReturnType<typeof getOrganisations>,\n TError,\n TData\n >(queryKey, queryFn, queryOptions);\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Creates a new Organisation\n\nYou need **admin** rights to use this method\n\n * @summary Create a new organisation\n */\nexport const createOrganisation = (\n organisationPostBodyBody: OrganisationPostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<OrganisationPostResponse>(\n { url: `/organisation`, method: \"post\", data: organisationPostBodyBody },\n options\n );\n};\n\nexport const useCreateOrganisation = <\n TError = ErrorType<Error | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof createOrganisation>,\n TError,\n { data: OrganisationPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof createOrganisation>,\n { data: OrganisationPostBodyBody }\n > = (props) => {\n const { data } = props || {};\n\n return createOrganisation(data, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof createOrganisation>,\n TError,\n { data: OrganisationPostBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n"],
5
+ "mappings": "iDAUA,wDAsCO,GAAM,GAAmB,AAC9B,GAEO,EACL,CAAE,IAAK,gBAAiB,OAAQ,OAChC,GAIS,EAA8B,IAAM,CAAC,iBAErC,EAAsB,AAGjC,GAO4D,CArE9D,MAsEE,GAAM,CAAE,MAAO,EAAc,QAAS,GAAmB,GAAW,GAE9D,EAAW,oBAAc,WAAd,OAA0B,IAKrC,EAAQ,EAIZ,EAPuE,IACvE,EAAiB,GAME,GAErB,MAAO,IACL,YACG,IAWM,EAAqB,CAChC,EACA,IAEO,EACL,CAAE,IAAK,gBAAiB,OAAQ,OAAQ,KAAM,GAC9C,GAIS,EAAwB,AAGnC,GAQI,CACJ,GAAM,CAAE,SAAU,EAAiB,QAAS,GAAmB,GAAW,GAW1E,MAAO,GANH,AAAC,GAAU,CACb,GAAM,CAAE,QAAS,GAAS,GAE1B,MAAO,GAAmB,EAAM,IAQpB",
6
6
  "names": []
7
7
  }