@drawbridge/drawbridge-utils 0.0.94 → 0.0.95
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/plans.cjs +2 -2
- package/dist/plans.d.cts +8 -8
- package/dist/plans.d.ts +8 -8
- package/dist/plans.js +2 -2
- package/package.json +1 -1
package/dist/plans.cjs
CHANGED
|
@@ -441,8 +441,8 @@ var resolvePlan = (subscription) => {
|
|
|
441
441
|
};
|
|
442
442
|
};
|
|
443
443
|
var conversionRate = (subscription) => {
|
|
444
|
-
var _a
|
|
445
|
-
return ((_a =
|
|
444
|
+
var _a;
|
|
445
|
+
return ((_a = resolvePlan(subscription)) == null ? void 0 : _a.conversion) ?? free.conversion;
|
|
446
446
|
};
|
|
447
447
|
// Annotate the CommonJS export names for ESM import in node:
|
|
448
448
|
0 && (module.exports = {
|
package/dist/plans.d.cts
CHANGED
|
@@ -230,15 +230,15 @@ const resolvePlan = ( subscription ) => {
|
|
|
230
230
|
};
|
|
231
231
|
|
|
232
232
|
// Resolve the conversion-fee percentage for an order's owning org.
|
|
233
|
-
//
|
|
234
|
-
//
|
|
235
|
-
//
|
|
236
|
-
//
|
|
237
|
-
//
|
|
233
|
+
//
|
|
234
|
+
// The plan is the only source. A negotiated rate is not a per-subscription
|
|
235
|
+
// override any more — it is a custom plan, and `resolvePlan` reads that from
|
|
236
|
+
// `subscription.custom.conversion`. The catalog answers for everyone else.
|
|
237
|
+
//
|
|
238
|
+
// `??` not `||`, because a plan's 0 is a valid 0% rate. `subscription` is null
|
|
239
|
+
// for free orgs (they have no subscription document).
|
|
238
240
|
const conversionRate = ( subscription ) =>
|
|
239
|
-
subscription?.
|
|
240
|
-
?? subscription?.conversion
|
|
241
|
-
?? resolvePlan( subscription )?.conversion
|
|
241
|
+
resolvePlan( subscription )?.conversion
|
|
242
242
|
?? free.conversion;
|
|
243
243
|
|
|
244
244
|
export { conversionRate, free, plans, resolvePlan };
|
package/dist/plans.d.ts
CHANGED
|
@@ -230,15 +230,15 @@ const resolvePlan = ( subscription ) => {
|
|
|
230
230
|
};
|
|
231
231
|
|
|
232
232
|
// Resolve the conversion-fee percentage for an order's owning org.
|
|
233
|
-
//
|
|
234
|
-
//
|
|
235
|
-
//
|
|
236
|
-
//
|
|
237
|
-
//
|
|
233
|
+
//
|
|
234
|
+
// The plan is the only source. A negotiated rate is not a per-subscription
|
|
235
|
+
// override any more — it is a custom plan, and `resolvePlan` reads that from
|
|
236
|
+
// `subscription.custom.conversion`. The catalog answers for everyone else.
|
|
237
|
+
//
|
|
238
|
+
// `??` not `||`, because a plan's 0 is a valid 0% rate. `subscription` is null
|
|
239
|
+
// for free orgs (they have no subscription document).
|
|
238
240
|
const conversionRate = ( subscription ) =>
|
|
239
|
-
subscription?.
|
|
240
|
-
?? subscription?.conversion
|
|
241
|
-
?? resolvePlan( subscription )?.conversion
|
|
241
|
+
resolvePlan( subscription )?.conversion
|
|
242
242
|
?? free.conversion;
|
|
243
243
|
|
|
244
244
|
export { conversionRate, free, plans, resolvePlan };
|
package/dist/plans.js
CHANGED
|
@@ -403,8 +403,8 @@ var resolvePlan = (subscription) => {
|
|
|
403
403
|
};
|
|
404
404
|
};
|
|
405
405
|
var conversionRate = (subscription) => {
|
|
406
|
-
var _a
|
|
407
|
-
return ((_a =
|
|
406
|
+
var _a;
|
|
407
|
+
return ((_a = resolvePlan(subscription)) == null ? void 0 : _a.conversion) ?? free.conversion;
|
|
408
408
|
};
|
|
409
409
|
export {
|
|
410
410
|
conversionRate,
|
package/package.json
CHANGED