@squonk/account-server-client 3.1.0-alpha.3 → 4.0.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/asset/asset.cjs +24 -24
- package/asset/asset.cjs.map +1 -1
- package/asset/asset.d.cts +137 -102
- package/asset/asset.d.ts +137 -102
- package/asset/asset.js +24 -24
- package/asset/asset.js.map +1 -1
- package/charges/charges.cjs +16 -16
- package/charges/charges.cjs.map +1 -1
- package/charges/charges.d.cts +137 -65
- package/charges/charges.d.ts +137 -65
- package/charges/charges.js +16 -16
- package/charges/charges.js.map +1 -1
- package/chunk-TKLTUR4R.cjs.map +1 -1
- package/event-stream/event-stream.cjs +8 -8
- package/event-stream/event-stream.cjs.map +1 -1
- package/event-stream/event-stream.d.cts +82 -47
- package/event-stream/event-stream.d.ts +82 -47
- package/event-stream/event-stream.js +8 -8
- package/event-stream/event-stream.js.map +1 -1
- package/index.cjs.map +1 -1
- package/index.d.cts +62 -14
- package/index.d.ts +62 -14
- package/index.js.map +1 -1
- package/merchant/merchant.cjs +8 -8
- package/merchant/merchant.cjs.map +1 -1
- package/merchant/merchant.d.cts +69 -33
- package/merchant/merchant.d.ts +69 -33
- package/merchant/merchant.js +8 -8
- package/merchant/merchant.js.map +1 -1
- package/organisation/organisation.cjs +14 -14
- package/organisation/organisation.cjs.map +1 -1
- package/organisation/organisation.d.cts +128 -75
- package/organisation/organisation.d.ts +128 -75
- package/organisation/organisation.js +14 -14
- package/organisation/organisation.js.map +1 -1
- package/package.json +7 -7
- package/product/product.cjs +24 -24
- package/product/product.cjs.map +1 -1
- package/product/product.d.cts +229 -122
- package/product/product.d.ts +229 -122
- package/product/product.js +24 -24
- package/product/product.js.map +1 -1
- package/src/account-server-api.schemas.ts +63 -14
- package/src/asset/asset.ts +185 -65
- package/src/charges/charges.ts +200 -18
- package/src/event-stream/event-stream.ts +114 -19
- package/src/merchant/merchant.ts +94 -10
- package/src/organisation/organisation.ts +171 -31
- package/src/product/product.ts +301 -41
- package/src/state/state.ts +50 -6
- package/src/unit/unit.ts +188 -38
- package/src/user/user.ts +183 -38
- package/state/state.cjs +4 -4
- package/state/state.cjs.map +1 -1
- package/state/state.d.cts +35 -17
- package/state/state.d.ts +35 -17
- package/state/state.js +4 -4
- package/state/state.js.map +1 -1
- package/unit/unit.cjs +12 -12
- package/unit/unit.cjs.map +1 -1
- package/unit/unit.d.cts +140 -87
- package/unit/unit.d.ts +140 -87
- package/unit/unit.js +12 -12
- package/unit/unit.js.map +1 -1
- package/user/user.cjs +12 -12
- package/user/user.cjs.map +1 -1
- package/user/user.d.cts +139 -86
- package/user/user.d.ts +139 -86
- package/user/user.js +12 -12
- package/user/user.js.map +1 -1
package/asset/asset.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { UseQueryOptions, QueryKey, UseQueryResult, UseSuspenseQueryOptions, UseSuspenseQueryResult, UseMutationOptions } from '@tanstack/react-query';
|
|
1
|
+
import { UseQueryOptions, QueryKey, DefinedInitialDataOptions, DefinedUseQueryResult, UndefinedInitialDataOptions, UseQueryResult, UseSuspenseQueryOptions, UseSuspenseQueryResult, UseMutationOptions, UseMutationResult } from '@tanstack/react-query';
|
|
3
2
|
import { GetAssetParams, customInstance, AssetGetResponse, ErrorType, AsError, AssetPostBodyBody, AssetPostResponse, AssetDetail, AssetPatchBodyBody, AttachAssetParams, DetachAssetParams } from '../index.js';
|
|
4
3
|
import 'axios';
|
|
5
4
|
|
|
@@ -12,37 +11,55 @@ type SecondParameter<T extends (...args: any) => any> = Parameters<T>[1];
|
|
|
12
11
|
declare const getAsset: (params?: GetAssetParams, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<AssetGetResponse>;
|
|
13
12
|
declare const getGetAssetQueryKey: (params?: GetAssetParams) => readonly ["account-server-api", "/asset", ...GetAssetParams[]];
|
|
14
13
|
declare const getGetAssetQueryOptions: <TData = AssetGetResponse, TError = ErrorType<void | AsError>>(params?: GetAssetParams, options?: {
|
|
15
|
-
query?: Partial<UseQueryOptions<
|
|
14
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>>;
|
|
16
15
|
request?: SecondParameter<typeof customInstance>;
|
|
17
|
-
}
|
|
16
|
+
}) => UseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData> & {
|
|
18
17
|
queryKey: QueryKey;
|
|
19
18
|
};
|
|
20
19
|
type GetAssetQueryResult = NonNullable<Awaited<ReturnType<typeof getAsset>>>;
|
|
21
20
|
type GetAssetQueryError = ErrorType<AsError | void>;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
declare function useGetAsset<TData = Awaited<ReturnType<typeof getAsset>>, TError = ErrorType<AsError | void>>(params: undefined | GetAssetParams, options: {
|
|
22
|
+
query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>> & Pick<DefinedInitialDataOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>, 'initialData'>;
|
|
23
|
+
request?: SecondParameter<typeof customInstance>;
|
|
24
|
+
}): DefinedUseQueryResult<TData, TError> & {
|
|
25
|
+
queryKey: QueryKey;
|
|
26
|
+
};
|
|
27
|
+
declare function useGetAsset<TData = Awaited<ReturnType<typeof getAsset>>, TError = ErrorType<AsError | void>>(params?: GetAssetParams, options?: {
|
|
28
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>> & Pick<UndefinedInitialDataOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>, 'initialData'>;
|
|
29
|
+
request?: SecondParameter<typeof customInstance>;
|
|
30
|
+
}): UseQueryResult<TData, TError> & {
|
|
31
|
+
queryKey: QueryKey;
|
|
32
|
+
};
|
|
33
|
+
declare function useGetAsset<TData = Awaited<ReturnType<typeof getAsset>>, TError = ErrorType<AsError | void>>(params?: GetAssetParams, options?: {
|
|
34
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>>;
|
|
27
35
|
request?: SecondParameter<typeof customInstance>;
|
|
28
|
-
}
|
|
36
|
+
}): UseQueryResult<TData, TError> & {
|
|
29
37
|
queryKey: QueryKey;
|
|
30
38
|
};
|
|
31
39
|
declare const getGetAssetSuspenseQueryOptions: <TData = AssetGetResponse, TError = ErrorType<void | AsError>>(params?: GetAssetParams, options?: {
|
|
32
|
-
query?: Partial<UseSuspenseQueryOptions<
|
|
40
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>>;
|
|
33
41
|
request?: SecondParameter<typeof customInstance>;
|
|
34
|
-
}
|
|
42
|
+
}) => UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData> & {
|
|
35
43
|
queryKey: QueryKey;
|
|
36
44
|
};
|
|
37
45
|
type GetAssetSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getAsset>>>;
|
|
38
46
|
type GetAssetSuspenseQueryError = ErrorType<AsError | void>;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
47
|
+
declare function useGetAssetSuspense<TData = Awaited<ReturnType<typeof getAsset>>, TError = ErrorType<AsError | void>>(params: undefined | GetAssetParams, options: {
|
|
48
|
+
query: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>>;
|
|
49
|
+
request?: SecondParameter<typeof customInstance>;
|
|
50
|
+
}): UseSuspenseQueryResult<TData, TError> & {
|
|
51
|
+
queryKey: QueryKey;
|
|
52
|
+
};
|
|
53
|
+
declare function useGetAssetSuspense<TData = Awaited<ReturnType<typeof getAsset>>, TError = ErrorType<AsError | void>>(params?: GetAssetParams, options?: {
|
|
54
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>>;
|
|
55
|
+
request?: SecondParameter<typeof customInstance>;
|
|
56
|
+
}): UseSuspenseQueryResult<TData, TError> & {
|
|
57
|
+
queryKey: QueryKey;
|
|
58
|
+
};
|
|
59
|
+
declare function useGetAssetSuspense<TData = Awaited<ReturnType<typeof getAsset>>, TError = ErrorType<AsError | void>>(params?: GetAssetParams, options?: {
|
|
60
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>>;
|
|
44
61
|
request?: SecondParameter<typeof customInstance>;
|
|
45
|
-
}
|
|
62
|
+
}): UseSuspenseQueryResult<TData, TError> & {
|
|
46
63
|
queryKey: QueryKey;
|
|
47
64
|
};
|
|
48
65
|
/**
|
|
@@ -58,11 +75,11 @@ They must also be *attached* to a **Merchant** before the **Merchant** can ue th
|
|
|
58
75
|
*/
|
|
59
76
|
declare const createAsset: (assetPostBodyBody: AssetPostBodyBody, options?: SecondParameter<typeof customInstance>) => Promise<AssetPostResponse>;
|
|
60
77
|
declare const getCreateAssetMutationOptions: <TError = ErrorType<void | AsError>, TContext = unknown>(options?: {
|
|
61
|
-
mutation?: UseMutationOptions<
|
|
78
|
+
mutation?: UseMutationOptions<Awaited<ReturnType<typeof createAsset>>, TError, {
|
|
62
79
|
data: AssetPostBodyBody;
|
|
63
|
-
}, TContext
|
|
80
|
+
}, TContext>;
|
|
64
81
|
request?: SecondParameter<typeof customInstance>;
|
|
65
|
-
}
|
|
82
|
+
}) => UseMutationOptions<Awaited<ReturnType<typeof createAsset>>, TError, {
|
|
66
83
|
data: AssetPostBodyBody;
|
|
67
84
|
}, TContext>;
|
|
68
85
|
type CreateAssetMutationResult = NonNullable<Awaited<ReturnType<typeof createAsset>>>;
|
|
@@ -72,11 +89,11 @@ type CreateAssetMutationError = ErrorType<AsError | void>;
|
|
|
72
89
|
* @summary Create an Asset
|
|
73
90
|
*/
|
|
74
91
|
declare const useCreateAsset: <TError = ErrorType<void | AsError>, TContext = unknown>(options?: {
|
|
75
|
-
mutation?: UseMutationOptions<
|
|
92
|
+
mutation?: UseMutationOptions<Awaited<ReturnType<typeof createAsset>>, TError, {
|
|
76
93
|
data: AssetPostBodyBody;
|
|
77
|
-
}, TContext
|
|
94
|
+
}, TContext>;
|
|
78
95
|
request?: SecondParameter<typeof customInstance>;
|
|
79
|
-
}
|
|
96
|
+
}) => UseMutationResult<Awaited<ReturnType<typeof createAsset>>, TError, {
|
|
80
97
|
data: AssetPostBodyBody;
|
|
81
98
|
}, TContext>;
|
|
82
99
|
/**
|
|
@@ -87,37 +104,55 @@ declare const useCreateAsset: <TError = ErrorType<void | AsError>, TContext = un
|
|
|
87
104
|
declare const getSpecificAsset: (assetId: string, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<AssetDetail>;
|
|
88
105
|
declare const getGetSpecificAssetQueryKey: (assetId: string) => readonly ["account-server-api", `/asset/${string}`];
|
|
89
106
|
declare const getGetSpecificAssetQueryOptions: <TData = AssetDetail, TError = ErrorType<void | AsError>>(assetId: string, options?: {
|
|
90
|
-
query?: Partial<UseQueryOptions<
|
|
107
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData>>;
|
|
91
108
|
request?: SecondParameter<typeof customInstance>;
|
|
92
|
-
}
|
|
109
|
+
}) => UseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData> & {
|
|
93
110
|
queryKey: QueryKey;
|
|
94
111
|
};
|
|
95
112
|
type GetSpecificAssetQueryResult = NonNullable<Awaited<ReturnType<typeof getSpecificAsset>>>;
|
|
96
113
|
type GetSpecificAssetQueryError = ErrorType<AsError | void>;
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
114
|
+
declare function useGetSpecificAsset<TData = Awaited<ReturnType<typeof getSpecificAsset>>, TError = ErrorType<AsError | void>>(assetId: string, options: {
|
|
115
|
+
query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData>> & Pick<DefinedInitialDataOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData>, 'initialData'>;
|
|
116
|
+
request?: SecondParameter<typeof customInstance>;
|
|
117
|
+
}): DefinedUseQueryResult<TData, TError> & {
|
|
118
|
+
queryKey: QueryKey;
|
|
119
|
+
};
|
|
120
|
+
declare function useGetSpecificAsset<TData = Awaited<ReturnType<typeof getSpecificAsset>>, TError = ErrorType<AsError | void>>(assetId: string, options?: {
|
|
121
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData>> & Pick<UndefinedInitialDataOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData>, 'initialData'>;
|
|
122
|
+
request?: SecondParameter<typeof customInstance>;
|
|
123
|
+
}): UseQueryResult<TData, TError> & {
|
|
124
|
+
queryKey: QueryKey;
|
|
125
|
+
};
|
|
126
|
+
declare function useGetSpecificAsset<TData = Awaited<ReturnType<typeof getSpecificAsset>>, TError = ErrorType<AsError | void>>(assetId: string, options?: {
|
|
127
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData>>;
|
|
102
128
|
request?: SecondParameter<typeof customInstance>;
|
|
103
|
-
}
|
|
129
|
+
}): UseQueryResult<TData, TError> & {
|
|
104
130
|
queryKey: QueryKey;
|
|
105
131
|
};
|
|
106
132
|
declare const getGetSpecificAssetSuspenseQueryOptions: <TData = AssetDetail, TError = ErrorType<void | AsError>>(assetId: string, options?: {
|
|
107
|
-
query?: Partial<UseSuspenseQueryOptions<
|
|
133
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData>>;
|
|
108
134
|
request?: SecondParameter<typeof customInstance>;
|
|
109
|
-
}
|
|
135
|
+
}) => UseSuspenseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData> & {
|
|
110
136
|
queryKey: QueryKey;
|
|
111
137
|
};
|
|
112
138
|
type GetSpecificAssetSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getSpecificAsset>>>;
|
|
113
139
|
type GetSpecificAssetSuspenseQueryError = ErrorType<AsError | void>;
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
140
|
+
declare function useGetSpecificAssetSuspense<TData = Awaited<ReturnType<typeof getSpecificAsset>>, TError = ErrorType<AsError | void>>(assetId: string, options: {
|
|
141
|
+
query: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData>>;
|
|
142
|
+
request?: SecondParameter<typeof customInstance>;
|
|
143
|
+
}): UseSuspenseQueryResult<TData, TError> & {
|
|
144
|
+
queryKey: QueryKey;
|
|
145
|
+
};
|
|
146
|
+
declare function useGetSpecificAssetSuspense<TData = Awaited<ReturnType<typeof getSpecificAsset>>, TError = ErrorType<AsError | void>>(assetId: string, options?: {
|
|
147
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData>>;
|
|
148
|
+
request?: SecondParameter<typeof customInstance>;
|
|
149
|
+
}): UseSuspenseQueryResult<TData, TError> & {
|
|
150
|
+
queryKey: QueryKey;
|
|
151
|
+
};
|
|
152
|
+
declare function useGetSpecificAssetSuspense<TData = Awaited<ReturnType<typeof getSpecificAsset>>, TError = ErrorType<AsError | void>>(assetId: string, options?: {
|
|
153
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData>>;
|
|
119
154
|
request?: SecondParameter<typeof customInstance>;
|
|
120
|
-
}
|
|
155
|
+
}): UseSuspenseQueryResult<TData, TError> & {
|
|
121
156
|
queryKey: QueryKey;
|
|
122
157
|
};
|
|
123
158
|
/**
|
|
@@ -130,29 +165,29 @@ Anyone can alter a `GLOBAL` asset. For other *scopes* you will need to be the us
|
|
|
130
165
|
* @summary Adjust an existing Asset
|
|
131
166
|
*/
|
|
132
167
|
declare const patchAsset: (assetId: string, assetPatchBodyBody: AssetPatchBodyBody, options?: SecondParameter<typeof customInstance>) => Promise<void>;
|
|
133
|
-
declare const getPatchAssetMutationOptions: <TError = ErrorType<AsError>, TContext = unknown>(options?: {
|
|
134
|
-
mutation?: UseMutationOptions<
|
|
168
|
+
declare const getPatchAssetMutationOptions: <TError = ErrorType<void | AsError>, TContext = unknown>(options?: {
|
|
169
|
+
mutation?: UseMutationOptions<Awaited<ReturnType<typeof patchAsset>>, TError, {
|
|
135
170
|
assetId: string;
|
|
136
171
|
data: AssetPatchBodyBody;
|
|
137
|
-
}, TContext
|
|
172
|
+
}, TContext>;
|
|
138
173
|
request?: SecondParameter<typeof customInstance>;
|
|
139
|
-
}
|
|
174
|
+
}) => UseMutationOptions<Awaited<ReturnType<typeof patchAsset>>, TError, {
|
|
140
175
|
assetId: string;
|
|
141
176
|
data: AssetPatchBodyBody;
|
|
142
177
|
}, TContext>;
|
|
143
178
|
type PatchAssetMutationResult = NonNullable<Awaited<ReturnType<typeof patchAsset>>>;
|
|
144
179
|
type PatchAssetMutationBody = AssetPatchBodyBody;
|
|
145
|
-
type PatchAssetMutationError = ErrorType<AsError>;
|
|
180
|
+
type PatchAssetMutationError = ErrorType<void | AsError>;
|
|
146
181
|
/**
|
|
147
182
|
* @summary Adjust an existing Asset
|
|
148
183
|
*/
|
|
149
|
-
declare const usePatchAsset: <TError = ErrorType<AsError>, TContext = unknown>(options?: {
|
|
150
|
-
mutation?: UseMutationOptions<
|
|
184
|
+
declare const usePatchAsset: <TError = ErrorType<void | AsError>, TContext = unknown>(options?: {
|
|
185
|
+
mutation?: UseMutationOptions<Awaited<ReturnType<typeof patchAsset>>, TError, {
|
|
151
186
|
assetId: string;
|
|
152
187
|
data: AssetPatchBodyBody;
|
|
153
|
-
}, TContext
|
|
188
|
+
}, TContext>;
|
|
154
189
|
request?: SecondParameter<typeof customInstance>;
|
|
155
|
-
}
|
|
190
|
+
}) => UseMutationResult<Awaited<ReturnType<typeof patchAsset>>, TError, {
|
|
156
191
|
assetId: string;
|
|
157
192
|
data: AssetPatchBodyBody;
|
|
158
193
|
}, TContext>;
|
|
@@ -164,25 +199,25 @@ Anyone can alter a `GLOBAL` asset. For other *scopes* you will need to be the us
|
|
|
164
199
|
* @summary Deletes an Asset
|
|
165
200
|
*/
|
|
166
201
|
declare const deleteAsset: (assetId: string, options?: SecondParameter<typeof customInstance>) => Promise<void>;
|
|
167
|
-
declare const getDeleteAssetMutationOptions: <TError = ErrorType<AsError>, TContext = unknown>(options?: {
|
|
168
|
-
mutation?: UseMutationOptions<
|
|
202
|
+
declare const getDeleteAssetMutationOptions: <TError = ErrorType<void | AsError>, TContext = unknown>(options?: {
|
|
203
|
+
mutation?: UseMutationOptions<Awaited<ReturnType<typeof deleteAsset>>, TError, {
|
|
169
204
|
assetId: string;
|
|
170
|
-
}, TContext
|
|
205
|
+
}, TContext>;
|
|
171
206
|
request?: SecondParameter<typeof customInstance>;
|
|
172
|
-
}
|
|
207
|
+
}) => UseMutationOptions<Awaited<ReturnType<typeof deleteAsset>>, TError, {
|
|
173
208
|
assetId: string;
|
|
174
209
|
}, TContext>;
|
|
175
210
|
type DeleteAssetMutationResult = NonNullable<Awaited<ReturnType<typeof deleteAsset>>>;
|
|
176
|
-
type DeleteAssetMutationError = ErrorType<AsError>;
|
|
211
|
+
type DeleteAssetMutationError = ErrorType<AsError | void>;
|
|
177
212
|
/**
|
|
178
213
|
* @summary Deletes an Asset
|
|
179
214
|
*/
|
|
180
|
-
declare const useDeleteAsset: <TError = ErrorType<AsError>, TContext = unknown>(options?: {
|
|
181
|
-
mutation?: UseMutationOptions<
|
|
215
|
+
declare const useDeleteAsset: <TError = ErrorType<void | AsError>, TContext = unknown>(options?: {
|
|
216
|
+
mutation?: UseMutationOptions<Awaited<ReturnType<typeof deleteAsset>>, TError, {
|
|
182
217
|
assetId: string;
|
|
183
|
-
}, TContext
|
|
218
|
+
}, TContext>;
|
|
184
219
|
request?: SecondParameter<typeof customInstance>;
|
|
185
|
-
}
|
|
220
|
+
}) => UseMutationResult<Awaited<ReturnType<typeof deleteAsset>>, TError, {
|
|
186
221
|
assetId: string;
|
|
187
222
|
}, TContext>;
|
|
188
223
|
/**
|
|
@@ -193,25 +228,25 @@ Anyone can alter a `GLOBAL` asset. For other *scopes* you will need to be the us
|
|
|
193
228
|
* @summary Disables an Asset
|
|
194
229
|
*/
|
|
195
230
|
declare const disableAsset: (assetId: string, options?: SecondParameter<typeof customInstance>) => Promise<void>;
|
|
196
|
-
declare const getDisableAssetMutationOptions: <TError = ErrorType<AsError>, TContext = unknown>(options?: {
|
|
197
|
-
mutation?: UseMutationOptions<
|
|
231
|
+
declare const getDisableAssetMutationOptions: <TError = ErrorType<void | AsError>, TContext = unknown>(options?: {
|
|
232
|
+
mutation?: UseMutationOptions<Awaited<ReturnType<typeof disableAsset>>, TError, {
|
|
198
233
|
assetId: string;
|
|
199
|
-
}, TContext
|
|
234
|
+
}, TContext>;
|
|
200
235
|
request?: SecondParameter<typeof customInstance>;
|
|
201
|
-
}
|
|
236
|
+
}) => UseMutationOptions<Awaited<ReturnType<typeof disableAsset>>, TError, {
|
|
202
237
|
assetId: string;
|
|
203
238
|
}, TContext>;
|
|
204
239
|
type DisableAssetMutationResult = NonNullable<Awaited<ReturnType<typeof disableAsset>>>;
|
|
205
|
-
type DisableAssetMutationError = ErrorType<AsError>;
|
|
240
|
+
type DisableAssetMutationError = ErrorType<AsError | void>;
|
|
206
241
|
/**
|
|
207
242
|
* @summary Disables an Asset
|
|
208
243
|
*/
|
|
209
|
-
declare const useDisableAsset: <TError = ErrorType<AsError>, TContext = unknown>(options?: {
|
|
210
|
-
mutation?: UseMutationOptions<
|
|
244
|
+
declare const useDisableAsset: <TError = ErrorType<void | AsError>, TContext = unknown>(options?: {
|
|
245
|
+
mutation?: UseMutationOptions<Awaited<ReturnType<typeof disableAsset>>, TError, {
|
|
211
246
|
assetId: string;
|
|
212
|
-
}, TContext
|
|
247
|
+
}, TContext>;
|
|
213
248
|
request?: SecondParameter<typeof customInstance>;
|
|
214
|
-
}
|
|
249
|
+
}) => UseMutationResult<Awaited<ReturnType<typeof disableAsset>>, TError, {
|
|
215
250
|
assetId: string;
|
|
216
251
|
}, TContext>;
|
|
217
252
|
/**
|
|
@@ -222,25 +257,25 @@ Anyone can alter a `GLOBAL` asset. For other *scopes* you will need to be the us
|
|
|
222
257
|
* @summary Enables an Asset
|
|
223
258
|
*/
|
|
224
259
|
declare const enableAsset: (assetId: string, options?: SecondParameter<typeof customInstance>) => Promise<void>;
|
|
225
|
-
declare const getEnableAssetMutationOptions: <TError = ErrorType<AsError>, TContext = unknown>(options?: {
|
|
226
|
-
mutation?: UseMutationOptions<
|
|
260
|
+
declare const getEnableAssetMutationOptions: <TError = ErrorType<void | AsError>, TContext = unknown>(options?: {
|
|
261
|
+
mutation?: UseMutationOptions<Awaited<ReturnType<typeof enableAsset>>, TError, {
|
|
227
262
|
assetId: string;
|
|
228
|
-
}, TContext
|
|
263
|
+
}, TContext>;
|
|
229
264
|
request?: SecondParameter<typeof customInstance>;
|
|
230
|
-
}
|
|
265
|
+
}) => UseMutationOptions<Awaited<ReturnType<typeof enableAsset>>, TError, {
|
|
231
266
|
assetId: string;
|
|
232
267
|
}, TContext>;
|
|
233
268
|
type EnableAssetMutationResult = NonNullable<Awaited<ReturnType<typeof enableAsset>>>;
|
|
234
|
-
type EnableAssetMutationError = ErrorType<AsError>;
|
|
269
|
+
type EnableAssetMutationError = ErrorType<AsError | void>;
|
|
235
270
|
/**
|
|
236
271
|
* @summary Enables an Asset
|
|
237
272
|
*/
|
|
238
|
-
declare const useEnableAsset: <TError = ErrorType<AsError>, TContext = unknown>(options?: {
|
|
239
|
-
mutation?: UseMutationOptions<
|
|
273
|
+
declare const useEnableAsset: <TError = ErrorType<void | AsError>, TContext = unknown>(options?: {
|
|
274
|
+
mutation?: UseMutationOptions<Awaited<ReturnType<typeof enableAsset>>, TError, {
|
|
240
275
|
assetId: string;
|
|
241
|
-
}, TContext
|
|
276
|
+
}, TContext>;
|
|
242
277
|
request?: SecondParameter<typeof customInstance>;
|
|
243
|
-
}
|
|
278
|
+
}) => UseMutationResult<Awaited<ReturnType<typeof enableAsset>>, TError, {
|
|
244
279
|
assetId: string;
|
|
245
280
|
}, TContext>;
|
|
246
281
|
/**
|
|
@@ -251,30 +286,30 @@ Anyone can alter a `GLOBAL` asset. For other *scopes* you will need to be the us
|
|
|
251
286
|
* @summary Attaches an Asset to a Merchant
|
|
252
287
|
*/
|
|
253
288
|
declare const attachAsset: (assetId: string, params?: AttachAssetParams, options?: SecondParameter<typeof customInstance>) => Promise<void>;
|
|
254
|
-
declare const getAttachAssetMutationOptions: <TError = ErrorType<AsError>, TContext = unknown>(options?: {
|
|
255
|
-
mutation?: UseMutationOptions<
|
|
289
|
+
declare const getAttachAssetMutationOptions: <TError = ErrorType<void | AsError>, TContext = unknown>(options?: {
|
|
290
|
+
mutation?: UseMutationOptions<Awaited<ReturnType<typeof attachAsset>>, TError, {
|
|
256
291
|
assetId: string;
|
|
257
|
-
params?: AttachAssetParams
|
|
258
|
-
}, TContext
|
|
292
|
+
params?: AttachAssetParams;
|
|
293
|
+
}, TContext>;
|
|
259
294
|
request?: SecondParameter<typeof customInstance>;
|
|
260
|
-
}
|
|
295
|
+
}) => UseMutationOptions<Awaited<ReturnType<typeof attachAsset>>, TError, {
|
|
261
296
|
assetId: string;
|
|
262
|
-
params?: AttachAssetParams
|
|
297
|
+
params?: AttachAssetParams;
|
|
263
298
|
}, TContext>;
|
|
264
299
|
type AttachAssetMutationResult = NonNullable<Awaited<ReturnType<typeof attachAsset>>>;
|
|
265
|
-
type AttachAssetMutationError = ErrorType<AsError>;
|
|
300
|
+
type AttachAssetMutationError = ErrorType<AsError | void>;
|
|
266
301
|
/**
|
|
267
302
|
* @summary Attaches an Asset to a Merchant
|
|
268
303
|
*/
|
|
269
|
-
declare const useAttachAsset: <TError = ErrorType<AsError>, TContext = unknown>(options?: {
|
|
270
|
-
mutation?: UseMutationOptions<
|
|
304
|
+
declare const useAttachAsset: <TError = ErrorType<void | AsError>, TContext = unknown>(options?: {
|
|
305
|
+
mutation?: UseMutationOptions<Awaited<ReturnType<typeof attachAsset>>, TError, {
|
|
271
306
|
assetId: string;
|
|
272
|
-
params?: AttachAssetParams
|
|
273
|
-
}, TContext
|
|
307
|
+
params?: AttachAssetParams;
|
|
308
|
+
}, TContext>;
|
|
274
309
|
request?: SecondParameter<typeof customInstance>;
|
|
275
|
-
}
|
|
310
|
+
}) => UseMutationResult<Awaited<ReturnType<typeof attachAsset>>, TError, {
|
|
276
311
|
assetId: string;
|
|
277
|
-
params?: AttachAssetParams
|
|
312
|
+
params?: AttachAssetParams;
|
|
278
313
|
}, TContext>;
|
|
279
314
|
/**
|
|
280
315
|
* Detaches an Asset from a **Merchant**
|
|
@@ -284,30 +319,30 @@ Anyone can alter a `GLOBAL` asset. For other *scopes* you will need to be the us
|
|
|
284
319
|
* @summary Detaches an Asset from a Merchant
|
|
285
320
|
*/
|
|
286
321
|
declare const detachAsset: (assetId: string, params?: DetachAssetParams, options?: SecondParameter<typeof customInstance>) => Promise<void>;
|
|
287
|
-
declare const getDetachAssetMutationOptions: <TError = ErrorType<AsError>, TContext = unknown>(options?: {
|
|
288
|
-
mutation?: UseMutationOptions<
|
|
322
|
+
declare const getDetachAssetMutationOptions: <TError = ErrorType<void | AsError>, TContext = unknown>(options?: {
|
|
323
|
+
mutation?: UseMutationOptions<Awaited<ReturnType<typeof detachAsset>>, TError, {
|
|
289
324
|
assetId: string;
|
|
290
|
-
params?: DetachAssetParams
|
|
291
|
-
}, TContext
|
|
325
|
+
params?: DetachAssetParams;
|
|
326
|
+
}, TContext>;
|
|
292
327
|
request?: SecondParameter<typeof customInstance>;
|
|
293
|
-
}
|
|
328
|
+
}) => UseMutationOptions<Awaited<ReturnType<typeof detachAsset>>, TError, {
|
|
294
329
|
assetId: string;
|
|
295
|
-
params?: DetachAssetParams
|
|
330
|
+
params?: DetachAssetParams;
|
|
296
331
|
}, TContext>;
|
|
297
332
|
type DetachAssetMutationResult = NonNullable<Awaited<ReturnType<typeof detachAsset>>>;
|
|
298
|
-
type DetachAssetMutationError = ErrorType<AsError>;
|
|
333
|
+
type DetachAssetMutationError = ErrorType<AsError | void>;
|
|
299
334
|
/**
|
|
300
335
|
* @summary Detaches an Asset from a Merchant
|
|
301
336
|
*/
|
|
302
|
-
declare const useDetachAsset: <TError = ErrorType<AsError>, TContext = unknown>(options?: {
|
|
303
|
-
mutation?: UseMutationOptions<
|
|
337
|
+
declare const useDetachAsset: <TError = ErrorType<void | AsError>, TContext = unknown>(options?: {
|
|
338
|
+
mutation?: UseMutationOptions<Awaited<ReturnType<typeof detachAsset>>, TError, {
|
|
304
339
|
assetId: string;
|
|
305
|
-
params?: DetachAssetParams
|
|
306
|
-
}, TContext
|
|
340
|
+
params?: DetachAssetParams;
|
|
341
|
+
}, TContext>;
|
|
307
342
|
request?: SecondParameter<typeof customInstance>;
|
|
308
|
-
}
|
|
343
|
+
}) => UseMutationResult<Awaited<ReturnType<typeof detachAsset>>, TError, {
|
|
309
344
|
assetId: string;
|
|
310
|
-
params?: DetachAssetParams
|
|
345
|
+
params?: DetachAssetParams;
|
|
311
346
|
}, TContext>;
|
|
312
347
|
|
|
313
348
|
export { type AttachAssetMutationError, type AttachAssetMutationResult, type CreateAssetMutationBody, type CreateAssetMutationError, type CreateAssetMutationResult, type DeleteAssetMutationError, type DeleteAssetMutationResult, type DetachAssetMutationError, type DetachAssetMutationResult, type DisableAssetMutationError, type DisableAssetMutationResult, type EnableAssetMutationError, type EnableAssetMutationResult, type GetAssetQueryError, type GetAssetQueryResult, type GetAssetSuspenseQueryError, type GetAssetSuspenseQueryResult, type GetSpecificAssetQueryError, type GetSpecificAssetQueryResult, type GetSpecificAssetSuspenseQueryError, type GetSpecificAssetSuspenseQueryResult, type PatchAssetMutationBody, type PatchAssetMutationError, type PatchAssetMutationResult, attachAsset, createAsset, deleteAsset, detachAsset, disableAsset, enableAsset, getAsset, getAttachAssetMutationOptions, getCreateAssetMutationOptions, getDeleteAssetMutationOptions, getDetachAssetMutationOptions, getDisableAssetMutationOptions, getEnableAssetMutationOptions, getGetAssetQueryKey, getGetAssetQueryOptions, getGetAssetSuspenseQueryOptions, getGetSpecificAssetQueryKey, getGetSpecificAssetQueryOptions, getGetSpecificAssetSuspenseQueryOptions, getPatchAssetMutationOptions, getSpecificAsset, patchAsset, useAttachAsset, useCreateAsset, useDeleteAsset, useDetachAsset, useDisableAsset, useEnableAsset, useGetAsset, useGetAssetSuspense, useGetSpecificAsset, useGetSpecificAssetSuspense, usePatchAsset };
|
package/asset/asset.js
CHANGED
|
@@ -28,47 +28,47 @@ var getGetAssetQueryOptions = (params, options) => {
|
|
|
28
28
|
const queryFn = ({ signal }) => getAsset(params, requestOptions, signal);
|
|
29
29
|
return { queryKey, queryFn, ...queryOptions };
|
|
30
30
|
};
|
|
31
|
-
|
|
31
|
+
function useGetAsset(params, options) {
|
|
32
32
|
const queryOptions = getGetAssetQueryOptions(params, options);
|
|
33
33
|
const query = useQuery(queryOptions);
|
|
34
34
|
query.queryKey = queryOptions.queryKey;
|
|
35
35
|
return query;
|
|
36
|
-
}
|
|
36
|
+
}
|
|
37
37
|
var getGetAssetSuspenseQueryOptions = (params, options) => {
|
|
38
38
|
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
39
39
|
const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetAssetQueryKey(params);
|
|
40
40
|
const queryFn = ({ signal }) => getAsset(params, requestOptions, signal);
|
|
41
41
|
return { queryKey, queryFn, ...queryOptions };
|
|
42
42
|
};
|
|
43
|
-
|
|
43
|
+
function useGetAssetSuspense(params, options) {
|
|
44
44
|
const queryOptions = getGetAssetSuspenseQueryOptions(params, options);
|
|
45
45
|
const query = useSuspenseQuery(queryOptions);
|
|
46
46
|
query.queryKey = queryOptions.queryKey;
|
|
47
47
|
return query;
|
|
48
|
-
}
|
|
48
|
+
}
|
|
49
49
|
var createAsset = (assetPostBodyBody, options) => {
|
|
50
|
-
const
|
|
51
|
-
|
|
50
|
+
const formUrlEncoded = new URLSearchParams();
|
|
51
|
+
formUrlEncoded.append("name", assetPostBodyBody.name);
|
|
52
52
|
if (assetPostBodyBody.content_file !== void 0) {
|
|
53
|
-
|
|
53
|
+
formUrlEncoded.append("content_file", assetPostBodyBody.content_file);
|
|
54
54
|
}
|
|
55
55
|
if (assetPostBodyBody.content_string !== void 0) {
|
|
56
|
-
|
|
56
|
+
formUrlEncoded.append("content_string", assetPostBodyBody.content_string);
|
|
57
57
|
}
|
|
58
|
-
|
|
58
|
+
formUrlEncoded.append("scope", assetPostBodyBody.scope);
|
|
59
59
|
if (assetPostBodyBody.scope_id !== void 0) {
|
|
60
|
-
|
|
60
|
+
formUrlEncoded.append("scope_id", assetPostBodyBody.scope_id);
|
|
61
61
|
}
|
|
62
|
-
|
|
62
|
+
formUrlEncoded.append("secret", assetPostBodyBody.secret.toString());
|
|
63
63
|
if (assetPostBodyBody.description !== void 0) {
|
|
64
|
-
|
|
64
|
+
formUrlEncoded.append("description", assetPostBodyBody.description);
|
|
65
65
|
}
|
|
66
66
|
return customInstance(
|
|
67
67
|
{
|
|
68
68
|
url: `/asset`,
|
|
69
69
|
method: "POST",
|
|
70
|
-
headers: { "Content-Type": "
|
|
71
|
-
data:
|
|
70
|
+
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
|
71
|
+
data: formUrlEncoded
|
|
72
72
|
},
|
|
73
73
|
options
|
|
74
74
|
);
|
|
@@ -104,41 +104,41 @@ var getGetSpecificAssetQueryOptions = (assetId, options) => {
|
|
|
104
104
|
const queryFn = ({ signal }) => getSpecificAsset(assetId, requestOptions, signal);
|
|
105
105
|
return { queryKey, queryFn, enabled: !!assetId, ...queryOptions };
|
|
106
106
|
};
|
|
107
|
-
|
|
107
|
+
function useGetSpecificAsset(assetId, options) {
|
|
108
108
|
const queryOptions = getGetSpecificAssetQueryOptions(assetId, options);
|
|
109
109
|
const query = useQuery(queryOptions);
|
|
110
110
|
query.queryKey = queryOptions.queryKey;
|
|
111
111
|
return query;
|
|
112
|
-
}
|
|
112
|
+
}
|
|
113
113
|
var getGetSpecificAssetSuspenseQueryOptions = (assetId, options) => {
|
|
114
114
|
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
115
115
|
const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetSpecificAssetQueryKey(assetId);
|
|
116
116
|
const queryFn = ({ signal }) => getSpecificAsset(assetId, requestOptions, signal);
|
|
117
117
|
return { queryKey, queryFn, enabled: !!assetId, ...queryOptions };
|
|
118
118
|
};
|
|
119
|
-
|
|
119
|
+
function useGetSpecificAssetSuspense(assetId, options) {
|
|
120
120
|
const queryOptions = getGetSpecificAssetSuspenseQueryOptions(assetId, options);
|
|
121
121
|
const query = useSuspenseQuery(queryOptions);
|
|
122
122
|
query.queryKey = queryOptions.queryKey;
|
|
123
123
|
return query;
|
|
124
|
-
}
|
|
124
|
+
}
|
|
125
125
|
var patchAsset = (assetId, assetPatchBodyBody, options) => {
|
|
126
|
-
const
|
|
126
|
+
const formUrlEncoded = new URLSearchParams();
|
|
127
127
|
if (assetPatchBodyBody.content_file !== void 0) {
|
|
128
|
-
|
|
128
|
+
formUrlEncoded.append("content_file", assetPatchBodyBody.content_file);
|
|
129
129
|
}
|
|
130
130
|
if (assetPatchBodyBody.content_string !== void 0) {
|
|
131
|
-
|
|
131
|
+
formUrlEncoded.append("content_string", assetPatchBodyBody.content_string);
|
|
132
132
|
}
|
|
133
133
|
if (assetPatchBodyBody.description !== void 0) {
|
|
134
|
-
|
|
134
|
+
formUrlEncoded.append("description", assetPatchBodyBody.description);
|
|
135
135
|
}
|
|
136
136
|
return customInstance(
|
|
137
137
|
{
|
|
138
138
|
url: `/asset/${assetId}`,
|
|
139
139
|
method: "PATCH",
|
|
140
|
-
headers: { "Content-Type": "
|
|
141
|
-
data:
|
|
140
|
+
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
|
141
|
+
data: formUrlEncoded
|
|
142
142
|
},
|
|
143
143
|
options
|
|
144
144
|
);
|