autumn-js 0.1.42 → 0.1.44

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 (96) hide show
  1. package/dist/libraries/backend/better-auth.d.mts +46 -0
  2. package/dist/libraries/backend/better-auth.d.ts +46 -0
  3. package/dist/libraries/backend/better-auth.js +10 -0
  4. package/dist/libraries/backend/better-auth.mjs +10 -1
  5. package/dist/libraries/backend/constants.mjs +0 -1
  6. package/dist/libraries/backend/convex.mjs +0 -1
  7. package/dist/libraries/backend/elysia.mjs +0 -1
  8. package/dist/libraries/backend/express.mjs +0 -1
  9. package/dist/libraries/backend/fastify.mjs +0 -1
  10. package/dist/libraries/backend/hono.mjs +0 -1
  11. package/dist/libraries/backend/index.mjs +0 -1
  12. package/dist/libraries/backend/next.js +3 -3500
  13. package/dist/libraries/backend/next.mjs +5 -3504
  14. package/dist/libraries/backend/react-router.mjs +0 -1
  15. package/dist/libraries/backend/remix_dep.mjs +0 -1
  16. package/dist/libraries/backend/routes/backendRouter.mjs +0 -1
  17. package/dist/libraries/backend/routes/entityRoutes.mjs +0 -1
  18. package/dist/libraries/backend/routes/genRoutes.mjs +0 -1
  19. package/dist/libraries/backend/routes/productRoutes.mjs +0 -1
  20. package/dist/libraries/backend/routes/referralRoutes.mjs +0 -1
  21. package/dist/libraries/backend/schemas/zod.mjs +0 -2
  22. package/dist/libraries/backend/supabase.mjs +0 -1
  23. package/dist/libraries/backend/tanstack.js +4 -96
  24. package/dist/libraries/backend/tanstack.mjs +1 -98
  25. package/dist/libraries/backend/utils/backendRes.mjs +0 -1
  26. package/dist/libraries/backend/utils/betterAuth/middlewares.mjs +0 -1
  27. package/dist/libraries/backend/utils/logBackendErrors.mjs +0 -1
  28. package/dist/libraries/backend/utils/secretKeyCheck.mjs +0 -1
  29. package/dist/libraries/backend/utils/withAuth.mjs +0 -1
  30. package/dist/libraries/react/components/ui/button.d.mts +1 -1
  31. package/dist/libraries/react/components/ui/button.d.ts +1 -1
  32. package/dist/next/client/AutumnClientProvider.d.mts +2 -0
  33. package/dist/next/client/AutumnClientProvider.d.ts +2 -0
  34. package/dist/next/client/NextAutumnClient.d.mts +253 -0
  35. package/dist/next/client/NextAutumnClient.d.ts +253 -0
  36. package/dist/next/client/NextAutumnProvider.d.mts +12 -0
  37. package/dist/next/client/NextAutumnProvider.d.ts +12 -0
  38. package/dist/next/client/clientAttachTypes-BtZh00uu.d.ts +121 -0
  39. package/dist/next/client/clientAttachTypes-yOuJqDWt.d.mts +121 -0
  40. package/dist/next/client/clientEntTypes-Bsi7ciUF.d.ts +73 -0
  41. package/dist/next/client/clientEntTypes-aLfa3lyP.d.mts +73 -0
  42. package/dist/next/client/clientUtils.d.mts +19 -0
  43. package/dist/next/client/clientUtils.d.ts +19 -0
  44. package/dist/next/client/cusTypes-B-rJwpui.d.ts +123 -0
  45. package/dist/next/client/cusTypes-CXjHwB-c.d.mts +123 -0
  46. package/dist/next/client/entTypes-BkN-Puru.d.mts +22 -0
  47. package/dist/next/client/entTypes-DjKFS-Zk.d.ts +22 -0
  48. package/dist/next/client/error-DHbclCVh.d.mts +17 -0
  49. package/dist/next/client/error-DHbclCVh.d.ts +17 -0
  50. package/dist/next/client/hooks/useAutumn.d.mts +19 -0
  51. package/dist/next/client/hooks/useAutumn.d.ts +19 -0
  52. package/dist/next/client/hooks/useCustomer.d.mts +87 -0
  53. package/dist/next/client/hooks/useCustomer.d.ts +87 -0
  54. package/dist/next/client/hooks/useEntity.d.mts +33 -0
  55. package/dist/next/client/hooks/useEntity.d.ts +33 -0
  56. package/dist/next/client/hooks/usePricingTable.d.mts +34 -0
  57. package/dist/next/client/hooks/usePricingTable.d.ts +34 -0
  58. package/dist/next/client/prodTypes-B_VMILpU.d.mts +162 -0
  59. package/dist/next/client/prodTypes-B_VMILpU.d.ts +162 -0
  60. package/dist/next/client/types.d.mts +75 -0
  61. package/dist/next/client/types.d.ts +75 -0
  62. package/dist/next/server/auth/authPlugin.d.mts +13 -0
  63. package/dist/next/server/auth/authPlugin.d.ts +13 -0
  64. package/dist/next/server/auth/clerk-wrapper.d.mts +3 -0
  65. package/dist/next/server/auth/clerk-wrapper.d.ts +3 -0
  66. package/dist/next/server/auth/get-next-headers.d.mts +6 -0
  67. package/dist/next/server/auth/get-next-headers.d.ts +6 -0
  68. package/dist/next/server/auth/handleAuthProvider.d.mts +44 -0
  69. package/dist/next/server/auth/handleAuthProvider.d.ts +44 -0
  70. package/dist/next/server/auth/supabase-wrapper.d.mts +3 -0
  71. package/dist/next/server/auth/supabase-wrapper.d.ts +3 -0
  72. package/dist/next/server/auth/withNextAuth.d.mts +16 -0
  73. package/dist/next/server/auth/withNextAuth.d.ts +16 -0
  74. package/dist/next/server/componentActions.d.mts +12 -0
  75. package/dist/next/server/componentActions.d.ts +12 -0
  76. package/dist/next/server/cusActions.d.mts +633 -0
  77. package/dist/next/server/cusActions.d.ts +633 -0
  78. package/dist/next/server/cusTypes-CrLBF0Kx.d.mts +327 -0
  79. package/dist/next/server/cusTypes-CrLBF0Kx.d.ts +327 -0
  80. package/dist/next/server/genActions.d.mts +84 -0
  81. package/dist/next/server/genActions.d.ts +84 -0
  82. package/dist/next/server/response-eH4S4sg0.d.mts +29 -0
  83. package/dist/next/server/response-eH4S4sg0.d.ts +29 -0
  84. package/dist/next/server/utils.d.mts +5 -0
  85. package/dist/next/server/utils.d.ts +5 -0
  86. package/dist/utils/encryptUtils.d.mts +4 -0
  87. package/dist/utils/encryptUtils.d.ts +4 -0
  88. package/dist/utils/entityUtils.d.mts +3 -0
  89. package/dist/utils/entityUtils.d.ts +3 -0
  90. package/dist/utils/logger.d.mts +45 -0
  91. package/dist/utils/logger.d.ts +45 -0
  92. package/dist/utils/toSnakeCase.d.mts +7 -0
  93. package/dist/utils/toSnakeCase.d.ts +7 -0
  94. package/package.json +1 -1
  95. package/dist/libraries/backend/chunk-6DZX6EAA.mjs +0 -37
  96. package/dist/libraries/react/chunk-5AWCXHI3.mjs +0 -743
