@getsupertab/supertab-js 3.21.0 → 3.22.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.
@@ -1,4 +1,4 @@
1
- import { c as R, g as z } from "./supertab-BpwqQ2BB.js";
1
+ import { c as R, g as z } from "./supertab-B8Vn8zcc.js";
2
2
  function $(w, d) {
3
3
  for (var b = 0; b < d.length; b++) {
4
4
  const y = d[b];
@@ -1,4 +1,4 @@
1
- import { r as mu, T as gu, P as _u, a as Su, V as yu } from "./supertab-BpwqQ2BB.js";
1
+ import { r as mu, T as gu, P as _u, a as Su, V as yu } from "./supertab-B8Vn8zcc.js";
2
2
  const b = typeof __SENTRY_DEBUG__ > "u" || __SENTRY_DEBUG__, q = globalThis, at = "9.40.0";
3
3
  function ht() {
4
4
  return lr(q), q;
@@ -4855,7 +4855,7 @@ const bA = sr({
4855
4855
  VITE_STATIC_REDIRECT_URI: void 0,
4856
4856
  VITE_GTM_CONTAINER_ID: "GTM-NG9GT7FM",
4857
4857
  VITE_SENTRY_DSN: "https://d08f3f301f364ceba6345c393c538faf@o23455.ingest.us.sentry.io/4507736861573120",
4858
- VITE_BASE_URL: "https://js.supertab.co/v3.21.0/",
4858
+ VITE_BASE_URL: "https://js.supertab.co/v3.22.0/",
4859
4859
  VITE_DEMO_CLIENT_ID: void 0,
4860
4860
  VITE_API_BASE_URL: void 0,
4861
4861
  VITE_SSO_BASE_URL: void 0,
@@ -4864,7 +4864,7 @@ const bA = sr({
4864
4864
  VITE_CHECKOUT_URL: void 0,
4865
4865
  TAPPER_ENV: "prod",
4866
4866
  PACKAGE_NAME: "@getsupertab/supertab-js",
4867
- PACKAGE_VERSION: "3.21.0",
4867
+ PACKAGE_VERSION: "3.22.0",
4868
4868
  MONETIZATION_PROVIDER_SCRIPT_URL: void 0
4869
4869
  }), I3 = US === "ctl" || US === "sbx" || US === "stg" ? !0 : US === "prod" && typeof window < "u" && window.location ? new URLSearchParams(window.location.search).has("supertab-enable-logging") : !1, Yt = {
4870
4870
  log: (...o) => {
@@ -5564,7 +5564,7 @@ const rr = /* @__PURE__ */ F_(M), g4 = /* @__PURE__ */ FP({
5564
5564
  default: rr
5565
5565
  }, [M]), IS = async (o) => {
5566
5566
  if (wA) {
5567
- const { captureException: a } = await import("./sentry-DDv5DYrF.js");
5567
+ const { captureException: a } = await import("./sentry-BfU8w763.js");
5568
5568
  a(o);
5569
5569
  }
5570
5570
  }, qC = "tabjs";
@@ -6212,38 +6212,40 @@ class yM {
6212
6212
  async purchase({
6213
6213
  offeringId: a,
6214
6214
  purchaseIntentId: s,
6215
- currencyCode: f = "USD",
6216
- metadata: d = {}
6215
+ onetimeOfferingId: f,
6216
+ currencyCode: d = "USD",
6217
+ metadata: g = {}
6217
6218
  }) {
6218
- if (!a && !s) {
6219
- const g = "Missing parameter: Either 'offeringId' or 'purchaseIntentId' must be provided.";
6219
+ if (!a && !s && !f) {
6220
+ const C = "Missing parameter: Provide one of 'offeringId' or 'onetimeOfferingId' (deprecated: 'purchaseIntentId').";
6220
6221
  throw new f4({
6221
- message: g,
6222
+ message: C,
6222
6223
  code: xy.MISSING_PARAMETER
6223
6224
  });
6224
6225
  }
6225
6226
  if (a)
6226
6227
  return v2(async () => {
6227
- const g = new URL(this.apiConfig.urls.apiBaseUrl), v = this.apiConfig.headers;
6228
- return g2(g, "post", "/purchases/offerings", {
6228
+ const C = new URL(this.apiConfig.urls.apiBaseUrl), k = this.apiConfig.headers;
6229
+ return g2(C, "post", "/purchases/offerings", {
6229
6230
  header: {
6230
- ...v,
6231
+ ...k,
6231
6232
  contentType: "application/json"
6232
6233
  // TODO: Remove this once we have a proper type for the header
6233
6234
  },
6234
- body: { offeringId: a, currencyCode: f, metadata: d ?? {} }
6235
+ body: { offeringId: a, currencyCode: d, metadata: g ?? {} }
6235
6236
  });
6236
6237
  }).call(this);
6237
- if (s)
6238
+ const v = f || s;
6239
+ if (v)
6238
6240
  return v2(async () => {
6239
- const g = new URL(this.apiConfig.urls.apiBaseUrl), v = this.apiConfig.headers;
6240
- return g2(g, "post", "/purchases/onetime_offerings", {
6241
+ const C = new URL(this.apiConfig.urls.apiBaseUrl), k = this.apiConfig.headers;
6242
+ return g2(C, "post", "/purchases/onetime_offerings", {
6241
6243
  header: {
6242
- ...v,
6244
+ ...k,
6243
6245
  contentType: "application/json"
6244
6246
  // TODO: Remove this once we have a proper type for the header
6245
6247
  },
6246
- body: { onetimeOfferingId: s }
6248
+ body: { onetimeOfferingId: v }
6247
6249
  });
6248
6250
  }).call(this);
6249
6251
  }
@@ -64753,7 +64755,7 @@ typeof ActiveXObject == "function" && (typeof global < "u" && global.ActiveXObje
64753
64755
  typeof r0 != "function" && (r0 = void 0);
64754
64756
  if (!r0 && !mk && !z4)
64755
64757
  try {
64756
- import("./browser-ponyfill-CQNXPqHa.js").then((o) => o.b).then(function(o) {
64758
+ import("./browser-ponyfill-DQtSolF7.js").then((o) => o.b).then(function(o) {
64757
64759
  r0 = o.default;
64758
64760
  }).catch(function() {
64759
64761
  });
@@ -174,7 +174,7 @@ declare class ApiClient {
174
174
  }[] | null;
175
175
  metadata?: unknown;
176
176
  }>;
177
- purchase({ offeringId, purchaseIntentId, currencyCode, metadata, }: PurchaseOfferingRequestClientFacing): Promise<{
177
+ purchase({ offeringId, purchaseIntentId, onetimeOfferingId, currencyCode, metadata, }: PurchaseOfferingRequestClientFacing): Promise<{
178
178
  purchase: {
179
179
  status: "completed" | "pending" | "abandoned";
180
180
  id: string;
@@ -301,7 +301,11 @@ declare enum AuthStatus {
301
301
 
302
302
  declare type BaseForPurchaseOfferingRequestClientFacing = Omit<PurchaseOfferingRequest, "metadata"> & {
303
303
  metadata?: Metadata;
304
- purchaseIntentId: string;
304
+ onetimeOfferingId?: string;
305
+ /**
306
+ * @deprecated Use onetimeOfferingId instead.
307
+ */
308
+ purchaseIntentId?: string;
305
309
  };
306
310
 
307
311
  declare class CheckoutClient {
@@ -414,7 +418,7 @@ declare type PurchaseOfferingRequest = {
414
418
  metadata: Metadata;
415
419
  };
416
420
 
417
- declare type PurchaseOfferingRequestClientFacing = RequireAtLeastOne<BaseForPurchaseOfferingRequestClientFacing, "offeringId" | "purchaseIntentId">;
421
+ declare type PurchaseOfferingRequestClientFacing = RequireAtLeastOne<BaseForPurchaseOfferingRequestClientFacing, "offeringId" | "onetimeOfferingId" | "purchaseIntentId">;
418
422
 
419
423
  declare enum PurchaseStatus {
420
424
  COMPLETED = "completed",
@@ -1,4 +1,4 @@
1
- import { S as e } from "./supertab-BpwqQ2BB.js";
1
+ import { S as e } from "./supertab-B8Vn8zcc.js";
2
2
  export {
3
3
  e as Supertab
4
4
  };
package/package.json CHANGED
@@ -22,7 +22,7 @@
22
22
  "engines": {
23
23
  "node": ">=22.13.1"
24
24
  },
25
- "version": "3.21.0",
25
+ "version": "3.22.0",
26
26
  "type": "module",
27
27
  "scripts": {
28
28
  "dev": "vite --config .vite/vite.dev.config.ts",