@rechargeapps/storefront-client 1.91.0 → 1.91.1
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/cjs/api/auth.js +1 -1
- package/dist/cjs/api/bundleData.js +1 -1
- package/dist/cjs/api/customer.js +4 -2
- package/dist/cjs/api/customer.js.map +1 -1
- package/dist/cjs/utils/request.js +1 -1
- package/dist/esm/api/auth.js +1 -1
- package/dist/esm/api/bundleData.js +1 -1
- package/dist/esm/api/customer.js +4 -2
- package/dist/esm/api/customer.js.map +1 -1
- package/dist/esm/utils/request.js +1 -1
- package/dist/umd/recharge-client.min.js +10 -10
- package/package.json +1 -1
package/dist/cjs/api/auth.js
CHANGED
|
@@ -190,7 +190,7 @@ async function rechargeAdminRequest(method, url, { id, query, data, headers } =
|
|
|
190
190
|
...storefrontAccessToken ? { "X-Recharge-Storefront-Access-Token": storefrontAccessToken } : {},
|
|
191
191
|
...appName ? { "X-Recharge-Sdk-App-Name": appName } : {},
|
|
192
192
|
...appVersion ? { "X-Recharge-Sdk-App-Version": appVersion } : {},
|
|
193
|
-
"X-Recharge-Sdk-Version": "1.91.
|
|
193
|
+
"X-Recharge-Sdk-Version": "1.91.1",
|
|
194
194
|
...headers ? headers : {}
|
|
195
195
|
};
|
|
196
196
|
return request.request(method, `${rechargeBaseUrl}${url}`, { id, query, data, headers: reqHeaders });
|
|
@@ -16,7 +16,7 @@ async function loadFromOnlineStore(id, country_code) {
|
|
|
16
16
|
const { appName, appVersion } = options.getOptions();
|
|
17
17
|
const headers = {
|
|
18
18
|
"X-Recharge-Sdk-Fn": "loadFromOnlineStore",
|
|
19
|
-
"X-Recharge-Sdk-Version": "1.91.
|
|
19
|
+
"X-Recharge-Sdk-Version": "1.91.1",
|
|
20
20
|
...appName ? { "X-Recharge-Sdk-App-Name": appName } : {},
|
|
21
21
|
...appVersion ? { "X-Recharge-Sdk-App-Version": appVersion } : {}
|
|
22
22
|
};
|
package/dist/cjs/api/customer.js
CHANGED
|
@@ -63,7 +63,9 @@ async function getActiveChurnLandingPageURL(session, subscriptionId, redirectURL
|
|
|
63
63
|
return `${base_url.replace(
|
|
64
64
|
"portal",
|
|
65
65
|
"pages"
|
|
66
|
-
)}${customer_hash}/subscriptions/${subscriptionId}/cancel?token=${temp_token}&subscription=${subscriptionId}&redirect_to=${
|
|
66
|
+
)}${customer_hash}/subscriptions/${subscriptionId}/cancel?token=${temp_token}&subscription=${subscriptionId}&redirect_to=${encodeURIComponent(
|
|
67
|
+
redirectURL
|
|
68
|
+
)}`;
|
|
67
69
|
}
|
|
68
70
|
async function getFailedPaymentMethodRecoveryLandingPageURL(session) {
|
|
69
71
|
const { base_url, customer_hash, temp_token } = await getCustomerPortalAccess(
|
|
@@ -81,7 +83,7 @@ async function getGiftRedemptionLandingPageURL(session, giftId, redirectURL) {
|
|
|
81
83
|
return `${base_url.replace(
|
|
82
84
|
"portal",
|
|
83
85
|
"pages"
|
|
84
|
-
)}${customer_hash}/gifts/${giftId}?token=${temp_token}&redirect_to=${redirectURL}`;
|
|
86
|
+
)}${customer_hash}/gifts/${giftId}?token=${temp_token}&redirect_to=${encodeURIComponent(redirectURL)}`;
|
|
85
87
|
}
|
|
86
88
|
const customerNotificationMap = {
|
|
87
89
|
SHOPIFY_UPDATE_PAYMENT_INFO: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customer.js","sources":["../../../src/api/customer.ts"],"sourcesContent":["import {\n Customer,\n CustomerCreditSummary,\n CustomerDeliveryScheduleParams,\n CustomerDeliveryScheduleResponse,\n CustomerNotification,\n CustomerNotificationOptions,\n CustomerNotificationTemplate,\n CustomerNotificationType,\n CustomerPortalAccessOptions,\n CustomerPortalAccessResponse,\n Delivery,\n GetCreditSummaryOptions,\n GetCustomerOptions,\n Session,\n UpdateCustomerRequest,\n} from '../types';\nimport { getInternalSession, rechargeApiRequest } from '../utils/request';\nimport { encodePathSegment } from '../utils/url';\n\nexport async function getCustomer(session: Session, options?: GetCustomerOptions): Promise<Customer> {\n const id = session.customerId;\n if (!id) {\n throw new Error('Not logged in.');\n }\n const { customer } = await rechargeApiRequest<{ customer: Customer }>(\n 'get',\n `/customers`,\n {\n id,\n query: { include: options?.include },\n },\n getInternalSession(session, 'getCustomer')\n );\n return customer;\n}\n\nexport async function updateCustomer(session: Session, updateRequest: UpdateCustomerRequest): Promise<Customer> {\n const id = session.customerId;\n if (!id) {\n throw new Error('Not logged in.');\n }\n const { customer } = await rechargeApiRequest<{ customer: Customer }>(\n 'put',\n `/customers`,\n { id, data: updateRequest },\n getInternalSession(session, 'updateCustomer')\n );\n return customer;\n}\n\nexport async function getDeliverySchedule(\n session: Session,\n query?: CustomerDeliveryScheduleParams\n): Promise<Delivery[]> {\n const id = session.customerId;\n if (!id) {\n throw new Error('Not logged in.');\n }\n const { deliveries } = await rechargeApiRequest<CustomerDeliveryScheduleResponse>(\n 'get',\n `/customers/${encodePathSegment(id)}/delivery_schedule`,\n { query },\n getInternalSession(session, 'getDeliverySchedule')\n );\n return deliveries;\n}\n\nexport async function getCustomerPortalAccess(\n session: Session,\n query?: CustomerPortalAccessOptions\n): Promise<CustomerPortalAccessResponse> {\n return rechargeApiRequest<CustomerPortalAccessResponse>(\n 'get',\n '/portal_access',\n { query },\n getInternalSession(session, 'getCustomerPortalAccess')\n );\n}\n\nexport async function getActiveChurnLandingPageURL(\n session: Session,\n subscriptionId: string | number,\n redirectURL: string\n): Promise<string> {\n if (subscriptionId === undefined || subscriptionId === '') {\n throw new Error('Subscription ID is required');\n }\n const { base_url, customer_hash, temp_token } = await getCustomerPortalAccess(\n getInternalSession(session, 'getActiveChurnLandingPageURL')\n );\n return `${base_url.replace(\n 'portal',\n 'pages'\n )}${customer_hash}/subscriptions/${subscriptionId}/cancel?token=${temp_token}&subscription=${subscriptionId}&redirect_to=${redirectURL}`;\n}\n\nexport async function getFailedPaymentMethodRecoveryLandingPageURL(session: Session): Promise<string> {\n const { base_url, customer_hash, temp_token } = await getCustomerPortalAccess(\n getInternalSession(session, 'getFailedPaymentMethodRecoveryLandingPageURL')\n );\n return `${base_url.replace('portal', 'pages')}account/payment-methods?token=${temp_token}&hash=${customer_hash}`;\n}\n\nexport async function getGiftRedemptionLandingPageURL(\n session: Session,\n giftId: string | number,\n redirectURL: string\n): Promise<string> {\n if (giftId === undefined || giftId === '') {\n throw new Error('Gift ID is required');\n }\n const { base_url, customer_hash, temp_token } = await getCustomerPortalAccess(\n getInternalSession(session, 'getGiftRedemptionLandingPageURL')\n );\n return `${base_url.replace(\n 'portal',\n 'pages'\n )}${customer_hash}/gifts/${giftId}?token=${temp_token}&redirect_to=${redirectURL}`;\n}\n\nconst customerNotificationMap: Record<\n CustomerNotification,\n { type: CustomerNotificationType; template_type: CustomerNotificationTemplate }\n> = {\n SHOPIFY_UPDATE_PAYMENT_INFO: {\n type: 'email',\n template_type: 'shopify_update_payment_information',\n },\n SHOPIFY_MIGRATE_PAYMENT_INFO: {\n type: 'email',\n template_type: 'shopify_migrate_payment_information',\n },\n};\n\nexport async function sendCustomerNotification<T extends CustomerNotification>(\n session: Session,\n notification: CustomerNotification,\n options?: CustomerNotificationOptions<T>\n): Promise<void> {\n const customerId = session.customerId;\n if (!customerId) {\n throw new Error('Not logged in.');\n }\n // Own-property check: a plain-object lookup resolves inherited keys such as\n // `__proto__`/`constructor` to truthy prototype values, bypassing this guard\n // (H1-3889216 / SEC-4002; same class as the CDN/bundle maps fixed in SEC-3996).\n if (!Object.prototype.hasOwnProperty.call(customerNotificationMap, notification)) {\n throw new Error('Notification not supported.');\n }\n const data = customerNotificationMap[notification];\n return rechargeApiRequest<void>(\n 'post',\n `/customers/${encodePathSegment(customerId)}/notifications`,\n {\n data: {\n ...data,\n template_vars: options,\n },\n },\n getInternalSession(session, 'sendCustomerNotification')\n );\n}\n\n/** @deprecated Use `getCreditSummary` on credit instead */\nexport async function getCreditSummary(\n session: Session,\n options?: GetCreditSummaryOptions\n): Promise<CustomerCreditSummary> {\n const id = session.customerId;\n if (!id) {\n throw new Error('Not logged in.');\n }\n const { credit_summary } = await rechargeApiRequest<{ credit_summary: CustomerCreditSummary }>(\n 'get',\n `/customers/${encodePathSegment(id)}/credit_summary`,\n {\n query: { include: options?.include },\n },\n getInternalSession(session, 'getCreditSummary')\n );\n return credit_summary;\n}\n"],"names":["rechargeApiRequest","getInternalSession","encodePathSegment"],"mappings":";;;;;AAoBsB,eAAA,WAAA,CAAY,SAAkB,OAAiD,EAAA;AACnG,EAAA,MAAM,KAAK,OAAQ,CAAA,UAAA,CAAA;AACnB,EAAA,IAAI,CAAC,EAAI,EAAA;AACP,IAAM,MAAA,IAAI,MAAM,gBAAgB,CAAA,CAAA;AAAA,GAClC;AACA,EAAM,MAAA,EAAE,QAAS,EAAA,GAAI,MAAMA,0BAAA;AAAA,IACzB,KAAA;AAAA,IACA,CAAA,UAAA,CAAA;AAAA,IACA;AAAA,MACE,EAAA;AAAA,MACA,KAAO,EAAA,EAAE,OAAS,EAAA,OAAA,EAAS,OAAQ,EAAA;AAAA,KACrC;AAAA,IACAC,0BAAA,CAAmB,SAAS,aAAa,CAAA;AAAA,GAC3C,CAAA;AACA,EAAO,OAAA,QAAA,CAAA;AACT,CAAA;AAEsB,eAAA,cAAA,CAAe,SAAkB,aAAyD,EAAA;AAC9G,EAAA,MAAM,KAAK,OAAQ,CAAA,UAAA,CAAA;AACnB,EAAA,IAAI,CAAC,EAAI,EAAA;AACP,IAAM,MAAA,IAAI,MAAM,gBAAgB,CAAA,CAAA;AAAA,GAClC;AACA,EAAM,MAAA,EAAE,QAAS,EAAA,GAAI,MAAMD,0BAAA;AAAA,IACzB,KAAA;AAAA,IACA,CAAA,UAAA,CAAA;AAAA,IACA,EAAE,EAAI,EAAA,IAAA,EAAM,aAAc,EAAA;AAAA,IAC1BC,0BAAA,CAAmB,SAAS,gBAAgB,CAAA;AAAA,GAC9C,CAAA;AACA,EAAO,OAAA,QAAA,CAAA;AACT,CAAA;AAEsB,eAAA,mBAAA,CACpB,SACA,KACqB,EAAA;AACrB,EAAA,MAAM,KAAK,OAAQ,CAAA,UAAA,CAAA;AACnB,EAAA,IAAI,CAAC,EAAI,EAAA;AACP,IAAM,MAAA,IAAI,MAAM,gBAAgB,CAAA,CAAA;AAAA,GAClC;AACA,EAAM,MAAA,EAAE,UAAW,EAAA,GAAI,MAAMD,0BAAA;AAAA,IAC3B,KAAA;AAAA,IACA,CAAA,WAAA,EAAcE,qBAAkB,CAAA,EAAE,CAAC,CAAA,kBAAA,CAAA;AAAA,IACnC,EAAE,KAAM,EAAA;AAAA,IACRD,0BAAA,CAAmB,SAAS,qBAAqB,CAAA;AAAA,GACnD,CAAA;AACA,EAAO,OAAA,UAAA,CAAA;AACT,CAAA;AAEsB,eAAA,uBAAA,CACpB,SACA,KACuC,EAAA;AACvC,EAAO,OAAAD,0BAAA;AAAA,IACL,KAAA;AAAA,IACA,gBAAA;AAAA,IACA,EAAE,KAAM,EAAA;AAAA,IACRC,0BAAA,CAAmB,SAAS,yBAAyB,CAAA;AAAA,GACvD,CAAA;AACF,CAAA;AAEsB,eAAA,4BAAA,CACpB,OACA,EAAA,cAAA,EACA,WACiB,EAAA;AACjB,EAAI,IAAA,cAAA,KAAmB,KAAa,CAAA,IAAA,cAAA,KAAmB,EAAI,EAAA;AACzD,IAAM,MAAA,IAAI,MAAM,6BAA6B,CAAA,CAAA;AAAA,GAC/C;AACA,EAAA,MAAM,EAAE,QAAA,EAAU,aAAe,EAAA,UAAA,KAAe,MAAM,uBAAA;AAAA,IACpDA,0BAAA,CAAmB,SAAS,8BAA8B,CAAA;AAAA,GAC5D,CAAA;AACA,EAAA,OAAO,GAAG,QAAS,CAAA,OAAA;AAAA,IACjB,QAAA;AAAA,IACA,OAAA;AAAA,GACD,
|
|
1
|
+
{"version":3,"file":"customer.js","sources":["../../../src/api/customer.ts"],"sourcesContent":["import {\n Customer,\n CustomerCreditSummary,\n CustomerDeliveryScheduleParams,\n CustomerDeliveryScheduleResponse,\n CustomerNotification,\n CustomerNotificationOptions,\n CustomerNotificationTemplate,\n CustomerNotificationType,\n CustomerPortalAccessOptions,\n CustomerPortalAccessResponse,\n Delivery,\n GetCreditSummaryOptions,\n GetCustomerOptions,\n Session,\n UpdateCustomerRequest,\n} from '../types';\nimport { getInternalSession, rechargeApiRequest } from '../utils/request';\nimport { encodePathSegment } from '../utils/url';\n\nexport async function getCustomer(session: Session, options?: GetCustomerOptions): Promise<Customer> {\n const id = session.customerId;\n if (!id) {\n throw new Error('Not logged in.');\n }\n const { customer } = await rechargeApiRequest<{ customer: Customer }>(\n 'get',\n `/customers`,\n {\n id,\n query: { include: options?.include },\n },\n getInternalSession(session, 'getCustomer')\n );\n return customer;\n}\n\nexport async function updateCustomer(session: Session, updateRequest: UpdateCustomerRequest): Promise<Customer> {\n const id = session.customerId;\n if (!id) {\n throw new Error('Not logged in.');\n }\n const { customer } = await rechargeApiRequest<{ customer: Customer }>(\n 'put',\n `/customers`,\n { id, data: updateRequest },\n getInternalSession(session, 'updateCustomer')\n );\n return customer;\n}\n\nexport async function getDeliverySchedule(\n session: Session,\n query?: CustomerDeliveryScheduleParams\n): Promise<Delivery[]> {\n const id = session.customerId;\n if (!id) {\n throw new Error('Not logged in.');\n }\n const { deliveries } = await rechargeApiRequest<CustomerDeliveryScheduleResponse>(\n 'get',\n `/customers/${encodePathSegment(id)}/delivery_schedule`,\n { query },\n getInternalSession(session, 'getDeliverySchedule')\n );\n return deliveries;\n}\n\nexport async function getCustomerPortalAccess(\n session: Session,\n query?: CustomerPortalAccessOptions\n): Promise<CustomerPortalAccessResponse> {\n return rechargeApiRequest<CustomerPortalAccessResponse>(\n 'get',\n '/portal_access',\n { query },\n getInternalSession(session, 'getCustomerPortalAccess')\n );\n}\n\nexport async function getActiveChurnLandingPageURL(\n session: Session,\n subscriptionId: string | number,\n redirectURL: string\n): Promise<string> {\n if (subscriptionId === undefined || subscriptionId === '') {\n throw new Error('Subscription ID is required');\n }\n const { base_url, customer_hash, temp_token } = await getCustomerPortalAccess(\n getInternalSession(session, 'getActiveChurnLandingPageURL')\n );\n return `${base_url.replace(\n 'portal',\n 'pages'\n )}${customer_hash}/subscriptions/${subscriptionId}/cancel?token=${temp_token}&subscription=${subscriptionId}&redirect_to=${encodeURIComponent(\n redirectURL\n )}`;\n}\n\nexport async function getFailedPaymentMethodRecoveryLandingPageURL(session: Session): Promise<string> {\n const { base_url, customer_hash, temp_token } = await getCustomerPortalAccess(\n getInternalSession(session, 'getFailedPaymentMethodRecoveryLandingPageURL')\n );\n return `${base_url.replace('portal', 'pages')}account/payment-methods?token=${temp_token}&hash=${customer_hash}`;\n}\n\nexport async function getGiftRedemptionLandingPageURL(\n session: Session,\n giftId: string | number,\n redirectURL: string\n): Promise<string> {\n if (giftId === undefined || giftId === '') {\n throw new Error('Gift ID is required');\n }\n const { base_url, customer_hash, temp_token } = await getCustomerPortalAccess(\n getInternalSession(session, 'getGiftRedemptionLandingPageURL')\n );\n return `${base_url.replace(\n 'portal',\n 'pages'\n )}${customer_hash}/gifts/${giftId}?token=${temp_token}&redirect_to=${encodeURIComponent(redirectURL)}`;\n}\n\nconst customerNotificationMap: Record<\n CustomerNotification,\n { type: CustomerNotificationType; template_type: CustomerNotificationTemplate }\n> = {\n SHOPIFY_UPDATE_PAYMENT_INFO: {\n type: 'email',\n template_type: 'shopify_update_payment_information',\n },\n SHOPIFY_MIGRATE_PAYMENT_INFO: {\n type: 'email',\n template_type: 'shopify_migrate_payment_information',\n },\n};\n\nexport async function sendCustomerNotification<T extends CustomerNotification>(\n session: Session,\n notification: CustomerNotification,\n options?: CustomerNotificationOptions<T>\n): Promise<void> {\n const customerId = session.customerId;\n if (!customerId) {\n throw new Error('Not logged in.');\n }\n // Own-property check: a plain-object lookup resolves inherited keys such as\n // `__proto__`/`constructor` to truthy prototype values, bypassing this guard\n // (H1-3889216 / SEC-4002; same class as the CDN/bundle maps fixed in SEC-3996).\n if (!Object.prototype.hasOwnProperty.call(customerNotificationMap, notification)) {\n throw new Error('Notification not supported.');\n }\n const data = customerNotificationMap[notification];\n return rechargeApiRequest<void>(\n 'post',\n `/customers/${encodePathSegment(customerId)}/notifications`,\n {\n data: {\n ...data,\n template_vars: options,\n },\n },\n getInternalSession(session, 'sendCustomerNotification')\n );\n}\n\n/** @deprecated Use `getCreditSummary` on credit instead */\nexport async function getCreditSummary(\n session: Session,\n options?: GetCreditSummaryOptions\n): Promise<CustomerCreditSummary> {\n const id = session.customerId;\n if (!id) {\n throw new Error('Not logged in.');\n }\n const { credit_summary } = await rechargeApiRequest<{ credit_summary: CustomerCreditSummary }>(\n 'get',\n `/customers/${encodePathSegment(id)}/credit_summary`,\n {\n query: { include: options?.include },\n },\n getInternalSession(session, 'getCreditSummary')\n );\n return credit_summary;\n}\n"],"names":["rechargeApiRequest","getInternalSession","encodePathSegment"],"mappings":";;;;;AAoBsB,eAAA,WAAA,CAAY,SAAkB,OAAiD,EAAA;AACnG,EAAA,MAAM,KAAK,OAAQ,CAAA,UAAA,CAAA;AACnB,EAAA,IAAI,CAAC,EAAI,EAAA;AACP,IAAM,MAAA,IAAI,MAAM,gBAAgB,CAAA,CAAA;AAAA,GAClC;AACA,EAAM,MAAA,EAAE,QAAS,EAAA,GAAI,MAAMA,0BAAA;AAAA,IACzB,KAAA;AAAA,IACA,CAAA,UAAA,CAAA;AAAA,IACA;AAAA,MACE,EAAA;AAAA,MACA,KAAO,EAAA,EAAE,OAAS,EAAA,OAAA,EAAS,OAAQ,EAAA;AAAA,KACrC;AAAA,IACAC,0BAAA,CAAmB,SAAS,aAAa,CAAA;AAAA,GAC3C,CAAA;AACA,EAAO,OAAA,QAAA,CAAA;AACT,CAAA;AAEsB,eAAA,cAAA,CAAe,SAAkB,aAAyD,EAAA;AAC9G,EAAA,MAAM,KAAK,OAAQ,CAAA,UAAA,CAAA;AACnB,EAAA,IAAI,CAAC,EAAI,EAAA;AACP,IAAM,MAAA,IAAI,MAAM,gBAAgB,CAAA,CAAA;AAAA,GAClC;AACA,EAAM,MAAA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,IAC3B,IAAM,EAAA,OAAA;AAAA,IACN,aAAe,EAAA,oCAAA;AAAA,GACjB;AAAA,EACA,4BAA8B,EAAA;AAAA,IAC5B,IAAM,EAAA,OAAA;AAAA,IACN,aAAe,EAAA,qCAAA;AAAA,GACjB;AACF,CAAA,CAAA;AAEsB,eAAA,wBAAA,CACpB,OACA,EAAA,YAAA,EACA,OACe,EAAA;AACf,EAAA,MAAM,aAAa,OAAQ,CAAA,UAAA,CAAA;AAC3B,EAAA,IAAI,CAAC,UAAY,EAAA;AACf,IAAM,MAAA,IAAI,MAAM,gBAAgB,CAAA,CAAA;AAAA,GAClC;AAIA,EAAA,IAAI,CAAC,MAAO,CAAA,SAAA,CAAU,eAAe,IAAK,CAAA,uBAAA,EAAyB,YAAY,CAAG,EAAA;AAChF,IAAM,MAAA,IAAI,MAAM,6BAA6B,CAAA,CAAA;AAAA,GAC/C;AACA,EAAM,MAAA,IAAA,GAAO,wBAAwB,YAAY,CAAA,CAAA;AACjD,EAAO,OAAAD,0BAAA;AAAA,IACL,MAAA;AAAA,IACA,CAAA,WAAA,EAAcE,qBAAkB,CAAA,UAAU,CAAC,CAAA,cAAA,CAAA;AAAA,IAC3C;AAAA,MACE,IAAM,EAAA;AAAA,QACJ,GAAG,IAAA;AAAA,QACH,aAAe,EAAA,OAAA;AAAA,OACjB;AAAA,KACF;AAAA,IACAD,0BAAA,CAAmB,SAAS,0BAA0B,CAAA;AAAA,GACxD,CAAA;AACF;;;;;;;;;;;"}
|
|
@@ -51,7 +51,7 @@ async function rechargeApiRequest(method, url, { id, query, data, headers } = {}
|
|
|
51
51
|
"X-Recharge-Sdk-Fn": session.internalFnCall,
|
|
52
52
|
...appName ? { "X-Recharge-Sdk-App-Name": appName } : {},
|
|
53
53
|
...appVersion ? { "X-Recharge-Sdk-App-Version": appVersion } : {},
|
|
54
|
-
"X-Recharge-Sdk-Version": "1.91.
|
|
54
|
+
"X-Recharge-Sdk-Version": "1.91.1",
|
|
55
55
|
"X-Request-Id": session.internalRequestId,
|
|
56
56
|
...session.tmp_fn_identifier ? { "X-Recharge-Sdk-Fn-Identifier": session.tmp_fn_identifier } : {},
|
|
57
57
|
...headers ? headers : {}
|
package/dist/esm/api/auth.js
CHANGED
|
@@ -188,7 +188,7 @@ async function rechargeAdminRequest(method, url, { id, query, data, headers } =
|
|
|
188
188
|
...storefrontAccessToken ? { "X-Recharge-Storefront-Access-Token": storefrontAccessToken } : {},
|
|
189
189
|
...appName ? { "X-Recharge-Sdk-App-Name": appName } : {},
|
|
190
190
|
...appVersion ? { "X-Recharge-Sdk-App-Version": appVersion } : {},
|
|
191
|
-
"X-Recharge-Sdk-Version": "1.91.
|
|
191
|
+
"X-Recharge-Sdk-Version": "1.91.1",
|
|
192
192
|
...headers ? headers : {}
|
|
193
193
|
};
|
|
194
194
|
return request(method, `${rechargeBaseUrl}${url}`, { id, query, data, headers: reqHeaders });
|
|
@@ -14,7 +14,7 @@ async function loadFromOnlineStore(id, country_code) {
|
|
|
14
14
|
const { appName, appVersion } = getOptions();
|
|
15
15
|
const headers = {
|
|
16
16
|
"X-Recharge-Sdk-Fn": "loadFromOnlineStore",
|
|
17
|
-
"X-Recharge-Sdk-Version": "1.91.
|
|
17
|
+
"X-Recharge-Sdk-Version": "1.91.1",
|
|
18
18
|
...appName ? { "X-Recharge-Sdk-App-Name": appName } : {},
|
|
19
19
|
...appVersion ? { "X-Recharge-Sdk-App-Version": appVersion } : {}
|
|
20
20
|
};
|
package/dist/esm/api/customer.js
CHANGED
|
@@ -61,7 +61,9 @@ async function getActiveChurnLandingPageURL(session, subscriptionId, redirectURL
|
|
|
61
61
|
return `${base_url.replace(
|
|
62
62
|
"portal",
|
|
63
63
|
"pages"
|
|
64
|
-
)}${customer_hash}/subscriptions/${subscriptionId}/cancel?token=${temp_token}&subscription=${subscriptionId}&redirect_to=${
|
|
64
|
+
)}${customer_hash}/subscriptions/${subscriptionId}/cancel?token=${temp_token}&subscription=${subscriptionId}&redirect_to=${encodeURIComponent(
|
|
65
|
+
redirectURL
|
|
66
|
+
)}`;
|
|
65
67
|
}
|
|
66
68
|
async function getFailedPaymentMethodRecoveryLandingPageURL(session) {
|
|
67
69
|
const { base_url, customer_hash, temp_token } = await getCustomerPortalAccess(
|
|
@@ -79,7 +81,7 @@ async function getGiftRedemptionLandingPageURL(session, giftId, redirectURL) {
|
|
|
79
81
|
return `${base_url.replace(
|
|
80
82
|
"portal",
|
|
81
83
|
"pages"
|
|
82
|
-
)}${customer_hash}/gifts/${giftId}?token=${temp_token}&redirect_to=${redirectURL}`;
|
|
84
|
+
)}${customer_hash}/gifts/${giftId}?token=${temp_token}&redirect_to=${encodeURIComponent(redirectURL)}`;
|
|
83
85
|
}
|
|
84
86
|
const customerNotificationMap = {
|
|
85
87
|
SHOPIFY_UPDATE_PAYMENT_INFO: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customer.js","sources":["../../../src/api/customer.ts"],"sourcesContent":["import {\n Customer,\n CustomerCreditSummary,\n CustomerDeliveryScheduleParams,\n CustomerDeliveryScheduleResponse,\n CustomerNotification,\n CustomerNotificationOptions,\n CustomerNotificationTemplate,\n CustomerNotificationType,\n CustomerPortalAccessOptions,\n CustomerPortalAccessResponse,\n Delivery,\n GetCreditSummaryOptions,\n GetCustomerOptions,\n Session,\n UpdateCustomerRequest,\n} from '../types';\nimport { getInternalSession, rechargeApiRequest } from '../utils/request';\nimport { encodePathSegment } from '../utils/url';\n\nexport async function getCustomer(session: Session, options?: GetCustomerOptions): Promise<Customer> {\n const id = session.customerId;\n if (!id) {\n throw new Error('Not logged in.');\n }\n const { customer } = await rechargeApiRequest<{ customer: Customer }>(\n 'get',\n `/customers`,\n {\n id,\n query: { include: options?.include },\n },\n getInternalSession(session, 'getCustomer')\n );\n return customer;\n}\n\nexport async function updateCustomer(session: Session, updateRequest: UpdateCustomerRequest): Promise<Customer> {\n const id = session.customerId;\n if (!id) {\n throw new Error('Not logged in.');\n }\n const { customer } = await rechargeApiRequest<{ customer: Customer }>(\n 'put',\n `/customers`,\n { id, data: updateRequest },\n getInternalSession(session, 'updateCustomer')\n );\n return customer;\n}\n\nexport async function getDeliverySchedule(\n session: Session,\n query?: CustomerDeliveryScheduleParams\n): Promise<Delivery[]> {\n const id = session.customerId;\n if (!id) {\n throw new Error('Not logged in.');\n }\n const { deliveries } = await rechargeApiRequest<CustomerDeliveryScheduleResponse>(\n 'get',\n `/customers/${encodePathSegment(id)}/delivery_schedule`,\n { query },\n getInternalSession(session, 'getDeliverySchedule')\n );\n return deliveries;\n}\n\nexport async function getCustomerPortalAccess(\n session: Session,\n query?: CustomerPortalAccessOptions\n): Promise<CustomerPortalAccessResponse> {\n return rechargeApiRequest<CustomerPortalAccessResponse>(\n 'get',\n '/portal_access',\n { query },\n getInternalSession(session, 'getCustomerPortalAccess')\n );\n}\n\nexport async function getActiveChurnLandingPageURL(\n session: Session,\n subscriptionId: string | number,\n redirectURL: string\n): Promise<string> {\n if (subscriptionId === undefined || subscriptionId === '') {\n throw new Error('Subscription ID is required');\n }\n const { base_url, customer_hash, temp_token } = await getCustomerPortalAccess(\n getInternalSession(session, 'getActiveChurnLandingPageURL')\n );\n return `${base_url.replace(\n 'portal',\n 'pages'\n )}${customer_hash}/subscriptions/${subscriptionId}/cancel?token=${temp_token}&subscription=${subscriptionId}&redirect_to=${redirectURL}`;\n}\n\nexport async function getFailedPaymentMethodRecoveryLandingPageURL(session: Session): Promise<string> {\n const { base_url, customer_hash, temp_token } = await getCustomerPortalAccess(\n getInternalSession(session, 'getFailedPaymentMethodRecoveryLandingPageURL')\n );\n return `${base_url.replace('portal', 'pages')}account/payment-methods?token=${temp_token}&hash=${customer_hash}`;\n}\n\nexport async function getGiftRedemptionLandingPageURL(\n session: Session,\n giftId: string | number,\n redirectURL: string\n): Promise<string> {\n if (giftId === undefined || giftId === '') {\n throw new Error('Gift ID is required');\n }\n const { base_url, customer_hash, temp_token } = await getCustomerPortalAccess(\n getInternalSession(session, 'getGiftRedemptionLandingPageURL')\n );\n return `${base_url.replace(\n 'portal',\n 'pages'\n )}${customer_hash}/gifts/${giftId}?token=${temp_token}&redirect_to=${redirectURL}`;\n}\n\nconst customerNotificationMap: Record<\n CustomerNotification,\n { type: CustomerNotificationType; template_type: CustomerNotificationTemplate }\n> = {\n SHOPIFY_UPDATE_PAYMENT_INFO: {\n type: 'email',\n template_type: 'shopify_update_payment_information',\n },\n SHOPIFY_MIGRATE_PAYMENT_INFO: {\n type: 'email',\n template_type: 'shopify_migrate_payment_information',\n },\n};\n\nexport async function sendCustomerNotification<T extends CustomerNotification>(\n session: Session,\n notification: CustomerNotification,\n options?: CustomerNotificationOptions<T>\n): Promise<void> {\n const customerId = session.customerId;\n if (!customerId) {\n throw new Error('Not logged in.');\n }\n // Own-property check: a plain-object lookup resolves inherited keys such as\n // `__proto__`/`constructor` to truthy prototype values, bypassing this guard\n // (H1-3889216 / SEC-4002; same class as the CDN/bundle maps fixed in SEC-3996).\n if (!Object.prototype.hasOwnProperty.call(customerNotificationMap, notification)) {\n throw new Error('Notification not supported.');\n }\n const data = customerNotificationMap[notification];\n return rechargeApiRequest<void>(\n 'post',\n `/customers/${encodePathSegment(customerId)}/notifications`,\n {\n data: {\n ...data,\n template_vars: options,\n },\n },\n getInternalSession(session, 'sendCustomerNotification')\n );\n}\n\n/** @deprecated Use `getCreditSummary` on credit instead */\nexport async function getCreditSummary(\n session: Session,\n options?: GetCreditSummaryOptions\n): Promise<CustomerCreditSummary> {\n const id = session.customerId;\n if (!id) {\n throw new Error('Not logged in.');\n }\n const { credit_summary } = await rechargeApiRequest<{ credit_summary: CustomerCreditSummary }>(\n 'get',\n `/customers/${encodePathSegment(id)}/credit_summary`,\n {\n query: { include: options?.include },\n },\n getInternalSession(session, 'getCreditSummary')\n );\n return credit_summary;\n}\n"],"names":[],"mappings":";;;AAoBsB,eAAA,WAAA,CAAY,SAAkB,OAAiD,EAAA;AACnG,EAAA,MAAM,KAAK,OAAQ,CAAA,UAAA,CAAA;AACn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IACR,kBAAA,CAAmB,SAAS,qBAAqB,CAAA;AAAA,GACnD,CAAA;AACA,EAAO,OAAA,UAAA,CAAA;AACT,CAAA;AAEsB,eAAA,uBAAA,CACpB,SACA,KACuC,EAAA;AACvC,EAAO,OAAA,kBAAA;AAAA,IACL,KAAA;AAAA,IACA,gBAAA;AAAA,IACA,EAAE,KAAM,EAAA;AAAA,IACR,kBAAA,CAAmB,SAAS,yBAAyB,CAAA;AAAA,GACvD,CAAA;AACF,CAAA;AAEsB,eAAA,4BAAA,CACpB,OACA,EAAA,cAAA,EACA,WACiB,EAAA;AACjB,EAAI,IAAA,cAAA,KAAmB,KAAa,CAAA,IAAA,cAAA,KAAmB,EAAI,EAAA;AACzD,IAAM,MAAA,IAAI,MAAM,6BAA6B,CAAA,CAAA;AAAA,GAC/C;AACA,EAAA,MAAM,EAAE,QAAA,EAAU,aAAe,EAAA,UAAA,KAAe,MAAM,uBAAA;AAAA,IACpD,kBAAA,CAAmB,SAAS,8BAA8B,CAAA;AAAA,GAC5D,CAAA;AACA,EAAA,OAAO,GAAG,QAAS,CAAA,OAAA;AAAA,IACjB,QAAA;AAAA,IACA,OAAA;AAAA,GACD,
|
|
1
|
+
{"version":3,"file":"customer.js","sources":["../../../src/api/customer.ts"],"sourcesContent":["import {\n Customer,\n CustomerCreditSummary,\n CustomerDeliveryScheduleParams,\n CustomerDeliveryScheduleResponse,\n CustomerNotification,\n CustomerNotificationOptions,\n CustomerNotificationTemplate,\n CustomerNotificationType,\n CustomerPortalAccessOptions,\n CustomerPortalAccessResponse,\n Delivery,\n GetCreditSummaryOptions,\n GetCustomerOptions,\n Session,\n UpdateCustomerRequest,\n} from '../types';\nimport { getInternalSession, rechargeApiRequest } from '../utils/request';\nimport { encodePathSegment } from '../utils/url';\n\nexport async function getCustomer(session: Session, options?: GetCustomerOptions): Promise<Customer> {\n const id = session.customerId;\n if (!id) {\n throw new Error('Not logged in.');\n }\n const { customer } = await rechargeApiRequest<{ customer: Customer }>(\n 'get',\n `/customers`,\n {\n id,\n query: { include: options?.include },\n },\n getInternalSession(session, 'getCustomer')\n );\n return customer;\n}\n\nexport async function updateCustomer(session: Session, updateRequest: UpdateCustomerRequest): Promise<Customer> {\n const id = session.customerId;\n if (!id) {\n throw new Error('Not logged in.');\n }\n const { customer } = await rechargeApiRequest<{ customer: Customer }>(\n 'put',\n `/customers`,\n { id, data: updateRequest },\n getInternalSession(session, 'updateCustomer')\n );\n return customer;\n}\n\nexport async function getDeliverySchedule(\n session: Session,\n query?: CustomerDeliveryScheduleParams\n): Promise<Delivery[]> {\n const id = session.customerId;\n if (!id) {\n throw new Error('Not logged in.');\n }\n const { deliveries } = await rechargeApiRequest<CustomerDeliveryScheduleResponse>(\n 'get',\n `/customers/${encodePathSegment(id)}/delivery_schedule`,\n { query },\n getInternalSession(session, 'getDeliverySchedule')\n );\n return deliveries;\n}\n\nexport async function getCustomerPortalAccess(\n session: Session,\n query?: CustomerPortalAccessOptions\n): Promise<CustomerPortalAccessResponse> {\n return rechargeApiRequest<CustomerPortalAccessResponse>(\n 'get',\n '/portal_access',\n { query },\n getInternalSession(session, 'getCustomerPortalAccess')\n );\n}\n\nexport async function getActiveChurnLandingPageURL(\n session: Session,\n subscriptionId: string | number,\n redirectURL: string\n): Promise<string> {\n if (subscriptionId === undefined || subscriptionId === '') {\n throw new Error('Subscription ID is required');\n }\n const { base_url, customer_hash, temp_token } = await getCustomerPortalAccess(\n getInternalSession(session, 'getActiveChurnLandingPageURL')\n );\n return `${base_url.replace(\n 'portal',\n 'pages'\n )}${customer_hash}/subscriptions/${subscriptionId}/cancel?token=${temp_token}&subscription=${subscriptionId}&redirect_to=${encodeURIComponent(\n redirectURL\n )}`;\n}\n\nexport async function getFailedPaymentMethodRecoveryLandingPageURL(session: Session): Promise<string> {\n const { base_url, customer_hash, temp_token } = await getCustomerPortalAccess(\n getInternalSession(session, 'getFailedPaymentMethodRecoveryLandingPageURL')\n );\n return `${base_url.replace('portal', 'pages')}account/payment-methods?token=${temp_token}&hash=${customer_hash}`;\n}\n\nexport async function getGiftRedemptionLandingPageURL(\n session: Session,\n giftId: string | number,\n redirectURL: string\n): Promise<string> {\n if (giftId === undefined || giftId === '') {\n throw new Error('Gift ID is required');\n }\n const { base_url, customer_hash, temp_token } = await getCustomerPortalAccess(\n getInternalSession(session, 'getGiftRedemptionLandingPageURL')\n );\n return `${base_url.replace(\n 'portal',\n 'pages'\n )}${customer_hash}/gifts/${giftId}?token=${temp_token}&redirect_to=${encodeURIComponent(redirectURL)}`;\n}\n\nconst customerNotificationMap: Record<\n CustomerNotification,\n { type: CustomerNotificationType; template_type: CustomerNotificationTemplate }\n> = {\n SHOPIFY_UPDATE_PAYMENT_INFO: {\n type: 'email',\n template_type: 'shopify_update_payment_information',\n },\n SHOPIFY_MIGRATE_PAYMENT_INFO: {\n type: 'email',\n template_type: 'shopify_migrate_payment_information',\n },\n};\n\nexport async function sendCustomerNotification<T extends CustomerNotification>(\n session: Session,\n notification: CustomerNotification,\n options?: CustomerNotificationOptions<T>\n): Promise<void> {\n const customerId = session.customerId;\n if (!customerId) {\n throw new Error('Not logged in.');\n }\n // Own-property check: a plain-object lookup resolves inherited keys such as\n // `__proto__`/`constructor` to truthy prototype values, bypassing this guard\n // (H1-3889216 / SEC-4002; same class as the CDN/bundle maps fixed in SEC-3996).\n if (!Object.prototype.hasOwnProperty.call(customerNotificationMap, notification)) {\n throw new Error('Notification not supported.');\n }\n const data = customerNotificationMap[notification];\n return rechargeApiRequest<void>(\n 'post',\n `/customers/${encodePathSegment(customerId)}/notifications`,\n {\n data: {\n ...data,\n template_vars: options,\n },\n },\n getInternalSession(session, 'sendCustomerNotification')\n );\n}\n\n/** @deprecated Use `getCreditSummary` on credit instead */\nexport async function getCreditSummary(\n session: Session,\n options?: GetCreditSummaryOptions\n): Promise<CustomerCreditSummary> {\n const id = session.customerId;\n if (!id) {\n throw new Error('Not logged in.');\n }\n const { credit_summary } = await rechargeApiRequest<{ credit_summary: CustomerCreditSummary }>(\n 'get',\n `/customers/${encodePathSegment(id)}/credit_summary`,\n {\n query: { include: options?.include },\n },\n getInternalSession(session, 'getCreditSummary')\n );\n return credit_summary;\n}\n"],"names":[],"mappings":";;;AAoBsB,eAAA,WAAA,CAAY,SAAkB,OAAiD,EAAA;AACnG,EAAA,MAAM,KAAK,OAAQ,CAAA,UAAA,CAAA;AACnB,EAAA,IAAI,CAAC,EAAI,EAAA;AACP,IAAM,MAAA,IAAI,MAAM,gBAAgB,CAAA,CAAA;AAAA,GAClC;AACA,EAAM,MAAA,EAAE,QAAS,EAAA,GAAI,MAAM,kBAAA;AAAA,IACzB,KAAA;AAAA,IACA,CAAA,UAAA,CAAA;AAAA,IACA;AAAA,MACE,EAAA;AAAA,MACA,KAAO,EAAA,EAAE,OAAS,EAAA,OAAA,EAAS,OAAQ,EAAA;AAAA,KACrC;AAAA,IACA,kBAAA,CAAmB,SAAS,aAAa,CAAA;AAAA,GAC3C,CAAA;AACA,EAAO,OAAA,QAAA,CAAA;AACT,CAAA;AAEsB,eAAA,cAAA,CAAe,SAAkB,aAAyD,EAAA;AAC9G,EAAA,MAAM,KAAK,OAAQ,CAAA,UAAA,CAAA;AACnB,EAAA,IAAI,CAAC,EAAI,EAAA;AACP,IAAM,MAAA,IAAI,MAAM,gBAAgB,CAAA,CAAA;AAAA,GAClC;AACA,EAAM,MAAA,EAAE,QAAS,EAAA,GAAI,MAAM,kBAAA;AAAA,IACzB,KAAA;AAAA,IACA,CAAA,UAAA,CAAA;AAAA,IACA,EAAE,EAAI,EAAA,IAAA,EAAM,aAAc,EAAA;AAAA,IAC1B,kBAAA,CAAmB,SAAS,gBAAgB,CAAA;AAAA,GAC9C,CAAA;AACA,EAAO,OAAA,QAAA,CAAA;AACT,CAAA;AAEsB,eAAA,mBAAA,CACpB,SACA,KACqB,EAAA;AACrB,EAAA,MAAM,KAAK,OAAQ,CAAA,UAAA,CAAA;AACnB,EAAA,IAAI,CAAC,EAAI,EAAA;AACP,IAAM,MAAA,IA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I,CAAC,MAAO,CAAA,SAAA,CAAU,eAAe,IAAK,CAAA,uBAAA,EAAyB,YAAY,CAAG,EAAA;AAChF,IAAM,MAAA,IAAI,MAAM,6BAA6B,CAAA,CAAA;AAAA,GAC/C;AACA,EAAM,MAAA,IAAA,GAAO,wBAAwB,YAAY,CAAA,CAAA;AACjD,EAAO,OAAA,kBAAA;AAAA,IACL,MAAA;AAAA,IACA,CAAA,WAAA,EAAc,iBAAkB,CAAA,UAAU,CAAC,CAAA,cAAA,CAAA;AAAA,IAC3C;AAAA,MACE,IAAM,EAAA;AAAA,QACJ,GAAG,IAAA;AAAA,QACH,aAAe,EAAA,OAAA;AAAA,OACjB;AAAA,KACF;AAAA,IACA,kBAAA,CAAmB,SAAS,0BAA0B,CAAA;AAAA,GACxD,CAAA;AACF;;;;"}
|
|
@@ -49,7 +49,7 @@ async function rechargeApiRequest(method, url, { id, query, data, headers } = {}
|
|
|
49
49
|
"X-Recharge-Sdk-Fn": session.internalFnCall,
|
|
50
50
|
...appName ? { "X-Recharge-Sdk-App-Name": appName } : {},
|
|
51
51
|
...appVersion ? { "X-Recharge-Sdk-App-Version": appVersion } : {},
|
|
52
|
-
"X-Recharge-Sdk-Version": "1.91.
|
|
52
|
+
"X-Recharge-Sdk-Version": "1.91.1",
|
|
53
53
|
"X-Request-Id": session.internalRequestId,
|
|
54
54
|
...session.tmp_fn_identifier ? { "X-Recharge-Sdk-Fn-Identifier": session.tmp_fn_identifier } : {},
|
|
55
55
|
...headers ? headers : {}
|