@makeco/stripe-kit 0.1.4 → 0.2.0
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/LICENSE.md +1 -1
- package/README.md +47 -35
- package/dist/cli-prompts.d.ts +19 -0
- package/dist/cli-prompts.d.ts.map +1 -0
- package/dist/cli-prompts.js +154 -0
- package/dist/cli-prompts.js.map +1 -0
- package/dist/cli.js +13 -14
- package/dist/cli.js.map +1 -1
- package/dist/commands/archive.d.ts +3 -0
- package/dist/commands/archive.d.ts.map +1 -0
- package/dist/commands/archive.js +119 -0
- package/dist/commands/archive.js.map +1 -0
- package/dist/commands/config.d.ts +3 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/config.js +33 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/create.d.ts +3 -0
- package/dist/commands/create.d.ts.map +1 -0
- package/dist/commands/create.js +113 -0
- package/dist/commands/create.js.map +1 -0
- package/dist/commands/db.d.ts +3 -0
- package/dist/commands/db.d.ts.map +1 -0
- package/dist/commands/db.js +143 -0
- package/dist/commands/db.js.map +1 -0
- package/dist/commands/index.d.ts +7 -7
- package/dist/commands/index.js +7 -7
- package/dist/commands/list.d.ts +3 -0
- package/dist/commands/list.d.ts.map +1 -0
- package/dist/commands/list.js +147 -0
- package/dist/commands/list.js.map +1 -0
- package/dist/commands/update.d.ts +3 -0
- package/dist/commands/update.d.ts.map +1 -0
- package/dist/commands/update.js +141 -0
- package/dist/commands/update.js.map +1 -0
- package/dist/commands/urls.d.ts +3 -0
- package/dist/commands/urls.d.ts.map +1 -0
- package/dist/commands/urls.js +79 -0
- package/dist/commands/urls.js.map +1 -0
- package/dist/definitions/action.constants.js +16 -16
- package/dist/definitions/config.schemas.d.ts +19 -256
- package/dist/definitions/config.schemas.d.ts.map +1 -1
- package/dist/definitions/config.schemas.js +11 -17
- package/dist/definitions/config.schemas.js.map +1 -1
- package/dist/definitions/context.types.d.ts +3 -4
- package/dist/definitions/context.types.d.ts.map +1 -1
- package/dist/definitions/database-adapter.schemas.d.ts +2 -2
- package/dist/definitions/database-adapter.schemas.js +1 -1
- package/dist/definitions/env.constants.js +4 -4
- package/dist/definitions/index.d.ts +6 -8
- package/dist/definitions/index.d.ts.map +1 -1
- package/dist/definitions/index.js +6 -8
- package/dist/definitions/index.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/utils/create-context.d.ts +1 -1
- package/dist/utils/create-context.d.ts.map +1 -1
- package/dist/utils/create-context.js +2 -5
- package/dist/utils/create-context.js.map +1 -1
- package/dist/utils/create-logger.d.ts +1 -1
- package/dist/utils/create-logger.js +13 -13
- package/dist/utils/define-config.d.ts +1 -1
- package/dist/utils/define-config.js +1 -1
- package/dist/utils/find-env-directories.js +14 -14
- package/dist/utils/index.d.ts +10 -11
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +10 -11
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/load-config.d.ts +1 -1
- package/dist/utils/load-config.d.ts.map +1 -1
- package/dist/utils/load-config.js +68 -48
- package/dist/utils/load-config.js.map +1 -1
- package/dist/utils/load-env.d.ts +1 -1
- package/dist/utils/load-env.js +18 -18
- package/dist/utils/stripe-client.d.ts +1 -1
- package/dist/utils/stripe-client.js +3 -3
- package/dist/utils/stripe-repository.d.ts +2 -2
- package/dist/utils/stripe-repository.js +2 -2
- package/dist/utils/user-preferences.d.ts +1 -1
- package/dist/utils/user-preferences.js +7 -7
- package/package.json +9 -4
- package/dist/cli-prompts/action.d.ts +0 -5
- package/dist/cli-prompts/action.d.ts.map +0 -1
- package/dist/cli-prompts/action.js +0 -36
- package/dist/cli-prompts/action.js.map +0 -1
- package/dist/cli-prompts/adapter.d.ts +0 -9
- package/dist/cli-prompts/adapter.d.ts.map +0 -1
- package/dist/cli-prompts/adapter.js +0 -53
- package/dist/cli-prompts/adapter.js.map +0 -1
- package/dist/cli-prompts/confirmation.d.ts +0 -6
- package/dist/cli-prompts/confirmation.d.ts.map +0 -1
- package/dist/cli-prompts/confirmation.js +0 -27
- package/dist/cli-prompts/confirmation.js.map +0 -1
- package/dist/cli-prompts/environment.d.ts +0 -5
- package/dist/cli-prompts/environment.d.ts.map +0 -1
- package/dist/cli-prompts/environment.js +0 -43
- package/dist/cli-prompts/environment.js.map +0 -1
- package/dist/cli-prompts/index.d.ts +0 -5
- package/dist/cli-prompts/index.d.ts.map +0 -1
- package/dist/cli-prompts/index.js +0 -5
- package/dist/cli-prompts/index.js.map +0 -1
- package/dist/commands/archive/archive.action.d.ts +0 -5
- package/dist/commands/archive/archive.action.d.ts.map +0 -1
- package/dist/commands/archive/archive.action.js +0 -73
- package/dist/commands/archive/archive.action.js.map +0 -1
- package/dist/commands/archive/archive.command.d.ts +0 -3
- package/dist/commands/archive/archive.command.d.ts.map +0 -1
- package/dist/commands/archive/archive.command.js +0 -24
- package/dist/commands/archive/archive.command.js.map +0 -1
- package/dist/commands/archive/archive.preflight.d.ts +0 -13
- package/dist/commands/archive/archive.preflight.d.ts.map +0 -1
- package/dist/commands/archive/archive.preflight.js +0 -27
- package/dist/commands/archive/archive.preflight.js.map +0 -1
- package/dist/commands/archive/index.d.ts +0 -2
- package/dist/commands/archive/index.d.ts.map +0 -1
- package/dist/commands/archive/index.js +0 -2
- package/dist/commands/archive/index.js.map +0 -1
- package/dist/commands/config/config.command.d.ts +0 -3
- package/dist/commands/config/config.command.d.ts.map +0 -1
- package/dist/commands/config/config.command.js +0 -33
- package/dist/commands/config/config.command.js.map +0 -1
- package/dist/commands/config/index.d.ts +0 -2
- package/dist/commands/config/index.d.ts.map +0 -1
- package/dist/commands/config/index.js +0 -2
- package/dist/commands/config/index.js.map +0 -1
- package/dist/commands/create/create.action.d.ts +0 -5
- package/dist/commands/create/create.action.d.ts.map +0 -1
- package/dist/commands/create/create.action.js +0 -53
- package/dist/commands/create/create.action.js.map +0 -1
- package/dist/commands/create/create.command.d.ts +0 -3
- package/dist/commands/create/create.command.d.ts.map +0 -1
- package/dist/commands/create/create.command.js +0 -22
- package/dist/commands/create/create.command.js.map +0 -1
- package/dist/commands/create/create.preflight.d.ts +0 -13
- package/dist/commands/create/create.preflight.d.ts.map +0 -1
- package/dist/commands/create/create.preflight.js +0 -24
- package/dist/commands/create/create.preflight.js.map +0 -1
- package/dist/commands/create/index.d.ts +0 -2
- package/dist/commands/create/index.d.ts.map +0 -1
- package/dist/commands/create/index.js +0 -2
- package/dist/commands/create/index.js.map +0 -1
- package/dist/commands/db/db.command.d.ts +0 -3
- package/dist/commands/db/db.command.d.ts.map +0 -1
- package/dist/commands/db/db.command.js +0 -13
- package/dist/commands/db/db.command.js.map +0 -1
- package/dist/commands/db/index.d.ts +0 -4
- package/dist/commands/db/index.d.ts.map +0 -1
- package/dist/commands/db/index.js +0 -4
- package/dist/commands/db/index.js.map +0 -1
- package/dist/commands/db/purge/index.d.ts +0 -2
- package/dist/commands/db/purge/index.d.ts.map +0 -1
- package/dist/commands/db/purge/index.js +0 -2
- package/dist/commands/db/purge/index.js.map +0 -1
- package/dist/commands/db/purge/purge.action.d.ts +0 -3
- package/dist/commands/db/purge/purge.action.d.ts.map +0 -1
- package/dist/commands/db/purge/purge.action.js +0 -17
- package/dist/commands/db/purge/purge.action.js.map +0 -1
- package/dist/commands/db/purge/purge.command.d.ts +0 -3
- package/dist/commands/db/purge/purge.command.d.ts.map +0 -1
- package/dist/commands/db/purge/purge.command.js +0 -23
- package/dist/commands/db/purge/purge.command.js.map +0 -1
- package/dist/commands/db/purge/purge.preflight.d.ts +0 -12
- package/dist/commands/db/purge/purge.preflight.d.ts.map +0 -1
- package/dist/commands/db/purge/purge.preflight.js +0 -27
- package/dist/commands/db/purge/purge.preflight.js.map +0 -1
- package/dist/commands/db/sync/index.d.ts +0 -2
- package/dist/commands/db/sync/index.d.ts.map +0 -1
- package/dist/commands/db/sync/index.js +0 -2
- package/dist/commands/db/sync/index.js.map +0 -1
- package/dist/commands/db/sync/sync.action.d.ts +0 -3
- package/dist/commands/db/sync/sync.action.d.ts.map +0 -1
- package/dist/commands/db/sync/sync.action.js +0 -24
- package/dist/commands/db/sync/sync.action.js.map +0 -1
- package/dist/commands/db/sync/sync.command.d.ts +0 -3
- package/dist/commands/db/sync/sync.command.d.ts.map +0 -1
- package/dist/commands/db/sync/sync.command.js +0 -23
- package/dist/commands/db/sync/sync.command.js.map +0 -1
- package/dist/commands/db/sync/sync.preflight.d.ts +0 -12
- package/dist/commands/db/sync/sync.preflight.d.ts.map +0 -1
- package/dist/commands/db/sync/sync.preflight.js +0 -33
- package/dist/commands/db/sync/sync.preflight.js.map +0 -1
- package/dist/commands/list/index.d.ts +0 -4
- package/dist/commands/list/index.d.ts.map +0 -1
- package/dist/commands/list/index.js +0 -4
- package/dist/commands/list/index.js.map +0 -1
- package/dist/commands/list/list.command.d.ts +0 -3
- package/dist/commands/list/list.command.d.ts.map +0 -1
- package/dist/commands/list/list.command.js +0 -13
- package/dist/commands/list/list.command.js.map +0 -1
- package/dist/commands/list/prices/index.d.ts +0 -2
- package/dist/commands/list/prices/index.d.ts.map +0 -1
- package/dist/commands/list/prices/index.js +0 -2
- package/dist/commands/list/prices/index.js.map +0 -1
- package/dist/commands/list/prices/prices.action.d.ts +0 -5
- package/dist/commands/list/prices/prices.action.d.ts.map +0 -1
- package/dist/commands/list/prices/prices.action.js +0 -40
- package/dist/commands/list/prices/prices.action.js.map +0 -1
- package/dist/commands/list/prices/prices.command.d.ts +0 -3
- package/dist/commands/list/prices/prices.command.d.ts.map +0 -1
- package/dist/commands/list/prices/prices.command.js +0 -22
- package/dist/commands/list/prices/prices.command.js.map +0 -1
- package/dist/commands/list/prices/prices.preflight.d.ts +0 -13
- package/dist/commands/list/prices/prices.preflight.d.ts.map +0 -1
- package/dist/commands/list/prices/prices.preflight.js +0 -19
- package/dist/commands/list/prices/prices.preflight.js.map +0 -1
- package/dist/commands/list/products/index.d.ts +0 -2
- package/dist/commands/list/products/index.d.ts.map +0 -1
- package/dist/commands/list/products/index.js +0 -2
- package/dist/commands/list/products/index.js.map +0 -1
- package/dist/commands/list/products/products.action.d.ts +0 -5
- package/dist/commands/list/products/products.action.d.ts.map +0 -1
- package/dist/commands/list/products/products.action.js +0 -32
- package/dist/commands/list/products/products.action.js.map +0 -1
- package/dist/commands/list/products/products.command.d.ts +0 -3
- package/dist/commands/list/products/products.command.d.ts.map +0 -1
- package/dist/commands/list/products/products.command.js +0 -22
- package/dist/commands/list/products/products.command.js.map +0 -1
- package/dist/commands/list/products/products.preflight.d.ts +0 -13
- package/dist/commands/list/products/products.preflight.d.ts.map +0 -1
- package/dist/commands/list/products/products.preflight.js +0 -19
- package/dist/commands/list/products/products.preflight.js.map +0 -1
- package/dist/commands/update/index.d.ts +0 -2
- package/dist/commands/update/index.d.ts.map +0 -1
- package/dist/commands/update/index.js +0 -2
- package/dist/commands/update/index.js.map +0 -1
- package/dist/commands/update/update.action.d.ts +0 -3
- package/dist/commands/update/update.action.d.ts.map +0 -1
- package/dist/commands/update/update.action.js +0 -84
- package/dist/commands/update/update.action.js.map +0 -1
- package/dist/commands/update/update.command.d.ts +0 -3
- package/dist/commands/update/update.command.d.ts.map +0 -1
- package/dist/commands/update/update.command.js +0 -22
- package/dist/commands/update/update.command.js.map +0 -1
- package/dist/commands/update/update.preflight.d.ts +0 -12
- package/dist/commands/update/update.preflight.d.ts.map +0 -1
- package/dist/commands/update/update.preflight.js +0 -36
- package/dist/commands/update/update.preflight.js.map +0 -1
- package/dist/commands/urls/index.d.ts +0 -2
- package/dist/commands/urls/index.d.ts.map +0 -1
- package/dist/commands/urls/index.js +0 -2
- package/dist/commands/urls/index.js.map +0 -1
- package/dist/commands/urls/urls.action.d.ts +0 -4
- package/dist/commands/urls/urls.action.d.ts.map +0 -1
- package/dist/commands/urls/urls.action.js +0 -65
- package/dist/commands/urls/urls.action.js.map +0 -1
- package/dist/commands/urls/urls.command.d.ts +0 -6
- package/dist/commands/urls/urls.command.d.ts.map +0 -1
- package/dist/commands/urls/urls.command.js +0 -19
- package/dist/commands/urls/urls.command.js.map +0 -1
- package/dist/definitions/stripe-price.schemas.d.ts +0 -132
- package/dist/definitions/stripe-price.schemas.d.ts.map +0 -1
- package/dist/definitions/stripe-price.schemas.js +0 -50
- package/dist/definitions/stripe-price.schemas.js.map +0 -1
- package/dist/definitions/stripe-product.schemas.d.ts +0 -87
- package/dist/definitions/stripe-product.schemas.d.ts.map +0 -1
- package/dist/definitions/stripe-product.schemas.js +0 -42
- package/dist/definitions/stripe-product.schemas.js.map +0 -1
- package/dist/utils/create-mappers.d.ts +0 -3
- package/dist/utils/create-mappers.d.ts.map +0 -1
- package/dist/utils/create-mappers.js +0 -98
- package/dist/utils/create-mappers.js.map +0 -1
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
export const ACTIONS = {
|
|
2
|
-
CREATE:
|
|
3
|
-
ARCHIVE:
|
|
4
|
-
SYNC:
|
|
5
|
-
UPDATE:
|
|
6
|
-
CLEAR_DB_PLANS:
|
|
7
|
-
URL:
|
|
8
|
-
LIST_PRODUCTS:
|
|
9
|
-
LIST_PRICES:
|
|
2
|
+
CREATE: "create",
|
|
3
|
+
ARCHIVE: "archive",
|
|
4
|
+
SYNC: "sync",
|
|
5
|
+
UPDATE: "update",
|
|
6
|
+
CLEAR_DB_PLANS: "clear-db-plans",
|
|
7
|
+
URL: "url",
|
|
8
|
+
LIST_PRODUCTS: "list-products",
|
|
9
|
+
LIST_PRICES: "list-prices",
|
|
10
10
|
};
|
|
11
11
|
export const VALID_ACTIONS = Object.values(ACTIONS);
|
|
12
12
|
export const ACTION_DESCRIPTIONS = {
|
|
13
|
-
[ACTIONS.CREATE]:
|
|
14
|
-
[ACTIONS.ARCHIVE]:
|
|
15
|
-
[ACTIONS.SYNC]:
|
|
16
|
-
[ACTIONS.UPDATE]:
|
|
17
|
-
[ACTIONS.CLEAR_DB_PLANS]:
|
|
18
|
-
[ACTIONS.URL]:
|
|
19
|
-
[ACTIONS.LIST_PRODUCTS]:
|
|
20
|
-
[ACTIONS.LIST_PRICES]:
|
|
13
|
+
[ACTIONS.CREATE]: "[create]: Create Stripe subscription plans (Idempotent)",
|
|
14
|
+
[ACTIONS.ARCHIVE]: "[archive]: Archive Stripe subscription plans",
|
|
15
|
+
[ACTIONS.SYNC]: "[sync]: Sync Stripe subscription plans to database",
|
|
16
|
+
[ACTIONS.UPDATE]: "[update]: Update Stripe subscription plans",
|
|
17
|
+
[ACTIONS.CLEAR_DB_PLANS]: "[clear-db-plans]: Delete subscription plans from database",
|
|
18
|
+
[ACTIONS.URL]: "[url]: Show Stripe dashboard URL",
|
|
19
|
+
[ACTIONS.LIST_PRODUCTS]: "[list-products]: List Stripe products",
|
|
20
|
+
[ACTIONS.LIST_PRICES]: "[list-prices]: List Stripe prices",
|
|
21
21
|
};
|
|
22
22
|
//# sourceMappingURL=action.constants.js.map
|
|
@@ -1,264 +1,22 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import type {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
currency: z.ZodString;
|
|
12
|
-
unitAmount: z.ZodOptional<z.ZodNumber>;
|
|
13
|
-
unitAmountDecimal: z.ZodOptional<z.ZodString>;
|
|
14
|
-
recurring: z.ZodOptional<z.ZodObject<{
|
|
15
|
-
interval: z.ZodEnum<{
|
|
16
|
-
day: "day";
|
|
17
|
-
month: "month";
|
|
18
|
-
week: "week";
|
|
19
|
-
year: "year";
|
|
20
|
-
}>;
|
|
21
|
-
intervalCount: z.ZodOptional<z.ZodNumber>;
|
|
22
|
-
}, z.core.$strip>>;
|
|
23
|
-
taxBehavior: z.ZodOptional<z.ZodEnum<{
|
|
24
|
-
inclusive: "inclusive";
|
|
25
|
-
exclusive: "exclusive";
|
|
26
|
-
unspecified: "unspecified";
|
|
27
|
-
}>>;
|
|
28
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
29
|
-
}, z.core.$strip>>;
|
|
30
|
-
images: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
31
|
-
marketingFeatures: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
32
|
-
name: z.ZodString;
|
|
33
|
-
}, z.core.$strip>>>;
|
|
34
|
-
url: z.ZodOptional<z.ZodString>;
|
|
35
|
-
type: z.ZodDefault<z.ZodEnum<{
|
|
36
|
-
good: "good";
|
|
37
|
-
service: "service";
|
|
38
|
-
}>>;
|
|
39
|
-
shippable: z.ZodOptional<z.ZodBoolean>;
|
|
40
|
-
packageDimensions: z.ZodOptional<z.ZodObject<{
|
|
41
|
-
height: z.ZodNumber;
|
|
42
|
-
length: z.ZodNumber;
|
|
43
|
-
weight: z.ZodNumber;
|
|
44
|
-
width: z.ZodNumber;
|
|
45
|
-
}, z.core.$strip>>;
|
|
46
|
-
statementDescriptor: z.ZodOptional<z.ZodString>;
|
|
47
|
-
taxCode: z.ZodOptional<z.ZodString>;
|
|
48
|
-
unitLabel: z.ZodOptional<z.ZodString>;
|
|
49
|
-
features: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
50
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
51
|
-
}, z.core.$strip>;
|
|
52
|
-
prices: z.ZodArray<z.ZodObject<{
|
|
53
|
-
id: z.ZodString;
|
|
54
|
-
currency: z.ZodString;
|
|
55
|
-
unitAmount: z.ZodOptional<z.ZodNumber>;
|
|
56
|
-
unitAmountDecimal: z.ZodOptional<z.ZodString>;
|
|
57
|
-
type: z.ZodDefault<z.ZodEnum<{
|
|
58
|
-
one_time: "one_time";
|
|
59
|
-
recurring: "recurring";
|
|
60
|
-
}>>;
|
|
61
|
-
billingScheme: z.ZodDefault<z.ZodEnum<{
|
|
62
|
-
per_unit: "per_unit";
|
|
63
|
-
tiered: "tiered";
|
|
64
|
-
}>>;
|
|
65
|
-
recurring: z.ZodOptional<z.ZodObject<{
|
|
66
|
-
interval: z.ZodEnum<{
|
|
67
|
-
day: "day";
|
|
68
|
-
month: "month";
|
|
69
|
-
week: "week";
|
|
70
|
-
year: "year";
|
|
71
|
-
}>;
|
|
72
|
-
intervalCount: z.ZodDefault<z.ZodNumber>;
|
|
73
|
-
trialPeriodDays: z.ZodOptional<z.ZodNumber>;
|
|
74
|
-
usageType: z.ZodDefault<z.ZodEnum<{
|
|
75
|
-
licensed: "licensed";
|
|
76
|
-
metered: "metered";
|
|
77
|
-
}>>;
|
|
78
|
-
meter: z.ZodOptional<z.ZodString>;
|
|
79
|
-
}, z.core.$strip>>;
|
|
80
|
-
tiers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
81
|
-
flatAmount: z.ZodOptional<z.ZodNumber>;
|
|
82
|
-
flatAmountDecimal: z.ZodOptional<z.ZodString>;
|
|
83
|
-
unitAmount: z.ZodOptional<z.ZodNumber>;
|
|
84
|
-
unitAmountDecimal: z.ZodOptional<z.ZodString>;
|
|
85
|
-
upTo: z.ZodUnion<readonly [z.ZodLiteral<"inf">, z.ZodNumber]>;
|
|
86
|
-
}, z.core.$strip>>>;
|
|
87
|
-
tiersMode: z.ZodOptional<z.ZodEnum<{
|
|
88
|
-
graduated: "graduated";
|
|
89
|
-
volume: "volume";
|
|
90
|
-
}>>;
|
|
91
|
-
transformQuantity: z.ZodOptional<z.ZodObject<{
|
|
92
|
-
divideBy: z.ZodNumber;
|
|
93
|
-
round: z.ZodEnum<{
|
|
94
|
-
down: "down";
|
|
95
|
-
up: "up";
|
|
96
|
-
}>;
|
|
97
|
-
}, z.core.$strip>>;
|
|
98
|
-
currencyOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
99
|
-
unitAmount: z.ZodOptional<z.ZodNumber>;
|
|
100
|
-
unitAmountDecimal: z.ZodOptional<z.ZodString>;
|
|
101
|
-
taxBehavior: z.ZodOptional<z.ZodEnum<{
|
|
102
|
-
inclusive: "inclusive";
|
|
103
|
-
exclusive: "exclusive";
|
|
104
|
-
unspecified: "unspecified";
|
|
105
|
-
}>>;
|
|
106
|
-
}, z.core.$strip>>>;
|
|
107
|
-
customUnitAmount: z.ZodOptional<z.ZodObject<{
|
|
108
|
-
enabled: z.ZodBoolean;
|
|
109
|
-
maximum: z.ZodOptional<z.ZodNumber>;
|
|
110
|
-
minimum: z.ZodOptional<z.ZodNumber>;
|
|
111
|
-
preset: z.ZodOptional<z.ZodNumber>;
|
|
112
|
-
}, z.core.$strip>>;
|
|
113
|
-
taxBehavior: z.ZodOptional<z.ZodEnum<{
|
|
114
|
-
inclusive: "inclusive";
|
|
115
|
-
exclusive: "exclusive";
|
|
116
|
-
unspecified: "unspecified";
|
|
117
|
-
}>>;
|
|
118
|
-
nickname: z.ZodOptional<z.ZodString>;
|
|
119
|
-
lookupKey: z.ZodOptional<z.ZodString>;
|
|
120
|
-
active: z.ZodDefault<z.ZodBoolean>;
|
|
121
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
122
|
-
}, z.core.$strip>>;
|
|
123
|
-
}, z.core.$strip>;
|
|
124
|
-
export type SubscriptionPlan = z.infer<typeof subscriptionPlanSchema>;
|
|
125
|
-
export interface StripePriceContext {
|
|
126
|
-
stripeProductId: string;
|
|
127
|
-
internalProductId: string;
|
|
128
|
-
planName: string;
|
|
129
|
-
tier: string;
|
|
130
|
-
}
|
|
131
|
-
export interface StripeMappers {
|
|
132
|
-
mapSubscriptionPlanToStripeProduct: (plan: SubscriptionPlan) => import('stripe').Stripe.ProductCreateParams;
|
|
133
|
-
mapSubscriptionPlanToStripePrice: (price: import('./stripe-price.schemas.js').StripePrice, context: StripePriceContext) => import('stripe').Stripe.PriceCreateParams;
|
|
1
|
+
import type Stripe from "stripe";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import type { DatabaseAdapter } from "./database-adapter.schemas.js";
|
|
4
|
+
import type { Prettify } from "./utility.types.js";
|
|
5
|
+
export interface SubscriptionPlan {
|
|
6
|
+
id: string;
|
|
7
|
+
product: Stripe.ProductCreateParams;
|
|
8
|
+
prices: Array<{
|
|
9
|
+
id: string;
|
|
10
|
+
} & Omit<Stripe.PriceCreateParams, "product">>;
|
|
134
11
|
}
|
|
135
12
|
export declare const configSchema: z.ZodObject<{
|
|
136
|
-
plans: z.ZodArray<z.
|
|
137
|
-
product: z.ZodObject<{
|
|
138
|
-
id: z.ZodString;
|
|
139
|
-
name: z.ZodString;
|
|
140
|
-
active: z.ZodDefault<z.ZodBoolean>;
|
|
141
|
-
description: z.ZodOptional<z.ZodString>;
|
|
142
|
-
defaultPriceData: z.ZodOptional<z.ZodObject<{
|
|
143
|
-
currency: z.ZodString;
|
|
144
|
-
unitAmount: z.ZodOptional<z.ZodNumber>;
|
|
145
|
-
unitAmountDecimal: z.ZodOptional<z.ZodString>;
|
|
146
|
-
recurring: z.ZodOptional<z.ZodObject<{
|
|
147
|
-
interval: z.ZodEnum<{
|
|
148
|
-
day: "day";
|
|
149
|
-
month: "month";
|
|
150
|
-
week: "week";
|
|
151
|
-
year: "year";
|
|
152
|
-
}>;
|
|
153
|
-
intervalCount: z.ZodOptional<z.ZodNumber>;
|
|
154
|
-
}, z.core.$strip>>;
|
|
155
|
-
taxBehavior: z.ZodOptional<z.ZodEnum<{
|
|
156
|
-
inclusive: "inclusive";
|
|
157
|
-
exclusive: "exclusive";
|
|
158
|
-
unspecified: "unspecified";
|
|
159
|
-
}>>;
|
|
160
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
161
|
-
}, z.core.$strip>>;
|
|
162
|
-
images: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
163
|
-
marketingFeatures: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
164
|
-
name: z.ZodString;
|
|
165
|
-
}, z.core.$strip>>>;
|
|
166
|
-
url: z.ZodOptional<z.ZodString>;
|
|
167
|
-
type: z.ZodDefault<z.ZodEnum<{
|
|
168
|
-
good: "good";
|
|
169
|
-
service: "service";
|
|
170
|
-
}>>;
|
|
171
|
-
shippable: z.ZodOptional<z.ZodBoolean>;
|
|
172
|
-
packageDimensions: z.ZodOptional<z.ZodObject<{
|
|
173
|
-
height: z.ZodNumber;
|
|
174
|
-
length: z.ZodNumber;
|
|
175
|
-
weight: z.ZodNumber;
|
|
176
|
-
width: z.ZodNumber;
|
|
177
|
-
}, z.core.$strip>>;
|
|
178
|
-
statementDescriptor: z.ZodOptional<z.ZodString>;
|
|
179
|
-
taxCode: z.ZodOptional<z.ZodString>;
|
|
180
|
-
unitLabel: z.ZodOptional<z.ZodString>;
|
|
181
|
-
features: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
182
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
183
|
-
}, z.core.$strip>;
|
|
184
|
-
prices: z.ZodArray<z.ZodObject<{
|
|
185
|
-
id: z.ZodString;
|
|
186
|
-
currency: z.ZodString;
|
|
187
|
-
unitAmount: z.ZodOptional<z.ZodNumber>;
|
|
188
|
-
unitAmountDecimal: z.ZodOptional<z.ZodString>;
|
|
189
|
-
type: z.ZodDefault<z.ZodEnum<{
|
|
190
|
-
one_time: "one_time";
|
|
191
|
-
recurring: "recurring";
|
|
192
|
-
}>>;
|
|
193
|
-
billingScheme: z.ZodDefault<z.ZodEnum<{
|
|
194
|
-
per_unit: "per_unit";
|
|
195
|
-
tiered: "tiered";
|
|
196
|
-
}>>;
|
|
197
|
-
recurring: z.ZodOptional<z.ZodObject<{
|
|
198
|
-
interval: z.ZodEnum<{
|
|
199
|
-
day: "day";
|
|
200
|
-
month: "month";
|
|
201
|
-
week: "week";
|
|
202
|
-
year: "year";
|
|
203
|
-
}>;
|
|
204
|
-
intervalCount: z.ZodDefault<z.ZodNumber>;
|
|
205
|
-
trialPeriodDays: z.ZodOptional<z.ZodNumber>;
|
|
206
|
-
usageType: z.ZodDefault<z.ZodEnum<{
|
|
207
|
-
licensed: "licensed";
|
|
208
|
-
metered: "metered";
|
|
209
|
-
}>>;
|
|
210
|
-
meter: z.ZodOptional<z.ZodString>;
|
|
211
|
-
}, z.core.$strip>>;
|
|
212
|
-
tiers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
213
|
-
flatAmount: z.ZodOptional<z.ZodNumber>;
|
|
214
|
-
flatAmountDecimal: z.ZodOptional<z.ZodString>;
|
|
215
|
-
unitAmount: z.ZodOptional<z.ZodNumber>;
|
|
216
|
-
unitAmountDecimal: z.ZodOptional<z.ZodString>;
|
|
217
|
-
upTo: z.ZodUnion<readonly [z.ZodLiteral<"inf">, z.ZodNumber]>;
|
|
218
|
-
}, z.core.$strip>>>;
|
|
219
|
-
tiersMode: z.ZodOptional<z.ZodEnum<{
|
|
220
|
-
graduated: "graduated";
|
|
221
|
-
volume: "volume";
|
|
222
|
-
}>>;
|
|
223
|
-
transformQuantity: z.ZodOptional<z.ZodObject<{
|
|
224
|
-
divideBy: z.ZodNumber;
|
|
225
|
-
round: z.ZodEnum<{
|
|
226
|
-
down: "down";
|
|
227
|
-
up: "up";
|
|
228
|
-
}>;
|
|
229
|
-
}, z.core.$strip>>;
|
|
230
|
-
currencyOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
231
|
-
unitAmount: z.ZodOptional<z.ZodNumber>;
|
|
232
|
-
unitAmountDecimal: z.ZodOptional<z.ZodString>;
|
|
233
|
-
taxBehavior: z.ZodOptional<z.ZodEnum<{
|
|
234
|
-
inclusive: "inclusive";
|
|
235
|
-
exclusive: "exclusive";
|
|
236
|
-
unspecified: "unspecified";
|
|
237
|
-
}>>;
|
|
238
|
-
}, z.core.$strip>>>;
|
|
239
|
-
customUnitAmount: z.ZodOptional<z.ZodObject<{
|
|
240
|
-
enabled: z.ZodBoolean;
|
|
241
|
-
maximum: z.ZodOptional<z.ZodNumber>;
|
|
242
|
-
minimum: z.ZodOptional<z.ZodNumber>;
|
|
243
|
-
preset: z.ZodOptional<z.ZodNumber>;
|
|
244
|
-
}, z.core.$strip>>;
|
|
245
|
-
taxBehavior: z.ZodOptional<z.ZodEnum<{
|
|
246
|
-
inclusive: "inclusive";
|
|
247
|
-
exclusive: "exclusive";
|
|
248
|
-
unspecified: "unspecified";
|
|
249
|
-
}>>;
|
|
250
|
-
nickname: z.ZodOptional<z.ZodString>;
|
|
251
|
-
lookupKey: z.ZodOptional<z.ZodString>;
|
|
252
|
-
active: z.ZodDefault<z.ZodBoolean>;
|
|
253
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
254
|
-
}, z.core.$strip>>;
|
|
255
|
-
}, z.core.$strip>>;
|
|
13
|
+
plans: z.ZodArray<z.ZodAny>;
|
|
256
14
|
env: z.ZodObject<{
|
|
257
15
|
stripeSecretKey: z.ZodString;
|
|
258
16
|
}, z.core.$strip>;
|
|
259
17
|
adapters: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
260
|
-
syncProducts: z.ZodPipe<z.ZodAny, z.ZodTransform<(products:
|
|
261
|
-
syncPrices: z.ZodPipe<z.ZodAny, z.ZodTransform<(prices:
|
|
18
|
+
syncProducts: z.ZodPipe<z.ZodAny, z.ZodTransform<(products: Stripe.Product[]) => Promise<void>, any>>;
|
|
19
|
+
syncPrices: z.ZodPipe<z.ZodAny, z.ZodTransform<(prices: Stripe.Price[]) => Promise<void>, any>>;
|
|
262
20
|
clearProducts: z.ZodPipe<z.ZodAny, z.ZodTransform<() => Promise<void>, any>>;
|
|
263
21
|
clearPrices: z.ZodPipe<z.ZodAny, z.ZodTransform<() => Promise<void>, any>>;
|
|
264
22
|
getProducts: z.ZodOptional<z.ZodPipe<z.ZodAny, z.ZodTransform<(() => Promise<unknown[]>) | undefined, any>>>;
|
|
@@ -272,7 +30,12 @@ export declare const configSchema: z.ZodObject<{
|
|
|
272
30
|
managedByValue: z.ZodDefault<z.ZodString>;
|
|
273
31
|
}, z.core.$strip>>;
|
|
274
32
|
}, z.core.$strip>;
|
|
275
|
-
export type Config = Prettify<Omit<z.infer<typeof configSchema>,
|
|
33
|
+
export type Config = Prettify<Omit<z.infer<typeof configSchema>, "adapters" | "plans"> & {
|
|
34
|
+
adapters: Record<string, DatabaseAdapter>;
|
|
35
|
+
plans: SubscriptionPlan[];
|
|
36
|
+
}>;
|
|
37
|
+
export type ConfigInput = Prettify<Omit<z.input<typeof configSchema>, "adapters" | "plans"> & {
|
|
276
38
|
adapters: Record<string, DatabaseAdapter>;
|
|
39
|
+
plans: SubscriptionPlan[];
|
|
277
40
|
}>;
|
|
278
41
|
//# sourceMappingURL=config.schemas.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.schemas.d.ts","sourceRoot":"","sources":["../../src/definitions/config.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"config.schemas.d.ts","sourceRoot":"","sources":["../../src/definitions/config.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AACjC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAGlE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAahD,MAAM,WAAW,gBAAgB;IAK/B,EAAE,EAAE,MAAM,CAAC;IAMX,OAAO,EAAE,MAAM,CAAC,mBAAmB,CAAC;IASpC,MAAM,EAAE,KAAK,CACX;QAEE,EAAE,EAAE,MAAM,CAAC;KACZ,GAAG,IAAI,CAAC,MAAM,CAAC,iBAAiB,EAAE,SAAS,CAAC,CAC9C,CAAC;CACH;AAMD,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;iBAqBvB,CAAC;AAEH,MAAM,MAAM,MAAM,GAAG,QAAQ,CAC3B,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,GAAG;IACzD,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IAC1C,KAAK,EAAE,gBAAgB,EAAE,CAAC;CAC3B,CACF,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,QAAQ,CAChC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,GAAG;IACzD,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IAC1C,KAAK,EAAE,gBAAgB,EAAE,CAAC;CAC3B,CACF,CAAC"}
|
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
import { z } from
|
|
2
|
-
import { databaseAdapterSchema } from
|
|
3
|
-
import { stripePriceSchema } from './stripe-price.schemas.js';
|
|
4
|
-
import { stripeProductSchema } from './stripe-product.schemas.js';
|
|
5
|
-
export const subscriptionPlanSchema = z.object({
|
|
6
|
-
product: stripeProductSchema,
|
|
7
|
-
prices: z.array(stripePriceSchema).min(1),
|
|
8
|
-
});
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { databaseAdapterSchema } from "./database-adapter.schemas.js";
|
|
9
3
|
export const configSchema = z.object({
|
|
10
|
-
plans: z.array(
|
|
4
|
+
plans: z.array(z.any()),
|
|
11
5
|
env: z.object({
|
|
12
6
|
stripeSecretKey: z.string(),
|
|
13
7
|
}),
|
|
@@ -15,16 +9,16 @@ export const configSchema = z.object({
|
|
|
15
9
|
productIds: z.record(z.string(), z.string()).optional(),
|
|
16
10
|
metadata: z
|
|
17
11
|
.object({
|
|
18
|
-
productIdField: z.string().default(
|
|
19
|
-
priceIdField: z.string().default(
|
|
20
|
-
managedByField: z.string().default(
|
|
21
|
-
managedByValue: z.string().default(
|
|
12
|
+
productIdField: z.string().default("internal_product_id"),
|
|
13
|
+
priceIdField: z.string().default("internal_price_id"),
|
|
14
|
+
managedByField: z.string().default("managed_by"),
|
|
15
|
+
managedByValue: z.string().default("@makeco/stripe-kit"),
|
|
22
16
|
})
|
|
23
17
|
.default({
|
|
24
|
-
productIdField:
|
|
25
|
-
priceIdField:
|
|
26
|
-
managedByField:
|
|
27
|
-
managedByValue:
|
|
18
|
+
productIdField: "internal_product_id",
|
|
19
|
+
priceIdField: "internal_price_id",
|
|
20
|
+
managedByField: "managed_by",
|
|
21
|
+
managedByValue: "@makeco/stripe-kit",
|
|
28
22
|
}),
|
|
29
23
|
});
|
|
30
24
|
//# sourceMappingURL=config.schemas.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.schemas.js","sourceRoot":"","sources":["../../src/definitions/config.schemas.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"config.schemas.js","sourceRoot":"","sources":["../../src/definitions/config.schemas.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AA+CnE,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC;IAEnC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;IACvB,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC;QACZ,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE;KAC5B,CAAC;IACF,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,qBAAqB,CAAC;IACrD,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IACvD,QAAQ,EAAE,CAAC;SACR,MAAM,CAAC;QACN,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,qBAAqB,CAAC;QACzD,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,mBAAmB,CAAC;QACrD,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,YAAY,CAAC;QAChD,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,oBAAoB,CAAC;KACzD,CAAC;SACD,OAAO,CAAC;QACP,cAAc,EAAE,qBAAqB;QACrC,YAAY,EAAE,mBAAmB;QACjC,cAAc,EAAE,YAAY;QAC5B,cAAc,EAAE,oBAAoB;KACrC,CAAC;CACL,CAAC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type Stripe from
|
|
2
|
-
import type { Config
|
|
3
|
-
import type { DatabaseAdapter } from
|
|
1
|
+
import type Stripe from "stripe";
|
|
2
|
+
import type { Config } from "./config.schemas.js";
|
|
3
|
+
import type { DatabaseAdapter } from "./database-adapter.schemas.js";
|
|
4
4
|
export interface Logger {
|
|
5
5
|
info(message: string | object, ...args: unknown[]): void;
|
|
6
6
|
error(message: string | object, ...args: unknown[]): void;
|
|
@@ -10,7 +10,6 @@ export interface Logger {
|
|
|
10
10
|
export interface Context {
|
|
11
11
|
logger: Logger;
|
|
12
12
|
env: Record<string, string | undefined>;
|
|
13
|
-
mappers: StripeMappers;
|
|
14
13
|
adapter: DatabaseAdapter;
|
|
15
14
|
stripeClient: Stripe;
|
|
16
15
|
config: Config;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.types.d.ts","sourceRoot":"","sources":["../../src/definitions/context.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AAEjC,OAAO,KAAK,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"context.types.d.ts","sourceRoot":"","sources":["../../src/definitions/context.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AAEjC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAMlE,MAAM,WAAW,MAAM;IACrB,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IACzD,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IAC1D,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IACzD,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;CAC3D;AAED,MAAM,WAAW,OAAO;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;IACxC,OAAO,EAAE,eAAe,CAAC;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type Stripe from
|
|
2
|
-
import { z } from
|
|
1
|
+
import type Stripe from "stripe";
|
|
2
|
+
import { z } from "zod";
|
|
3
3
|
export interface DatabaseAdapter {
|
|
4
4
|
syncProducts(products: Stripe.Product[]): Promise<void>;
|
|
5
5
|
syncPrices(prices: Stripe.Price[]): Promise<void>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export const ENVIRONMENTS = {
|
|
2
|
-
TEST:
|
|
3
|
-
DEV:
|
|
4
|
-
STAGING:
|
|
5
|
-
PROD:
|
|
2
|
+
TEST: "test",
|
|
3
|
+
DEV: "dev",
|
|
4
|
+
STAGING: "staging",
|
|
5
|
+
PROD: "prod",
|
|
6
6
|
};
|
|
7
7
|
export const VALID_ENVIRONMENTS = Object.values(ENVIRONMENTS);
|
|
8
8
|
export const ENV_CHOICES = VALID_ENVIRONMENTS;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
7
|
-
export * from './stripe-product.schemas.js';
|
|
8
|
-
export * from './utility.types.js';
|
|
1
|
+
export * from "./action.constants.js";
|
|
2
|
+
export * from "./config.schemas.js";
|
|
3
|
+
export * from "./context.types.js";
|
|
4
|
+
export * from "./database-adapter.schemas.js";
|
|
5
|
+
export * from "./env.constants.js";
|
|
6
|
+
export * from "./utility.types.js";
|
|
9
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/definitions/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/definitions/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC"}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
7
|
-
export * from './stripe-product.schemas.js';
|
|
8
|
-
export * from './utility.types.js';
|
|
1
|
+
export * from "./action.constants.js";
|
|
2
|
+
export * from "./config.schemas.js";
|
|
3
|
+
export * from "./context.types.js";
|
|
4
|
+
export * from "./database-adapter.schemas.js";
|
|
5
|
+
export * from "./env.constants.js";
|
|
6
|
+
export * from "./utility.types.js";
|
|
9
7
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/definitions/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/definitions/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export { defineConfig } from
|
|
1
|
+
export * from "./definitions/index.js";
|
|
2
|
+
export { defineConfig } from "./utils/define-config.js";
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export { defineConfig } from
|
|
1
|
+
export * from "./definitions/index.js";
|
|
2
|
+
export { defineConfig } from "./utils/define-config.js";
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-context.d.ts","sourceRoot":"","sources":["../../src/utils/create-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"create-context.d.ts","sourceRoot":"","sources":["../../src/utils/create-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAOtE,wBAAgB,aAAa,CAAC,KAAK,EAAE;IACnC,OAAO,EAAE,eAAe,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;CAChB,GAAG,OAAO,CAkBV"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { createLogger } from
|
|
2
|
-
import {
|
|
3
|
-
import { createStripeClient } from './stripe-client.js';
|
|
1
|
+
import { createLogger } from "./create-logger.js";
|
|
2
|
+
import { createStripeClient } from "./stripe-client.js";
|
|
4
3
|
export function createContext(input) {
|
|
5
4
|
const { adapter, config } = input;
|
|
6
5
|
const logger = createLogger();
|
|
@@ -8,11 +7,9 @@ export function createContext(input) {
|
|
|
8
7
|
const stripeClient = createStripeClient({
|
|
9
8
|
STRIPE_SECRET_KEY: stripeSecretKey,
|
|
10
9
|
});
|
|
11
|
-
const mappers = createMappers(config);
|
|
12
10
|
return {
|
|
13
11
|
logger,
|
|
14
12
|
stripeClient,
|
|
15
|
-
mappers,
|
|
16
13
|
adapter,
|
|
17
14
|
env: process.env,
|
|
18
15
|
config,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-context.js","sourceRoot":"","sources":["../../src/utils/create-context.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"create-context.js","sourceRoot":"","sources":["../../src/utils/create-context.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAKrD,MAAM,UAAU,aAAa,CAAC,KAG7B;IACC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IAElC,MAAM,MAAM,GAAG,YAAY,EAAE,CAAC;IAE9B,MAAM,eAAe,GAAG,MAAM,CAAC,GAAG,CAAC,eAAe,CAAC;IAEnD,MAAM,YAAY,GAAG,kBAAkB,CAAC;QACtC,iBAAiB,EAAE,eAAe;KACnC,CAAC,CAAC;IAEH,OAAO;QACL,MAAM;QACN,YAAY;QACZ,OAAO;QACP,GAAG,EAAE,OAAO,CAAC,GAAG;QAChB,MAAM;KACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import chalk from
|
|
1
|
+
import chalk from "chalk";
|
|
2
2
|
export function createLogger() {
|
|
3
3
|
return {
|
|
4
4
|
info(message, ...args) {
|
|
5
|
-
if (typeof message ===
|
|
6
|
-
console.log(chalk.blue(
|
|
5
|
+
if (typeof message === "object") {
|
|
6
|
+
console.log(chalk.blue("[INFO]"), message, ...args);
|
|
7
7
|
}
|
|
8
8
|
else {
|
|
9
|
-
console.log(chalk.blue(
|
|
9
|
+
console.log(chalk.blue("[INFO]"), message, ...args);
|
|
10
10
|
}
|
|
11
11
|
},
|
|
12
12
|
error(message, ...args) {
|
|
13
|
-
if (typeof message ===
|
|
14
|
-
console.error(chalk.red(
|
|
13
|
+
if (typeof message === "object") {
|
|
14
|
+
console.error(chalk.red("[ERROR]"), message, ...args);
|
|
15
15
|
}
|
|
16
16
|
else {
|
|
17
|
-
console.error(chalk.red(
|
|
17
|
+
console.error(chalk.red("[ERROR]"), message, ...args);
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
warn(message, ...args) {
|
|
21
|
-
if (typeof message ===
|
|
22
|
-
console.warn(chalk.yellow(
|
|
21
|
+
if (typeof message === "object") {
|
|
22
|
+
console.warn(chalk.yellow("[WARN]"), message, ...args);
|
|
23
23
|
}
|
|
24
24
|
else {
|
|
25
|
-
console.warn(chalk.yellow(
|
|
25
|
+
console.warn(chalk.yellow("[WARN]"), message, ...args);
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
debug(message, ...args) {
|
|
29
|
-
if (typeof message ===
|
|
30
|
-
console.log(chalk.gray(
|
|
29
|
+
if (typeof message === "object") {
|
|
30
|
+
console.log(chalk.gray("[DEBUG]"), message, ...args);
|
|
31
31
|
}
|
|
32
32
|
else {
|
|
33
|
-
console.log(chalk.gray(
|
|
33
|
+
console.log(chalk.gray("[DEBUG]"), message, ...args);
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
36
|
};
|