recur-tw 0.19.0 → 0.20.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/dist/index.cjs CHANGED
@@ -3249,7 +3249,7 @@ function toCamelCase(obj) {
3249
3249
 
3250
3250
  //#endregion
3251
3251
  //#region package.json
3252
- var version = "0.19.0";
3252
+ var version = "0.20.0";
3253
3253
 
3254
3254
  //#endregion
3255
3255
  //#region src/context.tsx
package/dist/index.js CHANGED
@@ -3224,7 +3224,7 @@ function toCamelCase(obj) {
3224
3224
 
3225
3225
  //#endregion
3226
3226
  //#region package.json
3227
- var version = "0.19.0";
3227
+ var version = "0.20.0";
3228
3228
 
3229
3229
  //#endregion
3230
3230
  //#region src/context.tsx
package/dist/recur.umd.js CHANGED
@@ -2245,7 +2245,7 @@ function ee(e,t){if(!w(e)||!e.hasOwnProperty(`raw`))throw Error(`invalid templat
2245
2245
  <path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"/>
2246
2246
  <circle cx="12" cy="7" r="4"/>
2247
2247
  </svg>
2248
- `}setupEventListeners(){let e=this.shadowRoot?.querySelector(`button`);e&&e.addEventListener(`click`,this.handleClick)}redirectToPortal(e){let t=this.getAttribute(`target`);this.dispatchEvent(new CustomEvent(`portal-redirect`,{detail:{url:e},bubbles:!0,composed:!0})),t===`_blank`?window.open(e,`_blank`,`noopener,noreferrer`):window.location.href=e}async fetchAndRedirect(e){let t=this.getAttribute(`customer-id`),n=this.getAttribute(`return-url`);this._isLoading=!0,this.render(),this.setupEventListeners();try{let r={};t&&(r.customerId=t),n&&(r.returnUrl=n);let i=await fetch(e,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(r)});if(!i.ok){let e=await i.json().catch(()=>({}));throw Error(e.error?.message||e.message||`HTTP ${i.status}: Failed to create portal session`)}let a=await i.json(),o=a.url||a.portalUrl;if(!o)throw Error(`Portal URL not found in response`);this._isLoading=!1,this.render(),this.setupEventListeners(),this.redirectToPortal(o)}catch(e){this._isLoading=!1,this.render(),this.setupEventListeners(),this.dispatchError(e instanceof Error?e.message:`Failed to create portal session`)}}dispatchError(e){console.error(`[recur-portal]`,e),this.dispatchEvent(new CustomEvent(`portal-error`,{detail:{message:e},bubbles:!0,composed:!0}))}},typeof window<`u`&&!customElements.get(`recur-portal`)&&customElements.define(`recur-portal`,nt)}));async function it(){if(typeof window>`u`){console.warn(`[Recur SDK] Cannot register Web Components: window is not defined`);return}await Promise.all([Promise.resolve().then(()=>(o(),i)),Promise.resolve().then(()=>(l(),s)),Promise.resolve().then(()=>(f(),u)),Promise.resolve().then(()=>(h(),p)),Promise.resolve().then(()=>(Se(),ye)),Promise.resolve().then(()=>(Ae(),Oe)),Promise.resolve().then(()=>(Le(),Pe)),Promise.resolve().then(()=>(Ze(),Ye)),Promise.resolve().then(()=>(et(),Qe)),Promise.resolve().then(()=>(rt(),tt))]);let e=[`recur-loading-spinner`,`recur-success-message`,`recur-error-display`,`recur-skeleton-loader`,`recur-payment-form-skeleton`,`recur-toast`,`recur-toast-container`,`recur-einvoice-section`,`recur-payment-form`,`recur-checkout`,`recur-portal`].filter(e=>!customElements.get(e));e.length>0&&console.warn(`[Recur SDK] The following components are not registered:`,e)}typeof window<`u`&&it();function at(e){return e.replace(/_([a-z])/g,(e,t)=>t.toUpperCase())}function X(e){if(e==null)return e;if(Array.isArray(e))return e.map(e=>X(e));if(e instanceof Date)return e;if(typeof e==`object`){let t={};for(let[n,r]of Object.entries(e)){let e=at(n);t[e]=X(r)}return t}return e}var ot=`0.19.0`;V();let st=ot;var ct=class{constructor(e){if(B(this,`config`,void 0),!e.publishableKey)throw Error(`publishableKey is required`);this.config={baseUrl:`https://api.recur.tw`,...e}}getHeaders(){return{"Content-Type":`application/json`,"X-Recur-Publishable-Key":this.config.publishableKey,"X-Recur-SDK-Type":`vanilla`,"X-Recur-SDK-Version":st,"X-Recur-Source":typeof window<`u`?window.location.origin:`server`}}async createSubscription(e){let{customerName:t,customerEmail:n}=e,r=e.productId||e.planId,i=e.productSlug;if(!r&&!i)throw Error(`Either productId or productSlug is required`);let a={customerName:t,customerEmail:n};r&&(a.productId=r),i&&(a.productSlug=i);let o=await fetch(`${this.config.baseUrl}/v1/subscriptions`,{method:`POST`,headers:this.getHeaders(),body:JSON.stringify(a)});if(!o.ok){let e=await o.json().catch(()=>({}));throw{code:e.error||`CHECKOUT_FAILED`,message:e.message||`Failed to initiate checkout`,details:e}}return X(await o.json())}async fetchProducts(e){let t=new URL(`${this.config.baseUrl}/v1/products`);e?.type&&t.searchParams.set(`type`,e.type);let n=await fetch(t.toString(),{method:`GET`,headers:this.getHeaders()});if(!n.ok){let e=await n.json().catch(()=>({}));throw{code:e.error||`FETCH_PRODUCTS_FAILED`,message:e.message||`Failed to fetch products`,details:e}}return X(await n.json())}async fetchPlans(){return{plans:(await this.fetchProducts({type:`SUBSCRIPTION`})).data}}getConfig(){return{...this.config}}};V();var lt=class{constructor(e,t){if(B(this,`config`,void 0),B(this,`options`,void 0),B(this,`container`,void 0),B(this,`checkoutId`,null),B(this,`sdkToken`,null),B(this,`sdkTimestamp`,null),B(this,`creditToken`,null),B(this,`sdkEnv`,`S`),B(this,`payuniSDK`,null),B(this,`isFormValid`,!1),this.config=e,this.options=t,typeof t.container==`string`){let e=document.querySelector(t.container);if(!e)throw Error(`Container not found: ${t.container}`);this.container=e}else this.container=t.container}async render(){try{await this.initCheckout(),this.renderHTML(),await this.loadPayUniSDK(),await this.initPayUniSDK(),this.setupFormSubmit()}catch(e){this.handleError(e)}}getBaseUrl(){if(this.config.baseUrl)return this.config.baseUrl;if(typeof window<`u`){let e=window.location.hostname;if(e===`localhost`||e.includes(`.test`)||e.includes(`.local`)||e===`127.0.0.1`)return`${window.location.protocol}//${window.location.host}/api`}return`https://api.recur.tw`}async initCheckout(){let e=this.getBaseUrl(),t=await fetch(`${e}/v1/checkouts`,{method:`POST`,headers:{"Content-Type":`application/json`,"X-Recur-Publishable-Key":this.config.publishableKey},body:JSON.stringify({productId:this.options.productId||this.options.planId,customerEmail:this.options.customerEmail,customerName:this.options.customerName})});if(!t.ok){let e=await t.json().catch(()=>({}));throw Error(e.error||`Failed to initialize checkout`)}let n=X(await t.json());this.checkoutId=n.checkout.id,this.sdkToken=n.sdkToken,this.sdkTimestamp=n.sdkTimestamp||null,this.creditToken=n.creditToken||null,this.sdkEnv=n.livemode?`P`:`S`}renderHTML(){this.container.innerHTML=`
2248
+ `}setupEventListeners(){let e=this.shadowRoot?.querySelector(`button`);e&&e.addEventListener(`click`,this.handleClick)}redirectToPortal(e){let t=this.getAttribute(`target`);this.dispatchEvent(new CustomEvent(`portal-redirect`,{detail:{url:e},bubbles:!0,composed:!0})),t===`_blank`?window.open(e,`_blank`,`noopener,noreferrer`):window.location.href=e}async fetchAndRedirect(e){let t=this.getAttribute(`customer-id`),n=this.getAttribute(`return-url`);this._isLoading=!0,this.render(),this.setupEventListeners();try{let r={};t&&(r.customerId=t),n&&(r.returnUrl=n);let i=await fetch(e,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(r)});if(!i.ok){let e=await i.json().catch(()=>({}));throw Error(e.error?.message||e.message||`HTTP ${i.status}: Failed to create portal session`)}let a=await i.json(),o=a.url||a.portalUrl;if(!o)throw Error(`Portal URL not found in response`);this._isLoading=!1,this.render(),this.setupEventListeners(),this.redirectToPortal(o)}catch(e){this._isLoading=!1,this.render(),this.setupEventListeners(),this.dispatchError(e instanceof Error?e.message:`Failed to create portal session`)}}dispatchError(e){console.error(`[recur-portal]`,e),this.dispatchEvent(new CustomEvent(`portal-error`,{detail:{message:e},bubbles:!0,composed:!0}))}},typeof window<`u`&&!customElements.get(`recur-portal`)&&customElements.define(`recur-portal`,nt)}));async function it(){if(typeof window>`u`){console.warn(`[Recur SDK] Cannot register Web Components: window is not defined`);return}await Promise.all([Promise.resolve().then(()=>(o(),i)),Promise.resolve().then(()=>(l(),s)),Promise.resolve().then(()=>(f(),u)),Promise.resolve().then(()=>(h(),p)),Promise.resolve().then(()=>(Se(),ye)),Promise.resolve().then(()=>(Ae(),Oe)),Promise.resolve().then(()=>(Le(),Pe)),Promise.resolve().then(()=>(Ze(),Ye)),Promise.resolve().then(()=>(et(),Qe)),Promise.resolve().then(()=>(rt(),tt))]);let e=[`recur-loading-spinner`,`recur-success-message`,`recur-error-display`,`recur-skeleton-loader`,`recur-payment-form-skeleton`,`recur-toast`,`recur-toast-container`,`recur-einvoice-section`,`recur-payment-form`,`recur-checkout`,`recur-portal`].filter(e=>!customElements.get(e));e.length>0&&console.warn(`[Recur SDK] The following components are not registered:`,e)}typeof window<`u`&&it();function at(e){return e.replace(/_([a-z])/g,(e,t)=>t.toUpperCase())}function X(e){if(e==null)return e;if(Array.isArray(e))return e.map(e=>X(e));if(e instanceof Date)return e;if(typeof e==`object`){let t={};for(let[n,r]of Object.entries(e)){let e=at(n);t[e]=X(r)}return t}return e}var ot=`0.20.0`;V();let st=ot;var ct=class{constructor(e){if(B(this,`config`,void 0),!e.publishableKey)throw Error(`publishableKey is required`);this.config={baseUrl:`https://api.recur.tw`,...e}}getHeaders(){return{"Content-Type":`application/json`,"X-Recur-Publishable-Key":this.config.publishableKey,"X-Recur-SDK-Type":`vanilla`,"X-Recur-SDK-Version":st,"X-Recur-Source":typeof window<`u`?window.location.origin:`server`}}async createSubscription(e){let{customerName:t,customerEmail:n}=e,r=e.productId||e.planId,i=e.productSlug;if(!r&&!i)throw Error(`Either productId or productSlug is required`);let a={customerName:t,customerEmail:n};r&&(a.productId=r),i&&(a.productSlug=i);let o=await fetch(`${this.config.baseUrl}/v1/subscriptions`,{method:`POST`,headers:this.getHeaders(),body:JSON.stringify(a)});if(!o.ok){let e=await o.json().catch(()=>({}));throw{code:e.error||`CHECKOUT_FAILED`,message:e.message||`Failed to initiate checkout`,details:e}}return X(await o.json())}async fetchProducts(e){let t=new URL(`${this.config.baseUrl}/v1/products`);e?.type&&t.searchParams.set(`type`,e.type);let n=await fetch(t.toString(),{method:`GET`,headers:this.getHeaders()});if(!n.ok){let e=await n.json().catch(()=>({}));throw{code:e.error||`FETCH_PRODUCTS_FAILED`,message:e.message||`Failed to fetch products`,details:e}}return X(await n.json())}async fetchPlans(){return{plans:(await this.fetchProducts({type:`SUBSCRIPTION`})).data}}getConfig(){return{...this.config}}};V();var lt=class{constructor(e,t){if(B(this,`config`,void 0),B(this,`options`,void 0),B(this,`container`,void 0),B(this,`checkoutId`,null),B(this,`sdkToken`,null),B(this,`sdkTimestamp`,null),B(this,`creditToken`,null),B(this,`sdkEnv`,`S`),B(this,`payuniSDK`,null),B(this,`isFormValid`,!1),this.config=e,this.options=t,typeof t.container==`string`){let e=document.querySelector(t.container);if(!e)throw Error(`Container not found: ${t.container}`);this.container=e}else this.container=t.container}async render(){try{await this.initCheckout(),this.renderHTML(),await this.loadPayUniSDK(),await this.initPayUniSDK(),this.setupFormSubmit()}catch(e){this.handleError(e)}}getBaseUrl(){if(this.config.baseUrl)return this.config.baseUrl;if(typeof window<`u`){let e=window.location.hostname;if(e===`localhost`||e.includes(`.test`)||e.includes(`.local`)||e===`127.0.0.1`)return`${window.location.protocol}//${window.location.host}/api`}return`https://api.recur.tw`}async initCheckout(){let e=this.getBaseUrl(),t=await fetch(`${e}/v1/checkouts`,{method:`POST`,headers:{"Content-Type":`application/json`,"X-Recur-Publishable-Key":this.config.publishableKey},body:JSON.stringify({productId:this.options.productId||this.options.planId,customerEmail:this.options.customerEmail,customerName:this.options.customerName})});if(!t.ok){let e=await t.json().catch(()=>({}));throw Error(e.error||`Failed to initialize checkout`)}let n=X(await t.json());this.checkoutId=n.checkout.id,this.sdkToken=n.sdkToken,this.sdkTimestamp=n.sdkTimestamp||null,this.creditToken=n.creditToken||null,this.sdkEnv=n.livemode?`P`:`S`}renderHTML(){this.container.innerHTML=`
2249
2249
  <div class="recur-embedded-checkout" style="max-width: 400px; margin: 0 auto; padding: 20px; font-family: system-ui, -apple-system, sans-serif;">
2250
2250
  <div class="recur-checkout-header" style="margin-bottom: 24px;">
2251
2251
  <h2 style="margin: 0 0 8px 0; font-size: 20px; font-weight: 600; color: #111;">Subscribe</h2>
package/dist/server.cjs CHANGED
@@ -89,6 +89,46 @@ var RecurAPIError = class extends Error {
89
89
  }
90
90
  };
91
91
  /**
92
+ * All webhook event types Recur emits, as a runtime constant.
93
+ *
94
+ * Kept in exact sync with the platform's canonical event enum — a contract
95
+ * test (__tests__/webhook-event-contract.test.ts) fails on any drift.
96
+ */
97
+ const WEBHOOK_EVENT_TYPES = [
98
+ "checkout.created",
99
+ "checkout.completed",
100
+ "order.paid",
101
+ "order.payment_failed",
102
+ "subscription.created",
103
+ "subscription.activated",
104
+ "subscription.cancelled",
105
+ "subscription.revoked",
106
+ "subscription.expired",
107
+ "subscription.trial_ending",
108
+ "subscription.upgraded",
109
+ "subscription.downgraded",
110
+ "subscription.renewed",
111
+ "subscription.past_due",
112
+ "subscription.payment_method_required",
113
+ "subscription.schedule_created",
114
+ "subscription.schedule_executed",
115
+ "subscription.schedule_cancelled",
116
+ "invoice.created",
117
+ "invoice.paid",
118
+ "invoice.payment_failed",
119
+ "customer.created",
120
+ "customer.updated",
121
+ "product.created",
122
+ "product.updated",
123
+ "refund.created",
124
+ "refund.succeeded",
125
+ "refund.failed",
126
+ "einvoice.issued",
127
+ "einvoice.issue_failed",
128
+ "einvoice.voided",
129
+ "einvoice.allowance_created"
130
+ ];
131
+ /**
92
132
  * Error thrown when webhook signature verification fails
93
133
  */
94
134
  var WebhookSignatureVerificationError = class extends Error {
@@ -100,7 +140,7 @@ var WebhookSignatureVerificationError = class extends Error {
100
140
 
101
141
  //#endregion
102
142
  //#region package.json
103
- var version = "0.19.0";
143
+ var version = "0.20.0";
104
144
 
105
145
  //#endregion
106
146
  //#region src/server/resources/entitlements.ts
@@ -579,4 +619,5 @@ var Recur = class {
579
619
  //#endregion
580
620
  exports.Recur = Recur;
581
621
  exports.RecurAPIError = RecurAPIError;
622
+ exports.WEBHOOK_EVENT_TYPES = WEBHOOK_EVENT_TYPES;
582
623
  exports.WebhookSignatureVerificationError = WebhookSignatureVerificationError;
package/dist/server.d.cts CHANGED
@@ -251,13 +251,20 @@ interface EntitlementListResult {
251
251
  */
252
252
  entitlements: Entitlement[];
253
253
  }
254
+ /**
255
+ * All webhook event types Recur emits, as a runtime constant.
256
+ *
257
+ * Kept in exact sync with the platform's canonical event enum — a contract
258
+ * test (__tests__/webhook-event-contract.test.ts) fails on any drift.
259
+ */
260
+ declare const WEBHOOK_EVENT_TYPES: readonly ["checkout.created", "checkout.completed", "order.paid", "order.payment_failed", "subscription.created", "subscription.activated", "subscription.cancelled", "subscription.revoked", "subscription.expired", "subscription.trial_ending", "subscription.upgraded", "subscription.downgraded", "subscription.renewed", "subscription.past_due", "subscription.payment_method_required", "subscription.schedule_created", "subscription.schedule_executed", "subscription.schedule_cancelled", "invoice.created", "invoice.paid", "invoice.payment_failed", "customer.created", "customer.updated", "product.created", "product.updated", "refund.created", "refund.succeeded", "refund.failed", "einvoice.issued", "einvoice.issue_failed", "einvoice.voided", "einvoice.allowance_created"];
254
261
  /**
255
262
  * Known webhook event types
256
263
  *
257
264
  * Uses a union with `(string & {})` to allow unknown event types
258
265
  * while still providing autocomplete for known ones.
259
266
  */
260
- type WebhookEventType = 'checkout.completed' | 'subscription.created' | 'subscription.activated' | 'subscription.updated' | 'subscription.cancelled' | 'subscription.revoked' | 'subscription.expired' | 'subscription.trial_ending' | 'subscription.payment_failed' | 'invoice.created' | 'invoice.paid' | 'invoice.payment_failed' | 'invoice.refunded' | 'customer.created' | 'customer.updated' | 'order.paid' | (string & {});
267
+ type WebhookEventType = (typeof WEBHOOK_EVENT_TYPES)[number] | (string & {});
261
268
  /**
262
269
  * A webhook event received from Recur
263
270
  */
@@ -599,4 +606,4 @@ declare class Recur {
599
606
  constructor(secretKey: string, options?: Omit<RecurConfig, 'secretKey'>);
600
607
  }
601
608
  //#endregion
602
- export { type ApiErrorCode, type CustomerIdentifier, type DuplicateSubscriptionDetails, type Entitlement, type EntitlementCheckOptions, type EntitlementCheckResult, type EntitlementListOptions, type EntitlementListResult, type EntitlementStatus, type EntitlementSubscription, type PortalSession, type PortalSessionCreateParams, Recur, RecurAPIError, type RecurConfig, type RecurError, type WebhookEvent, type WebhookEventType, WebhookSignatureVerificationError };
609
+ export { type ApiErrorCode, type CustomerIdentifier, type DuplicateSubscriptionDetails, type Entitlement, type EntitlementCheckOptions, type EntitlementCheckResult, type EntitlementListOptions, type EntitlementListResult, type EntitlementStatus, type EntitlementSubscription, type PortalSession, type PortalSessionCreateParams, Recur, RecurAPIError, type RecurConfig, type RecurError, WEBHOOK_EVENT_TYPES, type WebhookEvent, type WebhookEventType, WebhookSignatureVerificationError };
package/dist/server.d.ts CHANGED
@@ -251,13 +251,20 @@ interface EntitlementListResult {
251
251
  */
252
252
  entitlements: Entitlement[];
253
253
  }
254
+ /**
255
+ * All webhook event types Recur emits, as a runtime constant.
256
+ *
257
+ * Kept in exact sync with the platform's canonical event enum — a contract
258
+ * test (__tests__/webhook-event-contract.test.ts) fails on any drift.
259
+ */
260
+ declare const WEBHOOK_EVENT_TYPES: readonly ["checkout.created", "checkout.completed", "order.paid", "order.payment_failed", "subscription.created", "subscription.activated", "subscription.cancelled", "subscription.revoked", "subscription.expired", "subscription.trial_ending", "subscription.upgraded", "subscription.downgraded", "subscription.renewed", "subscription.past_due", "subscription.payment_method_required", "subscription.schedule_created", "subscription.schedule_executed", "subscription.schedule_cancelled", "invoice.created", "invoice.paid", "invoice.payment_failed", "customer.created", "customer.updated", "product.created", "product.updated", "refund.created", "refund.succeeded", "refund.failed", "einvoice.issued", "einvoice.issue_failed", "einvoice.voided", "einvoice.allowance_created"];
254
261
  /**
255
262
  * Known webhook event types
256
263
  *
257
264
  * Uses a union with `(string & {})` to allow unknown event types
258
265
  * while still providing autocomplete for known ones.
259
266
  */
260
- type WebhookEventType = 'checkout.completed' | 'subscription.created' | 'subscription.activated' | 'subscription.updated' | 'subscription.cancelled' | 'subscription.revoked' | 'subscription.expired' | 'subscription.trial_ending' | 'subscription.payment_failed' | 'invoice.created' | 'invoice.paid' | 'invoice.payment_failed' | 'invoice.refunded' | 'customer.created' | 'customer.updated' | 'order.paid' | (string & {});
267
+ type WebhookEventType = (typeof WEBHOOK_EVENT_TYPES)[number] | (string & {});
261
268
  /**
262
269
  * A webhook event received from Recur
263
270
  */
@@ -599,4 +606,4 @@ declare class Recur {
599
606
  constructor(secretKey: string, options?: Omit<RecurConfig, 'secretKey'>);
600
607
  }
601
608
  //#endregion
602
- export { type ApiErrorCode, type CustomerIdentifier, type DuplicateSubscriptionDetails, type Entitlement, type EntitlementCheckOptions, type EntitlementCheckResult, type EntitlementListOptions, type EntitlementListResult, type EntitlementStatus, type EntitlementSubscription, type PortalSession, type PortalSessionCreateParams, Recur, RecurAPIError, type RecurConfig, type RecurError, type WebhookEvent, type WebhookEventType, WebhookSignatureVerificationError };
609
+ export { type ApiErrorCode, type CustomerIdentifier, type DuplicateSubscriptionDetails, type Entitlement, type EntitlementCheckOptions, type EntitlementCheckResult, type EntitlementListOptions, type EntitlementListResult, type EntitlementStatus, type EntitlementSubscription, type PortalSession, type PortalSessionCreateParams, Recur, RecurAPIError, type RecurConfig, type RecurError, WEBHOOK_EVENT_TYPES, type WebhookEvent, type WebhookEventType, WebhookSignatureVerificationError };
package/dist/server.js CHANGED
@@ -60,6 +60,46 @@ var RecurAPIError = class extends Error {
60
60
  }
61
61
  };
62
62
  /**
63
+ * All webhook event types Recur emits, as a runtime constant.
64
+ *
65
+ * Kept in exact sync with the platform's canonical event enum — a contract
66
+ * test (__tests__/webhook-event-contract.test.ts) fails on any drift.
67
+ */
68
+ const WEBHOOK_EVENT_TYPES = [
69
+ "checkout.created",
70
+ "checkout.completed",
71
+ "order.paid",
72
+ "order.payment_failed",
73
+ "subscription.created",
74
+ "subscription.activated",
75
+ "subscription.cancelled",
76
+ "subscription.revoked",
77
+ "subscription.expired",
78
+ "subscription.trial_ending",
79
+ "subscription.upgraded",
80
+ "subscription.downgraded",
81
+ "subscription.renewed",
82
+ "subscription.past_due",
83
+ "subscription.payment_method_required",
84
+ "subscription.schedule_created",
85
+ "subscription.schedule_executed",
86
+ "subscription.schedule_cancelled",
87
+ "invoice.created",
88
+ "invoice.paid",
89
+ "invoice.payment_failed",
90
+ "customer.created",
91
+ "customer.updated",
92
+ "product.created",
93
+ "product.updated",
94
+ "refund.created",
95
+ "refund.succeeded",
96
+ "refund.failed",
97
+ "einvoice.issued",
98
+ "einvoice.issue_failed",
99
+ "einvoice.voided",
100
+ "einvoice.allowance_created"
101
+ ];
102
+ /**
63
103
  * Error thrown when webhook signature verification fails
64
104
  */
65
105
  var WebhookSignatureVerificationError = class extends Error {
@@ -71,7 +111,7 @@ var WebhookSignatureVerificationError = class extends Error {
71
111
 
72
112
  //#endregion
73
113
  //#region package.json
74
- var version = "0.19.0";
114
+ var version = "0.20.0";
75
115
 
76
116
  //#endregion
77
117
  //#region src/server/resources/entitlements.ts
@@ -548,4 +588,4 @@ var Recur = class {
548
588
  };
549
589
 
550
590
  //#endregion
551
- export { Recur, RecurAPIError, WebhookSignatureVerificationError };
591
+ export { Recur, RecurAPIError, WEBHOOK_EVENT_TYPES, WebhookSignatureVerificationError };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "recur-tw",
3
- "version": "0.19.0",
3
+ "version": "0.20.0",
4
4
  "description": "React & Vanilla JS SDK for embedding subscription checkout flows (Taiwan / PAYUNi)",
5
5
  "type": "module",
6
6
  "private": false,
@@ -101,8 +101,8 @@
101
101
  "typescript": "^6.0.3",
102
102
  "typescript-eslint": "^8.47.0",
103
103
  "vitest": "^4.1.0",
104
- "@workspace/typescript-config": "0.0.0",
105
- "@workspace/einvoice": "0.0.1"
104
+ "@workspace/einvoice": "0.0.1",
105
+ "@workspace/typescript-config": "0.0.0"
106
106
  },
107
107
  "dependencies": {
108
108
  "lit-html": "^3.3.1"