shoal-web-sdk 1.0.89 → 1.0.90
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.
|
@@ -77,7 +77,7 @@ export const deletePaymentMethod = (options) => {
|
|
|
77
77
|
type: 'http'
|
|
78
78
|
}
|
|
79
79
|
],
|
|
80
|
-
url: '/api/v1/payment-method/{paymentID}',
|
|
80
|
+
url: '/api/v1/payment-method/{org}/{paymentID}',
|
|
81
81
|
...options
|
|
82
82
|
});
|
|
83
83
|
};
|
|
@@ -92,7 +92,7 @@ export const updateDefaultPaymentMethod = (options) => {
|
|
|
92
92
|
type: 'http'
|
|
93
93
|
}
|
|
94
94
|
],
|
|
95
|
-
url: '/api/v1/payment-method/{paymentID}',
|
|
95
|
+
url: '/api/v1/payment-method/{org}/{paymentID}',
|
|
96
96
|
...options
|
|
97
97
|
});
|
|
98
98
|
};
|
|
@@ -300,13 +300,17 @@ export type CreateSetupIntentResponse = CreateSetupIntentResponses[keyof CreateS
|
|
|
300
300
|
export type DeletePaymentMethodData = {
|
|
301
301
|
body?: never;
|
|
302
302
|
path: {
|
|
303
|
+
/**
|
|
304
|
+
* Kinde organisation id.
|
|
305
|
+
*/
|
|
306
|
+
org: string;
|
|
303
307
|
/**
|
|
304
308
|
* Stripe payment method.
|
|
305
309
|
*/
|
|
306
310
|
paymentID: string;
|
|
307
311
|
};
|
|
308
312
|
query?: never;
|
|
309
|
-
url: '/api/v1/payment-method/{paymentID}';
|
|
313
|
+
url: '/api/v1/payment-method/{org}/{paymentID}';
|
|
310
314
|
};
|
|
311
315
|
export type DeletePaymentMethodErrors = {
|
|
312
316
|
/**
|
|
@@ -345,9 +349,13 @@ export type UpdateDefaultPaymentMethodData = {
|
|
|
345
349
|
* Stripe payment method.
|
|
346
350
|
*/
|
|
347
351
|
paymentID: string;
|
|
352
|
+
/**
|
|
353
|
+
* Kinde organisation id.
|
|
354
|
+
*/
|
|
355
|
+
org: string;
|
|
348
356
|
};
|
|
349
357
|
query?: never;
|
|
350
|
-
url: '/api/v1/payment-method/{paymentID}';
|
|
358
|
+
url: '/api/v1/payment-method/{org}/{paymentID}';
|
|
351
359
|
};
|
|
352
360
|
export type UpdateDefaultPaymentMethodErrors = {
|
|
353
361
|
/**
|
|
@@ -1011,6 +1011,7 @@ export declare const zCreateSetupIntentResponse: z.ZodObject<{
|
|
|
1011
1011
|
export declare const zDeletePaymentMethodData: z.ZodObject<{
|
|
1012
1012
|
body: z.ZodOptional<z.ZodNever>;
|
|
1013
1013
|
path: z.ZodObject<{
|
|
1014
|
+
org: z.ZodString;
|
|
1014
1015
|
paymentID: z.ZodString;
|
|
1015
1016
|
}, z.core.$strip>;
|
|
1016
1017
|
query: z.ZodOptional<z.ZodNever>;
|
|
@@ -1023,6 +1024,7 @@ export declare const zUpdateDefaultPaymentMethodData: z.ZodObject<{
|
|
|
1023
1024
|
body: z.ZodOptional<z.ZodNever>;
|
|
1024
1025
|
path: z.ZodObject<{
|
|
1025
1026
|
paymentID: z.ZodString;
|
|
1027
|
+
org: z.ZodString;
|
|
1026
1028
|
}, z.core.$strip>;
|
|
1027
1029
|
query: z.ZodOptional<z.ZodNever>;
|
|
1028
1030
|
}, z.core.$strip>;
|
|
@@ -228,6 +228,7 @@ export const zCreateSetupIntentResponse = zSetupIntentResponse;
|
|
|
228
228
|
export const zDeletePaymentMethodData = z.object({
|
|
229
229
|
body: z.optional(z.never()),
|
|
230
230
|
path: z.object({
|
|
231
|
+
org: z.string(),
|
|
231
232
|
paymentID: z.string()
|
|
232
233
|
}),
|
|
233
234
|
query: z.optional(z.never())
|
|
@@ -239,7 +240,8 @@ export const zDeletePaymentMethodResponse = z.void();
|
|
|
239
240
|
export const zUpdateDefaultPaymentMethodData = z.object({
|
|
240
241
|
body: z.optional(z.never()),
|
|
241
242
|
path: z.object({
|
|
242
|
-
paymentID: z.string()
|
|
243
|
+
paymentID: z.string(),
|
|
244
|
+
org: z.string()
|
|
243
245
|
}),
|
|
244
246
|
query: z.optional(z.never())
|
|
245
247
|
});
|
|
@@ -88,7 +88,7 @@ export const useCreateSetupIntent = (config) => {
|
|
|
88
88
|
export const useDeletePaymentMethod = (config) => {
|
|
89
89
|
const token = useToken();
|
|
90
90
|
const queryClient = useQueryClient();
|
|
91
|
-
const opts = { throwOnError: true, url: "/api/v1/payment-method/{paymentID}" };
|
|
91
|
+
const opts = { throwOnError: true, url: "/api/v1/payment-method/{org}/{paymentID}" };
|
|
92
92
|
const funcer = async (options) => {
|
|
93
93
|
const auth = isPromise(token) ? (await token) || "" : token || "";
|
|
94
94
|
const res = await deletePaymentMethod({ ...opts, ...options, auth });
|
|
@@ -97,7 +97,7 @@ export const useDeletePaymentMethod = (config) => {
|
|
|
97
97
|
return useMutation({
|
|
98
98
|
mutationFn: funcer,
|
|
99
99
|
onSuccess: (res, options, c, ctx) => {
|
|
100
|
-
queryClient.invalidateQueries({ queryKey: ["api", "v1", "payment-method", options?.path?.paymentID] });
|
|
100
|
+
queryClient.invalidateQueries({ queryKey: ["api", "v1", "payment-method", options?.path?.org, options?.path?.paymentID] });
|
|
101
101
|
config?.onSuccess && config.onSuccess(res.data, res.headers);
|
|
102
102
|
},
|
|
103
103
|
onError: config?.onError,
|
|
@@ -107,7 +107,7 @@ export const useDeletePaymentMethod = (config) => {
|
|
|
107
107
|
export const useUpdateDefaultPaymentMethod = (config) => {
|
|
108
108
|
const token = useToken();
|
|
109
109
|
const queryClient = useQueryClient();
|
|
110
|
-
const opts = { throwOnError: true, url: "/api/v1/payment-method/{paymentID}" };
|
|
110
|
+
const opts = { throwOnError: true, url: "/api/v1/payment-method/{org}/{paymentID}" };
|
|
111
111
|
const funcer = async (options) => {
|
|
112
112
|
const auth = isPromise(token) ? (await token) || "" : token || "";
|
|
113
113
|
const res = await updateDefaultPaymentMethod({ ...opts, ...options, auth });
|
|
@@ -116,7 +116,7 @@ export const useUpdateDefaultPaymentMethod = (config) => {
|
|
|
116
116
|
return useMutation({
|
|
117
117
|
mutationFn: funcer,
|
|
118
118
|
onSuccess: (res, options, c, ctx) => {
|
|
119
|
-
queryClient.invalidateQueries({ queryKey: ["api", "v1", "payment-method", options?.path?.paymentID] });
|
|
119
|
+
queryClient.invalidateQueries({ queryKey: ["api", "v1", "payment-method", options?.path?.org, options?.path?.paymentID] });
|
|
120
120
|
config?.onSuccess && config.onSuccess(res.data, res.headers);
|
|
121
121
|
},
|
|
122
122
|
onError: config?.onError,
|