@squonk/account-server-client 2.0.6 → 2.1.0-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.
Files changed (45) hide show
  1. package/admin/admin.cjs.map +1 -1
  2. package/admin/admin.d.ts +1 -1
  3. package/admin/admin.js.map +1 -1
  4. package/asset/asset.cjs.map +1 -1
  5. package/asset/asset.d.ts +1 -1
  6. package/asset/asset.js.map +1 -1
  7. package/{custom-instance-f32f6506.d.ts → custom-instance-35e5d4fd.d.ts} +8 -2
  8. package/event-stream/event-stream.cjs +101 -0
  9. package/event-stream/event-stream.cjs.map +1 -0
  10. package/event-stream/event-stream.d.ts +96 -0
  11. package/event-stream/event-stream.js +101 -0
  12. package/event-stream/event-stream.js.map +1 -0
  13. package/event-stream/package.json +7 -0
  14. package/index.cjs.map +1 -1
  15. package/index.d.ts +1 -1
  16. package/index.js.map +1 -1
  17. package/merchant/merchant.cjs.map +1 -1
  18. package/merchant/merchant.d.ts +1 -1
  19. package/merchant/merchant.js.map +1 -1
  20. package/organisation/organisation.cjs.map +1 -1
  21. package/organisation/organisation.d.ts +1 -1
  22. package/organisation/organisation.js.map +1 -1
  23. package/package.json +1 -1
  24. package/product/product.cjs.map +1 -1
  25. package/product/product.d.ts +1 -1
  26. package/product/product.js.map +1 -1
  27. package/src/account-server-api.schemas.ts +8 -1
  28. package/src/admin/admin.ts +1 -1
  29. package/src/asset/asset.ts +1 -1
  30. package/src/event-stream/event-stream.ts +328 -0
  31. package/src/merchant/merchant.ts +1 -1
  32. package/src/organisation/organisation.ts +1 -1
  33. package/src/product/product.ts +1 -1
  34. package/src/state/state.ts +1 -1
  35. package/src/unit/unit.ts +1 -1
  36. package/src/user/user.ts +1 -1
  37. package/state/state.cjs.map +1 -1
  38. package/state/state.d.ts +1 -1
  39. package/state/state.js.map +1 -1
  40. package/unit/unit.cjs.map +1 -1
  41. package/unit/unit.d.ts +1 -1
  42. package/unit/unit.js.map +1 -1
  43. package/user/user.cjs.map +1 -1
  44. package/user/user.d.ts +1 -1
  45. package/user/user.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/admin/admin.ts"],"names":[],"mappings":";;;;;AAUA,SAAS,gBAAgB;AA8BlB,IAAM,aAAa,CACxB,QACA,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,YAAY,QAAQ,OAAO,QAAQ,OAAO;AAAA,IACjD;AAAA,EACF;AACF;AAEO,IAAM,wBAAwB,CAAC,WACpC,CAAC,sBAAsB,YAAY,GAAI,SAAS,CAAC,MAAM,IAAI,CAAC,CAAE;AAEzD,IAAM,4BAA4B,CAIvC,QACA,YAUG;AACH,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YAAW,6CAAc,aAAY,sBAAsB,MAAM;AAEvE,QAAM,UAAiE,CAAC;AAAA,IACtE;AAAA,EACF,MAAM,WAAW,QAAQ,gBAAgB,MAAM;AAE/C,SAAO,EAAE,UAAU,SAAS,GAAG,aAAa;AAC9C;AAOO,IAAM,gBAAgB,CAI3B,QACA,YAQ2D;AAC3D,QAAM,eAAe,0BAA0B,QAAQ,OAAO;AAE9D,QAAM,QAAQ,SAAS,YAAY;AAInC,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT","sourcesContent":["/**\n * Generated by orval v6.15.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 **Organisations**, **Units**, **Products**, **Users**, and **Assets**.\n\n * OpenAPI spec version: 2.0\n */\nimport { useQuery } from \"@tanstack/react-query\";\nimport type {\n UseQueryOptions,\n QueryFunction,\n UseQueryResult,\n QueryKey,\n} from \"@tanstack/react-query\";\nimport type {\n ChargesGetResponse,\n AsError,\n GetChargesParams,\n} from \"../account-server-api.schemas\";\nimport { customInstance } from \".././custom-instance\";\nimport type { ErrorType } from \".././custom-instance\";\n\n// eslint-disable-next-line\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 global Charges.\n\nYou need admin rights to use this path.\n\n * @summary Gets charges for all Organisations\n */\nexport const getCharges = (\n params?: GetChargesParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<ChargesGetResponse>(\n { url: `/charges`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetChargesQueryKey = (params?: GetChargesParams) =>\n [\"account-server-api\", `/charges`, ...(params ? [params] : [])] as const;\n\nexport const getGetChargesQueryOptions = <\n TData = Awaited<ReturnType<typeof getCharges>>,\n TError = ErrorType<void | AsError>\n>(\n params?: GetChargesParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getCharges>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData> & {\n queryKey: QueryKey;\n} => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetChargesQueryKey(params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getCharges>>> = ({\n signal,\n }) => getCharges(params, requestOptions, signal);\n\n return { queryKey, queryFn, ...queryOptions };\n};\n\nexport type GetChargesQueryResult = NonNullable<\n Awaited<ReturnType<typeof getCharges>>\n>;\nexport type GetChargesQueryError = ErrorType<void | AsError>;\n\nexport const useGetCharges = <\n TData = Awaited<ReturnType<typeof getCharges>>,\n TError = ErrorType<void | AsError>\n>(\n params?: GetChargesParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getCharges>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetChargesQueryOptions(params, options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n"]}
1
+ {"version":3,"sources":["../../src/admin/admin.ts"],"names":[],"mappings":";;;;;AAUA,SAAS,gBAAgB;AA8BlB,IAAM,aAAa,CACxB,QACA,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,YAAY,QAAQ,OAAO,QAAQ,OAAO;AAAA,IACjD;AAAA,EACF;AACF;AAEO,IAAM,wBAAwB,CAAC,WACpC,CAAC,sBAAsB,YAAY,GAAI,SAAS,CAAC,MAAM,IAAI,CAAC,CAAE;AAEzD,IAAM,4BAA4B,CAIvC,QACA,YAUG;AACH,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YAAW,6CAAc,aAAY,sBAAsB,MAAM;AAEvE,QAAM,UAAiE,CAAC;AAAA,IACtE;AAAA,EACF,MAAM,WAAW,QAAQ,gBAAgB,MAAM;AAE/C,SAAO,EAAE,UAAU,SAAS,GAAG,aAAa;AAC9C;AAOO,IAAM,gBAAgB,CAI3B,QACA,YAQ2D;AAC3D,QAAM,eAAe,0BAA0B,QAAQ,OAAO;AAE9D,QAAM,QAAQ,SAAS,YAAY;AAInC,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT","sourcesContent":["/**\n * Generated by orval v6.15.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 **Organisations**, **Units**, **Products**, **Users**, and **Assets**.\n\n * OpenAPI spec version: 2.1\n */\nimport { useQuery } from \"@tanstack/react-query\";\nimport type {\n UseQueryOptions,\n QueryFunction,\n UseQueryResult,\n QueryKey,\n} from \"@tanstack/react-query\";\nimport type {\n ChargesGetResponse,\n AsError,\n GetChargesParams,\n} from \"../account-server-api.schemas\";\nimport { customInstance } from \".././custom-instance\";\nimport type { ErrorType } from \".././custom-instance\";\n\n// eslint-disable-next-line\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 global Charges.\n\nYou need admin rights to use this path.\n\n * @summary Gets charges for all Organisations\n */\nexport const getCharges = (\n params?: GetChargesParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<ChargesGetResponse>(\n { url: `/charges`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetChargesQueryKey = (params?: GetChargesParams) =>\n [\"account-server-api\", `/charges`, ...(params ? [params] : [])] as const;\n\nexport const getGetChargesQueryOptions = <\n TData = Awaited<ReturnType<typeof getCharges>>,\n TError = ErrorType<void | AsError>\n>(\n params?: GetChargesParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getCharges>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData> & {\n queryKey: QueryKey;\n} => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetChargesQueryKey(params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getCharges>>> = ({\n signal,\n }) => getCharges(params, requestOptions, signal);\n\n return { queryKey, queryFn, ...queryOptions };\n};\n\nexport type GetChargesQueryResult = NonNullable<\n Awaited<ReturnType<typeof getCharges>>\n>;\nexport type GetChargesQueryError = ErrorType<void | AsError>;\n\nexport const useGetCharges = <\n TData = Awaited<ReturnType<typeof getCharges>>,\n TError = ErrorType<void | AsError>\n>(\n params?: GetChargesParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getCharges>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetChargesQueryOptions(params, options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n"]}
package/admin/admin.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { UseQueryOptions, QueryKey, UseQueryResult } from '@tanstack/react-query';
2
- import { c as GetChargesParams, aE as customInstance, ax as ChargesGetResponse, aF as ErrorType, aA as AsError } from '../custom-instance-f32f6506.js';
2
+ import { c as GetChargesParams, aF as customInstance, ay as ChargesGetResponse, aG as ErrorType, aB as AsError } from '../custom-instance-35e5d4fd.js';
3
3
  import 'axios';
4
4
 
