@squonk/account-server-client 2.1.0-rc.1 → 2.1.0-rc.11

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 (78) hide show
  1. package/README.md +1 -1
  2. package/admin/admin.cjs +30 -8
  3. package/admin/admin.cjs.map +1 -1
  4. package/admin/admin.d.cts +50 -0
  5. package/admin/admin.d.ts +26 -6
  6. package/admin/admin.js +30 -8
  7. package/admin/admin.js.map +1 -1
  8. package/asset/asset.cjs +62 -22
  9. package/asset/asset.cjs.map +1 -1
  10. package/asset/asset.d.cts +260 -0
  11. package/asset/asset.d.ts +79 -36
  12. package/asset/asset.js +54 -14
  13. package/asset/asset.js.map +1 -1
  14. package/{chunk-3RNIDX7T.js → chunk-EBOQPVLG.js} +2 -2
  15. package/{chunk-3RNIDX7T.js.map → chunk-EBOQPVLG.js.map} +1 -1
  16. package/{chunk-UZTHSGDT.cjs → chunk-TKLTUR4R.cjs} +2 -2
  17. package/chunk-TKLTUR4R.cjs.map +1 -0
  18. package/event-stream/event-stream.cjs +64 -19
  19. package/event-stream/event-stream.cjs.map +1 -1
  20. package/event-stream/event-stream.d.cts +142 -0
  21. package/event-stream/event-stream.d.ts +66 -20
  22. package/event-stream/event-stream.js +61 -16
  23. package/event-stream/event-stream.js.map +1 -1
  24. package/index.cjs +10 -10
  25. package/index.cjs.map +1 -1
  26. package/{custom-instance-35e5d4fd.d.ts → index.d.cts} +163 -163
  27. package/index.d.ts +700 -2
  28. package/index.js +9 -9
  29. package/index.js.map +1 -1
  30. package/merchant/merchant.cjs +53 -14
  31. package/merchant/merchant.cjs.map +1 -1
  32. package/merchant/merchant.d.cts +91 -0
  33. package/merchant/merchant.d.ts +48 -8
  34. package/merchant/merchant.js +52 -13
  35. package/merchant/merchant.js.map +1 -1
  36. package/organisation/organisation.cjs +110 -28
  37. package/organisation/organisation.cjs.map +1 -1
  38. package/organisation/organisation.d.cts +271 -0
  39. package/organisation/organisation.d.ts +114 -25
  40. package/organisation/organisation.js +103 -21
  41. package/organisation/organisation.js.map +1 -1
  42. package/package.json +12 -12
  43. package/product/product.cjs +182 -47
  44. package/product/product.cjs.map +1 -1
  45. package/product/product.d.cts +399 -0
  46. package/product/product.d.ts +180 -31
  47. package/product/product.js +172 -37
  48. package/product/product.js.map +1 -1
  49. package/src/account-server-api.schemas.ts +272 -280
  50. package/src/admin/admin.ts +114 -84
  51. package/src/asset/asset.ts +480 -565
  52. package/src/custom-instance.ts +3 -4
  53. package/src/event-stream/event-stream.ts +300 -275
  54. package/src/merchant/merchant.ts +206 -142
  55. package/src/organisation/organisation.ts +549 -490
  56. package/src/product/product.ts +829 -688
  57. package/src/state/state.ts +112 -75
  58. package/src/unit/unit.ts +645 -599
  59. package/src/user/user.ts +489 -469
  60. package/state/state.cjs +29 -8
  61. package/state/state.cjs.map +1 -1
  62. package/state/state.d.cts +46 -0
  63. package/state/state.d.ts +26 -6
  64. package/state/state.js +29 -8
  65. package/state/state.js.map +1 -1
  66. package/unit/unit.cjs +120 -32
  67. package/unit/unit.cjs.map +1 -1
  68. package/unit/unit.d.cts +322 -0
  69. package/unit/unit.d.ts +133 -38
  70. package/unit/unit.js +112 -24
  71. package/unit/unit.js.map +1 -1
  72. package/user/user.cjs +96 -22
  73. package/user/user.cjs.map +1 -1
  74. package/user/user.d.cts +271 -0
  75. package/user/user.d.ts +96 -24
  76. package/user/user.js +90 -16
  77. package/user/user.js.map +1 -1
  78. package/chunk-UZTHSGDT.cjs.map +0 -1
@@ -1,9 +1,9 @@
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';
1
+ import * as _tanstack_react_query_build_legacy_types from '@tanstack/react-query/build/legacy/types';
2
+ import { UseQueryOptions, QueryKey, UseQueryResult, UseSuspenseQueryOptions, UseSuspenseQueryResult, UseMutationOptions } from '@tanstack/react-query';
3
+ import { customInstance, EventStreamGetPostResponse, ErrorType, AsError } from '../index.js';
4
4
  import 'axios';
5
5
 
6
- type SecondParameter<T extends (...args: any) => any> = T extends (config: any, args: infer P) => any ? P : never;
6
+ type SecondParameter<T extends (...args: any) => any> = Parameters<T>[1];
7
7
  /**
8
8
  * Gets your EventStream ID and read token, if you have created one.
9
9
 
@@ -12,19 +12,39 @@ type SecondParameter<T extends (...args: any) => any> = T extends (config: any,
12
12
  declare const getEventStream: (options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<EventStreamGetPostResponse>;
13
13
  declare const getGetEventStreamQueryKey: () => readonly ["account-server-api", "/event-stream"];
14
14
  declare const getGetEventStreamQueryOptions: <TData = EventStreamGetPostResponse, TError = ErrorType<void | AsError>>(options?: {
15
- query?: UseQueryOptions<EventStreamGetPostResponse, TError, TData, QueryKey> | undefined;
15
+ query?: Partial<UseQueryOptions<EventStreamGetPostResponse, TError, TData, QueryKey>> | undefined;
16
16
  request?: SecondParameter<typeof customInstance>;
17
17
  } | undefined) => UseQueryOptions<EventStreamGetPostResponse, TError, TData, QueryKey> & {
18
18
  queryKey: QueryKey;
19
19
  };
20
20
  type GetEventStreamQueryResult = NonNullable<Awaited<ReturnType<typeof getEventStream>>>;
21
21
  type GetEventStreamQueryError = ErrorType<void | AsError>;
22
+ /**
23
+ * @summary Gets the details of your EventStream
24
+ */
22
25
  declare const useGetEventStream: <TData = EventStreamGetPostResponse, TError = ErrorType<void | AsError>>(options?: {
23
- query?: UseQueryOptions<EventStreamGetPostResponse, TError, TData, QueryKey> | undefined;
26
+ query?: Partial<UseQueryOptions<EventStreamGetPostResponse, TError, TData, QueryKey>> | undefined;
24
27
  request?: SecondParameter<typeof customInstance>;
25
28
  } | undefined) => UseQueryResult<TData, TError> & {
26
29
  queryKey: QueryKey;
27
30
  };
31
+ declare const getGetEventStreamSuspenseQueryOptions: <TData = EventStreamGetPostResponse, TError = ErrorType<void | AsError>>(options?: {
32
+ query?: Partial<UseSuspenseQueryOptions<EventStreamGetPostResponse, TError, TData, QueryKey>> | undefined;
33
+ request?: SecondParameter<typeof customInstance>;
34
+ } | undefined) => UseSuspenseQueryOptions<EventStreamGetPostResponse, TError, TData, QueryKey> & {
35
+ queryKey: QueryKey;
36
+ };
37
+ type GetEventStreamSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getEventStream>>>;
38
+ type GetEventStreamSuspenseQueryError = ErrorType<void | AsError>;
39
+ /**
40
+ * @summary Gets the details of your EventStream
41
+ */
42
+ declare const useGetEventStreamSuspense: <TData = EventStreamGetPostResponse, TError = ErrorType<void | AsError>>(options?: {
43
+ query?: Partial<UseSuspenseQueryOptions<EventStreamGetPostResponse, TError, TData, QueryKey>> | undefined;
44
+ request?: SecondParameter<typeof customInstance>;
45
+ } | undefined) => UseSuspenseQueryResult<TData, TError> & {
46
+ queryKey: QueryKey;
47
+ };
28
48
  /**
29
49
  * Creates a new event stream (based on the **Server Sent Events** framework) for the authenticated user.
30
50
 
@@ -33,39 +53,62 @@ A user is only permitted one event stream.
33
53
  * @summary Create a new Server-Sent Events EventStream
34
54
  */
35
55
  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;
56
+ declare const getCreateEventStreamMutationOptions: <TError = ErrorType<void | AsError>, TContext = unknown>(options?: {
57
+ mutation?: UseMutationOptions<EventStreamGetPostResponse, TError, void, TContext> | undefined;
38
58
  request?: SecondParameter<typeof customInstance>;
39
- } | undefined) => UseMutationOptions<EventStreamGetPostResponse, TError, TVariables, TContext>;
59
+ } | undefined) => UseMutationOptions<EventStreamGetPostResponse, TError, void, TContext>;
40
60
  type CreateEventStreamMutationResult = NonNullable<Awaited<ReturnType<typeof createEventStream>>>;
41
61
  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;
62
+ /**
63
+ * @summary Create a new Server-Sent Events EventStream
64
+ */
65
+ declare const useCreateEventStream: <TError = ErrorType<void | AsError>, TContext = unknown>(options?: {
66
+ mutation?: UseMutationOptions<EventStreamGetPostResponse, TError, void, TContext> | undefined;
44
67
  request?: SecondParameter<typeof customInstance>;
45
- } | undefined) => _tanstack_react_query.UseMutationResult<EventStreamGetPostResponse, TError, TVariables, TContext>;
68
+ } | undefined) => _tanstack_react_query_build_legacy_types.UseMutationResult<EventStreamGetPostResponse, TError, void, TContext>;
46
69
  /**
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.
70
+ * 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
71
 
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`.
72
+ This is an un-authenticated endpoint. In order to read from the stream the caller must provide either the User access token that belongs to the event stream or the **read token** that was allocated when the stream was created. The **read token** must be provided in the request header property `X-IM-AS-EventStreamReadToken`.
50
73
 
51
- * @summary Subscribe to Server-Sent Events events from an EventStream
52
- */
74
+ * @summary Subscribe to Server-Sent Events events from an EventStream
75
+ */
53
76
  declare const getEventStreamEvents: (eventStreamId: number, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<string>;
54
77
  declare const getGetEventStreamEventsQueryKey: (eventStreamId: number) => readonly ["account-server-api", `/event-stream/${number}`];
55
78
  declare const getGetEventStreamEventsQueryOptions: <TData = string, TError = ErrorType<void | AsError>>(eventStreamId: number, options?: {
56
- query?: UseQueryOptions<string, TError, TData, QueryKey> | undefined;
79
+ query?: Partial<UseQueryOptions<string, TError, TData, QueryKey>> | undefined;
57
80
  request?: SecondParameter<typeof customInstance>;
58
81
  } | undefined) => UseQueryOptions<string, TError, TData, QueryKey> & {
59
82
  queryKey: QueryKey;
60
83
  };
61
84
  type GetEventStreamEventsQueryResult = NonNullable<Awaited<ReturnType<typeof getEventStreamEvents>>>;
62
85
  type GetEventStreamEventsQueryError = ErrorType<void | AsError>;
86
+ /**
87
+ * @summary Subscribe to Server-Sent Events events from an EventStream
88
+ */
63
89
  declare const useGetEventStreamEvents: <TData = string, TError = ErrorType<void | AsError>>(eventStreamId: number, options?: {
64
- query?: UseQueryOptions<string, TError, TData, QueryKey> | undefined;
90
+ query?: Partial<UseQueryOptions<string, TError, TData, QueryKey>> | undefined;
65
91
  request?: SecondParameter<typeof customInstance>;
66
92
  } | undefined) => UseQueryResult<TData, TError> & {
67
93
  queryKey: QueryKey;
68
94
  };
95
+ declare const getGetEventStreamEventsSuspenseQueryOptions: <TData = string, TError = ErrorType<void | AsError>>(eventStreamId: number, options?: {
96
+ query?: Partial<UseSuspenseQueryOptions<string, TError, TData, QueryKey>> | undefined;
97
+ request?: SecondParameter<typeof customInstance>;
98
+ } | undefined) => UseSuspenseQueryOptions<string, TError, TData, QueryKey> & {
99
+ queryKey: QueryKey;
100
+ };
101
+ type GetEventStreamEventsSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getEventStreamEvents>>>;
102
+ type GetEventStreamEventsSuspenseQueryError = ErrorType<void | AsError>;
103
+ /**
104
+ * @summary Subscribe to Server-Sent Events events from an EventStream
105
+ */
106
+ declare const useGetEventStreamEventsSuspense: <TData = string, TError = ErrorType<void | AsError>>(eventStreamId: number, options?: {
107
+ query?: Partial<UseSuspenseQueryOptions<string, TError, TData, QueryKey>> | undefined;
108
+ request?: SecondParameter<typeof customInstance>;
109
+ } | undefined) => UseSuspenseQueryResult<TData, TError> & {
110
+ queryKey: QueryKey;
111
+ };
69
112
  /**
70
113
  * Deletes an Event Stream.
71
114
 
@@ -84,13 +127,16 @@ declare const getDeleteEventStreamMutationOptions: <TError = ErrorType<AsError>,
84
127
  }, TContext>;
85
128
  type DeleteEventStreamMutationResult = NonNullable<Awaited<ReturnType<typeof deleteEventStream>>>;
86
129
  type DeleteEventStreamMutationError = ErrorType<AsError>;
130
+ /**
131
+ * @summary Deletes an existing EventStream (that you created)
132
+ */
87
133
  declare const useDeleteEventStream: <TError = ErrorType<AsError>, TContext = unknown>(options?: {
88
134
  mutation?: UseMutationOptions<void, TError, {
89
135
  eventStreamId: number;
90
136
  }, TContext> | undefined;
91
137
  request?: SecondParameter<typeof customInstance>;
92
- } | undefined) => _tanstack_react_query.UseMutationResult<void, TError, {
138
+ } | undefined) => _tanstack_react_query_build_legacy_types.UseMutationResult<void, TError, {
93
139
  eventStreamId: number;
94
140
  }, TContext>;
