@paddle/paddle-node-sdk 1.3.0-beta.1 → 1.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/CHANGELOG.md CHANGED
@@ -12,19 +12,20 @@ When we make [non-breaking changes](https://developer.paddle.com/api-reference/a
12
12
 
13
13
  This means when upgrading minor versions of the SDK, you may notice type errors. You can safely ignore these or fix by adding additional type guards.
14
14
 
15
- ## 1.3.0-beta.1 - 2024-04-03
15
+ ## 1.3.0 - 2024-04-18
16
16
 
17
- ### Fixed
17
+ ### Changed
18
18
 
19
- - Updated the optional properties returned by `pricingPreview.preview` operation to match the API response.
19
+ - Updated the package to export both CommonJS and ES module formats.
20
+ - Updated `Collection` to return `hasMore` and `estimatedTotal` properties
20
21
 
21
22
  ---
22
23
 
23
- ## 1.3.0-beta.0 - 2024-03-26
24
+ ## 1.2.2 - 2024-04-03
24
25
 
25
- ### Changed
26
+ ### Fixed
26
27
 
27
- - Updated the package to export both CommonJS and ES module formats.
28
+ - Updated the optional properties returned by `pricingPreview.preview` operation to match the API response.
28
29
 
29
30
  ---
30
31
 
@@ -27,16 +27,18 @@ class Collection {
27
27
  constructor(client, initialUri) {
28
28
  this.client = client;
29
29
  this.hasMore = true;
30
+ this.estimatedTotal = 0;
30
31
  this.data = [];
31
32
  this.nextLink = initialUri;
32
33
  }
33
34
  next() {
34
- var _a;
35
+ var _a, _b;
35
36
  return __awaiter(this, void 0, void 0, function* () {
36
37
  const response = yield this.client.get(this.nextLink);
37
38
  const handledResponse = this.handlePaginatedResponse(response);
38
39
  this.hasMore = (_a = handledResponse.meta.pagination.has_more) !== null && _a !== void 0 ? _a : false;
39
40
  this.nextLink = handledResponse.meta.pagination.next;
41
+ this.estimatedTotal = (_b = handledResponse.meta.pagination.estimated_total) !== null && _b !== void 0 ? _b : 0;
40
42
  this.data = handledResponse.data.map((data) => this.fromJson(data));
41
43
  return this.data.length > 0 ? this.data : [];
42
44
  });
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = '1.3.0-beta.1';
4
+ exports.SDK_VERSION = '1.3.0';
@@ -24,16 +24,18 @@ export class Collection {
24
24
  constructor(client, initialUri) {
25
25
  this.client = client;
26
26
  this.hasMore = true;
27
+ this.estimatedTotal = 0;
27
28
  this.data = [];
28
29
  this.nextLink = initialUri;
29
30
  }
30
31
  next() {
31
- var _a;
32
+ var _a, _b;
32
33
  return __awaiter(this, void 0, void 0, function* () {
33
34
  const response = yield this.client.get(this.nextLink);
34
35
  const handledResponse = this.handlePaginatedResponse(response);
35
36
  this.hasMore = (_a = handledResponse.meta.pagination.has_more) !== null && _a !== void 0 ? _a : false;
36
37
  this.nextLink = handledResponse.meta.pagination.next;
38
+ this.estimatedTotal = (_b = handledResponse.meta.pagination.estimated_total) !== null && _b !== void 0 ? _b : 0;
37
39
  this.data = handledResponse.data.map((data) => this.fromJson(data));
38
40
  return this.data.length > 0 ? this.data : [];
39
41
  });
@@ -1 +1 @@
1
- export const SDK_VERSION = '1.3.0-beta.1';
1
+ export const SDK_VERSION = '1.3.0';
@@ -2,7 +2,8 @@ import { type Client } from '../api/client';
2
2
  import { type ErrorResponse, type ResponsePaginated } from '../types/response';
3
3
  export declare abstract class Collection<T, C> implements AsyncIterable<C> {
4
4
  private readonly client;
5
- private hasMore;
5
+ hasMore: boolean;
6
+ estimatedTotal: number;
6
7
  private nextLink;
7
8
  private data;
8
9
  constructor(client: Client, initialUri: string);
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "1.3.0-beta.1";
1
+ export declare const SDK_VERSION = "1.3.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paddle/paddle-node-sdk",
3
- "version": "1.3.0-beta.1",
3
+ "version": "1.3.0",
4
4
  "description": "A Node.js SDK that you can use to integrate Paddle Billing with applications written in server-side JavaScript.",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/esm/index.js",