@drawbridge/drawbridge-utils 0.0.146 → 0.0.147

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.
@@ -4177,9 +4177,8 @@ var shopify_default2 = {
4177
4177
  adminAccessToken,
4178
4178
  domain: connection2.shop
4179
4179
  });
4180
- if (subscriptions.length && subscriptions.every((subscription) => typeof subscription.metered === "boolean")) {
4181
- metered = ((_a = subscriptions.find((subscription) => subscription.usageLineItemId)) == null ? void 0 : _a.usageLineItemId) || null;
4182
- }
4180
+ const usageLine = (_a = subscriptions.find((subscription) => subscription.usageLineItemId)) == null ? void 0 : _a.usageLineItemId;
4181
+ if (usageLine) metered = usageLine;
4183
4182
  } catch (probeError) {
4184
4183
  billingProbeFailed = true;
4185
4184
  (_b = logger2 == null ? void 0 : logger2.warn) == null ? void 0 : _b.call(logger2, "shopify.health.billing.probe.failed", {
@@ -4943,20 +4943,20 @@ var shopify = {
4943
4943
  domain : connection.shop
4944
4944
  });
4945
4945
 
4946
- // Only an ACTIVE approval says anything about metering — no
4947
- // subscriptions (mid-install, plan pending) leaves the stamp
4948
- // untouched rather than asserting null from silence. The
4949
- // every-boolean guard is version skew insurance: an older
4950
- // @drawbridge/shopify returns subscriptions without the flag
4951
- // (and without usageLineItemId), and reading that silence as
4952
- // unmetered would nag every healthy merchant to re-approve a
4953
- // plan that is fine the flag being boolean proves an SDK
4954
- // that also reports the line id.
4955
- if( subscriptions.length && subscriptions.every( ( subscription ) => typeof subscription.metered === 'boolean' ) ){
4956
-
4957
- metered = subscriptions.find( ( subscription ) => subscription.usageLineItemId )?.usageLineItemId || null;
4958
-
4959
- }
4946
+ // A usage line on the approval is POSITIVE evidence and gets
4947
+ // stamped. Its ABSENCE proves nothing: measured 2026-09-04
4948
+ // (both 2026-04 and unstable, against a plan whose meter
4949
+ // exists), managed-pricing App-Events meters never
4950
+ // materialize as subscription line items — AppUsagePricing is
4951
+ // the legacy usage-charge model. Reading absence as
4952
+ // "unmetered" flagged healthy stores, so absence is NO
4953
+ // VERDICT: the stamp, the Issue, the card and the
4954
+ // meter-missing pager all stay silent until a signal that can
4955
+ // actually observe the meter exists (Partner API
4956
+ // USAGE_CHARGE_APPLIED accrual events are that signal).
4957
+ const usageLine = subscriptions.find( ( subscription ) => subscription.usageLineItemId )?.usageLineItemId;
4958
+
4959
+ if( usageLine ) metered = usageLine;
4960
4960
 
4961
4961
  } catch ( probeError ) {
4962
4962
 
@@ -4943,20 +4943,20 @@ var shopify = {
4943
4943
  domain : connection.shop
4944
4944
  });
4945
4945
 
4946
- // Only an ACTIVE approval says anything about metering — no
4947
- // subscriptions (mid-install, plan pending) leaves the stamp
4948
- // untouched rather than asserting null from silence. The
4949
- // every-boolean guard is version skew insurance: an older
4950
- // @drawbridge/shopify returns subscriptions without the flag
4951
- // (and without usageLineItemId), and reading that silence as
4952
- // unmetered would nag every healthy merchant to re-approve a
4953
- // plan that is fine the flag being boolean proves an SDK
4954
- // that also reports the line id.
4955
- if( subscriptions.length && subscriptions.every( ( subscription ) => typeof subscription.metered === 'boolean' ) ){
4956
-
4957
- metered = subscriptions.find( ( subscription ) => subscription.usageLineItemId )?.usageLineItemId || null;
4958
-
4959
- }
4946
+ // A usage line on the approval is POSITIVE evidence and gets
4947
+ // stamped. Its ABSENCE proves nothing: measured 2026-09-04
4948
+ // (both 2026-04 and unstable, against a plan whose meter
4949
+ // exists), managed-pricing App-Events meters never
4950
+ // materialize as subscription line items — AppUsagePricing is
4951
+ // the legacy usage-charge model. Reading absence as
4952
+ // "unmetered" flagged healthy stores, so absence is NO
4953
+ // VERDICT: the stamp, the Issue, the card and the
4954
+ // meter-missing pager all stay silent until a signal that can
4955
+ // actually observe the meter exists (Partner API
4956
+ // USAGE_CHARGE_APPLIED accrual events are that signal).
4957
+ const usageLine = subscriptions.find( ( subscription ) => subscription.usageLineItemId )?.usageLineItemId;
4958
+
4959
+ if( usageLine ) metered = usageLine;
4960
4960
 
4961
4961
  } catch ( probeError ) {
4962
4962
 
@@ -4103,9 +4103,8 @@ var shopify_default2 = {
4103
4103
  adminAccessToken,
4104
4104
  domain: connection2.shop
4105
4105
  });