5
5
  type SecondParameter<T extends (...args: any) => any> = T extends (config: any, args: infer P) => any ? P : never;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/admin/admin.ts"],"sourcesContent":["/**\n * Generated by orval v6.15.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 **Organisations**, **Units**, **Products**, **Users**, and **Assets**.\n\n * OpenAPI spec version: 2.0\n */\nimport { useQuery } from \"@tanstack/react-query\";\nimport type {\n UseQueryOptions,\n QueryFunction,\n UseQueryResult,\n QueryKey,\n} from \"@tanstack/react-query\";\nimport type {\n ChargesGetResponse,\n AsError,\n GetChargesParams,\n} from \"../account-server-api.schemas\";\nimport { customInstance } from \".././custom-instance\";\nimport type { ErrorType } from \".././custom-instance\";\n\n// eslint-disable-next-line\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 global Charges.\n\nYou need admin rights to use this path.\n\n * @summary Gets charges for all Organisations\n */\nexport const getCharges = (\n params?: GetChargesParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<ChargesGetResponse>(\n { url: `/charges`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetChargesQueryKey = (params?: GetChargesParams) =>\n [\"account-server-api\", `/charges`, ...(params ? [params] : [])] as const;\n\nexport const getGetChargesQueryOptions = <\n TData = Awaited<ReturnType<typeof getCharges>>,\n TError = ErrorType<void | AsError>\n>(\n params?: GetChargesParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getCharges>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData> & {\n queryKey: QueryKey;\n} => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetChargesQueryKey(params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getCharges>>> = ({\n signal,\n }) => getCharges(params, requestOptions, signal);\n\n return { queryKey, queryFn, ...queryOptions };\n};\n\nexport type GetChargesQueryResult = NonNullable<\n Awaited<ReturnType<typeof getCharges>>\n>;\nexport type GetChargesQueryError = ErrorType<void | AsError>;\n\nexport const useGetCharges = <\n TData = Awaited<ReturnType<typeof getCharges>>,\n TError = ErrorType<void | AsError>\n>(\n params?: GetChargesParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getCharges>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetChargesQueryOptions(params, options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n"],"mappings":";;;;;AAUA,SAAS,gBAAgB;AA8BlB,IAAM,aAAa,CACxB,QACA,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,YAAY,QAAQ,OAAO,QAAQ,OAAO;AAAA,IACjD;AAAA,EACF;AACF;AAEO,IAAM,wBAAwB,CAAC,WACpC,CAAC,sBAAsB,YAAY,GAAI,SAAS,CAAC,MAAM,IAAI,CAAC,CAAE;AAEzD,IAAM,4BAA4B,CAIvC,QACA,YAUG;AACH,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YAAW,6CAAc,aAAY,sBAAsB,MAAM;AAEvE,QAAM,UAAiE,CAAC;AAAA,IACtE;AAAA,EACF,MAAM,WAAW,QAAQ,gBAAgB,MAAM;AAE/C,SAAO,EAAE,UAAU,SAAS,GAAG,aAAa;AAC9C;AAOO,IAAM,gBAAgB,CAI3B,QACA,YAQ2D;AAC3D,QAAM,eAAe,0BAA0B,QAAQ,OAAO;AAE9D,QAAM,QAAQ,SAAS,YAAY;AAInC,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../src/admin/admin.ts"],"sourcesContent":["/**\n * Generated by orval v6.15.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 **Organisations**, **Units**, **Products**, **Users**, and **Assets**.\n\n * OpenAPI spec version: 2.1\n */\nimport { useQuery } from \"@tanstack/react-query\";\nimport type {\n UseQueryOptions,\n QueryFunction,\n UseQueryResult,\n QueryKey,\n} from \"@tanstack/react-query\";\nimport type {\n ChargesGetResponse,\n AsError,\n GetChargesParams,\n} from \"../account-server-api.schemas\";\nimport { customInstance } from \".././custom-instance\";\nimport type { ErrorType } from \".././custom-instance\";\n\n// eslint-disable-next-line\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 global Charges.\n\nYou need admin rights to use this path.\n\n * @summary Gets charges for all Organisations\n */\nexport const getCharges = (\n params?: GetChargesParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<ChargesGetResponse>(\n { url: `/charges`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetChargesQueryKey = (params?: GetChargesParams) =>\n [\"account-server-api\", `/charges`, ...(params ? [params] : [])] as const;\n\nexport const getGetChargesQueryOptions = <\n TData = Awaited<ReturnType<typeof getCharges>>,\n TError = ErrorType<void | AsError>\n>(\n params?: GetChargesParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getCharges>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData> & {\n queryKey: QueryKey;\n} => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetChargesQueryKey(params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getCharges>>> = ({\n signal,\n }) => getCharges(params, requestOptions, signal);\n\n return { queryKey, queryFn, ...queryOptions };\n};\n\nexport type GetChargesQueryResult = NonNullable<\n Awaited<ReturnType<typeof getCharges>>\n>;\nexport type GetChargesQueryError = ErrorType<void | AsError>;\n\nexport const useGetCharges = <\n TData = Awaited<ReturnType<typeof getCharges>>,\n TError = ErrorType<void | AsError>\n>(\n params?: GetChargesParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getCharges>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetChargesQueryOptions(params, options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n"],"mappings":";;;;;AAUA,SAAS,gBAAgB;AA8BlB,IAAM,aAAa,CACxB,QACA,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,YAAY,QAAQ,OAAO,QAAQ,OAAO;AAAA,IACjD;AAAA,EACF;AACF;AAEO,IAAM,wBAAwB,CAAC,WACpC,CAAC,sBAAsB,YAAY,GAAI,SAAS,CAAC,MAAM,IAAI,CAAC,CAAE;AAEzD,IAAM,4BAA4B,CAIvC,QACA,YAUG;AACH,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YAAW,6CAAc,aAAY,sBAAsB,MAAM;AAEvE,QAAM,UAAiE,CAAC;AAAA,IACtE;AAAA,EACF,MAAM,WAAW,QAAQ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,QAAQ,SAAS,OAAO;AAAA,IAC3D;AAAA,EACF;AACF;AAEO,IAAM,gCAAgC,CAG3C,YAaG;AACH,QAAM,EAAE,UAAU,iBAAiB,SAAS,eAAe,IAAI,WAAW,CAAC;AAE3E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,SAAS,OAAO,IAAI,SAAS,CAAC;AAEtC,WAAO,YAAY,SAAS,QAAQ,cAAc;AAAA,EACpD;AAEA,SAAO,EAAE,YAAY,GAAG,gBAAgB;AAC1C;AAQO,IAAM,iBAAiB,CAG5B,YAQI;AACJ,QAAM,kBAAkB,8BAA8B,OAAO;AAE7D,SAAO,YAAY,eAAe;AACpC","sourcesContent":["/**\n * Generated by orval v6.15.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 **Organisations**, **Units**, **Products**, **Users**, and **Assets**.\n\n * OpenAPI spec version: 2.0\n */\nimport { useQuery, useMutation } from \"@tanstack/react-query\";\nimport type {\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"@tanstack/react-query\";\nimport type {\n AssetGetResponse,\n AsError,\n GetAssetParams,\n AssetPostResponse,\n AssetPostBodyBody,\n AssetPatchBodyBody,\n AttachAssetParams,\n DetachAssetParams,\n} from \"../account-server-api.schemas\";\nimport { customInstance } from \".././custom-instance\";\nimport type { ErrorType } from \".././custom-instance\";\n\n// eslint-disable-next-line\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 Assets you have access to.\n\nAssets are text and file resources that can be attached to (have a *scope* that applies to) **User** accounts, **Products**, **Units**, **Organisations** or can be **Global**. Assets can be requested by **Merchants**. The Data Manager uses assets to provide additional information that's often sensitive to **Job** (and **Application**) **Instances**.\n\nUsers must *attach* an Asset to a **Merchant** before the **Merchant** can ue it\n\n * @summary Gets Assets\n */\nexport const getAsset = (\n params?: GetAssetParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<AssetGetResponse>(\n { url: `/asset`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetAssetQueryKey = (params?: GetAssetParams) =>\n [\"account-server-api\", `/asset`, ...(params ? [params] : [])] as const;\n\nexport const getGetAssetQueryOptions = <\n TData = Awaited<ReturnType<typeof getAsset>>,\n TError = ErrorType<AsError | void>\n>(\n params?: GetAssetParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getAsset>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData> & {\n queryKey: QueryKey;\n} => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetAssetQueryKey(params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getAsset>>> = ({\n signal,\n }) => getAsset(params, requestOptions, signal);\n\n return { queryKey, queryFn, ...queryOptions };\n};\n\nexport type GetAssetQueryResult = NonNullable<\n Awaited<ReturnType<typeof getAsset>>\n>;\nexport type GetAssetQueryError = ErrorType<AsError | void>;\n\nexport const useGetAsset = <\n TData = Awaited<ReturnType<typeof getAsset>>,\n TError = ErrorType<AsError | void>\n>(\n params?: GetAssetParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getAsset>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetAssetQueryOptions(params, options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n\n/**\n * Creates an Asset, which can be attached to a **User** account, a **Product**, **Unit**, **Organisation** or can be made **Global**\n\n * @summary Create an Asset\n */\nexport const createAsset = (\n assetPostBodyBody: AssetPostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n formData.append(\"name\", assetPostBodyBody.name);\n if (assetPostBodyBody.content_file !== undefined) {\n formData.append(\"content_file\", assetPostBodyBody.content_file);\n }\n if (assetPostBodyBody.content_string !== undefined) {\n formData.append(\"content_string\", assetPostBodyBody.content_string);\n }\n formData.append(\"scope\", assetPostBodyBody.scope);\n if (assetPostBodyBody.scope_id !== undefined) {\n formData.append(\"scope_id\", assetPostBodyBody.scope_id);\n }\n formData.append(\"secret\", assetPostBodyBody.secret.toString());\n if (assetPostBodyBody.description !== undefined) {\n formData.append(\"description\", assetPostBodyBody.description);\n }\n\n return customInstance<AssetPostResponse>(\n {\n url: `/asset`,\n method: \"post\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport const getCreateAssetMutationOptions = <\n TError = ErrorType<AsError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createAsset>>,\n TError,\n { data: AssetPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof createAsset>>,\n TError,\n { data: AssetPostBodyBody },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof createAsset>>,\n { data: AssetPostBodyBody }\n > = (props) => {\n const { data } = props ?? {};\n\n return createAsset(data, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type CreateAssetMutationResult = NonNullable<\n Awaited<ReturnType<typeof createAsset>>\n>;\nexport type CreateAssetMutationBody = AssetPostBodyBody;\nexport type CreateAssetMutationError = ErrorType<AsError | void>;\n\nexport const useCreateAsset = <\n TError = ErrorType<AsError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createAsset>>,\n TError,\n { data: AssetPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getCreateAssetMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Used to update or replace Asset *Content* or *Description*.\n\nThe content of an Asset currently in use will not be affected by a change made here. If a **Merchant** has already obtained the Asset it may continue to use the original value until the **Merchant** requests the **Asset** again.\n\n * @summary Adjust an existing Asset\n */\nexport const patchAsset = (\n assetId: string,\n assetPatchBodyBody: AssetPatchBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n if (assetPatchBodyBody.content_file !== undefined) {\n formData.append(\"content_file\", assetPatchBodyBody.content_file);\n }\n if (assetPatchBodyBody.content_string !== undefined) {\n formData.append(\"content_string\", assetPatchBodyBody.content_string);\n }\n if (assetPatchBodyBody.description !== undefined) {\n formData.append(\"description\", assetPatchBodyBody.description);\n }\n\n return customInstance<void>(\n {\n url: `/asset/${assetId}`,\n method: \"patch\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport const getPatchAssetMutationOptions = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof patchAsset>>,\n TError,\n { assetId: string; data: AssetPatchBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof patchAsset>>,\n TError,\n { assetId: string; data: AssetPatchBodyBody },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof patchAsset>>,\n { assetId: string; data: AssetPatchBodyBody }\n > = (props) => {\n const { assetId, data } = props ?? {};\n\n return patchAsset(assetId, data, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type PatchAssetMutationResult = NonNullable<\n Awaited<ReturnType<typeof patchAsset>>\n>;\nexport type PatchAssetMutationBody = AssetPatchBodyBody;\nexport type PatchAssetMutationError = ErrorType<AsError>;\n\nexport const usePatchAsset = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof patchAsset>>,\n TError,\n { assetId: string; data: AssetPatchBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getPatchAssetMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Deletes a known Asset. Assets that are attached to **Merchants** cannot be deleted\n\n * @summary Deletes an Asset\n */\nexport const deleteAsset = (\n assetId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/asset/${assetId}`, method: \"delete\" },\n options\n );\n};\n\nexport const getDeleteAssetMutationOptions = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteAsset>>,\n TError,\n { assetId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof deleteAsset>>,\n TError,\n { assetId: string },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteAsset>>,\n { assetId: string }\n > = (props) => {\n const { assetId } = props ?? {};\n\n return deleteAsset(assetId, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type DeleteAssetMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteAsset>>\n>;\n\nexport type DeleteAssetMutationError = ErrorType<AsError>;\n\nexport const useDeleteAsset = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteAsset>>,\n TError,\n { assetId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getDeleteAssetMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Disables a known Asset\n\n * @summary Disables an Asset\n */\nexport const disableAsset = (\n assetId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/asset/${assetId}/disable`, method: \"patch\" },\n options\n );\n};\n\nexport const getDisableAssetMutationOptions = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof disableAsset>>,\n TError,\n { assetId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof disableAsset>>,\n TError,\n { assetId: string },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof disableAsset>>,\n { assetId: string }\n > = (props) => {\n const { assetId } = props ?? {};\n\n return disableAsset(assetId, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type DisableAssetMutationResult = NonNullable<\n Awaited<ReturnType<typeof disableAsset>>\n>;\n\nexport type DisableAssetMutationError = ErrorType<AsError>;\n\nexport const useDisableAsset = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof disableAsset>>,\n TError,\n { assetId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getDisableAssetMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Enables a known Asset\n\n * @summary Enables an Asset\n */\nexport const enableAsset = (\n assetId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/asset/${assetId}/enable`, method: \"patch\" },\n options\n );\n};\n\nexport const getEnableAssetMutationOptions = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof enableAsset>>,\n TError,\n { assetId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof enableAsset>>,\n TError,\n { assetId: string },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof enableAsset>>,\n { assetId: string }\n > = (props) => {\n const { assetId } = props ?? {};\n\n return enableAsset(assetId, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type EnableAssetMutationResult = NonNullable<\n Awaited<ReturnType<typeof enableAsset>>\n>;\n\nexport type EnableAssetMutationError = ErrorType<AsError>;\n\nexport const useEnableAsset = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof enableAsset>>,\n TError,\n { assetId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getEnableAssetMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Attaches an Asset to a **Merchant**. This allows the **Merchant** to query the Asset. **Merchants** cannot obtain Assets that are not attached to them.\n\n * @summary Attaches an Asset to a Merchant\n */\nexport const attachAsset = (\n assetId: string,\n params?: AttachAssetParams,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/asset/${assetId}/attach`, method: \"patch\", params },\n options\n );\n};\n\nexport const getAttachAssetMutationOptions = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof attachAsset>>,\n TError,\n { assetId: string; params?: AttachAssetParams },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof attachAsset>>,\n TError,\n { assetId: string; params?: AttachAssetParams },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof attachAsset>>,\n { assetId: string; params?: AttachAssetParams }\n > = (props) => {\n const { assetId, params } = props ?? {};\n\n return attachAsset(assetId, params, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type AttachAssetMutationResult = NonNullable<\n Awaited<ReturnType<typeof attachAsset>>\n>;\n\nexport type AttachAssetMutationError = ErrorType<AsError>;\n\nexport const useAttachAsset = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof attachAsset>>,\n TError,\n { assetId: string; params?: AttachAssetParams },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getAttachAssetMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Detaches an Asset from a **Merchant**\n\n * @summary Detaches an Asset from a Merchant\n */\nexport const detachAsset = (\n assetId: string,\n params?: DetachAssetParams,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/asset/${assetId}/detach`, method: \"patch\", params },\n options\n );\n};\n\nexport const getDetachAssetMutationOptions = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof detachAsset>>,\n TError,\n { assetId: string; params?: DetachAssetParams },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof detachAsset>>,\n TError,\n { assetId: string; params?: DetachAssetParams },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof detachAsset>>,\n { assetId: string; params?: DetachAssetParams }\n > = (props) => {\n const { assetId, params } = props ?? {};\n\n return detachAsset(assetId, params, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type DetachAssetMutationResult = NonNullable<\n Awaited<ReturnType<typeof detachAsset>>\n>;\n\nexport type DetachAssetMutationError = ErrorType<AsError>;\n\nexport const useDetachAsset = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof detachAsset>>,\n TError,\n { assetId: string; params?: DetachAssetParams },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getDetachAssetMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n"]}
