@squonk/account-server-client 0.1.23-rc.1 → 0.1.23-rc.2
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-688b0e9e.d.ts → custom-instance-86dd5ce6.d.ts} +7 -1
- package/index.cjs.map +1 -1
- package/index.d.ts +1 -1
- package/index.js.map +1 -1
- package/organisation/organisation.d.ts +1 -1
- package/package.json +1 -1
- package/product/product.d.ts +1 -1
- package/service/service.d.ts +1 -1
- package/src/account-server-api.schemas.ts +8 -0
- package/src/user/user.ts +51 -1
- package/state/state.d.ts +1 -1
- package/unit/unit.d.ts +1 -1
- package/user/user.cjs +17 -1
- package/user/user.cjs.map +1 -1
- package/user/user.d.ts +15 -2
- package/user/user.js +17 -1
- package/user/user.js.map +1 -1
|
@@ -71,6 +71,11 @@ interface UserDetail {
|
|
|
71
71
|
/** The user identity (username) */
|
|
72
72
|
id: string;
|
|
73
73
|
}
|
|
74
|
+
interface UserAccountDetail {
|
|
75
|
+
user: UserDetail;
|
|
76
|
+
/** Whether the caller has admin privilege */
|
|
77
|
+
caller_has_admin_privilege: boolean;
|
|
78
|
+
}
|
|
74
79
|
interface UnitDetail {
|
|
75
80
|
/** The Unit's unique identity */
|
|
76
81
|
id: string;
|
|
@@ -226,6 +231,7 @@ interface ProductDmStorage {
|
|
|
226
231
|
storage: ProductDmStorageDetail;
|
|
227
232
|
coins: ProductCoinsDetail;
|
|
228
233
|
}
|
|
234
|
+
declare type UserAccountGetResponse = UserAccountDetail;
|
|
229
235
|
interface UnitGetResponse {
|
|
230
236
|
/** The Unit's unique ID */
|
|
231
237
|
id: string;
|
|
@@ -324,4 +330,4 @@ declare const setBaseUrl: (baseUrl: string) => void;
|
|
|
324
330
|
declare const customInstance: <TReturn>(config: AxiosRequestConfig, options?: AxiosRequestConfig<any> | undefined) => Promise<TReturn>;
|
|
325
331
|
declare type ErrorType<TError> = AxiosError<TError>;
|
|
326
332
|
|
|
327
|
-
export {
|
|
333
|
+
export { ProductUnitGetResponse as A, ProductsGetTypesResponse as B, ProductsGetResponseProductsItem as C, ProductsGetResponse as D, OrganisationsGetResponse as E, OrganisationUnitsGetResponse as F, UnitsGetResponse as G, PersonalUnitPutResponse as H, OrganisationUnitPostResponse as I, OrganisationGetDefaultResponse as J, UsersGetResponse as K, OrganisationPostResponse as L, StateGetVersionResponse as M, AsError as N, OrganisationUnitPostBodyBody as O, ProductPatchBodyBody as P, AXIOS_INSTANCE as Q, setAuthToken as R, ServiceGetResponseKind as S, setBaseUrl as T, UnitProductPostBodyBodyFlavour as U, customInstance as V, ErrorType as W, UnitProductPostBodyBodyType as a, UnitProductPostBodyBody as b, OrganisationPostBodyBody as c, UserDetail as d, UserAccountDetail as e, UnitDetail as f, ServiceGetResponse as g, ServicesGetResponse as h, OrganisationDetail as i, ProductType as j, ProductInstanceDetailCoins as k, ProductInstanceDetail as l, ProductDetailFlavour as m, ProductDetailType as n, ProductDetail as o, ProductCoinsDetail as p, ProductClaimDetail as q, ProductDmStorageDetailCoins as r, ProductDmStorageDetailSize as s, ProductDmStorageDetail as t, ProductDmProjectTier as u, ProductDmStorage as v, UserAccountGetResponse as w, UnitGetResponse as x, UnitProductPostResponse as y, ProductUnitGetResponseProduct as z };
|
package/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/account-server-api.schemas.ts"],"names":[],"mappings":";;;;;;;;AA6BO,IAAM,iCAAiC;AAAA,EAC5C,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,MAAM;AAAA;AAaD,IAAM,8BAA8B;AAAA,EACzC,wCACE;AAAA,EACF,mCACE;AAAA;AAsDG,IAAM,yBAAyB;AAAA,EACpC,cAAc;AAAA;AAqDT,IAAM,uBAAuB;AAAA,EAClC,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,MAAM;AAAA;AAYD,IAAM,oBAAoB;AAAA,EAC/B,wCACE;AAAA,EACF,mCACE;AAAA","sourcesContent":["/**\n * Generated by orval v6.6.0 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Products**, **Organisations**, **Units** and **Users**.\n\n * OpenAPI spec version: 0.1\n */\nexport type ProductPatchBodyBody = {\n /** The name you want to give the Product */\n name?: string;\n /** The Product's built-in coin allowance. */\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 not 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 provided.\n\nProject 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 service identity for the Product. Products are created for use on a specific service, like a Data Manager instance */\n service_id: number;\n /** The Type of Product. Storage subscriptions require an **Allowance** to be defined and the **Flavour** must not be provided.\n\nProject 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 not set this for Storage products */\n flavour?: UnitProductPostBodyBodyFlavour;\n /** The Product's coin allowance. 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 organisation */\n name: string;\n /** The name of the organisation owner. A user ID */\n owner: string;\n};\n\nexport interface UserDetail {\n /** The user identity (username) */\n id: string;\n}\n\nexport interface UnitDetail {\n /** The Unit's unique identity */\n id: string;\n /** The Unit's name */\n name: string;\n /** The Unit's owner (a username) */\n owner_id: string;\n}\n\n/**\n * The kind of Service\n */\nexport type ServiceGetResponseKind = \"DATA_MANAGER\";\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const ServiceGetResponseKind = {\n DATA_MANAGER: \"DATA_MANAGER\" as ServiceGetResponseKind,\n};\n\nexport interface ServiceGetResponse {\n /** The unique ID of the Service */\n id: number;\n /** The kind of Service */\n kind: ServiceGetResponseKind;\n /** The name assigned to the Service */\n name?: string;\n}\n\nexport interface ServicesGetResponse {\n /** The list of known Services\n */\n services: ServiceGetResponse[];\n}\n\nexport interface OrganisationDetail {\n /** The Organisation's unique ID */\n id: string;\n /** The Organisation's name */\n name: string;\n /** The username of the Organisation's owner. Not all Organisations have an owner. The Default Organisation has no owner. */\n owner_id?: string;\n}\n\nexport interface ProductType {\n /** A product type, this is a unique string amongst all types known to the Account Server */\n type: string;\n /** A product flavour. Not all types have a flavour, those that do have a type-specific flavour string */\n flavour?: string;\n /** For a product that belongs to a specific service, the service that owns it is provided */\n service?: ServiceGetResponse;\n}\n\nexport type ProductInstanceDetailCoins = {\n /** The number of coins used\n */\n used: number;\n};\n\nexport interface ProductInstanceDetail {\n coins: ProductInstanceDetailCoins;\n}\n\n/**\n * The Product Type falvour. Not all products have flavours\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\n/**\n * The Product Type\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 /** The Product Service ID\n */\n service_id?: number;\n /** The Product Type\n */\n type: ProductDetailType;\n /** The Product Type falvour. Not all products have flavours\n */\n flavour?: ProductDetailFlavour;\n /** The name of the Product\n */\n name?: string;\n}\n\nexport interface ProductCoinsDetail {\n /** The billing allowance. When you exceed this during the current billing period the *cost multiplier* 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), excluding the coins that have been consumed for the current day */\n used: number;\n /** True if the product is operating at or beyond its coin limit. When it is authority to perform actions using the product are severely 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 billing period */\n billing_day: number;\n /** A multiplier applied to your coin usage within your allowance */\n allowance_multiplier: number;\n /** A multiplier 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-specific ID that is using this Subscription\n */\n id: string;\n /** A name for the service-specific ID\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 accumulated coins at the start of each day */\n used: number;\n /** The coin cost of a 'unit' of storage 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 UnitGetResponse {\n /** The Unit's unique ID */\n id: string;\n /** The Unit's name */\n name: string;\n /** The Unit's oener (username) */\n owner_id: string;\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 interface ProductsGetTypesResponse {\n /** All the Product Types you have access to */\n product_types: ProductType[];\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 Organisations */\n organisations: OrganisationDetail[];\n}\n\nexport interface OrganisationUnitsGetResponse {\n organisation: OrganisationDetail;\n /** A list of Units\n */\n units: UnitDetail[];\n}\n\nexport interface UnitsGetResponse {\n /** A list of Units\n */\n units: OrganisationUnitsGetResponse[];\n}\n\nexport interface PersonalUnitPutResponse {\n /** The unit's Organisation. Used to identify the Default organisation */\n organisation_id: string;\n /** The unit's unique ID */\n id: string;\n}\n\nexport interface OrganisationUnitPostResponse {\n /** The unit's unique ID */\n id: string;\n}\n\nexport interface OrganisationGetDefaultResponse {\n /** The Default Organisation ID\n */\n id: string;\n /** The Default Organisation Name\n */\n name: 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 StateGetVersionResponse {\n /** The Account Server version. This is guaranteed to be a valid semantic version for official (tagged) images. The version value format for unofficial images is a string but otherwise undefined\n */\n version: string;\n}\n\nexport interface AsError {\n /** Brief error text that can be presented to the user */\n error: string;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/account-server-api.schemas.ts"],"names":[],"mappings":";;;;;;;;AA6BO,IAAM,iCAAiC;AAAA,EAC5C,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,MAAM;AAAA;AAaD,IAAM,8BAA8B;AAAA,EACzC,wCACE;AAAA,EACF,mCACE;AAAA;AA4DG,IAAM,yBAAyB;AAAA,EACpC,cAAc;AAAA;AAqDT,IAAM,uBAAuB;AAAA,EAClC,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,MAAM;AAAA;AAYD,IAAM,oBAAoB;AAAA,EAC/B,wCACE;AAAA,EACF,mCACE;AAAA","sourcesContent":["/**\n * Generated by orval v6.6.0 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Products**, **Organisations**, **Units** and **Users**.\n\n * OpenAPI spec version: 0.1\n */\nexport type ProductPatchBodyBody = {\n /** The name you want to give the Product */\n name?: string;\n /** The Product's built-in coin allowance. */\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 not 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 provided.\n\nProject 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 service identity for the Product. Products are created for use on a specific service, like a Data Manager instance */\n service_id: number;\n /** The Type of Product. Storage subscriptions require an **Allowance** to be defined and the **Flavour** must not be provided.\n\nProject 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 not set this for Storage products */\n flavour?: UnitProductPostBodyBodyFlavour;\n /** The Product's coin allowance. 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 organisation */\n name: string;\n /** The name of the organisation owner. A user ID */\n owner: string;\n};\n\nexport interface UserDetail {\n /** The user identity (username) */\n id: string;\n}\n\nexport interface UserAccountDetail {\n user: UserDetail;\n /** Whether the caller has admin privilege */\n caller_has_admin_privilege: boolean;\n}\n\nexport interface UnitDetail {\n /** The Unit's unique identity */\n id: string;\n /** The Unit's name */\n name: string;\n /** The Unit's owner (a username) */\n owner_id: string;\n}\n\n/**\n * The kind of Service\n */\nexport type ServiceGetResponseKind = \"DATA_MANAGER\";\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const ServiceGetResponseKind = {\n DATA_MANAGER: \"DATA_MANAGER\" as ServiceGetResponseKind,\n};\n\nexport interface ServiceGetResponse {\n /** The unique ID of the Service */\n id: number;\n /** The kind of Service */\n kind: ServiceGetResponseKind;\n /** The name assigned to the Service */\n name?: string;\n}\n\nexport interface ServicesGetResponse {\n /** The list of known Services\n */\n services: ServiceGetResponse[];\n}\n\nexport interface OrganisationDetail {\n /** The Organisation's unique ID */\n id: string;\n /** The Organisation's name */\n name: string;\n /** The username of the Organisation's owner. Not all Organisations have an owner. The Default Organisation has no owner. */\n owner_id?: string;\n}\n\nexport interface ProductType {\n /** A product type, this is a unique string amongst all types known to the Account Server */\n type: string;\n /** A product flavour. Not all types have a flavour, those that do have a type-specific flavour string */\n flavour?: string;\n /** For a product that belongs to a specific service, the service that owns it is provided */\n service?: ServiceGetResponse;\n}\n\nexport type ProductInstanceDetailCoins = {\n /** The number of coins used\n */\n used: number;\n};\n\nexport interface ProductInstanceDetail {\n coins: ProductInstanceDetailCoins;\n}\n\n/**\n * The Product Type falvour. Not all products have flavours\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\n/**\n * The Product Type\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 /** The Product Service ID\n */\n service_id?: number;\n /** The Product Type\n */\n type: ProductDetailType;\n /** The Product Type falvour. Not all products have flavours\n */\n flavour?: ProductDetailFlavour;\n /** The name of the Product\n */\n name?: string;\n}\n\nexport interface ProductCoinsDetail {\n /** The billing allowance. When you exceed this during the current billing period the *cost multiplier* 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), excluding the coins that have been consumed for the current day */\n used: number;\n /** True if the product is operating at or beyond its coin limit. When it is authority to perform actions using the product are severely 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 billing period */\n billing_day: number;\n /** A multiplier applied to your coin usage within your allowance */\n allowance_multiplier: number;\n /** A multiplier 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-specific ID that is using this Subscription\n */\n id: string;\n /** A name for the service-specific ID\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 accumulated coins at the start of each day */\n used: number;\n /** The coin cost of a 'unit' of storage 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 type UserAccountGetResponse = UserAccountDetail;\n\nexport interface UnitGetResponse {\n /** The Unit's unique ID */\n id: string;\n /** The Unit's name */\n name: string;\n /** The Unit's oener (username) */\n owner_id: string;\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 interface ProductsGetTypesResponse {\n /** All the Product Types you have access to */\n product_types: ProductType[];\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 Organisations */\n organisations: OrganisationDetail[];\n}\n\nexport interface OrganisationUnitsGetResponse {\n organisation: OrganisationDetail;\n /** A list of Units\n */\n units: UnitDetail[];\n}\n\nexport interface UnitsGetResponse {\n /** A list of Units\n */\n units: OrganisationUnitsGetResponse[];\n}\n\nexport interface PersonalUnitPutResponse {\n /** The unit's Organisation. Used to identify the Default organisation */\n organisation_id: string;\n /** The unit's unique ID */\n id: string;\n}\n\nexport interface OrganisationUnitPostResponse {\n /** The unit's unique ID */\n id: string;\n}\n\nexport interface OrganisationGetDefaultResponse {\n /** The Default Organisation ID\n */\n id: string;\n /** The Default Organisation Name\n */\n name: 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 StateGetVersionResponse {\n /** The Account Server version. This is guaranteed to be a valid semantic version for official (tagged) images. The version value format for unofficial images is a string but otherwise undefined\n */\n version: string;\n}\n\nexport interface AsError {\n /** Brief error text that can be presented to the user */\n error: string;\n}\n"]}
|
package/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { Q as AXIOS_INSTANCE, N as AsError, W as ErrorType, i as OrganisationDetail, J as OrganisationGetDefaultResponse, c as OrganisationPostBodyBody, L as OrganisationPostResponse, O as OrganisationUnitPostBodyBody, I as OrganisationUnitPostResponse, F as OrganisationUnitsGetResponse, E as OrganisationsGetResponse, H as PersonalUnitPutResponse, q as ProductClaimDetail, p as ProductCoinsDetail, o as ProductDetail, m as ProductDetailFlavour, n as ProductDetailType, u as ProductDmProjectTier, v as ProductDmStorage, t as ProductDmStorageDetail, r as ProductDmStorageDetailCoins, s as ProductDmStorageDetailSize, l as ProductInstanceDetail, k as ProductInstanceDetailCoins, P as ProductPatchBodyBody, j as ProductType, A as ProductUnitGetResponse, z as ProductUnitGetResponseProduct, D as ProductsGetResponse, C as ProductsGetResponseProductsItem, B as ProductsGetTypesResponse, g as ServiceGetResponse, S as ServiceGetResponseKind, h as ServicesGetResponse, M as StateGetVersionResponse, f as UnitDetail, x as UnitGetResponse, b as UnitProductPostBodyBody, U as UnitProductPostBodyBodyFlavour, a as UnitProductPostBodyBodyType, y as UnitProductPostResponse, G as UnitsGetResponse, e as UserAccountDetail, w as UserAccountGetResponse, d as UserDetail, K as UsersGetResponse, V as customInstance, R as setAuthToken, T as setBaseUrl } from './custom-instance-86dd5ce6';
|
|
2
2
|
import 'axios';
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/account-server-api.schemas.ts"],"sourcesContent":["/**\n * Generated by orval v6.6.0 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Products**, **Organisations**, **Units** and **Users**.\n\n * OpenAPI spec version: 0.1\n */\nexport type ProductPatchBodyBody = {\n /** The name you want to give the Product */\n name?: string;\n /** The Product's built-in coin allowance. */\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 not 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 provided.\n\nProject 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 service identity for the Product. Products are created for use on a specific service, like a Data Manager instance */\n service_id: number;\n /** The Type of Product. Storage subscriptions require an **Allowance** to be defined and the **Flavour** must not be provided.\n\nProject 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 not set this for Storage products */\n flavour?: UnitProductPostBodyBodyFlavour;\n /** The Product's coin allowance. 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 organisation */\n name: string;\n /** The name of the organisation owner. A user ID */\n owner: string;\n};\n\nexport interface UserDetail {\n /** The user identity (username) */\n id: string;\n}\n\nexport interface UnitDetail {\n /** The Unit's unique identity */\n id: string;\n /** The Unit's name */\n name: string;\n /** The Unit's owner (a username) */\n owner_id: string;\n}\n\n/**\n * The kind of Service\n */\nexport type ServiceGetResponseKind = \"DATA_MANAGER\";\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const ServiceGetResponseKind = {\n DATA_MANAGER: \"DATA_MANAGER\" as ServiceGetResponseKind,\n};\n\nexport interface ServiceGetResponse {\n /** The unique ID of the Service */\n id: number;\n /** The kind of Service */\n kind: ServiceGetResponseKind;\n /** The name assigned to the Service */\n name?: string;\n}\n\nexport interface ServicesGetResponse {\n /** The list of known Services\n */\n services: ServiceGetResponse[];\n}\n\nexport interface OrganisationDetail {\n /** The Organisation's unique ID */\n id: string;\n /** The Organisation's name */\n name: string;\n /** The username of the Organisation's owner. Not all Organisations have an owner. The Default Organisation has no owner. */\n owner_id?: string;\n}\n\nexport interface ProductType {\n /** A product type, this is a unique string amongst all types known to the Account Server */\n type: string;\n /** A product flavour. Not all types have a flavour, those that do have a type-specific flavour string */\n flavour?: string;\n /** For a product that belongs to a specific service, the service that owns it is provided */\n service?: ServiceGetResponse;\n}\n\nexport type ProductInstanceDetailCoins = {\n /** The number of coins used\n */\n used: number;\n};\n\nexport interface ProductInstanceDetail {\n coins: ProductInstanceDetailCoins;\n}\n\n/**\n * The Product Type falvour. Not all products have flavours\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\n/**\n * The Product Type\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 /** The Product Service ID\n */\n service_id?: number;\n /** The Product Type\n */\n type: ProductDetailType;\n /** The Product Type falvour. Not all products have flavours\n */\n flavour?: ProductDetailFlavour;\n /** The name of the Product\n */\n name?: string;\n}\n\nexport interface ProductCoinsDetail {\n /** The billing allowance. When you exceed this during the current billing period the *cost multiplier* 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), excluding the coins that have been consumed for the current day */\n used: number;\n /** True if the product is operating at or beyond its coin limit. When it is authority to perform actions using the product are severely 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 billing period */\n billing_day: number;\n /** A multiplier applied to your coin usage within your allowance */\n allowance_multiplier: number;\n /** A multiplier 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-specific ID that is using this Subscription\n */\n id: string;\n /** A name for the service-specific ID\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 accumulated coins at the start of each day */\n used: number;\n /** The coin cost of a 'unit' of storage 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 UnitGetResponse {\n /** The Unit's unique ID */\n id: string;\n /** The Unit's name */\n name: string;\n /** The Unit's oener (username) */\n owner_id: string;\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 interface ProductsGetTypesResponse {\n /** All the Product Types you have access to */\n product_types: ProductType[];\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 Organisations */\n organisations: OrganisationDetail[];\n}\n\nexport interface OrganisationUnitsGetResponse {\n organisation: OrganisationDetail;\n /** A list of Units\n */\n units: UnitDetail[];\n}\n\nexport interface UnitsGetResponse {\n /** A list of Units\n */\n units: OrganisationUnitsGetResponse[];\n}\n\nexport interface PersonalUnitPutResponse {\n /** The unit's Organisation. Used to identify the Default organisation */\n organisation_id: string;\n /** The unit's unique ID */\n id: string;\n}\n\nexport interface OrganisationUnitPostResponse {\n /** The unit's unique ID */\n id: string;\n}\n\nexport interface OrganisationGetDefaultResponse {\n /** The Default Organisation ID\n */\n id: string;\n /** The Default Organisation Name\n */\n name: 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 StateGetVersionResponse {\n /** The Account Server version. This is guaranteed to be a valid semantic version for official (tagged) images. The version value format for unofficial images is a string but otherwise undefined\n */\n version: string;\n}\n\nexport interface AsError {\n /** Brief error text that can be presented to the user */\n error: string;\n}\n"],"mappings":";;;;;;;;AA6BO,IAAM,iCAAiC;AAAA,EAC5C,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,MAAM;AAAA;AAaD,IAAM,8BAA8B;AAAA,EACzC,wCACE;AAAA,EACF,mCACE;AAAA;AAsDG,IAAM,yBAAyB;AAAA,EACpC,cAAc;AAAA;AAqDT,IAAM,uBAAuB;AAAA,EAClC,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,MAAM;AAAA;AAYD,IAAM,oBAAoB;AAAA,EAC/B,wCACE;AAAA,EACF,mCACE;AAAA;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/account-server-api.schemas.ts"],"sourcesContent":["/**\n * Generated by orval v6.6.0 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Products**, **Organisations**, **Units** and **Users**.\n\n * OpenAPI spec version: 0.1\n */\nexport type ProductPatchBodyBody = {\n /** The name you want to give the Product */\n name?: string;\n /** The Product's built-in coin allowance. */\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 not 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 provided.\n\nProject 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 service identity for the Product. Products are created for use on a specific service, like a Data Manager instance */\n service_id: number;\n /** The Type of Product. Storage subscriptions require an **Allowance** to be defined and the **Flavour** must not be provided.\n\nProject 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 not set this for Storage products */\n flavour?: UnitProductPostBodyBodyFlavour;\n /** The Product's coin allowance. 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 organisation */\n name: string;\n /** The name of the organisation owner. A user ID */\n owner: string;\n};\n\nexport interface UserDetail {\n /** The user identity (username) */\n id: string;\n}\n\nexport interface UserAccountDetail {\n user: UserDetail;\n /** Whether the caller has admin privilege */\n caller_has_admin_privilege: boolean;\n}\n\nexport interface UnitDetail {\n /** The Unit's unique identity */\n id: string;\n /** The Unit's name */\n name: string;\n /** The Unit's owner (a username) */\n owner_id: string;\n}\n\n/**\n * The kind of Service\n */\nexport type ServiceGetResponseKind = \"DATA_MANAGER\";\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const ServiceGetResponseKind = {\n DATA_MANAGER: \"DATA_MANAGER\" as ServiceGetResponseKind,\n};\n\nexport interface ServiceGetResponse {\n /** The unique ID of the Service */\n id: number;\n /** The kind of Service */\n kind: ServiceGetResponseKind;\n /** The name assigned to the Service */\n name?: string;\n}\n\nexport interface ServicesGetResponse {\n /** The list of known Services\n */\n services: ServiceGetResponse[];\n}\n\nexport interface OrganisationDetail {\n /** The Organisation's unique ID */\n id: string;\n /** The Organisation's name */\n name: string;\n /** The username of the Organisation's owner. Not all Organisations have an owner. The Default Organisation has no owner. */\n owner_id?: string;\n}\n\nexport interface ProductType {\n /** A product type, this is a unique string amongst all types known to the Account Server */\n type: string;\n /** A product flavour. Not all types have a flavour, those that do have a type-specific flavour string */\n flavour?: string;\n /** For a product that belongs to a specific service, the service that owns it is provided */\n service?: ServiceGetResponse;\n}\n\nexport type ProductInstanceDetailCoins = {\n /** The number of coins used\n */\n used: number;\n};\n\nexport interface ProductInstanceDetail {\n coins: ProductInstanceDetailCoins;\n}\n\n/**\n * The Product Type falvour. Not all products have flavours\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\n/**\n * The Product Type\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 /** The Product Service ID\n */\n service_id?: number;\n /** The Product Type\n */\n type: ProductDetailType;\n /** The Product Type falvour. Not all products have flavours\n */\n flavour?: ProductDetailFlavour;\n /** The name of the Product\n */\n name?: string;\n}\n\nexport interface ProductCoinsDetail {\n /** The billing allowance. When you exceed this during the current billing period the *cost multiplier* 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), excluding the coins that have been consumed for the current day */\n used: number;\n /** True if the product is operating at or beyond its coin limit. When it is authority to perform actions using the product are severely 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 billing period */\n billing_day: number;\n /** A multiplier applied to your coin usage within your allowance */\n allowance_multiplier: number;\n /** A multiplier 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-specific ID that is using this Subscription\n */\n id: string;\n /** A name for the service-specific ID\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 accumulated coins at the start of each day */\n used: number;\n /** The coin cost of a 'unit' of storage 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 type UserAccountGetResponse = UserAccountDetail;\n\nexport interface UnitGetResponse {\n /** The Unit's unique ID */\n id: string;\n /** The Unit's name */\n name: string;\n /** The Unit's oener (username) */\n owner_id: string;\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 interface ProductsGetTypesResponse {\n /** All the Product Types you have access to */\n product_types: ProductType[];\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 Organisations */\n organisations: OrganisationDetail[];\n}\n\nexport interface OrganisationUnitsGetResponse {\n organisation: OrganisationDetail;\n /** A list of Units\n */\n units: UnitDetail[];\n}\n\nexport interface UnitsGetResponse {\n /** A list of Units\n */\n units: OrganisationUnitsGetResponse[];\n}\n\nexport interface PersonalUnitPutResponse {\n /** The unit's Organisation. Used to identify the Default organisation */\n organisation_id: string;\n /** The unit's unique ID */\n id: string;\n}\n\nexport interface OrganisationUnitPostResponse {\n /** The unit's unique ID */\n id: string;\n}\n\nexport interface OrganisationGetDefaultResponse {\n /** The Default Organisation ID\n */\n id: string;\n /** The Default Organisation Name\n */\n name: 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 StateGetVersionResponse {\n /** The Account Server version. This is guaranteed to be a valid semantic version for official (tagged) images. The version value format for unofficial images is a string but otherwise undefined\n */\n version: string;\n}\n\nexport interface AsError {\n /** Brief error text that can be presented to the user */\n error: string;\n}\n"],"mappings":";;;;;;;;AA6BO,IAAM,iCAAiC;AAAA,EAC5C,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,MAAM;AAAA;AAaD,IAAM,8BAA8B;AAAA,EACzC,wCACE;AAAA,EACF,mCACE;AAAA;AA4DG,IAAM,yBAAyB;AAAA,EACpC,cAAc;AAAA;AAqDT,IAAM,uBAAuB;AAAA,EAClC,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,MAAM;AAAA;AAYD,IAAM,oBAAoB;AAAA,EAC/B,wCACE;AAAA,EACF,mCACE;AAAA;","names":[]}
|
|
@@ -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 {
|
|
3
|
+
import { V as customInstance, E as OrganisationsGetResponse, W as ErrorType, N as AsError, c as OrganisationPostBodyBody, L as OrganisationPostResponse, J as OrganisationGetDefaultResponse } from '../custom-instance-86dd5ce6';
|
|
4
4
|
import 'axios';
|
|
5
5
|
|
|
6
6
|
declare type SecondParameter<T extends (...args: any) => any> = T extends (config: any, args: infer P) => any ? P : never;
|
package/package.json
CHANGED
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 {
|
|
3
|
+
import { V as customInstance, B as ProductsGetTypesResponse, W as ErrorType, N as AsError, D as ProductsGetResponse, b as UnitProductPostBodyBody, y as UnitProductPostResponse, A as ProductUnitGetResponse, P as ProductPatchBodyBody } from '../custom-instance-86dd5ce6';
|
|
4
4
|
import 'axios';
|
|
5
5
|
|
|
6
6
|
declare type SecondParameter<T extends (...args: any) => any> = T extends (config: any, args: infer P) => any ? P : never;
|
package/service/service.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UseQueryOptions, QueryKey, UseQueryResult } from 'react-query';
|
|
2
|
-
import {
|
|
2
|
+
import { V as customInstance, h as ServicesGetResponse, W as ErrorType, N as AsError, g as ServiceGetResponse } from '../custom-instance-86dd5ce6';
|
|
3
3
|
import 'axios';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -87,6 +87,12 @@ export interface UserDetail {
|
|
|
87
87
|
id: string;
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
+
export interface UserAccountDetail {
|
|
91
|
+
user: UserDetail;
|
|
92
|
+
/** Whether the caller has admin privilege */
|
|
93
|
+
caller_has_admin_privilege: boolean;
|
|
94
|
+
}
|
|
95
|
+
|
|
90
96
|
export interface UnitDetail {
|
|
91
97
|
/** The Unit's unique identity */
|
|
92
98
|
id: string;
|
|
@@ -270,6 +276,8 @@ export interface ProductDmStorage {
|
|
|
270
276
|
coins: ProductCoinsDetail;
|
|
271
277
|
}
|
|
272
278
|
|
|
279
|
+
export type UserAccountGetResponse = UserAccountDetail;
|
|
280
|
+
|
|
273
281
|
export interface UnitGetResponse {
|
|
274
282
|
/** The Unit's unique ID */
|
|
275
283
|
id: string;
|
package/src/user/user.ts
CHANGED
|
@@ -18,7 +18,11 @@ import {
|
|
|
18
18
|
UseQueryResult,
|
|
19
19
|
QueryKey,
|
|
20
20
|
} from "react-query";
|
|
21
|
-
import type {
|
|
21
|
+
import type {
|
|
22
|
+
UserAccountGetResponse,
|
|
23
|
+
AsError,
|
|
24
|
+
UsersGetResponse,
|
|
25
|
+
} from "../account-server-api.schemas";
|
|
22
26
|
import { customInstance, ErrorType } from ".././custom-instance";
|
|
23
27
|
|
|
24
28
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -36,6 +40,52 @@ type SecondParameter<T extends (...args: any) => any> = T extends (
|
|
|
36
40
|
? P
|
|
37
41
|
: never;
|
|
38
42
|
|
|
43
|
+
/**
|
|
44
|
+
* Returns a summary of your account
|
|
45
|
+
|
|
46
|
+
* @summary Get information about your account
|
|
47
|
+
*/
|
|
48
|
+
export const getUserAccount = (
|
|
49
|
+
options?: SecondParameter<typeof customInstance>
|
|
50
|
+
) => {
|
|
51
|
+
return customInstance<UserAccountGetResponse>(
|
|
52
|
+
{ url: `/user/account`, method: "get" },
|
|
53
|
+
options
|
|
54
|
+
);
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export const getGetUserAccountQueryKey = () => [`/user/account`];
|
|
58
|
+
|
|
59
|
+
export const useGetUserAccount = <
|
|
60
|
+
TData = AsyncReturnType<typeof getUserAccount>,
|
|
61
|
+
TError = ErrorType<void | AsError>
|
|
62
|
+
>(options?: {
|
|
63
|
+
query?: UseQueryOptions<
|
|
64
|
+
AsyncReturnType<typeof getUserAccount>,
|
|
65
|
+
TError,
|
|
66
|
+
TData
|
|
67
|
+
>;
|
|
68
|
+
request?: SecondParameter<typeof customInstance>;
|
|
69
|
+
}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
|
|
70
|
+
const { query: queryOptions, request: requestOptions } = options || {};
|
|
71
|
+
|
|
72
|
+
const queryKey = queryOptions?.queryKey ?? getGetUserAccountQueryKey();
|
|
73
|
+
|
|
74
|
+
const queryFn: QueryFunction<AsyncReturnType<typeof getUserAccount>> = () =>
|
|
75
|
+
getUserAccount(requestOptions);
|
|
76
|
+
|
|
77
|
+
const query = useQuery<AsyncReturnType<typeof getUserAccount>, TError, TData>(
|
|
78
|
+
queryKey,
|
|
79
|
+
queryFn,
|
|
80
|
+
queryOptions
|
|
81
|
+
);
|
|
82
|
+
|
|
83
|
+
return {
|
|
84
|
+
queryKey,
|
|
85
|
+
...query,
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
|
|
39
89
|
/**
|
|
40
90
|
* Gets users in an Organisation. You have to be in the Organisation or an Admin user to use this endpoint
|
|
41
91
|
|
package/state/state.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UseQueryOptions, QueryKey, UseQueryResult } from 'react-query';
|
|
2
|
-
import {
|
|
2
|
+
import { V as customInstance, M as StateGetVersionResponse, W as ErrorType, N as AsError } from '../custom-instance-86dd5ce6';
|
|
3
3
|
import 'axios';
|
|
4
4
|
|
|
5
5
|
/**
|
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 {
|
|
3
|
+
import { V as customInstance, F as OrganisationUnitsGetResponse, W as ErrorType, N as AsError, O as OrganisationUnitPostBodyBody, I as OrganisationUnitPostResponse, x as UnitGetResponse, G as UnitsGetResponse, H as PersonalUnitPutResponse } from '../custom-instance-86dd5ce6';
|
|
4
4
|
import 'axios';
|
|
5
5
|
|
|
6
6
|
declare type SecondParameter<T extends (...args: any) => any> = T extends (config: any, args: infer P) => any ? P : never;
|
package/user/user.cjs
CHANGED
|
@@ -8,6 +8,19 @@ var _chunk3DXYUDZHcjs = require('../chunk-3DXYUDZH.cjs');
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
var _reactquery = require('react-query');
|
|
11
|
+
var getUserAccount = (options) => {
|
|
12
|
+
return _chunk3DXYUDZHcjs.customInstance.call(void 0, { url: `/user/account`, method: "get" }, options);
|
|
13
|
+
};
|
|
14
|
+
var getGetUserAccountQueryKey = () => [`/user/account`];
|
|
15
|
+
var useGetUserAccount = (options) => {
|
|
16
|
+
const { query: queryOptions, request: requestOptions } = options || {};
|
|
17
|
+
const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetUserAccountQueryKey()));
|
|
18
|
+
const queryFn = () => getUserAccount(requestOptions);
|
|
19
|
+
const query = _reactquery.useQuery.call(void 0, queryKey, queryFn, queryOptions);
|
|
20
|
+
return _chunk3DXYUDZHcjs.__spreadValues.call(void 0, {
|
|
21
|
+
queryKey
|
|
22
|
+
}, query);
|
|
23
|
+
};
|
|
11
24
|
var getOrganisationUsers = (orgid, options) => {
|
|
12
25
|
return _chunk3DXYUDZHcjs.customInstance.call(void 0, { url: `/organisation/${orgid}/user`, method: "get" }, options);
|
|
13
26
|
};
|
|
@@ -97,5 +110,8 @@ var useDeleteOrganisationUnitUser = (options) => {
|
|
|
97
110
|
|
|
98
111
|
|
|
99
112
|
|
|
100
|
-
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
exports.addOrganisationUnitUser = addOrganisationUnitUser; exports.addOrganisationUser = addOrganisationUser; exports.deleteOrganisationUnitUser = deleteOrganisationUnitUser; exports.deleteOrganisationUser = deleteOrganisationUser; exports.getGetOrganisationUnitUsersQueryKey = getGetOrganisationUnitUsersQueryKey; exports.getGetOrganisationUsersQueryKey = getGetOrganisationUsersQueryKey; exports.getGetUserAccountQueryKey = getGetUserAccountQueryKey; exports.getOrganisationUnitUsers = getOrganisationUnitUsers; exports.getOrganisationUsers = getOrganisationUsers; exports.getUserAccount = getUserAccount; exports.useAddOrganisationUnitUser = useAddOrganisationUnitUser; exports.useAddOrganisationUser = useAddOrganisationUser; exports.useDeleteOrganisationUnitUser = useDeleteOrganisationUnitUser; exports.useDeleteOrganisationUser = useDeleteOrganisationUser; exports.useGetOrganisationUnitUsers = useGetOrganisationUnitUsers; exports.useGetOrganisationUsers = useGetOrganisationUsers; exports.useGetUserAccount = useGetUserAccount;
|
|
101
117
|
//# sourceMappingURL=user.cjs.map
|
package/user/user.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/user/user.ts"],"names":[],"mappings":";;;;;;AAUA;AAAA;AAAA;AAAA;AAiCO,IAAM,uBAAuB,CAClC,OACA,YACG;AACH,SAAO,eACL,EAAE,KAAK,iBAAiB,cAAc,QAAQ,SAC9C;AAAA;AAIG,IAAM,kCAAkC,CAAC,UAAkB;AAAA,EAChE,iBAAiB;AAAA;AAGZ,IAAM,0BAA0B,CAIrC,OACA,YAQ2D;AAC3D,QAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW;AAEpE,QAAM,WACJ,8CAAc,aAAY,gCAAgC;AAE5D,QAAM,UAEF,MAAM,qBAAqB,OAAO;AAEtC,QAAM,QAAQ,SAIZ,UAAU,SAAS,iBAAE,SAAS,CAAC,CAAC,SAAU;AAE5C,SAAO;AAAA,IACL;AAAA,KACG;AAAA;AASA,IAAM,sBAAsB,CACjC,OACA,QACA,YACG;AACH,SAAO,eACL,EAAE,KAAK,iBAAiB,cAAc,UAAU,QAAQ,SACxD;AAAA;AAIG,IAAM,yBAAyB,CAGpC,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,WAAW;AAE1E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,OAAO,WAAW,SAAS;AAEnC,WAAO,oBAAoB,OAAO,QAAQ;AAAA;AAG5C,SAAO,YAKL,YAAY;AAAA;AAOT,IAAM,yBAAyB,CACpC,OACA,QACA,YACG;AACH,SAAO,eACL,EAAE,KAAK,iBAAiB,cAAc,UAAU,QAAQ,YACxD;AAAA;AAIG,IAAM,4BAA4B,CAGvC,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,WAAW;AAE1E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,OAAO,WAAW,SAAS;AAEnC,WAAO,uBAAuB,OAAO,QAAQ;AAAA;AAG/C,SAAO,YAKL,YAAY;AAAA;AAOT,IAAM,2BAA2B,CACtC,QACA,YACG;AACH,SAAO,eACL,EAAE,KAAK,SAAS,eAAe,QAAQ,SACvC;AAAA;AAIG,IAAM,sCAAsC,CAAC,WAAmB;AAAA,EACrE,SAAS;AAAA;AAGJ,IAAM,8BAA8B,CAIzC,QACA,YAQ2D;AAC3D,QAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW;AAEpE,QAAM,WACJ,8CAAc,aAAY,oCAAoC;AAEhE,QAAM,UAEF,MAAM,yBAAyB,QAAQ;AAE3C,QAAM,QAAQ,SAIZ,UAAU,SAAS,iBAAE,SAAS,CAAC,CAAC,UAAW;AAE7C,SAAO;AAAA,IACL;AAAA,KACG;AAAA;AAaA,IAAM,0BAA0B,CACrC,QACA,QACA,YACG;AACH,SAAO,eACL,EAAE,KAAK,SAAS,eAAe,UAAU,QAAQ,SACjD;AAAA;AAIG,IAAM,6BAA6B,CAGxC,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,WAAW;AAE1E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,QAAQ,WAAW,SAAS;AAEpC,WAAO,wBAAwB,QAAQ,QAAQ;AAAA;AAGjD,SAAO,YAKL,YAAY;AAAA;AAWT,IAAM,6BAA6B,CACxC,QACA,QACA,YACG;AACH,SAAO,eACL,EAAE,KAAK,SAAS,eAAe,UAAU,QAAQ,YACjD;AAAA;AAIG,IAAM,gCAAgC,CAG3C,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,WAAW;AAE1E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,QAAQ,WAAW,SAAS;AAEpC,WAAO,2BAA2B,QAAQ,QAAQ;AAAA;AAGpD,SAAO,YAKL,YAAY;AAAA","sourcesContent":["/**\n * Generated by orval v6.6.0 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **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\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype AsyncReturnType<T extends (...args: any) => Promise<any>> = T extends (\n ...args: any\n) => Promise<infer R>\n ? R\n : any;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\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. You have to be in the Organisation or an Admin user to use this endpoint\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. You have to be in the Organisation or an Admin user to use this endpoint\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 { url: `/organisation/${orgid}/user/${userid}`, method: \"put\" },\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 from an organisation. You have to be in the Organisation or an Admin user to use this endpoint\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 { url: `/organisation/${orgid}/user/${userid}`, method: \"delete\" },\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. You have to be in the Organisation or Unit or an Admin user to use this endpoint\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 Organisational Unit.\n\nUsers cannot be added to **Independent Units** (Units that are part of the ***Default** Organisation).\n\nYou have to be in the Organisation or Unit or an Admin user to use this endpoint\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\" },\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 from an Organisational Unit.\n\nUsers cannot be removed from **Independent Units** (Units that are part of the ***Default** Organisation).\n\nYou have to be in the Organisation or Unit or an Admin user to use this endpoint\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 { url: `/unit/${unitid}/user/${userid}`, method: \"delete\" },\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"]}
|
|
1
|
+
{"version":3,"sources":["../../src/user/user.ts"],"names":[],"mappings":";;;;;;AAUA;AAAA;AAAA;AAAA;AAqCO,IAAM,iBAAiB,CAC5B,YACG;AACH,SAAO,eACL,EAAE,KAAK,iBAAiB,QAAQ,SAChC;AAAA;AAIG,IAAM,4BAA4B,MAAM,CAAC;AAEzC,IAAM,oBAAoB,CAG/B,YAO4D;AAC5D,QAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW;AAEpE,QAAM,WAAW,8CAAc,aAAY;AAE3C,QAAM,UAAiE,MACrE,eAAe;AAEjB,QAAM,QAAQ,SACZ,UACA,SACA;AAGF,SAAO;AAAA,IACL;AAAA,KACG;AAAA;AASA,IAAM,uBAAuB,CAClC,OACA,YACG;AACH,SAAO,eACL,EAAE,KAAK,iBAAiB,cAAc,QAAQ,SAC9C;AAAA;AAIG,IAAM,kCAAkC,CAAC,UAAkB;AAAA,EAChE,iBAAiB;AAAA;AAGZ,IAAM,0BAA0B,CAIrC,OACA,YAQ2D;AAC3D,QAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW;AAEpE,QAAM,WACJ,8CAAc,aAAY,gCAAgC;AAE5D,QAAM,UAEF,MAAM,qBAAqB,OAAO;AAEtC,QAAM,QAAQ,SAIZ,UAAU,SAAS,iBAAE,SAAS,CAAC,CAAC,SAAU;AAE5C,SAAO;AAAA,IACL;AAAA,KACG;AAAA;AASA,IAAM,sBAAsB,CACjC,OACA,QACA,YACG;AACH,SAAO,eACL,EAAE,KAAK,iBAAiB,cAAc,UAAU,QAAQ,SACxD;AAAA;AAIG,IAAM,yBAAyB,CAGpC,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,WAAW;AAE1E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,OAAO,WAAW,SAAS;AAEnC,WAAO,oBAAoB,OAAO,QAAQ;AAAA;AAG5C,SAAO,YAKL,YAAY;AAAA;AAOT,IAAM,yBAAyB,CACpC,OACA,QACA,YACG;AACH,SAAO,eACL,EAAE,KAAK,iBAAiB,cAAc,UAAU,QAAQ,YACxD;AAAA;AAIG,IAAM,4BAA4B,CAGvC,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,WAAW;AAE1E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,OAAO,WAAW,SAAS;AAEnC,WAAO,uBAAuB,OAAO,QAAQ;AAAA;AAG/C,SAAO,YAKL,YAAY;AAAA;AAOT,IAAM,2BAA2B,CACtC,QACA,YACG;AACH,SAAO,eACL,EAAE,KAAK,SAAS,eAAe,QAAQ,SACvC;AAAA;AAIG,IAAM,sCAAsC,CAAC,WAAmB;AAAA,EACrE,SAAS;AAAA;AAGJ,IAAM,8BAA8B,CAIzC,QACA,YAQ2D;AAC3D,QAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW;AAEpE,QAAM,WACJ,8CAAc,aAAY,oCAAoC;AAEhE,QAAM,UAEF,MAAM,yBAAyB,QAAQ;AAE3C,QAAM,QAAQ,SAIZ,UAAU,SAAS,iBAAE,SAAS,CAAC,CAAC,UAAW;AAE7C,SAAO;AAAA,IACL;AAAA,KACG;AAAA;AAaA,IAAM,0BAA0B,CACrC,QACA,QACA,YACG;AACH,SAAO,eACL,EAAE,KAAK,SAAS,eAAe,UAAU,QAAQ,SACjD;AAAA;AAIG,IAAM,6BAA6B,CAGxC,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,WAAW;AAE1E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,QAAQ,WAAW,SAAS;AAEpC,WAAO,wBAAwB,QAAQ,QAAQ;AAAA;AAGjD,SAAO,YAKL,YAAY;AAAA;AAWT,IAAM,6BAA6B,CACxC,QACA,QACA,YACG;AACH,SAAO,eACL,EAAE,KAAK,SAAS,eAAe,UAAU,QAAQ,YACjD;AAAA;AAIG,IAAM,gCAAgC,CAG3C,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,WAAW;AAE1E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,QAAQ,WAAW,SAAS;AAEpC,WAAO,2BAA2B,QAAQ,QAAQ;AAAA;AAGpD,SAAO,YAKL,YAAY;AAAA","sourcesContent":["/**\n * Generated by orval v6.6.0 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **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 UserAccountGetResponse,\n AsError,\n UsersGetResponse,\n} from \"../account-server-api.schemas\";\nimport { customInstance, ErrorType } from \".././custom-instance\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype AsyncReturnType<T extends (...args: any) => Promise<any>> = T extends (\n ...args: any\n) => Promise<infer R>\n ? R\n : any;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\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 * Returns a summary of your account\n\n * @summary Get information about your account\n */\nexport const getUserAccount = (\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<UserAccountGetResponse>(\n { url: `/user/account`, method: \"get\" },\n options\n );\n};\n\nexport const getGetUserAccountQueryKey = () => [`/user/account`];\n\nexport const useGetUserAccount = <\n TData = AsyncReturnType<typeof getUserAccount>,\n TError = ErrorType<void | AsError>\n>(options?: {\n query?: UseQueryOptions<\n AsyncReturnType<typeof getUserAccount>,\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 ?? getGetUserAccountQueryKey();\n\n const queryFn: QueryFunction<AsyncReturnType<typeof getUserAccount>> = () =>\n getUserAccount(requestOptions);\n\n const query = useQuery<AsyncReturnType<typeof getUserAccount>, TError, TData>(\n queryKey,\n queryFn,\n queryOptions\n );\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Gets users in an Organisation. You have to be in the Organisation or an Admin user to use this endpoint\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. You have to be in the Organisation or an Admin user to use this endpoint\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 { url: `/organisation/${orgid}/user/${userid}`, method: \"put\" },\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 from an organisation. You have to be in the Organisation or an Admin user to use this endpoint\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 { url: `/organisation/${orgid}/user/${userid}`, method: \"delete\" },\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. You have to be in the Organisation or Unit or an Admin user to use this endpoint\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 Organisational Unit.\n\nUsers cannot be added to **Independent Units** (Units that are part of the ***Default** Organisation).\n\nYou have to be in the Organisation or Unit or an Admin user to use this endpoint\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\" },\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 from an Organisational Unit.\n\nUsers cannot be removed from **Independent Units** (Units that are part of the ***Default** Organisation).\n\nYou have to be in the Organisation or Unit or an Admin user to use this endpoint\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 { url: `/unit/${unitid}/user/${userid}`, method: \"delete\" },\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"]}
|
package/user/user.d.ts
CHANGED
|
@@ -1,9 +1,22 @@
|
|
|
1
1
|
import * as react_query from 'react-query';
|
|
2
2
|
import { UseQueryOptions, QueryKey, UseQueryResult, UseMutationOptions } from 'react-query';
|
|
3
|
-
import {
|
|
3
|
+
import { V as customInstance, e as UserAccountDetail, W as ErrorType, N as AsError, K as UsersGetResponse } from '../custom-instance-86dd5ce6';
|
|
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;
|
|
7
|
+
/**
|
|
8
|
+
* Returns a summary of your account
|
|
9
|
+
|
|
10
|
+
* @summary Get information about your account
|
|
11
|
+
*/
|
|
12
|
+
declare const getUserAccount: (options?: SecondParameter<typeof customInstance>) => Promise<UserAccountDetail>;
|
|
13
|
+
declare const getGetUserAccountQueryKey: () => string[];
|
|
14
|
+
declare const useGetUserAccount: <TData = UserAccountDetail, TError = ErrorType<void | AsError>>(options?: {
|
|
15
|
+
query?: UseQueryOptions<UserAccountDetail, TError, TData, QueryKey> | undefined;
|
|
16
|
+
request?: SecondParameter<typeof customInstance>;
|
|
17
|
+
} | undefined) => UseQueryResult<TData, TError> & {
|
|
18
|
+
queryKey: QueryKey;
|
|
19
|
+
};
|
|
7
20
|
/**
|
|
8
21
|
* Gets users in an Organisation. You have to be in the Organisation or an Admin user to use this endpoint
|
|
9
22
|
|
|
@@ -103,4 +116,4 @@ declare const useDeleteOrganisationUnitUser: <TError = ErrorType<AsError>, TCont
|
|
|
103
116
|
userid: string;
|
|
104
117
|
}, TContext>;
|
|
105
118
|
|
|
106
|
-
export { addOrganisationUnitUser, addOrganisationUser, deleteOrganisationUnitUser, deleteOrganisationUser, getGetOrganisationUnitUsersQueryKey, getGetOrganisationUsersQueryKey, getOrganisationUnitUsers, getOrganisationUsers, useAddOrganisationUnitUser, useAddOrganisationUser, useDeleteOrganisationUnitUser, useDeleteOrganisationUser, useGetOrganisationUnitUsers, useGetOrganisationUsers };
|
|
119
|
+
export { addOrganisationUnitUser, addOrganisationUser, deleteOrganisationUnitUser, deleteOrganisationUser, getGetOrganisationUnitUsersQueryKey, getGetOrganisationUsersQueryKey, getGetUserAccountQueryKey, getOrganisationUnitUsers, getOrganisationUsers, getUserAccount, useAddOrganisationUnitUser, useAddOrganisationUser, useDeleteOrganisationUnitUser, useDeleteOrganisationUser, useGetOrganisationUnitUsers, useGetOrganisationUsers, useGetUserAccount };
|
package/user/user.js
CHANGED
|
@@ -8,6 +8,19 @@ import {
|
|
|
8
8
|
useQuery,
|
|
9
9
|
useMutation
|
|
10
10
|
} from "react-query";
|
|
11
|
+
var getUserAccount = (options) => {
|
|
12
|
+
return customInstance({ url: `/user/account`, method: "get" }, options);
|
|
13
|
+
};
|
|
14
|
+
var getGetUserAccountQueryKey = () => [`/user/account`];
|
|
15
|
+
var useGetUserAccount = (options) => {
|
|
16
|
+
const { query: queryOptions, request: requestOptions } = options || {};
|
|
17
|
+
const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetUserAccountQueryKey();
|
|
18
|
+
const queryFn = () => getUserAccount(requestOptions);
|
|
19
|
+
const query = useQuery(queryKey, queryFn, queryOptions);
|
|
20
|
+
return __spreadValues({
|
|
21
|
+
queryKey
|
|
22
|
+
}, query);
|
|
23
|
+
};
|
|
11
24
|
var getOrganisationUsers = (orgid, options) => {
|
|
12
25
|
return customInstance({ url: `/organisation/${orgid}/user`, method: "get" }, options);
|
|
13
26
|
};
|
|
@@ -89,13 +102,16 @@ export {
|
|
|
89
102
|
deleteOrganisationUser,
|
|
90
103
|
getGetOrganisationUnitUsersQueryKey,
|
|
91
104
|
getGetOrganisationUsersQueryKey,
|
|
105
|
+
getGetUserAccountQueryKey,
|
|
92
106
|
getOrganisationUnitUsers,
|
|
93
107
|
getOrganisationUsers,
|
|
108
|
+
getUserAccount,
|
|
94
109
|
useAddOrganisationUnitUser,
|
|
95
110
|
useAddOrganisationUser,
|
|
96
111
|
useDeleteOrganisationUnitUser,
|
|
97
112
|
useDeleteOrganisationUser,
|
|
98
113
|
useGetOrganisationUnitUsers,
|
|
99
|
-
useGetOrganisationUsers
|
|
114
|
+
useGetOrganisationUsers,
|
|
115
|
+
useGetUserAccount
|
|
100
116
|
};
|
|
101
117
|
//# sourceMappingURL=user.js.map
|
package/user/user.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/user/user.ts"],"sourcesContent":["/**\n * Generated by orval v6.6.0 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **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\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype AsyncReturnType<T extends (...args: any) => Promise<any>> = T extends (\n ...args: any\n) => Promise<infer R>\n ? R\n : any;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\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. You have to be in the Organisation or an Admin user to use this endpoint\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. You have to be in the Organisation or an Admin user to use this endpoint\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 { url: `/organisation/${orgid}/user/${userid}`, method: \"put\" },\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 from an organisation. You have to be in the Organisation or an Admin user to use this endpoint\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 { url: `/organisation/${orgid}/user/${userid}`, method: \"delete\" },\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. You have to be in the Organisation or Unit or an Admin user to use this endpoint\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 Organisational Unit.\n\nUsers cannot be added to **Independent Units** (Units that are part of the ***Default** Organisation).\n\nYou have to be in the Organisation or Unit or an Admin user to use this endpoint\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\" },\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 from an Organisational Unit.\n\nUsers cannot be removed from **Independent Units** (Units that are part of the ***Default** Organisation).\n\nYou have to be in the Organisation or Unit or an Admin user to use this endpoint\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 { url: `/unit/${unitid}/user/${userid}`, method: \"delete\" },\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"],"mappings":";;;;;;AAUA;AAAA;AAAA;AAAA;AAiCO,IAAM,uBAAuB,CAClC,OACA,YACG;AACH,SAAO,eACL,EAAE,KAAK,iBAAiB,cAAc,QAAQ,SAC9C;AAAA;AAIG,IAAM,kCAAkC,CAAC,UAAkB;AAAA,EAChE,iBAAiB;AAAA;AAGZ,IAAM,0BAA0B,CAIrC,OACA,YAQ2D;AAC3D,QAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW;AAEpE,QAAM,WACJ,8CAAc,aAAY,gCAAgC;AAE5D,QAAM,UAEF,MAAM,qBAAqB,OAAO;AAEtC,QAAM,QAAQ,SAIZ,UAAU,SAAS,iBAAE,SAAS,CAAC,CAAC,SAAU;AAE5C,SAAO;AAAA,IACL;AAAA,KACG;AAAA;AASA,IAAM,sBAAsB,CACjC,OACA,QACA,YACG;AACH,SAAO,eACL,EAAE,KAAK,iBAAiB,cAAc,UAAU,QAAQ,SACxD;AAAA;AAIG,IAAM,yBAAyB,CAGpC,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,WAAW;AAE1E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,OAAO,WAAW,SAAS;AAEnC,WAAO,oBAAoB,OAAO,QAAQ;AAAA;AAG5C,SAAO,YAKL,YAAY;AAAA;AAOT,IAAM,yBAAyB,CACpC,OACA,QACA,YACG;AACH,SAAO,eACL,EAAE,KAAK,iBAAiB,cAAc,UAAU,QAAQ,YACxD;AAAA;AAIG,IAAM,4BAA4B,CAGvC,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,WAAW;AAE1E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,OAAO,WAAW,SAAS;AAEnC,WAAO,uBAAuB,OAAO,QAAQ;AAAA;AAG/C,SAAO,YAKL,YAAY;AAAA;AAOT,IAAM,2BAA2B,CACtC,QACA,YACG;AACH,SAAO,eACL,EAAE,KAAK,SAAS,eAAe,QAAQ,SACvC;AAAA;AAIG,IAAM,sCAAsC,CAAC,WAAmB;AAAA,EACrE,SAAS;AAAA;AAGJ,IAAM,8BAA8B,CAIzC,QACA,YAQ2D;AAC3D,QAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW;AAEpE,QAAM,WACJ,8CAAc,aAAY,oCAAoC;AAEhE,QAAM,UAEF,MAAM,yBAAyB,QAAQ;AAE3C,QAAM,QAAQ,SAIZ,UAAU,SAAS,iBAAE,SAAS,CAAC,CAAC,UAAW;AAE7C,SAAO;AAAA,IACL;AAAA,KACG;AAAA;AAaA,IAAM,0BAA0B,CACrC,QACA,QACA,YACG;AACH,SAAO,eACL,EAAE,KAAK,SAAS,eAAe,UAAU,QAAQ,SACjD;AAAA;AAIG,IAAM,6BAA6B,CAGxC,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,WAAW;AAE1E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,QAAQ,WAAW,SAAS;AAEpC,WAAO,wBAAwB,QAAQ,QAAQ;AAAA;AAGjD,SAAO,YAKL,YAAY;AAAA;AAWT,IAAM,6BAA6B,CACxC,QACA,QACA,YACG;AACH,SAAO,eACL,EAAE,KAAK,SAAS,eAAe,UAAU,QAAQ,YACjD;AAAA;AAIG,IAAM,gCAAgC,CAG3C,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,WAAW;AAE1E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,QAAQ,WAAW,SAAS;AAEpC,WAAO,2BAA2B,QAAQ,QAAQ;AAAA;AAGpD,SAAO,YAKL,YAAY;AAAA;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/user/user.ts"],"sourcesContent":["/**\n * Generated by orval v6.6.0 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **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 UserAccountGetResponse,\n AsError,\n UsersGetResponse,\n} from \"../account-server-api.schemas\";\nimport { customInstance, ErrorType } from \".././custom-instance\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype AsyncReturnType<T extends (...args: any) => Promise<any>> = T extends (\n ...args: any\n) => Promise<infer R>\n ? R\n : any;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\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 * Returns a summary of your account\n\n * @summary Get information about your account\n */\nexport const getUserAccount = (\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<UserAccountGetResponse>(\n { url: `/user/account`, method: \"get\" },\n options\n );\n};\n\nexport const getGetUserAccountQueryKey = () => [`/user/account`];\n\nexport const useGetUserAccount = <\n TData = AsyncReturnType<typeof getUserAccount>,\n TError = ErrorType<void | AsError>\n>(options?: {\n query?: UseQueryOptions<\n AsyncReturnType<typeof getUserAccount>,\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 ?? getGetUserAccountQueryKey();\n\n const queryFn: QueryFunction<AsyncReturnType<typeof getUserAccount>> = () =>\n getUserAccount(requestOptions);\n\n const query = useQuery<AsyncReturnType<typeof getUserAccount>, TError, TData>(\n queryKey,\n queryFn,\n queryOptions\n );\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Gets users in an Organisation. You have to be in the Organisation or an Admin user to use this endpoint\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. You have to be in the Organisation or an Admin user to use this endpoint\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 { url: `/organisation/${orgid}/user/${userid}`, method: \"put\" },\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 from an organisation. You have to be in the Organisation or an Admin user to use this endpoint\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 { url: `/organisation/${orgid}/user/${userid}`, method: \"delete\" },\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. You have to be in the Organisation or Unit or an Admin user to use this endpoint\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 Organisational Unit.\n\nUsers cannot be added to **Independent Units** (Units that are part of the ***Default** Organisation).\n\nYou have to be in the Organisation or Unit or an Admin user to use this endpoint\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\" },\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 from an Organisational Unit.\n\nUsers cannot be removed from **Independent Units** (Units that are part of the ***Default** Organisation).\n\nYou have to be in the Organisation or Unit or an Admin user to use this endpoint\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 { url: `/unit/${unitid}/user/${userid}`, method: \"delete\" },\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"],"mappings":";;;;;;AAUA;AAAA;AAAA;AAAA;AAqCO,IAAM,iBAAiB,CAC5B,YACG;AACH,SAAO,eACL,EAAE,KAAK,iBAAiB,QAAQ,SAChC;AAAA;AAIG,IAAM,4BAA4B,MAAM,CAAC;AAEzC,IAAM,oBAAoB,CAG/B,YAO4D;AAC5D,QAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW;AAEpE,QAAM,WAAW,8CAAc,aAAY;AAE3C,QAAM,UAAiE,MACrE,eAAe;AAEjB,QAAM,QAAQ,SACZ,UACA,SACA;AAGF,SAAO;AAAA,IACL;AAAA,KACG;AAAA;AASA,IAAM,uBAAuB,CAClC,OACA,YACG;AACH,SAAO,eACL,EAAE,KAAK,iBAAiB,cAAc,QAAQ,SAC9C;AAAA;AAIG,IAAM,kCAAkC,CAAC,UAAkB;AAAA,EAChE,iBAAiB;AAAA;AAGZ,IAAM,0BAA0B,CAIrC,OACA,YAQ2D;AAC3D,QAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW;AAEpE,QAAM,WACJ,8CAAc,aAAY,gCAAgC;AAE5D,QAAM,UAEF,MAAM,qBAAqB,OAAO;AAEtC,QAAM,QAAQ,SAIZ,UAAU,SAAS,iBAAE,SAAS,CAAC,CAAC,SAAU;AAE5C,SAAO;AAAA,IACL;AAAA,KACG;AAAA;AASA,IAAM,sBAAsB,CACjC,OACA,QACA,YACG;AACH,SAAO,eACL,EAAE,KAAK,iBAAiB,cAAc,UAAU,QAAQ,SACxD;AAAA;AAIG,IAAM,yBAAyB,CAGpC,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,WAAW;AAE1E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,OAAO,WAAW,SAAS;AAEnC,WAAO,oBAAoB,OAAO,QAAQ;AAAA;AAG5C,SAAO,YAKL,YAAY;AAAA;AAOT,IAAM,yBAAyB,CACpC,OACA,QACA,YACG;AACH,SAAO,eACL,EAAE,KAAK,iBAAiB,cAAc,UAAU,QAAQ,YACxD;AAAA;AAIG,IAAM,4BAA4B,CAGvC,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,WAAW;AAE1E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,OAAO,WAAW,SAAS;AAEnC,WAAO,uBAAuB,OAAO,QAAQ;AAAA;AAG/C,SAAO,YAKL,YAAY;AAAA;AAOT,IAAM,2BAA2B,CACtC,QACA,YACG;AACH,SAAO,eACL,EAAE,KAAK,SAAS,eAAe,QAAQ,SACvC;AAAA;AAIG,IAAM,sCAAsC,CAAC,WAAmB;AAAA,EACrE,SAAS;AAAA;AAGJ,IAAM,8BAA8B,CAIzC,QACA,YAQ2D;AAC3D,QAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW;AAEpE,QAAM,WACJ,8CAAc,aAAY,oCAAoC;AAEhE,QAAM,UAEF,MAAM,yBAAyB,QAAQ;AAE3C,QAAM,QAAQ,SAIZ,UAAU,SAAS,iBAAE,SAAS,CAAC,CAAC,UAAW;AAE7C,SAAO;AAAA,IACL;AAAA,KACG;AAAA;AAaA,IAAM,0BAA0B,CACrC,QACA,QACA,YACG;AACH,SAAO,eACL,EAAE,KAAK,SAAS,eAAe,UAAU,QAAQ,SACjD;AAAA;AAIG,IAAM,6BAA6B,CAGxC,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,WAAW;AAE1E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,QAAQ,WAAW,SAAS;AAEpC,WAAO,wBAAwB,QAAQ,QAAQ;AAAA;AAGjD,SAAO,YAKL,YAAY;AAAA;AAWT,IAAM,6BAA6B,CACxC,QACA,QACA,YACG;AACH,SAAO,eACL,EAAE,KAAK,SAAS,eAAe,UAAU,QAAQ,YACjD;AAAA;AAIG,IAAM,gCAAgC,CAG3C,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,WAAW;AAE1E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,QAAQ,WAAW,SAAS;AAEpC,WAAO,2BAA2B,QAAQ,QAAQ;AAAA;AAGpD,SAAO,YAKL,YAAY;AAAA;","names":[]}
|