@@ -0,0 +1,84 @@
1
+ import { C as CustomerData, B as BillingPortalParams } from './cusTypes-CrLBF0Kx.mjs';
2
+ import 'zod/v4';
3
+
4
+ declare const attachAction: (args: Omit<{
5
+ productId?: string | undefined;
6
+ entityId?: string | undefined;
7
+ options?: {
8
+ featureId: string;
9
+ quantity: number;
10
+ }[] | undefined;
11
+ productIds?: string[] | undefined;
12
+ freeTrial?: boolean | undefined;
13
+ successUrl?: string | undefined;
14
+ metadata?: Record<string, string> | undefined;
15
+ forceCheckout?: boolean | undefined;
16
+ dialog?: any;
17
+ entityData?: any;
18
+ openInNewTab?: boolean | undefined;
19
+ reward?: string | undefined;
20
+ checkoutSessionParams?: Record<string, any> | undefined;
21
+ } & {
22
+ customerId: string;
23
+ customerData?: CustomerData;
24
+ }, "customerId"> & {
25
+ encryptedCustomerId?: string;
26
+ }, request?: Request) => Promise<any>;
27
+ declare const cancelAction: (args: Omit<{
28
+ productId: string;
29
+ entityId?: string | undefined;
30
+ cancelImmediately?: boolean | undefined;
31
+ } & {
32
+ customerId: string;
33
+ }, "customerId"> & {
34
+ encryptedCustomerId?: string;
35
+ }, request?: Request) => Promise<any>;
36
+ declare const checkAction: (args: Omit<{
37
+ featureId?: string | undefined;
38
+ productId?: string | undefined;
39
+ entityId?: string | undefined;
40
+ requiredBalance?: number | undefined;
41
+ sendEvent?: boolean | undefined;
42
+ withPreview?: boolean | undefined;
43
+ dialog?: any;
44
+ entityData?: any;
45
+ properties?: Record<string, any> | undefined;
46
+ } & {
47
+ customerId: string;
48
+ customerData?: CustomerData;
49
+ }, "customerId"> & {
50
+ encryptedCustomerId?: string;
51
+ }, request?: Request) => Promise<any>;
52
+ declare const trackAction: (args: Omit<{
53
+ featureId?: string | undefined;
54
+ eventName?: string | undefined;
55
+ entityId?: string | undefined;
56
+ value?: number | undefined;
57
+ idempotencyKey?: string | undefined;
58
+ entityData?: any;
59
+ } & {
60
+ customerId: string;
61
+ customerData?: CustomerData;
62
+ }, "customerId"> & {
63
+ encryptedCustomerId?: string;
64
+ }, request?: Request) => Promise<any>;
65
+ declare const getBillingPortalAction: (args: Omit<{
66
+ customerId: string;
67
+ params?: BillingPortalParams;
68
+ }, "customerId"> & {
69
+ encryptedCustomerId?: string;
70
+ }, request?: Request) => Promise<any>;
71
+ declare const generateReferralCodeAction: (args: Omit<{
72
+ customerId: string;
73
+ programId: string;
74
+ }, "customerId"> & {
75
+ encryptedCustomerId?: string;
76
+ }, request?: Request) => Promise<any>;
77
+ declare const redeemReferralCodeAction: (args: Omit<{
78
+ code: string;
79
+ customerId: string;
80
+ }, "customerId"> & {
81
+ encryptedCustomerId?: string;
82
+ }, request?: Request) => Promise<any>;
83
+
84
+ export { attachAction, cancelAction, checkAction, generateReferralCodeAction, getBillingPortalAction, redeemReferralCodeAction, trackAction };
@@ -0,0 +1,84 @@
1
+ import { C as CustomerData, B as BillingPortalParams } from './cusTypes-CrLBF0Kx.js';
2
+ import 'zod/v4';
3
+
4
+ declare const attachAction: (args: Omit<{
5
+ productId?: string | undefined;
6
+ entityId?: string | undefined;
7
+ options?: {
8
+ featureId: string;
9
+ quantity: number;
10
+ }[] | undefined;
11
+ productIds?: string[] | undefined;
12
+ freeTrial?: boolean | undefined;
13
+ successUrl?: string | undefined;
14
+ metadata?: Record<string, string> | undefined;
15
+ forceCheckout?: boolean | undefined;
16
+ dialog?: any;
17
+ entityData?: any;
18
+ openInNewTab?: boolean | undefined;
19
+ reward?: string | undefined;
20
+ checkoutSessionParams?: Record<string, any> | undefined;
21
+ } & {
22
+ customerId: string;
23
+ customerData?: CustomerData;
24
+ }, "customerId"> & {
25
+ encryptedCustomerId?: string;
26
+ }, request?: Request) => Promise<any>;
27
+ declare const cancelAction: (args: Omit<{
28
+ productId: string;
29
+ entityId?: string | undefined;
30
+ cancelImmediately?: boolean | undefined;
31
+ } & {
32
+ customerId: string;
33
+ }, "customerId"> & {
34
+ encryptedCustomerId?: string;
35
+ }, request?: Request) => Promise<any>;
36
+ declare const checkAction: (args: Omit<{
37
+ featureId?: string | undefined;
38
+ productId?: string | undefined;
39
+ entityId?: string | undefined;
40
+ requiredBalance?: number | undefined;
41
+ sendEvent?: boolean | undefined;
42
+ withPreview?: boolean | undefined;
43
+ dialog?: any;
44
+ entityData?: any;
45
+ properties?: Record<string, any> | undefined;
46
+ } & {
47
+ customerId: string;
48
+ customerData?: CustomerData;
49
+ }, "customerId"> & {
50
+ encryptedCustomerId?: string;
51
+ }, request?: Request) => Promise<any>;
52
+ declare const trackAction: (args: Omit<{
53
+ featureId?: string | undefined;
54
+ eventName?: string | undefined;
55
+ entityId?: string | undefined;
56
+ value?: number | undefined;
57
+ idempotencyKey?: string | undefined;
58
+ entityData?: any;
59
+ } & {
60
+ customerId: string;
61
+ customerData?: CustomerData;
62
+ }, "customerId"> & {
63
+ encryptedCustomerId?: string;
64
+ }, request?: Request) => Promise<any>;
65
+ declare const getBillingPortalAction: (args: Omit<{
66
+ customerId: string;
67
+ params?: BillingPortalParams;
68
+ }, "customerId"> & {
69
+ encryptedCustomerId?: string;
70
+ }, request?: Request) => Promise<any>;
71
+ declare const generateReferralCodeAction: (args: Omit<{
72
+ customerId: string;
73
+ programId: string;
74
+ }, "customerId"> & {
75
+ encryptedCustomerId?: string;
76
+ }, request?: Request) => Promise<any>;
77
+ declare const redeemReferralCodeAction: (args: Omit<{
78
+ code: string;
79
+ customerId: string;
80
+ }, "customerId"> & {
81
+ encryptedCustomerId?: string;
82
+ }, request?: Request) => Promise<any>;
83
+
84
+ export { attachAction, cancelAction, checkAction, generateReferralCodeAction, getBillingPortalAction, redeemReferralCodeAction, trackAction };
@@ -0,0 +1,29 @@
1
+ interface ErrorResponse {
2
+ message: string;
3
+ code: string;
4
+ }
5
+ declare class AutumnError extends Error {
6
+ readonly message: string;
7
+ readonly code: string;
8
+ constructor(response: ErrorResponse);
9
+ static fromError(error: any): AutumnError;
10
+ toString(): string;
11
+ toJSON(): {
12
+ message: string;
13
+ code: string;
14
+ };
15
+ }
16
+
17
+ type Success<T> = {
18
+ data: T;
19
+ error: null;
20
+ statusCode?: number;
21
+ };
22
+ type Failure<E> = {
23
+ data: null;
24
+ error: E;
25
+ statusCode?: number;
26
+ };
27
+ type Result<T, E> = Success<T> | Failure<E>;
28
+
29
+ export { AutumnError as A, type ErrorResponse as E, type Result as R };
@@ -0,0 +1,29 @@
1
+ interface ErrorResponse {
2
+ message: string;
3
+ code: string;
4
+ }
5
+ declare class AutumnError extends Error {
6
+ readonly message: string;
7
+ readonly code: string;
8
+ constructor(response: ErrorResponse);
9
+ static fromError(error: any): AutumnError;
10
+ toString(): string;
11
+ toJSON(): {
12
+ message: string;
13
+ code: string;
14
+ };
15
+ }
16
+
17
+ type Success<T> = {
18
+ data: T;
19
+ error: null;
20
+ statusCode?: number;
21
+ };
22
+ type Failure<E> = {
23
+ data: null;
24
+ error: E;
25
+ statusCode?: number;
26
+ };
27
+ type Result<T, E> = Success<T> | Failure<E>;
28
+
29
+ export { AutumnError as A, type ErrorResponse as E, type Result as R };
@@ -0,0 +1,5 @@
1
+ import { R as Result, A as AutumnError, E as ErrorResponse } from './response-eH4S4sg0.mjs';
2
+
3
+ declare const toServerResponse: <T>(result: Result<T, AutumnError>) => Result<T, ErrorResponse>;
4
+
5
+ export { toServerResponse };
@@ -0,0 +1,5 @@
1
+ import { R as Result, A as AutumnError, E as ErrorResponse } from './response-eH4S4sg0.js';
2
+
3
+ declare const toServerResponse: <T>(result: Result<T, AutumnError>) => Result<T, ErrorResponse>;
4
+
5
+ export { toServerResponse };
@@ -0,0 +1,4 @@
1
+ declare function encryptData(data: string): string;
2
+ declare function decryptData(encryptedData: string): string;
3
+
4
+ export { decryptData, encryptData };
@@ -0,0 +1,4 @@
1
+ declare function encryptData(data: string): string;
2
+ declare function decryptData(encryptedData: string): string;
3
+
4
+ export { decryptData, encryptData };
@@ -0,0 +1,3 @@
1
+ declare const getEntityExpandStr: (expand?: string[]) => string;
2
+
3
+ export { getEntityExpandStr };
@@ -0,0 +1,3 @@
1
+ declare const getEntityExpandStr: (expand?: string[]) => string;
2
+
3
+ export { getEntityExpandStr };
@@ -0,0 +1,45 @@
1
+ import * as util from 'util';
2
+
3
+ declare const logger: {
4
+ level: string;
5
+ debug: (...args: any[]) => void;
6
+ log: (...args: any[]) => void;
7
+ info: (...args: any[]) => void;
8
+ warn: (...args: any[]) => void;
9
+ error: (...args: any[]) => void;
10
+ assert(condition?: boolean, ...data: any[]): void;
11
+ assert(value: any, message?: string, ...optionalParams: any[]): void;
12
+ clear(): void;
13
+ clear(): void;
14
+ count(label?: string): void;
15
+ count(label?: string): void;
16
+ countReset(label?: string): void;
17
+ countReset(label?: string): void;
18
+ dir(item?: any, options?: any): void;
19
+ dir(obj: any, options?: util.InspectOptions): void;
20
+ dirxml(...data: any[]): void;
21
+ dirxml(...data: any[]): void;
22
+ group(...data: any[]): void;
23
+ group(...label: any[]): void;
24
+ groupCollapsed(...data: any[]): void;
25
+ groupCollapsed(...label: any[]): void;
26
+ groupEnd(): void;
27
+ groupEnd(): void;
28
+ table(tabularData?: any, properties?: string[]): void;
29
+ table(tabularData: any, properties?: readonly string[]): void;
30
+ time(label?: string): void;
31
+ time(label?: string): void;
32
+ timeEnd(label?: string): void;
33
+ timeEnd(label?: string): void;
34
+ timeLog(label?: string, ...data: any[]): void;
35
+ timeLog(label?: string, ...data: any[]): void;
36
+ timeStamp(label?: string): void;
37
+ timeStamp(label?: string): void;
38
+ trace(...data: any[]): void;
39
+ trace(message?: any, ...optionalParams: any[]): void;
40
+ Console: console.ConsoleConstructor;
41
+ profile(label?: string): void;
42
+ profileEnd(label?: string): void;
43
+ };
44
+
45
+ export { logger };
@@ -0,0 +1,45 @@
1
+ import * as util from 'util';
2
+
3
+ declare const logger: {
4
+ level: string;
5
+ debug: (...args: any[]) => void;
6
+ log: (...args: any[]) => void;
7
+ info: (...args: any[]) => void;
8
+ warn: (...args: any[]) => void;
9
+ error: (...args: any[]) => void;
10
+ assert(condition?: boolean, ...data: any[]): void;
11
+ assert(value: any, message?: string, ...optionalParams: any[]): void;
12
+ clear(): void;
13
+ clear(): void;
14
+ count(label?: string): void;
15
+ count(label?: string): void;
16
+ countReset(label?: string): void;
17
+ countReset(label?: string): void;
18
+ dir(item?: any, options?: any): void;
19
+ dir(obj: any, options?: util.InspectOptions): void;
20
+ dirxml(...data: any[]): void;
21
+ dirxml(...data: any[]): void;
22
+ group(...data: any[]): void;
23
+ group(...label: any[]): void;
24
+ groupCollapsed(...data: any[]): void;
25
+ groupCollapsed(...label: any[]): void;
26
+ groupEnd(): void;
27
+ groupEnd(): void;
28
+ table(tabularData?: any, properties?: string[]): void;
29
+ table(tabularData: any, properties?: readonly string[]): void;
30
+ time(label?: string): void;
31
+ time(label?: string): void;
32
+ timeEnd(label?: string): void;
33
+ timeEnd(label?: string): void;
34
+ timeLog(label?: string, ...data: any[]): void;
35
+ timeLog(label?: string, ...data: any[]): void;
36
+ timeStamp(label?: string): void;
37
+ timeStamp(label?: string): void;
38
+ trace(...data: any[]): void;
39
+ trace(message?: any, ...optionalParams: any[]): void;
40
+ Console: console.ConsoleConstructor;
41
+ profile(label?: string): void;
42
+ profileEnd(label?: string): void;
43
+ };
44
+
45
+ export { logger };
@@ -0,0 +1,7 @@
1
+ declare const toSnakeCase: <T>({ obj, excludeKeys, excludeChildrenOf, }: {
2
+ obj: T;
3
+ excludeKeys?: string[];
4
+ excludeChildrenOf?: string[];
5
+ }) => T;
6
+
7
+ export { toSnakeCase };
@@ -0,0 +1,7 @@
1
+ declare const toSnakeCase: <T>({ obj, excludeKeys, excludeChildrenOf, }: {
2
+ obj: T;
3
+ excludeKeys?: string[];
4
+ excludeChildrenOf?: string[];
5
+ }) => T;
6
+
7
+ export { toSnakeCase };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "autumn-js",
3
3
  "description": "Autumn JS Library",
4
- "version": "0.1.42",
4
+ "version": "0.1.44",
5
5
  "repository": "github:useautumn/autumn-js",
6
6
  "homepage": "https://docs.useautumn.com",
7
7
  "main": "./dist/sdk/index.js",
@@ -1,37 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
8
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
9
- }) : x)(function(x) {
10
- if (typeof require !== "undefined") return require.apply(this, arguments);
11
- throw Error('Dynamic require of "' + x + '" is not supported');
12
- });
13
- var __commonJS = (cb, mod) => function __require2() {
14
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
15
- };
16
- var __copyProps = (to, from, except, desc) => {
17
- if (from && typeof from === "object" || typeof from === "function") {
18
- for (let key of __getOwnPropNames(from))
19
- if (!__hasOwnProp.call(to, key) && key !== except)
20
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
21
- }
22
- return to;
23
- };
24
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
25
- // If the importer is in node compatibility mode or this is not an ESM
26
- // file that has been converted to a CommonJS file using a Babel-
27
- // compatible transform (i.e. "__esModule" has not been set), then set
28
- // "default" to the CommonJS "module.exports" for node compatibility.
29
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
30
- mod
31
- ));
32
-
33
- export {
34
- __require,
35
- __commonJS,
36
- __toESM
37
- };