@churchapps/content-providers 0.9.2 → 0.9.3

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
@@ -71,13 +71,15 @@ function navigateToPath(instructions, path) {
71
71
 
72
72
  // src/helpers/TokenHelper.ts
73
73
  function toAuthData(data, fallbacks) {
74
+ const planTypeId = data.plan_type_id || fallbacks?.planTypeId;
74
75
  return {
75
76
  access_token: data.access_token,
76
77
  refresh_token: data.refresh_token || fallbacks?.refreshToken || "",
77
78
  token_type: data.token_type || "Bearer",
78
79
  created_at: Math.floor(Date.now() / 1e3),
79
80
  expires_in: data.expires_in,
80
- scope: data.scope || fallbacks?.scope || ""
81
+ scope: data.scope || fallbacks?.scope || "",
82
+ ...planTypeId ? { planTypeId } : {}
81
83
  };
82
84
  }
83
85
  var TokenHelper = class {
@@ -105,7 +107,8 @@ var TokenHelper = class {
105
107
  return null;
106
108
  }
107
109
  const data = await response.json();
108
- return toAuthData(data, { refreshToken: auth.refresh_token, scope: auth.scope });
110
+ const planTypeId = auth.planTypeId;
111
+ return toAuthData(data, { refreshToken: auth.refresh_token, scope: auth.scope, planTypeId });
109
112
  } catch {
110
113
  return null;
111
114
  }
@@ -1483,9 +1486,7 @@ var B1ChurchProvider = class extends BaseProvider {
1483
1486
  setPairingData(data) {
1484
1487
  if (data && typeof data === "object" && "planTypeId" in data) {
1485
1488
  const planTypeId = data.planTypeId;
1486
- this.planTypeId = typeof planTypeId === "string" ? planTypeId : null;
1487
- } else {
1488
- this.planTypeId = null;
1489
+ if (typeof planTypeId === "string") this.planTypeId = planTypeId;
1489
1490
  }
1490
1491
  }
1491
1492
  async getCurrentPlan(authData) {
@@ -18021,7 +18022,7 @@ function getAvailableProviders(ids) {
18021
18022
  }
18022
18023
 
18023
18024
  // src/index.ts
18024
- var VERSION = true ? "0.9.2" : "dev";
18025
+ var VERSION = true ? "0.9.3" : "dev";
18025
18026
  // Annotate the CommonJS export names for ESM import in node:
18026
18027
  0 && (module.exports = {
18027
18028
  APlayProvider,