1
+ {"version":3,"sources":["../../src/asset/asset.ts"],"names":[],"mappings":";;;;;AAUA,SAAS,UAAU,mBAAmB;AAuC/B,IAAM,WAAW,CACtB,QACA,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,UAAU,QAAQ,OAAO,QAAQ,OAAO;AAAA,IAC/C;AAAA,EACF;AACF;AAEO,IAAM,sBAAsB,CAAC,WAClC,CAAC,sBAAsB,UAAU,GAAI,SAAS,CAAC,MAAM,IAAI,CAAC,CAAE;AAEvD,IAAM,0BAA0B,CAIrC,QACA,YAUG;AACH,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YAAW,6CAAc,aAAY,oBAAoB,MAAM;AAErE,QAAM,UAA+D,CAAC;AAAA,IACpE;AAAA,EACF,MAAM,SAAS,QAAQ,gBAAgB,MAAM;AAE7C,SAAO,EAAE,UAAU,SAAS,GAAG,aAAa;AAC9C;AAOO,IAAM,cAAc,CAIzB,QACA,YAQ2D;AAC3D,QAAM,eAAe,wBAAwB,QAAQ,OAAO;AAE5D,QAAM,QAAQ,SAAS,YAAY;AAInC,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT;AAOO,IAAM,cAAc,CACzB,mBACA,YACG;AACH,QAAM,WAAW,IAAI,SAAS;AAC9B,WAAS,OAAO,QAAQ,kBAAkB,IAAI;AAC9C,MAAI,kBAAkB,iBAAiB,QAAW;AAChD,aAAS,OAAO,gBAAgB,kBAAkB,YAAY;AAAA,EAChE;AACA,MAAI,kBAAkB,mBAAmB,QAAW;AAClD,aAAS,OAAO,kBAAkB,kBAAkB,cAAc;AAAA,EACpE;AACA,WAAS,OAAO,SAAS,kBAAkB,KAAK;AAChD,MAAI,kBAAkB,aAAa,QAAW;AAC5C,aAAS,OAAO,YAAY,kBAAkB,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,CAAC;AAE3E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,SAAS,OAAO,IAAI,SAAS,CAAC;AAEtC,WAAO,YAAY,SAAS,QAAQ,cAAc;AAAA,EACpD;AAEA,SAAO,EAAE,YAAY,GAAG,gBAAgB;AAC1C;AAQO,IAAM,iBAAiB,CAG5B,YAQI;AACJ,QAAM,kBAAkB,8BAA8B,OAAO;AAE7D,SAAO,YAAY,eAAe;AACpC","sourcesContent":["/**\n * Generated by orval v6.15.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 **Organisations**, **Units**, **Products**, **Users**, and **Assets**.\n\n * OpenAPI spec version: 2.1\n */\nimport { useQuery, useMutation } from \"@tanstack/react-query\";\nimport type {\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"@tanstack/react-query\";\nimport type {\n AssetGetResponse,\n AsError,\n GetAssetParams,\n AssetPostResponse,\n AssetPostBodyBody,\n AssetPatchBodyBody,\n AttachAssetParams,\n DetachAssetParams,\n} from \"../account-server-api.schemas\";\nimport { customInstance } from \".././custom-instance\";\nimport type { ErrorType } from \".././custom-instance\";\n\n// eslint-disable-next-line\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 Assets you have access to.\n\nAssets are text and file resources that can be attached to (have a *scope* that applies to) **User** accounts, **Products**, **Units**, **Organisations** or can be **Global**. Assets can be requested by **Merchants**. The Data Manager uses assets to provide additional information that's often sensitive to **Job** (and **Application**) **Instances**.\n\nUsers must *attach* an Asset to a **Merchant** before the **Merchant** can ue it\n\n * @summary Gets Assets\n */\nexport const getAsset = (\n params?: GetAssetParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<AssetGetResponse>(\n { url: `/asset`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetAssetQueryKey = (params?: GetAssetParams) =>\n [\"account-server-api\", `/asset`, ...(params ? [params] : [])] as const;\n\nexport const getGetAssetQueryOptions = <\n TData = Awaited<ReturnType<typeof getAsset>>,\n TError = ErrorType<AsError | void>\n>(\n params?: GetAssetParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getAsset>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData> & {\n queryKey: QueryKey;\n} => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetAssetQueryKey(params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getAsset>>> = ({\n signal,\n }) => getAsset(params, requestOptions, signal);\n\n return { queryKey, queryFn, ...queryOptions };\n};\n\nexport type GetAssetQueryResult = NonNullable<\n Awaited<ReturnType<typeof getAsset>>\n>;\nexport type GetAssetQueryError = ErrorType<AsError | void>;\n\nexport const useGetAsset = <\n TData = Awaited<ReturnType<typeof getAsset>>,\n TError = ErrorType<AsError | void>\n>(\n params?: GetAssetParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getAsset>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetAssetQueryOptions(params, options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n\n/**\n * Creates an Asset, which can be attached to a **User** account, a **Product**, **Unit**, **Organisation** or can be made **Global**\n\n * @summary Create an Asset\n */\nexport const createAsset = (\n assetPostBodyBody: AssetPostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n formData.append(\"name\", assetPostBodyBody.name);\n if (assetPostBodyBody.content_file !== undefined) {\n formData.append(\"content_file\", assetPostBodyBody.content_file);\n }\n if (assetPostBodyBody.content_string !== undefined) {\n formData.append(\"content_string\", assetPostBodyBody.content_string);\n }\n formData.append(\"scope\", assetPostBodyBody.scope);\n if (assetPostBodyBody.scope_id !== undefined) {\n formData.append(\"scope_id\", assetPostBodyBody.scope_id);\n }\n formData.append(\"secret\", assetPostBodyBody.secret.toString());\n if (assetPostBodyBody.description !== undefined) {\n formData.append(\"description\", assetPostBodyBody.description);\n }\n\n return customInstance<AssetPostResponse>(\n {\n url: `/asset`,\n method: \"post\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport const getCreateAssetMutationOptions = <\n TError = ErrorType<AsError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createAsset>>,\n TError,\n { data: AssetPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof createAsset>>,\n TError,\n { data: AssetPostBodyBody },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof createAsset>>,\n { data: AssetPostBodyBody }\n > = (props) => {\n const { data } = props ?? {};\n\n return createAsset(data, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type CreateAssetMutationResult = NonNullable<\n Awaited<ReturnType<typeof createAsset>>\n>;\nexport type CreateAssetMutationBody = AssetPostBodyBody;\nexport type CreateAssetMutationError = ErrorType<AsError | void>;\n\nexport const useCreateAsset = <\n TError = ErrorType<AsError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createAsset>>,\n TError,\n { data: AssetPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getCreateAssetMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Used to update or replace Asset *Content* or *Description*.\n\nThe content of an Asset currently in use will not be affected by a change made here. If a **Merchant** has already obtained the Asset it may continue to use the original value until the **Merchant** requests the **Asset** again.\n\n * @summary Adjust an existing Asset\n */\nexport const patchAsset = (\n assetId: string,\n assetPatchBodyBody: AssetPatchBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n if (assetPatchBodyBody.content_file !== undefined) {\n formData.append(\"content_file\", assetPatchBodyBody.content_file);\n }\n if (assetPatchBodyBody.content_string !== undefined) {\n formData.append(\"content_string\", assetPatchBodyBody.content_string);\n }\n if (assetPatchBodyBody.description !== undefined) {\n formData.append(\"description\", assetPatchBodyBody.description);\n }\n\n return customInstance<void>(\n {\n url: `/asset/${assetId}`,\n method: \"patch\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport const getPatchAssetMutationOptions = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof patchAsset>>,\n TError,\n { assetId: string; data: AssetPatchBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof patchAsset>>,\n TError,\n { assetId: string; data: AssetPatchBodyBody },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof patchAsset>>,\n { assetId: string; data: AssetPatchBodyBody }\n > = (props) => {\n const { assetId, data } = props ?? {};\n\n return patchAsset(assetId, data, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type PatchAssetMutationResult = NonNullable<\n Awaited<ReturnType<typeof patchAsset>>\n>;\nexport type PatchAssetMutationBody = AssetPatchBodyBody;\nexport type PatchAssetMutationError = ErrorType<AsError>;\n\nexport const usePatchAsset = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof patchAsset>>,\n TError,\n { assetId: string; data: AssetPatchBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getPatchAssetMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Deletes a known Asset. Assets that are attached to **Merchants** cannot be deleted\n\n * @summary Deletes an Asset\n */\nexport const deleteAsset = (\n assetId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/asset/${assetId}`, method: \"delete\" },\n options\n );\n};\n\nexport const getDeleteAssetMutationOptions = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteAsset>>,\n TError,\n { assetId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof deleteAsset>>,\n TError,\n { assetId: string },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteAsset>>,\n { assetId: string }\n > = (props) => {\n const { assetId } = props ?? {};\n\n return deleteAsset(assetId, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type DeleteAssetMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteAsset>>\n>;\n\nexport type DeleteAssetMutationError = ErrorType<AsError>;\n\nexport const useDeleteAsset = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteAsset>>,\n TError,\n { assetId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getDeleteAssetMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Disables a known Asset\n\n * @summary Disables an Asset\n */\nexport const disableAsset = (\n assetId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/asset/${assetId}/disable`, method: \"patch\" },\n options\n );\n};\n\nexport const getDisableAssetMutationOptions = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof disableAsset>>,\n TError,\n { assetId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof disableAsset>>,\n TError,\n { assetId: string },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof disableAsset>>,\n { assetId: string }\n > = (props) => {\n const { assetId } = props ?? {};\n\n return disableAsset(assetId, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type DisableAssetMutationResult = NonNullable<\n Awaited<ReturnType<typeof disableAsset>>\n>;\n\nexport type DisableAssetMutationError = ErrorType<AsError>;\n\nexport const useDisableAsset = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof disableAsset>>,\n TError,\n { assetId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getDisableAssetMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Enables a known Asset\n\n * @summary Enables an Asset\n */\nexport const enableAsset = (\n assetId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/asset/${assetId}/enable`, method: \"patch\" },\n options\n );\n};\n\nexport const getEnableAssetMutationOptions = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof enableAsset>>,\n TError,\n { assetId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof enableAsset>>,\n TError,\n { assetId: string },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof enableAsset>>,\n { assetId: string }\n > = (props) => {\n const { assetId } = props ?? {};\n\n return enableAsset(assetId, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type EnableAssetMutationResult = NonNullable<\n Awaited<ReturnType<typeof enableAsset>>\n>;\n\nexport type EnableAssetMutationError = ErrorType<AsError>;\n\nexport const useEnableAsset = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof enableAsset>>,\n TError,\n { assetId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getEnableAssetMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Attaches an Asset to a **Merchant**. This allows the **Merchant** to query the Asset. **Merchants** cannot obtain Assets that are not attached to them.\n\n * @summary Attaches an Asset to a Merchant\n */\nexport const attachAsset = (\n assetId: string,\n params?: AttachAssetParams,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/asset/${assetId}/attach`, method: \"patch\", params },\n options\n );\n};\n\nexport const getAttachAssetMutationOptions = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof attachAsset>>,\n TError,\n { assetId: string; params?: AttachAssetParams },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof attachAsset>>,\n TError,\n { assetId: string; params?: AttachAssetParams },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof attachAsset>>,\n { assetId: string; params?: AttachAssetParams }\n > = (props) => {\n const { assetId, params } = props ?? {};\n\n return attachAsset(assetId, params, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type AttachAssetMutationResult = NonNullable<\n Awaited<ReturnType<typeof attachAsset>>\n>;\n\nexport type AttachAssetMutationError = ErrorType<AsError>;\n\nexport const useAttachAsset = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof attachAsset>>,\n TError,\n { assetId: string; params?: AttachAssetParams },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getAttachAssetMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Detaches an Asset from a **Merchant**\n\n * @summary Detaches an Asset from a Merchant\n */\nexport const detachAsset = (\n assetId: string,\n params?: DetachAssetParams,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/asset/${assetId}/detach`, method: \"patch\", params },\n options\n );\n};\n\nexport const getDetachAssetMutationOptions = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof detachAsset>>,\n TError,\n { assetId: string; params?: DetachAssetParams },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof detachAsset>>,\n TError,\n { assetId: string; params?: DetachAssetParams },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof detachAsset>>,\n { assetId: string; params?: DetachAssetParams }\n > = (props) => {\n const { assetId, params } = props ?? {};\n\n return detachAsset(assetId, params, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type DetachAssetMutationResult = NonNullable<\n Awaited<ReturnType<typeof detachAsset>>\n>;\n\nexport type DetachAssetMutationError = ErrorType<AsError>;\n\nexport const useDetachAsset = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof detachAsset>>,\n TError,\n { assetId: string; params?: DetachAssetParams },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getDetachAssetMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n"]}
package/asset/asset.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as _tanstack_react_query from '@tanstack/react-query';
2
2
  import { UseQueryOptions, QueryKey, UseQueryResult, UseMutationOptions } from '@tanstack/react-query';
