@squonk/account-server-client 0.1.0-r.11 → 0.1.0-rc-29
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.
- package/README.md +33 -1
- package/{custom-instance-96223186.d.ts → custom-instance-488eca53.d.ts} +11 -3
- package/index.cjs.map +1 -1
- package/index.d.ts +1 -1
- package/index.js.map +1 -1
- package/organisation/organisation.cjs +1 -1
- package/organisation/organisation.cjs.map +2 -2
- package/organisation/organisation.d.ts +1 -1
- package/organisation/organisation.js +1 -1
- package/organisation/organisation.js.map +2 -2
- package/package.json +1 -1
- package/product/product.cjs.map +1 -1
- package/product/product.d.ts +1 -1
- package/product/product.js.map +1 -1
- package/unit/package.json +6 -0
- package/unit/unit.cjs +1 -1
- package/unit/unit.cjs.map +2 -2
- package/unit/unit.d.ts +1 -1
- package/unit/unit.js +1 -1
- package/unit/unit.js.map +2 -2
- package/user/package.json +6 -0
- package/user/user.d.ts +1 -1
package/README.md
CHANGED
|
@@ -1,5 +1,37 @@
|
|
|
1
1
|
# Account Server API JS Client
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://badge.fury.io/js/%40squonk%2Faccount-server-client)
|
|
4
|
+
|
|
5
|
+
This repo is a NodeJS package that generates a typescript client from an open api specification.
|
|
6
|
+
|
|
7
|
+
- Consumes the Squonk Account Server API
|
|
8
|
+
- Generated from the latest OpenAPI tag with [Orval](https://orval.dev)
|
|
9
|
+
- Typescript
|
|
10
|
+
- Calls made by Axios (this might change)
|
|
11
|
+
- Functions to call each API path
|
|
12
|
+
- React-Query hooks for use in React applications
|
|
13
|
+
|
|
14
|
+
Client generated automatically from the OpenAPI with a custom GitHub Action
|
|
4
15
|
|
|
5
16
|
[Client Generator](https://github.com/InformaticsMatters/openapi-js-client-generator)
|
|
17
|
+
|
|
18
|
+
## Output
|
|
19
|
+
|
|
20
|
+
Provides typescript async functions and react hooks. The contents published packages depend on the version of the `openapi.yaml` used to generate it. In general though, the package is organised as follows:
|
|
21
|
+
|
|
22
|
+
All types can be imported from the main entry point:
|
|
23
|
+
```ts
|
|
24
|
+
import type { OrganisationDetail, UnitDetail, ... } from '@squonk/account-server-client';
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
The custom instance (what is used to make all Axios calls) can also be imported from here:
|
|
28
|
+
|
|
29
|
+
```ts
|
|
30
|
+
import { customInstance } from '@squonk/account-server-client';
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Each `tag` from the `openapi.yaml` is used to create a sub-entry point. For example, the functions to make requests and the `react-query` hooks for a `unit` tag can be imported as follows:
|
|
34
|
+
|
|
35
|
+
```ts
|
|
36
|
+
import { useGetOrganisationUnits, getGetOrganisationUnitsQueryKey, ... } from '@squonk/account-server-client/dataset';
|
|
37
|
+
```
|
|
@@ -99,10 +99,16 @@ interface ProductDmProjectTier {
|
|
|
99
99
|
project_claim_id?: string;
|
|
100
100
|
}
|
|
101
101
|
declare type ProductDmStorageDetailSize = {
|
|
102
|
+
/** The humanised size of the peak storage used for the current day. The value is reset at the start of each day */
|
|
102
103
|
used: string;
|
|
104
|
+
/** The humanised size of the current storage used for the current day and used to calculate the 'burn rate' */
|
|
105
|
+
current: string;
|
|
103
106
|
};
|
|
104
107
|
declare type ProductDmStorageDetailCoins = {
|
|
108
|
+
/** The number of coins currently committed for the current day. This is added to the acumulated coins at the start of each day */
|
|
105
109
|
used: number;
|
|
110
|
+
/** The coin cost of 1MiB of strage or part thereof */
|
|
111
|
+
cost: number;
|
|
106
112
|
};
|
|
107
113
|
interface ProductDmStorageDetail {
|
|
108
114
|
size: ProductDmStorageDetailSize;
|
|
@@ -111,12 +117,14 @@ interface ProductDmStorageDetail {
|
|
|
111
117
|
interface ProductCoinsDetail {
|
|
112
118
|
/** The billing allowance. When you exceed this during the current billign period the *cost multipler* will increase */
|
|
113
119
|
allowance: number;
|
|
114
|
-
/** The total number of coins consumed (in this billing period) */
|
|
120
|
+
/** The total number of coins consumed (in this billing period), exclding the coins that have been consumed for the current day */
|
|
115
121
|
used: number;
|
|
116
|
-
/** The current burn rate, the amount of coins you
|
|
122
|
+
/** The current burn rate, the approximate amount of coins you are currently consuming each day */
|
|
117
123
|
current_burn_rate: number;
|
|
118
|
-
/** The predicted billing period amount, if
|
|
124
|
+
/** The predicted billing period amount, if costs continue at the current burn rate until the end of the billing period */
|
|
119
125
|
billing_prediction: number;
|
|
126
|
+
/** The day of the month when the bill is due, and the end of the current billign period */
|
|
127
|
+
billing_day: number;
|
|
120
128
|
/** 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 */
|
|
121
129
|
cost_multiplier: number;
|
|
122
130
|
/** A multipler that will be applied to your coin usage if you exceed your allowance */
|
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.2.4 \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 type ProductDmStorageType = \"DATA_MANAGER_STORAGE_SUBSCRIPTION\";\n\nexport const ProductDmStorageType = {\n DATA_MANAGER_STORAGE_SUBSCRIPTION:\n \"DATA_MANAGER_STORAGE_SUBSCRIPTION\" as ProductDmStorageType,\n};\n\nexport interface ProductDmStorage {\n /** The Product ID\n */\n id: string;\n type: ProductDmStorageType;\n organisation: OrganisationDetail;\n unit: UnitDetail;\n name?: string;\n storage: ProductDmStorageDetail;\n coins: ProductCoinsDetail;\n}\n\nexport type ProductDmProjectTierType = \"DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION\";\n\nexport const ProductDmProjectTierType = {\n DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION:\n \"DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION\" as ProductDmProjectTierType,\n};\n\nexport type ProductDmProjectTierFlavour =\n | \"EVALUATION\"\n | \"BRONZE\"\n | \"SILVER\"\n | \"GOLD\";\n\nexport const ProductDmProjectTierFlavour = {\n EVALUATION: \"EVALUATION\" as ProductDmProjectTierFlavour,\n BRONZE: \"BRONZE\" as ProductDmProjectTierFlavour,\n SILVER: \"SILVER\" as ProductDmProjectTierFlavour,\n GOLD: \"GOLD\" as ProductDmProjectTierFlavour,\n};\n\nexport interface ProductDmProjectTier {\n /** The Product ID\n */\n id: string;\n type: ProductDmProjectTierType;\n flavour: ProductDmProjectTierFlavour;\n organisation: OrganisationDetail;\n unit: UnitDetail;\n name?: string;\n storage: ProductDmStorageDetail;\n coins: ProductCoinsDetail;\n instance: ProductInstanceDetail;\n /** The Project ID using this Subscription. If no Project is using the subscrition the field will not be present in the response\n */\n project_claim_id?: string;\n}\n\nexport type ProductDmStorageDetailSize = {\n used: string;\n};\n\nexport type ProductDmStorageDetailCoins = {\n used: number;\n};\n\nexport interface ProductDmStorageDetail {\n size: ProductDmStorageDetailSize;\n coins: ProductDmStorageDetailCoins;\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 total number of coins consumed (in this billing period) */\n used: number;\n /** The current burn rate, the amount of coins you
|
|
4
|
+
"sourcesContent": ["/**\n * Generated by orval v6.2.4 \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 type ProductDmStorageType = \"DATA_MANAGER_STORAGE_SUBSCRIPTION\";\n\nexport const ProductDmStorageType = {\n DATA_MANAGER_STORAGE_SUBSCRIPTION:\n \"DATA_MANAGER_STORAGE_SUBSCRIPTION\" as ProductDmStorageType,\n};\n\nexport interface ProductDmStorage {\n /** The Product ID\n */\n id: string;\n type: ProductDmStorageType;\n organisation: OrganisationDetail;\n unit: UnitDetail;\n name?: string;\n storage: ProductDmStorageDetail;\n coins: ProductCoinsDetail;\n}\n\nexport type ProductDmProjectTierType = \"DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION\";\n\nexport const ProductDmProjectTierType = {\n DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION:\n \"DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION\" as ProductDmProjectTierType,\n};\n\nexport type ProductDmProjectTierFlavour =\n | \"EVALUATION\"\n | \"BRONZE\"\n | \"SILVER\"\n | \"GOLD\";\n\nexport const ProductDmProjectTierFlavour = {\n EVALUATION: \"EVALUATION\" as ProductDmProjectTierFlavour,\n BRONZE: \"BRONZE\" as ProductDmProjectTierFlavour,\n SILVER: \"SILVER\" as ProductDmProjectTierFlavour,\n GOLD: \"GOLD\" as ProductDmProjectTierFlavour,\n};\n\nexport interface ProductDmProjectTier {\n /** The Product ID\n */\n id: string;\n type: ProductDmProjectTierType;\n flavour: ProductDmProjectTierFlavour;\n organisation: OrganisationDetail;\n unit: UnitDetail;\n name?: string;\n storage: ProductDmStorageDetail;\n coins: ProductCoinsDetail;\n instance: ProductInstanceDetail;\n /** The Project ID using this Subscription. If no Project is using the subscrition the field will not be present in the response\n */\n project_claim_id?: string;\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 used: 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};\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 1MiB of strage or part thereof */\n cost: number;\n};\n\nexport interface ProductDmStorageDetail {\n size: ProductDmStorageDetailSize;\n coins: ProductDmStorageDetailCoins;\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 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 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
5
|
"mappings": "8DAuEO,GAAM,GAAuB,CAClC,kCACE,qCAiBS,EAA2B,CACtC,uCACE,0CASS,EAA8B,CACzC,WAAY,aACZ,OAAQ,SACR,OAAQ,SACR,KAAM",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { A as AXIOS_INSTANCE, E as Error, r as OrganisationDetail, u as OrganisationPostBodyBody, O as OrganisationPostResponse, v as OrganisationUnitPostBodyBody, a as OrganisationUnitPostResponse, b as OrganisationUnitsGetResponse, c as OrganisationsGetResponse, o as ProductCoinsDetail, k as ProductDmProjectTier, j as ProductDmProjectTierFlavour, i as ProductDmProjectTierType, h as ProductDmStorage, n as ProductDmStorageDetail, m as ProductDmStorageDetailCoins, l as ProductDmStorageDetailSize, g as ProductDmStorageType, d as ProductGetResponse, P as ProductGetResponseProductsItem, q as ProductInstanceDetail, p as ProductInstanceDetailCoins, f as ProductUnitGetResponse, e as ProductUnitGetResponseProductsItem, Q as QDummyParameter, s as UnitDetail, t as UserDetail, U as UsersGetResponse, y as customInstance, w as setAuthToken, x as setBaseUrl } from './custom-instance-
|
|
1
|
+
export { A as AXIOS_INSTANCE, E as Error, r as OrganisationDetail, u as OrganisationPostBodyBody, O as OrganisationPostResponse, v as OrganisationUnitPostBodyBody, a as OrganisationUnitPostResponse, b as OrganisationUnitsGetResponse, c as OrganisationsGetResponse, o as ProductCoinsDetail, k as ProductDmProjectTier, j as ProductDmProjectTierFlavour, i as ProductDmProjectTierType, h as ProductDmStorage, n as ProductDmStorageDetail, m as ProductDmStorageDetailCoins, l as ProductDmStorageDetailSize, g as ProductDmStorageType, d as ProductGetResponse, P as ProductGetResponseProductsItem, q as ProductInstanceDetail, p as ProductInstanceDetailCoins, f as ProductUnitGetResponse, e as ProductUnitGetResponseProductsItem, Q as QDummyParameter, s as UnitDetail, t as UserDetail, U as UsersGetResponse, y as customInstance, w as setAuthToken, x as setBaseUrl } from './custom-instance-488eca53';
|
|
2
2
|
import 'axios';
|
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.2.4 \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 type ProductDmStorageType = \"DATA_MANAGER_STORAGE_SUBSCRIPTION\";\n\nexport const ProductDmStorageType = {\n DATA_MANAGER_STORAGE_SUBSCRIPTION:\n \"DATA_MANAGER_STORAGE_SUBSCRIPTION\" as ProductDmStorageType,\n};\n\nexport interface ProductDmStorage {\n /** The Product ID\n */\n id: string;\n type: ProductDmStorageType;\n organisation: OrganisationDetail;\n unit: UnitDetail;\n name?: string;\n storage: ProductDmStorageDetail;\n coins: ProductCoinsDetail;\n}\n\nexport type ProductDmProjectTierType = \"DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION\";\n\nexport const ProductDmProjectTierType = {\n DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION:\n \"DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION\" as ProductDmProjectTierType,\n};\n\nexport type ProductDmProjectTierFlavour =\n | \"EVALUATION\"\n | \"BRONZE\"\n | \"SILVER\"\n | \"GOLD\";\n\nexport const ProductDmProjectTierFlavour = {\n EVALUATION: \"EVALUATION\" as ProductDmProjectTierFlavour,\n BRONZE: \"BRONZE\" as ProductDmProjectTierFlavour,\n SILVER: \"SILVER\" as ProductDmProjectTierFlavour,\n GOLD: \"GOLD\" as ProductDmProjectTierFlavour,\n};\n\nexport interface ProductDmProjectTier {\n /** The Product ID\n */\n id: string;\n type: ProductDmProjectTierType;\n flavour: ProductDmProjectTierFlavour;\n organisation: OrganisationDetail;\n unit: UnitDetail;\n name?: string;\n storage: ProductDmStorageDetail;\n coins: ProductCoinsDetail;\n instance: ProductInstanceDetail;\n /** The Project ID using this Subscription. If no Project is using the subscrition the field will not be present in the response\n */\n project_claim_id?: string;\n}\n\nexport type ProductDmStorageDetailSize = {\n used: string;\n};\n\nexport type ProductDmStorageDetailCoins = {\n used: number;\n};\n\nexport interface ProductDmStorageDetail {\n size: ProductDmStorageDetailSize;\n coins: ProductDmStorageDetailCoins;\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 total number of coins consumed (in this billing period) */\n used: number;\n /** The current burn rate, the amount of coins you
|
|
4
|
+
"sourcesContent": ["/**\n * Generated by orval v6.2.4 \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 type ProductDmStorageType = \"DATA_MANAGER_STORAGE_SUBSCRIPTION\";\n\nexport const ProductDmStorageType = {\n DATA_MANAGER_STORAGE_SUBSCRIPTION:\n \"DATA_MANAGER_STORAGE_SUBSCRIPTION\" as ProductDmStorageType,\n};\n\nexport interface ProductDmStorage {\n /** The Product ID\n */\n id: string;\n type: ProductDmStorageType;\n organisation: OrganisationDetail;\n unit: UnitDetail;\n name?: string;\n storage: ProductDmStorageDetail;\n coins: ProductCoinsDetail;\n}\n\nexport type ProductDmProjectTierType = \"DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION\";\n\nexport const ProductDmProjectTierType = {\n DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION:\n \"DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION\" as ProductDmProjectTierType,\n};\n\nexport type ProductDmProjectTierFlavour =\n | \"EVALUATION\"\n | \"BRONZE\"\n | \"SILVER\"\n | \"GOLD\";\n\nexport const ProductDmProjectTierFlavour = {\n EVALUATION: \"EVALUATION\" as ProductDmProjectTierFlavour,\n BRONZE: \"BRONZE\" as ProductDmProjectTierFlavour,\n SILVER: \"SILVER\" as ProductDmProjectTierFlavour,\n GOLD: \"GOLD\" as ProductDmProjectTierFlavour,\n};\n\nexport interface ProductDmProjectTier {\n /** The Product ID\n */\n id: string;\n type: ProductDmProjectTierType;\n flavour: ProductDmProjectTierFlavour;\n organisation: OrganisationDetail;\n unit: UnitDetail;\n name?: string;\n storage: ProductDmStorageDetail;\n coins: ProductCoinsDetail;\n instance: ProductInstanceDetail;\n /** The Project ID using this Subscription. If no Project is using the subscrition the field will not be present in the response\n */\n project_claim_id?: string;\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 used: 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};\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 1MiB of strage or part thereof */\n cost: number;\n};\n\nexport interface ProductDmStorageDetail {\n size: ProductDmStorageDetailSize;\n coins: ProductDmStorageDetailCoins;\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 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 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
5
|
"mappings": "6DAuEO,GAAM,GAAuB,CAClC,kCACE,qCAiBS,EAA2B,CACtC,uCACE,0CASS,EAA8B,CACzC,WAAY,aACZ,OAAQ,SACR,OAAQ,SACR,KAAM",
|
|
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)},
|
|
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;
|
|
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.2.4 \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 =
|
|
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,IAIrC,EAAQ,EAIZ,EAPuE,IACvE,EAAiB,GAME,GAErB,MAAO,IACL,YACG,IASM,EAAqB,CAChC,EACA,
|
|
4
|
+
"sourcesContent": ["/**\n * Generated by orval v6.2.4 \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 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,IAIrC,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",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_query from 'react-query';
|
|
2
2
|
import { UseQueryOptions, UseMutationOptions } from 'react-query';
|
|
3
|
-
import { y as customInstance, c as OrganisationsGetResponse, E as Error, u as OrganisationPostBodyBody, O as OrganisationPostResponse } from '../custom-instance-
|
|
3
|
+
import { y as customInstance, c as OrganisationsGetResponse, E as Error, u as OrganisationPostBodyBody, O as OrganisationPostResponse } from '../custom-instance-488eca53';
|
|
4
4
|
import 'axios';
|
|
5
5
|
|
|
6
6
|
declare type SecondParameter<T extends (...args: any) => any> = T extends (config: any, args: infer P) => any ? P : never;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as y,e as
|
|
1
|
+
import{a as y,e as s}from"../chunk-WMX3LCLR.js";import{useQuery as u,useMutation as c}from"react-query";var p=n=>s({url:"/organisation",method:"get"},n),g=()=>["/organisation"],q=n=>{var i;let{query:t,request:e}=n||{},o=(i=t==null?void 0:t.queryKey)!=null?i:g(),r=u(o,()=>p(e),t);return y({queryKey:o},r)},d=(n,t)=>s({url:"/organisation",method:"post",data:n},t),x=n=>{let{mutation:t,request:e}=n||{};return c(a=>{let{data:r}=a||{};return d(r,e)},t)};export{d as createOrganisation,g as getGetOrganisationsQueryKey,p as getOrganisations,x as useCreateOrganisation,q as useGetOrganisations};
|
|
2
2
|
//# sourceMappingURL=organisation.js.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.2.4 \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 =
|
|
5
|
-
"mappings": "gDAUA,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,IAIrC,EAAQ,EAIZ,EAPuE,IACvE,EAAiB,GAME,GAErB,MAAO,IACL,YACG,IASM,EAAqB,CAChC,EACA,
|
|
4
|
+
"sourcesContent": ["/**\n * Generated by orval v6.2.4 \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 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": "gDAUA,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,IAIrC,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",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
package/product/product.cjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/product/product.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Generated by orval v6.2.4 \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 { useQuery, UseQueryOptions, QueryFunction } from \"react-query\";\nimport type {\n ProductGetResponse,\n Error,\n ProductUnitGetResponse,\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 products you have access to\n\n * @summary Gets products\n */\nexport const getProducts = (\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<ProductGetResponse>(\n { url: `/product`, method: \"get\" },\n options\n );\n};\n\nexport const getGetProductsQueryKey = () => [`/product`];\n\nexport const useGetProducts = <\n TData = AsyncReturnType<typeof getProducts>,\n TError = Error | void\n>(options?: {\n query?: UseQueryOptions<AsyncReturnType<typeof getProducts>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey = queryOptions?.queryKey ?? getGetProductsQueryKey();\n const queryFn: QueryFunction<AsyncReturnType<typeof getProducts>> = () =>\n getProducts(requestOptions);\n\n const query = useQuery<AsyncReturnType<typeof getProducts>, TError, TData>(\n queryKey,\n queryFn,\n queryOptions\n );\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Gets products you have access to based on an Organisational Unit\n\n * @summary Gets Products for an Organisational Unit\n */\nexport const getProductsForUnit = (\n orgid: string,\n unitid: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<ProductUnitGetResponse>(\n { url: `/product/organisation/${orgid}/unit/${unitid}`, method: \"get\" },\n options\n );\n};\n\nexport const getGetProductsForUnitQueryKey = (\n orgid: string,\n unitid: string\n) => [`/product/organisation/${orgid}/unit/${unitid}`];\n\nexport const useGetProductsForUnit = <\n TData = AsyncReturnType<typeof getProductsForUnit>,\n TError =
|
|
4
|
+
"sourcesContent": ["/**\n * Generated by orval v6.2.4 \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 { useQuery, UseQueryOptions, QueryFunction } from \"react-query\";\nimport type {\n ProductGetResponse,\n Error,\n ProductUnitGetResponse,\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 products you have access to\n\n * @summary Gets products\n */\nexport const getProducts = (\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<ProductGetResponse>(\n { url: `/product`, method: \"get\" },\n options\n );\n};\n\nexport const getGetProductsQueryKey = () => [`/product`];\n\nexport const useGetProducts = <\n TData = AsyncReturnType<typeof getProducts>,\n TError = Error | void\n>(options?: {\n query?: UseQueryOptions<AsyncReturnType<typeof getProducts>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey = queryOptions?.queryKey ?? getGetProductsQueryKey();\n const queryFn: QueryFunction<AsyncReturnType<typeof getProducts>> = () =>\n getProducts(requestOptions);\n\n const query = useQuery<AsyncReturnType<typeof getProducts>, TError, TData>(\n queryKey,\n queryFn,\n queryOptions\n );\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Gets products you have access to based on an Organisational Unit\n\n * @summary Gets Products for an Organisational Unit\n */\nexport const getProductsForUnit = (\n orgid: string,\n unitid: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<ProductUnitGetResponse>(\n { url: `/product/organisation/${orgid}/unit/${unitid}`, method: \"get\" },\n options\n );\n};\n\nexport const getGetProductsForUnitQueryKey = (\n orgid: string,\n unitid: string\n) => [`/product/organisation/${orgid}/unit/${unitid}`];\n\nexport const useGetProductsForUnit = <\n TData = AsyncReturnType<typeof getProductsForUnit>,\n TError = void | Error\n>(\n orgid: string,\n unitid: string,\n options?: {\n query?: UseQueryOptions<\n AsyncReturnType<typeof getProductsForUnit>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n) => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetProductsForUnitQueryKey(orgid, unitid);\n const queryFn: QueryFunction<AsyncReturnType<typeof getProductsForUnit>> =\n () => getProductsForUnit(orgid, unitid, requestOptions);\n\n const query = useQuery<\n AsyncReturnType<typeof getProductsForUnit>,\n TError,\n TData\n >(queryKey, queryFn, { enabled: !!(orgid && unitid), ...queryOptions });\n\n return {\n queryKey,\n ...query,\n };\n};\n"],
|
|
5
5
|
"mappings": "iDAUA,uCA0BO,GAAM,GAAc,AACzB,GAEO,EACL,CAAE,IAAK,WAAY,OAAQ,OAC3B,GAIS,EAAyB,IAAM,CAAC,YAEhC,EAAiB,AAG5B,GAGI,CArDN,MAsDE,GAAM,CAAE,MAAO,EAAc,QAAS,GAAmB,GAAW,GAE9D,EAAW,oBAAc,WAAd,OAA0B,IAIrC,EAAQ,EACZ,EAJkE,IAClE,EAAY,GAKZ,GAGF,MAAO,IACL,YACG,IASM,EAAqB,CAChC,EACA,EACA,IAEO,EACL,CAAE,IAAK,yBAAyB,UAAc,IAAU,OAAQ,OAChE,GAIS,EAAgC,CAC3C,EACA,IACG,CAAC,yBAAyB,UAAc,KAEhC,EAAwB,CAInC,EACA,EACA,IAQG,CA3GL,MA4GE,GAAM,CAAE,MAAO,EAAc,QAAS,GAAmB,GAAW,GAE9D,EACJ,oBAAc,WAAd,OAA0B,EAA8B,EAAO,GAI3D,EAAQ,EAIZ,EANA,IAAM,EAAmB,EAAO,EAAQ,GAMrB,GAAE,QAAS,CAAC,CAAE,IAAS,IAAY,IAExD,MAAO,IACL,YACG",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/product/product.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_query from 'react-query';
|
|
2
2
|
import { UseQueryOptions } from 'react-query';
|
|
3
|
-
import { y as customInstance, d as ProductGetResponse, E as Error, f as ProductUnitGetResponse } from '../custom-instance-
|
|
3
|
+
import { y as customInstance, d as ProductGetResponse, E as Error, f as ProductUnitGetResponse } from '../custom-instance-488eca53';
|
|
4
4
|
import 'axios';
|
|
5
5
|
|
|
6
6
|
declare type SecondParameter<T extends (...args: any) => any> = T extends (config: any, args: infer P) => any ? P : never;
|
package/product/product.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/product/product.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Generated by orval v6.2.4 \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 { useQuery, UseQueryOptions, QueryFunction } from \"react-query\";\nimport type {\n ProductGetResponse,\n Error,\n ProductUnitGetResponse,\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 products you have access to\n\n * @summary Gets products\n */\nexport const getProducts = (\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<ProductGetResponse>(\n { url: `/product`, method: \"get\" },\n options\n );\n};\n\nexport const getGetProductsQueryKey = () => [`/product`];\n\nexport const useGetProducts = <\n TData = AsyncReturnType<typeof getProducts>,\n TError = Error | void\n>(options?: {\n query?: UseQueryOptions<AsyncReturnType<typeof getProducts>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey = queryOptions?.queryKey ?? getGetProductsQueryKey();\n const queryFn: QueryFunction<AsyncReturnType<typeof getProducts>> = () =>\n getProducts(requestOptions);\n\n const query = useQuery<AsyncReturnType<typeof getProducts>, TError, TData>(\n queryKey,\n queryFn,\n queryOptions\n );\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Gets products you have access to based on an Organisational Unit\n\n * @summary Gets Products for an Organisational Unit\n */\nexport const getProductsForUnit = (\n orgid: string,\n unitid: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<ProductUnitGetResponse>(\n { url: `/product/organisation/${orgid}/unit/${unitid}`, method: \"get\" },\n options\n );\n};\n\nexport const getGetProductsForUnitQueryKey = (\n orgid: string,\n unitid: string\n) => [`/product/organisation/${orgid}/unit/${unitid}`];\n\nexport const useGetProductsForUnit = <\n TData = AsyncReturnType<typeof getProductsForUnit>,\n TError =
|
|
4
|
+
"sourcesContent": ["/**\n * Generated by orval v6.2.4 \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 { useQuery, UseQueryOptions, QueryFunction } from \"react-query\";\nimport type {\n ProductGetResponse,\n Error,\n ProductUnitGetResponse,\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 products you have access to\n\n * @summary Gets products\n */\nexport const getProducts = (\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<ProductGetResponse>(\n { url: `/product`, method: \"get\" },\n options\n );\n};\n\nexport const getGetProductsQueryKey = () => [`/product`];\n\nexport const useGetProducts = <\n TData = AsyncReturnType<typeof getProducts>,\n TError = Error | void\n>(options?: {\n query?: UseQueryOptions<AsyncReturnType<typeof getProducts>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey = queryOptions?.queryKey ?? getGetProductsQueryKey();\n const queryFn: QueryFunction<AsyncReturnType<typeof getProducts>> = () =>\n getProducts(requestOptions);\n\n const query = useQuery<AsyncReturnType<typeof getProducts>, TError, TData>(\n queryKey,\n queryFn,\n queryOptions\n );\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Gets products you have access to based on an Organisational Unit\n\n * @summary Gets Products for an Organisational Unit\n */\nexport const getProductsForUnit = (\n orgid: string,\n unitid: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<ProductUnitGetResponse>(\n { url: `/product/organisation/${orgid}/unit/${unitid}`, method: \"get\" },\n options\n );\n};\n\nexport const getGetProductsForUnitQueryKey = (\n orgid: string,\n unitid: string\n) => [`/product/organisation/${orgid}/unit/${unitid}`];\n\nexport const useGetProductsForUnit = <\n TData = AsyncReturnType<typeof getProductsForUnit>,\n TError = void | Error\n>(\n orgid: string,\n unitid: string,\n options?: {\n query?: UseQueryOptions<\n AsyncReturnType<typeof getProductsForUnit>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n) => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetProductsForUnitQueryKey(orgid, unitid);\n const queryFn: QueryFunction<AsyncReturnType<typeof getProductsForUnit>> =\n () => getProductsForUnit(orgid, unitid, requestOptions);\n\n const query = useQuery<\n AsyncReturnType<typeof getProductsForUnit>,\n TError,\n TData\n >(queryKey, queryFn, { enabled: !!(orgid && unitid), ...queryOptions });\n\n return {\n queryKey,\n ...query,\n };\n};\n"],
|
|
5
5
|
"mappings": "gDAUA,uCA0BO,GAAM,GAAc,AACzB,GAEO,EACL,CAAE,IAAK,WAAY,OAAQ,OAC3B,GAIS,EAAyB,IAAM,CAAC,YAEhC,EAAiB,AAG5B,GAGI,CArDN,MAsDE,GAAM,CAAE,MAAO,EAAc,QAAS,GAAmB,GAAW,GAE9D,EAAW,oBAAc,WAAd,OAA0B,IAIrC,EAAQ,EACZ,EAJkE,IAClE,EAAY,GAKZ,GAGF,MAAO,IACL,YACG,IASM,EAAqB,CAChC,EACA,EACA,IAEO,EACL,CAAE,IAAK,yBAAyB,UAAc,IAAU,OAAQ,OAChE,GAIS,EAAgC,CAC3C,EACA,IACG,CAAC,yBAAyB,UAAc,KAEhC,EAAwB,CAInC,EACA,EACA,IAQG,CA3GL,MA4GE,GAAM,CAAE,MAAO,EAAc,QAAS,GAAmB,GAAW,GAE9D,EACJ,oBAAc,WAAd,OAA0B,EAA8B,EAAO,GAI3D,EAAQ,EAIZ,EANA,IAAM,EAAmB,EAAO,EAAQ,GAMrB,GAAE,QAAS,CAAC,CAAE,IAAS,IAAY,IAExD,MAAO,IACL,YACG",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/unit/unit.cjs
CHANGED
|
@@ -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=(t,e)=>_chunkOULWOQLWcjs.e.call(void 0, {url:`/organisation/${t}/unit`,method:"get"},e),d= exports.getGetOrganisationUnitsQueryKey =t=>[`/organisation/${t}/unit`],x= exports.useGetOrganisationUnits =(t,e)=>{var u;let{query:n,request:
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkOULWOQLWcjs = require('../chunk-OULWOQLW.cjs');var _reactquery = require('react-query');var p=(t,e)=>_chunkOULWOQLWcjs.e.call(void 0, {url:`/organisation/${t}/unit`,method:"get"},e),d= exports.getGetOrganisationUnitsQueryKey =t=>[`/organisation/${t}/unit`],x= exports.useGetOrganisationUnits =(t,e)=>{var u;let{query:n,request:a}=e||{},o=(u=n==null?void 0:n.queryKey)!=null?u:d(t),r=_reactquery.useQuery.call(void 0, o,()=>p(t,a),_chunkOULWOQLWcjs.a.call(void 0, {enabled:!!t},n));return _chunkOULWOQLWcjs.a.call(void 0, {queryKey:o},r)},m= exports.createOrganisationUnit =(t,e,n)=>_chunkOULWOQLWcjs.e.call(void 0, {url:`/organisation/${t}/unit`,method:"post",data:e},n),B= exports.useCreateOrganisationUnit =t=>{let{mutation:e,request:n}=t||{};return _reactquery.useMutation.call(void 0, o=>{let{orgid:y,data:r}=o||{};return m(y,r,n)},e)};exports.createOrganisationUnit = m; exports.getGetOrganisationUnitsQueryKey = d; exports.getOrganisationUnits = p; exports.useCreateOrganisationUnit = B; exports.useGetOrganisationUnits = x;
|
|
2
2
|
//# sourceMappingURL=unit.cjs.map
|
package/unit/unit.cjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/unit/unit.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Generated by orval v6.2.4 \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 OrganisationUnitsGetResponse,\n Error,\n OrganisationUnitPostResponse,\n OrganisationUnitPostBodyBody,\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 Organisational Units you have access to\n\n * @summary Gets Organisational Units\n */\nexport const getOrganisationUnits = (\n orgid: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<OrganisationUnitsGetResponse>(\n { url: `/organisation/${orgid}/unit`, method: \"get\" },\n options\n );\n};\n\nexport const getGetOrganisationUnitsQueryKey = (orgid: string) => [\n `/organisation/${orgid}/unit`,\n];\n\nexport const useGetOrganisationUnits = <\n TData = AsyncReturnType<typeof getOrganisationUnits>,\n TError =
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["/**\n * Generated by orval v6.2.4 \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 OrganisationUnitsGetResponse,\n Error,\n OrganisationUnitPostResponse,\n OrganisationUnitPostBodyBody,\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 Organisational Units you have access to\n\n * @summary Gets Organisational Units\n */\nexport const getOrganisationUnits = (\n orgid: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<OrganisationUnitsGetResponse>(\n { url: `/organisation/${orgid}/unit`, method: \"get\" },\n options\n );\n};\n\nexport const getGetOrganisationUnitsQueryKey = (orgid: string) => [\n `/organisation/${orgid}/unit`,\n];\n\nexport const useGetOrganisationUnits = <\n TData = AsyncReturnType<typeof getOrganisationUnits>,\n TError = void | Error\n>(\n orgid: string,\n options?: {\n query?: UseQueryOptions<\n AsyncReturnType<typeof getOrganisationUnits>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n) => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetOrganisationUnitsQueryKey(orgid);\n const queryFn: QueryFunction<AsyncReturnType<typeof getOrganisationUnits>> =\n () => getOrganisationUnits(orgid, requestOptions);\n\n const query = useQuery<\n AsyncReturnType<typeof getOrganisationUnits>,\n TError,\n TData\n >(queryKey, queryFn, { enabled: !!orgid, ...queryOptions });\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Creates a new organisation unit\n\n * @summary Create a new organisation unit\n */\nexport const createOrganisationUnit = (\n orgid: string,\n organisationUnitPostBodyBody: OrganisationUnitPostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<OrganisationUnitPostResponse>(\n {\n url: `/organisation/${orgid}/unit`,\n method: \"post\",\n data: organisationUnitPostBodyBody,\n },\n options\n );\n};\n\nexport const useCreateOrganisationUnit = <\n TError = Error | void,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof createOrganisationUnit>,\n TError,\n { orgid: string; data: OrganisationUnitPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof createOrganisationUnit>,\n { orgid: string; data: OrganisationUnitPostBodyBody }\n > = (props) => {\n const { orgid, data } = props || {};\n\n return createOrganisationUnit(orgid, data, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof createOrganisationUnit>,\n TError,\n { orgid: string; data: OrganisationUnitPostBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n"],
|
|
5
|
+
"mappings": "iDAUA,wDAkCO,GAAM,GAAuB,CAClC,EACA,IAEO,EACL,CAAE,IAAK,iBAAiB,SAAc,OAAQ,OAC9C,GAIS,EAAkC,AAAC,GAAkB,CAChE,iBAAiB,UAGN,EAA0B,CAIrC,EACA,IAQG,CAvEL,MAwEE,GAAM,CAAE,MAAO,EAAc,QAAS,GAAmB,GAAW,GAE9D,EACJ,oBAAc,WAAd,OAA0B,EAAgC,GAItD,EAAQ,EAIZ,EANA,IAAM,EAAqB,EAAO,GAMf,GAAE,QAAS,CAAC,CAAC,GAAU,IAE5C,MAAO,IACL,YACG,IASM,EAAyB,CACpC,EACA,EACA,IAEO,EACL,CACE,IAAK,iBAAiB,SACtB,OAAQ,OACR,KAAM,GAER,GAIS,EAA4B,AAGvC,GAQI,CACJ,GAAM,CAAE,SAAU,EAAiB,QAAS,GAAmB,GAAW,GAW1E,MAAO,GANH,AAAC,GAAU,CACb,GAAM,CAAE,QAAO,QAAS,GAAS,GAEjC,MAAO,GAAuB,EAAO,EAAM,IAQ/B",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/unit/unit.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_query from 'react-query';
|
|
2
2
|
import { UseQueryOptions, UseMutationOptions } from 'react-query';
|
|
3
|
-
import { y as customInstance, b as OrganisationUnitsGetResponse, E as Error, v as OrganisationUnitPostBodyBody, a as OrganisationUnitPostResponse } from '../custom-instance-
|
|
3
|
+
import { y as customInstance, b as OrganisationUnitsGetResponse, E as Error, v as OrganisationUnitPostBodyBody, a as OrganisationUnitPostResponse } from '../custom-instance-488eca53';
|
|
4
4
|
import 'axios';
|
|
5
5
|
|
|
6
6
|
declare type SecondParameter<T extends (...args: any) => any> = T extends (config: any, args: infer P) => any ? P : never;
|
package/unit/unit.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a,e as i}from"../chunk-WMX3LCLR.js";import{useQuery as c,useMutation as g}from"react-query";var p=(t,e)=>i({url:`/organisation/${t}/unit`,method:"get"},e),d=t=>[`/organisation/${t}/unit`],q=(t,e)=>{var u;let{query:n,request:
|
|
1
|
+
import{a as s,e as i}from"../chunk-WMX3LCLR.js";import{useQuery as c,useMutation as g}from"react-query";var p=(t,e)=>i({url:`/organisation/${t}/unit`,method:"get"},e),d=t=>[`/organisation/${t}/unit`],q=(t,e)=>{var u;let{query:n,request:a}=e||{},o=(u=n==null?void 0:n.queryKey)!=null?u:d(t),r=c(o,()=>p(t,a),s({enabled:!!t},n));return s({queryKey:o},r)},m=(t,e,n)=>i({url:`/organisation/${t}/unit`,method:"post",data:e},n),x=t=>{let{mutation:e,request:n}=t||{};return g(o=>{let{orgid:y,data:r}=o||{};return m(y,r,n)},e)};export{m as createOrganisationUnit,d as getGetOrganisationUnitsQueryKey,p as getOrganisationUnits,x as useCreateOrganisationUnit,q as useGetOrganisationUnits};
|
|
2
2
|
//# sourceMappingURL=unit.js.map
|
package/unit/unit.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/unit/unit.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Generated by orval v6.2.4 \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 OrganisationUnitsGetResponse,\n Error,\n OrganisationUnitPostResponse,\n OrganisationUnitPostBodyBody,\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 Organisational Units you have access to\n\n * @summary Gets Organisational Units\n */\nexport const getOrganisationUnits = (\n orgid: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<OrganisationUnitsGetResponse>(\n { url: `/organisation/${orgid}/unit`, method: \"get\" },\n options\n );\n};\n\nexport const getGetOrganisationUnitsQueryKey = (orgid: string) => [\n `/organisation/${orgid}/unit`,\n];\n\nexport const useGetOrganisationUnits = <\n TData = AsyncReturnType<typeof getOrganisationUnits>,\n TError =
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["/**\n * Generated by orval v6.2.4 \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 OrganisationUnitsGetResponse,\n Error,\n OrganisationUnitPostResponse,\n OrganisationUnitPostBodyBody,\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 Organisational Units you have access to\n\n * @summary Gets Organisational Units\n */\nexport const getOrganisationUnits = (\n orgid: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<OrganisationUnitsGetResponse>(\n { url: `/organisation/${orgid}/unit`, method: \"get\" },\n options\n );\n};\n\nexport const getGetOrganisationUnitsQueryKey = (orgid: string) => [\n `/organisation/${orgid}/unit`,\n];\n\nexport const useGetOrganisationUnits = <\n TData = AsyncReturnType<typeof getOrganisationUnits>,\n TError = void | Error\n>(\n orgid: string,\n options?: {\n query?: UseQueryOptions<\n AsyncReturnType<typeof getOrganisationUnits>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n) => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetOrganisationUnitsQueryKey(orgid);\n const queryFn: QueryFunction<AsyncReturnType<typeof getOrganisationUnits>> =\n () => getOrganisationUnits(orgid, requestOptions);\n\n const query = useQuery<\n AsyncReturnType<typeof getOrganisationUnits>,\n TError,\n TData\n >(queryKey, queryFn, { enabled: !!orgid, ...queryOptions });\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Creates a new organisation unit\n\n * @summary Create a new organisation unit\n */\nexport const createOrganisationUnit = (\n orgid: string,\n organisationUnitPostBodyBody: OrganisationUnitPostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<OrganisationUnitPostResponse>(\n {\n url: `/organisation/${orgid}/unit`,\n method: \"post\",\n data: organisationUnitPostBodyBody,\n },\n options\n );\n};\n\nexport const useCreateOrganisationUnit = <\n TError = Error | void,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof createOrganisationUnit>,\n TError,\n { orgid: string; data: OrganisationUnitPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof createOrganisationUnit>,\n { orgid: string; data: OrganisationUnitPostBodyBody }\n > = (props) => {\n const { orgid, data } = props || {};\n\n return createOrganisationUnit(orgid, data, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof createOrganisationUnit>,\n TError,\n { orgid: string; data: OrganisationUnitPostBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n"],
|
|
5
|
+
"mappings": "gDAUA,wDAkCO,GAAM,GAAuB,CAClC,EACA,IAEO,EACL,CAAE,IAAK,iBAAiB,SAAc,OAAQ,OAC9C,GAIS,EAAkC,AAAC,GAAkB,CAChE,iBAAiB,UAGN,EAA0B,CAIrC,EACA,IAQG,CAvEL,MAwEE,GAAM,CAAE,MAAO,EAAc,QAAS,GAAmB,GAAW,GAE9D,EACJ,oBAAc,WAAd,OAA0B,EAAgC,GAItD,EAAQ,EAIZ,EANA,IAAM,EAAqB,EAAO,GAMf,GAAE,QAAS,CAAC,CAAC,GAAU,IAE5C,MAAO,IACL,YACG,IASM,EAAyB,CACpC,EACA,EACA,IAEO,EACL,CACE,IAAK,iBAAiB,SACtB,OAAQ,OACR,KAAM,GAER,GAIS,EAA4B,AAGvC,GAQI,CACJ,GAAM,CAAE,SAAU,EAAiB,QAAS,GAAmB,GAAW,GAW1E,MAAO,GANH,AAAC,GAAU,CACb,GAAM,CAAE,QAAO,QAAS,GAAS,GAEjC,MAAO,GAAuB,EAAO,EAAM,IAQ/B",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/user/user.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_query from 'react-query';
|
|
2
2
|
import { UseQueryOptions, UseMutationOptions } from 'react-query';
|
|
3
|
-
import { y as customInstance, U as UsersGetResponse, E as Error } from '../custom-instance-
|
|
3
|
+
import { y as customInstance, U as UsersGetResponse, E as Error } from '../custom-instance-488eca53';
|
|
4
4
|
import 'axios';
|
|
5
5
|
|
|
6
6
|
declare type SecondParameter<T extends (...args: any) => any> = T extends (config: any, args: infer P) => any ? P : never;
|