@naturalpay/sdk 0.4.0 → 0.5.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 +9 -0
- package/client.d.mts +7 -16
- package/client.d.mts.map +1 -1
- package/client.d.ts +7 -16
- package/client.d.ts.map +1 -1
- package/client.js +3 -12
- package/client.js.map +1 -1
- package/client.mjs +3 -12
- package/client.mjs.map +1 -1
- package/internal/tslib.js +17 -17
- package/internal/utils/query.d.mts +3 -0
- package/internal/utils/query.d.mts.map +1 -1
- package/internal/utils/query.d.ts +3 -0
- package/internal/utils/query.d.ts.map +1 -1
- package/internal/utils/query.js +16 -3
- package/internal/utils/query.js.map +1 -1
- package/internal/utils/query.mjs +16 -2
- package/internal/utils/query.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/agents.d.mts +554 -268
- package/resources/agents.d.mts.map +1 -1
- package/resources/agents.d.ts +554 -268
- package/resources/agents.d.ts.map +1 -1
- package/resources/agents.js +72 -20
- package/resources/agents.js.map +1 -1
- package/resources/agents.mjs +72 -20
- package/resources/agents.mjs.map +1 -1
- package/resources/customers.d.mts +243 -114
- package/resources/customers.d.mts.map +1 -1
- package/resources/customers.d.ts +243 -114
- package/resources/customers.d.ts.map +1 -1
- package/resources/customers.js +6 -7
- package/resources/customers.js.map +1 -1
- package/resources/customers.mjs +6 -7
- package/resources/customers.mjs.map +1 -1
- package/resources/index.d.mts +2 -4
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +2 -4
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +1 -5
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +0 -2
- package/resources/index.mjs.map +1 -1
- package/src/client.ts +23 -60
- package/src/internal/utils/query.ts +18 -2
- package/src/resources/agents.ts +676 -300
- package/src/resources/customers.ts +273 -132
- package/src/resources/index.ts +10 -24
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
- package/internal/qs/formats.d.mts +0 -7
- package/internal/qs/formats.d.mts.map +0 -1
- package/internal/qs/formats.d.ts +0 -7
- package/internal/qs/formats.d.ts.map +0 -1
- package/internal/qs/formats.js +0 -13
- package/internal/qs/formats.js.map +0 -1
- package/internal/qs/formats.mjs +0 -9
- package/internal/qs/formats.mjs.map +0 -1
- package/internal/qs/index.d.mts +0 -10
- package/internal/qs/index.d.mts.map +0 -1
- package/internal/qs/index.d.ts +0 -10
- package/internal/qs/index.d.ts.map +0 -1
- package/internal/qs/index.js +0 -14
- package/internal/qs/index.js.map +0 -1
- package/internal/qs/index.mjs +0 -10
- package/internal/qs/index.mjs.map +0 -1
- package/internal/qs/stringify.d.mts +0 -3
- package/internal/qs/stringify.d.mts.map +0 -1
- package/internal/qs/stringify.d.ts +0 -3
- package/internal/qs/stringify.d.ts.map +0 -1
- package/internal/qs/stringify.js +0 -277
- package/internal/qs/stringify.js.map +0 -1
- package/internal/qs/stringify.mjs +0 -274
- package/internal/qs/stringify.mjs.map +0 -1
- package/internal/qs/types.d.mts +0 -57
- package/internal/qs/types.d.mts.map +0 -1
- package/internal/qs/types.d.ts +0 -57
- package/internal/qs/types.d.ts.map +0 -1
- package/internal/qs/types.js +0 -3
- package/internal/qs/types.js.map +0 -1
- package/internal/qs/types.mjs +0 -2
- package/internal/qs/types.mjs.map +0 -1
- package/internal/qs/utils.d.mts +0 -15
- package/internal/qs/utils.d.mts.map +0 -1
- package/internal/qs/utils.d.ts +0 -15
- package/internal/qs/utils.d.ts.map +0 -1
- package/internal/qs/utils.js +0 -230
- package/internal/qs/utils.js.map +0 -1
- package/internal/qs/utils.mjs +0 -217
- package/internal/qs/utils.mjs.map +0 -1
- package/resources/delegations.d.mts +0 -458
- package/resources/delegations.d.mts.map +0 -1
- package/resources/delegations.d.ts +0 -458
- package/resources/delegations.d.ts.map +0 -1
- package/resources/delegations.js +0 -47
- package/resources/delegations.js.map +0 -1
- package/resources/delegations.mjs +0 -43
- package/resources/delegations.mjs.map +0 -1
- package/resources/escalations.d.mts +0 -1124
- package/resources/escalations.d.mts.map +0 -1
- package/resources/escalations.d.ts +0 -1124
- package/resources/escalations.d.ts.map +0 -1
- package/resources/escalations.js +0 -110
- package/resources/escalations.js.map +0 -1
- package/resources/escalations.mjs +0 -106
- package/resources/escalations.mjs.map +0 -1
- package/src/internal/qs/LICENSE.md +0 -13
- package/src/internal/qs/README.md +0 -3
- package/src/internal/qs/formats.ts +0 -10
- package/src/internal/qs/index.ts +0 -13
- package/src/internal/qs/stringify.ts +0 -385
- package/src/internal/qs/types.ts +0 -71
- package/src/internal/qs/utils.ts +0 -265
- package/src/resources/delegations.ts +0 -580
- package/src/resources/escalations.ts +0 -1422
package/internal/tslib.js
CHANGED
|
@@ -1,10 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.__setModuleDefault = exports.__createBinding = void 0;
|
|
4
|
-
exports.__importStar = __importStar;
|
|
5
4
|
exports.__classPrivateFieldSet = __classPrivateFieldSet;
|
|
6
5
|
exports.__classPrivateFieldGet = __classPrivateFieldGet;
|
|
6
|
+
exports.__importStar = __importStar;
|
|
7
7
|
exports.__exportStar = __exportStar;
|
|
8
|
+
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
9
|
+
if (kind === "m")
|
|
10
|
+
throw new TypeError("Private method is not writable");
|
|
11
|
+
if (kind === "a" && !f)
|
|
12
|
+
throw new TypeError("Private accessor was defined without a setter");
|
|
13
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
14
|
+
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
15
|
+
return kind === "a" ? f.call(receiver, value) : f ? (f.value = value) : state.set(receiver, value), value;
|
|
16
|
+
}
|
|
17
|
+
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
18
|
+
if (kind === "a" && !f)
|
|
19
|
+
throw new TypeError("Private accessor was defined without a getter");
|
|
20
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
21
|
+
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
22
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
23
|
+
}
|
|
8
24
|
var __createBinding = Object.create
|
|
9
25
|
? function (o, m, k, k2) {
|
|
10
26
|
if (k2 === void 0)
|
|
@@ -58,22 +74,6 @@ function __importStar(mod) {
|
|
|
58
74
|
__setModuleDefault(result, mod);
|
|
59
75
|
return result;
|
|
60
76
|
}
|
|
61
|
-
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
62
|
-
if (kind === "m")
|
|
63
|
-
throw new TypeError("Private method is not writable");
|
|
64
|
-
if (kind === "a" && !f)
|
|
65
|
-
throw new TypeError("Private accessor was defined without a setter");
|
|
66
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
67
|
-
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
68
|
-
return kind === "a" ? f.call(receiver, value) : f ? (f.value = value) : state.set(receiver, value), value;
|
|
69
|
-
}
|
|
70
|
-
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
71
|
-
if (kind === "a" && !f)
|
|
72
|
-
throw new TypeError("Private accessor was defined without a getter");
|
|
73
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
74
|
-
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
75
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
76
|
-
}
|
|
77
77
|
function __exportStar(m, o) {
|
|
78
78
|
for (var p in m)
|
|
79
79
|
if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.d.mts","sourceRoot":"","sources":["../../src/internal/utils/query.ts"],"names":[],"mappings":"AAIA,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"query.d.mts","sourceRoot":"","sources":["../../src/internal/utils/query.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,UAerE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../src/internal/utils/query.ts"],"names":[],"mappings":"AAIA,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../src/internal/utils/query.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,UAerE"}
|
package/internal/utils/query.js
CHANGED
|
@@ -2,9 +2,22 @@
|
|
|
2
2
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.stringifyQuery = stringifyQuery;
|
|
5
|
-
const
|
|
6
|
-
|
|
5
|
+
const error_1 = require("../../core/error.js");
|
|
6
|
+
/**
|
|
7
|
+
* Basic re-implementation of `qs.stringify` for primitive types.
|
|
8
|
+
*/
|
|
7
9
|
function stringifyQuery(query) {
|
|
8
|
-
return
|
|
10
|
+
return Object.entries(query)
|
|
11
|
+
.filter(([_, value]) => typeof value !== 'undefined')
|
|
12
|
+
.map(([key, value]) => {
|
|
13
|
+
if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
|
|
14
|
+
return `${encodeURIComponent(key)}=${encodeURIComponent(value)}`;
|
|
15
|
+
}
|
|
16
|
+
if (value === null) {
|
|
17
|
+
return `${encodeURIComponent(key)}=`;
|
|
18
|
+
}
|
|
19
|
+
throw new error_1.NaturalError(`Cannot stringify type ${typeof value}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`);
|
|
20
|
+
})
|
|
21
|
+
.join('&');
|
|
9
22
|
}
|
|
10
23
|
//# sourceMappingURL=query.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.js","sourceRoot":"","sources":["../../src/internal/utils/query.ts"],"names":[],"mappings":";AAAA,sFAAsF;;
|
|
1
|
+
{"version":3,"file":"query.js","sourceRoot":"","sources":["../../src/internal/utils/query.ts"],"names":[],"mappings":";AAAA,sFAAsF;;AAOtF,wCAeC;AApBD,+CAAgD;AAEhD;;GAEG;AACH,SAAgB,cAAc,CAAC,KAAuC;IACpE,OAAO,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC;SACzB,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,OAAO,KAAK,KAAK,WAAW,CAAC;SACpD,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;QACpB,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,SAAS,EAAE,CAAC;YACzF,OAAO,GAAG,kBAAkB,CAAC,GAAG,CAAC,IAAI,kBAAkB,CAAC,KAAK,CAAC,EAAE,CAAC;QACnE,CAAC;QACD,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;YACnB,OAAO,GAAG,kBAAkB,CAAC,GAAG,CAAC,GAAG,CAAC;QACvC,CAAC;QACD,MAAM,IAAI,oBAAY,CACpB,yBAAyB,OAAO,KAAK,mQAAmQ,CACzS,CAAC;IACJ,CAAC,CAAC;SACD,IAAI,CAAC,GAAG,CAAC,CAAC;AACf,CAAC"}
|
package/internal/utils/query.mjs
CHANGED
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
import
|
|
2
|
+
import { NaturalError } from "../../core/error.mjs";
|
|
3
|
+
/**
|
|
4
|
+
* Basic re-implementation of `qs.stringify` for primitive types.
|
|
5
|
+
*/
|
|
3
6
|
export function stringifyQuery(query) {
|
|
4
|
-
return
|
|
7
|
+
return Object.entries(query)
|
|
8
|
+
.filter(([_, value]) => typeof value !== 'undefined')
|
|
9
|
+
.map(([key, value]) => {
|
|
10
|
+
if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
|
|
11
|
+
return `${encodeURIComponent(key)}=${encodeURIComponent(value)}`;
|
|
12
|
+
}
|
|
13
|
+
if (value === null) {
|
|
14
|
+
return `${encodeURIComponent(key)}=`;
|
|
15
|
+
}
|
|
16
|
+
throw new NaturalError(`Cannot stringify type ${typeof value}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`);
|
|
17
|
+
})
|
|
18
|
+
.join('&');
|
|
5
19
|
}
|
|
6
20
|
//# sourceMappingURL=query.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.mjs","sourceRoot":"","sources":["../../src/internal/utils/query.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,
|
|
1
|
+
{"version":3,"file":"query.mjs","sourceRoot":"","sources":["../../src/internal/utils/query.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,YAAY,EAAE,6BAAyB;AAEhD;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,KAAuC;IACpE,OAAO,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC;SACzB,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,OAAO,KAAK,KAAK,WAAW,CAAC;SACpD,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;QACpB,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,SAAS,EAAE,CAAC;YACzF,OAAO,GAAG,kBAAkB,CAAC,GAAG,CAAC,IAAI,kBAAkB,CAAC,KAAK,CAAC,EAAE,CAAC;QACnE,CAAC;QACD,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;YACnB,OAAO,GAAG,kBAAkB,CAAC,GAAG,CAAC,GAAG,CAAC;QACvC,CAAC;QACD,MAAM,IAAI,YAAY,CACpB,yBAAyB,OAAO,KAAK,mQAAmQ,CACzS,CAAC;IACJ,CAAC,CAAC;SACD,IAAI,CAAC,GAAG,CAAC,CAAC;AACf,CAAC"}
|