@squonk/account-server-client 0.1.20-rc.1 → 0.1.21

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.
@@ -226,11 +226,6 @@ interface ProductDmStorage {
226
226
  storage: ProductDmStorageDetail;
227
227
  coins: ProductCoinsDetail;
228
228
  }
229
- interface UnitsGetResponse {
230
- /** A list of Units
231
- */
232
- units: OrganisationUnitsGetResponse[];
233
- }
234
229
  interface UnitGetResponse {
235
230
  /** The Unit's unique ID */
236
231
  id: string;
@@ -270,6 +265,11 @@ interface OrganisationUnitsGetResponse {
270
265
  */
271
266
  units: UnitDetail[];
272
267
  }
268
+ interface UnitsGetResponse {
269
+ /** A list of Units
270
+ */
271
+ units: OrganisationUnitsGetResponse[];
272
+ }
273
273
  interface PersonalUnitPutResponse {
274
274
  /** The unit's Organisation. Used to identify the Default organisation */
275
275
  organisation_id: string;
@@ -299,6 +299,11 @@ interface OrganisationPostResponse {
299
299
  /** The Organisation's unique ID */
300
300
  id: string;
301
301
  }
302
+ interface StateGetVersionResponse {
303
+ /** 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
304
+ */
305
+ version: string;
306
+ }
302
307
  interface AsError {
303
308
  /** Brief error text that can be presented to the user */
304
309
  error: string;
@@ -319,4 +324,4 @@ declare const setBaseUrl: (baseUrl: string) => void;
319
324
  declare const customInstance: <TReturn>(config: AxiosRequestConfig, options?: AxiosRequestConfig<any> | undefined) => Promise<TReturn>;
320
325
  declare type ErrorType<TError> = AxiosError<TError>;
321
326
 
322
- export { ProductsGetTypesResponse as A, ProductsGetResponseProductsItem as B, ProductsGetResponse as C, OrganisationsGetResponse as D, OrganisationUnitsGetResponse as E, PersonalUnitPutResponse as F, OrganisationUnitPostResponse as G, OrganisationGetDefaultResponse as H, UsersGetResponse as I, OrganisationPostResponse as J, AsError as K, AXIOS_INSTANCE as L, setAuthToken as M, setBaseUrl as N, OrganisationUnitPostBodyBody as O, ProductPatchBodyBody as P, customInstance as Q, ErrorType as R, ServiceGetResponseKind as S, UnitProductPostBodyBodyFlavour as U, UnitProductPostBodyBodyType as a, UnitProductPostBodyBody as b, OrganisationPostBodyBody as c, UserDetail as d, UnitDetail as e, ServiceGetResponse as f, ServicesGetResponse as g, OrganisationDetail as h, ProductType as i, ProductInstanceDetailCoins as j, ProductInstanceDetail as k, ProductDetailFlavour as l, ProductDetailType as m, ProductDetail as n, ProductCoinsDetail as o, ProductClaimDetail as p, ProductDmStorageDetailCoins as q, ProductDmStorageDetailSize as r, ProductDmStorageDetail as s, ProductDmProjectTier as t, ProductDmStorage as u, UnitsGetResponse as v, UnitGetResponse as w, UnitProductPostResponse as x, ProductUnitGetResponseProduct as y, ProductUnitGetResponse as z };
327
+ export { ProductsGetResponseProductsItem as A, ProductsGetResponse as B, OrganisationsGetResponse as C, OrganisationUnitsGetResponse as D, UnitsGetResponse as E, PersonalUnitPutResponse as F, OrganisationUnitPostResponse as G, OrganisationGetDefaultResponse as H, UsersGetResponse as I, OrganisationPostResponse as J, StateGetVersionResponse as K, AsError as L, AXIOS_INSTANCE as M, setAuthToken as N, OrganisationUnitPostBodyBody as O, ProductPatchBodyBody as P, setBaseUrl as Q, customInstance as R, ServiceGetResponseKind as S, ErrorType as T, UnitProductPostBodyBodyFlavour as U, UnitProductPostBodyBodyType as a, UnitProductPostBodyBody as b, OrganisationPostBodyBody as c, UserDetail as d, UnitDetail as e, ServiceGetResponse as f, ServicesGetResponse as g, OrganisationDetail as h, ProductType as i, ProductInstanceDetailCoins as j, ProductInstanceDetail as k, ProductDetailFlavour as l, ProductDetailType as m, ProductDetail as n, ProductCoinsDetail as o, ProductClaimDetail as p, ProductDmStorageDetailCoins as q, ProductDmStorageDetailSize as r, ProductDmStorageDetail as s, ProductDmProjectTier as t, ProductDmStorage as u, UnitGetResponse as v, UnitProductPostResponse as w, ProductUnitGetResponseProduct as x, ProductUnitGetResponse as y, ProductsGetTypesResponse 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 UnitsGetResponse {\n /** A list of Units\n */\n units: OrganisationUnitsGetResponse[];\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 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 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;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"]}
package/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export { L as AXIOS_INSTANCE, K as AsError, R as ErrorType, h as OrganisationDetail, H as OrganisationGetDefaultResponse, c as OrganisationPostBodyBody, J as OrganisationPostResponse, O as OrganisationUnitPostBodyBody, G as OrganisationUnitPostResponse, E as OrganisationUnitsGetResponse, D as OrganisationsGetResponse, F as PersonalUnitPutResponse, p as ProductClaimDetail, o as ProductCoinsDetail, n as ProductDetail, l as ProductDetailFlavour, m as ProductDetailType, t as ProductDmProjectTier, u as ProductDmStorage, s as ProductDmStorageDetail, q as ProductDmStorageDetailCoins, r as ProductDmStorageDetailSize, k as ProductInstanceDetail, j as ProductInstanceDetailCoins, P as ProductPatchBodyBody, i as ProductType, z as ProductUnitGetResponse, y as ProductUnitGetResponseProduct, C as ProductsGetResponse, B as ProductsGetResponseProductsItem, A as ProductsGetTypesResponse, f as ServiceGetResponse, S as ServiceGetResponseKind, g as ServicesGetResponse, e as UnitDetail, w as UnitGetResponse, b as UnitProductPostBodyBody, U as UnitProductPostBodyBodyFlavour, a as UnitProductPostBodyBodyType, x as UnitProductPostResponse, v as UnitsGetResponse, d as UserDetail, I as UsersGetResponse, Q as customInstance, M as setAuthToken, N as setBaseUrl } from './custom-instance-90720a09';
1
+ export { M as AXIOS_INSTANCE, L as AsError, T as ErrorType, h as OrganisationDetail, H as OrganisationGetDefaultResponse, c as OrganisationPostBodyBody, J as OrganisationPostResponse, O as OrganisationUnitPostBodyBody, G as OrganisationUnitPostResponse, D as OrganisationUnitsGetResponse, C as OrganisationsGetResponse, F as PersonalUnitPutResponse, p as ProductClaimDetail, o as ProductCoinsDetail, n as ProductDetail, l as ProductDetailFlavour, m as ProductDetailType, t as ProductDmProjectTier, u as ProductDmStorage, s as ProductDmStorageDetail, q as ProductDmStorageDetailCoins, r as ProductDmStorageDetailSize, k as ProductInstanceDetail, j as ProductInstanceDetailCoins, P as ProductPatchBodyBody, i as ProductType, y as ProductUnitGetResponse, x as ProductUnitGetResponseProduct, B as ProductsGetResponse, A as ProductsGetResponseProductsItem, z as ProductsGetTypesResponse, f as ServiceGetResponse, S as ServiceGetResponseKind, g as ServicesGetResponse, K as StateGetVersionResponse, e as UnitDetail, v as UnitGetResponse, b as UnitProductPostBodyBody, U as UnitProductPostBodyBodyFlavour, a as UnitProductPostBodyBodyType, w as UnitProductPostResponse, E as UnitsGetResponse, d as UserDetail, I as UsersGetResponse, R as customInstance, N as setAuthToken, Q as setBaseUrl } from './custom-instance-688b0e9e';
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 UnitsGetResponse {\n /** A list of Units\n */\n units: OrganisationUnitsGetResponse[];\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 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 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 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,6 +1,6 @@
1
1
  import * as react_query from 'react-query';
2
2
  import { UseQueryOptions, QueryKey, UseQueryResult, UseMutationOptions } from 'react-query';
3
- import { Q as customInstance, D as OrganisationsGetResponse, R as ErrorType, K as AsError, c as OrganisationPostBodyBody, J as OrganisationPostResponse, H as OrganisationGetDefaultResponse } from '../custom-instance-90720a09';
3
+ import { R as customInstance, C as OrganisationsGetResponse, T as ErrorType, L as AsError, c as OrganisationPostBodyBody, J as OrganisationPostResponse, H as OrganisationGetDefaultResponse } from '../custom-instance-688b0e9e';
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
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.1.20-rc.1",
2
+ "version": "0.1.21",
3
3
  "author": "Oliver Dudgeon",
4
4
  "name": "@squonk/account-server-client",
5
5
  "private": false,
@@ -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 { Q as customInstance, A as ProductsGetTypesResponse, R as ErrorType, K as AsError, C as ProductsGetResponse, b as UnitProductPostBodyBody, x as UnitProductPostResponse, z as ProductUnitGetResponse, P as ProductPatchBodyBody } from '../custom-instance-90720a09';
3
+ import { R as customInstance, z as ProductsGetTypesResponse, T as ErrorType, L as AsError, B as ProductsGetResponse, b as UnitProductPostBodyBody, w as UnitProductPostResponse, y as ProductUnitGetResponse, P as ProductPatchBodyBody } from '../custom-instance-688b0e9e';
4
4
  import 'axios';
5
5
 
6
6
  declare type SecondParameter<T extends (...args: any) => any> = T extends (config: any, args: infer P) => any ? P : never;
@@ -1,5 +1,5 @@
1
1
  import { UseQueryOptions, QueryKey, UseQueryResult } from 'react-query';
2
- import { Q as customInstance, g as ServicesGetResponse, R as ErrorType, K as AsError, f as ServiceGetResponse } from '../custom-instance-90720a09';
2
+ import { R as customInstance, g as ServicesGetResponse, T as ErrorType, L as AsError, f as ServiceGetResponse } from '../custom-instance-688b0e9e';
3
3
  import 'axios';
4
4
 
5
5
  /**
@@ -270,12 +270,6 @@ export interface ProductDmStorage {
270
270
  coins: ProductCoinsDetail;
271
271
  }
272
272
 
273
- export interface UnitsGetResponse {
274
- /** A list of Units
275
- */
276
- units: OrganisationUnitsGetResponse[];
277
- }
278
-
279
273
  export interface UnitGetResponse {
280
274
  /** The Unit's unique ID */
281
275
  id: string;
@@ -328,6 +322,12 @@ export interface OrganisationUnitsGetResponse {
328
322
  units: UnitDetail[];
329
323
  }
330
324
 
325
+ export interface UnitsGetResponse {
326
+ /** A list of Units
327
+ */
328
+ units: OrganisationUnitsGetResponse[];
329
+ }
330
+
331
331
  export interface PersonalUnitPutResponse {
332
332
  /** The unit's Organisation. Used to identify the Default organisation */
333
333
  organisation_id: string;
@@ -362,6 +362,12 @@ export interface OrganisationPostResponse {
362
362
  id: string;
363
363
  }
364
364
 
365
+ export interface StateGetVersionResponse {
366
+ /** 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
367
+ */
368
+ version: string;
369
+ }
370
+
365
371
  export interface AsError {
366
372
  /** Brief error text that can be presented to the user */
367
373
  error: string;
@@ -0,0 +1,77 @@
1
+ /**
2
+ * Generated by orval v6.6.0 🍺
3
+ * Do not edit manually.
4
+ * Account Server API
5
+ * The Informatics Matters Account Server API.
6
+
7
+ A service that provides access to the Account Server, which gives *registered* users access to and management of **Products**, **Organisations**, **Units** and **Users**.
8
+
9
+ * OpenAPI spec version: 0.1
10
+ */
11
+ import {
12
+ useQuery,
13
+ UseQueryOptions,
14
+ QueryFunction,
15
+ UseQueryResult,
16
+ QueryKey,
17
+ } from "react-query";
18
+ import type {
19
+ StateGetVersionResponse,
20
+ AsError,
21
+ } from "../account-server-api.schemas";
22
+ import { customInstance, ErrorType } from ".././custom-instance";
23
+
24
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
25
+ type AsyncReturnType<T extends (...args: any) => Promise<any>> = T extends (
26
+ ...args: any
27
+ ) => Promise<infer R>
28
+ ? R
29
+ : any;
30
+
31
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
32
+ type SecondParameter<T extends (...args: any) => any> = T extends (
33
+ config: any,
34
+ args: infer P
35
+ ) => any
36
+ ? P
37
+ : never;
38
+
39
+ /**
40
+ * @summary Gets the Account Server version
41
+ */
42
+ export const getVersion = (
43
+ options?: SecondParameter<typeof customInstance>
44
+ ) => {
45
+ return customInstance<StateGetVersionResponse>(
46
+ { url: `/version`, method: "get" },
47
+ options
48
+ );
49
+ };
50
+
51
+ export const getGetVersionQueryKey = () => [`/version`];
52
+
53
+ export const useGetVersion = <
54
+ TData = AsyncReturnType<typeof getVersion>,
55
+ TError = ErrorType<AsError | void>
56
+ >(options?: {
57
+ query?: UseQueryOptions<AsyncReturnType<typeof getVersion>, TError, TData>;
58
+ request?: SecondParameter<typeof customInstance>;
59
+ }): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
60
+ const { query: queryOptions, request: requestOptions } = options || {};
61
+
62
+ const queryKey = queryOptions?.queryKey ?? getGetVersionQueryKey();
63
+
64
+ const queryFn: QueryFunction<AsyncReturnType<typeof getVersion>> = () =>
65
+ getVersion(requestOptions);
66
+
67
+ const query = useQuery<AsyncReturnType<typeof getVersion>, TError, TData>(
68
+ queryKey,
69
+ queryFn,
70
+ queryOptions
71
+ );
72
+
73
+ return {
74
+ queryKey,
75
+ ...query,
76
+ };
77
+ };
@@ -0,0 +1,7 @@
1
+ {
2
+ "module": "./state.js",
3
+ "main": "./state.cjs",
4
+ "types": "./state.d.ts",
5
+ "sideEffects": false,
6
+ "type": "module"
7
+ }
@@ -0,0 +1,28 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
2
+
3
+
4
+ var _chunk3DXYUDZHcjs = require('../chunk-3DXYUDZH.cjs');
5
+
6
+ // src/state/state.ts
7
+
8
+
9
+ var _reactquery = require('react-query');
10
+ var getVersion = (options) => {
11
+ return _chunk3DXYUDZHcjs.customInstance.call(void 0, { url: `/version`, method: "get" }, options);
12
+ };
13
+ var getGetVersionQueryKey = () => [`/version`];
14
+ var useGetVersion = (options) => {
15
+ const { query: queryOptions, request: requestOptions } = options || {};
16
+ const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetVersionQueryKey()));
17
+ const queryFn = () => getVersion(requestOptions);
18
+ const query = _reactquery.useQuery.call(void 0, queryKey, queryFn, queryOptions);
19
+ return _chunk3DXYUDZHcjs.__spreadValues.call(void 0, {
20
+ queryKey
21
+ }, query);
22
+ };
23
+
24
+
25
+
26
+
27
+ exports.getGetVersionQueryKey = getGetVersionQueryKey; exports.getVersion = getVersion; exports.useGetVersion = useGetVersion;
28
+ //# sourceMappingURL=state.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/state/state.ts"],"names":[],"mappings":";;;;;;AAUA;AAAA;AAAA;AA+BO,IAAM,aAAa,CACxB,YACG;AACH,SAAO,eACL,EAAE,KAAK,YAAY,QAAQ,SAC3B;AAAA;AAIG,IAAM,wBAAwB,MAAM,CAAC;AAErC,IAAM,gBAAgB,CAG3B,YAG4D;AAC5D,QAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW;AAEpE,QAAM,WAAW,8CAAc,aAAY;AAE3C,QAAM,UAA6D,MACjE,WAAW;AAEb,QAAM,QAAQ,SACZ,UACA,SACA;AAGF,SAAO;AAAA,IACL;AAAA,KACG;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 UseQueryOptions,\n QueryFunction,\n UseQueryResult,\n QueryKey,\n} from \"react-query\";\nimport type {\n StateGetVersionResponse,\n AsError,\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 * @summary Gets the Account Server version\n */\nexport const getVersion = (\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<StateGetVersionResponse>(\n { url: `/version`, method: \"get\" },\n options\n );\n};\n\nexport const getGetVersionQueryKey = () => [`/version`];\n\nexport const useGetVersion = <\n TData = AsyncReturnType<typeof getVersion>,\n TError = ErrorType<AsError | void>\n>(options?: {\n query?: UseQueryOptions<AsyncReturnType<typeof getVersion>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey = queryOptions?.queryKey ?? getGetVersionQueryKey();\n\n const queryFn: QueryFunction<AsyncReturnType<typeof getVersion>> = () =>\n getVersion(requestOptions);\n\n const query = useQuery<AsyncReturnType<typeof getVersion>, TError, TData>(\n queryKey,\n queryFn,\n queryOptions\n );\n\n return {\n queryKey,\n ...query,\n };\n};\n"]}
@@ -0,0 +1,29 @@
1
+ import { UseQueryOptions, QueryKey, UseQueryResult } from 'react-query';
2
+ import { R as customInstance, K as StateGetVersionResponse, T as ErrorType, L as AsError } from '../custom-instance-688b0e9e';
3
+ import 'axios';
4
+
5
+ /**
6
+ * Generated by orval v6.6.0 🍺
7
+ * Do not edit manually.
8
+ * Account Server API
9
+ * The Informatics Matters Account Server API.
10
+
11
+ A service that provides access to the Account Server, which gives *registered* users access to and management of **Products**, **Organisations**, **Units** and **Users**.
12
+
13
+ * OpenAPI spec version: 0.1
14
+ */
15
+
16
+ declare type SecondParameter<T extends (...args: any) => any> = T extends (config: any, args: infer P) => any ? P : never;
17
+ /**
18
+ * @summary Gets the Account Server version
19
+ */
20
+ declare const getVersion: (options?: SecondParameter<typeof customInstance>) => Promise<StateGetVersionResponse>;
21
+ declare const getGetVersionQueryKey: () => string[];
22
+ declare const useGetVersion: <TData = StateGetVersionResponse, TError = ErrorType<void | AsError>>(options?: {
23
+ query?: UseQueryOptions<StateGetVersionResponse, TError, TData, QueryKey> | undefined;
24
+ request?: SecondParameter<typeof customInstance>;
25
+ } | undefined) => UseQueryResult<TData, TError> & {
26
+ queryKey: QueryKey;
27
+ };
28
+
29
+ export { getGetVersionQueryKey, getVersion, useGetVersion };
package/state/state.js ADDED
@@ -0,0 +1,28 @@
1
+ import {
2
+ __spreadValues,
3
+ customInstance
4
+ } from "../chunk-JR7F532L.js";
5
+
6
+ // src/state/state.ts
7
+ import {
8
+ useQuery
9
+ } from "react-query";
10
+ var getVersion = (options) => {
11
+ return customInstance({ url: `/version`, method: "get" }, options);
12
+ };
13
+ var getGetVersionQueryKey = () => [`/version`];
14
+ var useGetVersion = (options) => {
15
+ const { query: queryOptions, request: requestOptions } = options || {};
16
+ const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetVersionQueryKey();
17
+ const queryFn = () => getVersion(requestOptions);
18
+ const query = useQuery(queryKey, queryFn, queryOptions);
19
+ return __spreadValues({
20
+ queryKey
21
+ }, query);
22
+ };
23
+ export {
24
+ getGetVersionQueryKey,
25
+ getVersion,
26
+ useGetVersion
27
+ };
28
+ //# sourceMappingURL=state.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/state/state.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 UseQueryOptions,\n QueryFunction,\n UseQueryResult,\n QueryKey,\n} from \"react-query\";\nimport type {\n StateGetVersionResponse,\n AsError,\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 * @summary Gets the Account Server version\n */\nexport const getVersion = (\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<StateGetVersionResponse>(\n { url: `/version`, method: \"get\" },\n options\n );\n};\n\nexport const getGetVersionQueryKey = () => [`/version`];\n\nexport const useGetVersion = <\n TData = AsyncReturnType<typeof getVersion>,\n TError = ErrorType<AsError | void>\n>(options?: {\n query?: UseQueryOptions<AsyncReturnType<typeof getVersion>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey = queryOptions?.queryKey ?? getGetVersionQueryKey();\n\n const queryFn: QueryFunction<AsyncReturnType<typeof getVersion>> = () =>\n getVersion(requestOptions);\n\n const query = useQuery<AsyncReturnType<typeof getVersion>, TError, TData>(\n queryKey,\n queryFn,\n queryOptions\n );\n\n return {\n queryKey,\n ...query,\n };\n};\n"],"mappings":";;;;;;AAUA;AAAA;AAAA;AA+BO,IAAM,aAAa,CACxB,YACG;AACH,SAAO,eACL,EAAE,KAAK,YAAY,QAAQ,SAC3B;AAAA;AAIG,IAAM,wBAAwB,MAAM,CAAC;AAErC,IAAM,gBAAgB,CAG3B,YAG4D;AAC5D,QAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW;AAEpE,QAAM,WAAW,8CAAc,aAAY;AAE3C,QAAM,UAA6D,MACjE,WAAW;AAEb,QAAM,QAAQ,SACZ,UACA,SACA;AAGF,SAAO;AAAA,IACL;AAAA,KACG;AAAA;","names":[]}
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 { Q as customInstance, E as OrganisationUnitsGetResponse, R as ErrorType, K as AsError, O as OrganisationUnitPostBodyBody, G as OrganisationUnitPostResponse, w as UnitGetResponse, v as UnitsGetResponse, F as PersonalUnitPutResponse } from '../custom-instance-90720a09';
3
+ import { R as customInstance, D as OrganisationUnitsGetResponse, T as ErrorType, L as AsError, O as OrganisationUnitPostBodyBody, G as OrganisationUnitPostResponse, v as UnitGetResponse, E as UnitsGetResponse, F as PersonalUnitPutResponse } from '../custom-instance-688b0e9e';
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.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 { Q as customInstance, I as UsersGetResponse, R as ErrorType, K as AsError } from '../custom-instance-90720a09';
3
+ import { R as customInstance, I as UsersGetResponse, T as ErrorType, L as AsError } from '../custom-instance-688b0e9e';
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;