@shware/purchase 1.8.9 → 2.0.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.
Files changed (128) hide show
  1. package/dist/_virtual/_rolldown/runtime.cjs +23 -0
  2. package/dist/app-store/config.cjs +105 -128
  3. package/dist/app-store/config.cjs.map +1 -1
  4. package/dist/app-store/config.d.cts +36 -33
  5. package/dist/app-store/config.d.cts.map +1 -0
  6. package/dist/app-store/config.d.mts +42 -0
  7. package/dist/app-store/config.d.mts.map +1 -0
  8. package/dist/app-store/config.mjs +100 -91
  9. package/dist/app-store/config.mjs.map +1 -1
  10. package/dist/app-store/index.cjs +3 -31
  11. package/dist/app-store/index.d.cts +2 -3
  12. package/dist/app-store/index.d.mts +2 -0
  13. package/dist/app-store/index.mjs +1 -5
  14. package/dist/google-play/config.cjs +108 -123
  15. package/dist/google-play/config.cjs.map +1 -1
  16. package/dist/google-play/config.d.cts +35 -33
  17. package/dist/google-play/config.d.cts.map +1 -0
  18. package/dist/google-play/config.d.mts +41 -0
  19. package/dist/google-play/config.d.mts.map +1 -0
  20. package/dist/google-play/config.mjs +103 -86
  21. package/dist/google-play/config.mjs.map +1 -1
  22. package/dist/google-play/index.cjs +9 -42
  23. package/dist/google-play/index.d.cts +3 -4
  24. package/dist/google-play/index.d.mts +3 -0
  25. package/dist/google-play/index.mjs +2 -17
  26. package/dist/google-play/real-time-developer-notification.cjs +122 -81
  27. package/dist/google-play/real-time-developer-notification.cjs.map +1 -1
  28. package/dist/google-play/real-time-developer-notification.d.cts +119 -117
  29. package/dist/google-play/real-time-developer-notification.d.cts.map +1 -0
  30. package/dist/google-play/real-time-developer-notification.d.mts +150 -0
  31. package/dist/google-play/real-time-developer-notification.d.mts.map +1 -0
  32. package/dist/google-play/real-time-developer-notification.mjs +118 -53
  33. package/dist/google-play/real-time-developer-notification.mjs.map +1 -1
  34. package/dist/index.cjs +13 -48
  35. package/dist/index.d.cts +5 -6
  36. package/dist/index.d.mts +5 -0
  37. package/dist/index.mjs +2 -19
  38. package/dist/stripe/config.cjs +114 -133
  39. package/dist/stripe/config.cjs.map +1 -1
  40. package/dist/stripe/config.d.cts +46 -37
  41. package/dist/stripe/config.d.cts.map +1 -0
  42. package/dist/stripe/config.d.mts +52 -0
  43. package/dist/stripe/config.d.mts.map +1 -0
  44. package/dist/stripe/config.mjs +109 -96
  45. package/dist/stripe/config.mjs.map +1 -1
  46. package/dist/stripe/handler.cjs +25 -53
  47. package/dist/stripe/handler.cjs.map +1 -1
  48. package/dist/stripe/handler.d.cts +10 -9
  49. package/dist/stripe/handler.d.cts.map +1 -0
  50. package/dist/stripe/handler.d.mts +16 -0
  51. package/dist/stripe/handler.d.mts.map +1 -0
  52. package/dist/stripe/handler.mjs +25 -29
  53. package/dist/stripe/handler.mjs.map +1 -1
  54. package/dist/stripe/index.cjs +27 -74
  55. package/dist/stripe/index.d.cts +8 -12
  56. package/dist/stripe/index.d.mts +8 -0
  57. package/dist/stripe/index.mjs +5 -44
  58. package/dist/stripe/mapper.cjs +168 -219
  59. package/dist/stripe/mapper.cjs.map +1 -1
  60. package/dist/stripe/mapper.d.cts +115 -114
  61. package/dist/stripe/mapper.d.cts.map +1 -0
  62. package/dist/stripe/mapper.d.mts +158 -0
  63. package/dist/stripe/mapper.d.mts.map +1 -0
  64. package/dist/stripe/mapper.mjs +155 -182
  65. package/dist/stripe/mapper.mjs.map +1 -1
  66. package/dist/stripe/metadata.cjs +11 -35
  67. package/dist/stripe/metadata.cjs.map +1 -1
  68. package/dist/stripe/metadata.d.cts +9 -7
  69. package/dist/stripe/metadata.d.cts.map +1 -0
  70. package/dist/stripe/metadata.d.mts +12 -0
  71. package/dist/stripe/metadata.d.mts.map +1 -0
  72. package/dist/stripe/metadata.mjs +11 -11
  73. package/dist/stripe/metadata.mjs.map +1 -1
  74. package/dist/stripe/pending-checkout.cjs +55 -61
  75. package/dist/stripe/pending-checkout.cjs.map +1 -1
  76. package/dist/stripe/pending-checkout.d.cts +3 -1
  77. package/dist/stripe/pending-checkout.d.cts.map +1 -0
  78. package/dist/stripe/{pending-checkout.d.ts → pending-checkout.d.mts} +3 -1
  79. package/dist/stripe/pending-checkout.d.mts.map +1 -0
  80. package/dist/stripe/pending-checkout.mjs +52 -34
  81. package/dist/stripe/pending-checkout.mjs.map +1 -1
  82. package/dist/stripe/schema.cjs +30 -55
  83. package/dist/stripe/schema.cjs.map +1 -1
  84. package/dist/stripe/schema.d.cts +36 -37
  85. package/dist/stripe/schema.d.cts.map +1 -0
  86. package/dist/stripe/schema.d.mts +40 -0
  87. package/dist/stripe/schema.d.mts.map +1 -0
  88. package/dist/stripe/schema.mjs +28 -40
  89. package/dist/stripe/schema.mjs.map +1 -1
  90. package/dist/subscription/index.cjs +178 -80
  91. package/dist/subscription/index.cjs.map +1 -1
  92. package/dist/subscription/index.d.cts +136 -134
  93. package/dist/subscription/index.d.cts.map +1 -0
  94. package/dist/subscription/index.d.mts +150 -0
  95. package/dist/subscription/index.d.mts.map +1 -0
  96. package/dist/subscription/index.mjs +173 -51
  97. package/dist/subscription/index.mjs.map +1 -1
  98. package/dist/types.cjs +0 -19
  99. package/dist/types.d.cts +7 -6
  100. package/dist/types.d.cts.map +1 -0
  101. package/dist/types.d.mts +10 -0
  102. package/dist/types.d.mts.map +1 -0
  103. package/dist/types.mjs +1 -1
  104. package/package.json +40 -25
  105. package/dist/app-store/config.d.ts +0 -39
  106. package/dist/app-store/index.cjs.map +0 -1
  107. package/dist/app-store/index.d.ts +0 -3
  108. package/dist/app-store/index.mjs.map +0 -1
  109. package/dist/google-play/config.d.ts +0 -39
  110. package/dist/google-play/index.cjs.map +0 -1
  111. package/dist/google-play/index.d.ts +0 -4
  112. package/dist/google-play/index.mjs.map +0 -1
  113. package/dist/google-play/real-time-developer-notification.d.ts +0 -148
  114. package/dist/index.cjs.map +0 -1
  115. package/dist/index.d.ts +0 -6
  116. package/dist/index.mjs.map +0 -1
  117. package/dist/stripe/config.d.ts +0 -43
  118. package/dist/stripe/handler.d.ts +0 -15
  119. package/dist/stripe/index.cjs.map +0 -1
  120. package/dist/stripe/index.d.ts +0 -12
  121. package/dist/stripe/index.mjs.map +0 -1
  122. package/dist/stripe/mapper.d.ts +0 -157
  123. package/dist/stripe/metadata.d.ts +0 -10
  124. package/dist/stripe/schema.d.ts +0 -41
  125. package/dist/subscription/index.d.ts +0 -148
  126. package/dist/types.cjs.map +0 -1
  127. package/dist/types.d.ts +0 -9
  128. package/dist/types.mjs.map +0 -1
