@paddle/paddle-node-sdk 2.0.0-rc.2 → 2.0.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,33 +12,21 @@ 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
|
-
## 2.0.0
|
|
15
|
+
## 2.0.0 - 2024-11-20
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
- Added the `trafficSource` filter on notification settings
|
|
20
|
-
- Omitted the `transactionId` completely from `SubscriptionNotification` and created a separate `SubscriptionCreatedNotification` with the non-null `transactionId`
|
|
21
|
-
- Added `paymentMethods` resources
|
|
22
|
-
- Added `generateAuthToken` for customer
|
|
23
|
-
|
|
24
|
-
## 2.0.0-rc.1 - 2024-10-08
|
|
17
|
+
> **Breaking changes:** This version includes major improvements that introduce breaking changes. These are called out below.
|
|
25
18
|
|
|
26
19
|
### Added
|
|
27
20
|
|
|
21
|
+
- Added support for edge runtime.
|
|
28
22
|
- Added `simulationTypes` resources
|
|
29
23
|
- Added `simulations` resources
|
|
30
24
|
- Added `simulationRuns` resources
|
|
31
25
|
- Added `simulationRunEvents` resources
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
> **Breaking changes:** This version includes major improvements that introduce breaking changes. These are called out below.
|
|
38
|
-
|
|
39
|
-
### Added
|
|
40
|
-
|
|
41
|
-
- Added support for edge runtime.
|
|
26
|
+
- Added the `trafficSource` filter on notification settings
|
|
27
|
+
- Omitted the `transactionId` completely from `SubscriptionNotification` and created a separate `SubscriptionCreatedNotification` with the non-null `transactionId`
|
|
28
|
+
- Added `paymentMethods` resources
|
|
29
|
+
- Added `generateAuthToken` for customer
|
|
42
30
|
|
|
43
31
|
### Changed
|
|
44
32
|
|
|
@@ -1,27 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
26
3
|
var t = {};
|
|
27
4
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -35,22 +12,32 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
35
12
|
};
|
|
36
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
14
|
exports.convertToSnakeCase = void 0;
|
|
38
|
-
const lodash = __importStar(require("lodash"));
|
|
39
15
|
function isTopLevelCustomDataCamel(input) {
|
|
40
16
|
return 'customData' in input;
|
|
41
17
|
}
|
|
18
|
+
function isObject(input) {
|
|
19
|
+
return input != null && typeof input === 'object';
|
|
20
|
+
}
|
|
21
|
+
function snakeCase(input) {
|
|
22
|
+
return input
|
|
23
|
+
.trim()
|
|
24
|
+
.replace(/([a-z])([A-Z])/g, '$1_$2')
|
|
25
|
+
.replace(/[\W]+/g, '_')
|
|
26
|
+
.replace(/^_+|_+$/g, '')
|
|
27
|
+
.toLowerCase();
|
|
28
|
+
}
|
|
42
29
|
function decamelizeKeys(obj) {
|
|
43
|
-
if (!
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
30
|
+
if (!isObject(obj) ||
|
|
31
|
+
obj instanceof Date ||
|
|
32
|
+
obj instanceof RegExp ||
|
|
33
|
+
typeof obj === 'boolean' ||
|
|
34
|
+
typeof obj === 'function') {
|
|
48
35
|
return obj;
|
|
49
36
|
}
|
|
50
37
|
let output;
|
|
51
38
|
let i = 0;
|
|
52
39
|
let l = 0;
|
|
53
|
-
if (
|
|
40
|
+
if (Array.isArray(obj)) {
|
|
54
41
|
output = [];
|
|
55
42
|
for (l = obj.length; i < l; i++) {
|
|
56
43
|
output.push(decamelizeKeys(obj[i]));
|
|
@@ -60,14 +47,14 @@ function decamelizeKeys(obj) {
|
|
|
60
47
|
output = {};
|
|
61
48
|
for (const key in obj) {
|
|
62
49
|
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
63
|
-
output[
|
|
50
|
+
output[snakeCase(key)] = decamelizeKeys(obj[key]);
|
|
64
51
|
}
|
|
65
52
|
}
|
|
66
53
|
}
|
|
67
54
|
return output;
|
|
68
55
|
}
|
|
69
56
|
function convertToSnakeCase(input) {
|
|
70
|
-
if (!input || !
|
|
57
|
+
if (!input || !isObject(input)) {
|
|
71
58
|
return input;
|
|
72
59
|
}
|
|
73
60
|
if (isTopLevelCustomDataCamel(input)) {
|
package/dist/cjs/version.js
CHANGED
|
@@ -9,22 +9,32 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
9
9
|
}
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
|
-
import * as lodash from 'lodash';
|
|
13
12
|
function isTopLevelCustomDataCamel(input) {
|
|
14
13
|
return 'customData' in input;
|
|
15
14
|
}
|
|
15
|
+
function isObject(input) {
|
|
16
|
+
return input != null && typeof input === 'object';
|
|
17
|
+
}
|
|
18
|
+
function snakeCase(input) {
|
|
19
|
+
return input
|
|
20
|
+
.trim()
|
|
21
|
+
.replace(/([a-z])([A-Z])/g, '$1_$2')
|
|
22
|
+
.replace(/[\W]+/g, '_')
|
|
23
|
+
.replace(/^_+|_+$/g, '')
|
|
24
|
+
.toLowerCase();
|
|
25
|
+
}
|
|
16
26
|
function decamelizeKeys(obj) {
|
|
17
|
-
if (!
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
27
|
+
if (!isObject(obj) ||
|
|
28
|
+
obj instanceof Date ||
|
|
29
|
+
obj instanceof RegExp ||
|
|
30
|
+
typeof obj === 'boolean' ||
|
|
31
|
+
typeof obj === 'function') {
|
|
22
32
|
return obj;
|
|
23
33
|
}
|
|
24
34
|
let output;
|
|
25
35
|
let i = 0;
|
|
26
36
|
let l = 0;
|
|
27
|
-
if (
|
|
37
|
+
if (Array.isArray(obj)) {
|
|
28
38
|
output = [];
|
|
29
39
|
for (l = obj.length; i < l; i++) {
|
|
30
40
|
output.push(decamelizeKeys(obj[i]));
|
|
@@ -34,14 +44,14 @@ function decamelizeKeys(obj) {
|
|
|
34
44
|
output = {};
|
|
35
45
|
for (const key in obj) {
|
|
36
46
|
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
37
|
-
output[
|
|
47
|
+
output[snakeCase(key)] = decamelizeKeys(obj[key]);
|
|
38
48
|
}
|
|
39
49
|
}
|
|
40
50
|
}
|
|
41
51
|
return output;
|
|
42
52
|
}
|
|
43
53
|
export function convertToSnakeCase(input) {
|
|
44
|
-
if (!input || !
|
|
54
|
+
if (!input || !isObject(input)) {
|
|
45
55
|
return input;
|
|
46
56
|
}
|
|
47
57
|
if (isTopLevelCustomDataCamel(input)) {
|
package/dist/esm/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = '2.0.0
|
|
1
|
+
export const SDK_VERSION = '2.0.0';
|
package/dist/types/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "2.0.0
|
|
1
|
+
export declare const SDK_VERSION = "2.0.0";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paddle/paddle-node-sdk",
|
|
3
|
-
"version": "2.0.0
|
|
3
|
+
"version": "2.0.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.cjs.node.js",
|
|
6
6
|
"module": "dist/esm/index.esm.node.js",
|
|
@@ -58,9 +58,6 @@
|
|
|
58
58
|
"prettier": "^3.0.3",
|
|
59
59
|
"typescript": "^5.2.2"
|
|
60
60
|
},
|
|
61
|
-
"dependencies": {
|
|
62
|
-
"lodash": "^4.17.21"
|
|
63
|
-
},
|
|
64
61
|
"exports": {
|
|
65
62
|
"types": "./dist/types/index.cjs.node.d.ts",
|
|
66
63
|
"worker": {
|