3
- import { g as GetAssetParams, aE as customInstance, az as AssetGetResponse, aF as ErrorType, aA as AsError, s as AssetPostBodyBody, ay as AssetPostResponse, t as AssetPatchBodyBody, A as AttachAssetParams, D as DetachAssetParams } from '../custom-instance-f32f6506.js';
3
+ import { g as GetAssetParams, aF as customInstance, aA as AssetGetResponse, aG as ErrorType, aB as AsError, s as AssetPostBodyBody, az as AssetPostResponse, t as AssetPatchBodyBody, A as AttachAssetParams, D as DetachAssetParams } from '../custom-instance-35e5d4fd.js';
4
4
  import 'axios';
5
5
 
6
6
  type SecondParameter<T extends (...args: any) => any> = T extends (config: any, args: infer P) => any ? P : never;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/asset/asset.ts"],"sourcesContent":["/**\n * Generated by orval v6.15.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 **Organisations**, **Units**, **Products**, **Users**, and **Assets**.\n\n * OpenAPI spec version: 2.0\n */\nimport { useQuery, useMutation } from \"@tanstack/react-query\";\nimport type {\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"@tanstack/react-query\";\nimport type {\n AssetGetResponse,\n AsError,\n GetAssetParams,\n AssetPostResponse,\n AssetPostBodyBody,\n AssetPatchBodyBody,\n AttachAssetParams,\n DetachAssetParams,\n} from \"../account-server-api.schemas\";\nimport { customInstance } from \".././custom-instance\";\nimport type { ErrorType } from \".././custom-instance\";\n\n// eslint-disable-next-line\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 Assets you have access to.\n\nAssets are text and file resources that can be attached to (have a *scope* that applies to) **User** accounts, **Products**, **Units**, **Organisations** or can be **Global**. Assets can be requested by **Merchants**. The Data Manager uses assets to provide additional information that's often sensitive to **Job** (and **Application**) **Instances**.\n\nUsers must *attach* an Asset to a **Merchant** before the **Merchant** can ue it\n\n * @summary Gets Assets\n */\nexport const getAsset = (\n params?: GetAssetParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<AssetGetResponse>(\n { url: `/asset`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetAssetQueryKey = (params?: GetAssetParams) =>\n [\"account-server-api\", `/asset`, ...(params ? [params] : [])] as const;\n\nexport const getGetAssetQueryOptions = <\n TData = Awaited<ReturnType<typeof getAsset>>,\n TError = ErrorType<AsError | void>\n>(\n params?: GetAssetParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getAsset>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData> & {\n queryKey: QueryKey;\n} => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetAssetQueryKey(params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getAsset>>> = ({\n signal,\n }) => getAsset(params, requestOptions, signal);\n\n return { queryKey, queryFn, ...queryOptions };\n};\n\nexport type GetAssetQueryResult = NonNullable<\n Awaited<ReturnType<typeof getAsset>>\n>;\nexport type GetAssetQueryError = ErrorType<AsError | void>;\n\nexport const useGetAsset = <\n TData = Awaited<ReturnType<typeof getAsset>>,\n TError = ErrorType<AsError | void>\n>(\n params?: GetAssetParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getAsset>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetAssetQueryOptions(params, options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n\n/**\n * Creates an Asset, which can be attached to a **User** account, a **Product**, **Unit**, **Organisation** or can be made **Global**\n\n * @summary Create an Asset\n */\nexport const createAsset = (\n assetPostBodyBody: AssetPostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n formData.append(\"name\", assetPostBodyBody.name);\n if (assetPostBodyBody.content_file !== undefined) {\n formData.append(\"content_file\", assetPostBodyBody.content_file);\n }\n if (assetPostBodyBody.content_string !== undefined) {\n formData.append(\"content_string\", assetPostBodyBody.content_string);\n }\n formData.append(\"scope\", assetPostBodyBody.scope);\n if (assetPostBodyBody.scope_id !== undefined) {\n formData.append(\"scope_id\", assetPostBodyBody.scope_id);\n }\n formData.append(\"secret\", assetPostBodyBody.secret.toString());\n if (assetPostBodyBody.description !== undefined) {\n formData.append(\"description\", assetPostBodyBody.description);\n }\n\n return customInstance<AssetPostResponse>(\n {\n url: `/asset`,\n method: \"post\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport const getCreateAssetMutationOptions = <\n TError = ErrorType<AsError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createAsset>>,\n TError,\n { data: AssetPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof createAsset>>,\n TError,\n { data: AssetPostBodyBody },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof createAsset>>,\n { data: AssetPostBodyBody }\n > = (props) => {\n const { data } = props ?? {};\n\n return createAsset(data, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type CreateAssetMutationResult = NonNullable<\n Awaited<ReturnType<typeof createAsset>>\n>;\nexport type CreateAssetMutationBody = AssetPostBodyBody;\nexport type CreateAssetMutationError = ErrorType<AsError | void>;\n\nexport const useCreateAsset = <\n TError = ErrorType<AsError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createAsset>>,\n TError,\n { data: AssetPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getCreateAssetMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Used to update or replace Asset *Content* or *Description*.\n\nThe content of an Asset currently in use will not be affected by a change made here. If a **Merchant** has already obtained the Asset it may continue to use the original value until the **Merchant** requests the **Asset** again.\n\n * @summary Adjust an existing Asset\n */\nexport const patchAsset = (\n assetId: string,\n assetPatchBodyBody: AssetPatchBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n if (assetPatchBodyBody.content_file !== undefined) {\n formData.append(\"content_file\", assetPatchBodyBody.content_file);\n }\n if (assetPatchBodyBody.content_string !== undefined) {\n formData.append(\"content_string\", assetPatchBodyBody.content_string);\n }\n if (assetPatchBodyBody.description !== undefined) {\n formData.append(\"description\", assetPatchBodyBody.description);\n }\n\n return customInstance<void>(\n {\n url: `/asset/${assetId}`,\n method: \"patch\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport const getPatchAssetMutationOptions = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof patchAsset>>,\n TError,\n { assetId: string; data: AssetPatchBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof patchAsset>>,\n TError,\n { assetId: string; data: AssetPatchBodyBody },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof patchAsset>>,\n { assetId: string; data: AssetPatchBodyBody }\n > = (props) => {\n const { assetId, data } = props ?? {};\n\n return patchAsset(assetId, data, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type PatchAssetMutationResult = NonNullable<\n Awaited<ReturnType<typeof patchAsset>>\n>;\nexport type PatchAssetMutationBody = AssetPatchBodyBody;\nexport type PatchAssetMutationError = ErrorType<AsError>;\n\nexport const usePatchAsset = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof patchAsset>>,\n TError,\n { assetId: string; data: AssetPatchBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getPatchAssetMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Deletes a known Asset. Assets that are attached to **Merchants** cannot be deleted\n\n * @summary Deletes an Asset\n */\nexport const deleteAsset = (\n assetId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/asset/${assetId}`, method: \"delete\" },\n options\n );\n};\n\nexport const getDeleteAssetMutationOptions = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteAsset>>,\n TError,\n { assetId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof deleteAsset>>,\n TError,\n { assetId: string },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteAsset>>,\n { assetId: string }\n > = (props) => {\n const { assetId } = props ?? {};\n\n return deleteAsset(assetId, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type DeleteAssetMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteAsset>>\n>;\n\nexport type DeleteAssetMutationError = ErrorType<AsError>;\n\nexport const useDeleteAsset = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteAsset>>,\n TError,\n { assetId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getDeleteAssetMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Disables a known Asset\n\n * @summary Disables an Asset\n */\nexport const disableAsset = (\n assetId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/asset/${assetId}/disable`, method: \"patch\" },\n options\n );\n};\n\nexport const getDisableAssetMutationOptions = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof disableAsset>>,\n TError,\n { assetId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof disableAsset>>,\n TError,\n { assetId: string },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof disableAsset>>,\n { assetId: string }\n > = (props) => {\n const { assetId } = props ?? {};\n\n return disableAsset(assetId, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type DisableAssetMutationResult = NonNullable<\n Awaited<ReturnType<typeof disableAsset>>\n>;\n\nexport type DisableAssetMutationError = ErrorType<AsError>;\n\nexport const useDisableAsset = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof disableAsset>>,\n TError,\n { assetId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getDisableAssetMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Enables a known Asset\n\n * @summary Enables an Asset\n */\nexport const enableAsset = (\n assetId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/asset/${assetId}/enable`, method: \"patch\" },\n options\n );\n};\n\nexport const getEnableAssetMutationOptions = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof enableAsset>>,\n TError,\n { assetId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof enableAsset>>,\n TError,\n { assetId: string },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof enableAsset>>,\n { assetId: string }\n > = (props) => {\n const { assetId } = props ?? {};\n\n return enableAsset(assetId, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type EnableAssetMutationResult = NonNullable<\n Awaited<ReturnType<typeof enableAsset>>\n>;\n\nexport type EnableAssetMutationError = ErrorType<AsError>;\n\nexport const useEnableAsset = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof enableAsset>>,\n TError,\n { assetId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getEnableAssetMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Attaches an Asset to a **Merchant**. This allows the **Merchant** to query the Asset. **Merchants** cannot obtain Assets that are not attached to them.\n\n * @summary Attaches an Asset to a Merchant\n */\nexport const attachAsset = (\n assetId: string,\n params?: AttachAssetParams,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/asset/${assetId}/attach`, method: \"patch\", params },\n options\n );\n};\n\nexport const getAttachAssetMutationOptions = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof attachAsset>>,\n TError,\n { assetId: string; params?: AttachAssetParams },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof attachAsset>>,\n TError,\n { assetId: string; params?: AttachAssetParams },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof attachAsset>>,\n { assetId: string; params?: AttachAssetParams }\n > = (props) => {\n const { assetId, params } = props ?? {};\n\n return attachAsset(assetId, params, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type AttachAssetMutationResult = NonNullable<\n Awaited<ReturnType<typeof attachAsset>>\n>;\n\nexport type AttachAssetMutationError = ErrorType<AsError>;\n\nexport const useAttachAsset = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof attachAsset>>,\n TError,\n { assetId: string; params?: AttachAssetParams },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getAttachAssetMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Detaches an Asset from a **Merchant**\n\n * @summary Detaches an Asset from a Merchant\n */\nexport const detachAsset = (\n assetId: string,\n params?: DetachAssetParams,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/asset/${assetId}/detach`, method: \"patch\", params },\n options\n );\n};\n\nexport const getDetachAssetMutationOptions = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof detachAsset>>,\n TError,\n { assetId: string; params?: DetachAssetParams },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof detachAsset>>,\n TError,\n { assetId: string; params?: DetachAssetParams },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof detachAsset>>,\n { assetId: string; params?: DetachAssetParams }\n > = (props) => {\n const { assetId, params } = props ?? {};\n\n return detachAsset(assetId, params, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type DetachAssetMutationResult = NonNullable<\n Awaited<ReturnType<typeof detachAsset>>\n>;\n\nexport type DetachAssetMutationError = ErrorType<AsError>;\n\nexport const useDetachAsset = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof detachAsset>>,\n TError,\n { assetId: string; params?: DetachAssetParams },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getDetachAssetMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n"],"mappings":";;;;;AAUA,SAAS,UAAU,mBAAmB;AAuC/B,IAAM,WAAW,CACtB,QACA,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,UAAU,QAAQ,OAAO,QAAQ,OAAO;AAAA,IAC/C;AAAA,EACF;AACF;AAEO,IAAM,sBAAsB,CAAC,WAClC,CAAC,sBAAsB,UAAU,GAAI,SAAS,CAAC,MAAM,IAAI,CAAC,CAAE;AAEvD,IAAM,0BAA0B,CAIrC,QACA,YAUG;AACH,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YAAW,6CAAc,aAAY,oBAAoB,MAAM;AAErE,QAAM,UAA+D,CAAC;AAAA,IACpE;AAAA,EACF,MAAM,SAAS,QAAQ,gBAAgB,MAAM;AAE7C,SAAO,EAAE,UAAU,SAAS,GAAG,aAAa;AAC9C;AAOO,IAAM,cAAc,CAIzB,QACA,YAQ2D;AAC3D,QAAM,eAAe,wBAAwB,QAAQ,OAAO;AAE5D,QAAM,QAAQ,SAAS,YAAY;AAInC,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT;AAOO,IAAM,cAAc,CACzB,mBACA,YACG;AACH,QAAM,WAAW,IAAI,SAAS;AAC9B,WAAS,OAAO,QAAQ,kBAAkB,IAAI;AAC9C,MAAI,kBAAkB,iBAAiB,QAAW;AAChD,aAAS,OAAO,gBAAgB,kBAAkB,YAAY;AAAA,EAChE;AACA,MAAI,kBAAkB,mBAAmB,QAAW;AAClD,aAAS,OAAO,kBAAkB,kBAAkB,cAAc;AAAA,EACpE;AACA,WAAS,O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ACF;AAEO,IAAM,gCAAgC,CAG3C,YAaG;AACH,QAAM,EAAE,UAAU,iBAAiB,SAAS,eAAe,IAAI,WAAW,CAAC;AAE3E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,SAAS,OAAO,IAAI,SAAS,CAAC;AAEtC,WAAO,YAAY,SAAS,QAAQ,cAAc;AAAA,EACpD;AAEA,SAAO,EAAE,YAAY,GAAG,gBAAgB;AAC1C;AAQO,IAAM,iBAAiB,CAG5B,YAQI;AACJ,QAAM,kBAAkB,8BAA8B,OAAO;AAE7D,SAAO,YAAY,eAAe;AACpC;","names":[]}