4106
- if (subscriptions.length && subscriptions.every((subscription) => typeof subscription.metered === "boolean")) {
4107
- metered = ((_a = subscriptions.find((subscription) => subscription.usageLineItemId)) == null ? void 0 : _a.usageLineItemId) || null;
4108
- }
4106
+ const usageLine = (_a = subscriptions.find((subscription) => subscription.usageLineItemId)) == null ? void 0 : _a.usageLineItemId;
4107
+ if (usageLine) metered = usageLine;
4109
4108
  } catch (probeError) {
4110
4109
  billingProbeFailed = true;
4111
4110
  (_b = logger2 == null ? void 0 : logger2.warn) == null ? void 0 : _b.call(logger2, "shopify.health.billing.probe.failed", {
@@ -4102,9 +4102,8 @@ var shopify_default2 = {
4102
4102
  adminAccessToken,
4103
4103
  domain: connection2.shop
4104
4104
  });
4105
- if (subscriptions.length && subscriptions.every((subscription) => typeof subscription.metered === "boolean")) {
4106
- metered = ((_a = subscriptions.find((subscription) => subscription.usageLineItemId)) == null ? void 0 : _a.usageLineItemId) || null;
4107
- }
4105
+ const usageLine = (_a = subscriptions.find((subscription) => subscription.usageLineItemId)) == null ? void 0 : _a.usageLineItemId;
4106
+ if (usageLine) metered = usageLine;
4108
4107
  } catch (probeError) {
4109
4108
  billingProbeFailed = true;
4110
4109
  (_b = logger2 == null ? void 0 : logger2.warn) == null ? void 0 : _b.call(logger2, "shopify.health.billing.probe.failed", {
package/dist/providers.js CHANGED
@@ -4058,9 +4058,8 @@ var shopify_default2 = {
4058
4058
  adminAccessToken,
4059
4059
  domain: connection2.shop
4060
4060
  });
4061
- if (subscriptions.length && subscriptions.every((subscription) => typeof subscription.metered === "boolean")) {
4062
- metered = ((_a = subscriptions.find((subscription) => subscription.usageLineItemId)) == null ? void 0 : _a.usageLineItemId) || null;
4063
- }
4061
+ const usageLine = (_a = subscriptions.find((subscription) => subscription.usageLineItemId)) == null ? void 0 : _a.usageLineItemId;
4062
+ if (usageLine) metered = usageLine;
4064
4063
  } catch (probeError) {
4065
4064
  billingProbeFailed = true;
4066
4065
  (_b = logger2 == null ? void 0 : logger2.warn) == null ? void 0 : _b.call(logger2, "shopify.health.billing.probe.failed", {
package/package.json CHANGED
@@ -216,5 +216,5 @@
216
216
  "prepublishOnly": ". \"$HOME/.nvm/nvm.sh\" && nvm use && tsup && node --test"
217
217
  },
218
218
  "types": "dist/index.d.ts",
219
- "version": "0.0.146"
219
+ "version": "0.0.147"
220
220
  }