@shware/purchase 0.1.12 → 0.1.14
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/stripe/index.d.cts +2 -1
- package/dist/stripe/index.d.ts +2 -1
- package/dist/stripe/schema.cjs +11 -10
- package/dist/stripe/schema.cjs.map +1 -1
- package/dist/stripe/schema.d.cts +14 -11
- package/dist/stripe/schema.d.ts +14 -11
- package/dist/stripe/schema.mjs +6 -2
- package/dist/stripe/schema.mjs.map +1 -1
- package/package.json +4 -4
package/dist/stripe/index.d.cts
CHANGED
package/dist/stripe/index.d.ts
CHANGED
package/dist/stripe/schema.cjs
CHANGED
|
@@ -24,12 +24,12 @@ __export(schema_exports, {
|
|
|
24
24
|
checkoutSessionSchema: () => checkoutSessionSchema
|
|
25
25
|
});
|
|
26
26
|
module.exports = __toCommonJS(schema_exports);
|
|
27
|
-
var
|
|
28
|
-
var cancellationDetailsSchema = (0,
|
|
29
|
-
comment: (0,
|
|
30
|
-
feedback: (0,
|
|
31
|
-
(0,
|
|
32
|
-
(0,
|
|
27
|
+
var import_mini = require("zod/mini");
|
|
28
|
+
var cancellationDetailsSchema = (0, import_mini.object)({
|
|
29
|
+
comment: (0, import_mini.optional)((0, import_mini.nullable)((0, import_mini.string)().check((0, import_mini.maxLength)(1024)))),
|
|
30
|
+
feedback: (0, import_mini.optional)(
|
|
31
|
+
(0, import_mini.nullable)(
|
|
32
|
+
(0, import_mini.enum)([
|
|
33
33
|
"customer_service",
|
|
34
34
|
"low_quality",
|
|
35
35
|
"missing_features",
|
|
@@ -43,10 +43,11 @@ var cancellationDetailsSchema = (0, import_v4_mini.object)({
|
|
|
43
43
|
)
|
|
44
44
|
});
|
|
45
45
|
function checkoutSessionSchema(productIds) {
|
|
46
|
-
return (0,
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
return (0, import_mini.object)({
|
|
47
|
+
quantity: (0, import_mini._default)((0, import_mini.int)().check((0, import_mini.gte)(1)), 1),
|
|
48
|
+
productId: (0, import_mini.enum)(productIds),
|
|
49
|
+
cancelUrl: (0, import_mini.optional)((0, import_mini.url)()),
|
|
50
|
+
successUrl: (0, import_mini.optional)((0, import_mini.url)())
|
|
50
51
|
});
|
|
51
52
|
}
|
|
52
53
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/stripe/schema.ts"],"sourcesContent":["import {\n maxLength,\n object,\n optional,\n nullable,\n string,\n enum as _enum,\n url,\n type
|
|
1
|
+
{"version":3,"sources":["../../src/stripe/schema.ts"],"sourcesContent":["import {\n maxLength,\n object,\n optional,\n nullable,\n string,\n enum as _enum,\n url,\n _default,\n int,\n gte,\n type output,\n} from 'zod/mini';\nimport type { ProductId } from './types';\n\nexport const cancellationDetailsSchema = object({\n comment: optional(nullable(string().check(maxLength(1024)))),\n feedback: optional(\n nullable(\n _enum([\n 'customer_service',\n 'low_quality',\n 'missing_features',\n 'switched_service',\n 'too_complex',\n 'too_expensive',\n 'unused',\n 'other',\n ])\n )\n ),\n});\n\nexport function checkoutSessionSchema(productIds: [ProductId, ...ProductId[]]) {\n return object({\n quantity: _default(int().check(gte(1)), 1),\n productId: _enum(productIds),\n cancelUrl: optional(url()),\n successUrl: optional(url()),\n });\n}\n\nexport interface CancellationDetails extends output<typeof cancellationDetailsSchema> {\n reason?: 'cancellation_requested' | 'payment_disputed' | 'payment_failed' | null;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAYO;AAGA,IAAM,gCAA4B,oBAAO;AAAA,EAC9C,aAAS,0BAAS,0BAAS,oBAAO,EAAE,UAAM,uBAAU,IAAI,CAAC,CAAC,CAAC;AAAA,EAC3D,cAAU;AAAA,QACR;AAAA,UACE,YAAAA,MAAM;AAAA,QACJ;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF;AACF,CAAC;AAEM,SAAS,sBAAsB,YAAyC;AAC7E,aAAO,oBAAO;AAAA,IACZ,cAAU,0BAAS,iBAAI,EAAE,UAAM,iBAAI,CAAC,CAAC,GAAG,CAAC;AAAA,IACzC,eAAW,YAAAA,MAAM,UAAU;AAAA,IAC3B,eAAW,0BAAS,iBAAI,CAAC;AAAA,IACzB,gBAAY,0BAAS,iBAAI,CAAC;AAAA,EAC5B,CAAC;AACH;","names":["_enum"]}
|
package/dist/stripe/schema.d.cts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as zod_v4_core from 'zod/v4/core';
|
|
2
|
+
import * as zod_mini from 'zod/mini';
|
|
3
|
+
import { output } from 'zod/mini';
|
|
2
4
|
import { ProductId } from './types.cjs';
|
|
3
5
|
|
|
4
|
-
declare const cancellationDetailsSchema:
|
|
5
|
-
comment:
|
|
6
|
-
feedback:
|
|
6
|
+
declare const cancellationDetailsSchema: zod_mini.ZodMiniObject<{
|
|
7
|
+
comment: zod_mini.ZodMiniOptional<zod_mini.ZodMiniNullable<zod_mini.ZodMiniString<string>>>;
|
|
8
|
+
feedback: zod_mini.ZodMiniOptional<zod_mini.ZodMiniNullable<zod_mini.ZodMiniEnum<{
|
|
7
9
|
customer_service: "customer_service";
|
|
8
10
|
low_quality: "low_quality";
|
|
9
11
|
missing_features: "missing_features";
|
|
@@ -13,15 +15,16 @@ declare const cancellationDetailsSchema: z.ZodMiniObject<{
|
|
|
13
15
|
unused: "unused";
|
|
14
16
|
other: "other";
|
|
15
17
|
}>>>;
|
|
16
|
-
},
|
|
17
|
-
declare function checkoutSessionSchema(productIds: [ProductId, ...ProductId[]]):
|
|
18
|
-
|
|
18
|
+
}, zod_v4_core.$strip>;
|
|
19
|
+
declare function checkoutSessionSchema(productIds: [ProductId, ...ProductId[]]): zod_mini.ZodMiniObject<{
|
|
20
|
+
quantity: zod_mini.ZodMiniDefault<zod_mini.ZodMiniNumberFormat>;
|
|
21
|
+
productId: zod_mini.ZodMiniEnum<{
|
|
19
22
|
[x: Lowercase<string>]: Lowercase<string>;
|
|
20
23
|
}>;
|
|
21
|
-
cancelUrl:
|
|
22
|
-
successUrl:
|
|
23
|
-
},
|
|
24
|
-
interface CancellationDetails extends
|
|
24
|
+
cancelUrl: zod_mini.ZodMiniOptional<zod_mini.ZodMiniURL>;
|
|
25
|
+
successUrl: zod_mini.ZodMiniOptional<zod_mini.ZodMiniURL>;
|
|
26
|
+
}, zod_v4_core.$strip>;
|
|
27
|
+
interface CancellationDetails extends output<typeof cancellationDetailsSchema> {
|
|
25
28
|
reason?: 'cancellation_requested' | 'payment_disputed' | 'payment_failed' | null;
|
|
26
29
|
}
|
|
27
30
|
|
package/dist/stripe/schema.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as zod_v4_core from 'zod/v4/core';
|
|
2
|
+
import * as zod_mini from 'zod/mini';
|
|
3
|
+
import { output } from 'zod/mini';
|
|
2
4
|
import { ProductId } from './types.js';
|
|
3
5
|
|
|
4
|
-
declare const cancellationDetailsSchema:
|
|
5
|
-
comment:
|
|
6
|
-
feedback:
|
|
6
|
+
declare const cancellationDetailsSchema: zod_mini.ZodMiniObject<{
|
|
7
|
+
comment: zod_mini.ZodMiniOptional<zod_mini.ZodMiniNullable<zod_mini.ZodMiniString<string>>>;
|
|
8
|
+
feedback: zod_mini.ZodMiniOptional<zod_mini.ZodMiniNullable<zod_mini.ZodMiniEnum<{
|
|
7
9
|
customer_service: "customer_service";
|
|
8
10
|
low_quality: "low_quality";
|
|
9
11
|
missing_features: "missing_features";
|
|
@@ -13,15 +15,16 @@ declare const cancellationDetailsSchema: z.ZodMiniObject<{
|
|
|
13
15
|
unused: "unused";
|
|
14
16
|
other: "other";
|
|
15
17
|
}>>>;
|
|
16
|
-
},
|
|
17
|
-
declare function checkoutSessionSchema(productIds: [ProductId, ...ProductId[]]):
|
|
18
|
-
|
|
18
|
+
}, zod_v4_core.$strip>;
|
|
19
|
+
declare function checkoutSessionSchema(productIds: [ProductId, ...ProductId[]]): zod_mini.ZodMiniObject<{
|
|
20
|
+
quantity: zod_mini.ZodMiniDefault<zod_mini.ZodMiniNumberFormat>;
|
|
21
|
+
productId: zod_mini.ZodMiniEnum<{
|
|
19
22
|
[x: Lowercase<string>]: Lowercase<string>;
|
|
20
23
|
}>;
|
|
21
|
-
cancelUrl:
|
|
22
|
-
successUrl:
|
|
23
|
-
},
|
|
24
|
-
interface CancellationDetails extends
|
|
24
|
+
cancelUrl: zod_mini.ZodMiniOptional<zod_mini.ZodMiniURL>;
|
|
25
|
+
successUrl: zod_mini.ZodMiniOptional<zod_mini.ZodMiniURL>;
|
|
26
|
+
}, zod_v4_core.$strip>;
|
|
27
|
+
interface CancellationDetails extends output<typeof cancellationDetailsSchema> {
|
|
25
28
|
reason?: 'cancellation_requested' | 'payment_disputed' | 'payment_failed' | null;
|
|
26
29
|
}
|
|
27
30
|
|
package/dist/stripe/schema.mjs
CHANGED
|
@@ -6,8 +6,11 @@ import {
|
|
|
6
6
|
nullable,
|
|
7
7
|
string,
|
|
8
8
|
enum as _enum,
|
|
9
|
-
url
|
|
10
|
-
|
|
9
|
+
url,
|
|
10
|
+
_default,
|
|
11
|
+
int,
|
|
12
|
+
gte
|
|
13
|
+
} from "zod/mini";
|
|
11
14
|
var cancellationDetailsSchema = object({
|
|
12
15
|
comment: optional(nullable(string().check(maxLength(1024)))),
|
|
13
16
|
feedback: optional(
|
|
@@ -27,6 +30,7 @@ var cancellationDetailsSchema = object({
|
|
|
27
30
|
});
|
|
28
31
|
function checkoutSessionSchema(productIds) {
|
|
29
32
|
return object({
|
|
33
|
+
quantity: _default(int().check(gte(1)), 1),
|
|
30
34
|
productId: _enum(productIds),
|
|
31
35
|
cancelUrl: optional(url()),
|
|
32
36
|
successUrl: optional(url())
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/stripe/schema.ts"],"sourcesContent":["import {\n maxLength,\n object,\n optional,\n nullable,\n string,\n enum as _enum,\n url,\n type
|
|
1
|
+
{"version":3,"sources":["../../src/stripe/schema.ts"],"sourcesContent":["import {\n maxLength,\n object,\n optional,\n nullable,\n string,\n enum as _enum,\n url,\n _default,\n int,\n gte,\n type output,\n} from 'zod/mini';\nimport type { ProductId } from './types';\n\nexport const cancellationDetailsSchema = object({\n comment: optional(nullable(string().check(maxLength(1024)))),\n feedback: optional(\n nullable(\n _enum([\n 'customer_service',\n 'low_quality',\n 'missing_features',\n 'switched_service',\n 'too_complex',\n 'too_expensive',\n 'unused',\n 'other',\n ])\n )\n ),\n});\n\nexport function checkoutSessionSchema(productIds: [ProductId, ...ProductId[]]) {\n return object({\n quantity: _default(int().check(gte(1)), 1),\n productId: _enum(productIds),\n cancelUrl: optional(url()),\n successUrl: optional(url()),\n });\n}\n\nexport interface CancellationDetails extends output<typeof cancellationDetailsSchema> {\n reason?: 'cancellation_requested' | 'payment_disputed' | 'payment_failed' | null;\n}\n"],"mappings":";AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,QAAQ;AAAA,EACR;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AAGA,IAAM,4BAA4B,OAAO;AAAA,EAC9C,SAAS,SAAS,SAAS,OAAO,EAAE,MAAM,UAAU,IAAI,CAAC,CAAC,CAAC;AAAA,EAC3D,UAAU;AAAA,IACR;AAAA,MACE,MAAM;AAAA,QACJ;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF;AACF,CAAC;AAEM,SAAS,sBAAsB,YAAyC;AAC7E,SAAO,OAAO;AAAA,IACZ,UAAU,SAAS,IAAI,EAAE,MAAM,IAAI,CAAC,CAAC,GAAG,CAAC;AAAA,IACzC,WAAW,MAAM,UAAU;AAAA,IAC3B,WAAW,SAAS,IAAI,CAAC;AAAA,IACzB,YAAY,SAAS,IAAI,CAAC;AAAA,EAC5B,CAAC;AACH;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shware/purchase",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.14",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -39,15 +39,15 @@
|
|
|
39
39
|
],
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@types/jest": "^30.0.0",
|
|
42
|
-
"@types/node": "^24.3.
|
|
42
|
+
"@types/node": "^24.3.3",
|
|
43
43
|
"jest": "^30.1.3",
|
|
44
44
|
"ts-jest": "^29.4.1",
|
|
45
45
|
"typescript": "^5.9.2",
|
|
46
|
-
"@repo/eslint-config": "0.0.
|
|
46
|
+
"@repo/eslint-config": "0.0.4",
|
|
47
47
|
"@repo/typescript-config": "0.0.0"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"zod": "^4.1.
|
|
50
|
+
"zod": "^4.1.8"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
53
|
"stripe": "^18"
|