@freemius/sdk 0.2.0 → 0.3.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.
package/dist/index.js CHANGED
@@ -169,7 +169,7 @@ var WebhookError = class extends Error {
169
169
 
170
170
  //#endregion
171
171
  //#region package.json
172
- var version = "0.2.0";
172
+ var version = "0.3.0";
173
173
 
174
174
  //#endregion
175
175
  //#region src/api/client.ts
@@ -496,6 +496,18 @@ var User = class extends ApiBase {
496
496
  if (!this.isGoodResponse(response.response) || !response.data) return null;
497
497
  return response.data;
498
498
  }
499
+ async retrieveInvoice(userId, paymentId) {
500
+ const response = await this.client.GET(`/products/{product_id}/users/{user_id}/payments/{payment_id}/invoice.pdf`, {
501
+ params: { path: {
502
+ product_id: this.productId,
503
+ user_id: this.getIdForPath(userId),
504
+ payment_id: this.getIdForPath(paymentId)
505
+ } },
506
+ parseAs: "blob"
507
+ });
508
+ if (!this.isGoodResponse(response.response) || !response.data) return null;
509
+ return response.data;
510
+ }
499
511
  };
500
512
 
501
513
  //#endregion
@@ -572,7 +584,7 @@ function isTestServer() {
572
584
 
573
585
  //#endregion
574
586
  //#region src/services/ApiService.ts
575
- const API_ENDPOINT_PRODUCTION = "https://api.freemius.com/v1/";
587
+ const API_ENDPOINT_PRODUCTION = "https://fast-api.freemius.com/v1/";
576
588
  const API_ENDPOINT_TEST = "http://api.freemius-local.com:8080/v1/";
577
589
  /**
578
590
  * @todo - Add a proper user-agent string with SDK version.
package/dist/index.mjs CHANGED
@@ -147,7 +147,7 @@ var WebhookError = class extends Error {
147
147
 
148
148
  //#endregion
149
149
  //#region package.json
150
- var version = "0.2.0";
150
+ var version = "0.3.0";
151
151
 
152
152
  //#endregion
153
153
  //#region src/api/client.ts
@@ -474,6 +474,18 @@ var User = class extends ApiBase {
474
474
  if (!this.isGoodResponse(response.response) || !response.data) return null;
475
475
  return response.data;
476
476
  }
477
+ async retrieveInvoice(userId, paymentId) {
478
+ const response = await this.client.GET(`/products/{product_id}/users/{user_id}/payments/{payment_id}/invoice.pdf`, {
479
+ params: { path: {
480
+ product_id: this.productId,
481
+ user_id: this.getIdForPath(userId),
482
+ payment_id: this.getIdForPath(paymentId)
483
+ } },
484
+ parseAs: "blob"
485
+ });
486
+ if (!this.isGoodResponse(response.response) || !response.data) return null;
487
+ return response.data;
488
+ }
477
489
  };
478
490
 
479
491
  //#endregion
@@ -550,7 +562,7 @@ function isTestServer() {
550
562
 
551
563
  //#endregion
552
564
  //#region src/services/ApiService.ts
553
- const API_ENDPOINT_PRODUCTION = "https://api.freemius.com/v1/";
565
+ const API_ENDPOINT_PRODUCTION = "https://fast-api.freemius.com/v1/";
554
566
  const API_ENDPOINT_TEST = "http://api.freemius-local.com:8080/v1/";
555
567
  /**
556
568
  * @todo - Add a proper user-agent string with SDK version.