@getmanza/sdk 1.0.0 → 1.0.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/dist/client.d.ts +5 -5
- package/dist/client.d.ts.map +1 -1
- package/dist/env.d.ts +3 -0
- package/dist/env.d.ts.map +1 -0
- package/dist/errors.d.ts +15 -15
- package/dist/errors.d.ts.map +1 -1
- package/dist/index.cjs +77 -59
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +77 -59
- package/dist/page.d.ts +3 -3
- package/dist/page.d.ts.map +1 -1
- package/dist/resources/accounts.d.ts +3 -3
- package/dist/resources/accounts.d.ts.map +1 -1
- package/dist/resources/base.d.ts +8 -8
- package/dist/resources/base.d.ts.map +1 -1
- package/dist/resources/beneficiaries.d.ts +5 -5
- package/dist/resources/beneficiaries.d.ts.map +1 -1
- package/dist/resources/checkout_sessions.d.ts +3 -3
- package/dist/resources/checkout_sessions.d.ts.map +1 -1
- package/dist/resources/customers.d.ts +5 -5
- package/dist/resources/customers.d.ts.map +1 -1
- package/dist/resources/entity.d.ts +2 -2
- package/dist/resources/entity.d.ts.map +1 -1
- package/dist/resources/invoices.d.ts +10 -10
- package/dist/resources/invoices.d.ts.map +1 -1
- package/dist/resources/payee_trust_requests.d.ts +3 -3
- package/dist/resources/payee_trust_requests.d.ts.map +1 -1
- package/dist/resources/payment_links.d.ts +4 -4
- package/dist/resources/payment_links.d.ts.map +1 -1
- package/dist/resources/transfer_drafts.d.ts +5 -5
- package/dist/resources/transfer_drafts.d.ts.map +1 -1
- package/dist/resources/webhook_endpoints.d.ts +9 -9
- package/dist/resources/webhook_endpoints.d.ts.map +1 -1
- package/dist/response.d.ts +1 -1
- package/dist/response.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -8,8 +8,8 @@ import { PayeeTrustRequests } from "./resources/payee_trust_requests.js";
|
|
|
8
8
|
import { PaymentLinks } from "./resources/payment_links.js";
|
|
9
9
|
import { TransferDrafts } from "./resources/transfer_drafts.js";
|
|
10
10
|
import { WebhookEndpoints } from "./resources/webhook_endpoints.js";
|
|
11
|
-
import {
|
|
12
|
-
export interface
|
|
11
|
+
import { ManzaResponse } from "./response.js";
|
|
12
|
+
export interface ManzaClientOptions {
|
|
13
13
|
apiKey?: string | undefined;
|
|
14
14
|
baseUrl?: string;
|
|
15
15
|
apiVersion?: string | undefined;
|
|
@@ -21,7 +21,7 @@ export interface RequestOptions {
|
|
|
21
21
|
body?: unknown;
|
|
22
22
|
headers?: Record<string, string> | undefined;
|
|
23
23
|
}
|
|
24
|
-
export declare class
|
|
24
|
+
export declare class Manza {
|
|
25
25
|
#private;
|
|
26
26
|
readonly apiKey: string;
|
|
27
27
|
readonly baseUrl: string;
|
|
@@ -37,7 +37,7 @@ export declare class Zazu {
|
|
|
37
37
|
readonly paymentLinks: PaymentLinks;
|
|
38
38
|
readonly transferDrafts: TransferDrafts;
|
|
39
39
|
readonly webhookEndpoints: WebhookEndpoints;
|
|
40
|
-
constructor(options?:
|
|
41
|
-
request<T = unknown>(method: string, path: string, options?: RequestOptions): Promise<
|
|
40
|
+
constructor(options?: ManzaClientOptions);
|
|
41
|
+
request<T = unknown>(method: string, path: string, options?: RequestOptions): Promise<ManzaResponse<T>>;
|
|
42
42
|
}
|
|
43
43
|
//# sourceMappingURL=client.d.ts.map
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAG9C,MAAM,WAAW,kBAAkB;IACjC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;CACtB;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;IAC7C,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC;CAC9C;AAOD,qBAAa,KAAK;;IAChB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAG3B,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,aAAa,EAAE,aAAa,CAAC;IACtC,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAC5C,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,kBAAkB,EAAE,kBAAkB,CAAC;IAChD,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IACpC,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;IACxC,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;gBAEhC,OAAO,GAAE,kBAAuB;IAuBtC,OAAO,CAAC,CAAC,GAAG,OAAO,EACvB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,cAAmB,GAC3B,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;CAqD7B"}
|
package/dist/env.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../src/env.ts"],"names":[],"mappings":"AAiBA,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAaxD;AAGD,wBAAgB,wBAAwB,IAAI,IAAI,CAE/C"}
|
package/dist/errors.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export interface
|
|
1
|
+
export interface ManzaErrorOptions {
|
|
2
2
|
status?: number;
|
|
3
3
|
requestId?: string | null;
|
|
4
4
|
type?: string | null;
|
|
@@ -6,40 +6,40 @@ export interface ZazuErrorOptions {
|
|
|
6
6
|
body?: unknown;
|
|
7
7
|
headers?: Headers | null;
|
|
8
8
|
}
|
|
9
|
-
export declare class
|
|
9
|
+
export declare class ManzaError extends Error {
|
|
10
10
|
readonly status: number | undefined;
|
|
11
11
|
readonly requestId: string | null;
|
|
12
12
|
readonly type: string | null;
|
|
13
13
|
readonly param: string | null;
|
|
14
14
|
readonly body: unknown;
|
|
15
15
|
readonly headers: Headers | null;
|
|
16
|
-
constructor(message: string, options?:
|
|
16
|
+
constructor(message: string, options?: ManzaErrorOptions);
|
|
17
17
|
}
|
|
18
|
-
export declare class
|
|
18
|
+
export declare class ManzaConfigurationError extends ManzaError {
|
|
19
19
|
}
|
|
20
|
-
export declare class
|
|
20
|
+
export declare class ManzaConnectionError extends ManzaError {
|
|
21
21
|
}
|
|
22
|
-
export declare class
|
|
22
|
+
export declare class ManzaAuthenticationError extends ManzaError {
|
|
23
23
|
}
|
|
24
|
-
export declare class
|
|
24
|
+
export declare class ManzaForbiddenError extends ManzaError {
|
|
25
25
|
}
|
|
26
|
-
export declare class
|
|
26
|
+
export declare class ManzaNotFoundError extends ManzaError {
|
|
27
27
|
}
|
|
28
|
-
export declare class
|
|
28
|
+
export declare class ManzaValidationError extends ManzaError {
|
|
29
29
|
}
|
|
30
|
-
export declare class
|
|
30
|
+
export declare class ManzaRateLimitError extends ManzaError {
|
|
31
31
|
readonly retryAfter: number | null;
|
|
32
|
-
constructor(message: string, options?:
|
|
32
|
+
constructor(message: string, options?: ManzaErrorOptions & {
|
|
33
33
|
retryAfter?: number | null;
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
|
-
export declare class
|
|
36
|
+
export declare class ManzaServerError extends ManzaError {
|
|
37
37
|
}
|
|
38
|
-
export declare class
|
|
38
|
+
export declare class ManzaArgumentError extends ManzaError {
|
|
39
39
|
}
|
|
40
|
-
export declare class
|
|
40
|
+
export declare class ManzaConflictError extends ManzaError {
|
|
41
41
|
readonly paymentId: string | null;
|
|
42
|
-
constructor(message: string, options?:
|
|
42
|
+
constructor(message: string, options?: ManzaErrorOptions & {
|
|
43
43
|
paymentId?: string | null;
|
|
44
44
|
});
|
|
45
45
|
}
|
package/dist/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,iBAAiB;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,IAAI,CAAC,EAAE,OAAO,CAAC;IAIf,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;CAC1B;AAED,qBAAa,UAAW,SAAQ,KAAK;IACnC,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;gBAErB,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,iBAAsB;CAU7D;AAED,qBAAa,uBAAwB,SAAQ,UAAU;CAAG;AAC1D,qBAAa,oBAAqB,SAAQ,UAAU;CAAG;AACvD,qBAAa,wBAAyB,SAAQ,UAAU;CAAG;AAC3D,qBAAa,mBAAoB,SAAQ,UAAU;CAAG;AACtD,qBAAa,kBAAmB,SAAQ,UAAU;CAAG;AACrD,qBAAa,oBAAqB,SAAQ,UAAU;CAAG;AACvD,qBAAa,mBAAoB,SAAQ,UAAU;IACjD,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;gBAEvB,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,iBAAiB,GAAG;QAAE,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;KAAO;CAI9F;AACD,qBAAa,gBAAiB,SAAQ,UAAU;CAAG;AACnD,qBAAa,kBAAmB,SAAQ,UAAU;CAAG;AAIrD,qBAAa,kBAAmB,SAAQ,UAAU;IAChD,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;gBAEtB,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,iBAAiB,GAAG;QAAE,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;KAAO;CAI7F"}
|
package/dist/index.cjs
CHANGED
|
@@ -46,31 +46,54 @@ __export(exports_src, {
|
|
|
46
46
|
Entity: () => Entity,
|
|
47
47
|
Invoices: () => Invoices,
|
|
48
48
|
MAX_PER_PAGE: () => MAX_PER_PAGE,
|
|
49
|
+
Manza: () => Manza,
|
|
50
|
+
ManzaArgumentError: () => ManzaArgumentError,
|
|
51
|
+
ManzaAuthenticationError: () => ManzaAuthenticationError,
|
|
52
|
+
ManzaConfigurationError: () => ManzaConfigurationError,
|
|
53
|
+
ManzaConflictError: () => ManzaConflictError,
|
|
54
|
+
ManzaConnectionError: () => ManzaConnectionError,
|
|
55
|
+
ManzaError: () => ManzaError,
|
|
56
|
+
ManzaForbiddenError: () => ManzaForbiddenError,
|
|
57
|
+
ManzaNotFoundError: () => ManzaNotFoundError,
|
|
58
|
+
ManzaRateLimitError: () => ManzaRateLimitError,
|
|
59
|
+
ManzaResponse: () => ManzaResponse,
|
|
60
|
+
ManzaServerError: () => ManzaServerError,
|
|
61
|
+
ManzaValidationError: () => ManzaValidationError,
|
|
49
62
|
Page: () => Page,
|
|
50
63
|
PayeeTrustRequests: () => PayeeTrustRequests,
|
|
51
64
|
PaymentLinks: () => PaymentLinks,
|
|
52
65
|
TransferAuthorization: () => TransferAuthorization,
|
|
53
66
|
TransferDrafts: () => TransferDrafts,
|
|
54
67
|
VERSION: () => VERSION,
|
|
55
|
-
WebhookEndpoints: () => WebhookEndpoints
|
|
56
|
-
Zazu: () => Zazu,
|
|
57
|
-
ZazuArgumentError: () => ZazuArgumentError,
|
|
58
|
-
ZazuAuthenticationError: () => ZazuAuthenticationError,
|
|
59
|
-
ZazuConfigurationError: () => ZazuConfigurationError,
|
|
60
|
-
ZazuConflictError: () => ZazuConflictError,
|
|
61
|
-
ZazuConnectionError: () => ZazuConnectionError,
|
|
62
|
-
ZazuError: () => ZazuError,
|
|
63
|
-
ZazuForbiddenError: () => ZazuForbiddenError,
|
|
64
|
-
ZazuNotFoundError: () => ZazuNotFoundError,
|
|
65
|
-
ZazuRateLimitError: () => ZazuRateLimitError,
|
|
66
|
-
ZazuResponse: () => ZazuResponse,
|
|
67
|
-
ZazuServerError: () => ZazuServerError,
|
|
68
|
-
ZazuValidationError: () => ZazuValidationError
|
|
68
|
+
WebhookEndpoints: () => WebhookEndpoints
|
|
69
69
|
});
|
|
70
70
|
module.exports = __toCommonJS(exports_src);
|
|
71
71
|
|
|
72
|
+
// src/env.ts
|
|
73
|
+
var WARNED = Symbol.for("@getmanza/sdk.warnedLegacyEnv");
|
|
74
|
+
var store = globalThis;
|
|
75
|
+
store[WARNED] ??= new Set;
|
|
76
|
+
var warned = store[WARNED];
|
|
77
|
+
function rawEnv(name) {
|
|
78
|
+
if (typeof process !== "undefined" && process.env)
|
|
79
|
+
return process.env[name];
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
function readEnv(name) {
|
|
83
|
+
const value = rawEnv(`MANZA_${name}`);
|
|
84
|
+
if (value !== undefined)
|
|
85
|
+
return value;
|
|
86
|
+
const legacy = `ZAZU_${name}`;
|
|
87
|
+
const legacyValue = rawEnv(legacy);
|
|
88
|
+
if (legacyValue !== undefined && !warned.has(legacy)) {
|
|
89
|
+
warned.add(legacy);
|
|
90
|
+
console.warn(`[manza] ${legacy} is deprecated and will be removed in 2.0. Use MANZA_${name} instead.`);
|
|
91
|
+
}
|
|
92
|
+
return legacyValue;
|
|
93
|
+
}
|
|
94
|
+
|
|
72
95
|
// src/errors.ts
|
|
73
|
-
class
|
|
96
|
+
class ManzaError extends Error {
|
|
74
97
|
status;
|
|
75
98
|
requestId;
|
|
76
99
|
type;
|
|
@@ -89,25 +112,25 @@ class ZazuError extends Error {
|
|
|
89
112
|
}
|
|
90
113
|
}
|
|
91
114
|
|
|
92
|
-
class
|
|
115
|
+
class ManzaConfigurationError extends ManzaError {
|
|
93
116
|
}
|
|
94
117
|
|
|
95
|
-
class
|
|
118
|
+
class ManzaConnectionError extends ManzaError {
|
|
96
119
|
}
|
|
97
120
|
|
|
98
|
-
class
|
|
121
|
+
class ManzaAuthenticationError extends ManzaError {
|
|
99
122
|
}
|
|
100
123
|
|
|
101
|
-
class
|
|
124
|
+
class ManzaForbiddenError extends ManzaError {
|
|
102
125
|
}
|
|
103
126
|
|
|
104
|
-
class
|
|
127
|
+
class ManzaNotFoundError extends ManzaError {
|
|
105
128
|
}
|
|
106
129
|
|
|
107
|
-
class
|
|
130
|
+
class ManzaValidationError extends ManzaError {
|
|
108
131
|
}
|
|
109
132
|
|
|
110
|
-
class
|
|
133
|
+
class ManzaRateLimitError extends ManzaError {
|
|
111
134
|
retryAfter;
|
|
112
135
|
constructor(message, options = {}) {
|
|
113
136
|
super(message, options);
|
|
@@ -115,13 +138,13 @@ class ZazuRateLimitError extends ZazuError {
|
|
|
115
138
|
}
|
|
116
139
|
}
|
|
117
140
|
|
|
118
|
-
class
|
|
141
|
+
class ManzaServerError extends ManzaError {
|
|
119
142
|
}
|
|
120
143
|
|
|
121
|
-
class
|
|
144
|
+
class ManzaArgumentError extends ManzaError {
|
|
122
145
|
}
|
|
123
146
|
|
|
124
|
-
class
|
|
147
|
+
class ManzaConflictError extends ManzaError {
|
|
125
148
|
paymentId;
|
|
126
149
|
constructor(message, options = {}) {
|
|
127
150
|
super(message, options);
|
|
@@ -141,7 +164,7 @@ class Page {
|
|
|
141
164
|
constructor(response, fetcher) {
|
|
142
165
|
const body = response.body;
|
|
143
166
|
if (!body || !Array.isArray(body.data)) {
|
|
144
|
-
throw new
|
|
167
|
+
throw new ManzaArgumentError("Page response body has no `data` array — was this a list endpoint?", { body });
|
|
145
168
|
}
|
|
146
169
|
this.response = response;
|
|
147
170
|
this.data = body.data;
|
|
@@ -195,10 +218,10 @@ class ResourceBase {
|
|
|
195
218
|
if (limit === undefined || limit === null)
|
|
196
219
|
return MAX_PER_PAGE;
|
|
197
220
|
if (!Number.isInteger(limit) || limit <= 0) {
|
|
198
|
-
throw new
|
|
221
|
+
throw new ManzaArgumentError(`limit must be a positive integer (got ${JSON.stringify(limit)})`);
|
|
199
222
|
}
|
|
200
223
|
if (limit > MAX_PER_PAGE) {
|
|
201
|
-
throw new
|
|
224
|
+
throw new ManzaArgumentError(`limit cannot exceed ${MAX_PER_PAGE} (got ${limit})`);
|
|
202
225
|
}
|
|
203
226
|
return limit;
|
|
204
227
|
}
|
|
@@ -206,7 +229,7 @@ class ResourceBase {
|
|
|
206
229
|
const encoded = segments.map((s) => {
|
|
207
230
|
const str = String(s);
|
|
208
231
|
if (str.length === 0) {
|
|
209
|
-
throw new
|
|
232
|
+
throw new ManzaArgumentError("path segment cannot be blank");
|
|
210
233
|
}
|
|
211
234
|
return str.replace(/[^A-Za-z0-9._~-]/g, (c) => `%${c.charCodeAt(0).toString(16).toUpperCase().padStart(2, "0")}`);
|
|
212
235
|
});
|
|
@@ -387,7 +410,7 @@ class TransferDrafts extends ResourceBase {
|
|
|
387
410
|
}
|
|
388
411
|
authorize(id, params) {
|
|
389
412
|
if (!params.signature || params.signature.trim() === "") {
|
|
390
|
-
throw new
|
|
413
|
+
throw new ManzaArgumentError("signature cannot be blank");
|
|
391
414
|
}
|
|
392
415
|
return this.httpPost(this.encodePath("api/transfer_drafts", id, "authorize"), {
|
|
393
416
|
authorization_id: params.authorization_id,
|
|
@@ -435,7 +458,7 @@ class WebhookEndpoints extends ResourceBase {
|
|
|
435
458
|
}
|
|
436
459
|
|
|
437
460
|
// src/response.ts
|
|
438
|
-
class
|
|
461
|
+
class ManzaResponse {
|
|
439
462
|
status;
|
|
440
463
|
headers;
|
|
441
464
|
body;
|
|
@@ -455,14 +478,14 @@ class ZazuResponse {
|
|
|
455
478
|
}
|
|
456
479
|
|
|
457
480
|
// src/version.ts
|
|
458
|
-
var VERSION = "0.
|
|
481
|
+
var VERSION = "1.0.1";
|
|
459
482
|
|
|
460
483
|
// src/client.ts
|
|
461
484
|
var DEFAULT_BASE_URL = "https://ma.manza.finance";
|
|
462
485
|
var DEFAULT_TIMEOUT_MS = 30000;
|
|
463
|
-
var USER_AGENT = `
|
|
486
|
+
var USER_AGENT = `manza-ts/${VERSION}`;
|
|
464
487
|
|
|
465
|
-
class
|
|
488
|
+
class Manza {
|
|
466
489
|
apiKey;
|
|
467
490
|
baseUrl;
|
|
468
491
|
apiVersion;
|
|
@@ -479,14 +502,14 @@ class Zazu {
|
|
|
479
502
|
transferDrafts;
|
|
480
503
|
webhookEndpoints;
|
|
481
504
|
constructor(options = {}) {
|
|
482
|
-
const apiKey = options.apiKey ?? readEnv("
|
|
505
|
+
const apiKey = options.apiKey ?? readEnv("API_KEY");
|
|
483
506
|
if (!apiKey) {
|
|
484
|
-
throw new
|
|
507
|
+
throw new ManzaConfigurationError("Missing apiKey. Pass apiKey or set MANZA_API_KEY.");
|
|
485
508
|
}
|
|
486
509
|
this.apiKey = apiKey;
|
|
487
|
-
this.baseUrl = (options.baseUrl ?? readEnv("
|
|
488
|
-
this.apiVersion = options.apiVersion ?? readEnv("
|
|
489
|
-
this.timeoutMs = options.timeoutMs ?? (Number(readEnv("
|
|
510
|
+
this.baseUrl = (options.baseUrl ?? readEnv("BASE_URL") ?? DEFAULT_BASE_URL).replace(/\/+$/, "");
|
|
511
|
+
this.apiVersion = options.apiVersion ?? readEnv("API_VERSION") ?? null;
|
|
512
|
+
this.timeoutMs = options.timeoutMs ?? (Number(readEnv("TIMEOUT_MS")) || DEFAULT_TIMEOUT_MS);
|
|
490
513
|
this.#fetch = options.fetch ?? globalThis.fetch.bind(globalThis);
|
|
491
514
|
this.accounts = new Accounts(this);
|
|
492
515
|
this.beneficiaries = new Beneficiaries(this);
|
|
@@ -507,7 +530,7 @@ class Zazu {
|
|
|
507
530
|
Accept: "application/json"
|
|
508
531
|
});
|
|
509
532
|
if (this.apiVersion)
|
|
510
|
-
headers.set("
|
|
533
|
+
headers.set("Manza-Version", this.apiVersion);
|
|
511
534
|
if (options.headers) {
|
|
512
535
|
for (const [k, v] of Object.entries(options.headers))
|
|
513
536
|
headers.set(k, v);
|
|
@@ -525,14 +548,14 @@ class Zazu {
|
|
|
525
548
|
raw = await this.#fetch(url, init);
|
|
526
549
|
} catch (err) {
|
|
527
550
|
if (err instanceof Error && err.name === "AbortError") {
|
|
528
|
-
throw new
|
|
551
|
+
throw new ManzaConnectionError(`Request timed out after ${this.timeoutMs}ms`);
|
|
529
552
|
}
|
|
530
|
-
throw new
|
|
553
|
+
throw new ManzaConnectionError(`Connection failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
531
554
|
} finally {
|
|
532
555
|
clearTimeout(timeout);
|
|
533
556
|
}
|
|
534
557
|
const body = await parseBody(raw);
|
|
535
|
-
const response = new
|
|
558
|
+
const response = new ManzaResponse(raw, body);
|
|
536
559
|
if (response.success)
|
|
537
560
|
return response;
|
|
538
561
|
throw buildError(response);
|
|
@@ -584,43 +607,38 @@ function buildError(response) {
|
|
|
584
607
|
};
|
|
585
608
|
switch (response.status) {
|
|
586
609
|
case 400:
|
|
587
|
-
return new
|
|
610
|
+
return new ManzaValidationError(message ?? "Bad request", opts);
|
|
588
611
|
case 401:
|
|
589
|
-
return new
|
|
612
|
+
return new ManzaAuthenticationError(message ?? "Authentication failed", opts);
|
|
590
613
|
case 403:
|
|
591
|
-
return new
|
|
614
|
+
return new ManzaForbiddenError(message ?? "Forbidden", opts);
|
|
592
615
|
case 404:
|
|
593
|
-
return new
|
|
616
|
+
return new ManzaNotFoundError(message ?? "Not found", opts);
|
|
594
617
|
case 409:
|
|
595
|
-
return new
|
|
618
|
+
return new ManzaConflictError(message ?? "Conflict", {
|
|
596
619
|
...opts,
|
|
597
620
|
paymentId: payload.payment_id ?? null
|
|
598
621
|
});
|
|
599
622
|
case 422:
|
|
600
|
-
return new
|
|
623
|
+
return new ManzaValidationError(message ?? "Validation failed", opts);
|
|
601
624
|
case 429: {
|
|
602
625
|
const retryAfter = Number(response.headers.get("retry-after"));
|
|
603
|
-
return new
|
|
626
|
+
return new ManzaRateLimitError(message ?? "Rate limited", {
|
|
604
627
|
...opts,
|
|
605
628
|
retryAfter: Number.isFinite(retryAfter) ? retryAfter : null
|
|
606
629
|
});
|
|
607
630
|
}
|
|
608
631
|
}
|
|
609
632
|
if (response.status >= 500 && response.status < 600) {
|
|
610
|
-
return new
|
|
633
|
+
return new ManzaServerError(message ?? `Server error (${response.status})`, opts);
|
|
611
634
|
}
|
|
612
|
-
return new
|
|
613
|
-
}
|
|
614
|
-
function readEnv(name) {
|
|
615
|
-
if (typeof process !== "undefined" && process.env)
|
|
616
|
-
return process.env[name];
|
|
617
|
-
return;
|
|
635
|
+
return new ManzaError(message ?? `Unexpected status ${response.status}`, opts);
|
|
618
636
|
}
|
|
619
637
|
// src/transfer_authorization.ts
|
|
620
638
|
var SIGNATURE_VERSION = "manza.transfer-authorization.v1";
|
|
621
639
|
function signatureInput(fields) {
|
|
622
640
|
if (typeof fields.amount !== "string") {
|
|
623
|
-
throw new
|
|
641
|
+
throw new ManzaArgumentError(`amount must be the API's decimal string (got ${JSON.stringify(fields.amount)})`);
|
|
624
642
|
}
|
|
625
643
|
return [
|
|
626
644
|
SIGNATURE_VERSION,
|
|
@@ -643,7 +661,7 @@ function payeeFor(params) {
|
|
|
643
661
|
const ext = params.external_account_id ?? null;
|
|
644
662
|
const own = params.destination_account_id ?? null;
|
|
645
663
|
if (ext === null === (own === null)) {
|
|
646
|
-
throw new
|
|
664
|
+
throw new ManzaArgumentError("pass exactly one of external_account_id or destination_account_id");
|
|
647
665
|
}
|
|
648
666
|
return own !== null ? `own:${own}` : `ext:${ext}`;
|
|
649
667
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { type
|
|
2
|
-
export {
|
|
1
|
+
export { Manza, type ManzaClientOptions, type RequestOptions } from "./client.js";
|
|
2
|
+
export { ManzaArgumentError, ManzaAuthenticationError, ManzaConfigurationError, ManzaConflictError, ManzaConnectionError, ManzaError, type ManzaErrorOptions, ManzaForbiddenError, ManzaNotFoundError, ManzaRateLimitError, ManzaServerError, ManzaValidationError, } from "./errors.js";
|
|
3
3
|
export { MAX_PER_PAGE, Page, type PageBody, type PageFetcher } from "./page.js";
|
|
4
4
|
export { Accounts } from "./resources/accounts.js";
|
|
5
5
|
export { Beneficiaries } from "./resources/beneficiaries.js";
|
|
@@ -11,7 +11,7 @@ export { PayeeTrustRequests } from "./resources/payee_trust_requests.js";
|
|
|
11
11
|
export { PaymentLinks } from "./resources/payment_links.js";
|
|
12
12
|
export { TransferDrafts } from "./resources/transfer_drafts.js";
|
|
13
13
|
export { WebhookEndpoints } from "./resources/webhook_endpoints.js";
|
|
14
|
-
export {
|
|
14
|
+
export { ManzaResponse } from "./response.js";
|
|
15
15
|
export { type PayeeForParams, type SignatureInputFields, TransferAuthorization, } from "./transfer_authorization.js";
|
|
16
16
|
export { VERSION } from "./version.js";
|
|
17
17
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,KAAK,kBAAkB,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAClF,OAAO,EACL,kBAAkB,EAClB,wBAAwB,EACxB,uBAAuB,EACvB,kBAAkB,EAClB,oBAAoB,EACpB,UAAU,EACV,KAAK,iBAAiB,EACtB,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,gBAAgB,EAChB,oBAAoB,GACrB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,KAAK,QAAQ,EAAE,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;AAGhF,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,qBAAqB,GACtB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
|
+
// src/env.ts
|
|
2
|
+
var WARNED = Symbol.for("@getmanza/sdk.warnedLegacyEnv");
|
|
3
|
+
var store = globalThis;
|
|
4
|
+
store[WARNED] ??= new Set;
|
|
5
|
+
var warned = store[WARNED];
|
|
6
|
+
function rawEnv(name) {
|
|
7
|
+
if (typeof process !== "undefined" && process.env)
|
|
8
|
+
return process.env[name];
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
function readEnv(name) {
|
|
12
|
+
const value = rawEnv(`MANZA_${name}`);
|
|
13
|
+
if (value !== undefined)
|
|
14
|
+
return value;
|
|
15
|
+
const legacy = `ZAZU_${name}`;
|
|
16
|
+
const legacyValue = rawEnv(legacy);
|
|
17
|
+
if (legacyValue !== undefined && !warned.has(legacy)) {
|
|
18
|
+
warned.add(legacy);
|
|
19
|
+
console.warn(`[manza] ${legacy} is deprecated and will be removed in 2.0. Use MANZA_${name} instead.`);
|
|
20
|
+
}
|
|
21
|
+
return legacyValue;
|
|
22
|
+
}
|
|
23
|
+
|
|
1
24
|
// src/errors.ts
|
|
2
|
-
class
|
|
25
|
+
class ManzaError extends Error {
|
|
3
26
|
status;
|
|
4
27
|
requestId;
|
|
5
28
|
type;
|
|
@@ -18,25 +41,25 @@ class ZazuError extends Error {
|
|
|
18
41
|
}
|
|
19
42
|
}
|
|
20
43
|
|
|
21
|
-
class
|
|
44
|
+
class ManzaConfigurationError extends ManzaError {
|
|
22
45
|
}
|
|
23
46
|
|
|
24
|
-
class
|
|
47
|
+
class ManzaConnectionError extends ManzaError {
|
|
25
48
|
}
|
|
26
49
|
|
|
27
|
-
class
|
|
50
|
+
class ManzaAuthenticationError extends ManzaError {
|
|
28
51
|
}
|
|
29
52
|
|
|
30
|
-
class
|
|
53
|
+
class ManzaForbiddenError extends ManzaError {
|
|
31
54
|
}
|
|
32
55
|
|
|
33
|
-
class
|
|
56
|
+
class ManzaNotFoundError extends ManzaError {
|
|
34
57
|
}
|
|
35
58
|
|
|
36
|
-
class
|
|
59
|
+
class ManzaValidationError extends ManzaError {
|
|
37
60
|
}
|
|
38
61
|
|
|
39
|
-
class
|
|
62
|
+
class ManzaRateLimitError extends ManzaError {
|
|
40
63
|
retryAfter;
|
|
41
64
|
constructor(message, options = {}) {
|
|
42
65
|
super(message, options);
|
|
@@ -44,13 +67,13 @@ class ZazuRateLimitError extends ZazuError {
|
|
|
44
67
|
}
|
|
45
68
|
}
|
|
46
69
|
|
|
47
|
-
class
|
|
70
|
+
class ManzaServerError extends ManzaError {
|
|
48
71
|
}
|
|
49
72
|
|
|
50
|
-
class
|
|
73
|
+
class ManzaArgumentError extends ManzaError {
|
|
51
74
|
}
|
|
52
75
|
|
|
53
|
-
class
|
|
76
|
+
class ManzaConflictError extends ManzaError {
|
|
54
77
|
paymentId;
|
|
55
78
|
constructor(message, options = {}) {
|
|
56
79
|
super(message, options);
|
|
@@ -70,7 +93,7 @@ class Page {
|
|
|
70
93
|
constructor(response, fetcher) {
|
|
71
94
|
const body = response.body;
|
|
72
95
|
if (!body || !Array.isArray(body.data)) {
|
|
73
|
-
throw new
|
|
96
|
+
throw new ManzaArgumentError("Page response body has no `data` array — was this a list endpoint?", { body });
|
|
74
97
|
}
|
|
75
98
|
this.response = response;
|
|
76
99
|
this.data = body.data;
|
|
@@ -124,10 +147,10 @@ class ResourceBase {
|
|
|
124
147
|
if (limit === undefined || limit === null)
|
|
125
148
|
return MAX_PER_PAGE;
|
|
126
149
|
if (!Number.isInteger(limit) || limit <= 0) {
|
|
127
|
-
throw new
|
|
150
|
+
throw new ManzaArgumentError(`limit must be a positive integer (got ${JSON.stringify(limit)})`);
|
|
128
151
|
}
|
|
129
152
|
if (limit > MAX_PER_PAGE) {
|
|
130
|
-
throw new
|
|
153
|
+
throw new ManzaArgumentError(`limit cannot exceed ${MAX_PER_PAGE} (got ${limit})`);
|
|
131
154
|
}
|
|
132
155
|
return limit;
|
|
133
156
|
}
|
|
@@ -135,7 +158,7 @@ class ResourceBase {
|
|
|
135
158
|
const encoded = segments.map((s) => {
|
|
136
159
|
const str = String(s);
|
|
137
160
|
if (str.length === 0) {
|
|
138
|
-
throw new
|
|
161
|
+
throw new ManzaArgumentError("path segment cannot be blank");
|
|
139
162
|
}
|
|
140
163
|
return str.replace(/[^A-Za-z0-9._~-]/g, (c) => `%${c.charCodeAt(0).toString(16).toUpperCase().padStart(2, "0")}`);
|
|
141
164
|
});
|
|
@@ -316,7 +339,7 @@ class TransferDrafts extends ResourceBase {
|
|
|
316
339
|
}
|
|
317
340
|
authorize(id, params) {
|
|
318
341
|
if (!params.signature || params.signature.trim() === "") {
|
|
319
|
-
throw new
|
|
342
|
+
throw new ManzaArgumentError("signature cannot be blank");
|
|
320
343
|
}
|
|
321
344
|
return this.httpPost(this.encodePath("api/transfer_drafts", id, "authorize"), {
|
|
322
345
|
authorization_id: params.authorization_id,
|
|
@@ -364,7 +387,7 @@ class WebhookEndpoints extends ResourceBase {
|
|
|
364
387
|
}
|
|
365
388
|
|
|
366
389
|
// src/response.ts
|
|
367
|
-
class
|
|
390
|
+
class ManzaResponse {
|
|
368
391
|
status;
|
|
369
392
|
headers;
|
|
370
393
|
body;
|
|
@@ -384,14 +407,14 @@ class ZazuResponse {
|
|
|
384
407
|
}
|
|
385
408
|
|
|
386
409
|
// src/version.ts
|
|
387
|
-
var VERSION = "0.
|
|
410
|
+
var VERSION = "1.0.1";
|
|
388
411
|
|
|
389
412
|
// src/client.ts
|
|
390
413
|
var DEFAULT_BASE_URL = "https://ma.manza.finance";
|
|
391
414
|
var DEFAULT_TIMEOUT_MS = 30000;
|
|
392
|
-
var USER_AGENT = `
|
|
415
|
+
var USER_AGENT = `manza-ts/${VERSION}`;
|
|
393
416
|
|
|
394
|
-
class
|
|
417
|
+
class Manza {
|
|
395
418
|
apiKey;
|
|
396
419
|
baseUrl;
|
|
397
420
|
apiVersion;
|
|
@@ -408,14 +431,14 @@ class Zazu {
|
|
|
408
431
|
transferDrafts;
|
|
409
432
|
webhookEndpoints;
|
|
410
433
|
constructor(options = {}) {
|
|
411
|
-
const apiKey = options.apiKey ?? readEnv("
|
|
434
|
+
const apiKey = options.apiKey ?? readEnv("API_KEY");
|
|
412
435
|
if (!apiKey) {
|
|
413
|
-
throw new
|
|
436
|
+
throw new ManzaConfigurationError("Missing apiKey. Pass apiKey or set MANZA_API_KEY.");
|
|
414
437
|
}
|
|
415
438
|
this.apiKey = apiKey;
|
|
416
|
-
this.baseUrl = (options.baseUrl ?? readEnv("
|
|
417
|
-
this.apiVersion = options.apiVersion ?? readEnv("
|
|
418
|
-
this.timeoutMs = options.timeoutMs ?? (Number(readEnv("
|
|
439
|
+
this.baseUrl = (options.baseUrl ?? readEnv("BASE_URL") ?? DEFAULT_BASE_URL).replace(/\/+$/, "");
|
|
440
|
+
this.apiVersion = options.apiVersion ?? readEnv("API_VERSION") ?? null;
|
|
441
|
+
this.timeoutMs = options.timeoutMs ?? (Number(readEnv("TIMEOUT_MS")) || DEFAULT_TIMEOUT_MS);
|
|
419
442
|
this.#fetch = options.fetch ?? globalThis.fetch.bind(globalThis);
|
|
420
443
|
this.accounts = new Accounts(this);
|
|
421
444
|
this.beneficiaries = new Beneficiaries(this);
|
|
@@ -436,7 +459,7 @@ class Zazu {
|
|
|
436
459
|
Accept: "application/json"
|
|
437
460
|
});
|
|
438
461
|
if (this.apiVersion)
|
|
439
|
-
headers.set("
|
|
462
|
+
headers.set("Manza-Version", this.apiVersion);
|
|
440
463
|
if (options.headers) {
|
|
441
464
|
for (const [k, v] of Object.entries(options.headers))
|
|
442
465
|
headers.set(k, v);
|
|
@@ -454,14 +477,14 @@ class Zazu {
|
|
|
454
477
|
raw = await this.#fetch(url, init);
|
|
455
478
|
} catch (err) {
|
|
456
479
|
if (err instanceof Error && err.name === "AbortError") {
|
|
457
|
-
throw new
|
|
480
|
+
throw new ManzaConnectionError(`Request timed out after ${this.timeoutMs}ms`);
|
|
458
481
|
}
|
|
459
|
-
throw new
|
|
482
|
+
throw new ManzaConnectionError(`Connection failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
460
483
|
} finally {
|
|
461
484
|
clearTimeout(timeout);
|
|
462
485
|
}
|
|
463
486
|
const body = await parseBody(raw);
|
|
464
|
-
const response = new
|
|
487
|
+
const response = new ManzaResponse(raw, body);
|
|
465
488
|
if (response.success)
|
|
466
489
|
return response;
|
|
467
490
|
throw buildError(response);
|
|
@@ -513,43 +536,38 @@ function buildError(response) {
|
|
|
513
536
|
};
|
|
514
537
|
switch (response.status) {
|
|
515
538
|
case 400:
|
|
516
|
-
return new
|
|
539
|
+
return new ManzaValidationError(message ?? "Bad request", opts);
|
|
517
540
|
case 401:
|
|
518
|
-
return new
|
|
541
|
+
return new ManzaAuthenticationError(message ?? "Authentication failed", opts);
|
|
519
542
|
case 403:
|
|
520
|
-
return new
|
|
543
|
+
return new ManzaForbiddenError(message ?? "Forbidden", opts);
|
|
521
544
|
case 404:
|
|
522
|
-
return new
|
|
545
|
+
return new ManzaNotFoundError(message ?? "Not found", opts);
|
|
523
546
|
case 409:
|
|
524
|
-
return new
|
|
547
|
+
return new ManzaConflictError(message ?? "Conflict", {
|
|
525
548
|
...opts,
|
|
526
549
|
paymentId: payload.payment_id ?? null
|
|
527
550
|
});
|
|
528
551
|
case 422:
|
|
529
|
-
return new
|
|
552
|
+
return new ManzaValidationError(message ?? "Validation failed", opts);
|
|
530
553
|
case 429: {
|
|
531
554
|
const retryAfter = Number(response.headers.get("retry-after"));
|
|
532
|
-
return new
|
|
555
|
+
return new ManzaRateLimitError(message ?? "Rate limited", {
|
|
533
556
|
...opts,
|
|
534
557
|
retryAfter: Number.isFinite(retryAfter) ? retryAfter : null
|
|
535
558
|
});
|
|
536
559
|
}
|
|
537
560
|
}
|
|
538
561
|
if (response.status >= 500 && response.status < 600) {
|
|
539
|
-
return new
|
|
562
|
+
return new ManzaServerError(message ?? `Server error (${response.status})`, opts);
|
|
540
563
|
}
|
|
541
|
-
return new
|
|
542
|
-
}
|
|
543
|
-
function readEnv(name) {
|
|
544
|
-
if (typeof process !== "undefined" && process.env)
|
|
545
|
-
return process.env[name];
|
|
546
|
-
return;
|
|
564
|
+
return new ManzaError(message ?? `Unexpected status ${response.status}`, opts);
|
|
547
565
|
}
|
|
548
566
|
// src/transfer_authorization.ts
|
|
549
567
|
var SIGNATURE_VERSION = "manza.transfer-authorization.v1";
|
|
550
568
|
function signatureInput(fields) {
|
|
551
569
|
if (typeof fields.amount !== "string") {
|
|
552
|
-
throw new
|
|
570
|
+
throw new ManzaArgumentError(`amount must be the API's decimal string (got ${JSON.stringify(fields.amount)})`);
|
|
553
571
|
}
|
|
554
572
|
return [
|
|
555
573
|
SIGNATURE_VERSION,
|
|
@@ -572,7 +590,7 @@ function payeeFor(params) {
|
|
|
572
590
|
const ext = params.external_account_id ?? null;
|
|
573
591
|
const own = params.destination_account_id ?? null;
|
|
574
592
|
if (ext === null === (own === null)) {
|
|
575
|
-
throw new
|
|
593
|
+
throw new ManzaArgumentError("pass exactly one of external_account_id or destination_account_id");
|
|
576
594
|
}
|
|
577
595
|
return own !== null ? `own:${own}` : `ext:${ext}`;
|
|
578
596
|
}
|
|
@@ -590,24 +608,24 @@ export {
|
|
|
590
608
|
Entity,
|
|
591
609
|
Invoices,
|
|
592
610
|
MAX_PER_PAGE,
|
|
611
|
+
Manza,
|
|
612
|
+
ManzaArgumentError,
|
|
613
|
+
ManzaAuthenticationError,
|
|
614
|
+
ManzaConfigurationError,
|
|
615
|
+
ManzaConflictError,
|
|
616
|
+
ManzaConnectionError,
|
|
617
|
+
ManzaError,
|
|
618
|
+
ManzaForbiddenError,
|
|
619
|
+
ManzaNotFoundError,
|
|
620
|
+
ManzaRateLimitError,
|
|
621
|
+
ManzaResponse,
|
|
622
|
+
ManzaServerError,
|
|
623
|
+
ManzaValidationError,
|
|
593
624
|
Page,
|
|
594
625
|
PayeeTrustRequests,
|
|
595
626
|
PaymentLinks,
|
|
596
627
|
TransferAuthorization,
|
|
597
628
|
TransferDrafts,
|
|
598
629
|
VERSION,
|
|
599
|
-
WebhookEndpoints
|
|
600
|
-
Zazu,
|
|
601
|
-
ZazuArgumentError,
|
|
602
|
-
ZazuAuthenticationError,
|
|
603
|
-
ZazuConfigurationError,
|
|
604
|
-
ZazuConflictError,
|
|
605
|
-
ZazuConnectionError,
|
|
606
|
-
ZazuError,
|
|
607
|
-
ZazuForbiddenError,
|
|
608
|
-
ZazuNotFoundError,
|
|
609
|
-
ZazuRateLimitError,
|
|
610
|
-
ZazuResponse,
|
|
611
|
-
ZazuServerError,
|
|
612
|
-
ZazuValidationError
|
|
630
|
+
WebhookEndpoints
|
|
613
631
|
};
|
package/dist/page.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ManzaResponse } from "./response.js";
|
|
2
2
|
export declare const MAX_PER_PAGE = 100;
|
|
3
3
|
export interface PageBody<T> {
|
|
4
4
|
data: T[];
|
|
@@ -11,8 +11,8 @@ export declare class Page<T> {
|
|
|
11
11
|
readonly data: T[];
|
|
12
12
|
readonly hasMore: boolean;
|
|
13
13
|
readonly nextCursor: string | null;
|
|
14
|
-
readonly response:
|
|
15
|
-
constructor(response:
|
|
14
|
+
readonly response: ManzaResponse<PageBody<T>>;
|
|
15
|
+
constructor(response: ManzaResponse<PageBody<T>>, fetcher: PageFetcher<T>);
|
|
16
16
|
next(): Promise<Page<T> | null>;
|
|
17
17
|
records(): AsyncIterableIterator<T>;
|
|
18
18
|
}
|
package/dist/page.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../src/page.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../src/page.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD,eAAO,MAAM,YAAY,MAAM,CAAC;AAEhC,MAAM,WAAW,QAAQ,CAAC,CAAC;IACzB,IAAI,EAAE,CAAC,EAAE,CAAC;IACV,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AAEzE,qBAAa,IAAI,CAAC,CAAC;;IACjB,QAAQ,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC;IACnB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,QAAQ,CAAC,QAAQ,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;gBAGlC,QAAQ,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC;IAenE,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;IAM9B,OAAO,IAAI,qBAAqB,CAAC,CAAC,CAAC;CAQ3C"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Page } from "../page.js";
|
|
2
|
-
import type {
|
|
2
|
+
import type { ManzaResponse } from "../response.js";
|
|
3
3
|
import { type ListParams, ResourceBase } from "./base.js";
|
|
4
4
|
export interface AccountListParams extends ListParams {
|
|
5
5
|
status?: string;
|
|
@@ -12,8 +12,8 @@ export interface TransactionListParams extends ListParams {
|
|
|
12
12
|
}
|
|
13
13
|
export declare class Accounts extends ResourceBase {
|
|
14
14
|
list(params?: AccountListParams): Promise<Page<unknown>>;
|
|
15
|
-
get(id: string): Promise<
|
|
15
|
+
get(id: string): Promise<ManzaResponse>;
|
|
16
16
|
listTransactions(accountId: string, params?: TransactionListParams): Promise<Page<unknown>>;
|
|
17
|
-
getTransaction(accountId: string, transactionId: string): Promise<
|
|
17
|
+
getTransaction(accountId: string, transactionId: string): Promise<ManzaResponse>;
|
|
18
18
|
}
|
|
19
19
|
//# sourceMappingURL=accounts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accounts.d.ts","sourceRoot":"","sources":["../../src/resources/accounts.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"accounts.d.ts","sourceRoot":"","sources":["../../src/resources/accounts.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,KAAK,UAAU,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAE1D,MAAM,WAAW,iBAAkB,SAAQ,UAAU;IACnD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,qBAAsB,SAAQ,UAAU;IACvD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B;AAED,qBAAa,QAAS,SAAQ,YAAY;IACxC,IAAI,CAAC,MAAM,GAAE,iBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAK5D,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAIvC,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,GAAE,qBAA0B,GAAG,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAa/F,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;CAGjF"}
|
package/dist/resources/base.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Manza } from "../client.js";
|
|
2
2
|
import { Page } from "../page.js";
|
|
3
|
-
import type {
|
|
3
|
+
import type { ManzaResponse } from "../response.js";
|
|
4
4
|
export interface ListParams {
|
|
5
5
|
limit?: number | undefined;
|
|
6
6
|
cursor?: string | null | undefined;
|
|
7
7
|
}
|
|
8
8
|
export declare abstract class ResourceBase {
|
|
9
|
-
protected readonly client:
|
|
10
|
-
constructor(client:
|
|
11
|
-
protected httpGet<T>(path: string, params?: Record<string, unknown>): Promise<
|
|
12
|
-
protected httpPost<T>(path: string, body?: unknown): Promise<
|
|
13
|
-
protected httpPatch<T>(path: string, body?: unknown): Promise<
|
|
14
|
-
protected httpDelete<T>(path: string): Promise<
|
|
9
|
+
protected readonly client: Manza;
|
|
10
|
+
constructor(client: Manza);
|
|
11
|
+
protected httpGet<T>(path: string, params?: Record<string, unknown>): Promise<ManzaResponse<T>>;
|
|
12
|
+
protected httpPost<T>(path: string, body?: unknown): Promise<ManzaResponse<T>>;
|
|
13
|
+
protected httpPatch<T>(path: string, body?: unknown): Promise<ManzaResponse<T>>;
|
|
14
|
+
protected httpDelete<T>(path: string): Promise<ManzaResponse<T>>;
|
|
15
15
|
protected listPage<T>(path: string, params?: Record<string, unknown>, listOpts?: ListParams): Promise<Page<T>>;
|
|
16
16
|
protected validateLimit(limit: number | undefined): number;
|
|
17
17
|
protected encodePath(base: string, ...segments: string[]): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/resources/base.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/resources/base.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAgB,IAAI,EAAiB,MAAM,YAAY,CAAC;AAC/D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEpD,MAAM,WAAW,UAAU;IACzB,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;CACpC;AAED,8BAAsB,YAAY;IAChC,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC;gBAErB,MAAM,EAAE,KAAK;IAIzB,SAAS,CAAC,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;IAI/F,SAAS,CAAC,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;IAI9E,SAAS,CAAC,SAAS,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;IAI/E,SAAS,CAAC,UAAU,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;cAIhD,QAAQ,CAAC,CAAC,EACxB,IAAI,EAAE,MAAM,EACZ,MAAM,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,EACpC,QAAQ,GAAE,UAAe,GACxB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAYnB,SAAS,CAAC,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM;IAiB1D,SAAS,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM;CAalE"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { Page } from "../page.js";
|
|
2
|
-
import type {
|
|
2
|
+
import type { ManzaResponse } from "../response.js";
|
|
3
3
|
import { type ListParams, ResourceBase } from "./base.js";
|
|
4
4
|
export declare class Beneficiaries extends ResourceBase {
|
|
5
5
|
list(params?: ListParams): Promise<Page<unknown>>;
|
|
6
|
-
get(id: string): Promise<
|
|
7
|
-
create(attributes: Record<string, unknown>): Promise<
|
|
6
|
+
get(id: string): Promise<ManzaResponse>;
|
|
7
|
+
create(attributes: Record<string, unknown>): Promise<ManzaResponse>;
|
|
8
8
|
listExternalAccounts(beneficiaryId: string, params?: ListParams): Promise<Page<unknown>>;
|
|
9
|
-
getExternalAccount(beneficiaryId: string, id: string): Promise<
|
|
10
|
-
createExternalAccount(beneficiaryId: string, attributes: Record<string, unknown>): Promise<
|
|
9
|
+
getExternalAccount(beneficiaryId: string, id: string): Promise<ManzaResponse>;
|
|
10
|
+
createExternalAccount(beneficiaryId: string, attributes: Record<string, unknown>): Promise<ManzaResponse>;
|
|
11
11
|
}
|
|
12
12
|
//# sourceMappingURL=beneficiaries.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"beneficiaries.d.ts","sourceRoot":"","sources":["../../src/resources/beneficiaries.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"beneficiaries.d.ts","sourceRoot":"","sources":["../../src/resources/beneficiaries.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,KAAK,UAAU,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAE1D,qBAAa,aAAc,SAAQ,YAAY;IAC7C,IAAI,CAAC,MAAM,GAAE,UAAe,GAAG,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAKrD,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAQvC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,aAAa,CAAC;IAInE,oBAAoB,CAAC,aAAa,EAAE,MAAM,EAAE,MAAM,GAAE,UAAe,GAAG,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAS5F,kBAAkB,CAAC,aAAa,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAS7E,qBAAqB,CACnB,aAAa,EAAE,MAAM,EACrB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAClC,OAAO,CAAC,aAAa,CAAC;CAM1B"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ManzaResponse } from "../response.js";
|
|
2
2
|
import { ResourceBase } from "./base.js";
|
|
3
3
|
export declare class CheckoutSessions extends ResourceBase {
|
|
4
|
-
get(id: string): Promise<
|
|
5
|
-
create(attributes: Record<string, unknown>): Promise<
|
|
4
|
+
get(id: string): Promise<ManzaResponse>;
|
|
5
|
+
create(attributes: Record<string, unknown>): Promise<ManzaResponse>;
|
|
6
6
|
}
|
|
7
7
|
//# sourceMappingURL=checkout_sessions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkout_sessions.d.ts","sourceRoot":"","sources":["../../src/resources/checkout_sessions.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"checkout_sessions.d.ts","sourceRoot":"","sources":["../../src/resources/checkout_sessions.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC,qBAAa,gBAAiB,SAAQ,YAAY;IAChD,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAIvC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,aAAa,CAAC;CAGpE"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import type { Page } from "../page.js";
|
|
2
|
-
import type {
|
|
2
|
+
import type { ManzaResponse } from "../response.js";
|
|
3
3
|
import { type ListParams, ResourceBase } from "./base.js";
|
|
4
4
|
export interface CustomerListParams extends ListParams {
|
|
5
5
|
q?: string;
|
|
6
6
|
}
|
|
7
7
|
export declare class Customers extends ResourceBase {
|
|
8
8
|
list(params?: CustomerListParams): Promise<Page<unknown>>;
|
|
9
|
-
get(id: string): Promise<
|
|
10
|
-
create(attributes: Record<string, unknown>): Promise<
|
|
11
|
-
update(id: string, attributes: Record<string, unknown>): Promise<
|
|
12
|
-
delete(id: string): Promise<
|
|
9
|
+
get(id: string): Promise<ManzaResponse>;
|
|
10
|
+
create(attributes: Record<string, unknown>): Promise<ManzaResponse>;
|
|
11
|
+
update(id: string, attributes: Record<string, unknown>): Promise<ManzaResponse>;
|
|
12
|
+
delete(id: string): Promise<ManzaResponse>;
|
|
13
13
|
}
|
|
14
14
|
//# sourceMappingURL=customers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customers.d.ts","sourceRoot":"","sources":["../../src/resources/customers.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"customers.d.ts","sourceRoot":"","sources":["../../src/resources/customers.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,KAAK,UAAU,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAE1D,MAAM,WAAW,kBAAmB,SAAQ,UAAU;IACpD,CAAC,CAAC,EAAE,MAAM,CAAC;CACZ;AAED,qBAAa,SAAU,SAAQ,YAAY;IACzC,IAAI,CAAC,MAAM,GAAE,kBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAK7D,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAIvC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,aAAa,CAAC;IAInE,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,aAAa,CAAC;IAI/E,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;CAG3C"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ManzaResponse } from "../response.js";
|
|
2
2
|
import { ResourceBase } from "./base.js";
|
|
3
3
|
export declare class Entity extends ResourceBase {
|
|
4
|
-
get(): Promise<
|
|
4
|
+
get(): Promise<ManzaResponse>;
|
|
5
5
|
}
|
|
6
6
|
//# sourceMappingURL=entity.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity.d.ts","sourceRoot":"","sources":["../../src/resources/entity.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"entity.d.ts","sourceRoot":"","sources":["../../src/resources/entity.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC,qBAAa,MAAO,SAAQ,YAAY;IACtC,GAAG,IAAI,OAAO,CAAC,aAAa,CAAC;CAG9B"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Page } from "../page.js";
|
|
2
|
-
import type {
|
|
2
|
+
import type { ManzaResponse } from "../response.js";
|
|
3
3
|
import { type ListParams, ResourceBase } from "./base.js";
|
|
4
4
|
export interface InvoiceListParams extends ListParams {
|
|
5
5
|
status?: string;
|
|
@@ -7,14 +7,14 @@ export interface InvoiceListParams extends ListParams {
|
|
|
7
7
|
}
|
|
8
8
|
export declare class Invoices extends ResourceBase {
|
|
9
9
|
list(params?: InvoiceListParams): Promise<Page<unknown>>;
|
|
10
|
-
get(id: string): Promise<
|
|
11
|
-
create(attributes: Record<string, unknown>): Promise<
|
|
12
|
-
update(id: string, attributes: Record<string, unknown>): Promise<
|
|
13
|
-
delete(id: string): Promise<
|
|
14
|
-
send(id: string): Promise<
|
|
15
|
-
markAsPaid(id: string, attributes?: Record<string, unknown>): Promise<
|
|
16
|
-
cancel(id: string): Promise<
|
|
17
|
-
creditNote(id: string, attributes?: Record<string, unknown>): Promise<
|
|
18
|
-
createPaymentLink(id: string, attributes?: Record<string, unknown>): Promise<
|
|
10
|
+
get(id: string): Promise<ManzaResponse>;
|
|
11
|
+
create(attributes: Record<string, unknown>): Promise<ManzaResponse>;
|
|
12
|
+
update(id: string, attributes: Record<string, unknown>): Promise<ManzaResponse>;
|
|
13
|
+
delete(id: string): Promise<ManzaResponse>;
|
|
14
|
+
send(id: string): Promise<ManzaResponse>;
|
|
15
|
+
markAsPaid(id: string, attributes?: Record<string, unknown>): Promise<ManzaResponse>;
|
|
16
|
+
cancel(id: string): Promise<ManzaResponse>;
|
|
17
|
+
creditNote(id: string, attributes?: Record<string, unknown>): Promise<ManzaResponse>;
|
|
18
|
+
createPaymentLink(id: string, attributes?: Record<string, unknown>): Promise<ManzaResponse>;
|
|
19
19
|
}
|
|
20
20
|
//# sourceMappingURL=invoices.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invoices.d.ts","sourceRoot":"","sources":["../../src/resources/invoices.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"invoices.d.ts","sourceRoot":"","sources":["../../src/resources/invoices.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,KAAK,UAAU,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAE1D,MAAM,WAAW,iBAAkB,SAAQ,UAAU;IACnD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,qBAAa,QAAS,SAAQ,YAAY;IACxC,IAAI,CAAC,MAAM,GAAE,iBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAK5D,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAIvC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,aAAa,CAAC;IAInE,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,aAAa,CAAC;IAI/E,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAO1C,IAAI,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAIxC,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE,UAAU,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAIxF,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAI1C,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE,UAAU,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAIxF,iBAAiB,CAAC,EAAE,EAAE,MAAM,EAAE,UAAU,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,GAAG,OAAO,CAAC,aAAa,CAAC;CAGhG"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ManzaResponse } from "../response.js";
|
|
2
2
|
import { ResourceBase } from "./base.js";
|
|
3
3
|
export declare class PayeeTrustRequests extends ResourceBase {
|
|
4
4
|
create(params: {
|
|
5
5
|
external_account_ids: string[];
|
|
6
|
-
}): Promise<
|
|
7
|
-
get(id: string): Promise<
|
|
6
|
+
}): Promise<ManzaResponse>;
|
|
7
|
+
get(id: string): Promise<ManzaResponse>;
|
|
8
8
|
}
|
|
9
9
|
//# sourceMappingURL=payee_trust_requests.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payee_trust_requests.d.ts","sourceRoot":"","sources":["../../src/resources/payee_trust_requests.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"payee_trust_requests.d.ts","sourceRoot":"","sources":["../../src/resources/payee_trust_requests.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC,qBAAa,kBAAmB,SAAQ,YAAY;IAElD,MAAM,CAAC,MAAM,EAAE;QAAE,oBAAoB,EAAE,MAAM,EAAE,CAAA;KAAE,GAAG,OAAO,CAAC,aAAa,CAAC;IAM1E,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;CAGxC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { Page } from "../page.js";
|
|
2
|
-
import type {
|
|
2
|
+
import type { ManzaResponse } from "../response.js";
|
|
3
3
|
import { type ListParams, ResourceBase } from "./base.js";
|
|
4
4
|
export declare class PaymentLinks extends ResourceBase {
|
|
5
5
|
list(params?: ListParams): Promise<Page<unknown>>;
|
|
6
|
-
get(id: string): Promise<
|
|
7
|
-
create(attributes: Record<string, unknown>): Promise<
|
|
8
|
-
cancel(id: string): Promise<
|
|
6
|
+
get(id: string): Promise<ManzaResponse>;
|
|
7
|
+
create(attributes: Record<string, unknown>): Promise<ManzaResponse>;
|
|
8
|
+
cancel(id: string): Promise<ManzaResponse>;
|
|
9
9
|
}
|
|
10
10
|
//# sourceMappingURL=payment_links.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payment_links.d.ts","sourceRoot":"","sources":["../../src/resources/payment_links.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"payment_links.d.ts","sourceRoot":"","sources":["../../src/resources/payment_links.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,KAAK,UAAU,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAE1D,qBAAa,YAAa,SAAQ,YAAY;IAC5C,IAAI,CAAC,MAAM,GAAE,UAAe,GAAG,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAKrD,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAIvC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,aAAa,CAAC;IAInE,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;CAG3C"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ManzaResponse } from "../response.js";
|
|
2
2
|
import { ResourceBase } from "./base.js";
|
|
3
3
|
export declare class TransferDrafts extends ResourceBase {
|
|
4
|
-
create(attributes: Record<string, unknown>): Promise<
|
|
5
|
-
get(id: string): Promise<
|
|
4
|
+
create(attributes: Record<string, unknown>): Promise<ManzaResponse>;
|
|
5
|
+
get(id: string): Promise<ManzaResponse>;
|
|
6
6
|
authorize(id: string, params: {
|
|
7
7
|
authorization_id: string;
|
|
8
8
|
signature: string;
|
|
9
|
-
}): Promise<
|
|
9
|
+
}): Promise<ManzaResponse>;
|
|
10
10
|
decline(id: string, params: {
|
|
11
11
|
authorization_id: string;
|
|
12
12
|
reason?: string | null | undefined;
|
|
13
|
-
}): Promise<
|
|
13
|
+
}): Promise<ManzaResponse>;
|
|
14
14
|
}
|
|
15
15
|
//# sourceMappingURL=transfer_drafts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transfer_drafts.d.ts","sourceRoot":"","sources":["../../src/resources/transfer_drafts.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"transfer_drafts.d.ts","sourceRoot":"","sources":["../../src/resources/transfer_drafts.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC,qBAAa,cAAe,SAAQ,YAAY;IAO9C,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,aAAa,CAAC;IAInE,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAUvC,SAAS,CACP,EAAE,EAAE,MAAM,EACV,MAAM,EAAE;QAAE,gBAAgB,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,GACtD,OAAO,CAAC,aAAa,CAAC;IAYzB,OAAO,CACL,EAAE,EAAE,MAAM,EACV,MAAM,EAAE;QAAE,gBAAgB,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAA;KAAE,GACvE,OAAO,CAAC,aAAa,CAAC;CAK1B"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Page } from "../page.js";
|
|
2
|
-
import type {
|
|
2
|
+
import type { ManzaResponse } from "../response.js";
|
|
3
3
|
import { type ListParams, ResourceBase } from "./base.js";
|
|
4
4
|
export interface WebhookEndpointCreateParams {
|
|
5
5
|
url: string;
|
|
@@ -8,13 +8,13 @@ export interface WebhookEndpointCreateParams {
|
|
|
8
8
|
}
|
|
9
9
|
export declare class WebhookEndpoints extends ResourceBase {
|
|
10
10
|
list(params?: ListParams): Promise<Page<unknown>>;
|
|
11
|
-
get(id: string): Promise<
|
|
12
|
-
create(params: WebhookEndpointCreateParams): Promise<
|
|
13
|
-
update(id: string, attributes: Record<string, unknown>): Promise<
|
|
14
|
-
delete(id: string): Promise<
|
|
15
|
-
test(id: string): Promise<
|
|
16
|
-
regenerateSecret(id: string): Promise<
|
|
17
|
-
enable(id: string): Promise<
|
|
18
|
-
disable(id: string): Promise<
|
|
11
|
+
get(id: string): Promise<ManzaResponse>;
|
|
12
|
+
create(params: WebhookEndpointCreateParams): Promise<ManzaResponse>;
|
|
13
|
+
update(id: string, attributes: Record<string, unknown>): Promise<ManzaResponse>;
|
|
14
|
+
delete(id: string): Promise<ManzaResponse>;
|
|
15
|
+
test(id: string): Promise<ManzaResponse>;
|
|
16
|
+
regenerateSecret(id: string): Promise<ManzaResponse>;
|
|
17
|
+
enable(id: string): Promise<ManzaResponse>;
|
|
18
|
+
disable(id: string): Promise<ManzaResponse>;
|
|
19
19
|
}
|
|
20
20
|
//# sourceMappingURL=webhook_endpoints.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webhook_endpoints.d.ts","sourceRoot":"","sources":["../../src/resources/webhook_endpoints.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"webhook_endpoints.d.ts","sourceRoot":"","sources":["../../src/resources/webhook_endpoints.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,KAAK,UAAU,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAE1D,MAAM,WAAW,2BAA2B;IAC1C,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,qBAAa,gBAAiB,SAAQ,YAAY;IAChD,IAAI,CAAC,MAAM,GAAE,UAAe,GAAG,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAKrD,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAIvC,MAAM,CAAC,MAAM,EAAE,2BAA2B,GAAG,OAAO,CAAC,aAAa,CAAC;IAInE,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,aAAa,CAAC;IAI/E,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAI1C,IAAI,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAIxC,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAIpD,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAI1C,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;CAG5C"}
|
package/dist/response.d.ts
CHANGED
package/dist/response.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../src/response.ts"],"names":[],"mappings":"AAGA,qBAAa,
|
|
1
|
+
{"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../src/response.ts"],"names":[],"mappings":"AAGA,qBAAa,aAAa,CAAC,KAAK,GAAG,OAAO;IACxC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;IACrB,QAAQ,CAAC,GAAG,EAAE,QAAQ,CAAC;gBAEX,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK;IAOtC,IAAI,OAAO,IAAI,OAAO,CAErB;IAED,IAAI,SAAS,IAAI,MAAM,GAAG,IAAI,CAE7B;CACF"}
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "1.0.1";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/package.json
CHANGED