95
141
 
96
- export { CreateEventStreamMutationError, CreateEventStreamMutationResult, DeleteEventStreamMutationError, DeleteEventStreamMutationResult, GetEventStreamEventsQueryError, GetEventStreamEventsQueryResult, GetEventStreamQueryError, GetEventStreamQueryResult, createEventStream, deleteEventStream, getCreateEventStreamMutationOptions, getDeleteEventStreamMutationOptions, getEventStream, getEventStreamEvents, getGetEventStreamEventsQueryKey, getGetEventStreamEventsQueryOptions, getGetEventStreamQueryKey, getGetEventStreamQueryOptions, useCreateEventStream, useDeleteEventStream, useGetEventStream, useGetEventStreamEvents };
142
+ export { type CreateEventStreamMutationError, type CreateEventStreamMutationResult, type DeleteEventStreamMutationError, type DeleteEventStreamMutationResult, type GetEventStreamEventsQueryError, type GetEventStreamEventsQueryResult, type GetEventStreamEventsSuspenseQueryError, type GetEventStreamEventsSuspenseQueryResult, type GetEventStreamQueryError, type GetEventStreamQueryResult, type GetEventStreamSuspenseQueryError, type GetEventStreamSuspenseQueryResult, createEventStream, deleteEventStream, getCreateEventStreamMutationOptions, getDeleteEventStreamMutationOptions, getEventStream, getEventStreamEvents, getGetEventStreamEventsQueryKey, getGetEventStreamEventsQueryOptions, getGetEventStreamEventsSuspenseQueryOptions, getGetEventStreamQueryKey, getGetEventStreamQueryOptions, getGetEventStreamSuspenseQueryOptions, useCreateEventStream, useDeleteEventStream, useGetEventStream, useGetEventStreamEvents, useGetEventStreamEventsSuspense, useGetEventStreamSuspense };
@@ -1,22 +1,30 @@
1
1
  import {
2
2
  customInstance
3
- } from "../chunk-3RNIDX7T.js";
3
+ } from "../chunk-EBOQPVLG.js";
4
4
 
5
5
  // src/event-stream/event-stream.ts
6
- import { useQuery, useMutation } from "@tanstack/react-query";
6
+ import {
7
+ useMutation,
8
+ useQuery,
9
+ useSuspenseQuery
10
+ } from "@tanstack/react-query";
7
11
  var getEventStream = (options, signal) => {
8
12
  return customInstance(
9
- { url: `/event-stream`, method: "get", signal },
13
+ {
14
+ url: `/event-stream`,
15
+ method: "GET",
16
+ signal
17
+ },
10
18
  options
11
19
  );
12
20
  };
13
- var getGetEventStreamQueryKey = () => ["account-server-api", `/event-stream`];
21
+ var getGetEventStreamQueryKey = () => {
22
+ return ["account-server-api", `/event-stream`];
23
+ };
14
24
  var getGetEventStreamQueryOptions = (options) => {
15
25
  const { query: queryOptions, request: requestOptions } = options ?? {};
16
26
  const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetEventStreamQueryKey();
17
- const queryFn = ({
18
- signal
19
- }) => getEventStream(requestOptions, signal);
27
+ const queryFn = ({ signal }) => getEventStream(requestOptions, signal);
20
28
  return { queryKey, queryFn, ...queryOptions };
21
29
  };