1
+ {"version":3,"sources":["../../src/asset/asset.ts"],"sourcesContent":["/**\n * Generated by orval v6.15.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 **Organisations**, **Units**, **Products**, **Users**, and **Assets**.\n\n * OpenAPI spec version: 2.1\n */\nimport { useQuery, useMutation } from \"@tanstack/react-query\";\nimport type {\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"@tanstack/react-query\";\nimport type {\n AssetGetResponse,\n AsError,\n GetAssetParams,\n AssetPostResponse,\n AssetPostBodyBody,\n AssetPatchBodyBody,\n AttachAssetParams,\n DetachAssetParams,\n} from \"../account-server-api.schemas\";\nimport { customInstance } from \".././custom-instance\";\nimport type { ErrorType } from \".././custom-instance\";\n\n// eslint-disable-next-line\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 Assets you have access to.\n\nAssets are text and file resources that can be attached to (have a *scope* that applies to) **User** accounts, **Products**, **Units**, **Organisations** or can be **Global**. Assets can be requested by **Merchants**. The Data Manager uses assets to provide additional information that's often sensitive to **Job** (and **Application**) **Instances**.\n\nUsers must *attach* an Asset to a **Merchant** before the **Merchant** can ue it\n\n * @summary Gets Assets\n */\nexport const getAsset = (\n params?: GetAssetParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<AssetGetResponse>(\n { url: `/asset`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetAssetQueryKey = (params?: GetAssetParams) =>\n [\"account-server-api\", `/asset`, ...(params ? [params] : [])] as const;\n\nexport const getGetAssetQueryOptions = <\n TData = Awaited<ReturnType<typeof getAsset>>,\n TError = ErrorType<AsError | void>\n>(\n params?: GetAssetParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getAsset>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData> & {\n queryKey: QueryKey;\n} => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetAssetQueryKey(params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getAsset>>> = ({\n signal,\n }) => getAsset(params, requestOptions, signal);\n\n return { queryKey, queryFn, ...queryOptions };\n};\n\nexport type GetAssetQueryResult = NonNullable<\n Awaited<ReturnType<typeof getAsset>>\n>;\nexport type GetAssetQueryError = ErrorType<AsError | void>;\n\nexport const useGetAsset = <\n TData = Awaited<ReturnType<typeof getAsset>>,\n TError = ErrorType<AsError | void>\n>(\n params?: GetAssetParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getAsset>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetAssetQueryOptions(params, options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n\n/**\n * Creates an Asset, which can be attached to a **User** account, a **Product**, **Unit**, **Organisation** or can be made **Global**\n\n * @summary Create an Asset\n */\nexport const createAsset = (\n assetPostBodyBody: AssetPostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n formData.append(\"name\", assetPostBodyBody.name);\n if (assetPostBodyBody.content_file !== undefined) {\n formData.append(\"content_file\", assetPostBodyBody.content_file);\n }\n if (assetPostBodyBody.content_string !== undefined) {\n formData.append(\"content_string\", assetPostBodyBody.content_string);\n }\n formData.append(\"scope\", assetPostBodyBody.scope);\n if (assetPostBodyBody.scope_id !== undefined) {\n formData.append(\"scope_id\", assetPostBodyBody.scope_id);\n }\n formData.append(\"secret\", assetPostBodyBody.secret.toString());\n if (assetPostBodyBody.description !== undefined) {\n formData.append(\"description\", assetPostBodyBody.description);\n }\n\n return customInstance<AssetPostResponse>(\n {\n url: `/asset`,\n method: \"post\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport const getCreateAssetMutationOptions = <\n TError = ErrorType<AsError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createAsset>>,\n TError,\n { data: AssetPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof createAsset>>,\n TError,\n { data: AssetPostBodyBody },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof createAsset>>,\n { data: AssetPostBodyBody }\n > = (props) => {\n const { data } = props ?? {};\n\n return createAsset(data, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type CreateAssetMutationResult = NonNullable<\n Awaited<ReturnType<typeof createAsset>>\n>;\nexport type CreateAssetMutationBody = AssetPostBodyBody;\nexport type CreateAssetMutationError = ErrorType<AsError | void>;\n\nexport const useCreateAsset = <\n TError = ErrorType<AsError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createAsset>>,\n TError,\n { data: AssetPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getCreateAssetMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Used to update or replace Asset *Content* or *Description*.\n\nThe content of an Asset currently in use will not be affected by a change made here. If a **Merchant** has already obtained the Asset it may continue to use the original value until the **Merchant** requests the **Asset** again.\n\n * @summary Adjust an existing Asset\n */\nexport const patchAsset = (\n assetId: string,\n assetPatchBodyBody: AssetPatchBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n if (assetPatchBodyBody.content_file !== undefined) {\n formData.append(\"content_file\", assetPatchBodyBody.content_file);\n }\n if (assetPatchBodyBody.content_string !== undefined) {\n formData.append(\"content_string\", assetPatchBodyBody.content_string);\n }\n if (assetPatchBodyBody.description !== undefined) {\n formData.append(\"description\", assetPatchBodyBody.description);\n }\n\n return customInstance<void>(\n {\n url: `/asset/${assetId}`,\n method: \"patch\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport const getPatchAssetMutationOptions = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof patchAsset>>,\n TError,\n { assetId: string; data: AssetPatchBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof patchAsset>>,\n TError,\n { assetId: string; data: AssetPatchBodyBody },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof patchAsset>>,\n { assetId: string; data: AssetPatchBodyBody }\n > = (props) => {\n const { assetId, data } = props ?? {};\n\n return patchAsset(assetId, data, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type PatchAssetMutationResult = NonNullable<\n Awaited<ReturnType<typeof patchAsset>>\n>;\nexport type PatchAssetMutationBody = AssetPatchBodyBody;\nexport type PatchAssetMutationError = ErrorType<AsError>;\n\nexport const usePatchAsset = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof patchAsset>>,\n TError,\n { assetId: string; data: AssetPatchBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getPatchAssetMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Deletes a known Asset. Assets that are attached to **Merchants** cannot be deleted\n\n * @summary Deletes an Asset\n */\nexport const deleteAsset = (\n assetId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/asset/${assetId}`, method: \"delete\" },\n options\n );\n};\n\nexport const getDeleteAssetMutationOptions = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteAsset>>,\n TError,\n { assetId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof deleteAsset>>,\n TError,\n { assetId: string },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteAsset>>,\n { assetId: string }\n > = (props) => {\n const { assetId } = props ?? {};\n\n return deleteAsset(assetId, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type DeleteAssetMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteAsset>>\n>;\n\nexport type DeleteAssetMutationError = ErrorType<AsError>;\n\nexport const useDeleteAsset = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteAsset>>,\n TError,\n { assetId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getDeleteAssetMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Disables a known Asset\n\n * @summary Disables an Asset\n */\nexport const disableAsset = (\n assetId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/asset/${assetId}/disable`, method: \"patch\" },\n options\n );\n};\n\nexport const getDisableAssetMutationOptions = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof disableAsset>>,\n TError,\n { assetId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof disableAsset>>,\n TError,\n { assetId: string },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof disableAsset>>,\n { assetId: string }\n > = (props) => {\n const { assetId } = props ?? {};\n\n return disableAsset(assetId, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type DisableAssetMutationResult = NonNullable<\n Awaited<ReturnType<typeof disableAsset>>\n>;\n\nexport type DisableAssetMutationError = ErrorType<AsError>;\n\nexport const useDisableAsset = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof disableAsset>>,\n TError,\n { assetId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getDisableAssetMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Enables a known Asset\n\n * @summary Enables an Asset\n */\nexport const enableAsset = (\n assetId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/asset/${assetId}/enable`, method: \"patch\" },\n options\n );\n};\n\nexport const getEnableAssetMutationOptions = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof enableAsset>>,\n TError,\n { assetId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof enableAsset>>,\n TError,\n { assetId: string },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof enableAsset>>,\n { assetId: string }\n > = (props) => {\n const { assetId } = props ?? {};\n\n return enableAsset(assetId, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type EnableAssetMutationResult = NonNullable<\n Awaited<ReturnType<typeof enableAsset>>\n>;\n\nexport type EnableAssetMutationError = ErrorType<AsError>;\n\nexport const useEnableAsset = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof enableAsset>>,\n TError,\n { assetId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getEnableAssetMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Attaches an Asset to a **Merchant**. This allows the **Merchant** to query the Asset. **Merchants** cannot obtain Assets that are not attached to them.\n\n * @summary Attaches an Asset to a Merchant\n */\nexport const attachAsset = (\n assetId: string,\n params?: AttachAssetParams,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/asset/${assetId}/attach`, method: \"patch\", params },\n options\n );\n};\n\nexport const getAttachAssetMutationOptions = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof attachAsset>>,\n TError,\n { assetId: string; params?: AttachAssetParams },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof attachAsset>>,\n TError,\n { assetId: string; params?: AttachAssetParams },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof attachAsset>>,\n { assetId: string; params?: AttachAssetParams }\n > = (props) => {\n const { assetId, params } = props ?? {};\n\n return attachAsset(assetId, params, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type AttachAssetMutationResult = NonNullable<\n Awaited<ReturnType<typeof attachAsset>>\n>;\n\nexport type AttachAssetMutationError = ErrorType<AsError>;\n\nexport const useAttachAsset = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof attachAsset>>,\n TError,\n { assetId: string; params?: AttachAssetParams },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getAttachAssetMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Detaches an Asset from a **Merchant**\n\n * @summary Detaches an Asset from a Merchant\n */\nexport const detachAsset = (\n assetId: string,\n params?: DetachAssetParams,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/asset/${assetId}/detach`, method: \"patch\", params },\n options\n );\n};\n\nexport const getDetachAssetMutationOptions = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof detachAsset>>,\n TError,\n { assetId: string; params?: DetachAssetParams },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof detachAsset>>,\n TError,\n { assetId: string; params?: DetachAssetParams },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof detachAsset>>,\n { assetId: string; params?: DetachAssetParams }\n > = (props) => {\n const { assetId, params } = props ?? {};\n\n return detachAsset(assetId, params, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type DetachAssetMutationResult = NonNullable<\n Awaited<ReturnType<typeof detachAsset>>\n>;\n\nexport type DetachAssetMutationError = ErrorType<AsError>;\n\nexport const useDetachAsset = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof detachAsset>>,\n TError,\n { assetId: string; params?: DetachAssetParams },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getDetachAssetMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n"],"mappings":";;;;;AAUA,SAAS,UAAU,mBAAmB;AAuC/B,IAAM,WAAW,CACtB,QACA,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,UAAU,QAAQ,OAAO,QAAQ,OAAO;AAAA,IAC/C;AAAA,EACF;AACF;AAEO,IAAM,sBAAsB,CAAC,WAClC,CAAC,sBAAsB,UAAU,GAAI,SAAS,CAAC,MAAM,IAAI,CAAC,CAAE;AAEvD,IAAM,0BAA0B,CAIrC,QACA,YAUG;AACH,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YAAW,6CAAc,aAAY,oBAAoB,MAAM;AAErE,QAAM,UAA+D,CAAC;AAAA,IACpE;AAAA,EACF,MAAM,SAAS,QAAQ,gBAAgB,MAAM;AAE7C,SAAO,EAAE,UAAU,SAAS,GAAG,aAAa;AAC9C;AAOO,IAAM,cAAc,CAIzB,QACA,YAQ2D;AAC3D,QAAM,eAAe,wBAAwB,QAAQ,OAAO;AAE5D,QAAM,QAAQ,SAAS,YAAY;AAInC,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT;AAOO,IAAM,cAAc,CACzB,mBACA,YACG;AACH,QAAM,WAAW,IAAI,SAAS;AAC9B,WAAS,OAAO,QAAQ,kBAAkB,IAAI;AAC9C,MAAI,kBAAkB,iBAAiB,QAAW;AAChD,aAAS,OAAO,gBAAgB,kBAAkB,YAAY;AAAA,EAChE;AACA,MAAI,kBAAkB,mBAAmB,QAAW;AAClD,aAAS,OAAO,kBAAkB,kBAAkB,cAAc;AAAA,EACpE;AACA,WAAS,OAAO,SAAS,kBAAkB,KAAK;AAChD,MAAI,kBAAkB,aAAa,QAAW;AAC5C,aAAS,OAAO,YAAY,kBAAkB,QAAQ;AAAA,EACxD;AACA,WAAS,OAAO,UAAU,kB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AAM,EAAE,SAAS,OAAO,IAAI,SAAS,CAAC;AAEtC,WAAO,YAAY,SAAS,QAAQ,cAAc;AAAA,EACpD;AAEA,SAAO,EAAE,YAAY,GAAG,gBAAgB;AAC1C;AAQO,IAAM,iBAAiB,CAG5B,YAQI;AACJ,QAAM,kBAAkB,8BAA8B,OAAO;AAE7D,SAAO,YAAY,eAAe;AACpC;","names":[]}
@@ -9,7 +9,7 @@ import { AxiosRequestConfig, AxiosError } from 'axios';
9
9
 
