@nizam-os/merchant-sdk 2.4.2 → 2.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/dist/api/errors/TooManyRequestsError.d.ts +6 -0
- package/dist/api/errors/TooManyRequestsError.js +54 -0
- package/dist/api/errors/index.d.ts +1 -0
- package/dist/api/errors/index.js +1 -0
- package/dist/api/resources/invites/client/Client.d.ts +1 -0
- package/dist/api/resources/invites/client/Client.js +3 -0
- package/dist/api/resources/lookups/client/Client.d.ts +5 -0
- package/dist/api/resources/lookups/client/Client.js +15 -0
- package/dist/api/resources/realtime/client/Client.d.ts +1 -0
- package/dist/api/resources/realtime/client/Client.js +3 -0
- package/dist/api/resources/users/client/Client.d.ts +1 -0
- package/dist/api/resources/users/client/Client.js +3 -0
- package/package.json +1 -1
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type * as core from "../../core/index.js";
|
|
2
|
+
import * as errors from "../../errors/index.js";
|
|
3
|
+
import type * as NizamMerchant from "../index.js";
|
|
4
|
+
export declare class TooManyRequestsError extends errors.NizamMerchantError {
|
|
5
|
+
constructor(body: NizamMerchant.ProblemDetail, rawResponse?: core.RawResponse);
|
|
6
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.TooManyRequestsError = void 0;
|
|
38
|
+
const errors = __importStar(require("../../errors/index.js"));
|
|
39
|
+
class TooManyRequestsError extends errors.NizamMerchantError {
|
|
40
|
+
constructor(body, rawResponse) {
|
|
41
|
+
super({
|
|
42
|
+
message: "TooManyRequestsError",
|
|
43
|
+
statusCode: 429,
|
|
44
|
+
body: body,
|
|
45
|
+
rawResponse: rawResponse,
|
|
46
|
+
});
|
|
47
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
48
|
+
if (Error.captureStackTrace) {
|
|
49
|
+
Error.captureStackTrace(this, this.constructor);
|
|
50
|
+
}
|
|
51
|
+
this.name = this.constructor.name;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.TooManyRequestsError = TooManyRequestsError;
|
|
@@ -3,5 +3,6 @@ export * from "./ForbiddenError.js";
|
|
|
3
3
|
export * from "./GoneError.js";
|
|
4
4
|
export * from "./InternalServerError.js";
|
|
5
5
|
export * from "./NotFoundError.js";
|
|
6
|
+
export * from "./TooManyRequestsError.js";
|
|
6
7
|
export * from "./UnauthorizedError.js";
|
|
7
8
|
export * from "./UnprocessableEntityError.js";
|
package/dist/api/errors/index.js
CHANGED
|
@@ -19,5 +19,6 @@ __exportStar(require("./ForbiddenError.js"), exports);
|
|
|
19
19
|
__exportStar(require("./GoneError.js"), exports);
|
|
20
20
|
__exportStar(require("./InternalServerError.js"), exports);
|
|
21
21
|
__exportStar(require("./NotFoundError.js"), exports);
|
|
22
|
+
__exportStar(require("./TooManyRequestsError.js"), exports);
|
|
22
23
|
__exportStar(require("./UnauthorizedError.js"), exports);
|
|
23
24
|
__exportStar(require("./UnprocessableEntityError.js"), exports);
|
|
@@ -25,6 +25,7 @@ export declare class InvitesClient {
|
|
|
25
25
|
* @throws {@link NizamMerchant.ConflictError}
|
|
26
26
|
* @throws {@link NizamMerchant.GoneError}
|
|
27
27
|
* @throws {@link NizamMerchant.UnprocessableEntityError}
|
|
28
|
+
* @throws {@link NizamMerchant.TooManyRequestsError}
|
|
28
29
|
* @throws {@link NizamMerchant.InternalServerError}
|
|
29
30
|
*
|
|
30
31
|
* @example
|
|
@@ -61,6 +61,7 @@ class InvitesClient {
|
|
|
61
61
|
* @throws {@link NizamMerchant.ConflictError}
|
|
62
62
|
* @throws {@link NizamMerchant.GoneError}
|
|
63
63
|
* @throws {@link NizamMerchant.UnprocessableEntityError}
|
|
64
|
+
* @throws {@link NizamMerchant.TooManyRequestsError}
|
|
64
65
|
* @throws {@link NizamMerchant.InternalServerError}
|
|
65
66
|
*
|
|
66
67
|
* @example
|
|
@@ -107,6 +108,8 @@ class InvitesClient {
|
|
|
107
108
|
throw new NizamMerchant.GoneError(_response.error.body, _response.rawResponse);
|
|
108
109
|
case 422:
|
|
109
110
|
throw new NizamMerchant.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
111
|
+
case 429:
|
|
112
|
+
throw new NizamMerchant.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
110
113
|
case 500:
|
|
111
114
|
throw new NizamMerchant.InternalServerError(_response.error.body, _response.rawResponse);
|
|
112
115
|
default:
|
|
@@ -17,6 +17,7 @@ export declare class LookupsClient {
|
|
|
17
17
|
* @param {LookupsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
18
18
|
*
|
|
19
19
|
* @throws {@link NizamMerchant.UnauthorizedError}
|
|
20
|
+
* @throws {@link NizamMerchant.TooManyRequestsError}
|
|
20
21
|
* @throws {@link NizamMerchant.InternalServerError}
|
|
21
22
|
*
|
|
22
23
|
* @example
|
|
@@ -28,6 +29,7 @@ export declare class LookupsClient {
|
|
|
28
29
|
* @param {LookupsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
29
30
|
*
|
|
30
31
|
* @throws {@link NizamMerchant.UnauthorizedError}
|
|
32
|
+
* @throws {@link NizamMerchant.TooManyRequestsError}
|
|
31
33
|
* @throws {@link NizamMerchant.InternalServerError}
|
|
32
34
|
*
|
|
33
35
|
* @example
|
|
@@ -39,6 +41,7 @@ export declare class LookupsClient {
|
|
|
39
41
|
* @param {LookupsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
40
42
|
*
|
|
41
43
|
* @throws {@link NizamMerchant.UnauthorizedError}
|
|
44
|
+
* @throws {@link NizamMerchant.TooManyRequestsError}
|
|
42
45
|
* @throws {@link NizamMerchant.InternalServerError}
|
|
43
46
|
*
|
|
44
47
|
* @example
|
|
@@ -50,6 +53,7 @@ export declare class LookupsClient {
|
|
|
50
53
|
* @param {LookupsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
51
54
|
*
|
|
52
55
|
* @throws {@link NizamMerchant.UnauthorizedError}
|
|
56
|
+
* @throws {@link NizamMerchant.TooManyRequestsError}
|
|
53
57
|
* @throws {@link NizamMerchant.InternalServerError}
|
|
54
58
|
*
|
|
55
59
|
* @example
|
|
@@ -61,6 +65,7 @@ export declare class LookupsClient {
|
|
|
61
65
|
* @param {LookupsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
62
66
|
*
|
|
63
67
|
* @throws {@link NizamMerchant.UnauthorizedError}
|
|
68
|
+
* @throws {@link NizamMerchant.TooManyRequestsError}
|
|
64
69
|
* @throws {@link NizamMerchant.InternalServerError}
|
|
65
70
|
*
|
|
66
71
|
* @example
|
|
@@ -53,6 +53,7 @@ class LookupsClient {
|
|
|
53
53
|
* @param {LookupsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
54
54
|
*
|
|
55
55
|
* @throws {@link NizamMerchant.UnauthorizedError}
|
|
56
|
+
* @throws {@link NizamMerchant.TooManyRequestsError}
|
|
56
57
|
* @throws {@link NizamMerchant.InternalServerError}
|
|
57
58
|
*
|
|
58
59
|
* @example
|
|
@@ -87,6 +88,8 @@ class LookupsClient {
|
|
|
87
88
|
switch (_response.error.statusCode) {
|
|
88
89
|
case 401:
|
|
89
90
|
throw new NizamMerchant.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
91
|
+
case 429:
|
|
92
|
+
throw new NizamMerchant.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
90
93
|
case 500:
|
|
91
94
|
throw new NizamMerchant.InternalServerError(_response.error.body, _response.rawResponse);
|
|
92
95
|
default:
|
|
@@ -103,6 +106,7 @@ class LookupsClient {
|
|
|
103
106
|
* @param {LookupsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
104
107
|
*
|
|
105
108
|
* @throws {@link NizamMerchant.UnauthorizedError}
|
|
109
|
+
* @throws {@link NizamMerchant.TooManyRequestsError}
|
|
106
110
|
* @throws {@link NizamMerchant.InternalServerError}
|
|
107
111
|
*
|
|
108
112
|
* @example
|
|
@@ -134,6 +138,8 @@ class LookupsClient {
|
|
|
134
138
|
switch (_response.error.statusCode) {
|
|
135
139
|
case 401:
|
|
136
140
|
throw new NizamMerchant.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
141
|
+
case 429:
|
|
142
|
+
throw new NizamMerchant.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
137
143
|
case 500:
|
|
138
144
|
throw new NizamMerchant.InternalServerError(_response.error.body, _response.rawResponse);
|
|
139
145
|
default:
|
|
@@ -150,6 +156,7 @@ class LookupsClient {
|
|
|
150
156
|
* @param {LookupsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
151
157
|
*
|
|
152
158
|
* @throws {@link NizamMerchant.UnauthorizedError}
|
|
159
|
+
* @throws {@link NizamMerchant.TooManyRequestsError}
|
|
153
160
|
* @throws {@link NizamMerchant.InternalServerError}
|
|
154
161
|
*
|
|
155
162
|
* @example
|
|
@@ -181,6 +188,8 @@ class LookupsClient {
|
|
|
181
188
|
switch (_response.error.statusCode) {
|
|
182
189
|
case 401:
|
|
183
190
|
throw new NizamMerchant.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
191
|
+
case 429:
|
|
192
|
+
throw new NizamMerchant.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
184
193
|
case 500:
|
|
185
194
|
throw new NizamMerchant.InternalServerError(_response.error.body, _response.rawResponse);
|
|
186
195
|
default:
|
|
@@ -197,6 +206,7 @@ class LookupsClient {
|
|
|
197
206
|
* @param {LookupsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
198
207
|
*
|
|
199
208
|
* @throws {@link NizamMerchant.UnauthorizedError}
|
|
209
|
+
* @throws {@link NizamMerchant.TooManyRequestsError}
|
|
200
210
|
* @throws {@link NizamMerchant.InternalServerError}
|
|
201
211
|
*
|
|
202
212
|
* @example
|
|
@@ -228,6 +238,8 @@ class LookupsClient {
|
|
|
228
238
|
switch (_response.error.statusCode) {
|
|
229
239
|
case 401:
|
|
230
240
|
throw new NizamMerchant.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
241
|
+
case 429:
|
|
242
|
+
throw new NizamMerchant.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
231
243
|
case 500:
|
|
232
244
|
throw new NizamMerchant.InternalServerError(_response.error.body, _response.rawResponse);
|
|
233
245
|
default:
|
|
@@ -244,6 +256,7 @@ class LookupsClient {
|
|
|
244
256
|
* @param {LookupsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
245
257
|
*
|
|
246
258
|
* @throws {@link NizamMerchant.UnauthorizedError}
|
|
259
|
+
* @throws {@link NizamMerchant.TooManyRequestsError}
|
|
247
260
|
* @throws {@link NizamMerchant.InternalServerError}
|
|
248
261
|
*
|
|
249
262
|
* @example
|
|
@@ -275,6 +288,8 @@ class LookupsClient {
|
|
|
275
288
|
switch (_response.error.statusCode) {
|
|
276
289
|
case 401:
|
|
277
290
|
throw new NizamMerchant.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
291
|
+
case 429:
|
|
292
|
+
throw new NizamMerchant.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
278
293
|
case 500:
|
|
279
294
|
throw new NizamMerchant.InternalServerError(_response.error.body, _response.rawResponse);
|
|
280
295
|
default:
|
|
@@ -20,6 +20,7 @@ export declare class RealtimeClient {
|
|
|
20
20
|
*
|
|
21
21
|
* @throws {@link NizamMerchant.UnauthorizedError}
|
|
22
22
|
* @throws {@link NizamMerchant.ForbiddenError}
|
|
23
|
+
* @throws {@link NizamMerchant.TooManyRequestsError}
|
|
23
24
|
* @throws {@link NizamMerchant.InternalServerError}
|
|
24
25
|
*
|
|
25
26
|
* @example
|
|
@@ -56,6 +56,7 @@ class RealtimeClient {
|
|
|
56
56
|
*
|
|
57
57
|
* @throws {@link NizamMerchant.UnauthorizedError}
|
|
58
58
|
* @throws {@link NizamMerchant.ForbiddenError}
|
|
59
|
+
* @throws {@link NizamMerchant.TooManyRequestsError}
|
|
59
60
|
* @throws {@link NizamMerchant.InternalServerError}
|
|
60
61
|
*
|
|
61
62
|
* @example
|
|
@@ -89,6 +90,8 @@ class RealtimeClient {
|
|
|
89
90
|
throw new NizamMerchant.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
90
91
|
case 403:
|
|
91
92
|
throw new NizamMerchant.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
93
|
+
case 429:
|
|
94
|
+
throw new NizamMerchant.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
92
95
|
case 500:
|
|
93
96
|
throw new NizamMerchant.InternalServerError(_response.error.body, _response.rawResponse);
|
|
94
97
|
default:
|
|
@@ -30,6 +30,7 @@ export declare class UsersClient {
|
|
|
30
30
|
* @throws {@link NizamMerchant.UnauthorizedError}
|
|
31
31
|
* @throws {@link NizamMerchant.ForbiddenError}
|
|
32
32
|
* @throws {@link NizamMerchant.ConflictError}
|
|
33
|
+
* @throws {@link NizamMerchant.TooManyRequestsError}
|
|
33
34
|
* @throws {@link NizamMerchant.InternalServerError}
|
|
34
35
|
*
|
|
35
36
|
* @example
|
|
@@ -66,6 +66,7 @@ class UsersClient {
|
|
|
66
66
|
* @throws {@link NizamMerchant.UnauthorizedError}
|
|
67
67
|
* @throws {@link NizamMerchant.ForbiddenError}
|
|
68
68
|
* @throws {@link NizamMerchant.ConflictError}
|
|
69
|
+
* @throws {@link NizamMerchant.TooManyRequestsError}
|
|
69
70
|
* @throws {@link NizamMerchant.InternalServerError}
|
|
70
71
|
*
|
|
71
72
|
* @example
|
|
@@ -101,6 +102,8 @@ class UsersClient {
|
|
|
101
102
|
throw new NizamMerchant.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
102
103
|
case 409:
|
|
103
104
|
throw new NizamMerchant.ConflictError(_response.error.body, _response.rawResponse);
|
|
105
|
+
case 429:
|
|
106
|
+
throw new NizamMerchant.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
104
107
|
case 500:
|
|
105
108
|
throw new NizamMerchant.InternalServerError(_response.error.body, _response.rawResponse);
|
|
106
109
|
default:
|