autumn-js 0.1.24 → 0.1.26
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/dist/libraries/backend/better-auth.js +50 -12
- package/dist/libraries/backend/better-auth.mjs +7 -7
- package/dist/libraries/backend/{chunk-7DS7ICKQ.mjs → chunk-2NCEN2I4.mjs} +6 -6
- package/dist/libraries/backend/{chunk-7PLQK5LL.mjs → chunk-5NMOQ6PY.mjs} +1 -1
- package/dist/libraries/backend/{chunk-DMPRLFPO.mjs → chunk-5THMQKAB.mjs} +1 -1
- package/dist/libraries/backend/{chunk-OEKZ2I55.mjs → chunk-B5U4TWFH.mjs} +1 -1
- package/dist/libraries/backend/{chunk-J6DXZ2RF.mjs → chunk-EGUAG7WW.mjs} +1 -1
- package/dist/libraries/backend/{chunk-4LVRQN5R.mjs → chunk-VBIQ4TQW.mjs} +40 -12
- package/dist/libraries/backend/{chunk-GB7SC4FJ.mjs → chunk-XVYYZCVZ.mjs} +1 -1
- package/dist/libraries/backend/convex.js +50 -12
- package/dist/libraries/backend/convex.mjs +7 -7
- package/dist/libraries/backend/elysia.js +50 -12
- package/dist/libraries/backend/elysia.mjs +7 -7
- package/dist/libraries/backend/express.d.mts +1 -1
- package/dist/libraries/backend/express.d.ts +1 -1
- package/dist/libraries/backend/express.js +50 -12
- package/dist/libraries/backend/express.mjs +7 -7
- package/dist/libraries/backend/fastify.js +50 -12
- package/dist/libraries/backend/fastify.mjs +7 -7
- package/dist/libraries/backend/hono.js +50 -12
- package/dist/libraries/backend/hono.mjs +7 -7
- package/dist/libraries/backend/index.d.mts +1 -1
- package/dist/libraries/backend/index.d.ts +1 -1
- package/dist/libraries/backend/index.js +50 -12
- package/dist/libraries/backend/index.mjs +7 -7
- package/dist/libraries/backend/next.js +50 -12
- package/dist/libraries/backend/next.mjs +7 -7
- package/dist/libraries/backend/react-router.js +50 -12
- package/dist/libraries/backend/react-router.mjs +7 -7
- package/dist/libraries/backend/{referralTypes-DJwOFSeK.d.ts → referralTypes-B0SAWlJ0.d.ts} +23 -2
- package/dist/libraries/backend/{referralTypes-9uVrgXY-.d.mts → referralTypes-Bo9Jj3Ew.d.mts} +23 -2
- package/dist/libraries/backend/remix_dep.js +50 -12
- package/dist/libraries/backend/remix_dep.mjs +7 -7
- package/dist/libraries/backend/routes/backendRouter.js +50 -12
- package/dist/libraries/backend/routes/backendRouter.mjs +7 -7
- package/dist/libraries/backend/routes/entityRoutes.js +47 -9
- package/dist/libraries/backend/routes/entityRoutes.mjs +3 -3
- package/dist/libraries/backend/routes/genRoutes.js +47 -9
- package/dist/libraries/backend/routes/genRoutes.mjs +3 -3
- package/dist/libraries/backend/routes/productRoutes.js +47 -9
- package/dist/libraries/backend/routes/productRoutes.mjs +3 -3
- package/dist/libraries/backend/routes/referralRoutes.js +47 -9
- package/dist/libraries/backend/routes/referralRoutes.mjs +3 -3
- package/dist/libraries/backend/supabase.js +50 -12
- package/dist/libraries/backend/supabase.mjs +7 -7
- package/dist/libraries/backend/tanstack.js +50 -12
- package/dist/libraries/backend/tanstack.mjs +7 -7
- package/dist/libraries/backend/utils/backendRes.js +47 -9
- package/dist/libraries/backend/utils/backendRes.mjs +1 -1
- package/dist/libraries/backend/utils/withAuth.d.mts +1 -1
- package/dist/libraries/backend/utils/withAuth.d.ts +1 -1
- package/dist/libraries/backend/utils/withAuth.js +47 -9
- package/dist/libraries/backend/utils/withAuth.mjs +2 -2
- package/dist/libraries/react/AutumnContext.d.mts +6 -6
- package/dist/libraries/react/AutumnContext.d.ts +6 -6
- package/dist/libraries/react/AutumnContext.js +47 -9
- package/dist/libraries/react/AutumnContext.mjs +6 -6
- package/dist/libraries/react/BaseAutumnProvider.d.mts +6 -6
- package/dist/libraries/react/BaseAutumnProvider.d.ts +6 -6
- package/dist/libraries/react/BaseAutumnProvider.js +37 -9
- package/dist/libraries/react/BaseAutumnProvider.mjs +11 -11
- package/dist/libraries/react/{ReactAutumnClient-BBQsSJYU.d.mts → ReactAutumnClient-6VcY-_5L.d.mts} +5 -5
- package/dist/libraries/react/{ReactAutumnClient-VD1rcIPC.d.ts → ReactAutumnClient-yOor_S4y.d.ts} +5 -5
- package/dist/libraries/react/ReactAutumnProvider.d.mts +2 -2
- package/dist/libraries/react/ReactAutumnProvider.d.ts +2 -2
- package/dist/libraries/react/ReactAutumnProvider.js +37 -9
- package/dist/libraries/react/ReactAutumnProvider.mjs +13 -13
- package/dist/libraries/react/{attachTypes-DVF4f7Hw.d.ts → attachTypes-DoCshKK6.d.ts} +1 -1
- package/dist/libraries/react/{attachTypes-DJIr5ldB.d.mts → attachTypes-gI6T0O95.d.mts} +1 -1
- package/dist/libraries/react/{chunk-NBVPBAGX.mjs → chunk-2GAPGNKI.mjs} +9 -9
- package/dist/libraries/react/{chunk-PDLQNFRW.mjs → chunk-2PBWI3T6.mjs} +17 -17
- package/dist/libraries/react/{chunk-GITYXFGP.mjs → chunk-65S4VY5K.mjs} +1 -1
- package/dist/libraries/react/{chunk-2CP6WKDX.mjs → chunk-6H3UYG2P.mjs} +1 -1
- package/dist/libraries/react/{chunk-F6DIQF5V.mjs → chunk-7BNGM5OQ.mjs} +6 -6
- package/dist/libraries/react/{chunk-ZUPU2EBK.mjs → chunk-AXNPTV5K.mjs} +1 -1
- package/dist/libraries/react/{chunk-JLAWCM26.mjs → chunk-CA2BGO7B.mjs} +450 -452
- package/dist/libraries/react/{chunk-PE5RABEC.mjs → chunk-CWSAN3AB.mjs} +4 -4
- package/dist/libraries/react/{chunk-YURNJN6P.mjs → chunk-DAZBMK7R.mjs} +1 -1
- package/dist/libraries/react/{chunk-KUFNEIRV.mjs → chunk-E7V7O2AJ.mjs} +37 -9
- package/dist/libraries/react/{chunk-IBGAE73H.mjs → chunk-GDLYFO2L.mjs} +2 -2
- package/dist/libraries/react/{chunk-DOC77WTB.mjs → chunk-ILMAJOCJ.mjs} +3 -3
- package/dist/libraries/react/{chunk-UMG2RCCT.mjs → chunk-KFWZCBVR.mjs} +2 -2
- package/dist/libraries/react/{chunk-4WAFPXBN.mjs → chunk-MRYUB6IP.mjs} +1 -1
- package/dist/libraries/react/{chunk-R7DEST3O.mjs → chunk-MYLB2EJS.mjs} +1 -1
- package/dist/libraries/react/{chunk-O7IKBONA.mjs → chunk-Q25RE73N.mjs} +1 -1
- package/dist/libraries/react/{chunk-2SFUXGFK.mjs → chunk-QFAFH3PT.mjs} +1 -1
- package/dist/libraries/react/{chunk-MUZHFEMO.mjs → chunk-R4GPXTKG.mjs} +1 -1
- package/dist/libraries/react/{chunk-UGHMVXB7.mjs → chunk-R5FGE3P4.mjs} +3 -3
- package/dist/libraries/react/{chunk-XR2XUVVC.mjs → chunk-VYBU4WHO.mjs} +2 -2
- package/dist/libraries/react/{chunk-7U6BZK2Q.mjs → chunk-WGHQ5LYX.mjs} +2 -2
- package/dist/libraries/react/{chunk-MLPVSH6P.mjs → chunk-WUEXMQIT.mjs} +2 -2
- package/dist/libraries/react/{chunk-MZ26ZDT3.mjs → chunk-YE6KQQS7.mjs} +6 -6
- package/dist/libraries/react/{chunk-65UX5FJ5.mjs → chunk-YOOJMRQ2.mjs} +2 -2
- package/dist/libraries/react/client/ConvexAutumnClient.d.mts +6 -6
- package/dist/libraries/react/client/ConvexAutumnClient.d.ts +6 -6
- package/dist/libraries/react/client/ConvexAutumnClient.js +47 -9
- package/dist/libraries/react/client/ConvexAutumnClient.mjs +2 -2
- package/dist/libraries/react/client/ReactAutumnClient.d.mts +6 -6
- package/dist/libraries/react/client/ReactAutumnClient.d.ts +6 -6
- package/dist/libraries/react/client/ReactAutumnClient.js +47 -9
- package/dist/libraries/react/client/ReactAutumnClient.mjs +5 -5
- package/dist/libraries/react/client/clientCompMethods.d.mts +6 -6
- package/dist/libraries/react/client/clientCompMethods.d.ts +6 -6
- package/dist/libraries/react/client/clientCusMethods.d.mts +6 -6
- package/dist/libraries/react/client/clientCusMethods.d.ts +6 -6
- package/dist/libraries/react/client/clientEntityMethods.d.mts +6 -6
- package/dist/libraries/react/client/clientEntityMethods.d.ts +6 -6
- package/dist/libraries/react/client/clientGenMethods.d.mts +6 -6
- package/dist/libraries/react/client/clientGenMethods.d.ts +6 -6
- package/dist/libraries/react/client/clientProdMethods.d.mts +6 -6
- package/dist/libraries/react/client/clientProdMethods.d.ts +6 -6
- package/dist/libraries/react/client/clientReferralMethods.d.mts +6 -6
- package/dist/libraries/react/client/clientReferralMethods.d.ts +6 -6
- package/dist/libraries/react/client/types/clientGenTypes.js +47 -9
- package/dist/libraries/react/client/types/clientGenTypes.mjs +1 -1
- package/dist/libraries/react/components/checkout-dialog/checkout-dialog-synced.d.mts +2 -2
- package/dist/libraries/react/components/checkout-dialog/checkout-dialog-synced.d.ts +2 -2
- package/dist/libraries/react/components/checkout-dialog/checkout-dialog-synced.js +37 -9
- package/dist/libraries/react/components/checkout-dialog/checkout-dialog-synced.mjs +33 -33
- package/dist/libraries/react/components/checkout-dialog/lib/checkout-content.d.mts +2 -2
- package/dist/libraries/react/components/checkout-dialog/lib/checkout-content.d.ts +2 -2
- package/dist/libraries/react/components/paywall-dialog/lib/paywall-content.d.mts +1 -1
- package/dist/libraries/react/components/paywall-dialog/lib/paywall-content.d.ts +1 -1
- package/dist/libraries/react/components/paywall-dialog/paywall-dialog-synced.js +37 -9
- package/dist/libraries/react/components/paywall-dialog/paywall-dialog-synced.mjs +33 -33
- package/dist/libraries/react/components/pricing-table/lib/pricing-table-content.d.mts +1 -1
- package/dist/libraries/react/components/pricing-table/lib/pricing-table-content.d.ts +1 -1
- package/dist/libraries/react/components/pricing-table/pricing-table-synced.d.mts +1 -1
- package/dist/libraries/react/components/pricing-table/pricing-table-synced.d.ts +1 -1
- package/dist/libraries/react/components/pricing-table/pricing-table-synced.js +37 -9
- package/dist/libraries/react/components/pricing-table/pricing-table-synced.mjs +33 -33
- package/dist/libraries/react/components/ui/accordion.mjs +3 -3
- package/dist/libraries/react/components/ui/dialog.mjs +4 -4
- package/dist/libraries/react/components/ui/popover.mjs +5 -5
- package/dist/libraries/react/components/ui/switch.mjs +3 -3
- package/dist/libraries/react/{cusTypes-CEb_KwPo.d.ts → cusTypes-DckkwpWg.d.ts} +1 -1
- package/dist/libraries/react/{cusTypes-DynqPCZH.d.mts → cusTypes-UwHT30-L.d.mts} +1 -1
- package/dist/libraries/react/{entTypes--Y-4T20Y.d.ts → entTypes-BWsQfaNZ.d.ts} +1 -1
- package/dist/libraries/react/{entTypes-DjasDDYh.d.mts → entTypes-DcRz1vjc.d.mts} +1 -1
- package/dist/libraries/react/{genTypes-DdYlVEah.d.mts → genTypes-C_ilxndU.d.mts} +1 -1
- package/dist/libraries/react/{genTypes-aPPwPimh.d.ts → genTypes-DjcQWIOM.d.ts} +1 -1
- package/dist/libraries/react/hooks/helpers/handleCheck.d.mts +6 -6
- package/dist/libraries/react/hooks/helpers/handleCheck.d.ts +6 -6
- package/dist/libraries/react/hooks/helpers/handleCheck.js +47 -9
- package/dist/libraries/react/hooks/helpers/handleCheck.mjs +2 -2
- package/dist/libraries/react/hooks/helpers/useAutumnBase.d.mts +6 -6
- package/dist/libraries/react/hooks/helpers/useAutumnBase.d.ts +6 -6
- package/dist/libraries/react/hooks/helpers/useAutumnBase.js +37 -9
- package/dist/libraries/react/hooks/helpers/useAutumnBase.mjs +3 -3
- package/dist/libraries/react/hooks/useAnalytics.d.mts +2 -2
- package/dist/libraries/react/hooks/useAnalytics.d.ts +2 -2
- package/dist/libraries/react/hooks/useAnalytics.js +37 -9
- package/dist/libraries/react/hooks/useAnalytics.mjs +7 -7
- package/dist/libraries/react/hooks/useCustomer.d.mts +6 -6
- package/dist/libraries/react/hooks/useCustomer.d.ts +6 -6
- package/dist/libraries/react/hooks/useCustomer.js +37 -9
- package/dist/libraries/react/hooks/useCustomer.mjs +11 -11
- package/dist/libraries/react/hooks/useCustomerBase.d.mts +6 -6
- package/dist/libraries/react/hooks/useCustomerBase.d.ts +6 -6
- package/dist/libraries/react/hooks/useCustomerBase.js +37 -9
- package/dist/libraries/react/hooks/useCustomerBase.mjs +10 -10
- package/dist/libraries/react/hooks/useEntity.d.mts +4 -4
- package/dist/libraries/react/hooks/useEntity.d.ts +4 -4
- package/dist/libraries/react/hooks/useEntity.js +37 -9
- package/dist/libraries/react/hooks/useEntity.mjs +11 -11
- package/dist/libraries/react/hooks/useEntityBase.d.mts +6 -6
- package/dist/libraries/react/hooks/useEntityBase.d.ts +6 -6
- package/dist/libraries/react/hooks/useEntityBase.js +37 -9
- package/dist/libraries/react/hooks/useEntityBase.mjs +10 -10
- package/dist/libraries/react/hooks/usePaywall.d.mts +1 -1
- package/dist/libraries/react/hooks/usePaywall.d.ts +1 -1
- package/dist/libraries/react/hooks/usePaywall.js +37 -9
- package/dist/libraries/react/hooks/usePaywall.mjs +7 -7
- package/dist/libraries/react/hooks/usePricingTable.d.mts +1 -1
- package/dist/libraries/react/hooks/usePricingTable.d.ts +1 -1
- package/dist/libraries/react/hooks/usePricingTable.js +37 -9
- package/dist/libraries/react/hooks/usePricingTable.mjs +8 -8
- package/dist/libraries/react/hooks/usePricingTableBase.d.mts +6 -6
- package/dist/libraries/react/hooks/usePricingTableBase.d.ts +6 -6
- package/dist/libraries/react/hooks/usePricingTableBase.js +37 -9
- package/dist/libraries/react/hooks/usePricingTableBase.mjs +2 -2
- package/dist/libraries/react/hooks/useProductsBase.d.mts +6 -6
- package/dist/libraries/react/hooks/useProductsBase.d.ts +6 -6
- package/dist/libraries/react/index.js +37 -9
- package/dist/libraries/react/index.mjs +37 -9
- package/dist/libraries/react/{prodTypes-C8xRoBP7.d.mts → prodTypes-B8NdKyKo.d.mts} +1 -1
- package/dist/libraries/react/{prodTypes-C8xRoBP7.d.ts → prodTypes-B8NdKyKo.d.ts} +1 -1
- package/dist/next/server/auth/withNextAuth.d.mts +1 -1
- package/dist/next/server/auth/withNextAuth.d.ts +1 -1
- package/dist/next/server/componentActions.d.mts +1 -1
- package/dist/next/server/componentActions.d.ts +1 -1
- package/dist/next/server/cusActions.d.mts +15 -3
- package/dist/next/server/cusActions.d.ts +15 -3
- package/dist/next/server/{cusTypes-W3m1cxYN.d.mts → cusTypes-CrLBF0Kx.d.mts} +10 -1
- package/dist/next/server/{cusTypes-W3m1cxYN.d.ts → cusTypes-CrLBF0Kx.d.ts} +10 -1
- package/dist/next/server/genActions.d.mts +1 -1
- package/dist/next/server/genActions.d.ts +1 -1
- package/dist/sdk/index.d.mts +24 -3
- package/dist/sdk/index.d.ts +24 -3
- package/dist/sdk/index.js +46 -14
- package/dist/sdk/index.mjs +41 -15
- package/dist/utils/encryptUtils.js +37 -9
- package/dist/utils/encryptUtils.mjs +37 -9
- package/package.json +2 -1
- package/dist/libraries/react/{chunk-D3PGSU2Q.mjs → chunk-YN67J64M.mjs} +11 -11
|
@@ -144,20 +144,33 @@ var handleQuery = async ({
|
|
|
144
144
|
var autumnApiUrl = "https://api.useautumn.com/v1";
|
|
145
145
|
|
|
146
146
|
// src/sdk/utils.ts
|
|
147
|
+
import queryString from "query-string";
|
|
147
148
|
var staticWrapper = (callback, instance, args) => {
|
|
148
149
|
if (!instance) {
|
|
149
150
|
instance = new Autumn();
|
|
150
151
|
}
|
|
151
152
|
return callback({ instance, ...args });
|
|
152
153
|
};
|
|
154
|
+
var buildQueryString = (params) => {
|
|
155
|
+
if (!params) return "";
|
|
156
|
+
return queryString.stringify(params, {
|
|
157
|
+
skipNull: true,
|
|
158
|
+
skipEmptyString: true
|
|
159
|
+
});
|
|
160
|
+
};
|
|
161
|
+
var buildPathWithQuery = (basePath, params) => {
|
|
162
|
+
const query = buildQueryString(params);
|
|
163
|
+
return query ? `${basePath}?${query}` : basePath;
|
|
164
|
+
};
|
|
153
165
|
|
|
154
166
|
// src/sdk/customers/cusMethods.ts
|
|
155
167
|
var customerMethods = (instance) => {
|
|
156
168
|
return {
|
|
169
|
+
list: (params) => staticWrapper(listCustomers, instance, { params }),
|
|
157
170
|
get: (id, params) => staticWrapper(getCustomer, instance, { id, params }),
|
|
158
171
|
create: (params) => staticWrapper(createCustomer, instance, { params }),
|
|
159
172
|
update: (id, params) => staticWrapper(updateCustomer, instance, { id, params }),
|
|
160
|
-
delete: (id) => staticWrapper(deleteCustomer, instance, { id }),
|
|
173
|
+
delete: (id, params) => staticWrapper(deleteCustomer, instance, { id, params }),
|
|
161
174
|
billingPortal: (id, params) => staticWrapper(billingPortal, instance, { id, params }),
|
|
162
175
|
updateBalances: (id, params) => staticWrapper(updateBalances, instance, { id, params })
|
|
163
176
|
};
|
|
@@ -168,6 +181,13 @@ var getExpandStr = (expand) => {
|
|
|
168
181
|
}
|
|
169
182
|
return `expand=${expand.join(",")}`;
|
|
170
183
|
};
|
|
184
|
+
var listCustomers = async ({
|
|
185
|
+
instance,
|
|
186
|
+
params
|
|
187
|
+
}) => {
|
|
188
|
+
const path = buildPathWithQuery("/customers", params);
|
|
189
|
+
return instance.get(path);
|
|
190
|
+
};
|
|
171
191
|
var getCustomer = async ({
|
|
172
192
|
instance,
|
|
173
193
|
id,
|
|
@@ -199,9 +219,10 @@ var updateCustomer = async ({
|
|
|
199
219
|
};
|
|
200
220
|
var deleteCustomer = async ({
|
|
201
221
|
instance,
|
|
202
|
-
id
|
|
222
|
+
id,
|
|
223
|
+
params
|
|
203
224
|
}) => {
|
|
204
|
-
return instance.delete(`/customers/${id}`);
|
|
225
|
+
return instance.delete(`/customers/${id}${params?.delete_in_stripe ? "?delete_in_stripe=true" : ""}`);
|
|
205
226
|
};
|
|
206
227
|
var billingPortal = async ({
|
|
207
228
|
instance,
|
|
@@ -293,9 +314,9 @@ var listProducts = async ({
|
|
|
293
314
|
queryParams.append(key, String(value));
|
|
294
315
|
}
|
|
295
316
|
}
|
|
296
|
-
const
|
|
297
|
-
if (
|
|
298
|
-
path += `?${
|
|
317
|
+
const queryString2 = queryParams.toString();
|
|
318
|
+
if (queryString2) {
|
|
319
|
+
path += `?${queryString2}`;
|
|
299
320
|
}
|
|
300
321
|
}
|
|
301
322
|
return instance.get(path);
|
|
@@ -441,9 +462,9 @@ var listFeatures = async ({
|
|
|
441
462
|
queryParams.append(key, String(value));
|
|
442
463
|
}
|
|
443
464
|
}
|
|
444
|
-
const
|
|
445
|
-
if (
|
|
446
|
-
path += `?${
|
|
465
|
+
const queryString2 = queryParams.toString();
|
|
466
|
+
if (queryString2) {
|
|
467
|
+
path += `?${queryString2}`;
|
|
447
468
|
}
|
|
448
469
|
}
|
|
449
470
|
return instance.get(path);
|
|
@@ -822,6 +843,13 @@ var UpdateBalancesParamsSchema = z2.object({
|
|
|
822
843
|
})
|
|
823
844
|
)
|
|
824
845
|
);
|
|
846
|
+
var DeleteCustomerParamsSchema = z2.object({
|
|
847
|
+
delete_in_stripe: z2.boolean().optional()
|
|
848
|
+
});
|
|
849
|
+
var ListCustomersParamsSchema = z2.object({
|
|
850
|
+
limit: z2.number().optional(),
|
|
851
|
+
offset: z2.number().optional()
|
|
852
|
+
});
|
|
825
853
|
|
|
826
854
|
// src/sdk/general/checkTypes.ts
|
|
827
855
|
import { z as z3 } from "zod/v4";
|
|
@@ -168,4 +168,4 @@ interface Product {
|
|
|
168
168
|
};
|
|
169
169
|
}
|
|
170
170
|
|
|
171
|
-
export { AppEnv as A, type CheckFeaturePreview as C, type Product as P, type
|
|
171
|
+
export { AppEnv as A, type CheckFeaturePreview as C, type Product as P, type ProductItem as a, type CheckFeatureResult as b, type CheckProductResult as c, ProductItemInterval as d, type ProductScenario as e };
|
|
@@ -168,4 +168,4 @@ interface Product {
|
|
|
168
168
|
};
|
|
169
169
|
}
|
|
170
170
|
|
|
171
|
-
export { AppEnv as A, type CheckFeaturePreview as C, type Product as P, type
|
|
171
|
+
export { AppEnv as A, type CheckFeaturePreview as C, type Product as P, type ProductItem as a, type CheckFeatureResult as b, type CheckProductResult as c, ProductItemInterval as d, type ProductScenario as e };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as CustomerData, a as CheckFeatureResult, b as CheckProductResult, P as ProductItem, c as Product,
|
|
1
|
+
import { C as CustomerData, a as CheckFeatureResult, b as CheckProductResult, P as ProductItem, c as Product, L as ListCustomersParams, d as Customer, G as GetCustomerParams, e as CreateCustomerParams, U as UpdateCustomerParams, D as DeleteCustomerParams, B as BillingPortalParams, f as BillingPortalResult, g as UpdateBalancesParams, h as UpdateBalancesResult, i as CreateProductParams, j as ListProductsParams, k as CustomerProduct, l as CustomerFeature, m as CustomerInvoice } from './cusTypes-CrLBF0Kx.mjs';
|
|
2
2
|
import { z } from 'zod/v4';
|
|
3
3
|
import { z as z$1 } from 'zod';
|
|
4
4
|
import { R as Result, A as AutumnError } from './response-eH4S4sg0.mjs';
|
|
@@ -188,10 +188,16 @@ declare class Autumn {
|
|
|
188
188
|
post(path: string, body: any): Promise<Result<any, AutumnError>>;
|
|
189
189
|
delete(path: string): Promise<Result<any, AutumnError>>;
|
|
190
190
|
static customers: {
|
|
191
|
+
list: (params?: ListCustomersParams) => Promise<Result<{
|
|
192
|
+
list: Customer[];
|
|
193
|
+
total: number;
|
|
194
|
+
limit: number;
|
|
195
|
+
offset: number;
|
|
196
|
+
}, AutumnError>>;
|
|
191
197
|
get: (id: string, params?: GetCustomerParams) => Promise<Result<Customer, AutumnError>>;
|
|
192
198
|
create: (params?: CreateCustomerParams) => Promise<Result<Customer, AutumnError>>;
|
|
193
199
|
update: (id: string, params: UpdateCustomerParams) => Promise<Result<Customer, AutumnError>>;
|
|
194
|
-
delete: (id: string) => Promise<Result<Customer, AutumnError>>;
|
|
200
|
+
delete: (id: string, params?: DeleteCustomerParams) => Promise<Result<Customer, AutumnError>>;
|
|
195
201
|
billingPortal: (id: string, params?: BillingPortalParams) => Promise<Result<BillingPortalResult, AutumnError>>;
|
|
196
202
|
updateBalances: (id: string, params: UpdateBalancesParams) => Promise<Result<UpdateBalancesResult, AutumnError>>;
|
|
197
203
|
};
|
|
@@ -218,10 +224,16 @@ declare class Autumn {
|
|
|
218
224
|
}, AutumnError>>;
|
|
219
225
|
};
|
|
220
226
|
customers: {
|
|
227
|
+
list: (params?: ListCustomersParams) => Promise<Result<{
|
|
228
|
+
list: Customer[];
|
|
229
|
+
total: number;
|
|
230
|
+
limit: number;
|
|
231
|
+
offset: number;
|
|
232
|
+
}, AutumnError>>;
|
|
221
233
|
get: (id: string, params?: GetCustomerParams) => Promise<Result<Customer, AutumnError>>;
|
|
222
234
|
create: (params?: CreateCustomerParams) => Promise<Result<Customer, AutumnError>>;
|
|
223
235
|
update: (id: string, params: UpdateCustomerParams) => Promise<Result<Customer, AutumnError>>;
|
|
224
|
-
delete: (id: string) => Promise<Result<Customer, AutumnError>>;
|
|
236
|
+
delete: (id: string, params?: DeleteCustomerParams) => Promise<Result<Customer, AutumnError>>;
|
|
225
237
|
billingPortal: (id: string, params?: BillingPortalParams) => Promise<Result<BillingPortalResult, AutumnError>>;
|
|
226
238
|
updateBalances: (id: string, params: UpdateBalancesParams) => Promise<Result<UpdateBalancesResult, AutumnError>>;
|
|
227
239
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as CustomerData, a as CheckFeatureResult, b as CheckProductResult, P as ProductItem, c as Product,
|
|
1
|
+
import { C as CustomerData, a as CheckFeatureResult, b as CheckProductResult, P as ProductItem, c as Product, L as ListCustomersParams, d as Customer, G as GetCustomerParams, e as CreateCustomerParams, U as UpdateCustomerParams, D as DeleteCustomerParams, B as BillingPortalParams, f as BillingPortalResult, g as UpdateBalancesParams, h as UpdateBalancesResult, i as CreateProductParams, j as ListProductsParams, k as CustomerProduct, l as CustomerFeature, m as CustomerInvoice } from './cusTypes-CrLBF0Kx.js';
|
|
2
2
|
import { z } from 'zod/v4';
|
|
3
3
|
import { z as z$1 } from 'zod';
|
|
4
4
|
import { R as Result, A as AutumnError } from './response-eH4S4sg0.js';
|
|
@@ -188,10 +188,16 @@ declare class Autumn {
|
|
|
188
188
|
post(path: string, body: any): Promise<Result<any, AutumnError>>;
|
|
189
189
|
delete(path: string): Promise<Result<any, AutumnError>>;
|
|
190
190
|
static customers: {
|
|
191
|
+
list: (params?: ListCustomersParams) => Promise<Result<{
|
|
192
|
+
list: Customer[];
|
|
193
|
+
total: number;
|
|
194
|
+
limit: number;
|
|
195
|
+
offset: number;
|
|
196
|
+
}, AutumnError>>;
|
|
191
197
|
get: (id: string, params?: GetCustomerParams) => Promise<Result<Customer, AutumnError>>;
|
|
192
198
|
create: (params?: CreateCustomerParams) => Promise<Result<Customer, AutumnError>>;
|
|
193
199
|
update: (id: string, params: UpdateCustomerParams) => Promise<Result<Customer, AutumnError>>;
|
|
194
|
-
delete: (id: string) => Promise<Result<Customer, AutumnError>>;
|
|
200
|
+
delete: (id: string, params?: DeleteCustomerParams) => Promise<Result<Customer, AutumnError>>;
|
|
195
201
|
billingPortal: (id: string, params?: BillingPortalParams) => Promise<Result<BillingPortalResult, AutumnError>>;
|
|
196
202
|
updateBalances: (id: string, params: UpdateBalancesParams) => Promise<Result<UpdateBalancesResult, AutumnError>>;
|
|
197
203
|
};
|
|
@@ -218,10 +224,16 @@ declare class Autumn {
|
|
|
218
224
|
}, AutumnError>>;
|
|
219
225
|
};
|
|
220
226
|
customers: {
|
|
227
|
+
list: (params?: ListCustomersParams) => Promise<Result<{
|
|
228
|
+
list: Customer[];
|
|
229
|
+
total: number;
|
|
230
|
+
limit: number;
|
|
231
|
+
offset: number;
|
|
232
|
+
}, AutumnError>>;
|
|
221
233
|
get: (id: string, params?: GetCustomerParams) => Promise<Result<Customer, AutumnError>>;
|
|
222
234
|
create: (params?: CreateCustomerParams) => Promise<Result<Customer, AutumnError>>;
|
|
223
235
|
update: (id: string, params: UpdateCustomerParams) => Promise<Result<Customer, AutumnError>>;
|
|
224
|
-
delete: (id: string) => Promise<Result<Customer, AutumnError>>;
|
|
236
|
+
delete: (id: string, params?: DeleteCustomerParams) => Promise<Result<Customer, AutumnError>>;
|
|
225
237
|
billingPortal: (id: string, params?: BillingPortalParams) => Promise<Result<BillingPortalResult, AutumnError>>;
|
|
226
238
|
updateBalances: (id: string, params: UpdateBalancesParams) => Promise<Result<UpdateBalancesResult, AutumnError>>;
|
|
227
239
|
};
|
|
@@ -310,9 +310,18 @@ declare const UpdateBalancesParamsSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
310
310
|
feature_id: z.ZodString;
|
|
311
311
|
balance: z.ZodNumber;
|
|
312
312
|
}, z.core.$strip>>]>;
|
|
313
|
+
declare const DeleteCustomerParamsSchema: z.ZodObject<{
|
|
314
|
+
delete_in_stripe: z.ZodOptional<z.ZodBoolean>;
|
|
315
|
+
}, z.core.$strip>;
|
|
316
|
+
declare const ListCustomersParamsSchema: z.ZodObject<{
|
|
317
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
318
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
319
|
+
}, z.core.$strip>;
|
|
320
|
+
type ListCustomersParams = z.infer<typeof ListCustomersParamsSchema>;
|
|
321
|
+
type DeleteCustomerParams = z.infer<typeof DeleteCustomerParamsSchema>;
|
|
313
322
|
type UpdateBalancesParams = z.infer<typeof UpdateBalancesParamsSchema>;
|
|
314
323
|
type UpdateBalancesResult = {
|
|
315
324
|
success: boolean;
|
|
316
325
|
};
|
|
317
326
|
|
|
318
|
-
export type { BillingPortalParams as B, CustomerData as C, GetCustomerParams as G,
|
|
327
|
+
export type { BillingPortalParams as B, CustomerData as C, DeleteCustomerParams as D, GetCustomerParams as G, ListCustomersParams as L, ProductItem as P, UpdateCustomerParams as U, CheckFeatureResult as a, CheckProductResult as b, Product as c, Customer as d, CreateCustomerParams as e, BillingPortalResult as f, UpdateBalancesParams as g, UpdateBalancesResult as h, CreateProductParams as i, ListProductsParams as j, CustomerProduct as k, CustomerFeature as l, CustomerInvoice as m };
|
|
@@ -310,9 +310,18 @@ declare const UpdateBalancesParamsSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
310
310
|
feature_id: z.ZodString;
|
|
311
311
|
balance: z.ZodNumber;
|
|
312
312
|
}, z.core.$strip>>]>;
|
|
313
|
+
declare const DeleteCustomerParamsSchema: z.ZodObject<{
|
|
314
|
+
delete_in_stripe: z.ZodOptional<z.ZodBoolean>;
|
|
315
|
+
}, z.core.$strip>;
|
|
316
|
+
declare const ListCustomersParamsSchema: z.ZodObject<{
|
|
317
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
318
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
319
|
+
}, z.core.$strip>;
|
|
320
|
+
type ListCustomersParams = z.infer<typeof ListCustomersParamsSchema>;
|
|
321
|
+
type DeleteCustomerParams = z.infer<typeof DeleteCustomerParamsSchema>;
|
|
313
322
|
type UpdateBalancesParams = z.infer<typeof UpdateBalancesParamsSchema>;
|
|
314
323
|
type UpdateBalancesResult = {
|
|
315
324
|
success: boolean;
|
|
316
325
|
};
|
|
317
326
|
|
|
318
|
-
export type { BillingPortalParams as B, CustomerData as C, GetCustomerParams as G,
|
|
327
|
+
export type { BillingPortalParams as B, CustomerData as C, DeleteCustomerParams as D, GetCustomerParams as G, ListCustomersParams as L, ProductItem as P, UpdateCustomerParams as U, CheckFeatureResult as a, CheckProductResult as b, Product as c, Customer as d, CreateCustomerParams as e, BillingPortalResult as f, UpdateBalancesParams as g, UpdateBalancesResult as h, CreateProductParams as i, ListProductsParams as j, CustomerProduct as k, CustomerFeature as l, CustomerInvoice as m };
|
package/dist/sdk/index.d.mts
CHANGED
|
@@ -348,6 +348,15 @@ declare const UpdateBalancesParamsSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
348
348
|
feature_id: z.ZodString;
|
|
349
349
|
balance: z.ZodNumber;
|
|
350
350
|
}, z.core.$strip>>]>;
|
|
351
|
+
declare const DeleteCustomerParamsSchema: z.ZodObject<{
|
|
352
|
+
delete_in_stripe: z.ZodOptional<z.ZodBoolean>;
|
|
353
|
+
}, z.core.$strip>;
|
|
354
|
+
declare const ListCustomersParamsSchema: z.ZodObject<{
|
|
355
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
356
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
357
|
+
}, z.core.$strip>;
|
|
358
|
+
type ListCustomersParams = z.infer<typeof ListCustomersParamsSchema>;
|
|
359
|
+
type DeleteCustomerParams = z.infer<typeof DeleteCustomerParamsSchema>;
|
|
351
360
|
type UpdateBalancesParams = z.infer<typeof UpdateBalancesParamsSchema>;
|
|
352
361
|
type UpdateBalancesResult = {
|
|
353
362
|
success: boolean;
|
|
@@ -593,10 +602,16 @@ declare class Autumn {
|
|
|
593
602
|
post(path: string, body: any): Promise<Result<any, AutumnError>>;
|
|
594
603
|
delete(path: string): Promise<Result<any, AutumnError>>;
|
|
595
604
|
static customers: {
|
|
605
|
+
list: (params?: ListCustomersParams) => Promise<Result<{
|
|
606
|
+
list: Customer[];
|
|
607
|
+
total: number;
|
|
608
|
+
limit: number;
|
|
609
|
+
offset: number;
|
|
610
|
+
}, AutumnError>>;
|
|
596
611
|
get: (id: string, params?: GetCustomerParams) => Promise<Result<Customer, AutumnError>>;
|
|
597
612
|
create: (params?: CreateCustomerParams) => Promise<Result<Customer, AutumnError>>;
|
|
598
613
|
update: (id: string, params: UpdateCustomerParams) => Promise<Result<Customer, AutumnError>>;
|
|
599
|
-
delete: (id: string) => Promise<Result<Customer, AutumnError>>;
|
|
614
|
+
delete: (id: string, params?: DeleteCustomerParams) => Promise<Result<Customer, AutumnError>>;
|
|
600
615
|
billingPortal: (id: string, params?: BillingPortalParams) => Promise<Result<BillingPortalResult, AutumnError>>;
|
|
601
616
|
updateBalances: (id: string, params: UpdateBalancesParams) => Promise<Result<UpdateBalancesResult, AutumnError>>;
|
|
602
617
|
};
|
|
@@ -623,10 +638,16 @@ declare class Autumn {
|
|
|
623
638
|
}, AutumnError>>;
|
|
624
639
|
};
|
|
625
640
|
customers: {
|
|
641
|
+
list: (params?: ListCustomersParams) => Promise<Result<{
|
|
642
|
+
list: Customer[];
|
|
643
|
+
total: number;
|
|
644
|
+
limit: number;
|
|
645
|
+
offset: number;
|
|
646
|
+
}, AutumnError>>;
|
|
626
647
|
get: (id: string, params?: GetCustomerParams) => Promise<Result<Customer, AutumnError>>;
|
|
627
648
|
create: (params?: CreateCustomerParams) => Promise<Result<Customer, AutumnError>>;
|
|
628
649
|
update: (id: string, params: UpdateCustomerParams) => Promise<Result<Customer, AutumnError>>;
|
|
629
|
-
delete: (id: string) => Promise<Result<Customer, AutumnError>>;
|
|
650
|
+
delete: (id: string, params?: DeleteCustomerParams) => Promise<Result<Customer, AutumnError>>;
|
|
630
651
|
billingPortal: (id: string, params?: BillingPortalParams) => Promise<Result<BillingPortalResult, AutumnError>>;
|
|
631
652
|
updateBalances: (id: string, params: UpdateBalancesParams) => Promise<Result<UpdateBalancesResult, AutumnError>>;
|
|
632
653
|
};
|
|
@@ -975,4 +996,4 @@ interface RedeemReferralCodeResult {
|
|
|
975
996
|
reward_id: string;
|
|
976
997
|
}
|
|
977
998
|
|
|
978
|
-
export { AppEnv, type AttachFeatureOptions, AttachFeatureOptionsSchema, type AttachParams, AttachParamsSchema, type AttachResult, AttachResultSchema, Autumn, AutumnError, type AutumnPromise, type BillingPortalParams, BillingPortalParamsSchema, type BillingPortalResult, type CancelParams, CancelParamsSchema, type CancelResult, CancelResultSchema, type CheckFeaturePreview, type CheckFeatureResult, CheckFeatureResultSchema, type CheckFeatureScenario, type CheckParams, CheckParamsSchema, type CheckProductPreview, type CheckProductResult, type CheckResult, type CheckoutParams, CheckoutParamsSchema, type CheckoutResult, CoreCusFeatureSchema, type CoreCustomerFeature, type CreateCustomerParams, CreateCustomerParamsSchema, type CreateEntityParams, type CreateEntityResult, type CreateProductParams, type CreateReferralCodeParams, CreateReferralCodeParamsSchema, type CreateReferralCodeResult, type Customer, type CustomerData, CustomerDataSchema, CustomerExpandEnum, type CustomerExpandOption, type CustomerFeature, type CustomerInvoice, type CustomerProduct, type CustomerReferral, type DeleteEntityResult, type Entity, type EntityData, EntityDataSchema, type EntityExpandOption, type ErrorResponse, type Feature$1 as Feature, FeatureSchema, type FreeTrial, FreeTrialDuration, type GetCustomerParams, type GetEntityParams, type GetPricingTableParams, Infinite, type ListProductsParams, type PriceTier, type PricingTableProduct, type Product, type ProductItem, ProductItemInterval, type ProductItemIntervalType, type ProductScenario, ProductStatus, type QueryParams, QueryParamsSchema, QueryRangeEnum, type QueryResult, type RedeemReferralCodeParams, RedeemReferralCodeParamsSchema, type RedeemReferralCodeResult, type SetupPaymentParams, type SetupPaymentResult, type TrackParams, TrackParamsSchema, type TrackResult, TrackResultSchema, type TransferProductParams, TransferProductParamsSchema, type TransferProductResult, type UpdateBalancesParams, UpdateBalancesParamsSchema, type UpdateBalancesResult, type UpdateCustomerParams, UsageModel, type UsageModelType, type UsageParams, type UsageResult, fetchPricingTable, toContainerResult };
|
|
999
|
+
export { AppEnv, type AttachFeatureOptions, AttachFeatureOptionsSchema, type AttachParams, AttachParamsSchema, type AttachResult, AttachResultSchema, Autumn, AutumnError, type AutumnPromise, type BillingPortalParams, BillingPortalParamsSchema, type BillingPortalResult, type CancelParams, CancelParamsSchema, type CancelResult, CancelResultSchema, type CheckFeaturePreview, type CheckFeatureResult, CheckFeatureResultSchema, type CheckFeatureScenario, type CheckParams, CheckParamsSchema, type CheckProductPreview, type CheckProductResult, type CheckResult, type CheckoutParams, CheckoutParamsSchema, type CheckoutResult, CoreCusFeatureSchema, type CoreCustomerFeature, type CreateCustomerParams, CreateCustomerParamsSchema, type CreateEntityParams, type CreateEntityResult, type CreateProductParams, type CreateReferralCodeParams, CreateReferralCodeParamsSchema, type CreateReferralCodeResult, type Customer, type CustomerData, CustomerDataSchema, CustomerExpandEnum, type CustomerExpandOption, type CustomerFeature, type CustomerInvoice, type CustomerProduct, type CustomerReferral, type DeleteCustomerParams, DeleteCustomerParamsSchema, type DeleteEntityResult, type Entity, type EntityData, EntityDataSchema, type EntityExpandOption, type ErrorResponse, type Feature$1 as Feature, FeatureSchema, type FreeTrial, FreeTrialDuration, type GetCustomerParams, type GetEntityParams, type GetPricingTableParams, Infinite, type ListCustomersParams, ListCustomersParamsSchema, type ListProductsParams, type PriceTier, type PricingTableProduct, type Product, type ProductItem, ProductItemInterval, type ProductItemIntervalType, type ProductScenario, ProductStatus, type QueryParams, QueryParamsSchema, QueryRangeEnum, type QueryResult, type RedeemReferralCodeParams, RedeemReferralCodeParamsSchema, type RedeemReferralCodeResult, type SetupPaymentParams, type SetupPaymentResult, type TrackParams, TrackParamsSchema, type TrackResult, TrackResultSchema, type TransferProductParams, TransferProductParamsSchema, type TransferProductResult, type UpdateBalancesParams, UpdateBalancesParamsSchema, type UpdateBalancesResult, type UpdateCustomerParams, UsageModel, type UsageModelType, type UsageParams, type UsageResult, fetchPricingTable, toContainerResult };
|
package/dist/sdk/index.d.ts
CHANGED
|
@@ -348,6 +348,15 @@ declare const UpdateBalancesParamsSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
348
348
|
feature_id: z.ZodString;
|
|
349
349
|
balance: z.ZodNumber;
|
|
350
350
|
}, z.core.$strip>>]>;
|
|
351
|
+
declare const DeleteCustomerParamsSchema: z.ZodObject<{
|
|
352
|
+
delete_in_stripe: z.ZodOptional<z.ZodBoolean>;
|
|
353
|
+
}, z.core.$strip>;
|
|
354
|
+
declare const ListCustomersParamsSchema: z.ZodObject<{
|
|
355
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
356
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
357
|
+
}, z.core.$strip>;
|
|
358
|
+
type ListCustomersParams = z.infer<typeof ListCustomersParamsSchema>;
|
|
359
|
+
type DeleteCustomerParams = z.infer<typeof DeleteCustomerParamsSchema>;
|
|
351
360
|
type UpdateBalancesParams = z.infer<typeof UpdateBalancesParamsSchema>;
|
|
352
361
|
type UpdateBalancesResult = {
|
|
353
362
|
success: boolean;
|
|
@@ -593,10 +602,16 @@ declare class Autumn {
|
|
|
593
602
|
post(path: string, body: any): Promise<Result<any, AutumnError>>;
|
|
594
603
|
delete(path: string): Promise<Result<any, AutumnError>>;
|
|
595
604
|
static customers: {
|
|
605
|
+
list: (params?: ListCustomersParams) => Promise<Result<{
|
|
606
|
+
list: Customer[];
|
|
607
|
+
total: number;
|
|
608
|
+
limit: number;
|
|
609
|
+
offset: number;
|
|
610
|
+
}, AutumnError>>;
|
|
596
611
|
get: (id: string, params?: GetCustomerParams) => Promise<Result<Customer, AutumnError>>;
|
|
597
612
|
create: (params?: CreateCustomerParams) => Promise<Result<Customer, AutumnError>>;
|
|
598
613
|
update: (id: string, params: UpdateCustomerParams) => Promise<Result<Customer, AutumnError>>;
|
|
599
|
-
delete: (id: string) => Promise<Result<Customer, AutumnError>>;
|
|
614
|
+
delete: (id: string, params?: DeleteCustomerParams) => Promise<Result<Customer, AutumnError>>;
|
|
600
615
|
billingPortal: (id: string, params?: BillingPortalParams) => Promise<Result<BillingPortalResult, AutumnError>>;
|
|
601
616
|
updateBalances: (id: string, params: UpdateBalancesParams) => Promise<Result<UpdateBalancesResult, AutumnError>>;
|
|
602
617
|
};
|
|
@@ -623,10 +638,16 @@ declare class Autumn {
|
|
|
623
638
|
}, AutumnError>>;
|
|
624
639
|
};
|
|
625
640
|
customers: {
|
|
641
|
+
list: (params?: ListCustomersParams) => Promise<Result<{
|
|
642
|
+
list: Customer[];
|
|
643
|
+
total: number;
|
|
644
|
+
limit: number;
|
|
645
|
+
offset: number;
|
|
646
|
+
}, AutumnError>>;
|
|
626
647
|
get: (id: string, params?: GetCustomerParams) => Promise<Result<Customer, AutumnError>>;
|
|
627
648
|
create: (params?: CreateCustomerParams) => Promise<Result<Customer, AutumnError>>;
|
|
628
649
|
update: (id: string, params: UpdateCustomerParams) => Promise<Result<Customer, AutumnError>>;
|
|
629
|
-
delete: (id: string) => Promise<Result<Customer, AutumnError>>;
|
|
650
|
+
delete: (id: string, params?: DeleteCustomerParams) => Promise<Result<Customer, AutumnError>>;
|
|
630
651
|
billingPortal: (id: string, params?: BillingPortalParams) => Promise<Result<BillingPortalResult, AutumnError>>;
|
|
631
652
|
updateBalances: (id: string, params: UpdateBalancesParams) => Promise<Result<UpdateBalancesResult, AutumnError>>;
|
|
632
653
|
};
|
|
@@ -975,4 +996,4 @@ interface RedeemReferralCodeResult {
|
|
|
975
996
|
reward_id: string;
|
|
976
997
|
}
|
|
977
998
|
|
|
978
|
-
export { AppEnv, type AttachFeatureOptions, AttachFeatureOptionsSchema, type AttachParams, AttachParamsSchema, type AttachResult, AttachResultSchema, Autumn, AutumnError, type AutumnPromise, type BillingPortalParams, BillingPortalParamsSchema, type BillingPortalResult, type CancelParams, CancelParamsSchema, type CancelResult, CancelResultSchema, type CheckFeaturePreview, type CheckFeatureResult, CheckFeatureResultSchema, type CheckFeatureScenario, type CheckParams, CheckParamsSchema, type CheckProductPreview, type CheckProductResult, type CheckResult, type CheckoutParams, CheckoutParamsSchema, type CheckoutResult, CoreCusFeatureSchema, type CoreCustomerFeature, type CreateCustomerParams, CreateCustomerParamsSchema, type CreateEntityParams, type CreateEntityResult, type CreateProductParams, type CreateReferralCodeParams, CreateReferralCodeParamsSchema, type CreateReferralCodeResult, type Customer, type CustomerData, CustomerDataSchema, CustomerExpandEnum, type CustomerExpandOption, type CustomerFeature, type CustomerInvoice, type CustomerProduct, type CustomerReferral, type DeleteEntityResult, type Entity, type EntityData, EntityDataSchema, type EntityExpandOption, type ErrorResponse, type Feature$1 as Feature, FeatureSchema, type FreeTrial, FreeTrialDuration, type GetCustomerParams, type GetEntityParams, type GetPricingTableParams, Infinite, type ListProductsParams, type PriceTier, type PricingTableProduct, type Product, type ProductItem, ProductItemInterval, type ProductItemIntervalType, type ProductScenario, ProductStatus, type QueryParams, QueryParamsSchema, QueryRangeEnum, type QueryResult, type RedeemReferralCodeParams, RedeemReferralCodeParamsSchema, type RedeemReferralCodeResult, type SetupPaymentParams, type SetupPaymentResult, type TrackParams, TrackParamsSchema, type TrackResult, TrackResultSchema, type TransferProductParams, TransferProductParamsSchema, type TransferProductResult, type UpdateBalancesParams, UpdateBalancesParamsSchema, type UpdateBalancesResult, type UpdateCustomerParams, UsageModel, type UsageModelType, type UsageParams, type UsageResult, fetchPricingTable, toContainerResult };
|
|
999
|
+
export { AppEnv, type AttachFeatureOptions, AttachFeatureOptionsSchema, type AttachParams, AttachParamsSchema, type AttachResult, AttachResultSchema, Autumn, AutumnError, type AutumnPromise, type BillingPortalParams, BillingPortalParamsSchema, type BillingPortalResult, type CancelParams, CancelParamsSchema, type CancelResult, CancelResultSchema, type CheckFeaturePreview, type CheckFeatureResult, CheckFeatureResultSchema, type CheckFeatureScenario, type CheckParams, CheckParamsSchema, type CheckProductPreview, type CheckProductResult, type CheckResult, type CheckoutParams, CheckoutParamsSchema, type CheckoutResult, CoreCusFeatureSchema, type CoreCustomerFeature, type CreateCustomerParams, CreateCustomerParamsSchema, type CreateEntityParams, type CreateEntityResult, type CreateProductParams, type CreateReferralCodeParams, CreateReferralCodeParamsSchema, type CreateReferralCodeResult, type Customer, type CustomerData, CustomerDataSchema, CustomerExpandEnum, type CustomerExpandOption, type CustomerFeature, type CustomerInvoice, type CustomerProduct, type CustomerReferral, type DeleteCustomerParams, DeleteCustomerParamsSchema, type DeleteEntityResult, type Entity, type EntityData, EntityDataSchema, type EntityExpandOption, type ErrorResponse, type Feature$1 as Feature, FeatureSchema, type FreeTrial, FreeTrialDuration, type GetCustomerParams, type GetEntityParams, type GetPricingTableParams, Infinite, type ListCustomersParams, ListCustomersParamsSchema, type ListProductsParams, type PriceTier, type PricingTableProduct, type Product, type ProductItem, ProductItemInterval, type ProductItemIntervalType, type ProductScenario, ProductStatus, type QueryParams, QueryParamsSchema, QueryRangeEnum, type QueryResult, type RedeemReferralCodeParams, RedeemReferralCodeParamsSchema, type RedeemReferralCodeResult, type SetupPaymentParams, type SetupPaymentResult, type TrackParams, TrackParamsSchema, type TrackResult, TrackResultSchema, type TransferProductParams, TransferProductParamsSchema, type TransferProductResult, type UpdateBalancesParams, UpdateBalancesParamsSchema, type UpdateBalancesResult, type UpdateCustomerParams, UsageModel, type UsageModelType, type UsageParams, type UsageResult, fetchPricingTable, toContainerResult };
|
package/dist/sdk/index.js
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var queryString = require('query-string');
|
|
3
4
|
var v4 = require('zod/v4');
|
|
4
5
|
var zod = require('zod');
|
|
5
6
|
|
|
7
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
8
|
+
|
|
9
|
+
var queryString__default = /*#__PURE__*/_interopDefault(queryString);
|
|
10
|
+
|
|
6
11
|
var __defProp = Object.defineProperty;
|
|
7
12
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
13
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
@@ -85,22 +90,32 @@ var handleQuery = async ({
|
|
|
85
90
|
|
|
86
91
|
// src/libraries/backend/constants.ts
|
|
87
92
|
var autumnApiUrl = "https://api.useautumn.com/v1";
|
|
88
|
-
|
|
89
|
-
// src/sdk/utils.ts
|
|
90
93
|
var staticWrapper = (callback, instance, args) => {
|
|
91
94
|
if (!instance) {
|
|
92
95
|
instance = new Autumn();
|
|
93
96
|
}
|
|
94
97
|
return callback({ instance, ...args });
|
|
95
98
|
};
|
|
99
|
+
var buildQueryString = (params) => {
|
|
100
|
+
if (!params) return "";
|
|
101
|
+
return queryString__default.default.stringify(params, {
|
|
102
|
+
skipNull: true,
|
|
103
|
+
skipEmptyString: true
|
|
104
|
+
});
|
|
105
|
+
};
|
|
106
|
+
var buildPathWithQuery = (basePath, params) => {
|
|
107
|
+
const query = buildQueryString(params);
|
|
108
|
+
return query ? `${basePath}?${query}` : basePath;
|
|
109
|
+
};
|
|
96
110
|
|
|
97
111
|
// src/sdk/customers/cusMethods.ts
|
|
98
112
|
var customerMethods = (instance) => {
|
|
99
113
|
return {
|
|
114
|
+
list: (params) => staticWrapper(listCustomers, instance, { params }),
|
|
100
115
|
get: (id, params) => staticWrapper(getCustomer, instance, { id, params }),
|
|
101
116
|
create: (params) => staticWrapper(createCustomer, instance, { params }),
|
|
102
117
|
update: (id, params) => staticWrapper(updateCustomer, instance, { id, params }),
|
|
103
|
-
delete: (id) => staticWrapper(deleteCustomer, instance, { id }),
|
|
118
|
+
delete: (id, params) => staticWrapper(deleteCustomer, instance, { id, params }),
|
|
104
119
|
billingPortal: (id, params) => staticWrapper(billingPortal, instance, { id, params }),
|
|
105
120
|
updateBalances: (id, params) => staticWrapper(updateBalances, instance, { id, params })
|
|
106
121
|
};
|
|
@@ -111,6 +126,13 @@ var getExpandStr = (expand) => {
|
|
|
111
126
|
}
|
|
112
127
|
return `expand=${expand.join(",")}`;
|
|
113
128
|
};
|
|
129
|
+
var listCustomers = async ({
|
|
130
|
+
instance,
|
|
131
|
+
params
|
|
132
|
+
}) => {
|
|
133
|
+
const path = buildPathWithQuery("/customers", params);
|
|
134
|
+
return instance.get(path);
|
|
135
|
+
};
|
|
114
136
|
var getCustomer = async ({
|
|
115
137
|
instance,
|
|
116
138
|
id,
|
|
@@ -142,9 +164,10 @@ var updateCustomer = async ({
|
|
|
142
164
|
};
|
|
143
165
|
var deleteCustomer = async ({
|
|
144
166
|
instance,
|
|
145
|
-
id
|
|
167
|
+
id,
|
|
168
|
+
params
|
|
146
169
|
}) => {
|
|
147
|
-
return instance.delete(`/customers/${id}`);
|
|
170
|
+
return instance.delete(`/customers/${id}${params?.delete_in_stripe ? "?delete_in_stripe=true" : ""}`);
|
|
148
171
|
};
|
|
149
172
|
var billingPortal = async ({
|
|
150
173
|
instance,
|
|
@@ -236,9 +259,9 @@ var listProducts = async ({
|
|
|
236
259
|
queryParams.append(key, String(value));
|
|
237
260
|
}
|
|
238
261
|
}
|
|
239
|
-
const
|
|
240
|
-
if (
|
|
241
|
-
path += `?${
|
|
262
|
+
const queryString2 = queryParams.toString();
|
|
263
|
+
if (queryString2) {
|
|
264
|
+
path += `?${queryString2}`;
|
|
242
265
|
}
|
|
243
266
|
}
|
|
244
267
|
return instance.get(path);
|
|
@@ -368,9 +391,9 @@ var listFeatures = async ({
|
|
|
368
391
|
queryParams.append(key, String(value));
|
|
369
392
|
}
|
|
370
393
|
}
|
|
371
|
-
const
|
|
372
|
-
if (
|
|
373
|
-
path += `?${
|
|
394
|
+
const queryString2 = queryParams.toString();
|
|
395
|
+
if (queryString2) {
|
|
396
|
+
path += `?${queryString2}`;
|
|
374
397
|
}
|
|
375
398
|
}
|
|
376
399
|
return instance.get(path);
|
|
@@ -761,6 +784,13 @@ var UpdateBalancesParamsSchema = v4.z.object({
|
|
|
761
784
|
})
|
|
762
785
|
)
|
|
763
786
|
);
|
|
787
|
+
var DeleteCustomerParamsSchema = v4.z.object({
|
|
788
|
+
delete_in_stripe: v4.z.boolean().optional()
|
|
789
|
+
});
|
|
790
|
+
var ListCustomersParamsSchema = v4.z.object({
|
|
791
|
+
limit: v4.z.number().optional(),
|
|
792
|
+
offset: v4.z.number().optional()
|
|
793
|
+
});
|
|
764
794
|
var CheckFeatureResultSchema = v4.z.object({
|
|
765
795
|
allowed: v4.z.boolean(),
|
|
766
796
|
feature_id: v4.z.string(),
|
|
@@ -846,9 +876,9 @@ var fetchPricingTable = async ({
|
|
|
846
876
|
queryParams.append(key, String(value));
|
|
847
877
|
}
|
|
848
878
|
}
|
|
849
|
-
const
|
|
850
|
-
if (
|
|
851
|
-
path += `?${
|
|
879
|
+
const queryString2 = queryParams.toString();
|
|
880
|
+
if (queryString2) {
|
|
881
|
+
path += `?${queryString2}`;
|
|
852
882
|
}
|
|
853
883
|
}
|
|
854
884
|
return await instance.get(path);
|
|
@@ -950,10 +980,12 @@ exports.CreateCustomerParamsSchema = CreateCustomerParamsSchema;
|
|
|
950
980
|
exports.CreateReferralCodeParamsSchema = CreateReferralCodeParamsSchema;
|
|
951
981
|
exports.CustomerDataSchema = CustomerDataSchema;
|
|
952
982
|
exports.CustomerExpandEnum = CustomerExpandEnum;
|
|
983
|
+
exports.DeleteCustomerParamsSchema = DeleteCustomerParamsSchema;
|
|
953
984
|
exports.EntityDataSchema = EntityDataSchema;
|
|
954
985
|
exports.FeatureSchema = FeatureSchema;
|
|
955
986
|
exports.FreeTrialDuration = FreeTrialDuration;
|
|
956
987
|
exports.Infinite = Infinite;
|
|
988
|
+
exports.ListCustomersParamsSchema = ListCustomersParamsSchema;
|
|
957
989
|
exports.ProductItemInterval = ProductItemInterval;
|
|
958
990
|
exports.ProductStatus = ProductStatus;
|
|
959
991
|
exports.QueryParamsSchema = QueryParamsSchema;
|