10
10
  A service that provides access to the Account Server, which gives *registered* users access to and management of **Organisations**, **Units**, **Products**, **Users**, and **Assets**.
11
11
 
12
- * OpenAPI spec version: 2.0
12
+ * OpenAPI spec version: 2.1
13
13
  */
14
14
  type DetachAssetParams = {
15
15
  /**
@@ -656,6 +656,12 @@ interface StateGetVersionResponse {
656
656
  */
657
657
  version: string;
658
658
  }
659
+ interface EventStreamGetPostResponse {
660
+ /** The EventStream ID */
661
+ id: number;
662
+ /** The EventStream read token, required to read from the stream */
663
+ read_token: string;
664
+ }
659
665
  interface ChargesGetResponse {
660
666
  coins: string;
661
667
  summary: ChargeSummary[];
@@ -691,4 +697,4 @@ declare const setBaseUrl: (baseUrl: string) => void;
691
697
  declare const customInstance: <TReturn>(config: AxiosRequestConfig, options?: AxiosRequestConfig) => Promise<TReturn>;
692
698
  type ErrorType<TError> = AxiosError<TError>;
693
699
 
694
- export { ProcessingChargesMerchantKind as $, AttachAssetParams as A, OrganisationDetail as B, ProductTypeServiceKind as C, DetachAssetParams as D, ProductType as E, ProductInstanceDetailCoins as F, GetOrganisationChargesParams as G, ProductInstanceDetail as H, ProductDetailFlavour as I, ProductDetailType as J, ProductDetail as K, ProductCoinsDetail as L, MerchantDetailKind as M, ProductClaimDetail as N, OrganisationPatchBodyBody as O, ProductPatchBodyBody as P, QUntilParameter as Q, ProductDmStorageDetailCoins as R, ProductDmStorageDetailSize as S, ProductDmStorageDetail as T, UnitProductPostBodyBodyFlavour as U, ProductDmProjectTier as V, ProductDmStorage as W, ChargeAdditionalData as X, StorageChargeItem as Y, StorageCharges as Z, ProcessingChargeItem as _, QFromParameter as a, ProcessingCharges as a0, AssetDetailScope as a1, AssetDetail as a2, UserAccountGetResponse as a3, UnitsGetResponse as a4, UnitGetResponse as a5, UnitProductPostResponse as a6, ChargeSummaryType as a7, ChargeSummary as a8, UnitProductChargeSummary as a9, AsError as aA, AXIOS_INSTANCE as aB, setAuthToken as aC, setBaseUrl as aD, customInstance as aE, ErrorType as aF, UnitChargeSummary as aa, UnitChargesGetResponse as ab, ProductUnitGetResponseProduct as ac, ProductUnitGetResponse as ad, ProductsGetTypesResponse as ae, ProductsGetDefaultStorageCostDefaultStorageCost as af, ProductsGetDefaultStorageCost as ag, ProductsGetResponseProductsItem as ah, ProductsGetResponse as ai, ProductChargesGetResponseProductType as aj, ProductChargesGetResponse as ak, OrganisationGetResponse as al, OrganisationsGetResponse as am, OrganisationUnitChargeSummary as an, OrganisationChargesGetResponse as ao, OrganisationUnitsGetResponse as ap, OrganisationChargeSummary as aq, PersonalUnitPutResponse as ar, OrganisationUnitPostResponse as as, OrganisationGetDefaultResponse as at, UsersGetResponse as au, OrganisationPostResponse as av, StateGetVersionResponse as aw, ChargesGetResponse as ax, AssetPostResponse as ay, AssetGetResponse as az, GetProductChargesParams as b, GetChargesParams as c, QUserIdParameter as d, QProductIdParameter as e, QUnitIdParameter as f, GetAssetParams as g, QMIdParameter as h, QOrgIdParameter as i, QPbpParameter as j, GetUnitChargesParams as k, UnitProductPostBodyBodyType as l, UnitProductPostBodyBody as m, UnitPatchBodyBody as n, OrganisationUnitPostBodyBody as o, PersonalUnitPutBodyBody as p, OrganisationPostBodyBody as q, AssetPostBodyBodyScope as r, AssetPostBodyBody as s, AssetPatchBodyBody as t, UserDetail as u, UserAccountDetail as v, UnitDetail as w, MerchantDetail as x, MerchantGetResponse as y, MerchantsGetResponse as z };
700
+ export { ProcessingChargesMerchantKind as $, AttachAssetParams as A, OrganisationDetail as B, ProductTypeServiceKind as C, DetachAssetParams as D, ProductType as E, ProductInstanceDetailCoins as F, GetOrganisationChargesParams as G, ProductInstanceDetail as H, ProductDetailFlavour as I, ProductDetailType as J, ProductDetail as K, ProductCoinsDetail as L, MerchantDetailKind as M, ProductClaimDetail as N, OrganisationPatchBodyBody as O, ProductPatchBodyBody as P, QUntilParameter as Q, ProductDmStorageDetailCoins as R, ProductDmStorageDetailSize as S, ProductDmStorageDetail as T, UnitProductPostBodyBodyFlavour as U, ProductDmProjectTier as V, ProductDmStorage as W, ChargeAdditionalData as X, StorageChargeItem as Y, StorageCharges as Z, ProcessingChargeItem as _, QFromParameter as a, ProcessingCharges as a0, AssetDetailScope as a1, AssetDetail as a2, UserAccountGetResponse as a3, UnitsGetResponse as a4, UnitGetResponse as a5, UnitProductPostResponse as a6, ChargeSummaryType as a7, ChargeSummary as a8, UnitProductChargeSummary as a9, AssetGetResponse as aA, AsError as aB, AXIOS_INSTANCE as aC, setAuthToken as aD, setBaseUrl as aE, customInstance as aF, ErrorType as aG, UnitChargeSummary as aa, UnitChargesGetResponse as ab, ProductUnitGetResponseProduct as ac, ProductUnitGetResponse as ad, ProductsGetTypesResponse as ae, ProductsGetDefaultStorageCostDefaultStorageCost as af, ProductsGetDefaultStorageCost as ag, ProductsGetResponseProductsItem as ah, ProductsGetResponse as ai, ProductChargesGetResponseProductType as aj, ProductChargesGetResponse as ak, OrganisationGetResponse as al, OrganisationsGetResponse as am, OrganisationUnitChargeSummary as an, OrganisationChargesGetResponse as ao, OrganisationUnitsGetResponse as ap, OrganisationChargeSummary as aq, PersonalUnitPutResponse as ar, OrganisationUnitPostResponse as as, OrganisationGetDefaultResponse as at, UsersGetResponse as au, OrganisationPostResponse as av, StateGetVersionResponse as aw, EventStreamGetPostResponse as ax, ChargesGetResponse as ay, AssetPostResponse as az, GetProductChargesParams as b, GetChargesParams as c, QUserIdParameter as d, QProductIdParameter as e, QUnitIdParameter as f, GetAssetParams as g, QMIdParameter as h, QOrgIdParameter as i, QPbpParameter as j, GetUnitChargesParams as k, UnitProductPostBodyBodyType as l, UnitProductPostBodyBody as m, UnitPatchBodyBody as n, OrganisationUnitPostBodyBody as o, PersonalUnitPutBodyBody as p, OrganisationPostBodyBody as q, AssetPostBodyBodyScope as r, AssetPostBodyBody as s, AssetPatchBodyBody as t, UserDetail as u, UserAccountDetail as v, UnitDetail as w, MerchantDetail as x, MerchantGetResponse as y, MerchantsGetResponse as z };
@@ -0,0 +1,101 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
2
+
3
+ var _chunkUZTHSGDTcjs = require('../chunk-UZTHSGDT.cjs');
4
+
5
+ // src/event-stream/event-stream.ts
6
+ var _reactquery = require('@tanstack/react-query');
7
+ var getEventStream = (options, signal) => {
8
+ return _chunkUZTHSGDTcjs.customInstance.call(void 0,
9
+ { url: `/event-stream`, method: "get", signal },
10
+ options
11
+ );
12
+ };
13
+ var getGetEventStreamQueryKey = () => ["account-server-api", `/event-stream`];
14
+ var getGetEventStreamQueryOptions = (options) => {
15
+ const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
16
+ const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetEventStreamQueryKey()));
17
+ const queryFn = ({
18
+ signal
19
+ }) => getEventStream(requestOptions, signal);
20
+ return { queryKey, queryFn, ...queryOptions };
21
+ };
22
+ var useGetEventStream = (options) => {
23
+ const queryOptions = getGetEventStreamQueryOptions(options);
24
+ const query = _reactquery.useQuery.call(void 0, queryOptions);
25
+ query.queryKey = queryOptions.queryKey;
26
+ return query;
27
+ };
28
+ var createEventStream = (options) => {
29
+ return _chunkUZTHSGDTcjs.customInstance.call(void 0,
30
+ { url: `/event-stream`, method: "post" },
31
+ options
32
+ );
33
+ };
34
+ var getCreateEventStreamMutationOptions = (options) => {
35
+ const { mutation: mutationOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
36
+ const mutationFn = () => {
37
+ return createEventStream(requestOptions);
38
+ };
39
+ return { mutationFn, ...mutationOptions };
40
+ };
41
+ var useCreateEventStream = (options) => {
42
+ const mutationOptions = getCreateEventStreamMutationOptions(options);
43
+ return _reactquery.useMutation.call(void 0, mutationOptions);
44
+ };
45
+ var getEventStreamEvents = (eventStreamId, options, signal) => {
46
+ return _chunkUZTHSGDTcjs.customInstance.call(void 0,
47
+ { url: `/event-stream/${eventStreamId}`, method: "get", signal },
48
+ options
49
+ );
50
+ };
51
+ var getGetEventStreamEventsQueryKey = (eventStreamId) => ["account-server-api", `/event-stream/${eventStreamId}`];
52
+ var getGetEventStreamEventsQueryOptions = (eventStreamId, options) => {
53
+ const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
54
+ const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetEventStreamEventsQueryKey(eventStreamId)));
55
+ const queryFn = ({ signal }) => getEventStreamEvents(eventStreamId, requestOptions, signal);
56
+ return { queryKey, queryFn, enabled: !!eventStreamId, ...queryOptions };
57
+ };
58
+ var useGetEventStreamEvents = (eventStreamId, options) => {
59
+ const queryOptions = getGetEventStreamEventsQueryOptions(
60
+ eventStreamId,
61
+ options
62
+ );
63
+ const query = _reactquery.useQuery.call(void 0, queryOptions);
64
+ query.queryKey = queryOptions.queryKey;
65
+ return query;
66
+ };
67
+ var deleteEventStream = (eventStreamId, options) => {
68
+ return _chunkUZTHSGDTcjs.customInstance.call(void 0,
69
+ { url: `/event-stream/${eventStreamId}`, method: "delete" },
70
+ options
71
+ );
72
+ };
73
+ var getDeleteEventStreamMutationOptions = (options) => {
74
+ const { mutation: mutationOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
75
+ const mutationFn = (props) => {
76
+ const { eventStreamId } = _nullishCoalesce(props, () => ( {}));
77
+ return deleteEventStream(eventStreamId, requestOptions);
78
+ };
79
+ return { mutationFn, ...mutationOptions };
80
+ };
81
+ var useDeleteEventStream = (options) => {
82
+ const mutationOptions = getDeleteEventStreamMutationOptions(options);
83
+ return _reactquery.useMutation.call(void 0, mutationOptions);
84
+ };
85
+
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+
97
+
98
+
99
+
100
+ exports.createEventStream = createEventStream; exports.deleteEventStream = deleteEventStream; exports.getCreateEventStreamMutationOptions = getCreateEventStreamMutationOptions; exports.getDeleteEventStreamMutationOptions = getDeleteEventStreamMutationOptions; exports.getEventStream = getEventStream; exports.getEventStreamEvents = getEventStreamEvents; exports.getGetEventStreamEventsQueryKey = getGetEventStreamEventsQueryKey; exports.getGetEventStreamEventsQueryOptions = getGetEventStreamEventsQueryOptions; exports.getGetEventStreamQueryKey = getGetEventStreamQueryKey; exports.getGetEventStreamQueryOptions = getGetEventStreamQueryOptions; exports.useCreateEventStream = useCreateEventStream; exports.useDeleteEventStream = useDeleteEventStream; exports.useGetEventStream = useGetEventStream; exports.useGetEventStreamEvents = useGetEventStreamEvents;
101
+ //# sourceMappingURL=event-stream.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/event-stream/event-stream.ts"],"names":[],"mappings":";;;;;AAUA,SAAS,UAAU,mBAAmB;AA6B/B,IAAM,iBAAiB,CAC5B,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,iBAAiB,QAAQ,OAAO,OAAO;AAAA,IAC9C;AAAA,EACF;AACF;AAEO,IAAM,4BAA4B,MAAM,CAAC,sBAAsB,eAAe;AAE9E,IAAM,gCAAgC,CAG3C,YAW4B;AAC5B,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YAAW,6CAAc,aAAY,0BAA0B;AAErE,QAAM,UAAqE,CAAC;AAAA,IAC1E;AAAA,EACF,MAAM,eAAe,gBAAgB,MAAM;AAE3C,SAAO,EAAE,UAAU,SAAS,GAAG,aAAa;AAC9C;AAOO,IAAM,oBAAoB,CAG/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G;AACH,SAAO;AAAA,IACL,EAAE,KAAK,iBAAiB,iBAAiB,QAAQ,SAAS;AAAA,IAC1D;AAAA,EACF;AACF;AAEO,IAAM,sCAAsC,CAGjD,YAaG;AACH,QAAM,EAAE,UAAU,iBAAiB,SAAS,eAAe,IAAI,WAAW,CAAC;AAE3E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,cAAc,IAAI,SAAS,CAAC;AAEpC,WAAO,kBAAkB,eAAe,cAAc;AAAA,EACxD;AAEA,SAAO,EAAE,YAAY,GAAG,gBAAgB;AAC1C;AAQO,IAAM,uBAAuB,CAGlC,YAQI;AACJ,QAAM,kBAAkB,oCAAoC,OAAO;AAEnE,SAAO,YAAY,eAAe;AACpC","sourcesContent":["/**\n * Generated by orval v6.15.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 **Organisations**, **Units**, **Products**, **Users**, and **Assets**.\n\n * OpenAPI spec version: 2.1\n */\nimport { useQuery, useMutation } from \"@tanstack/react-query\";\nimport type {\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"@tanstack/react-query\";\nimport type {\n EventStreamGetPostResponse,\n AsError,\n} from \"../account-server-api.schemas\";\nimport { customInstance } from \".././custom-instance\";\nimport type { ErrorType } from \".././custom-instance\";\n\n// eslint-disable-next-line\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 your EventStream ID and read token, if you have created one.\n\n * @summary Gets the details of your EventStream\n */\nexport const getEventStream = (\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<EventStreamGetPostResponse>(\n { url: `/event-stream`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetEventStreamQueryKey = () => [\"account-server-api\", `/event-stream`] as const;\n\nexport const getGetEventStreamQueryOptions = <\n TData = Awaited<ReturnType<typeof getEventStream>>,\n TError = ErrorType<void | AsError>\n>(options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getEventStream>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryOptions<\n Awaited<ReturnType<typeof getEventStream>>,\n TError,\n TData\n> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetEventStreamQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getEventStream>>> = ({\n signal,\n }) => getEventStream(requestOptions, signal);\n\n return { queryKey, queryFn, ...queryOptions };\n};\n\nexport type GetEventStreamQueryResult = NonNullable<\n Awaited<ReturnType<typeof getEventStream>>\n>;\nexport type GetEventStreamQueryError = ErrorType<void | AsError>;\n\nexport const useGetEventStream = <\n TData = Awaited<ReturnType<typeof getEventStream>>,\n TError = ErrorType<void | AsError>\n>(options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getEventStream>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetEventStreamQueryOptions(options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n\n/**\n * Creates a new event stream (based on the **Server Sent Events** framework) for the authenticated user.\n\nA user is only permitted one event stream.\n\n * @summary Create a new Server-Sent Events EventStream\n */\nexport const createEventStream = (\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<EventStreamGetPostResponse>(\n { url: `/event-stream`, method: \"post\" },\n options\n );\n};\n\nexport const getCreateEventStreamMutationOptions = <\n TError = ErrorType<AsError | void>,\n TVariables = void,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createEventStream>>,\n TError,\n TVariables,\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof createEventStream>>,\n TError,\n TVariables,\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof createEventStream>>,\n TVariables\n > = () => {\n return createEventStream(requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type CreateEventStreamMutationResult = NonNullable<\n Awaited<ReturnType<typeof createEventStream>>\n>;\n\nexport type CreateEventStreamMutationError = ErrorType<AsError | void>;\n\nexport const useCreateEventStream = <\n TError = ErrorType<AsError | void>,\n TVariables = void,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createEventStream>>,\n TError,\n TVariables,\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getCreateEventStreamMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Gets events that you are entitled to receive. Events are delivered as **Server Sent Events** and you are expected to continuously read form this endpoint or it will be closed.\n\nThis is an un-authenticated endpoint. In order to read from the stream the caller must provide the **read token** they were allocated when the stream was created The token must be provided in the request header property `X-IM-AS-EventStreamReadToken`.\n\n * @summary Subscribe to Server-Sent Events events from an EventStream\n */\nexport const getEventStreamEvents = (\n eventStreamId: number,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<string>(\n { url: `/event-stream/${eventStreamId}`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetEventStreamEventsQueryKey = (eventStreamId: number) =>\n [\"account-server-api\", `/event-stream/${eventStreamId}`] as const;\n\nexport const getGetEventStreamEventsQueryOptions = <\n TData = Awaited<ReturnType<typeof getEventStreamEvents>>,\n TError = ErrorType<void | AsError>\n>(\n eventStreamId: number,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getEventStreamEvents>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryOptions<\n Awaited<ReturnType<typeof getEventStreamEvents>>,\n TError,\n TData\n> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetEventStreamEventsQueryKey(eventStreamId);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getEventStreamEvents>>\n > = ({ signal }) =>\n getEventStreamEvents(eventStreamId, requestOptions, signal);\n\n return { queryKey, queryFn, enabled: !!eventStreamId, ...queryOptions };\n};\n\nexport type GetEventStreamEventsQueryResult = NonNullable<\n Awaited<ReturnType<typeof getEventStreamEvents>>\n>;\nexport type GetEventStreamEventsQueryError = ErrorType<void | AsError>;\n\nexport const useGetEventStreamEvents = <\n TData = Awaited<ReturnType<typeof getEventStreamEvents>>,\n TError = ErrorType<void | AsError>\n>(\n eventStreamId: number,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getEventStreamEvents>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetEventStreamEventsQueryOptions(\n eventStreamId,\n options\n );\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n\n/**\n * Deletes an Event Stream.\n\nYou must be the user who created the event stream.\n\n * @summary Deletes an existing EventStream (that you created)\n */\nexport const deleteEventStream = (\n eventStreamId: number,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/event-stream/${eventStreamId}`, method: \"delete\" },\n options\n );\n};\n\nexport const getDeleteEventStreamMutationOptions = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteEventStream>>,\n TError,\n { eventStreamId: number },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof deleteEventStream>>,\n TError,\n { eventStreamId: number },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteEventStream>>,\n { eventStreamId: number }\n > = (props) => {\n const { eventStreamId } = props ?? {};\n\n return deleteEventStream(eventStreamId, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type DeleteEventStreamMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteEventStream>>\n>;\n\nexport type DeleteEventStreamMutationError = ErrorType<AsError>;\n\nexport const useDeleteEventStream = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteEventStream>>,\n TError,\n { eventStreamId: number },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getDeleteEventStreamMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n"]}
@@ -0,0 +1,96 @@
1
+ import * as _tanstack_react_query from '@tanstack/react-query';
2
+ import { UseQueryOptions, QueryKey, UseQueryResult, UseMutationOptions } from '@tanstack/react-query';
3
+ import { aF as customInstance, ax as EventStreamGetPostResponse, aG as ErrorType, aB as AsError } from '../custom-instance-35e5d4fd.js';
4
+ import 'axios';
5
+
6
+ type SecondParameter<T extends (...args: any) => any> = T extends (config: any, args: infer P) => any ? P : never;
7
+ /**
8
+ * Gets your EventStream ID and read token, if you have created one.
9
+
10
+ * @summary Gets the details of your EventStream
11
+ */
12
+ declare const getEventStream: (options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<EventStreamGetPostResponse>;
13
+ declare const getGetEventStreamQueryKey: () => readonly ["account-server-api", "/event-stream"];
14
+ declare const getGetEventStreamQueryOptions: <TData = EventStreamGetPostResponse, TError = ErrorType<void | AsError>>(options?: {
15
+ query?: UseQueryOptions<EventStreamGetPostResponse, TError, TData, QueryKey> | undefined;
16
+ request?: SecondParameter<typeof customInstance>;
17
+ } | undefined) => UseQueryOptions<EventStreamGetPostResponse, TError, TData, QueryKey> & {
18
+ queryKey: QueryKey;
19
+ };
20
+ type GetEventStreamQueryResult = NonNullable<Awaited<ReturnType<typeof getEventStream>>>;
21
+ type GetEventStreamQueryError = ErrorType<void | AsError>;
22
+ declare const useGetEventStream: <TData = EventStreamGetPostResponse, TError = ErrorType<void | AsError>>(options?: {
23
+ query?: UseQueryOptions<EventStreamGetPostResponse, TError, TData, QueryKey> | undefined;
24
+ request?: SecondParameter<typeof customInstance>;
25
+ } | undefined) => UseQueryResult<TData, TError> & {
26
+ queryKey: QueryKey;
27
+ };
28
+ /**
29
+ * Creates a new event stream (based on the **Server Sent Events** framework) for the authenticated user.
30
+
31
+ A user is only permitted one event stream.
32
+
33
+ * @summary Create a new Server-Sent Events EventStream
34
+ */
35
+ declare const createEventStream: (options?: SecondParameter<typeof customInstance>) => Promise<EventStreamGetPostResponse>;
36
+ declare const getCreateEventStreamMutationOptions: <TError = ErrorType<void | AsError>, TVariables = void, TContext = unknown>(options?: {
37
+ mutation?: UseMutationOptions<EventStreamGetPostResponse, TError, TVariables, TContext> | undefined;
38
+ request?: SecondParameter<typeof customInstance>;
39
+ } | undefined) => UseMutationOptions<EventStreamGetPostResponse, TError, TVariables, TContext>;
40
+ type CreateEventStreamMutationResult = NonNullable<Awaited<ReturnType<typeof createEventStream>>>;
41
+ type CreateEventStreamMutationError = ErrorType<AsError | void>;
42
+ declare const useCreateEventStream: <TError = ErrorType<void | AsError>, TVariables = void, TContext = unknown>(options?: {
43
+ mutation?: UseMutationOptions<EventStreamGetPostResponse, TError, TVariables, TContext> | undefined;
44
+ request?: SecondParameter<typeof customInstance>;
45
+ } | undefined) => _tanstack_react_query.UseMutationResult<EventStreamGetPostResponse, TError, TVariables, TContext>;
46
+ /**
47
+ * Gets events that you are entitled to receive. Events are delivered as **Server Sent Events** and you are expected to continuously read form this endpoint or it will be closed.
48
+
49
+ This is an un-authenticated endpoint. In order to read from the stream the caller must provide the **read token** they were allocated when the stream was created The token must be provided in the request header property `X-IM-AS-EventStreamReadToken`.
50
+
51
+ * @summary Subscribe to Server-Sent Events events from an EventStream
52
+ */
53
+ declare const getEventStreamEvents: (eventStreamId: number, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<string>;
54
+ declare const getGetEventStreamEventsQueryKey: (eventStreamId: number) => readonly ["account-server-api", `/event-stream/${number}`];
55
+ declare const getGetEventStreamEventsQueryOptions: <TData = string, TError = ErrorType<void | AsError>>(eventStreamId: number, options?: {
56
+ query?: UseQueryOptions<string, TError, TData, QueryKey> | undefined;
57
+ request?: SecondParameter<typeof customInstance>;
58
+ } | undefined) => UseQueryOptions<string, TError, TData, QueryKey> & {
59
+ queryKey: QueryKey;
60
+ };
61
+ type GetEventStreamEventsQueryResult = NonNullable<Awaited<ReturnType<typeof getEventStreamEvents>>>;
62
+ type GetEventStreamEventsQueryError = ErrorType<void | AsError>;
63
+ declare const useGetEventStreamEvents: <TData = string, TError = ErrorType<void | AsError>>(eventStreamId: number, options?: {
64
+ query?: UseQueryOptions<string, TError, TData, QueryKey> | undefined;
65
+ request?: SecondParameter<typeof customInstance>;
66
+ } | undefined) => UseQueryResult<TData, TError> & {
67
+ queryKey: QueryKey;
68
+ };
69
+ /**
70
+ * Deletes an Event Stream.
71
+
72
+ You must be the user who created the event stream.
73
+
74
+ * @summary Deletes an existing EventStream (that you created)
75
+ */
76
+ declare const deleteEventStream: (eventStreamId: number, options?: SecondParameter<typeof customInstance>) => Promise<void>;
77
+ declare const getDeleteEventStreamMutationOptions: <TError = ErrorType<AsError>, TContext = unknown>(options?: {
78
+ mutation?: UseMutationOptions<void, TError, {
79
+ eventStreamId: number;
80
+ }, TContext> | undefined;
81
+ request?: SecondParameter<typeof customInstance>;
82
+ } | undefined) => UseMutationOptions<void, TError, {
83
+ eventStreamId: number;
84
+ }, TContext>;
85
+ type DeleteEventStreamMutationResult = NonNullable<Awaited<ReturnType<typeof deleteEventStream>>>;
86
+ type DeleteEventStreamMutationError = ErrorType<AsError>;
87
+ declare const useDeleteEventStream: <TError = ErrorType<AsError>, TContext = unknown>(options?: {
88
+ mutation?: UseMutationOptions<void, TError, {
89
+ eventStreamId: number;
90
+ }, TContext> | undefined;
91
+ request?: SecondParameter<typeof customInstance>;
92
+ } | undefined) => _tanstack_react_query.UseMutationResult<void, TError, {
93
+ eventStreamId: number;
94
+ }, TContext>;
95
+
96
+ export { CreateEventStreamMutationError, CreateEventStreamMutationResult, DeleteEventStreamMutationError, DeleteEventStreamMutationResult, GetEventStreamEventsQueryError, GetEventStreamEventsQueryResult, GetEventStreamQueryError, GetEventStreamQueryResult, createEventStream, deleteEventStream, getCreateEventStreamMutationOptions, getDeleteEventStreamMutationOptions, getEventStream, getEventStreamEvents, getGetEventStreamEventsQueryKey, getGetEventStreamEventsQueryOptions, getGetEventStreamQueryKey, getGetEventStreamQueryOptions, useCreateEventStream, useDeleteEventStream, useGetEventStream, useGetEventStreamEvents };