22
30
  var useGetEventStream = (options) => {
@@ -25,9 +33,24 @@ var useGetEventStream = (options) => {
25
33
  query.queryKey = queryOptions.queryKey;
26
34
  return query;
27
35
  };
36
+ var getGetEventStreamSuspenseQueryOptions = (options) => {
37
+ const { query: queryOptions, request: requestOptions } = options ?? {};
38
+ const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetEventStreamQueryKey();
39
+ const queryFn = ({ signal }) => getEventStream(requestOptions, signal);
40
+ return { queryKey, queryFn, ...queryOptions };
41
+ };
42
+ var useGetEventStreamSuspense = (options) => {
43
+ const queryOptions = getGetEventStreamSuspenseQueryOptions(options);
44
+ const query = useSuspenseQuery(queryOptions);
45
+ query.queryKey = queryOptions.queryKey;
46
+ return query;
47
+ };
28
48
  var createEventStream = (options) => {
29
49
  return customInstance(
30
- { url: `/event-stream`, method: "post" },
50
+ {
51
+ url: `/event-stream`,
52
+ method: "POST"
53
+ },
31
54
  options
32
55
  );
33
56
  };
@@ -44,11 +67,17 @@ var useCreateEventStream = (options) => {
44
67
  };
45
68
  var getEventStreamEvents = (eventStreamId, options, signal) => {
46
69
  return customInstance(
47
- { url: `/event-stream/${eventStreamId}`, method: "get", signal },
70
+ {
71
+ url: `/event-stream/${eventStreamId}`,
72
+ method: "GET",
73
+ signal
74
+ },
48
75
  options
49
76
  );
50
77
  };
51
- var getGetEventStreamEventsQueryKey = (eventStreamId) => ["account-server-api", `/event-stream/${eventStreamId}`];
78
+ var getGetEventStreamEventsQueryKey = (eventStreamId) => {
79
+ return ["account-server-api", `/event-stream/${eventStreamId}`];
80
+ };
52
81
  var getGetEventStreamEventsQueryOptions = (eventStreamId, options) => {
53
82
  const { query: queryOptions, request: requestOptions } = options ?? {};
54
83
  const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetEventStreamEventsQueryKey(eventStreamId);
@@ -56,17 +85,29 @@ var getGetEventStreamEventsQueryOptions = (eventStreamId, options) => {
56
85
  return { queryKey, queryFn, enabled: !!eventStreamId, ...queryOptions };
57
86
  };
58
87
  var useGetEventStreamEvents = (eventStreamId, options) => {
59
- const queryOptions = getGetEventStreamEventsQueryOptions(
60
- eventStreamId,
61
- options
62
- );
88
+ const queryOptions = getGetEventStreamEventsQueryOptions(eventStreamId, options);
63
89
  const query = useQuery(queryOptions);
64
90
  query.queryKey = queryOptions.queryKey;
65
91
  return query;
66
92
  };
93
+ var getGetEventStreamEventsSuspenseQueryOptions = (eventStreamId, options) => {
94
+ const { query: queryOptions, request: requestOptions } = options ?? {};
95
+ const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetEventStreamEventsQueryKey(eventStreamId);
96
+ const queryFn = ({ signal }) => getEventStreamEvents(eventStreamId, requestOptions, signal);
97
+ return { queryKey, queryFn, enabled: !!eventStreamId, ...queryOptions };
98
+ };
99
+ var useGetEventStreamEventsSuspense = (eventStreamId, options) => {
100
+ const queryOptions = getGetEventStreamEventsSuspenseQueryOptions(eventStreamId, options);
101
+ const query = useSuspenseQuery(queryOptions);
102
+ query.queryKey = queryOptions.queryKey;
103
+ return query;
104
+ };
67
105
  var deleteEventStream = (eventStreamId, options) => {
68
106
  return customInstance(
69
- { url: `/event-stream/${eventStreamId}`, method: "delete" },
107
+ {
108
+ url: `/event-stream/${eventStreamId}`,
109
+ method: "DELETE"
110
+ },
70
111
  options
71
112
  );
72
113
  };
@@ -91,11 +132,15 @@ export {
91
132
  getEventStreamEvents,
92
133
  getGetEventStreamEventsQueryKey,
93
134
  getGetEventStreamEventsQueryOptions,
135
+ getGetEventStreamEventsSuspenseQueryOptions,
94
136
  getGetEventStreamQueryKey,
95
137
  getGetEventStreamQueryOptions,
138
+ getGetEventStreamSuspenseQueryOptions,
96
139
  useCreateEventStream,
97
140
  useDeleteEventStream,
98
141
  useGetEventStream,
99
- useGetEventStreamEvents
142
+ useGetEventStreamEvents,
143
+ useGetEventStreamEventsSuspense,
144
+ useGetEventStreamSuspense
100
145
  };
101
146
  //# sourceMappingURL=event-stream.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/event-stream/event-stream.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 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"],"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/B,YAO4D;AAC5D,QAAM,eAAe,8BAA8B,OAAO;AAE1D,QAAM,QAAQ,SAAS,YAAY;AAInC,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT;AASO,IAAM,oBAAoB,CAC/B,YACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,iBAAiB,QAAQ,OAAO;AAAA,IACvC;AAAA,EACF;AACF;AAEO,IAAM,sCAAsC,CAIjD,YAaG;AACH,QAAM,EAAE,UAAU,iBAAiB,SAAS,eAAe,IAAI,WAAW,CAAC;AAE3E,QAAM,aAGF,MAAM;AACR,WAAO,kBAAkB,cAAc;AAAA,EACzC;AAEA,SAAO,EAAE,YAAY,GAAG,gBAAgB;AAC1C;AAQO,IAAM,uBAAuB,CAIlC,YAQI;AACJ,QAAM,kBAAkB,oCAAoC,OAAO;AAEnE,SAAO,YAAY,eAAe;AACpC;AAQO,IAAM,uBAAuB,CAClC,eACA,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,iBAAiB,iBAAiB,QAAQ,OAAO,OAAO;AAAA,IAC/D;AAAA,EACF;AACF;AAEO,IAAM,kCAAkC,CAAC,kBAC9C,CAAC,sBAAsB,iBAAiB,eAAe;AAElD,IAAM,sCAAsC,CAIjD,eACA,YAY4B;AAC5B,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YACJ,6CAAc,aAAY,gCAAgC,aAAa;AAEzE,QAAM,UAEF,CAAC,EAAE,OAAO,MACZ,qBAAqB,eAAe,gBAAgB,MAAM;AAE5D,SAAO,EAAE,UAAU,SAAS,SAAS,CAAC,CAAC,eAAe,GAAG,aAAa;AACxE;AAOO,IAAM,0BAA0B,CAIrC,eACA,YAQ2D;AAC3D,QAAM,eAAe;AAAA,IACnB;AAAA,IACA;AAAA,EACF;AAEA,QAAM,QAAQ,SAAS,YAAY;AAInC,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT;AASO,IAAM,oBAAoB,CAC/B,eACA,YACG;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;","names":[]}
1
+ {"version":3,"sources":["../../src/event-stream/event-stream.ts"],"sourcesContent":["/**\n * Generated by orval v6.25.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 {\n useMutation,\n useQuery,\n useSuspenseQuery\n} from '@tanstack/react-query'\nimport type {\n MutationFunction,\n QueryFunction,\n QueryKey,\n UseMutationOptions,\n UseQueryOptions,\n UseQueryResult,\n UseSuspenseQueryOptions,\n UseSuspenseQueryResult\n} from '@tanstack/react-query'\nimport type {\n AsError,\n EventStreamGetPostResponse\n} from '../account-server-api.schemas'\nimport { customInstance } from '.././custom-instance';\nimport type { ErrorType } from '.././custom-instance';\n\n\ntype SecondParameter<T extends (...args: any) => any> = Parameters<T>[1];\n\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 \n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n \n \n return customInstance<EventStreamGetPostResponse>(\n {url: `/event-stream`, method: 'GET', signal\n },\n options);\n }\n \n\nexport const getGetEventStreamQueryKey = () => {\n return [\"account-server-api\", `/event-stream`] as const;\n }\n\n \nexport const getGetEventStreamQueryOptions = <TData = Awaited<ReturnType<typeof getEventStream>>, TError = ErrorType<void | AsError>>( options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetEventStreamQueryKey();\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getEventStream>>> = ({ signal }) => getEventStream(requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetEventStreamQueryResult = NonNullable<Awaited<ReturnType<typeof getEventStream>>>\nexport type GetEventStreamQueryError = ErrorType<void | AsError>\n\n/**\n * @summary Gets the details of your EventStream\n */\nexport const useGetEventStream = <TData = Awaited<ReturnType<typeof getEventStream>>, TError = ErrorType<void | AsError>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetEventStreamQueryOptions(options)\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\nexport const getGetEventStreamSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getEventStream>>, TError = ErrorType<void | AsError>>( options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetEventStreamQueryKey();\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getEventStream>>> = ({ signal }) => getEventStream(requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetEventStreamSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getEventStream>>>\nexport type GetEventStreamSuspenseQueryError = ErrorType<void | AsError>\n\n/**\n * @summary Gets the details of your EventStream\n */\nexport const useGetEventStreamSuspense = <TData = Awaited<ReturnType<typeof getEventStream>>, TError = ErrorType<void | AsError>>(\n options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetEventStreamSuspenseQueryOptions(options)\n\n const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\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 \n options?: SecondParameter<typeof customInstance>,) => {\n \n \n return customInstance<EventStreamGetPostResponse>(\n {url: `/event-stream`, method: 'POST'\n },\n options);\n }\n \n\n\nexport const getCreateEventStreamMutationOptions = <TError = ErrorType<AsError | void>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createEventStream>>, TError,void, TContext>, request?: SecondParameter<typeof customInstance>}\n): UseMutationOptions<Awaited<ReturnType<typeof createEventStream>>, TError,void, TContext> => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {};\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof createEventStream>>, void> = () => {\n \n\n return createEventStream(requestOptions)\n }\n\n \n\n\n return { mutationFn, ...mutationOptions }}\n\n export type CreateEventStreamMutationResult = NonNullable<Awaited<ReturnType<typeof createEventStream>>>\n \n export type CreateEventStreamMutationError = ErrorType<AsError | void>\n\n /**\n * @summary Create a new Server-Sent Events EventStream\n */\nexport const useCreateEventStream = <TError = ErrorType<AsError | void>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createEventStream>>, TError,void, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\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 either the User access token that belongs to the event stream or the **read token** that was allocated when the stream was created. The **read 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>,signal?: AbortSignal\n) => {\n \n \n return customInstance<string>(\n {url: `/event-stream/${eventStreamId}`, method: 'GET', signal\n },\n options);\n }\n \n\nexport const getGetEventStreamEventsQueryKey = (eventStreamId: number,) => {\n return [\"account-server-api\", `/event-stream/${eventStreamId}`] as const;\n }\n\n \nexport const getGetEventStreamEventsQueryOptions = <TData = Awaited<ReturnType<typeof getEventStreamEvents>>, TError = ErrorType<void | AsError>>(eventStreamId: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getEventStreamEvents>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetEventStreamEventsQueryKey(eventStreamId);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getEventStreamEvents>>> = ({ signal }) => getEventStreamEvents(eventStreamId, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, enabled: !!(eventStreamId), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getEventStreamEvents>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetEventStreamEventsQueryResult = NonNullable<Awaited<ReturnType<typeof getEventStreamEvents>>>\nexport type GetEventStreamEventsQueryError = ErrorType<void | AsError>\n\n/**\n * @summary Subscribe to Server-Sent Events events from an EventStream\n */\nexport const useGetEventStreamEvents = <TData = Awaited<ReturnType<typeof getEventStreamEvents>>, TError = ErrorType<void | AsError>>(\n eventStreamId: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getEventStreamEvents>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetEventStreamEventsQueryOptions(eventStreamId,options)\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\nexport const getGetEventStreamEventsSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getEventStreamEvents>>, TError = ErrorType<void | AsError>>(eventStreamId: number, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStreamEvents>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetEventStreamEventsQueryKey(eventStreamId);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getEventStreamEvents>>> = ({ signal }) => getEventStreamEvents(eventStreamId, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, enabled: !!(eventStreamId), ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStreamEvents>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetEventStreamEventsSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getEventStreamEvents>>>\nexport type GetEventStreamEventsSuspenseQueryError = ErrorType<void | AsError>\n\n/**\n * @summary Subscribe to Server-Sent Events events from an EventStream\n */\nexport const useGetEventStreamEventsSuspense = <TData = Awaited<ReturnType<typeof getEventStreamEvents>>, TError = ErrorType<void | AsError>>(\n eventStreamId: number, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStreamEvents>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetEventStreamEventsSuspenseQueryOptions(eventStreamId,options)\n\n const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\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 \n return customInstance<void>(\n {url: `/event-stream/${eventStreamId}`, method: 'DELETE'\n },\n options);\n }\n \n\n\nexport const getDeleteEventStreamMutationOptions = <TError = ErrorType<AsError>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteEventStream>>, TError,{eventStreamId: number}, TContext>, request?: SecondParameter<typeof customInstance>}\n): UseMutationOptions<Awaited<ReturnType<typeof deleteEventStream>>, TError,{eventStreamId: number}, TContext> => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {};\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof deleteEventStream>>, {eventStreamId: number}> = (props) => {\n const {eventStreamId} = props ?? {};\n\n return deleteEventStream(eventStreamId,requestOptions)\n }\n\n \n\n\n return { mutationFn, ...mutationOptions }}\n\n export type DeleteEventStreamMutationResult = NonNullable<Awaited<ReturnType<typeof deleteEventStream>>>\n \n export type DeleteEventStreamMutationError = ErrorType<AsError>\n\n /**\n * @summary Deletes an existing EventStream (that you created)\n */\nexport const useDeleteEventStream = <TError = ErrorType<AsError>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteEventStream>>, TError,{eventStreamId: number}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n\n const mutationOptions = getDeleteEventStreamMutationOptions(options);\n\n return useMutation(mutationOptions);\n }\n "],"mappings":";;;;;AAUA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AA2BA,IAAM,iBAAiB,CAE7B,SAAiD,WAC7C;AAGC,SAAO;AAAA,IACP;AAAA,MAAC,KAAK;AAAA,MAAiB,QAAQ;AAAA,MAAO;AAAA,IACxC;AAAA,IACE;AAAA,EAAO;AACT;AAGG,IAAM,4BAA4B,MAAM;AAC3C,SAAO,CAAC,sBAAsB,eAAe;AAC7C;AAGG,IAAM,gCAAgC,CAA0F,YAClI;AAEL,QAAM,EAAC,OAAO,cAAc,SAAS,eAAc,IAAI,WAAW,CAAC;AAEjE,QAAM,YAAY,6CAAc,aAAY,0BAA0B;AAIpE,QAAM,UAAqE,CAAC,EAAE,OAAO,MAAM,eAAe,gBAAgB,MAAM;AAMjI,SAAQ,EAAE,UAAU,SAAS,GAAG,aAAY;AAC/C;AAQO,IAAM,oBAAoB,CAC/B,YAE8D;AAE9D,QAAM,eAAe,8BAA8B,OAAO;AAE1D,QAAM,QAAQ,SAAS,YAAY;AAEnC,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT;AAIO,IAAM,wCAAwC,CAA0F,YAC1I;AAEL,QAAM,EAAC,OAAO,cAAc,SAAS,eAAc,IAAI,WAAW,CAAC;AAEjE,QAAM,YAAY,6CAAc,aAAY,0BAA0B;AAIpE,QAAM,UAAqE,CAAC,EAAE,OAAO,MAAM,eAAe,gBAAgB,MAAM;AAMjI,SAAQ,EAAE,UAAU,SAAS,GAAG,aAAY;AAC/C;AAQO,IAAM,4BAA4B,CACvC,YAEsE;AAEtE,QAAM,eAAe,sCAAsC,OAAO;AAElE,QAAM,QAAQ,iBAAiB,YAAY;AAE3C,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT;AAWO,IAAM,oBAAoB,CAEhC,YAAsD;AAGjD,SAAO;AAAA,IACP;AAAA,MAAC,KAAK;AAAA,MAAiB,QAAQ;AAAA,IACjC;AAAA,IACE;AAAA,EAAO;AACT;AAIG,IAAM,sCAAsC,CAC3B,YACuE;AAC9F,QAAM,EAAC,UAAU,iBAAiB,SAAS,eAAc,IAAI,WAAW,CAAC;AAKpE,QAAM,aAAoF,MAAM;AAG5F,WAAQ,kBAAkB,cAAc;AAAA,EAC1C;AAKL,SAAQ,EAAE,YAAY,GAAG,gBAAgB;AAAC;AAStC,IAAM,uBAAuB,CACZ,YACnB;AAEC,QAAM,kBAAkB,oCAAoC,OAAO;AAEnE,SAAO,YAAY,eAAe;AACpC;AAQG,IAAM,uBAAuB,CAChC,eACH,SAAiD,WAC7C;AAGC,SAAO;AAAA,IACP;AAAA,MAAC,KAAK,iBAAiB,aAAa;AAAA,MAAI,QAAQ;AAAA,MAAO;AAAA,IACzD;AAAA,IACE;AAAA,EAAO;AACT;AAGG,IAAM,kCAAkC,CAAC,kBAA2B;AACvE,SAAO,CAAC,sBAAsB,iBAAiB,aAAa,EAAE;AAC9D;AAGG,IAAM,sCAAsC,CAA+F,eAAuB,YACpK;AAEL,QAAM,EAAC,OAAO,cAAc,SAAS,eAAc,IAAI,WAAW,CAAC;AAEjE,QAAM,YAAY,6CAAc,aAAY,gCAAgC,aAAa;AAIvF,QAAM,UAA2E,CAAC,EAAE,OAAO,MAAM,qBAAqB,eAAe,gBAAgB,MAAM;AAM5J,SAAQ,EAAE,UAAU,SAAS,SAAS,CAAC,CAAE,eAAgB,GAAG,aAAY;AAC3E;AAQO,IAAM,0BAA0B,CACtC,eAAuB,YAEwC;AAE9D,QAAM,eAAe,oCAAoC,eAAc,OAAO;AAE9E,QAAM,QAAQ,SAAS,YAAY;AAEnC,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT;AAIO,IAAM,8CAA8C,CAA+F,eAAuB,YAC5K;AAEL,QAAM,EAAC,OAAO,cAAc,SAAS,eAAc,IAAI,WAAW,CAAC;AAEjE,QAAM,YAAY,6CAAc,aAAY,gCAAgC,aAAa;AAIvF,QAAM,UAA2E,CAAC,EAAE,OAAO,MAAM,qBAAqB,eAAe,gBAAgB,MAAM;AAM5J,SAAQ,EAAE,UAAU,SAAS,SAAS,CAAC,CAAE,eAAgB,GAAG,aAAY;AAC3E;AAQO,IAAM,kCAAkC,CAC9C,eAAuB,YAEgD;AAEtE,QAAM,eAAe,4CAA4C,eAAc,OAAO;AAEtF,QAAM,QAAQ,iBAAiB,YAAY;AAE3C,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT;AAWO,IAAM,oBAAoB,CAC7B,eACH,YAAsD;AAGjD,SAAO;AAAA,IACP;AAAA,MAAC,KAAK,iBAAiB,aAAa;AAAA,MAAI,QAAQ;AAAA,IAClD;AAAA,IACE;AAAA,EAAO;AACT;AAIG,IAAM,sCAAsC,CAC3B,YAC0F;AACjH,QAAM,EAAC,UAAU,iBAAiB,SAAS,eAAc,IAAI,WAAW,CAAC;AAKpE,QAAM,aAAuG,CAAC,UAAU;AACpH,UAAM,EAAC,cAAa,IAAI,SAAS,CAAC;AAElC,WAAQ,kBAAkB,eAAc,cAAc;AAAA,EACxD;AAKL,SAAQ,EAAE,YAAY,GAAG,gBAAgB;AAAC;AAStC,IAAM,uBAAuB,CACZ,YACnB;AAEC,QAAM,kBAAkB,oCAAoC,OAAO;AAEnE,SAAO,YAAY,eAAe;AACpC;","names":[]}
package/index.cjs CHANGED
@@ -3,19 +3,19 @@
3
3
 
4
4
 
5
5
 
6
- var _chunkUZTHSGDTcjs = require('./chunk-UZTHSGDT.cjs');
6
+ var _chunkTKLTUR4Rcjs = require('./chunk-TKLTUR4R.cjs');
7
7
 
8
8
  // src/account-server-api.schemas.ts
9
+ var UnitProductPostBodyBodyType = {
10
+ DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION: "DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION",
11
+ DATA_MANAGER_STORAGE_SUBSCRIPTION: "DATA_MANAGER_STORAGE_SUBSCRIPTION"
12
+ };
9
13
  var UnitProductPostBodyBodyFlavour = {
10
14
  EVALUATION: "EVALUATION",
11
15
  BRONZE: "BRONZE",
12
16
  SILVER: "SILVER",
13
17
  GOLD: "GOLD"
14
18
  };
15
- var UnitProductPostBodyBodyType = {
16
- DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION: "DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION",
17
- DATA_MANAGER_STORAGE_SUBSCRIPTION: "DATA_MANAGER_STORAGE_SUBSCRIPTION"
18
- };
19
19
  var AssetPostBodyBodyScope = {
20
20
  USER: "USER",
21
21
  PRODUCT: "PRODUCT",
@@ -29,16 +29,16 @@ var MerchantDetailKind = {
29
29
  var ProductTypeServiceKind = {
30
30
  DATA_MANAGER: "DATA_MANAGER"
31
31
  };
32
+ var ProductDetailType = {
33
+ DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION: "DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION",
34
+ DATA_MANAGER_STORAGE_SUBSCRIPTION: "DATA_MANAGER_STORAGE_SUBSCRIPTION"
35
+ };
32
36
  var ProductDetailFlavour = {
33
37
  EVALUATION: "EVALUATION",
34
38
  BRONZE: "BRONZE",
35
39
  SILVER: "SILVER",
36
40
  GOLD: "GOLD"
37
41
  };
38
- var ProductDetailType = {
39
- DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION: "DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION",
40
- DATA_MANAGER_STORAGE_SUBSCRIPTION: "DATA_MANAGER_STORAGE_SUBSCRIPTION"
41
- };
42
42
  var ProcessingChargesMerchantKind = {
43
43
  DATA_MANAGER: "DATA_MANAGER"
44
44
  };
@@ -73,5 +73,5 @@ var ProductChargesGetResponseProductType = {
73
73
 
74
74
 
75
75
 
76
- exports.AXIOS_INSTANCE = _chunkUZTHSGDTcjs.AXIOS_INSTANCE; exports.AssetDetailScope = AssetDetailScope; exports.AssetPostBodyBodyScope = AssetPostBodyBodyScope; exports.ChargeSummaryType = ChargeSummaryType; exports.MerchantDetailKind = MerchantDetailKind; exports.ProcessingChargesMerchantKind = ProcessingChargesMerchantKind; exports.ProductChargesGetResponseProductType = ProductChargesGetResponseProductType; exports.ProductDetailFlavour = ProductDetailFlavour; exports.ProductDetailType = ProductDetailType; exports.ProductTypeServiceKind = ProductTypeServiceKind; exports.UnitProductPostBodyBodyFlavour = UnitProductPostBodyBodyFlavour; exports.UnitProductPostBodyBodyType = UnitProductPostBodyBodyType; exports.customInstance = _chunkUZTHSGDTcjs.customInstance; exports.setAuthToken = _chunkUZTHSGDTcjs.setAuthToken; exports.setBaseUrl = _chunkUZTHSGDTcjs.setBaseUrl;
76
+ exports.AXIOS_INSTANCE = _chunkTKLTUR4Rcjs.AXIOS_INSTANCE; exports.AssetDetailScope = AssetDetailScope; exports.AssetPostBodyBodyScope = AssetPostBodyBodyScope; exports.ChargeSummaryType = ChargeSummaryType; exports.MerchantDetailKind = MerchantDetailKind; exports.ProcessingChargesMerchantKind = ProcessingChargesMerchantKind; exports.ProductChargesGetResponseProductType = ProductChargesGetResponseProductType; exports.ProductDetailFlavour = ProductDetailFlavour; exports.ProductDetailType = ProductDetailType; exports.ProductTypeServiceKind = ProductTypeServiceKind; exports.UnitProductPostBodyBodyFlavour = UnitProductPostBodyBodyFlavour; exports.UnitProductPostBodyBodyType = UnitProductPostBodyBodyType; exports.customInstance = _chunkTKLTUR4Rcjs.customInstance; exports.setAuthToken = _chunkTKLTUR4Rcjs.setAuthToken; exports.setBaseUrl = _chunkTKLTUR4Rcjs.setBaseUrl;
77
77
  //# sourceMappingURL=index.cjs.map
package/index.cjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/account-server-api.schemas.ts"],"names":[],"mappings":";;;;;;;;AA+JO,IAAM,iCAAiC;AAAA,EAC5C,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,MAAM;AACR;AAWO,IAAM,8BAA8B;AAAA,EACzC,wCACE;AAAA,EACF,mCAAmC;AACrC;AAkDO,IAAM,yBAAyB;AAAA,EACpC,MAAM;AAAA,EACN,SAAS;AAAA,EACT,MAAM;AAAA,EACN,cAAc;AAAA,EACd,QAAQ;AACV;AA+DO,IAAM,qBAAqB;AAAA,EAChC,cAAc;AAChB;AA2CO,IAAM,yBAAyB;AAAA,EACpC,cAAc;AAChB;AA6BO,IAAM,uBAAuB;AAAA,EAClC,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,MAAM;AACR;AAUO,IAAM,oBAAoB;AAAA,EAC/B,wCACE;AAAA,EACF,mCAAmC;AACrC;AAqIO,IAAM,gCAAgC;AAAA,EAC3C,cAAc;AAChB;AAmBO,IAAM,mBAAmB;AAAA,EAC9B,MAAM;AAAA,EACN,SAAS;AAAA,EACT,MAAM;AAAA,EACN,cAAc;AAAA,EACd,QAAQ;AACV;AAuCO,IAAM,oBAAoB;AAAA,EAC/B,YAAY;AAAA,EACZ,SAAS;AACX;AA+EO,IAAM,uCAAuC;AAAA,EAClD,wCACE;AAAA,EACF,mCAAmC;AACrC","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 */\nexport type DetachAssetParams = {\n /**\n * A Merchant Identity\n */\n m_id?: QMIdParameter;\n};\n\nexport type AttachAssetParams = {\n /**\n * A Merchant Identity\n */\n m_id?: QMIdParameter;\n};\n\n/**\n * A date where assets prior to this will be returned. This can be a date-time string but it is interpreted as a date, i.e. `2020-01-01T00:00:00Z` is interpreted as `2020-01-01`. Any asset that occurs prior this date will be returned. UTC is assumed if no timezone is provided\n */\nexport type QUntilParameter = string;\n\n/**\n * A date from which to retrieve assets. This can be a date-time string but it is interpreted as a date, i.e. `2020-01-01T00:00:00Z` is interpreted as `2020-01-01`. Any asset that occurs on ar after this date will be returned. UTC is assumed if no timezone is provided\n */\nexport type QFromParameter = string;\n\nexport type GetOrganisationChargesParams = {\n /**\n * A date from which to retrieve assets. This can be a date-time string but it is interpreted as a date, i.e. `2020-01-01T00:00:00Z` is interpreted as `2020-01-01`. Any asset that occurs on ar after this date will be returned. UTC is assumed if no timezone is provided\n */\n from?: QFromParameter;\n /**\n * A date where assets prior to this will be returned. This can be a date-time string but it is interpreted as a date, i.e. `2020-01-01T00:00:00Z` is interpreted as `2020-01-01`. Any asset that occurs prior this date will be returned. UTC is assumed if no timezone is provided\n */\n until?: QUntilParameter;\n /**\n * A charge Prior Billing Period, 0 implies \"current\" and -23 is for the period 23 months ago.\n */\n pbp?: QPbpParameter;\n};\n\nexport type GetProductChargesParams = {\n /**\n * A date from which to retrieve assets. This can be a date-time string but it is interpreted as a date, i.e. `2020-01-01T00:00:00Z` is interpreted as `2020-01-01`. Any asset that occurs on ar after this date will be returned. UTC is assumed if no timezone is provided\n */\n from?: QFromParameter;\n /**\n * A date where assets prior to this will be returned. This can be a date-time string but it is interpreted as a date, i.e. `2020-01-01T00:00:00Z` is interpreted as `2020-01-01`. Any asset that occurs prior this date will be returned. UTC is assumed if no timezone is provided\n */\n until?: QUntilParameter;\n /**\n * A charge Prior Billing Period, 0 implies \"current\" and -23 is for the period 23 months ago.\n */\n pbp?: QPbpParameter;\n};\n\nexport type GetChargesParams = {\n /**\n * A date from which to retrieve assets. This can be a date-time string but it is interpreted as a date, i.e. `2020-01-01T00:00:00Z` is interpreted as `2020-01-01`. Any asset that occurs on ar after this date will be returned. UTC is assumed if no timezone is provided\n */\n from?: QFromParameter;\n /**\n * A date where assets prior to this will be returned. This can be a date-time string but it is interpreted as a date, i.e. `2020-01-01T00:00:00Z` is interpreted as `2020-01-01`. Any asset that occurs prior this date will be returned. UTC is assumed if no timezone is provided\n */\n until?: QUntilParameter;\n /**\n * A charge Prior Billing Period, 0 implies \"current\" and -23 is for the period 23 months ago.\n */\n pbp?: QPbpParameter;\n};\n\n/**\n * A User Identity\n */\nexport type QUserIdParameter = string;\n\n/**\n * A Product Identity\n */\nexport type QProductIdParameter = string;\n\n/**\n * A Unit Identity\n */\nexport type QUnitIdParameter = string;\n\nexport type GetAssetParams = {\n /**\n * A User Identity\n */\n user_id?: QUserIdParameter;\n /**\n * A Product Identity\n */\n product_id?: QProductIdParameter;\n /**\n * A Unit Identity\n */\n unit_id?: QUnitIdParameter;\n /**\n * An Organisation Identity\n */\n org_id?: QOrgIdParameter;\n};\n\n/**\n * A Merchant Identity\n */\nexport type QMIdParameter = number;\n\n/**\n * An Organisation Identity\n */\nexport type QOrgIdParameter = string;\n\n/**\n * A charge Prior Billing Period, 0 implies \"current\" and -23 is for the period 23 months ago.\n */\nexport type QPbpParameter = number;\n\nexport type GetUnitChargesParams = {\n /**\n * A date from which to retrieve assets. This can be a date-time string but it is interpreted as a date, i.e. `2020-01-01T00:00:00Z` is interpreted as `2020-01-01`. Any asset that occurs on ar after this date will be returned. UTC is assumed if no timezone is provided\n */\n from?: QFromParameter;\n /**\n * A date where assets prior to this will be returned. This can be a date-time string but it is interpreted as a date, i.e. `2020-01-01T00:00:00Z` is interpreted as `2020-01-01`. Any asset that occurs prior this date will be returned. UTC is assumed if no timezone is provided\n */\n until?: QUntilParameter;\n /**\n * A charge Prior Billing Period, 0 implies \"current\" and -23 is for the period 23 months ago.\n */\n pbp?: QPbpParameter;\n};\n\nexport type ProductPatchBodyBody = {\n /** The name you want to give the Product */\n name?: string;\n /** The Product's built-in coin allowance. Product allowances cannot be reduced */\n allowance?: number;\n /** The Product's built-in coin limit. If set it must not be less than the allowance. If not set the allowance is used. The existing product limit cannot be reduced */\n limit?: number;\n};\n\n/**\n * The Flavour of the Product. Used only for Project Tier Products. Do not set this for Storage products\n */\nexport type UnitProductPostBodyBodyFlavour =\n (typeof UnitProductPostBodyBodyFlavour)[keyof typeof UnitProductPostBodyBodyFlavour];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const UnitProductPostBodyBodyFlavour = {\n EVALUATION: \"EVALUATION\",\n BRONZE: \"BRONZE\",\n SILVER: \"SILVER\",\n GOLD: \"GOLD\",\n} as const;\n\n/**\n * The Type of Product. Storage subscriptions require an **Allowance** to be defined and the **Flavour** must not be provided.\n\nProject Tier subscriptions have built-in allowances and Limits so you must not provide values for these for these products\n */\nexport type UnitProductPostBodyBodyType =\n (typeof UnitProductPostBodyBodyType)[keyof typeof UnitProductPostBodyBodyType];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const UnitProductPostBodyBodyType = {\n DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION:\n \"DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION\",\n DATA_MANAGER_STORAGE_SUBSCRIPTION: \"DATA_MANAGER_STORAGE_SUBSCRIPTION\",\n} as const;\n\nexport type UnitProductPostBodyBody = {\n /** The name you want to give the Product */\n name: string;\n /** The Type of Product. Storage subscriptions require an **Allowance** to be defined and the **Flavour** must not be provided.\n\nProject Tier subscriptions have built-in allowances and Limits so you must not provide values for these for these products */\n type: UnitProductPostBodyBodyType;\n /** The Flavour of the Product. Used only for Project Tier Products. Do not set this for Storage products */\n flavour?: UnitProductPostBodyBodyFlavour;\n /** The Product's coin allowance. You must provide this for Storage products but you must not provide a value for Project Tier Products */\n allowance?: number;\n /** The Product's built-in coin limit. If set it must not be less than the allowance. If not set the allowance is used. You can provide this for Storage products but you must not provide a value for Project Tier Products */\n limit?: number;\n};\n\nexport type UnitPatchBodyBody = {\n /** The new name for the Unit */\n name?: string;\n};\n\nexport type OrganisationPatchBodyBody = {\n /** The new name for the Organisational */\n name?: string;\n};\n\nexport type OrganisationUnitPostBodyBody = {\n /** The name of the unit */\n name: string;\n /** The day you would like to be billed for the Unit's Products (a value from 1 and 28) */\n billing_day: number;\n};\n\nexport type PersonalUnitPutBodyBody = {\n /** The day you would like to be billed for the Unit's Products (a value from 1 and 28) */\n billing_day: number;\n};\n\nexport type OrganisationPostBodyBody = {\n /** The name of the organisation */\n name: string;\n /** The name of the organisation owner. A user ID */\n owner: string;\n};\n\nexport type AssetPostBodyBodyScope =\n (typeof AssetPostBodyBodyScope)[keyof typeof AssetPostBodyBodyScope];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const AssetPostBodyBodyScope = {\n USER: \"USER\",\n PRODUCT: \"PRODUCT\",\n UNIT: \"UNIT\",\n ORGANISATION: \"ORGANISATION\",\n GLOBAL: \"GLOBAL\",\n} as const;\n\nexport type AssetPostBodyBody = {\n /** The name of the asset. This must be unique within its scope. For example, only one asset can be called \"asset-1\" within a given Unit. Asset names must be valid RFC 1123 Label Names */\n name: string;\n /** A file containing the content for the asset. You must provide a value here or in content_string */\n content_file?: Blob;\n /** The textual content of the asset. You must provide a value here or in content_file */\n content_string?: string;\n scope: AssetPostBodyBodyScope;\n /** The unique identity based on the Scope of the asset. For example, this will be the Unit ID if it's a UNIT. A scope_id is required if the scope is USER as it will be automatically set to your username. Global assets do not have a scope. */\n scope_id?: string;\n /** Is this a secret asset? */\n secret: boolean;\n /** An optional description for the Asset */\n description?: string;\n};\n\nexport type AssetPatchBodyBody = {\n /** A file containing the content for the asset. You must provide a value here or in content_string */\n content_file?: Blob;\n /** The textual content of the asset. You must provide a value here or in content_file */\n content_string?: string;\n /** An optional description for the Asset */\n description?: string;\n};\n\nexport interface UserDetail {\n /** The user identity (username) */\n id: string;\n}\n\nexport interface UserAccountDetail {\n user: UserDetail;\n /** Whether the caller has admin privilege */\n caller_has_admin_privilege: boolean;\n /** The roles assigned to the user recognised by the Account Server */\n account_server_roles: string[];\n}\n\nexport interface UnitDetail {\n /** Whether the user making the API call is a member of the Unit */\n caller_is_member: boolean;\n /** The Unit's unique identity */\n id: string;\n /** The Unit's name */\n name: string;\n /** The Unit's owner (a username) */\n owner_id: string;\n /** True if the Unit is private */\n private: boolean;\n created: string;\n /** The Unit's billing day */\n billing_day: number;\n}\n\n/**\n * The kind of Service\n */\nexport type MerchantDetailKind =\n (typeof MerchantDetailKind)[keyof typeof MerchantDetailKind];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const MerchantDetailKind = {\n DATA_MANAGER: \"DATA_MANAGER\",\n} as const;\n\nexport interface MerchantDetail {\n /** The unique ID of the Service */\n id: number;\n created: string;\n /** The kind of Service */\n kind: MerchantDetailKind;\n /** The name assigned to the Service */\n name: string;\n /** The hostname used by the Service */\n api_hostname: string;\n}\n\nexport type MerchantGetResponse = MerchantDetail;\n\nexport interface MerchantsGetResponse {\n /** The list of known Merchants\n */\n merchants: MerchantDetail[];\n}\n\nexport interface OrganisationDetail {\n /** Whether the user making the API call is a member of the Unit */\n caller_is_member: boolean;\n /** The Organisation's unique ID */\n id: string;\n /** The Organisation's name */\n name: string;\n /** The username of the Organisation's owner. Not all Organisations have an owner. The Default Organisation has no owner. */\n owner_id?: string;\n /** True if the Unit is private */\n private: boolean;\n created: string;\n}\n\n/**\n * The kind of service that can use the Product\n */\nexport type ProductTypeServiceKind =\n (typeof ProductTypeServiceKind)[keyof typeof ProductTypeServiceKind];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const ProductTypeServiceKind = {\n DATA_MANAGER: \"DATA_MANAGER\",\n} as const;\n\nexport interface ProductType {\n /** A product type, this is a unique string amongst all types known to the Account Server */\n type: string;\n /** A product flavour. Not all types have a flavour, those that do have a type-specific flavour string */\n flavour?: string;\n /** The kind of service that can use the Product */\n service_kind?: ProductTypeServiceKind;\n}\n\nexport type ProductInstanceDetailCoins = {\n /** The number of coins used\n */\n used: number;\n};\n\nexport interface ProductInstanceDetail {\n coins: ProductInstanceDetailCoins;\n}\n\n/**\n * The Product Type flavour. Not all products have flavours\n\n */\nexport type ProductDetailFlavour =\n (typeof ProductDetailFlavour)[keyof typeof ProductDetailFlavour];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const ProductDetailFlavour = {\n EVALUATION: \"EVALUATION\",\n BRONZE: \"BRONZE\",\n SILVER: \"SILVER\",\n GOLD: \"GOLD\",\n} as const;\n\n/**\n * The Product Type\n\n */\nexport type ProductDetailType =\n (typeof ProductDetailType)[keyof typeof ProductDetailType];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const ProductDetailType = {\n DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION:\n \"DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION\",\n DATA_MANAGER_STORAGE_SUBSCRIPTION: \"DATA_MANAGER_STORAGE_SUBSCRIPTION\",\n} as const;\n\nexport interface ProductDetail {\n /** The Product ID\n */\n id: string;\n created: string;\n /** The Product Type\n */\n type: ProductDetailType;\n /** The Product Type flavour. Not all products have flavours\n */\n flavour?: ProductDetailFlavour;\n /** The name of the Product\n */\n name?: string;\n}\n\nexport interface ProductCoinsDetail {\n /** The billing allowance. When you exceed this during the current billing period the *cost multiplier* will increase */\n allowance: number;\n /** The limit on your billing period spend. You can exceed the allowance but you cannot exceed the spend limit. Once reached the dependent may be restricted */\n limit: number;\n /** The total number of coins consumed (in this billing period), excluding the coins that have been consumed for the current day */\n used: number;\n /** True if the product is operating at or beyond its coin limit. When it is authority to perform actions using the product are severely limited. */\n at_limit: boolean;\n /** The current burn rate, the approximate amount of coins you are currently consuming each day */\n current_burn_rate: number;\n /** The predicted billing period amount, if costs continue at the current burn rate until the end of the billing period */\n billing_prediction: number;\n /** The day of the month when the bill is due, and the end of the current billing period */\n billing_day: number;\n /** A multiplier applied to your coin usage within your allowance */\n allowance_multiplier: number;\n /** A multiplier that will be applied to coin used beyond your allowance */\n overspend_multiplier: number;\n /** The number of days remaining, in the current billing period */\n remaining_days: number;\n}\n\nexport interface ProductClaimDetail {\n /** The service-specific ID that is using this Subscription\n */\n id: string;\n /** A name for the service-specific ID\n */\n name?: string;\n}\n\nexport type ProductDmStorageDetailCoins = {\n /** The number of coins currently committed for the current day. This is added to the accumulated coins at the start of each day */\n used: number;\n /** The coin cost of a 'unit' of storage or part thereof. The unit size is defined in the storage section of the response */\n unit_cost: number;\n};\n\nexport type ProductDmStorageDetailSize = {\n /** The humanised size of the peak storage used for the current day. The value is reset at the start of each day */\n peak: string;\n /** The humanised size of the current storage used for the current day and used to calculate the 'burn rate' */\n current: string;\n /** The humanised storage unit. The cost of storage is based on the daily peak of the number of units (or part thereof) used */\n unit_size: string;\n /** The peak number of storage units used today */\n units_used: number;\n};\n\nexport interface ProductDmStorageDetail {\n size: ProductDmStorageDetailSize;\n coins: ProductDmStorageDetailCoins;\n}\n\nexport interface ProductDmProjectTier {\n product: ProductDetail;\n organisation: OrganisationDetail;\n unit: UnitDetail;\n storage: ProductDmStorageDetail;\n coins: ProductCoinsDetail;\n instance: ProductInstanceDetail;\n /** True if the product can be (needs to be) claimed. */\n claimable: boolean;\n claim?: ProductClaimDetail;\n}\n\nexport interface ProductDmStorage {\n product: ProductDetail;\n organisation: OrganisationDetail;\n unit: UnitDetail;\n storage: ProductDmStorageDetail;\n coins: ProductCoinsDetail;\n /** True if the product can be (needs to be) claimed. */\n claimable: boolean;\n}\n\nexport interface ChargeAdditionalData {\n [key: string]: any;\n}\n\nexport interface StorageChargeItem {\n item_number: number;\n /** The date and time of the processing charge */\n date: string;\n /** The coin-cost of the storage */\n coins: string;\n /** The date when the charges concluded */\n closed?: string;\n additional_data?: ChargeAdditionalData;\n}\n\nexport interface StorageCharges {\n num_items: number;\n items: StorageChargeItem[];\n}\n\nexport interface ProcessingChargeItem {\n /** The charge record number */\n id: number;\n /** The most recent sequence number for this charge */\n sqn: number;\n name?: string;\n username: string;\n /** The date and time of the processing charge */\n timestamp: string;\n /** The coin-cost of the storage */\n coins: string;\n additional_data?: ChargeAdditionalData;\n}\n\nexport type ProcessingChargesMerchantKind =\n (typeof ProcessingChargesMerchantKind)[keyof typeof ProcessingChargesMerchantKind];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const ProcessingChargesMerchantKind = {\n DATA_MANAGER: \"DATA_MANAGER\",\n} as const;\n\nexport interface ProcessingCharges {\n merchant_name: string;\n merchant_kind: ProcessingChargesMerchantKind;\n merchant_api_hostname: string;\n /** The date when the process stopped */\n closed?: string;\n /** True if no further change to the charges can occur. Typically True after the charge has been closed for a pre-configured period of time. */\n final: boolean;\n /** True if charges were received after the charge record was finalised */\n post_final_charges?: boolean;\n charge: ProcessingChargeItem;\n}\n\nexport type AssetDetailScope =\n (typeof AssetDetailScope)[keyof typeof AssetDetailScope];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const AssetDetailScope = {\n USER: \"USER\",\n PRODUCT: \"PRODUCT\",\n UNIT: \"UNIT\",\n ORGANISATION: \"ORGANISATION\",\n GLOBAL: \"GLOBAL\",\n} as const;\n\nexport interface AssetDetail {\n creator: string;\n id: string;\n name: string;\n scope: AssetDetailScope;\n scope_id: string;\n secret: boolean;\n disabled: boolean;\n content: string;\n created: string;\n content_modified?: string;\n description?: string;\n merchants: MerchantDetail[];\n}\n\nexport type UserAccountGetResponse = UserAccountDetail;\n\nexport interface UnitsGetResponse {\n /** A list of Units\n */\n units: OrganisationUnitsGetResponse[];\n}\n\nexport type UnitGetResponse = UnitDetail;\n\nexport interface UnitProductPostResponse {\n /** The Product's unique ID */\n id: string;\n}\n\n/**\n * The type of charge\n */\nexport type ChargeSummaryType =\n (typeof ChargeSummaryType)[keyof typeof ChargeSummaryType];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const ChargeSummaryType = {\n PROCESSING: \"PROCESSING\",\n STORAGE: \"STORAGE\",\n} as const;\n\nexport interface ChargeSummary {\n /** The type of charge */\n type: ChargeSummaryType;\n /** The cost, in coins of the charge */\n coins: string;\n}\n\nexport interface UnitProductChargeSummary {\n product_id: string;\n product_type: string;\n charges: ChargeSummary[];\n}\n\nexport interface UnitChargeSummary {\n charges: ChargeSummary[];\n}\n\nexport interface UnitChargesGetResponse {\n /** Whether the user making the API call is a member of the Unit */\n caller_is_member: boolean;\n unit_id: string;\n name?: string;\n /** The Unit's owner (a username) */\n owner_id: string;\n /** True if the Unit is private */\n private: boolean;\n created: string;\n coins: string;\n billing_day: number;\n /** The start of the charge period */\n from: string;\n /** The date where of first day after the charge period */\n until: string;\n summary: UnitChargeSummary;\n products: UnitProductChargeSummary[];\n}\n\n/**\n * The Unit's Product\n */\nexport type ProductUnitGetResponseProduct =\n | ProductDmStorage\n | ProductDmProjectTier;\n\nexport interface ProductUnitGetResponse {\n /** The Unit's Product */\n product: ProductUnitGetResponseProduct;\n}\n\nexport interface ProductsGetTypesResponse {\n /** All the Product Types you have access to */\n product_types: ProductType[];\n}\n\nexport type ProductsGetDefaultStorageCostDefaultStorageCost = {\n cost: string;\n units: string;\n description: string;\n};\n\nexport interface ProductsGetDefaultStorageCost {\n default_storage_cost: ProductsGetDefaultStorageCostDefaultStorageCost;\n}\n\nexport type ProductsGetResponseProductsItem =\n | ProductDmStorage\n | ProductDmProjectTier;\n\nexport interface ProductsGetResponse {\n /** All the Products you have access to */\n products: ProductsGetResponseProductsItem[];\n}\n\nexport type ProductChargesGetResponseProductType =\n (typeof ProductChargesGetResponseProductType)[keyof typeof ProductChargesGetResponseProductType];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const ProductChargesGetResponseProductType = {\n DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION:\n \"DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION\",\n DATA_MANAGER_STORAGE_SUBSCRIPTION: \"DATA_MANAGER_STORAGE_SUBSCRIPTION\",\n} as const;\n\nexport interface ProductChargesGetResponse {\n product_id: string;\n product_type: ProductChargesGetResponseProductType;\n billing_day: number;\n /** True if the product can be (needs to be) claimed. */\n claimable: boolean;\n claim?: ProductClaimDetail;\n /** The start of the charge period */\n from: string;\n /** The date where of first day after the charge period */\n until: string;\n /** The total number of coins consumed by this product for the invoice period */\n coins: string;\n processing_charges: ProcessingCharges[];\n storage_charges: StorageCharges;\n}\n\nexport type OrganisationGetResponse = OrganisationDetail;\n\nexport interface OrganisationsGetResponse {\n /** A list of Organisations */\n organisations: OrganisationDetail[];\n}\n\nexport interface OrganisationUnitChargeSummary {\n unit_id: string;\n name: string;\n billing_day: number;\n /** The start of the charge period */\n from: string;\n /** The date where of first day after the charge period */\n until: string;\n summary: ChargeSummary[];\n}\n\nexport interface OrganisationChargesGetResponse {\n organisation_id: string;\n name: string;\n coins: string;\n summary: ChargeSummary[];\n unit_charges: OrganisationUnitChargeSummary[];\n}\n\nexport interface OrganisationUnitsGetResponse {\n organisation: OrganisationDetail;\n /** A list of Units\n */\n units: UnitDetail[];\n}\n\nexport interface OrganisationChargeSummary {\n organisation_id: string;\n name: string;\n summary: ChargeSummary[];\n}\n\nexport interface PersonalUnitPutResponse {\n /** The unit's Organisation. Used to identify the Default organisation */\n organisation_id: string;\n /** The unit's unique ID */\n id: string;\n}\n\nexport interface OrganisationUnitPostResponse {\n /** The unit's unique ID */\n id: string;\n}\n\nexport interface OrganisationGetDefaultResponse {\n /** Whether the user making the API call is a member of the Default Organisation. Only admin users are members of the Default organisation */\n caller_is_member: boolean;\n /** The Default Organisation ID\n */\n id: string;\n /** The Default Organisation Name\n */\n name: string;\n /** True if the Organisation is private. The Default organisation is always public, although it does not contain a membership (unless you're admin) and only houses Personal Units\n */\n private: boolean;\n created: string;\n}\n\nexport interface UsersGetResponse {\n organisation?: OrganisationDetail;\n unit?: UnitDetail;\n /** The list of Organisation Users\n */\n users: UserDetail[];\n}\n\nexport interface OrganisationPostResponse {\n /** The Organisation's unique ID */\n id: string;\n}\n\nexport interface StateGetVersionResponse {\n /** The Account Server version. This is guaranteed to be a valid semantic version for official (tagged) images. The version value format for unofficial images is a string but otherwise undefined\n */\n version: string;\n}\n\nexport interface EventStreamGetPostResponse {\n /** The EventStream ID */\n id: number;\n /** The EventStream read token, required to read from the stream */\n read_token: string;\n}\n\nexport interface ChargesGetResponse {\n coins: string;\n summary: ChargeSummary[];\n organisation_charges: OrganisationChargeSummary[];\n}\n\nexport interface AssetPostResponse {\n /** The Asset ID\n */\n id: string;\n}\n\nexport interface AssetGetResponse {\n /** A list of Assets\n */\n assets: AssetDetail[];\n}\n\nexport interface AsError {\n /** Brief error text that can be presented to the user */\n error: string;\n}\n"]}
1
+ {"version":3,"sources":["../src/account-server-api.schemas.ts"],"names":[],"mappings":";;;;;;;;AAiKO,IAAM,8BAA8B;AAAA,EACzC,wCAAwC;AAAA,EACxC,mCAAmC;AACrC;AASO,IAAM,iCAAiC;AAAA,EAC5C,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,MAAM;AACR;AAkDO,IAAM,yBAAyB;AAAA,EACpC,MAAM;AAAA,EACN,SAAS;AAAA,EACT,MAAM;AAAA,EACN,cAAc;AAAA,EACd,QAAQ;AACV;AA+DO,IAAM,qBAAqB;AAAA,EAChC,cAAc;AAChB;AA2CO,IAAM,yBAAyB;AAAA,EACpC,cAAc;AAChB;AA6BO,IAAM,oBAAoB;AAAA,EAC/B,wCAAwC;AAAA,EACxC,mCAAmC;AACrC;AAUO,IAAM,uBAAuB;AAAA,EAClC,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,MAAM;AACR;AAmIO,IAAM,gCAAgC;AAAA,EAC3C,cAAc;AAChB;AAmBO,IAAM,mBAAmB;AAAA,EAC9B,MAAM;AAAA,EACN,SAAS;AAAA,EACT,MAAM;AAAA,EACN,cAAc;AAAA,EACd,QAAQ;AACV;AAuCO,IAAM,oBAAoB;AAAA,EAC/B,YAAY;AAAA,EACZ,SAAS;AACX;AA2EO,IAAM,uCAAuC;AAAA,EAClD,wCAAwC;AAAA,EACxC,mCAAmC;AACrC","sourcesContent":["/**\n * Generated by orval v6.25.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 */\nexport type DetachAssetParams = {\n/**\n * A Merchant Identity\n */\nm_id?: QMIdParameter;\n};\n\nexport type AttachAssetParams = {\n/**\n * A Merchant Identity\n */\nm_id?: QMIdParameter;\n};\n\n/**\n * A date where assets prior to this will be returned. This can be a date-time string but it is interpreted as a date, i.e. `2020-01-01T00:00:00Z` is interpreted as `2020-01-01`. Any asset that occurs prior this date will be returned. UTC is assumed if no timezone is provided\n */\nexport type QUntilParameter = string;\n\n/**\n * A date from which to retrieve assets. This can be a date-time string but it is interpreted as a date, i.e. `2020-01-01T00:00:00Z` is interpreted as `2020-01-01`. Any asset that occurs on ar after this date will be returned. UTC is assumed if no timezone is provided\n */\nexport type QFromParameter = string;\n\nexport type GetOrganisationChargesParams = {\n/**\n * A date from which to retrieve assets. This can be a date-time string but it is interpreted as a date, i.e. `2020-01-01T00:00:00Z` is interpreted as `2020-01-01`. Any asset that occurs on ar after this date will be returned. UTC is assumed if no timezone is provided\n */\nfrom?: QFromParameter;\n/**\n * A date where assets prior to this will be returned. This can be a date-time string but it is interpreted as a date, i.e. `2020-01-01T00:00:00Z` is interpreted as `2020-01-01`. Any asset that occurs prior this date will be returned. UTC is assumed if no timezone is provided\n */\nuntil?: QUntilParameter;\n/**\n * A charge Prior Billing Period, 0 implies \"current\" and -23 is for the period 23 months ago.\n */\npbp?: QPbpParameter;\n};\n\nexport type GetProductChargesParams = {\n/**\n * A date from which to retrieve assets. This can be a date-time string but it is interpreted as a date, i.e. `2020-01-01T00:00:00Z` is interpreted as `2020-01-01`. Any asset that occurs on ar after this date will be returned. UTC is assumed if no timezone is provided\n */\nfrom?: QFromParameter;\n/**\n * A date where assets prior to this will be returned. This can be a date-time string but it is interpreted as a date, i.e. `2020-01-01T00:00:00Z` is interpreted as `2020-01-01`. Any asset that occurs prior this date will be returned. UTC is assumed if no timezone is provided\n */\nuntil?: QUntilParameter;\n/**\n * A charge Prior Billing Period, 0 implies \"current\" and -23 is for the period 23 months ago.\n */\npbp?: QPbpParameter;\n};\n\nexport type GetChargesParams = {\n/**\n * A date from which to retrieve assets. This can be a date-time string but it is interpreted as a date, i.e. `2020-01-01T00:00:00Z` is interpreted as `2020-01-01`. Any asset that occurs on ar after this date will be returned. UTC is assumed if no timezone is provided\n */\nfrom?: QFromParameter;\n/**\n * A date where assets prior to this will be returned. This can be a date-time string but it is interpreted as a date, i.e. `2020-01-01T00:00:00Z` is interpreted as `2020-01-01`. Any asset that occurs prior this date will be returned. UTC is assumed if no timezone is provided\n */\nuntil?: QUntilParameter;\n/**\n * A charge Prior Billing Period, 0 implies \"current\" and -23 is for the period 23 months ago.\n */\npbp?: QPbpParameter;\n};\n\n/**\n * A User Identity\n */\nexport type QUserIdParameter = string;\n\n/**\n * A Product Identity\n */\nexport type QProductIdParameter = string;\n\n/**\n * A Unit Identity\n */\nexport type QUnitIdParameter = string;\n\nexport type GetAssetParams = {\n/**\n * A User Identity\n */\nuser_id?: QUserIdParameter;\n/**\n * A Product Identity\n */\nproduct_id?: QProductIdParameter;\n/**\n * A Unit Identity\n */\nunit_id?: QUnitIdParameter;\n/**\n * An Organisation Identity\n */\norg_id?: QOrgIdParameter;\n};\n\n/**\n * A Merchant Identity\n */\nexport type QMIdParameter = number;\n\n/**\n * An Organisation Identity\n */\nexport type QOrgIdParameter = string;\n\n/**\n * A charge Prior Billing Period, 0 implies \"current\" and -23 is for the period 23 months ago.\n */\nexport type QPbpParameter = number;\n\nexport type GetUnitChargesParams = {\n/**\n * A date from which to retrieve assets. This can be a date-time string but it is interpreted as a date, i.e. `2020-01-01T00:00:00Z` is interpreted as `2020-01-01`. Any asset that occurs on ar after this date will be returned. UTC is assumed if no timezone is provided\n */\nfrom?: QFromParameter;\n/**\n * A date where assets prior to this will be returned. This can be a date-time string but it is interpreted as a date, i.e. `2020-01-01T00:00:00Z` is interpreted as `2020-01-01`. Any asset that occurs prior this date will be returned. UTC is assumed if no timezone is provided\n */\nuntil?: QUntilParameter;\n/**\n * A charge Prior Billing Period, 0 implies \"current\" and -23 is for the period 23 months ago.\n */\npbp?: QPbpParameter;\n};\n\nexport type ProductPatchBodyBody = {\n /** The Product's built-in coin allowance. Product allowances cannot be reduced */\n allowance?: number;\n /** The Product's built-in coin limit. If set it must not be less than the allowance. If not set the allowance is used. The existing product limit cannot be reduced */\n limit?: number;\n /** The name you want to give the Product */\n name?: string;\n};\n\n/**\n * The Type of Product. Storage subscriptions require an **Allowance** to be defined and the **Flavour** must not be provided.\n\nProject Tier subscriptions have built-in allowances and Limits so you must not provide values for these for these products\n */\nexport type UnitProductPostBodyBodyType = typeof UnitProductPostBodyBodyType[keyof typeof UnitProductPostBodyBodyType];\n\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const UnitProductPostBodyBodyType = {\n DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION: 'DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION',\n DATA_MANAGER_STORAGE_SUBSCRIPTION: 'DATA_MANAGER_STORAGE_SUBSCRIPTION',\n} as const;\n\n/**\n * The Flavour of the Product. Used only for Project Tier Products. Do not set this for Storage products\n */\nexport type UnitProductPostBodyBodyFlavour = typeof UnitProductPostBodyBodyFlavour[keyof typeof UnitProductPostBodyBodyFlavour];\n\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const UnitProductPostBodyBodyFlavour = {\n EVALUATION: 'EVALUATION',\n BRONZE: 'BRONZE',\n SILVER: 'SILVER',\n GOLD: 'GOLD',\n} as const;\n\nexport type UnitProductPostBodyBody = {\n /** The Product's coin allowance. You must provide this for Storage products but you must not provide a value for Project Tier Products */\n allowance?: number;\n /** The Flavour of the Product. Used only for Project Tier Products. Do not set this for Storage products */\n flavour?: UnitProductPostBodyBodyFlavour;\n /** The Product's built-in coin limit. If set it must not be less than the allowance. If not set the allowance is used. You can provide this for Storage products but you must not provide a value for Project Tier Products */\n limit?: number;\n /** The name you want to give the Product */\n name: string;\n /** The Type of Product. Storage subscriptions require an **Allowance** to be defined and the **Flavour** must not be provided.\n\nProject Tier subscriptions have built-in allowances and Limits so you must not provide values for these for these products */\n type: UnitProductPostBodyBodyType;\n};\n\nexport type UnitPatchBodyBody = {\n /** The new name for the Unit */\n name?: string;\n};\n\nexport type OrganisationPatchBodyBody = {\n /** The new name for the Organisational */\n name?: string;\n};\n\nexport type OrganisationUnitPostBodyBody = {\n /** The day you would like to be billed for the Unit's Products (a value from 1 and 28) */\n billing_day: number;\n /** The name of the unit */\n name: string;\n};\n\nexport type PersonalUnitPutBodyBody = {\n /** The day you would like to be billed for the Unit's Products (a value from 1 and 28) */\n billing_day: number;\n};\n\nexport type OrganisationPostBodyBody = {\n /** The name of the organisation */\n name: string;\n /** The name of the organisation owner. A user ID */\n owner: string;\n};\n\nexport type AssetPostBodyBodyScope = typeof AssetPostBodyBodyScope[keyof typeof AssetPostBodyBodyScope];\n\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const AssetPostBodyBodyScope = {\n USER: 'USER',\n PRODUCT: 'PRODUCT',\n UNIT: 'UNIT',\n ORGANISATION: 'ORGANISATION',\n GLOBAL: 'GLOBAL',\n} as const;\n\nexport type AssetPostBodyBody = {\n /** A file containing the content for the asset. You must provide a value here or in content_string */\n content_file?: Blob;\n /** The textual content of the asset. You must provide a value here or in content_file */\n content_string?: string;\n /** An optional description for the Asset */\n description?: string;\n /** The name of the asset. This must be unique within its scope. For example, only one asset can be called \"asset-1\" within a given Unit. Asset names must be valid RFC 1123 Label Names */\n name: string;\n scope: AssetPostBodyBodyScope;\n /** The unique identity based on the Scope of the asset. For example, this will be the Unit ID if it's a UNIT. A scope_id is required if the scope is USER as it will be automatically set to your username. Global assets do not have a scope. */\n scope_id?: string;\n /** Is this a secret asset? */\n secret: boolean;\n};\n\nexport type AssetPatchBodyBody = {\n /** A file containing the content for the asset. You must provide a value here or in content_string */\n content_file?: Blob;\n /** The textual content of the asset. You must provide a value here or in content_file */\n content_string?: string;\n /** An optional description for the Asset */\n description?: string;\n};\n\nexport interface UserDetail {\n /** The user identity (username) */\n id: string;\n}\n\nexport interface UserAccountDetail {\n /** The roles assigned to the user recognised by the Account Server */\n account_server_roles: string[];\n /** Whether the caller has admin privilege */\n caller_has_admin_privilege: boolean;\n user: UserDetail;\n}\n\nexport interface UnitDetail {\n /** The Unit's billing day */\n billing_day: number;\n /** Whether the user making the API call is a member of the Unit */\n caller_is_member: boolean;\n created: string;\n /** The Unit's unique identity */\n id: string;\n /** The Unit's name */\n name: string;\n /** The Unit's owner (a username) */\n owner_id: string;\n /** True if the Unit is private */\n private: boolean;\n}\n\n/**\n * The kind of Service\n */\nexport type MerchantDetailKind = typeof MerchantDetailKind[keyof typeof MerchantDetailKind];\n\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const MerchantDetailKind = {\n DATA_MANAGER: 'DATA_MANAGER',\n} as const;\n\nexport interface MerchantDetail {\n /** The hostname used by the Service */\n api_hostname: string;\n created: string;\n /** The unique ID of the Service */\n id: number;\n /** The kind of Service */\n kind: MerchantDetailKind;\n /** The name assigned to the Service */\n name: string;\n}\n\nexport type MerchantGetResponse = MerchantDetail;\n\nexport interface MerchantsGetResponse {\n /** The list of known Merchants\n */\n merchants: MerchantDetail[];\n}\n\nexport interface OrganisationDetail {\n /** Whether the user making the API call is a member of the Unit */\n caller_is_member: boolean;\n created: string;\n /** The Organisation's unique ID */\n id: string;\n /** The Organisation's name */\n name: string;\n /** The username of the Organisation's owner. Not all Organisations have an owner. The Default Organisation has no owner. */\n owner_id?: string;\n /** True if the Unit is private */\n private: boolean;\n}\n\n/**\n * The kind of service that can use the Product\n */\nexport type ProductTypeServiceKind = typeof ProductTypeServiceKind[keyof typeof ProductTypeServiceKind];\n\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const ProductTypeServiceKind = {\n DATA_MANAGER: 'DATA_MANAGER',\n} as const;\n\nexport interface ProductType {\n /** A product flavour. Not all types have a flavour, those that do have a type-specific flavour string */\n flavour?: string;\n /** The kind of service that can use the Product */\n service_kind?: ProductTypeServiceKind;\n /** A product type, this is a unique string amongst all types known to the Account Server */\n type: string;\n}\n\nexport type ProductInstanceDetailCoins = {\n /** The number of coins used\n */\n used: number;\n};\n\nexport interface ProductInstanceDetail {\n coins: ProductInstanceDetailCoins;\n}\n\n/**\n * The Product Type\n\n */\nexport type ProductDetailType = typeof ProductDetailType[keyof typeof ProductDetailType];\n\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const ProductDetailType = {\n DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION: 'DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION',\n DATA_MANAGER_STORAGE_SUBSCRIPTION: 'DATA_MANAGER_STORAGE_SUBSCRIPTION',\n} as const;\n\n/**\n * The Product Type flavour. Not all products have flavours\n\n */\nexport type ProductDetailFlavour = typeof ProductDetailFlavour[keyof typeof ProductDetailFlavour];\n\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const ProductDetailFlavour = {\n EVALUATION: 'EVALUATION',\n BRONZE: 'BRONZE',\n SILVER: 'SILVER',\n GOLD: 'GOLD',\n} as const;\n\nexport interface ProductDetail {\n created: string;\n /** The Product Type flavour. Not all products have flavours\n */\n flavour?: ProductDetailFlavour;\n /** The Product ID\n */\n id: string;\n /** The name of the Product\n */\n name?: string;\n /** The Product Type\n */\n type: ProductDetailType;\n}\n\nexport interface ProductCoinsDetail {\n /** The billing allowance. When you exceed this during the current billing period the *cost multiplier* will increase */\n allowance: number;\n /** A multiplier applied to your coin usage within your allowance */\n allowance_multiplier: number;\n /** True if the product is operating at or beyond its coin limit. When it is authority to perform actions using the product are severely limited. */\n at_limit: boolean;\n /** The day of the month when the bill is due, and the end of the current billing period */\n billing_day: number;\n /** The predicted billing period amount, if costs continue at the current burn rate until the end of the billing period */\n billing_prediction: number;\n /** The current burn rate, the approximate amount of coins you are currently consuming each day */\n current_burn_rate: number;\n /** The limit on your billing period spend. You can exceed the allowance but you cannot exceed the spend limit. Once reached the dependent may be restricted */\n limit: number;\n /** A multiplier that will be applied to coin used beyond your allowance */\n overspend_multiplier: number;\n /** The number of days remaining, in the current billing period */\n remaining_days: number;\n /** The total number of coins consumed (in this billing period), excluding the coins that have been consumed for the current day */\n used: number;\n}\n\nexport interface ProductClaimDetail {\n /** The service-specific ID that is using this Subscription\n */\n id: string;\n /** A name for the service-specific ID\n */\n name?: string;\n}\n\nexport type ProductDmStorageDetailSize = {\n /** The humanised size of the current storage used for the current day and used to calculate the 'burn rate' */\n current: string;\n /** The humanised size of the peak storage used for the current day. The value is reset at the start of each day */\n peak: string;\n /** The humanised storage unit. The cost of storage is based on the daily peak of the number of units (or part thereof) used */\n unit_size: string;\n /** The peak number of storage units used today */\n units_used: number;\n};\n\nexport type ProductDmStorageDetailCoins = {\n /** The coin cost of a 'unit' of storage or part thereof. The unit size is defined in the storage section of the response */\n unit_cost: number;\n /** The number of coins currently committed for the current day. This is added to the accumulated coins at the start of each day */\n used: number;\n};\n\nexport interface ProductDmStorageDetail {\n coins: ProductDmStorageDetailCoins;\n size: ProductDmStorageDetailSize;\n}\n\nexport interface ProductDmProjectTier {\n claim?: ProductClaimDetail;\n /** True if the product can be (needs to be) claimed. */\n claimable: boolean;\n coins: ProductCoinsDetail;\n instance: ProductInstanceDetail;\n organisation: OrganisationDetail;\n product: ProductDetail;\n storage: ProductDmStorageDetail;\n unit: UnitDetail;\n}\n\nexport interface ProductDmStorage {\n /** True if the product can be (needs to be) claimed. */\n claimable: boolean;\n coins: ProductCoinsDetail;\n organisation: OrganisationDetail;\n product: ProductDetail;\n storage: ProductDmStorageDetail;\n unit: UnitDetail;\n}\n\nexport interface ChargeAdditionalData { [key: string]: any }\n\nexport interface StorageChargeItem {\n additional_data?: ChargeAdditionalData;\n /** The date when the charges concluded */\n closed?: string;\n /** The coin-cost of the storage */\n coins: string;\n /** The date and time of the processing charge */\n date: string;\n item_number: number;\n}\n\nexport interface StorageCharges {\n items: StorageChargeItem[];\n num_items: number;\n}\n\nexport interface ProcessingChargeItem {\n additional_data?: ChargeAdditionalData;\n /** The coin-cost of the storage */\n coins: string;\n /** The charge record number */\n id: number;\n name?: string;\n /** The most recent sequence number for this charge */\n sqn: number;\n /** The date and time of the processing charge */\n timestamp: string;\n username: string;\n}\n\nexport type ProcessingChargesMerchantKind = typeof ProcessingChargesMerchantKind[keyof typeof ProcessingChargesMerchantKind];\n\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const ProcessingChargesMerchantKind = {\n DATA_MANAGER: 'DATA_MANAGER',\n} as const;\n\nexport interface ProcessingCharges {\n charge: ProcessingChargeItem;\n /** The date when the process stopped */\n closed?: string;\n /** True if no further change to the charges can occur. Typically True after the charge has been closed for a pre-configured period of time. */\n final: boolean;\n merchant_api_hostname: string;\n merchant_kind: ProcessingChargesMerchantKind;\n merchant_name: string;\n /** True if charges were received after the charge record was finalised */\n post_final_charges?: boolean;\n}\n\nexport type AssetDetailScope = typeof AssetDetailScope[keyof typeof AssetDetailScope];\n\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const AssetDetailScope = {\n USER: 'USER',\n PRODUCT: 'PRODUCT',\n UNIT: 'UNIT',\n ORGANISATION: 'ORGANISATION',\n GLOBAL: 'GLOBAL',\n} as const;\n\nexport interface AssetDetail {\n content: string;\n content_modified?: string;\n created: string;\n creator: string;\n description?: string;\n disabled: boolean;\n id: string;\n merchants: MerchantDetail[];\n name: string;\n scope: AssetDetailScope;\n scope_id: string;\n secret: boolean;\n}\n\nexport type UserAccountGetResponse = UserAccountDetail;\n\nexport interface UnitsGetResponse {\n /** A list of Units\n */\n units: OrganisationUnitsGetResponse[];\n}\n\nexport type UnitGetResponse = UnitDetail;\n\nexport interface UnitProductPostResponse {\n /** The Product's unique ID */\n id: string;\n}\n\n/**\n * The type of charge\n */\nexport type ChargeSummaryType = typeof ChargeSummaryType[keyof typeof ChargeSummaryType];\n\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const ChargeSummaryType = {\n PROCESSING: 'PROCESSING',\n STORAGE: 'STORAGE',\n} as const;\n\nexport interface ChargeSummary {\n /** The cost, in coins of the charge */\n coins: string;\n /** The type of charge */\n type: ChargeSummaryType;\n}\n\nexport interface UnitProductChargeSummary {\n charges: ChargeSummary[];\n product_id: string;\n product_type: string;\n}\n\nexport interface UnitChargeSummary {\n charges: ChargeSummary[];\n}\n\nexport interface UnitChargesGetResponse {\n billing_day: number;\n /** Whether the user making the API call is a member of the Unit */\n caller_is_member: boolean;\n coins: string;\n created: string;\n /** The start of the charge period */\n from: string;\n name?: string;\n /** The Unit's owner (a username) */\n owner_id: string;\n /** True if the Unit is private */\n private: boolean;\n products: UnitProductChargeSummary[];\n summary: UnitChargeSummary;\n unit_id: string;\n /** The date where of first day after the charge period */\n until: string;\n}\n\n/**\n * The Unit's Product\n */\nexport type ProductUnitGetResponseProduct = ProductDmStorage | ProductDmProjectTier;\n\nexport interface ProductUnitGetResponse {\n /** The Unit's Product */\n product: ProductUnitGetResponseProduct;\n}\n\nexport interface ProductsGetTypesResponse {\n /** All the Product Types you have access to */\n product_types: ProductType[];\n}\n\nexport type ProductsGetDefaultStorageCostDefaultStorageCost = {\n cost: string;\n description: string;\n units: string;\n};\n\nexport interface ProductsGetDefaultStorageCost {\n default_storage_cost: ProductsGetDefaultStorageCostDefaultStorageCost;\n}\n\nexport type ProductsGetResponseProductsItem = ProductDmStorage | ProductDmProjectTier;\n\nexport interface ProductsGetResponse {\n /** All the Products you have access to */\n products: ProductsGetResponseProductsItem[];\n}\n\nexport type ProductChargesGetResponseProductType = typeof ProductChargesGetResponseProductType[keyof typeof ProductChargesGetResponseProductType];\n\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const ProductChargesGetResponseProductType = {\n DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION: 'DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION',\n DATA_MANAGER_STORAGE_SUBSCRIPTION: 'DATA_MANAGER_STORAGE_SUBSCRIPTION',\n} as const;\n\nexport interface ProductChargesGetResponse {\n billing_day: number;\n claim?: ProductClaimDetail;\n /** True if the product can be (needs to be) claimed. */\n claimable: boolean;\n /** The total number of coins consumed by this product for the invoice period */\n coins: string;\n /** The start of the charge period */\n from: string;\n processing_charges: ProcessingCharges[];\n product_id: string;\n product_type: ProductChargesGetResponseProductType;\n storage_charges: StorageCharges;\n /** The date where of first day after the charge period */\n until: string;\n}\n\nexport type OrganisationGetResponse = OrganisationDetail;\n\nexport interface OrganisationsGetResponse {\n /** A list of Organisations */\n organisations: OrganisationDetail[];\n}\n\nexport interface OrganisationUnitChargeSummary {\n billing_day: number;\n /** The start of the charge period */\n from: string;\n name: string;\n summary: ChargeSummary[];\n unit_id: string;\n /** The date where of first day after the charge period */\n until: string;\n}\n\nexport interface OrganisationChargesGetResponse {\n coins: string;\n name: string;\n organisation_id: string;\n summary: ChargeSummary[];\n unit_charges: OrganisationUnitChargeSummary[];\n}\n\nexport interface OrganisationUnitsGetResponse {\n organisation: OrganisationDetail;\n /** A list of Units\n */\n units: UnitDetail[];\n}\n\nexport interface OrganisationChargeSummary {\n name: string;\n organisation_id: string;\n summary: ChargeSummary[];\n}\n\nexport interface PersonalUnitPutResponse {\n /** The unit's unique ID */\n id: string;\n /** The unit's Organisation. Used to identify the Default organisation */\n organisation_id: string;\n}\n\nexport interface OrganisationUnitPostResponse {\n /** The unit's unique ID */\n id: string;\n}\n\nexport interface OrganisationGetDefaultResponse {\n /** Whether the user making the API call is a member of the Default Organisation. Only admin users are members of the Default organisation */\n caller_is_member?: boolean;\n created?: string;\n /** The Default Organisation ID\n */\n id?: string;\n /** The Default Organisation Name\n */\n name?: string;\n /** True if the Organisation is private. The Default organisation is always public, although it does not contain a membership (unless you're admin) and only houses Personal Units\n */\n private?: boolean;\n}\n\nexport interface UsersGetResponse {\n organisation?: OrganisationDetail;\n unit?: UnitDetail;\n /** The list of Organisation Users\n */\n users: UserDetail[];\n}\n\nexport interface OrganisationPostResponse {\n /** The Organisation's unique ID */\n id: string;\n}\n\nexport interface StateGetVersionResponse {\n /** The Account Server version. This is guaranteed to be a valid semantic version for official (tagged) images. The version value format for unofficial images is a string but otherwise undefined\n */\n version: string;\n}\n\nexport interface EventStreamGetPostResponse {\n /** The EventStream ID */\n id: number;\n /** The EventStream read token, required to read from the stream */\n read_token: string;\n}\n\nexport interface ChargesGetResponse {\n coins: string;\n organisation_charges: OrganisationChargeSummary[];\n summary: ChargeSummary[];\n}\n\nexport interface AssetPostResponse {\n /** The Asset ID\n */\n id: string;\n}\n\nexport interface AssetGetResponse {\n /** A list of Assets\n */\n assets: AssetDetail[];\n}\n\nexport interface AsError {\n /** Brief error text that can be presented to the user */\n error: string;\n}\n\n"]}