@rebilly/instruments 9.83.0 → 9.84.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/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
- ## [9.83.0](https://github.com/Rebilly/rebilly/compare/instruments/core-v9.82.1...instruments/core-v9.83.0) (2024-09-23)
1
+ ## [9.84.1](https://github.com/Rebilly/rebilly/compare/instruments/core-v9.84.0...instruments/core-v9.84.1) (2024-09-25)
2
2
 
3
3
 
4
- ### Features
4
+ ### Bug Fixes
5
5
 
6
- * **api-metadata, rebilly-js-sdk:** Update resources based on latest api definitions ([#7708](https://github.com/Rebilly/rebilly/issues/7708)) ([7bb92e5](https://github.com/Rebilly/rebilly/commit/7bb92e5964ac5922a8b47c485080a0d1466e5f11))
6
+ * **instruments:** Update invoice with payment instrument billing address ([#7673](https://github.com/Rebilly/rebilly/issues/7673)) ([45f8044](https://github.com/Rebilly/rebilly/commit/45f80440d94b8d265de4fb9fa22be08fa4edb3f1))
package/dist/index.js CHANGED
@@ -2738,6 +2738,49 @@ function updateAddonsHandler(iframe) {
2738
2738
  }
2739
2739
  );
2740
2740
  }
2741
+ class BaseModel {
2742
+ constructor({ ...fields } = {}) {
2743
+ Object.entries(fields).forEach(([key, value]) => {
2744
+ this[key] = value;
2745
+ });
2746
+ }
2747
+ }
2748
+ const _InvoiceModel = class _InvoiceModel extends BaseModel {
2749
+ get isPaid() {
2750
+ return this.status === _InvoiceModel.Status.paid;
2751
+ }
2752
+ get isVoid() {
2753
+ return this.status === _InvoiceModel.Status.voided;
2754
+ }
2755
+ get isRefunded() {
2756
+ return this.status === _InvoiceModel.Status.refunded;
2757
+ }
2758
+ get isAbandoned() {
2759
+ return this.status === _InvoiceModel.Status.abandoned;
2760
+ }
2761
+ };
2762
+ _InvoiceModel.Status = {
2763
+ draft: "draft",
2764
+ unpaid: "unpaid",
2765
+ paid: "paid",
2766
+ partiallyPaid: "partially-paid",
2767
+ pastDue: "past-due",
2768
+ abandoned: "abandoned",
2769
+ voided: "voided",
2770
+ partiallyRefunded: "partially-refunded",
2771
+ refunded: "refunded",
2772
+ disputed: "disputed"
2773
+ };
2774
+ let InvoiceModel = _InvoiceModel;
2775
+ function updateInvoiceHandler(iframe) {
2776
+ iframe.component.on(
2777
+ `${iframe.name}-update-invoice`,
2778
+ async ({ invoice }) => {
2779
+ state.data.invoice = new InvoiceModel(invoice);
2780
+ state.updateModel();
2781
+ }
2782
+ );
2783
+ }
2741
2784
  const errorTemplate = (error2) => {
2742
2785
  const title2 = "Error";
2743
2786
  function displayString(message = null) {
@@ -2937,6 +2980,7 @@ let ViewIframe$1 = class ViewIframe extends BaseIframe {
2937
2980
  showErrorHandler(this);
2938
2981
  updateCouponsHandler(this);
2939
2982
  updateAddonsHandler(this);
2983
+ updateInvoiceHandler(this);
2940
2984
  showConfirmationModalHandler(this);
2941
2985
  }
2942
2986
  };
@@ -3330,13 +3374,6 @@ function cloneDeep(value) {
3330
3374
  }
3331
3375
  var cloneDeep_1 = cloneDeep;
3332
3376
  const cloneDeep$1 = /* @__PURE__ */ getDefaultExportFromCjs(cloneDeep_1);
3333
- class BaseModel {
3334
- constructor({ ...fields } = {}) {
3335
- Object.entries(fields).forEach(([key, value]) => {
3336
- this[key] = value;
3337
- });
3338
- }
3339
- }
3340
3377
  class SummaryLineItemModel extends BaseModel {
3341
3378
  constructor({
3342
3379
  unitPrice = 0,
@@ -6220,7 +6257,7 @@ function C$1({ options: e2 }) {
6220
6257
  }
6221
6258
  function o2() {
6222
6259
  const i = {
6223
- "REB-API-CONSUMER": `${["Rebilly", e2.appName, "js-sdk"].filter((g) => g).join("/")}@7bb92e5`
6260
+ "REB-API-CONSUMER": `${["Rebilly", e2.appName, "js-sdk"].filter((g) => g).join("/")}@45f8044`
6224
6261
  };
6225
6262
  return e2.apiKey && (i["REB-APIKEY"] = e2.apiKey), i;
6226
6263
  }
@@ -16418,33 +16455,6 @@ async function fetchReadyToPayout() {
16418
16455
  return filterReadyToPayout(readyToPayout);
16419
16456
  });
16420
16457
  }
16421
- const _InvoiceModel = class _InvoiceModel extends BaseModel {
16422
- get isPaid() {
16423
- return this.status === _InvoiceModel.Status.paid;
16424
- }
16425
- get isVoid() {
16426
- return this.status === _InvoiceModel.Status.voided;
16427
- }
16428
- get isRefunded() {
16429
- return this.status === _InvoiceModel.Status.refunded;
16430
- }
16431
- get isAbandoned() {
16432
- return this.status === _InvoiceModel.Status.abandoned;
16433
- }
16434
- };
16435
- _InvoiceModel.Status = {
16436
- draft: "draft",
16437
- unpaid: "unpaid",
16438
- paid: "paid",
16439
- partiallyPaid: "partially-paid",
16440
- pastDue: "past-due",
16441
- abandoned: "abandoned",
16442
- voided: "voided",
16443
- partiallyRefunded: "partially-refunded",
16444
- refunded: "refunded",
16445
- disputed: "disputed"
16446
- };
16447
- let InvoiceModel = _InvoiceModel;
16448
16458
  async function fetchInvoiceAndProducts({
16449
16459
  data
16450
16460
  }) {