@@ -1,39 +1,41 @@
1
- import { Metadata, IsUnique } from '../types.cjs';
2
- import 'ms';
3
-
1
+ import { IsUnique, Metadata } from "../types.cjs";
2
+ //#region src/google-play/config.d.ts
4
3
  declare const addMethod: unique symbol;
5
- declare class Subscription<NS extends Lowercase<string> = Lowercase<string>, PE extends string = string, PI extends string = never, I extends Lowercase<string> = never> {
6
- readonly productId: string;
7
- readonly config: GooglePlayConfig<NS, PE, PI>;
8
- readonly plans: Map<string, Metadata & {
9
- plan?: PE;
10
- }>;
11
- readonly defaultPlans: Set<string>;
12
- constructor(config: GooglePlayConfig<NS, PE, PI>, productId: string);
13
- basePlan: <K extends Lowercase<string>>(planId: K extends I ? never : K, plan: PE, metadata?: Metadata) => Subscription<NS, PE, PI, I | K>;
14
- default: <const T extends readonly [I, ...I[]]>(planIds: T & (IsUnique<T> extends true ? unknown : never)) => GooglePlayConfig<NS, PE, PI>;
4
+ declare class Subscription<NS extends Lowercase<string> = Lowercase<string>, PE extends string = string, BP extends string = string, PI extends string = never, I extends Lowercase<string> = never> {
5
+ readonly productId: string;
6
+ readonly config: GooglePlayConfig<NS, PE, BP, PI>;
7
+ readonly plans: Map<string, Metadata & {
8
+ plan?: PE;
9
+ billingPeriod?: BP;
10
+ }>;
11
+ readonly defaultPlans: Set<string>;
12
+ constructor(config: GooglePlayConfig<NS, PE, BP, PI>, productId: string);
13
+ basePlan: <K extends Lowercase<string>>(planId: K extends I ? never : K, plan: PE, billingPeriod: BP, metadata?: Metadata) => Subscription<NS, PE, BP, PI, I | K>;
14
+ default: <const T extends readonly [I, ...I[]]>(planIds: T & (IsUnique<T> extends true ? unknown : never)) => GooglePlayConfig<NS, PE, BP, PI>;
15
15
  }
16
16
  type Options = {
17
- package: string;
18
- audience: string;
17
+ package: string;
18
+ audience: string;
19
19
  };
20
- declare class GooglePlayConfig<NS extends Lowercase<string> = Lowercase<string>, PE extends string = string, PI extends string = never> {
21
- readonly package: string;
22
- readonly audience: string;
23
- private onetimes;
24
- private subscriptions;
25
- private products;
26
- [addMethod]: (subscription: Subscription<NS, PE, PI>) => this;
27
- private getId;
28
- private constructor();
29
- static create: <NS_1 extends Lowercase<string>, PE_1 extends string = string>(options: Options) => GooglePlayConfig<NS_1, PE_1, never>;
30
- subscription: <K extends `${NS}.${Lowercase<string>}`>(productId: K extends PI ? never : K) => Subscription<NS, PE, PI | K, never>;
31
- onetime: <K extends `${NS}.${Lowercase<string>}`>(productId: K extends PI ? never : K, metadata?: Metadata) => GooglePlayConfig<NS, PE, PI | K>;
32
- getPlan: (productId: string, planId: string) => PE;
33
- getMode: (productId: string) => "payment" | "subscription";
34
- getCreditAmount: (productId: string, planId?: string) => number;
35
- private getCreditExpiresIn;
36
- getCreditExpiresAt: (productId: string, planId?: string) => string;
20
+ declare class GooglePlayConfig<NS extends Lowercase<string> = Lowercase<string>, PE extends string = string, BP extends string = string, PI extends string = never> {
21
+ readonly package: string;
22
+ readonly audience: string;
23
+ private onetimes;
24
+ private subscriptions;
25
+ private products;
26
+ [addMethod]: (subscription: Subscription<NS, PE, BP, PI>) => this;
27
+ private getId;
28
+ private constructor();
29
+ static create: <NS_1 extends Lowercase<string>, PE_1 extends string = string, BP_1 extends string = string>(options: Options) => GooglePlayConfig<NS_1, PE_1, BP_1, never>;
30
+ subscription: <K extends `${NS}.${Lowercase<string>}`>(productId: K extends PI ? never : K) => Subscription<NS, PE, BP, K | PI, never>;
31
+ onetime: <K extends `${NS}.${Lowercase<string>}`>(productId: K extends PI ? never : K, metadata?: Metadata) => GooglePlayConfig<NS, PE, BP, PI | K>;
32
+ getPlan: (productId: string, planId: string) => PE;
33
+ getBillingPeriod: (productId: string, planId: string) => BP;
34
+ getMode: (productId: string) => 'payment' | 'subscription';
35
+ getCreditAmount: (productId: string, planId?: string) => number;
36
+ private getCreditExpiresIn;
37
+ getCreditExpiresAt: (productId: string, planId?: string) => string;
37
38
  }
38
-
39
+ //#endregion
39
40
  export { GooglePlayConfig };
41
+ //# sourceMappingURL=config.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.cts","names":[],"sources":["../../src/google-play/config.ts"],"mappings":";;cAIM;cAEA,aACJ,WAAW,oBAAoB,mBAC/B,4BACA,4BACA,2BACA,UAAU;WAED;WACA,QAAQ,iBAAiB,IAAI,IAAI,IAAI;WACrC,OAAO,YAAY;IAAa,OAAO;IAAI,gBAAgB;;WAC3D,cAAc;EAEvB,YAAY,QAAQ,iBAAiB,IAAI,IAAI,IAAI,KAAK;EAOtD,WAAY,UAAU,mBAAiB,QAC7B,UAAU,YAAY,GAAC,MACzB,IAAE,eACO,IAAE,WACP,aACT,aAAa,IAAI,IAAI,IAAI,IAAI,IAAI;EAKpC,gBAAiB,oBAAoB,MAAM,MAAI,SACpC,KAAK,SAAS,uCAAkC,iBAAA,IAAA,IAAA,IAAA;;KAQxD;EAAY;EAAiB;;cAErB,iBACX,WAAW,oBAAoB,mBAC/B,4BACA,4BACA;WAES;WACA;UACD;UACA;UACA;GAEP,aAAU,cAAkB,aAAa,IAAI,IAAI,IAAI;UAQ9C;UAID;SAQA,SACL,aAAW,mBACX,8BACA,8BAA0B,SAEjB,YAAO,iBAAA,MAAA,MAAA;EAKlB,eAAgB,aAAa,MAAM,qBAAmB,WAAa,UAAU,aAAa,MAAC,aAAA,IAAA,IAAA,IAAA,IAAA;EAI3F,UAAW,aAAa,MAAM,qBAAmB,WACpC,UAAU,aAAa,GAAC,WACzB,aAIK,iBAAiB,IAAI,IAAI,IAAI,KAAK;EAGnD,UAAO,mBAAqB,mBAAmB;EAQ/C,mBAAgB,mBAAqB,mBAAmB;EAQxD,UAAO;EAMP,kBAAe,mBAAqB;UAO5B;EAOR,qBAAkB,mBAAqB"}
@@ -0,0 +1,41 @@
1
+ import { IsUnique, Metadata } from "../types.mjs";
2
+ //#region src/google-play/config.d.ts
3
+ declare const addMethod: unique symbol;
4
+ declare class Subscription<NS extends Lowercase<string> = Lowercase<string>, PE extends string = string, BP extends string = string, PI extends string = never, I extends Lowercase<string> = never> {
5
+ readonly productId: string;
6
+ readonly config: GooglePlayConfig<NS, PE, BP, PI>;
7
+ readonly plans: Map<string, Metadata & {
8
+ plan?: PE;
9
+ billingPeriod?: BP;
10
+ }>;
11
+ readonly defaultPlans: Set<string>;
12
+ constructor(config: GooglePlayConfig<NS, PE, BP, PI>, productId: string);
13
+ basePlan: <K extends Lowercase<string>>(planId: K extends I ? never : K, plan: PE, billingPeriod: BP, metadata?: Metadata) => Subscription<NS, PE, BP, PI, I | K>;
14
+ default: <const T extends readonly [I, ...I[]]>(planIds: T & (IsUnique<T> extends true ? unknown : never)) => GooglePlayConfig<NS, PE, BP, PI>;
15
+ }
16
+ type Options = {
17
+ package: string;
18
+ audience: string;
19
+ };
20
+ declare class GooglePlayConfig<NS extends Lowercase<string> = Lowercase<string>, PE extends string = string, BP extends string = string, PI extends string = never> {
21
+ readonly package: string;
22
+ readonly audience: string;
23
+ private onetimes;
24
+ private subscriptions;
25
+ private products;
26
+ [addMethod]: (subscription: Subscription<NS, PE, BP, PI>) => this;
27
+ private getId;
28
+ private constructor();
29
+ static create: <NS_1 extends Lowercase<string>, PE_1 extends string = string, BP_1 extends string = string>(options: Options) => GooglePlayConfig<NS_1, PE_1, BP_1, never>;
30
+ subscription: <K extends `${NS}.${Lowercase<string>}`>(productId: K extends PI ? never : K) => Subscription<NS, PE, BP, K | PI, never>;
31
+ onetime: <K extends `${NS}.${Lowercase<string>}`>(productId: K extends PI ? never : K, metadata?: Metadata) => GooglePlayConfig<NS, PE, BP, PI | K>;
32
+ getPlan: (productId: string, planId: string) => PE;
33
+ getBillingPeriod: (productId: string, planId: string) => BP;
34
+ getMode: (productId: string) => 'payment' | 'subscription';
35
+ getCreditAmount: (productId: string, planId?: string) => number;
36
+ private getCreditExpiresIn;
37
+ getCreditExpiresAt: (productId: string, planId?: string) => string;
38
+ }
39
+ //#endregion
40
+ export { GooglePlayConfig };
41
+ //# sourceMappingURL=config.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.mts","names":[],"sources":["../../src/google-play/config.ts"],"mappings":";;cAIM;cAEA,aACJ,WAAW,oBAAoB,mBAC/B,4BACA,4BACA,2BACA,UAAU;WAED;WACA,QAAQ,iBAAiB,IAAI,IAAI,IAAI;WACrC,OAAO,YAAY;IAAa,OAAO;IAAI,gBAAgB;;WAC3D,cAAc;EAEvB,YAAY,QAAQ,iBAAiB,IAAI,IAAI,IAAI,KAAK;EAOtD,WAAY,UAAU,mBAAiB,QAC7B,UAAU,YAAY,GAAC,MACzB,IAAE,eACO,IAAE,WACP,aACT,aAAa,IAAI,IAAI,IAAI,IAAI,IAAI;EAKpC,gBAAiB,oBAAoB,MAAM,MAAI,SACpC,KAAK,SAAS,uCAAkC,iBAAA,IAAA,IAAA,IAAA;;KAQxD;EAAY;EAAiB;;cAErB,iBACX,WAAW,oBAAoB,mBAC/B,4BACA,4BACA;WAES;WACA;UACD;UACA;UACA;GAEP,aAAU,cAAkB,aAAa,IAAI,IAAI,IAAI;UAQ9C;UAID;SAQA,SACL,aAAW,mBACX,8BACA,8BAA0B,SAEjB,YAAO,iBAAA,MAAA,MAAA;EAKlB,eAAgB,aAAa,MAAM,qBAAmB,WAAa,UAAU,aAAa,MAAC,aAAA,IAAA,IAAA,IAAA,IAAA;EAI3F,UAAW,aAAa,MAAM,qBAAmB,WACpC,UAAU,aAAa,GAAC,WACzB,aAIK,iBAAiB,IAAI,IAAI,IAAI,KAAK;EAGnD,UAAO,mBAAqB,mBAAmB;EAQ/C,mBAAgB,mBAAqB,mBAAmB;EAQxD,UAAO;EAMP,kBAAe,mBAAqB;UAO5B;EAOR,qBAAkB,mBAAqB"}
@@ -1,92 +1,109 @@
1
- // src/google-play/config.ts
2
1
  import { invariant } from "@shware/utils";
3
2
  import ms from "ms";
4
- var addMethod = /* @__PURE__ */ Symbol("addMethod");
3
+ //#region src/google-play/config.ts
4
+ const addMethod = Symbol("addMethod");
5
5
  var Subscription = class {
6
- productId;
7
- config;
8
- plans;
9
- defaultPlans;
10
- constructor(config, productId) {
11
- this.config = config;
12
- this.productId = productId;
13
- this.plans = /* @__PURE__ */ new Map();
14
- this.defaultPlans = /* @__PURE__ */ new Set();
15
- }
16
- basePlan = (planId, plan, metadata = { credits: 0, expiresIn: "0" }) => {
17
- this.plans.set(planId, { ...metadata, plan });
18
- return this;
19
- };
20
- default = (planIds) => {
21
- planIds.forEach((planId) => this.defaultPlans.add(planId));
22
- this.config[addMethod](this);
23
- return this.config;
24
- };
6
+ productId;
7
+ config;
8
+ plans;
9
+ defaultPlans;
10
+ constructor(config, productId) {
11
+ this.config = config;
12
+ this.productId = productId;
13
+ this.plans = /* @__PURE__ */ new Map();
14
+ this.defaultPlans = /* @__PURE__ */ new Set();
15
+ }
16
+ basePlan = (planId, plan, billingPeriod, metadata = {
17
+ credits: 0,
18
+ expiresIn: "0"
19
+ }) => {
20
+ this.plans.set(planId, {
21
+ ...metadata,
22
+ plan,
23
+ billingPeriod
24
+ });
25
+ return this;
26
+ };
27
+ default = (planIds) => {
28
+ planIds.forEach((planId) => this.defaultPlans.add(planId));
29
+ this.config[addMethod](this);
30
+ return this.config;
31
+ };
25
32
  };
26
- var GooglePlayConfig = class _GooglePlayConfig {
27
- package;
28
- audience;
29
- onetimes;
30
- subscriptions;
31
- products;
32
- [addMethod] = (subscription) => {
33
- subscription.plans.forEach((metadata, planId) => {
34
- this.products.set(this.getId(subscription.productId, planId), metadata);
35
- });
36
- this.subscriptions.set(subscription.productId, subscription);
37
- return this;
38
- };
39
- getId = (productId, planId) => {
40
- return planId ? `${productId}:${planId}` : productId;
41
- };
42
- constructor(options) {
43
- this.package = options.package;
44
- this.audience = options.audience;
45
- this.products = /* @__PURE__ */ new Map();
46
- this.onetimes = /* @__PURE__ */ new Set();
47
- this.subscriptions = /* @__PURE__ */ new Map();
48
- }
49
- static create = (options) => {
50
- return new _GooglePlayConfig(options);
51
- };
52
- subscription = (productId) => {
53
- return new Subscription(this, productId);
54
- };
55
- onetime = (productId, metadata = { credits: 0, expiresIn: "0" }) => {
56
- this.onetimes.add(productId);
57
- this.products.set(productId, metadata);
58
- return this;
59
- };
60
- getPlan = (productId, planId) => {
61
- const id = this.getId(productId, planId);
62
- const metadata = this.products.get(id);
63
- invariant(metadata, `Product not found for ${id}`);
64
- invariant(metadata.plan, `Plan not found for ${id}`);
65
- return metadata.plan;
66
- };
67
- getMode = (productId) => {
68
- if (this.onetimes.has(productId)) return "payment";
69
- if (this.subscriptions.has(productId)) return "subscription";
70
- throw new Error(`Mode not found for product ${productId}`);
71
- };
72
- getCreditAmount = (productId, planId) => {
73
- const id = this.getId(productId, planId);
74
- const metadata = this.products.get(id);
75
- invariant(metadata, `Product not found for ${id}`);
76
- return metadata.credits;
77
- };
78
- getCreditExpiresIn = (productId, planId) => {
79
- const id = this.getId(productId, planId);
80
- const metadata = this.products.get(id);
81
- invariant(metadata, `Product not found for ${id}`);
82
- return ms(metadata.expiresIn);
83
- };
84
- getCreditExpiresAt = (productId, planId) => {
85
- const expiresIn = this.getCreditExpiresIn(productId, planId);
86
- return new Date(Date.now() + expiresIn).toISOString();
87
- };
88
- };
89
- export {
90
- GooglePlayConfig
33
+ var GooglePlayConfig = class GooglePlayConfig {
34
+ package;
35
+ audience;
36
+ onetimes;
37
+ subscriptions;
38
+ products;
39
+ [addMethod] = (subscription) => {
40
+ subscription.plans.forEach((metadata, planId) => {
41
+ this.products.set(this.getId(subscription.productId, planId), metadata);
42
+ });
43
+ this.subscriptions.set(subscription.productId, subscription);
44
+ return this;
45
+ };
46
+ getId = (productId, planId) => {
47
+ return planId ? `${productId}:${planId}` : productId;
48
+ };
49
+ constructor(options) {
50
+ this.package = options.package;
51
+ this.audience = options.audience;
52
+ this.products = /* @__PURE__ */ new Map();
53
+ this.onetimes = /* @__PURE__ */ new Set();
54
+ this.subscriptions = /* @__PURE__ */ new Map();
55
+ }
56
+ static create = (options) => {
57
+ return new GooglePlayConfig(options);
58
+ };
59
+ subscription = (productId) => {
60
+ return new Subscription(this, productId);
61
+ };
62
+ onetime = (productId, metadata = {
63
+ credits: 0,
64
+ expiresIn: "0"
65
+ }) => {
66
+ this.onetimes.add(productId);
67
+ this.products.set(productId, metadata);
68
+ return this;
69
+ };
70
+ getPlan = (productId, planId) => {
71
+ const id = this.getId(productId, planId);
72
+ const metadata = this.products.get(id);
73
+ invariant(metadata, `Product not found for ${id}`);
74
+ invariant(metadata.plan, `Plan not found for ${id}`);
75
+ return metadata.plan;
76
+ };
77
+ getBillingPeriod = (productId, planId) => {
78
+ const id = this.getId(productId, planId);
79
+ const metadata = this.products.get(id);
80
+ invariant(metadata, `Product not found for ${id}`);
81
+ invariant(metadata.billingPeriod, `Billing period not found for ${id}`);
82
+ return metadata.billingPeriod;
83
+ };
84
+ getMode = (productId) => {
85
+ if (this.onetimes.has(productId)) return "payment";
86
+ if (this.subscriptions.has(productId)) return "subscription";
87
+ throw new Error(`Mode not found for product ${productId}`);
88
+ };
89
+ getCreditAmount = (productId, planId) => {
90
+ const id = this.getId(productId, planId);
91
+ const metadata = this.products.get(id);
92
+ invariant(metadata, `Product not found for ${id}`);
93
+ return metadata.credits;
94
+ };
95
+ getCreditExpiresIn = (productId, planId) => {
96
+ const id = this.getId(productId, planId);
97
+ const metadata = this.products.get(id);
98
+ invariant(metadata, `Product not found for ${id}`);
99
+ return ms(metadata.expiresIn);
100
+ };
101
+ getCreditExpiresAt = (productId, planId) => {
102
+ const expiresIn = this.getCreditExpiresIn(productId, planId);
103
+ return new Date(Date.now() + expiresIn).toISOString();
104
+ };
91
105
  };
106
+ //#endregion
107
+ export { GooglePlayConfig };
108
+
92
109
  //# sourceMappingURL=config.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/google-play/config.ts"],"sourcesContent":["import { invariant } from '@shware/utils';\nimport ms from 'ms';\nimport type { IsUnique, Metadata } from '../types';\n\nconst addMethod = Symbol('addMethod');\n\nclass Subscription<\n NS extends Lowercase<string> = Lowercase<string>,\n PE extends string = string,\n PI extends string = never,\n I extends Lowercase<string> = never,\n> {\n readonly productId: string;\n readonly config: GooglePlayConfig<NS, PE, PI>;\n readonly plans: Map<string, Metadata & { plan?: PE }>;\n readonly defaultPlans: Set<string>;\n\n constructor(config: GooglePlayConfig<NS, PE, PI>, productId: string) {\n this.config = config;\n this.productId = productId;\n this.plans = new Map();\n this.defaultPlans = new Set();\n }\n\n basePlan = <K extends Lowercase<string>>(\n planId: K extends I ? never : K,\n plan: PE,\n metadata: Metadata = { credits: 0, expiresIn: '0' }\n ): Subscription<NS, PE, PI, I | K> => {\n this.plans.set(planId, { ...metadata, plan });\n return this;\n };\n\n default = <const T extends readonly [I, ...I[]]>(\n planIds: T & (IsUnique<T> extends true ? unknown : never)\n ) => {\n planIds.forEach((planId) => this.defaultPlans.add(planId));\n this.config[addMethod](this);\n return this.config;\n };\n}\n\ntype Options = { package: string; audience: string };\n\nexport class GooglePlayConfig<\n NS extends Lowercase<string> = Lowercase<string>,\n PE extends string = string,\n PI extends string = never,\n> {\n readonly package: string;\n readonly audience: string;\n private onetimes: Set<string>;\n private subscriptions: Map<string, Subscription<NS, PE, PI>>;\n private products: Map<string, (Metadata & { plan?: PE }) | null>;\n\n [addMethod] = (subscription: Subscription<NS, PE, PI>) => {\n subscription.plans.forEach((metadata, planId) => {\n this.products.set(this.getId(subscription.productId, planId), metadata);\n });\n this.subscriptions.set(subscription.productId, subscription);\n return this;\n };\n\n private getId = (productId: string, planId?: string) => {\n return planId ? `${productId}:${planId}` : productId;\n };\n\n private constructor(options: Options) {\n this.package = options.package;\n this.audience = options.audience;\n this.products = new Map();\n this.onetimes = new Set();\n this.subscriptions = new Map();\n }\n\n static create = <NS extends Lowercase<string>, PE extends string = string>(options: Options) => {\n return new GooglePlayConfig<NS, PE>(options);\n };\n\n subscription = <K extends `${NS}.${Lowercase<string>}`>(productId: K extends PI ? never : K) => {\n return new Subscription<NS, PE, PI | K>(this, productId);\n };\n\n onetime = <K extends `${NS}.${Lowercase<string>}`>(\n productId: K extends PI ? never : K,\n metadata: Metadata = { credits: 0, expiresIn: '0' }\n ) => {\n this.onetimes.add(productId);\n this.products.set(productId, metadata);\n return this as GooglePlayConfig<NS, PE, PI | K>;\n };\n\n getPlan = (productId: string, planId: string): PE => {\n const id = this.getId(productId, planId);\n const metadata = this.products.get(id);\n invariant(metadata, `Product not found for ${id}`);\n invariant(metadata.plan, `Plan not found for ${id}`);\n return metadata.plan;\n };\n\n getMode = (productId: string): 'payment' | 'subscription' => {\n if (this.onetimes.has(productId)) return 'payment';\n if (this.subscriptions.has(productId)) return 'subscription';\n throw new Error(`Mode not found for product ${productId}`);\n };\n\n getCreditAmount = (productId: string, planId?: string): number => {\n const id = this.getId(productId, planId);\n const metadata = this.products.get(id);\n invariant(metadata, `Product not found for ${id}`);\n return metadata.credits;\n };\n\n private getCreditExpiresIn = (productId: string, planId?: string): number => {\n const id = this.getId(productId, planId);\n const metadata = this.products.get(id);\n invariant(metadata, `Product not found for ${id}`);\n return ms(metadata.expiresIn);\n };\n\n getCreditExpiresAt = (productId: string, planId?: string): string => {\n const expiresIn = this.getCreditExpiresIn(productId, planId);\n return new Date(Date.now() + expiresIn).toISOString();\n };\n}\n"],"mappings":";AAAA,SAAS,iBAAiB;AAC1B,OAAO,QAAQ;AAGf,IAAM,YAAY,uBAAO,WAAW;AAEpC,IAAM,eAAN,MAKE;AAAA,EACS;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAET,YAAY,QAAsC,WAAmB;AACnE,SAAK,SAAS;AACd,SAAK,YAAY;AACjB,SAAK,QAAQ,oBAAI,IAAI;AACrB,SAAK,eAAe,oBAAI,IAAI;AAAA,EAC9B;AAAA,EAEA,WAAW,CACT,QACA,MACA,WAAqB,EAAE,SAAS,GAAG,WAAW,IAAI,MACd;AACpC,SAAK,MAAM,IAAI,QAAQ,EAAE,GAAG,UAAU,KAAK,CAAC;AAC5C,WAAO;AAAA,EACT;AAAA,EAEA,UAAU,CACR,YACG;AACH,YAAQ,QAAQ,CAAC,WAAW,KAAK,aAAa,IAAI,MAAM,CAAC;AACzD,SAAK,OAAO,SAAS,EAAE,IAAI;AAC3B,WAAO,KAAK;AAAA,EACd;AACF;AAIO,IAAM,mBAAN,MAAM,kBAIX;AAAA,EACS;AAAA,EACA;AAAA,EACD;AAAA,EACA;AAAA,EACA;AAAA,EAER,CAAC,SAAS,IAAI,CAAC,iBAA2C;AACxD,iBAAa,MAAM,QAAQ,CAAC,UAAU,WAAW;AAC/C,WAAK,SAAS,IAAI,KAAK,MAAM,aAAa,WAAW,MAAM,GAAG,QAAQ;AAAA,IACxE,CAAC;AACD,SAAK,cAAc,IAAI,aAAa,WAAW,YAAY;AAC3D,WAAO;AAAA,EACT;AAAA,EAEQ,QAAQ,CAAC,WAAmB,WAAoB;AACtD,WAAO,SAAS,GAAG,SAAS,IAAI,MAAM,KAAK;AAAA,EAC7C;AAAA,EAEQ,YAAY,SAAkB;AACpC,SAAK,UAAU,QAAQ;AACvB,SAAK,WAAW,QAAQ;AACxB,SAAK,WAAW,oBAAI,IAAI;AACxB,SAAK,WAAW,oBAAI,IAAI;AACxB,SAAK,gBAAgB,oBAAI,IAAI;AAAA,EAC/B;AAAA,EAEA,OAAO,SAAS,CAA2D,YAAqB;AAC9F,WAAO,IAAI,kBAAyB,OAAO;AAAA,EAC7C;AAAA,EAEA,eAAe,CAAyC,cAAwC;AAC9F,WAAO,IAAI,aAA6B,MAAM,SAAS;AAAA,EACzD;AAAA,EAEA,UAAU,CACR,WACA,WAAqB,EAAE,SAAS,GAAG,WAAW,IAAI,MAC/C;AACH,SAAK,SAAS,IAAI,SAAS;AAC3B,SAAK,SAAS,IAAI,WAAW,QAAQ;AACrC,WAAO;AAAA,EACT;AAAA,EAEA,UAAU,CAAC,WAAmB,WAAuB;AACnD,UAAM,KAAK,KAAK,MAAM,WAAW,MAAM;AACvC,UAAM,WAAW,KAAK,SAAS,IAAI,EAAE;AACrC,cAAU,UAAU,yBAAyB,EAAE,EAAE;AACjD,cAAU,SAAS,MAAM,sBAAsB,EAAE,EAAE;AACnD,WAAO,SAAS;AAAA,EAClB;AAAA,EAEA,UAAU,CAAC,cAAkD;AAC3D,QAAI,KAAK,SAAS,IAAI,SAAS,EAAG,QAAO;AACzC,QAAI,KAAK,cAAc,IAAI,SAAS,EAAG,QAAO;AAC9C,UAAM,IAAI,MAAM,8BAA8B,SAAS,EAAE;AAAA,EAC3D;AAAA,EAEA,kBAAkB,CAAC,WAAmB,WAA4B;AAChE,UAAM,KAAK,KAAK,MAAM,WAAW,MAAM;AACvC,UAAM,WAAW,KAAK,SAAS,IAAI,EAAE;AACrC,cAAU,UAAU,yBAAyB,EAAE,EAAE;AACjD,WAAO,SAAS;AAAA,EAClB;AAAA,EAEQ,qBAAqB,CAAC,WAAmB,WAA4B;AAC3E,UAAM,KAAK,KAAK,MAAM,WAAW,MAAM;AACvC,UAAM,WAAW,KAAK,SAAS,IAAI,EAAE;AACrC,cAAU,UAAU,yBAAyB,EAAE,EAAE;AACjD,WAAO,GAAG,SAAS,SAAS;AAAA,EAC9B;AAAA,EAEA,qBAAqB,CAAC,WAAmB,WAA4B;AACnE,UAAM,YAAY,KAAK,mBAAmB,WAAW,MAAM;AAC3D,WAAO,IAAI,KAAK,KAAK,IAAI,IAAI,SAAS,EAAE,YAAY;AAAA,EACtD;AACF;","names":[]}
1
+ {"version":3,"file":"config.mjs","names":[],"sources":["../../src/google-play/config.ts"],"sourcesContent":["import { invariant } from '@shware/utils';\nimport ms from 'ms';\nimport type { IsUnique, Metadata } from '../types';\n\nconst addMethod = Symbol('addMethod');\n\nclass Subscription<\n NS extends Lowercase<string> = Lowercase<string>,\n PE extends string = string,\n BP extends string = string,\n PI extends string = never,\n I extends Lowercase<string> = never,\n> {\n readonly productId: string;\n readonly config: GooglePlayConfig<NS, PE, BP, PI>;\n readonly plans: Map<string, Metadata & { plan?: PE; billingPeriod?: BP }>;\n readonly defaultPlans: Set<string>;\n\n constructor(config: GooglePlayConfig<NS, PE, BP, PI>, productId: string) {\n this.config = config;\n this.productId = productId;\n this.plans = new Map();\n this.defaultPlans = new Set();\n }\n\n basePlan = <K extends Lowercase<string>>(\n planId: K extends I ? never : K,\n plan: PE,\n billingPeriod: BP,\n metadata: Metadata = { credits: 0, expiresIn: '0' }\n ): Subscription<NS, PE, BP, PI, I | K> => {\n this.plans.set(planId, { ...metadata, plan, billingPeriod });\n return this;\n };\n\n default = <const T extends readonly [I, ...I[]]>(\n planIds: T & (IsUnique<T> extends true ? unknown : never)\n ) => {\n planIds.forEach((planId) => this.defaultPlans.add(planId));\n this.config[addMethod](this);\n return this.config;\n };\n}\n\ntype Options = { package: string; audience: string };\n\nexport class GooglePlayConfig<\n NS extends Lowercase<string> = Lowercase<string>,\n PE extends string = string,\n BP extends string = string,\n PI extends string = never,\n> {\n readonly package: string;\n readonly audience: string;\n private onetimes: Set<string>;\n private subscriptions: Map<string, Subscription<NS, PE, BP, PI>>;\n private products: Map<string, (Metadata & { plan?: PE; billingPeriod?: BP }) | null>;\n\n [addMethod] = (subscription: Subscription<NS, PE, BP, PI>) => {\n subscription.plans.forEach((metadata, planId) => {\n this.products.set(this.getId(subscription.productId, planId), metadata);\n });\n this.subscriptions.set(subscription.productId, subscription);\n return this;\n };\n\n private getId = (productId: string, planId?: string) => {\n return planId ? `${productId}:${planId}` : productId;\n };\n\n private constructor(options: Options) {\n this.package = options.package;\n this.audience = options.audience;\n this.products = new Map();\n this.onetimes = new Set();\n this.subscriptions = new Map();\n }\n\n static create = <\n NS extends Lowercase<string>,\n PE extends string = string,\n BP extends string = string,\n >(\n options: Options\n ) => {\n return new GooglePlayConfig<NS, PE, BP>(options);\n };\n\n subscription = <K extends `${NS}.${Lowercase<string>}`>(productId: K extends PI ? never : K) => {\n return new Subscription<NS, PE, BP, PI | K>(this, productId);\n };\n\n onetime = <K extends `${NS}.${Lowercase<string>}`>(\n productId: K extends PI ? never : K,\n metadata: Metadata = { credits: 0, expiresIn: '0' }\n ) => {\n this.onetimes.add(productId);\n this.products.set(productId, metadata);\n return this as GooglePlayConfig<NS, PE, BP, PI | K>;\n };\n\n getPlan = (productId: string, planId: string): PE => {\n const id = this.getId(productId, planId);\n const metadata = this.products.get(id);\n invariant(metadata, `Product not found for ${id}`);\n invariant(metadata.plan, `Plan not found for ${id}`);\n return metadata.plan;\n };\n\n getBillingPeriod = (productId: string, planId: string): BP => {\n const id = this.getId(productId, planId);\n const metadata = this.products.get(id);\n invariant(metadata, `Product not found for ${id}`);\n invariant(metadata.billingPeriod, `Billing period not found for ${id}`);\n return metadata.billingPeriod;\n };\n\n getMode = (productId: string): 'payment' | 'subscription' => {\n if (this.onetimes.has(productId)) return 'payment';\n if (this.subscriptions.has(productId)) return 'subscription';\n throw new Error(`Mode not found for product ${productId}`);\n };\n\n getCreditAmount = (productId: string, planId?: string): number => {\n const id = this.getId(productId, planId);\n const metadata = this.products.get(id);\n invariant(metadata, `Product not found for ${id}`);\n return metadata.credits;\n };\n\n private getCreditExpiresIn = (productId: string, planId?: string): number => {\n const id = this.getId(productId, planId);\n const metadata = this.products.get(id);\n invariant(metadata, `Product not found for ${id}`);\n return ms(metadata.expiresIn);\n };\n\n getCreditExpiresAt = (productId: string, planId?: string): string => {\n const expiresIn = this.getCreditExpiresIn(productId, planId);\n return new Date(Date.now() + expiresIn).toISOString();\n };\n}\n"],"mappings":"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"}
@@ -1,42 +1,9 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/google-play/index.ts
21
- var google_play_exports = {};
22
- __export(google_play_exports, {
23
- GooglePlayConfig: () => import_config.GooglePlayConfig,
24
- GooglePlaySubscriptionState: () => import_real_time_developer_notification.GooglePlaySubscriptionState,
25
- OneTimeProductNotificationType: () => import_real_time_developer_notification.OneTimeProductNotificationType,
26
- SubscriptionNotificationType: () => import_real_time_developer_notification.SubscriptionNotificationType,
27
- VoidedPurchaseProductType: () => import_real_time_developer_notification.VoidedPurchaseProductType,
28
- VoidedPurchaseRefundType: () => import_real_time_developer_notification.VoidedPurchaseRefundType
29
- });
30
- module.exports = __toCommonJS(google_play_exports);
31
- var import_real_time_developer_notification = require("./real-time-developer-notification.cjs");
32
- var import_config = require("./config.cjs");
33
- // Annotate the CommonJS export names for ESM import in node:
34
- 0 && (module.exports = {
35
- GooglePlayConfig,
36
- GooglePlaySubscriptionState,
37
- OneTimeProductNotificationType,
38
- SubscriptionNotificationType,
39
- VoidedPurchaseProductType,
40
- VoidedPurchaseRefundType
41
- });
42
- //# sourceMappingURL=index.cjs.map
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_google_play_config = require("./config.cjs");
3
+ const require_google_play_real_time_developer_notification = require("./real-time-developer-notification.cjs");
4
+ exports.GooglePlayConfig = require_google_play_config.GooglePlayConfig;
5
+ exports.GooglePlaySubscriptionState = require_google_play_real_time_developer_notification.GooglePlaySubscriptionState;
6
+ exports.OneTimeProductNotificationType = require_google_play_real_time_developer_notification.OneTimeProductNotificationType;
7
+ exports.SubscriptionNotificationType = require_google_play_real_time_developer_notification.SubscriptionNotificationType;
8
+ exports.VoidedPurchaseProductType = require_google_play_real_time_developer_notification.VoidedPurchaseProductType;
9
+ exports.VoidedPurchaseRefundType = require_google_play_real_time_developer_notification.VoidedPurchaseRefundType;
@@ -1,4 +1,3 @@
1
- export { DeveloperNotification, GooglePlaySubscriptionState, OneTimeProductNotification, OneTimeProductNotificationType, PubsubMessage, SubscriptionNotification, SubscriptionNotificationType, TestNotification, VoidedPurchaseNotification, VoidedPurchaseProductType, VoidedPurchaseRefundType } from './real-time-developer-notification.cjs';
2
- export { GooglePlayConfig } from './config.cjs';
3
- import '../types.cjs';
4
- import 'ms';
1
+ import { GooglePlayConfig } from "./config.cjs";
2
+ import { DeveloperNotification, GooglePlaySubscriptionState, OneTimeProductNotification, OneTimeProductNotificationType, PubsubMessage, SubscriptionNotification, SubscriptionNotificationType, TestNotification, VoidedPurchaseNotification, VoidedPurchaseProductType, VoidedPurchaseRefundType } from "./real-time-developer-notification.cjs";
3
+ export { type DeveloperNotification, GooglePlayConfig, GooglePlaySubscriptionState, type OneTimeProductNotification, OneTimeProductNotificationType, type PubsubMessage, type SubscriptionNotification, SubscriptionNotificationType, type TestNotification, type VoidedPurchaseNotification, VoidedPurchaseProductType, VoidedPurchaseRefundType };
@@ -0,0 +1,3 @@
1
+ import { GooglePlayConfig } from "./config.mjs";
2
+ import { DeveloperNotification, GooglePlaySubscriptionState, OneTimeProductNotification, OneTimeProductNotificationType, PubsubMessage, SubscriptionNotification, SubscriptionNotificationType, TestNotification, VoidedPurchaseNotification, VoidedPurchaseProductType, VoidedPurchaseRefundType } from "./real-time-developer-notification.mjs";
3
+ export { type DeveloperNotification, GooglePlayConfig, GooglePlaySubscriptionState, type OneTimeProductNotification, OneTimeProductNotificationType, type PubsubMessage, type SubscriptionNotification, SubscriptionNotificationType, type TestNotification, type VoidedPurchaseNotification, VoidedPurchaseProductType, VoidedPurchaseRefundType };
@@ -1,18 +1,3 @@
1
- // src/google-play/index.ts
2
- import {
3
- GooglePlaySubscriptionState,
4
- SubscriptionNotificationType,
5
- OneTimeProductNotificationType,
6
- VoidedPurchaseProductType,
7
- VoidedPurchaseRefundType
8
- } from "./real-time-developer-notification.mjs";
9
1
  import { GooglePlayConfig } from "./config.mjs";
10
- export {
11
- GooglePlayConfig,
12
- GooglePlaySubscriptionState,
13
- OneTimeProductNotificationType,
14
- SubscriptionNotificationType,
15
- VoidedPurchaseProductType,
16
- VoidedPurchaseRefundType
17
- };
18
- //# sourceMappingURL=index.mjs.map
2
+ import { GooglePlaySubscriptionState, OneTimeProductNotificationType, SubscriptionNotificationType, VoidedPurchaseProductType, VoidedPurchaseRefundType } from "./real-time-developer-notification.mjs";
3
+ export { GooglePlayConfig, GooglePlaySubscriptionState, OneTimeProductNotificationType, SubscriptionNotificationType, VoidedPurchaseProductType, VoidedPurchaseRefundType };