@squonk/account-server-client 0.1.6-rc.2 → 0.1.7-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.
- package/{custom-instance-d52e4104.d.ts → custom-instance-0d593da2.d.ts} +2 -2
- 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 +1 -1
- package/organisation/organisation.d.ts +3 -3
- package/organisation/organisation.js +1 -1
- package/organisation/organisation.js.map +1 -1
- package/package.json +1 -1
- package/product/product.cjs.map +1 -1
- package/product/product.d.ts +6 -6
- package/product/product.js.map +1 -1
- package/unit/unit.cjs +1 -1
- package/unit/unit.cjs.map +1 -1
- package/unit/unit.d.ts +3 -3
- package/unit/unit.js +1 -1
- package/unit/unit.js.map +1 -1
- package/user/user.cjs.map +1 -1
- package/user/user.d.ts +7 -7
- package/user/user.js.map +1 -1
|
@@ -211,7 +211,7 @@ interface OrganisationPostResponse {
|
|
|
211
211
|
/** The organisation's unique ID */
|
|
212
212
|
id: string;
|
|
213
213
|
}
|
|
214
|
-
interface
|
|
214
|
+
interface AsError {
|
|
215
215
|
/** Brief error text that can be presented to the user */
|
|
216
216
|
error: string;
|
|
217
217
|
}
|
|
@@ -231,4 +231,4 @@ declare const setBaseUrl: (baseUrl: string) => void;
|
|
|
231
231
|
declare const customInstance: <TReturn>(config: AxiosRequestConfig, options?: AxiosRequestConfig<any> | undefined) => Promise<TReturn>;
|
|
232
232
|
declare type ErrorType<TError> = AxiosError<TError>;
|
|
233
233
|
|
|
234
|
-
export { UsersGetResponse as A, OrganisationPostResponse as B,
|
|
234
|
+
export { UsersGetResponse as A, OrganisationPostResponse as B, AsError as C, AXIOS_INSTANCE as D, setAuthToken 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.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.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
|
|
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 AsError {\n /** Brief error text that can be presented to the user */\n error: string;\n}\n"],
|
|
5
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 {
|
|
1
|
+
export { D as AXIOS_INSTANCE, C as AsError, 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, E as setAuthToken, F as setBaseUrl } from './custom-instance-0d593da2';
|
|
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.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
|
|
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 AsError {\n /** Brief error text that can be presented to the user */\n error: string;\n}\n"],
|
|
5
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 _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"],
|
|
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"],B= 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),Q= 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 = Q; exports.useGetOrganisations = B;
|
|
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.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
|
|
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 AsError,\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 | AsError>\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<AsError | 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
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
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_query from 'react-query';
|
|
2
2
|
import { UseQueryOptions, QueryKey, UseQueryResult, UseMutationOptions } from 'react-query';
|
|
3
|
-
import { G as customInstance, x as OrganisationsGetResponse, H as ErrorType,
|
|
3
|
+
import { G as customInstance, x as OrganisationsGetResponse, H as ErrorType, C as AsError, c as OrganisationPostBodyBody, B as OrganisationPostResponse } from '../custom-instance-0d593da2';
|
|
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;
|
|
@@ -13,7 +13,7 @@ You need **admin** rights to use this method
|
|
|
13
13
|
*/
|
|
14
14
|
declare const getOrganisations: (options?: SecondParameter<typeof customInstance>) => Promise<OrganisationsGetResponse>;
|
|
15
15
|
declare const getGetOrganisationsQueryKey: () => string[];
|
|
16
|
-
declare const useGetOrganisations: <TData = OrganisationsGetResponse, TError = ErrorType<void |
|
|
16
|
+
declare const useGetOrganisations: <TData = OrganisationsGetResponse, TError = ErrorType<void | AsError>>(options?: {
|
|
17
17
|
query?: UseQueryOptions<OrganisationsGetResponse, TError, TData, QueryKey> | undefined;
|
|
18
18
|
request?: SecondParameter<typeof customInstance>;
|
|
19
19
|
} | undefined) => UseQueryResult<TData, TError> & {
|
|
@@ -27,7 +27,7 @@ You need **admin** rights to use this method
|
|
|
27
27
|
* @summary Create a new organisation
|
|
28
28
|
*/
|
|
29
29
|
declare const createOrganisation: (organisationPostBodyBody: OrganisationPostBodyBody, options?: SecondParameter<typeof customInstance>) => Promise<OrganisationPostResponse>;
|
|
30
|
-
declare const useCreateOrganisation: <TError = ErrorType<void |
|
|
30
|
+
declare const useCreateOrganisation: <TError = ErrorType<void | AsError>, TContext = unknown>(options?: {
|
|
31
31
|
mutation?: UseMutationOptions<OrganisationPostResponse, TError, {
|
|
32
32
|
data: OrganisationPostBodyBody;
|
|
33
33
|
}, TContext> | undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as y,e as s}from"../chunk-33VR3IML.js";import{useQuery as u,useMutation as c}from"react-query";var p=e=>s({url:"/organisation",method:"get"},e),g=()=>["/organisation"],
|
|
1
|
+
import{a as y,e as s}from"../chunk-33VR3IML.js";import{useQuery as u,useMutation as c}from"react-query";var p=e=>s({url:"/organisation",method:"get"},e),g=()=>["/organisation"],A=e=>{var i;let{query:t,request:n}=e||{},r=(i=t==null?void 0:t.queryKey)!=null?i:g(),o=u(r,()=>p(n),t);return y({queryKey:r},o)},T=(e,t)=>s({url:"/organisation",method:"post",data:e},t),B=e=>{let{mutation:t,request:n}=e||{};return c(a=>{let{data:o}=a||{};return T(o,n)},t)};export{T as createOrganisation,g as getGetOrganisationsQueryKey,p as getOrganisations,B as useCreateOrganisation,A 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.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
|
|
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 AsError,\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 | AsError>\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<AsError | 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
5
|
"mappings": "gDAUA,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
|
}
|
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.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 ProductsGetResponse,\n
|
|
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 ProductsGetResponse,\n AsError,\n UnitProductPostResponse,\n UnitProductPostBodyBody,\n ProductUnitGetResponse,\n ProductPatchBodyBody,\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 products you have access to across all Units and Organisations\n\n * @summary Gets all Products\n */\nexport const getProducts = (\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<ProductsGetResponse>(\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 = ErrorType<AsError | void>\n>(options?: {\n query?: UseQueryOptions<AsyncReturnType<typeof getProducts>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey = queryOptions?.queryKey ?? getGetProductsQueryKey();\n\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 * @summary Creates a Product for an Organisational Unit\n */\nexport const createUnitProduct = (\n unitid: string,\n unitProductPostBodyBody: UnitProductPostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<UnitProductPostResponse>(\n {\n url: `/product/unit/${unitid}`,\n method: \"post\",\n data: unitProductPostBodyBody,\n },\n options\n );\n};\n\nexport const useCreateUnitProduct = <\n TError = ErrorType<AsError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof createUnitProduct>,\n TError,\n { unitid: string; data: UnitProductPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof createUnitProduct>,\n { unitid: string; data: UnitProductPostBodyBody }\n > = (props) => {\n const { unitid, data } = props || {};\n\n return createUnitProduct(unitid, data, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof createUnitProduct>,\n TError,\n { unitid: string; data: UnitProductPostBodyBody },\n TContext\n >(mutationFn, mutationOptions);\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 unitid: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<ProductsGetResponse>(\n { url: `/product/unit/${unitid}`, method: \"get\" },\n options\n );\n};\n\nexport const getGetProductsForUnitQueryKey = (unitid: string) => [\n `/product/unit/${unitid}`,\n];\n\nexport const useGetProductsForUnit = <\n TData = AsyncReturnType<typeof getProductsForUnit>,\n TError = ErrorType<void | AsError>\n>(\n unitid: string,\n options?: {\n query?: UseQueryOptions<\n AsyncReturnType<typeof getProductsForUnit>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetProductsForUnitQueryKey(unitid);\n\n const queryFn: QueryFunction<\n AsyncReturnType<typeof getProductsForUnit>\n > = () => getProductsForUnit(unitid, requestOptions);\n\n const query = useQuery<\n AsyncReturnType<typeof getProductsForUnit>,\n TError,\n TData\n >(queryKey, queryFn, { enabled: !!unitid, ...queryOptions });\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Gets a Unit's Product\n\n * @summary Gets a Unit's Product\n */\nexport const getProduct = (\n unitid: string,\n productid: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<ProductUnitGetResponse>(\n { url: `/product/unit/${unitid}/product/${productid}`, method: \"get\" },\n options\n );\n};\n\nexport const getGetProductQueryKey = (unitid: string, productid: string) => [\n `/product/unit/${unitid}/product/${productid}`,\n];\n\nexport const useGetProduct = <\n TData = AsyncReturnType<typeof getProduct>,\n TError = ErrorType<AsError | void>\n>(\n unitid: string,\n productid: string,\n options?: {\n query?: UseQueryOptions<AsyncReturnType<typeof getProduct>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetProductQueryKey(unitid, productid);\n\n const queryFn: QueryFunction<AsyncReturnType<typeof getProduct>> = () =>\n getProduct(unitid, productid, requestOptions);\n\n const query = useQuery<AsyncReturnType<typeof getProduct>, TError, TData>(\n queryKey,\n queryFn,\n { enabled: !!(unitid && productid), ...queryOptions }\n );\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Used to update some adjustable parameters of a Product, i.e. to extend the Allowance or Limit. Curently you can only patch storage Products\n\n * @summary Adjust an existing Product\n */\nexport const patchProduct = (\n unitid: string,\n productid: string,\n productPatchBodyBody: ProductPatchBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n {\n url: `/product/unit/${unitid}/product/${productid}`,\n method: \"patch\",\n data: productPatchBodyBody,\n },\n options\n );\n};\n\nexport const usePatchProduct = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof patchProduct>,\n TError,\n { unitid: string; productid: string; data: ProductPatchBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof patchProduct>,\n { unitid: string; productid: string; data: ProductPatchBodyBody }\n > = (props) => {\n const { unitid, productid, data } = props || {};\n\n return patchProduct(unitid, productid, data, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof patchProduct>,\n TError,\n { unitid: string; productid: string; data: ProductPatchBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n"],
|
|
5
5
|
"mappings": "iDAUA,wDAsCO,GAAM,GAAc,AACzB,GAEO,EACL,CAAE,IAAK,WAAY,OAAQ,OAC3B,GAIS,EAAyB,IAAM,CAAC,YAEhC,EAAiB,AAG5B,GAG4D,CAjE9D,MAkEE,GAAM,CAAE,MAAO,EAAc,QAAS,GAAmB,GAAW,GAE9D,EAAW,oBAAc,WAAd,OAA0B,IAKrC,EAAQ,EACZ,EAJkE,IAClE,EAAY,GAKZ,GAGF,MAAO,IACL,YACG,IAOM,EAAoB,CAC/B,EACA,EACA,IAEO,EACL,CACE,IAAK,iBAAiB,IACtB,OAAQ,OACR,KAAM,GAER,GAIS,EAAuB,AAGlC,GAQI,CACJ,GAAM,CAAE,SAAU,EAAiB,QAAS,GAAmB,GAAW,GAW1E,MAAO,GANH,AAAC,GAAU,CACb,GAAM,CAAE,SAAQ,QAAS,GAAS,GAElC,MAAO,GAAkB,EAAQ,EAAM,IAQ3B,IAOH,EAAqB,CAChC,EACA,IAEO,EACL,CAAE,IAAK,iBAAiB,IAAU,OAAQ,OAC1C,GAIS,EAAgC,AAAC,GAAmB,CAC/D,iBAAiB,KAGN,EAAwB,CAInC,EACA,IAQ2D,CArK7D,MAsKE,GAAM,CAAE,MAAO,EAAc,QAAS,GAAmB,GAAW,GAE9D,EACJ,oBAAc,WAAd,OAA0B,EAA8B,GAMpD,EAAQ,EAIZ,EANE,IAAM,EAAmB,EAAQ,GAMhB,GAAE,QAAS,CAAC,CAAC,GAAW,IAE7C,MAAO,IACL,YACG,IASM,EAAa,CACxB,EACA,EACA,IAEO,EACL,CAAE,IAAK,iBAAiB,aAAkB,IAAa,OAAQ,OAC/D,GAIS,EAAwB,CAAC,EAAgB,IAAsB,CAC1E,iBAAiB,aAAkB,KAGxB,EAAgB,CAI3B,EACA,EACA,IAI2D,CAzN7D,MA0NE,GAAM,CAAE,MAAO,EAAc,QAAS,GAAmB,GAAW,GAE9D,EACJ,oBAAc,WAAd,OAA0B,EAAsB,EAAQ,GAKpD,EAAQ,EACZ,EAJiE,IACjE,EAAW,EAAQ,EAAW,GAK9B,GAAE,QAAS,CAAC,CAAE,IAAU,IAAe,IAGzC,MAAO,IACL,YACG,IASM,EAAe,CAC1B,EACA,EACA,EACA,IAEO,EACL,CACE,IAAK,iBAAiB,aAAkB,IACxC,OAAQ,QACR,KAAM,GAER,GAIS,EAAkB,AAG7B,GAQI,CACJ,GAAM,CAAE,SAAU,EAAiB,QAAS,GAAmB,GAAW,GAW1E,MAAO,GANH,AAAC,GAAU,CACb,GAAM,CAAE,SAAQ,YAAW,QAAS,GAAS,GAE7C,MAAO,GAAa,EAAQ,EAAW,EAAM,IAQjC",
|
|
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, QueryKey, UseQueryResult, UseMutationOptions } from 'react-query';
|
|
3
|
-
import { G as customInstance, w as ProductsGetResponse, H as ErrorType,
|
|
3
|
+
import { G as customInstance, w as ProductsGetResponse, H as ErrorType, C as AsError, b as UnitProductPostBodyBody, s as UnitProductPostResponse, u as ProductUnitGetResponse, P as ProductPatchBodyBody } from '../custom-instance-0d593da2';
|
|
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;
|
|
@@ -11,7 +11,7 @@ declare type SecondParameter<T extends (...args: any) => any> = T extends (confi
|
|
|
11
11
|
*/
|
|
12
12
|
declare const getProducts: (options?: SecondParameter<typeof customInstance>) => Promise<ProductsGetResponse>;
|
|
13
13
|
declare const getGetProductsQueryKey: () => string[];
|
|
14
|
-
declare const useGetProducts: <TData = ProductsGetResponse, TError = ErrorType<void |
|
|
14
|
+
declare const useGetProducts: <TData = ProductsGetResponse, TError = ErrorType<void | AsError>>(options?: {
|
|
15
15
|
query?: UseQueryOptions<ProductsGetResponse, TError, TData, QueryKey> | undefined;
|
|
16
16
|
request?: SecondParameter<typeof customInstance>;
|
|
17
17
|
} | undefined) => UseQueryResult<TData, TError> & {
|
|
@@ -21,7 +21,7 @@ declare const useGetProducts: <TData = ProductsGetResponse, TError = ErrorType<v
|
|
|
21
21
|
* @summary Creates a Product for an Organisational Unit
|
|
22
22
|
*/
|
|
23
23
|
declare const createUnitProduct: (unitid: string, unitProductPostBodyBody: UnitProductPostBodyBody, options?: SecondParameter<typeof customInstance>) => Promise<UnitProductPostResponse>;
|
|
24
|
-
declare const useCreateUnitProduct: <TError = ErrorType<void |
|
|
24
|
+
declare const useCreateUnitProduct: <TError = ErrorType<void | AsError>, TContext = unknown>(options?: {
|
|
25
25
|
mutation?: UseMutationOptions<UnitProductPostResponse, TError, {
|
|
26
26
|
unitid: string;
|
|
27
27
|
data: UnitProductPostBodyBody;
|
|
@@ -38,7 +38,7 @@ declare const useCreateUnitProduct: <TError = ErrorType<void | Error>, TContext
|
|
|
38
38
|
*/
|
|
39
39
|
declare const getProductsForUnit: (unitid: string, options?: SecondParameter<typeof customInstance>) => Promise<ProductsGetResponse>;
|
|
40
40
|
declare const getGetProductsForUnitQueryKey: (unitid: string) => string[];
|
|
41
|
-
declare const useGetProductsForUnit: <TData = ProductsGetResponse, TError = ErrorType<void |
|
|
41
|
+
declare const useGetProductsForUnit: <TData = ProductsGetResponse, TError = ErrorType<void | AsError>>(unitid: string, options?: {
|
|
42
42
|
query?: UseQueryOptions<ProductsGetResponse, TError, TData, QueryKey> | undefined;
|
|
43
43
|
request?: SecondParameter<typeof customInstance>;
|
|
44
44
|
} | undefined) => UseQueryResult<TData, TError> & {
|
|
@@ -51,7 +51,7 @@ declare const useGetProductsForUnit: <TData = ProductsGetResponse, TError = Erro
|
|
|
51
51
|
*/
|
|
52
52
|
declare const getProduct: (unitid: string, productid: string, options?: SecondParameter<typeof customInstance>) => Promise<ProductUnitGetResponse>;
|
|
53
53
|
declare const getGetProductQueryKey: (unitid: string, productid: string) => string[];
|
|
54
|
-
declare const useGetProduct: <TData = ProductUnitGetResponse, TError = ErrorType<void |
|
|
54
|
+
declare const useGetProduct: <TData = ProductUnitGetResponse, TError = ErrorType<void | AsError>>(unitid: string, productid: string, options?: {
|
|
55
55
|
query?: UseQueryOptions<ProductUnitGetResponse, TError, TData, QueryKey> | undefined;
|
|
56
56
|
request?: SecondParameter<typeof customInstance>;
|
|
57
57
|
} | undefined) => UseQueryResult<TData, TError> & {
|
|
@@ -63,7 +63,7 @@ declare const useGetProduct: <TData = ProductUnitGetResponse, TError = ErrorType
|
|
|
63
63
|
* @summary Adjust an existing Product
|
|
64
64
|
*/
|
|
65
65
|
declare const patchProduct: (unitid: string, productid: string, productPatchBodyBody: ProductPatchBodyBody, options?: SecondParameter<typeof customInstance>) => Promise<void>;
|
|
66
|
-
declare const usePatchProduct: <TError = ErrorType<
|
|
66
|
+
declare const usePatchProduct: <TError = ErrorType<AsError>, TContext = unknown>(options?: {
|
|
67
67
|
mutation?: UseMutationOptions<void, TError, {
|
|
68
68
|
unitid: string;
|
|
69
69
|
productid: string;
|
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.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 ProductsGetResponse,\n
|
|
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 ProductsGetResponse,\n AsError,\n UnitProductPostResponse,\n UnitProductPostBodyBody,\n ProductUnitGetResponse,\n ProductPatchBodyBody,\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 products you have access to across all Units and Organisations\n\n * @summary Gets all Products\n */\nexport const getProducts = (\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<ProductsGetResponse>(\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 = ErrorType<AsError | void>\n>(options?: {\n query?: UseQueryOptions<AsyncReturnType<typeof getProducts>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey = queryOptions?.queryKey ?? getGetProductsQueryKey();\n\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 * @summary Creates a Product for an Organisational Unit\n */\nexport const createUnitProduct = (\n unitid: string,\n unitProductPostBodyBody: UnitProductPostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<UnitProductPostResponse>(\n {\n url: `/product/unit/${unitid}`,\n method: \"post\",\n data: unitProductPostBodyBody,\n },\n options\n );\n};\n\nexport const useCreateUnitProduct = <\n TError = ErrorType<AsError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof createUnitProduct>,\n TError,\n { unitid: string; data: UnitProductPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof createUnitProduct>,\n { unitid: string; data: UnitProductPostBodyBody }\n > = (props) => {\n const { unitid, data } = props || {};\n\n return createUnitProduct(unitid, data, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof createUnitProduct>,\n TError,\n { unitid: string; data: UnitProductPostBodyBody },\n TContext\n >(mutationFn, mutationOptions);\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 unitid: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<ProductsGetResponse>(\n { url: `/product/unit/${unitid}`, method: \"get\" },\n options\n );\n};\n\nexport const getGetProductsForUnitQueryKey = (unitid: string) => [\n `/product/unit/${unitid}`,\n];\n\nexport const useGetProductsForUnit = <\n TData = AsyncReturnType<typeof getProductsForUnit>,\n TError = ErrorType<void | AsError>\n>(\n unitid: string,\n options?: {\n query?: UseQueryOptions<\n AsyncReturnType<typeof getProductsForUnit>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetProductsForUnitQueryKey(unitid);\n\n const queryFn: QueryFunction<\n AsyncReturnType<typeof getProductsForUnit>\n > = () => getProductsForUnit(unitid, requestOptions);\n\n const query = useQuery<\n AsyncReturnType<typeof getProductsForUnit>,\n TError,\n TData\n >(queryKey, queryFn, { enabled: !!unitid, ...queryOptions });\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Gets a Unit's Product\n\n * @summary Gets a Unit's Product\n */\nexport const getProduct = (\n unitid: string,\n productid: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<ProductUnitGetResponse>(\n { url: `/product/unit/${unitid}/product/${productid}`, method: \"get\" },\n options\n );\n};\n\nexport const getGetProductQueryKey = (unitid: string, productid: string) => [\n `/product/unit/${unitid}/product/${productid}`,\n];\n\nexport const useGetProduct = <\n TData = AsyncReturnType<typeof getProduct>,\n TError = ErrorType<AsError | void>\n>(\n unitid: string,\n productid: string,\n options?: {\n query?: UseQueryOptions<AsyncReturnType<typeof getProduct>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetProductQueryKey(unitid, productid);\n\n const queryFn: QueryFunction<AsyncReturnType<typeof getProduct>> = () =>\n getProduct(unitid, productid, requestOptions);\n\n const query = useQuery<AsyncReturnType<typeof getProduct>, TError, TData>(\n queryKey,\n queryFn,\n { enabled: !!(unitid && productid), ...queryOptions }\n );\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Used to update some adjustable parameters of a Product, i.e. to extend the Allowance or Limit. Curently you can only patch storage Products\n\n * @summary Adjust an existing Product\n */\nexport const patchProduct = (\n unitid: string,\n productid: string,\n productPatchBodyBody: ProductPatchBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n {\n url: `/product/unit/${unitid}/product/${productid}`,\n method: \"patch\",\n data: productPatchBodyBody,\n },\n options\n );\n};\n\nexport const usePatchProduct = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof patchProduct>,\n TError,\n { unitid: string; productid: string; data: ProductPatchBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof patchProduct>,\n { unitid: string; productid: string; data: ProductPatchBodyBody }\n > = (props) => {\n const { unitid, productid, data } = props || {};\n\n return patchProduct(unitid, productid, data, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof patchProduct>,\n TError,\n { unitid: string; productid: string; data: ProductPatchBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n"],
|
|
5
5
|
"mappings": "gDAUA,wDAsCO,GAAM,GAAc,AACzB,GAEO,EACL,CAAE,IAAK,WAAY,OAAQ,OAC3B,GAIS,EAAyB,IAAM,CAAC,YAEhC,EAAiB,AAG5B,GAG4D,CAjE9D,MAkEE,GAAM,CAAE,MAAO,EAAc,QAAS,GAAmB,GAAW,GAE9D,EAAW,oBAAc,WAAd,OAA0B,IAKrC,EAAQ,EACZ,EAJkE,IAClE,EAAY,GAKZ,GAGF,MAAO,IACL,YACG,IAOM,EAAoB,CAC/B,EACA,EACA,IAEO,EACL,CACE,IAAK,iBAAiB,IACtB,OAAQ,OACR,KAAM,GAER,GAIS,EAAuB,AAGlC,GAQI,CACJ,GAAM,CAAE,SAAU,EAAiB,QAAS,GAAmB,GAAW,GAW1E,MAAO,GANH,AAAC,GAAU,CACb,GAAM,CAAE,SAAQ,QAAS,GAAS,GAElC,MAAO,GAAkB,EAAQ,EAAM,IAQ3B,IAOH,EAAqB,CAChC,EACA,IAEO,EACL,CAAE,IAAK,iBAAiB,IAAU,OAAQ,OAC1C,GAIS,EAAgC,AAAC,GAAmB,CAC/D,iBAAiB,KAGN,EAAwB,CAInC,EACA,IAQ2D,CArK7D,MAsKE,GAAM,CAAE,MAAO,EAAc,QAAS,GAAmB,GAAW,GAE9D,EACJ,oBAAc,WAAd,OAA0B,EAA8B,GAMpD,EAAQ,EAIZ,EANE,IAAM,EAAmB,EAAQ,GAMhB,GAAE,QAAS,CAAC,CAAC,GAAW,IAE7C,MAAO,IACL,YACG,IASM,EAAa,CACxB,EACA,EACA,IAEO,EACL,CAAE,IAAK,iBAAiB,aAAkB,IAAa,OAAQ,OAC/D,GAIS,EAAwB,CAAC,EAAgB,IAAsB,CAC1E,iBAAiB,aAAkB,KAGxB,EAAgB,CAI3B,EACA,EACA,IAI2D,CAzN7D,MA0NE,GAAM,CAAE,MAAO,EAAc,QAAS,GAAmB,GAAW,GAE9D,EACJ,oBAAc,WAAd,OAA0B,EAAsB,EAAQ,GAKpD,EAAQ,EACZ,EAJiE,IACjE,EAAW,EAAQ,EAAW,GAK9B,GAAE,QAAS,CAAC,CAAE,IAAU,IAAe,IAGzC,MAAO,IACL,YACG,IASM,EAAe,CAC1B,EACA,EACA,EACA,IAEO,EACL,CACE,IAAK,iBAAiB,aAAkB,IACxC,OAAQ,QACR,KAAM,GAER,GAIS,EAAkB,AAG7B,GAQI,CACJ,GAAM,CAAE,SAAU,EAAiB,QAAS,GAAmB,GAAW,GAW1E,MAAO,GANH,AAAC,GAAU,CACb,GAAM,CAAE,SAAQ,YAAW,QAAS,GAAS,GAE7C,MAAO,GAAa,EAAQ,EAAW,EAAM,IAQjC",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/unit/unit.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk3KO3PKBXcjs = require('../chunk-3KO3PKBX.cjs');var _reactquery = require('react-query');var p=(t,e)=>_chunk3KO3PKBXcjs.e.call(void 0, {url:`/organisation/${t}/unit`,method:"get"},e),d= exports.getGetOrganisationUnitsQueryKey =t=>[`/organisation/${t}/unit`],
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk3KO3PKBXcjs = require('../chunk-3KO3PKBX.cjs');var _reactquery = require('react-query');var p=(t,e)=>_chunk3KO3PKBXcjs.e.call(void 0, {url:`/organisation/${t}/unit`,method:"get"},e),d= exports.getGetOrganisationUnitsQueryKey =t=>[`/organisation/${t}/unit`],B= exports.useGetOrganisationUnits =(t,e)=>{var u;let{query:n,request:i}=e||{},r=(u=n==null?void 0:n.queryKey)!=null?u:d(t),o=_reactquery.useQuery.call(void 0, r,()=>p(t,i),_chunk3KO3PKBXcjs.a.call(void 0, {enabled:!!t},n));return _chunk3KO3PKBXcjs.a.call(void 0, {queryKey:r},o)},T= exports.createOrganisationUnit =(t,e,n)=>_chunk3KO3PKBXcjs.e.call(void 0, {url:`/organisation/${t}/unit`,method:"post",data:e},n),Q= exports.useCreateOrganisationUnit =t=>{let{mutation:e,request:n}=t||{};return _reactquery.useMutation.call(void 0, r=>{let{orgid:y,data:o}=r||{};return T(y,o,n)},e)};exports.createOrganisationUnit = T; exports.getGetOrganisationUnitsQueryKey = d; exports.getOrganisationUnits = p; exports.useCreateOrganisationUnit = Q; exports.useGetOrganisationUnits = B;
|
|
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.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 OrganisationUnitsGetResponse,\n
|
|
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 OrganisationUnitsGetResponse,\n AsError,\n OrganisationUnitPostResponse,\n OrganisationUnitPostBodyBody,\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 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 = ErrorType<void | AsError>\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): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetOrganisationUnitsQueryKey(orgid);\n\n const queryFn: QueryFunction<\n 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 Organisational 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 = ErrorType<AsError | 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
5
|
"mappings": "iDAUA,wDAoCO,GAAM,GAAuB,CAClC,EACA,IAEO,EACL,CAAE,IAAK,iBAAiB,SAAc,OAAQ,OAC9C,GAIS,EAAkC,AAAC,GAAkB,CAChE,iBAAiB,UAGN,EAA0B,CAIrC,EACA,IAQ2D,CAzE7D,MA0EE,GAAM,CAAE,MAAO,EAAc,QAAS,GAAmB,GAAW,GAE9D,EACJ,oBAAc,WAAd,OAA0B,EAAgC,GAMtD,EAAQ,EAIZ,EANE,IAAM,EAAqB,EAAO,GAMjB,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, QueryKey, UseQueryResult, UseMutationOptions } from 'react-query';
|
|
3
|
-
import { G as customInstance, y as OrganisationUnitsGetResponse, H as ErrorType,
|
|
3
|
+
import { G as customInstance, y as OrganisationUnitsGetResponse, H as ErrorType, C as AsError, O as OrganisationUnitPostBodyBody, z as OrganisationUnitPostResponse } from '../custom-instance-0d593da2';
|
|
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;
|
|
@@ -11,7 +11,7 @@ declare type SecondParameter<T extends (...args: any) => any> = T extends (confi
|
|
|
11
11
|
*/
|
|
12
12
|
declare const getOrganisationUnits: (orgid: string, options?: SecondParameter<typeof customInstance>) => Promise<OrganisationUnitsGetResponse>;
|
|
13
13
|
declare const getGetOrganisationUnitsQueryKey: (orgid: string) => string[];
|
|
14
|
-
declare const useGetOrganisationUnits: <TData = OrganisationUnitsGetResponse, TError = ErrorType<void |
|
|
14
|
+
declare const useGetOrganisationUnits: <TData = OrganisationUnitsGetResponse, TError = ErrorType<void | AsError>>(orgid: string, options?: {
|
|
15
15
|
query?: UseQueryOptions<OrganisationUnitsGetResponse, TError, TData, QueryKey> | undefined;
|
|
16
16
|
request?: SecondParameter<typeof customInstance>;
|
|
17
17
|
} | undefined) => UseQueryResult<TData, TError> & {
|
|
@@ -23,7 +23,7 @@ declare const useGetOrganisationUnits: <TData = OrganisationUnitsGetResponse, TE
|
|
|
23
23
|
* @summary Create a new Organisational Unit
|
|
24
24
|
*/
|
|
25
25
|
declare const createOrganisationUnit: (orgid: string, organisationUnitPostBodyBody: OrganisationUnitPostBodyBody, options?: SecondParameter<typeof customInstance>) => Promise<OrganisationUnitPostResponse>;
|
|
26
|
-
declare const useCreateOrganisationUnit: <TError = ErrorType<void |
|
|
26
|
+
declare const useCreateOrganisationUnit: <TError = ErrorType<void | AsError>, TContext = unknown>(options?: {
|
|
27
27
|
mutation?: UseMutationOptions<OrganisationUnitPostResponse, TError, {
|
|
28
28
|
orgid: string;
|
|
29
29
|
data: OrganisationUnitPostBodyBody;
|
package/unit/unit.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as s,e as a}from"../chunk-33VR3IML.js";import{useQuery as c,useMutation as g}from"react-query";var p=(t,e)=>a({url:`/organisation/${t}/unit`,method:"get"},e),d=t=>[`/organisation/${t}/unit`],
|
|
1
|
+
import{a as s,e as a}from"../chunk-33VR3IML.js";import{useQuery as c,useMutation as g}from"react-query";var p=(t,e)=>a({url:`/organisation/${t}/unit`,method:"get"},e),d=t=>[`/organisation/${t}/unit`],A=(t,e)=>{var u;let{query:n,request:i}=e||{},r=(u=n==null?void 0:n.queryKey)!=null?u:d(t),o=c(r,()=>p(t,i),s({enabled:!!t},n));return s({queryKey:r},o)},T=(t,e,n)=>a({url:`/organisation/${t}/unit`,method:"post",data:e},n),B=t=>{let{mutation:e,request:n}=t||{};return g(r=>{let{orgid:y,data:o}=r||{};return T(y,o,n)},e)};export{T as createOrganisationUnit,d as getGetOrganisationUnitsQueryKey,p as getOrganisationUnits,B as useCreateOrganisationUnit,A 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.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 OrganisationUnitsGetResponse,\n
|
|
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 OrganisationUnitsGetResponse,\n AsError,\n OrganisationUnitPostResponse,\n OrganisationUnitPostBodyBody,\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 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 = ErrorType<void | AsError>\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): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetOrganisationUnitsQueryKey(orgid);\n\n const queryFn: QueryFunction<\n 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 Organisational 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 = ErrorType<AsError | 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
5
|
"mappings": "gDAUA,wDAoCO,GAAM,GAAuB,CAClC,EACA,IAEO,EACL,CAAE,IAAK,iBAAiB,SAAc,OAAQ,OAC9C,GAIS,EAAkC,AAAC,GAAkB,CAChE,iBAAiB,UAGN,EAA0B,CAIrC,EACA,IAQ2D,CAzE7D,MA0EE,GAAM,CAAE,MAAO,EAAc,QAAS,GAAmB,GAAW,GAE9D,EACJ,oBAAc,WAAd,OAA0B,EAAgC,GAMtD,EAAQ,EAIZ,EANE,IAAM,EAAqB,EAAO,GAMjB,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.cjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/user/user.ts"],
|
|
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 { UsersGetResponse,
|
|
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 { UsersGetResponse, AsError } 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 users in an organisation\n\n * @summary Gets users in an organisation\n */\nexport const getOrganisationUsers = (\n orgid: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<UsersGetResponse>(\n { url: `/organisation/${orgid}/user`, method: \"get\" },\n options\n );\n};\n\nexport const getGetOrganisationUsersQueryKey = (orgid: string) => [\n `/organisation/${orgid}/user`,\n];\n\nexport const useGetOrganisationUsers = <\n TData = AsyncReturnType<typeof getOrganisationUsers>,\n TError = ErrorType<AsError | void>\n>(\n orgid: string,\n options?: {\n query?: UseQueryOptions<\n AsyncReturnType<typeof getOrganisationUsers>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetOrganisationUsersQueryKey(orgid);\n\n const queryFn: QueryFunction<\n AsyncReturnType<typeof getOrganisationUsers>\n > = () => getOrganisationUsers(orgid, requestOptions);\n\n const query = useQuery<\n AsyncReturnType<typeof getOrganisationUsers>,\n TError,\n TData\n >(queryKey, queryFn, { enabled: !!orgid, ...queryOptions });\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Adds a user to an organisation\n\n * @summary Adds a user to an organisation\n */\nexport const addOrganisationUser = (\n orgid: string,\n userid: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n {\n url: `/organisation/${orgid}/user/${userid}`,\n method: \"put\",\n data: undefined,\n },\n options\n );\n};\n\nexport const useAddOrganisationUser = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof addOrganisationUser>,\n TError,\n { orgid: string; userid: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof addOrganisationUser>,\n { orgid: string; userid: string }\n > = (props) => {\n const { orgid, userid } = props || {};\n\n return addOrganisationUser(orgid, userid, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof addOrganisationUser>,\n TError,\n { orgid: string; userid: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Removes a user to an organisation\n\n * @summary Deletes a user from an organisation\n */\nexport const deleteOrganisationUser = (\n orgid: string,\n userid: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n {\n url: `/organisation/${orgid}/user/${userid}`,\n method: \"delete\",\n data: undefined,\n },\n options\n );\n};\n\nexport const useDeleteOrganisationUser = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof deleteOrganisationUser>,\n TError,\n { orgid: string; userid: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof deleteOrganisationUser>,\n { orgid: string; userid: string }\n > = (props) => {\n const { orgid, userid } = props || {};\n\n return deleteOrganisationUser(orgid, userid, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof deleteOrganisationUser>,\n TError,\n { orgid: string; userid: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Gets users in an Organisational Unit\n\n * @summary Gets users in an Organisational Unit\n */\nexport const getOrganisationUnitUsers = (\n unitid: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<UsersGetResponse>(\n { url: `/unit/${unitid}/user`, method: \"get\" },\n options\n );\n};\n\nexport const getGetOrganisationUnitUsersQueryKey = (unitid: string) => [\n `/unit/${unitid}/user`,\n];\n\nexport const useGetOrganisationUnitUsers = <\n TData = AsyncReturnType<typeof getOrganisationUnitUsers>,\n TError = ErrorType<AsError | void>\n>(\n unitid: string,\n options?: {\n query?: UseQueryOptions<\n AsyncReturnType<typeof getOrganisationUnitUsers>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetOrganisationUnitUsersQueryKey(unitid);\n\n const queryFn: QueryFunction<\n AsyncReturnType<typeof getOrganisationUnitUsers>\n > = () => getOrganisationUnitUsers(unitid, requestOptions);\n\n const query = useQuery<\n AsyncReturnType<typeof getOrganisationUnitUsers>,\n TError,\n TData\n >(queryKey, queryFn, { enabled: !!unitid, ...queryOptions });\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Adds a user to an Organisationall Unit\n\n * @summary Adds a user to an Organisational Unit\n */\nexport const addOrganisationUnitUser = (\n unitid: string,\n userid: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/unit/${unitid}/user/${userid}`, method: \"put\", data: undefined },\n options\n );\n};\n\nexport const useAddOrganisationUnitUser = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof addOrganisationUnitUser>,\n TError,\n { unitid: string; userid: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof addOrganisationUnitUser>,\n { unitid: string; userid: string }\n > = (props) => {\n const { unitid, userid } = props || {};\n\n return addOrganisationUnitUser(unitid, userid, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof addOrganisationUnitUser>,\n TError,\n { unitid: string; userid: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Removes a user to an Organisational Unit\n\n * @summary Deletes a user from an Organisational Unit\n */\nexport const deleteOrganisationUnitUser = (\n unitid: string,\n userid: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n {\n url: `/unit/${unitid}/user/${userid}`,\n method: \"delete\",\n data: undefined,\n },\n options\n );\n};\n\nexport const useDeleteOrganisationUnitUser = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof deleteOrganisationUnitUser>,\n TError,\n { unitid: string; userid: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof deleteOrganisationUnitUser>,\n { unitid: string; userid: string }\n > = (props) => {\n const { unitid, userid } = props || {};\n\n return deleteOrganisationUnitUser(unitid, userid, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof deleteOrganisationUnitUser>,\n TError,\n { unitid: string; userid: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n"],
|
|
5
5
|
"mappings": "iDAUA,wDA+BO,GAAM,GAAuB,CAClC,EACA,IAEO,EACL,CAAE,IAAK,iBAAiB,SAAc,OAAQ,OAC9C,GAIS,EAAkC,AAAC,GAAkB,CAChE,iBAAiB,UAGN,EAA0B,CAIrC,EACA,IAQ2D,CApE7D,MAqEE,GAAM,CAAE,MAAO,EAAc,QAAS,GAAmB,GAAW,GAE9D,EACJ,oBAAc,WAAd,OAA0B,EAAgC,GAMtD,EAAQ,EAIZ,EANE,IAAM,EAAqB,EAAO,GAMjB,GAAE,QAAS,CAAC,CAAC,GAAU,IAE5C,MAAO,IACL,YACG,IASM,EAAsB,CACjC,EACA,EACA,IAEO,EACL,CACE,IAAK,iBAAiB,UAAc,IACpC,OAAQ,MACR,KAAM,QAER,GAIS,EAAyB,AAGpC,GAQI,CACJ,GAAM,CAAE,SAAU,EAAiB,QAAS,GAAmB,GAAW,GAW1E,MAAO,GANH,AAAC,GAAU,CACb,GAAM,CAAE,QAAO,UAAW,GAAS,GAEnC,MAAO,GAAoB,EAAO,EAAQ,IAQ9B,IAOH,EAAyB,CACpC,EACA,EACA,IAEO,EACL,CACE,IAAK,iBAAiB,UAAc,IACpC,OAAQ,SACR,KAAM,QAER,GAIS,EAA4B,AAGvC,GAQI,CACJ,GAAM,CAAE,SAAU,EAAiB,QAAS,GAAmB,GAAW,GAW1E,MAAO,GANH,AAAC,GAAU,CACb,GAAM,CAAE,QAAO,UAAW,GAAS,GAEnC,MAAO,GAAuB,EAAO,EAAQ,IAQjC,IAOH,EAA2B,CACtC,EACA,IAEO,EACL,CAAE,IAAK,SAAS,SAAe,OAAQ,OACvC,GAIS,EAAsC,AAAC,GAAmB,CACrE,SAAS,UAGE,EAA8B,CAIzC,EACA,IAQ2D,CA9N7D,MA+NE,GAAM,CAAE,MAAO,EAAc,QAAS,GAAmB,GAAW,GAE9D,EACJ,oBAAc,WAAd,OAA0B,EAAoC,GAM1D,EAAQ,EAIZ,EANE,IAAM,EAAyB,EAAQ,GAMtB,GAAE,QAAS,CAAC,CAAC,GAAW,IAE7C,MAAO,IACL,YACG,IASM,EAA0B,CACrC,EACA,EACA,IAEO,EACL,CAAE,IAAK,SAAS,UAAe,IAAU,OAAQ,MAAO,KAAM,QAC9D,GAIS,EAA6B,AAGxC,GAQI,CACJ,GAAM,CAAE,SAAU,EAAiB,QAAS,GAAmB,GAAW,GAW1E,MAAO,GANH,AAAC,GAAU,CACb,GAAM,CAAE,SAAQ,UAAW,GAAS,GAEpC,MAAO,GAAwB,EAAQ,EAAQ,IAQnC,IAOH,EAA6B,CACxC,EACA,EACA,IAEO,EACL,CACE,IAAK,SAAS,UAAe,IAC7B,OAAQ,SACR,KAAM,QAER,GAIS,EAAgC,AAG3C,GAQI,CACJ,GAAM,CAAE,SAAU,EAAiB,QAAS,GAAmB,GAAW,GAW1E,MAAO,GANH,AAAC,GAAU,CACb,GAAM,CAAE,SAAQ,UAAW,GAAS,GAEpC,MAAO,GAA2B,EAAQ,EAAQ,IAQtC",
|
|
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, QueryKey, UseQueryResult, UseMutationOptions } from 'react-query';
|
|
3
|
-
import { G as customInstance, A as UsersGetResponse, H as ErrorType,
|
|
3
|
+
import { G as customInstance, A as UsersGetResponse, H as ErrorType, C as AsError } from '../custom-instance-0d593da2';
|
|
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;
|
|
@@ -11,7 +11,7 @@ declare type SecondParameter<T extends (...args: any) => any> = T extends (confi
|
|
|
11
11
|
*/
|
|
12
12
|
declare const getOrganisationUsers: (orgid: string, options?: SecondParameter<typeof customInstance>) => Promise<UsersGetResponse>;
|
|
13
13
|
declare const getGetOrganisationUsersQueryKey: (orgid: string) => string[];
|
|
14
|
-
declare const useGetOrganisationUsers: <TData = UsersGetResponse, TError = ErrorType<void |
|
|
14
|
+
declare const useGetOrganisationUsers: <TData = UsersGetResponse, TError = ErrorType<void | AsError>>(orgid: string, options?: {
|
|
15
15
|
query?: UseQueryOptions<UsersGetResponse, TError, TData, QueryKey> | undefined;
|
|
16
16
|
request?: SecondParameter<typeof customInstance>;
|
|
17
17
|
} | undefined) => UseQueryResult<TData, TError> & {
|
|
@@ -23,7 +23,7 @@ declare const useGetOrganisationUsers: <TData = UsersGetResponse, TError = Error
|
|
|
23
23
|
* @summary Adds a user to an organisation
|
|
24
24
|
*/
|
|
25
25
|
declare const addOrganisationUser: (orgid: string, userid: string, options?: SecondParameter<typeof customInstance>) => Promise<void>;
|
|
26
|
-
declare const useAddOrganisationUser: <TError = ErrorType<
|
|
26
|
+
declare const useAddOrganisationUser: <TError = ErrorType<AsError>, TContext = unknown>(options?: {
|
|
27
27
|
mutation?: UseMutationOptions<void, TError, {
|
|
28
28
|
orgid: string;
|
|
29
29
|
userid: string;
|
|
@@ -39,7 +39,7 @@ declare const useAddOrganisationUser: <TError = ErrorType<Error>, TContext = unk
|
|
|
39
39
|
* @summary Deletes a user from an organisation
|
|
40
40
|
*/
|
|
41
41
|
declare const deleteOrganisationUser: (orgid: string, userid: string, options?: SecondParameter<typeof customInstance>) => Promise<void>;
|
|
42
|
-
declare const useDeleteOrganisationUser: <TError = ErrorType<
|
|
42
|
+
declare const useDeleteOrganisationUser: <TError = ErrorType<AsError>, TContext = unknown>(options?: {
|
|
43
43
|
mutation?: UseMutationOptions<void, TError, {
|
|
44
44
|
orgid: string;
|
|
45
45
|
userid: string;
|
|
@@ -56,7 +56,7 @@ declare const useDeleteOrganisationUser: <TError = ErrorType<Error>, TContext =
|
|
|
56
56
|
*/
|
|
57
57
|
declare const getOrganisationUnitUsers: (unitid: string, options?: SecondParameter<typeof customInstance>) => Promise<UsersGetResponse>;
|
|
58
58
|
declare const getGetOrganisationUnitUsersQueryKey: (unitid: string) => string[];
|
|
59
|
-
declare const useGetOrganisationUnitUsers: <TData = UsersGetResponse, TError = ErrorType<void |
|
|
59
|
+
declare const useGetOrganisationUnitUsers: <TData = UsersGetResponse, TError = ErrorType<void | AsError>>(unitid: string, options?: {
|
|
60
60
|
query?: UseQueryOptions<UsersGetResponse, TError, TData, QueryKey> | undefined;
|
|
61
61
|
request?: SecondParameter<typeof customInstance>;
|
|
62
62
|
} | undefined) => UseQueryResult<TData, TError> & {
|
|
@@ -68,7 +68,7 @@ declare const useGetOrganisationUnitUsers: <TData = UsersGetResponse, TError = E
|
|
|
68
68
|
* @summary Adds a user to an Organisational Unit
|
|
69
69
|
*/
|
|
70
70
|
declare const addOrganisationUnitUser: (unitid: string, userid: string, options?: SecondParameter<typeof customInstance>) => Promise<void>;
|
|
71
|
-
declare const useAddOrganisationUnitUser: <TError = ErrorType<
|
|
71
|
+
declare const useAddOrganisationUnitUser: <TError = ErrorType<AsError>, TContext = unknown>(options?: {
|
|
72
72
|
mutation?: UseMutationOptions<void, TError, {
|
|
73
73
|
unitid: string;
|
|
74
74
|
userid: string;
|
|
@@ -84,7 +84,7 @@ declare const useAddOrganisationUnitUser: <TError = ErrorType<Error>, TContext =
|
|
|
84
84
|
* @summary Deletes a user from an Organisational Unit
|
|
85
85
|
*/
|
|
86
86
|
declare const deleteOrganisationUnitUser: (unitid: string, userid: string, options?: SecondParameter<typeof customInstance>) => Promise<void>;
|
|
87
|
-
declare const useDeleteOrganisationUnitUser: <TError = ErrorType<
|
|
87
|
+
declare const useDeleteOrganisationUnitUser: <TError = ErrorType<AsError>, TContext = unknown>(options?: {
|
|
88
88
|
mutation?: UseMutationOptions<void, TError, {
|
|
89
89
|
unitid: string;
|
|
90
90
|
userid: string;
|
package/user/user.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/user/user.ts"],
|
|
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 { UsersGetResponse,
|
|
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 { UsersGetResponse, AsError } 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 users in an organisation\n\n * @summary Gets users in an organisation\n */\nexport const getOrganisationUsers = (\n orgid: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<UsersGetResponse>(\n { url: `/organisation/${orgid}/user`, method: \"get\" },\n options\n );\n};\n\nexport const getGetOrganisationUsersQueryKey = (orgid: string) => [\n `/organisation/${orgid}/user`,\n];\n\nexport const useGetOrganisationUsers = <\n TData = AsyncReturnType<typeof getOrganisationUsers>,\n TError = ErrorType<AsError | void>\n>(\n orgid: string,\n options?: {\n query?: UseQueryOptions<\n AsyncReturnType<typeof getOrganisationUsers>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetOrganisationUsersQueryKey(orgid);\n\n const queryFn: QueryFunction<\n AsyncReturnType<typeof getOrganisationUsers>\n > = () => getOrganisationUsers(orgid, requestOptions);\n\n const query = useQuery<\n AsyncReturnType<typeof getOrganisationUsers>,\n TError,\n TData\n >(queryKey, queryFn, { enabled: !!orgid, ...queryOptions });\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Adds a user to an organisation\n\n * @summary Adds a user to an organisation\n */\nexport const addOrganisationUser = (\n orgid: string,\n userid: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n {\n url: `/organisation/${orgid}/user/${userid}`,\n method: \"put\",\n data: undefined,\n },\n options\n );\n};\n\nexport const useAddOrganisationUser = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof addOrganisationUser>,\n TError,\n { orgid: string; userid: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof addOrganisationUser>,\n { orgid: string; userid: string }\n > = (props) => {\n const { orgid, userid } = props || {};\n\n return addOrganisationUser(orgid, userid, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof addOrganisationUser>,\n TError,\n { orgid: string; userid: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Removes a user to an organisation\n\n * @summary Deletes a user from an organisation\n */\nexport const deleteOrganisationUser = (\n orgid: string,\n userid: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n {\n url: `/organisation/${orgid}/user/${userid}`,\n method: \"delete\",\n data: undefined,\n },\n options\n );\n};\n\nexport const useDeleteOrganisationUser = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof deleteOrganisationUser>,\n TError,\n { orgid: string; userid: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof deleteOrganisationUser>,\n { orgid: string; userid: string }\n > = (props) => {\n const { orgid, userid } = props || {};\n\n return deleteOrganisationUser(orgid, userid, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof deleteOrganisationUser>,\n TError,\n { orgid: string; userid: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Gets users in an Organisational Unit\n\n * @summary Gets users in an Organisational Unit\n */\nexport const getOrganisationUnitUsers = (\n unitid: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<UsersGetResponse>(\n { url: `/unit/${unitid}/user`, method: \"get\" },\n options\n );\n};\n\nexport const getGetOrganisationUnitUsersQueryKey = (unitid: string) => [\n `/unit/${unitid}/user`,\n];\n\nexport const useGetOrganisationUnitUsers = <\n TData = AsyncReturnType<typeof getOrganisationUnitUsers>,\n TError = ErrorType<AsError | void>\n>(\n unitid: string,\n options?: {\n query?: UseQueryOptions<\n AsyncReturnType<typeof getOrganisationUnitUsers>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetOrganisationUnitUsersQueryKey(unitid);\n\n const queryFn: QueryFunction<\n AsyncReturnType<typeof getOrganisationUnitUsers>\n > = () => getOrganisationUnitUsers(unitid, requestOptions);\n\n const query = useQuery<\n AsyncReturnType<typeof getOrganisationUnitUsers>,\n TError,\n TData\n >(queryKey, queryFn, { enabled: !!unitid, ...queryOptions });\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Adds a user to an Organisationall Unit\n\n * @summary Adds a user to an Organisational Unit\n */\nexport const addOrganisationUnitUser = (\n unitid: string,\n userid: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/unit/${unitid}/user/${userid}`, method: \"put\", data: undefined },\n options\n );\n};\n\nexport const useAddOrganisationUnitUser = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof addOrganisationUnitUser>,\n TError,\n { unitid: string; userid: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof addOrganisationUnitUser>,\n { unitid: string; userid: string }\n > = (props) => {\n const { unitid, userid } = props || {};\n\n return addOrganisationUnitUser(unitid, userid, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof addOrganisationUnitUser>,\n TError,\n { unitid: string; userid: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Removes a user to an Organisational Unit\n\n * @summary Deletes a user from an Organisational Unit\n */\nexport const deleteOrganisationUnitUser = (\n unitid: string,\n userid: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n {\n url: `/unit/${unitid}/user/${userid}`,\n method: \"delete\",\n data: undefined,\n },\n options\n );\n};\n\nexport const useDeleteOrganisationUnitUser = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof deleteOrganisationUnitUser>,\n TError,\n { unitid: string; userid: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof deleteOrganisationUnitUser>,\n { unitid: string; userid: string }\n > = (props) => {\n const { unitid, userid } = props || {};\n\n return deleteOrganisationUnitUser(unitid, userid, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof deleteOrganisationUnitUser>,\n TError,\n { unitid: string; userid: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n"],
|
|
5
5
|
"mappings": "gDAUA,wDA+BO,GAAM,GAAuB,CAClC,EACA,IAEO,EACL,CAAE,IAAK,iBAAiB,SAAc,OAAQ,OAC9C,GAIS,EAAkC,AAAC,GAAkB,CAChE,iBAAiB,UAGN,EAA0B,CAIrC,EACA,IAQ2D,CApE7D,MAqEE,GAAM,CAAE,MAAO,EAAc,QAAS,GAAmB,GAAW,GAE9D,EACJ,oBAAc,WAAd,OAA0B,EAAgC,GAMtD,EAAQ,EAIZ,EANE,IAAM,EAAqB,EAAO,GAMjB,GAAE,QAAS,CAAC,CAAC,GAAU,IAE5C,MAAO,IACL,YACG,IASM,EAAsB,CACjC,EACA,EACA,IAEO,EACL,CACE,IAAK,iBAAiB,UAAc,IACpC,OAAQ,MACR,KAAM,QAER,GAIS,EAAyB,AAGpC,GAQI,CACJ,GAAM,CAAE,SAAU,EAAiB,QAAS,GAAmB,GAAW,GAW1E,MAAO,GANH,AAAC,GAAU,CACb,GAAM,CAAE,QAAO,UAAW,GAAS,GAEnC,MAAO,GAAoB,EAAO,EAAQ,IAQ9B,IAOH,EAAyB,CACpC,EACA,EACA,IAEO,EACL,CACE,IAAK,iBAAiB,UAAc,IACpC,OAAQ,SACR,KAAM,QAER,GAIS,EAA4B,AAGvC,GAQI,CACJ,GAAM,CAAE,SAAU,EAAiB,QAAS,GAAmB,GAAW,GAW1E,MAAO,GANH,AAAC,GAAU,CACb,GAAM,CAAE,QAAO,UAAW,GAAS,GAEnC,MAAO,GAAuB,EAAO,EAAQ,IAQjC,IAOH,EAA2B,CACtC,EACA,IAEO,EACL,CAAE,IAAK,SAAS,SAAe,OAAQ,OACvC,GAIS,EAAsC,AAAC,GAAmB,CACrE,SAAS,UAGE,EAA8B,CAIzC,EACA,IAQ2D,CA9N7D,MA+NE,GAAM,CAAE,MAAO,EAAc,QAAS,GAAmB,GAAW,GAE9D,EACJ,oBAAc,WAAd,OAA0B,EAAoC,GAM1D,EAAQ,EAIZ,EANE,IAAM,EAAyB,EAAQ,GAMtB,GAAE,QAAS,CAAC,CAAC,GAAW,IAE7C,MAAO,IACL,YACG,IASM,EAA0B,CACrC,EACA,EACA,IAEO,EACL,CAAE,IAAK,SAAS,UAAe,IAAU,OAAQ,MAAO,KAAM,QAC9D,GAIS,EAA6B,AAGxC,GAQI,CACJ,GAAM,CAAE,SAAU,EAAiB,QAAS,GAAmB,GAAW,GAW1E,MAAO,GANH,AAAC,GAAU,CACb,GAAM,CAAE,SAAQ,UAAW,GAAS,GAEpC,MAAO,GAAwB,EAAQ,EAAQ,IAQnC,IAOH,EAA6B,CACxC,EACA,EACA,IAEO,EACL,CACE,IAAK,SAAS,UAAe,IAC7B,OAAQ,SACR,KAAM,QAER,GAIS,EAAgC,AAG3C,GAQI,CACJ,GAAM,CAAE,SAAU,EAAiB,QAAS,GAAmB,GAAW,GAW1E,MAAO,GANH,AAAC,GAAU,CACb,GAAM,CAAE,SAAQ,UAAW,GAAS,GAEpC,MAAO,GAA2B,EAAQ,EAAQ,IAQtC",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|