@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.
@@ -4,4 +4,5 @@ export { Config, CreateCheckoutSessionDTO, PriceId, ProductId } from './types.cj
4
4
  export { METADATA_KEYS } from './metadata.cjs';
5
5
  import '../subscription/index.cjs';
6
6
  import 'stripe';
7
- import 'zod/v4-mini';
7
+ import 'zod/v4/core';
8
+ import 'zod/mini';
@@ -4,4 +4,5 @@ export { Config, CreateCheckoutSessionDTO, PriceId, ProductId } from './types.js
4
4
  export { METADATA_KEYS } from './metadata.js';
5
5
  import '../subscription/index.js';
6
6
  import 'stripe';
7
- import 'zod/v4-mini';
7
+ import 'zod/v4/core';
8
+ import 'zod/mini';
@@ -24,12 +24,12 @@ __export(schema_exports, {
24
24
  checkoutSessionSchema: () => checkoutSessionSchema
25
25
  });
26
26
  module.exports = __toCommonJS(schema_exports);
27
- var import_v4_mini = require("zod/v4-mini");
28
- var cancellationDetailsSchema = (0, import_v4_mini.object)({
29
- comment: (0, import_v4_mini.optional)((0, import_v4_mini.nullable)((0, import_v4_mini.string)().check((0, import_v4_mini.maxLength)(1024)))),
30
- feedback: (0, import_v4_mini.optional)(
31
- (0, import_v4_mini.nullable)(
32
- (0, import_v4_mini.enum)([
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, import_v4_mini.object)({
47
- productId: (0, import_v4_mini.enum)(productIds),
48
- cancelUrl: (0, import_v4_mini.optional)((0, import_v4_mini.url)()),
49
- successUrl: (0, import_v4_mini.optional)((0, import_v4_mini.url)())
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 z,\n} from 'zod/v4-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 productId: _enum(productIds),\n cancelUrl: optional(url()),\n successUrl: optional(url()),\n });\n}\n\nexport interface CancellationDetails extends z.output<typeof cancellationDetailsSchema> {\n reason?: 'cancellation_requested' | 'payment_disputed' | 'payment_failed' | null;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBASO;AAGA,IAAM,gCAA4B,uBAAO;AAAA,EAC9C,aAAS,6BAAS,6BAAS,uBAAO,EAAE,UAAM,0BAAU,IAAI,CAAC,CAAC,CAAC;AAAA,EAC3D,cAAU;AAAA,QACR;AAAA,UACE,eAAAA,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,uBAAO;AAAA,IACZ,eAAW,eAAAA,MAAM,UAAU;AAAA,IAC3B,eAAW,6BAAS,oBAAI,CAAC;AAAA,IACzB,gBAAY,6BAAS,oBAAI,CAAC;AAAA,EAC5B,CAAC;AACH;","names":["_enum"]}
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"]}
@@ -1,9 +1,11 @@
1
- import { z } from 'zod/v4-mini';
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: z.ZodMiniObject<{
5
- comment: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
6
- feedback: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniEnum<{
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
- }, z.core.$strip>;
17
- declare function checkoutSessionSchema(productIds: [ProductId, ...ProductId[]]): z.ZodMiniObject<{
18
- productId: z.ZodMiniEnum<{
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: z.ZodMiniOptional<z.ZodMiniURL>;
22
- successUrl: z.ZodMiniOptional<z.ZodMiniURL>;
23
- }, z.core.$strip>;
24
- interface CancellationDetails extends z.output<typeof cancellationDetailsSchema> {
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
 
@@ -1,9 +1,11 @@
1
- import { z } from 'zod/v4-mini';
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: z.ZodMiniObject<{
5
- comment: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
6
- feedback: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniEnum<{
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
- }, z.core.$strip>;
17
- declare function checkoutSessionSchema(productIds: [ProductId, ...ProductId[]]): z.ZodMiniObject<{
18
- productId: z.ZodMiniEnum<{
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: z.ZodMiniOptional<z.ZodMiniURL>;
22
- successUrl: z.ZodMiniOptional<z.ZodMiniURL>;
23
- }, z.core.$strip>;
24
- interface CancellationDetails extends z.output<typeof cancellationDetailsSchema> {
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
 
@@ -6,8 +6,11 @@ import {
6
6
  nullable,
7
7
  string,
8
8
  enum as _enum,
9
- url
10
- } from "zod/v4-mini";
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 z,\n} from 'zod/v4-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 productId: _enum(productIds),\n cancelUrl: optional(url()),\n successUrl: optional(url()),\n });\n}\n\nexport interface CancellationDetails extends z.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,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,WAAW,MAAM,UAAU;AAAA,IAC3B,WAAW,SAAS,IAAI,CAAC;AAAA,IACzB,YAAY,SAAS,IAAI,CAAC;AAAA,EAC5B,CAAC;AACH;","names":[]}
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.12",
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.1",
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.2",
46
+ "@repo/eslint-config": "0.0.4",
47
47
  "@repo/typescript-config": "0.0.0"
48
48
  },
49
49
  "dependencies": {
50
- "zod": "^4.1.5"
50
+ "zod": "^4.1.8"
51
51
  },
52
52
  "peerDependencies": {
53
53
  "stripe": "^18"