@jitsu/functions-lib 2.14.0-beta.4 → 2.14.0-beta.6
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/index.cjs.js +26 -0
- package/dist/index.es.js +25 -1
- package/dist/lib/functions.d.ts +13 -0
- package/package.json +1 -1
- package/src/lib/functions.ts +27 -0
package/dist/index.cjs.js
CHANGED
|
@@ -157,6 +157,7 @@ function transferValue(target, property, source) {
|
|
|
157
157
|
const TableNameParameter = "JITSU_TABLE_NAME";
|
|
158
158
|
const DropRetryErrorName = "Drop & RetryError";
|
|
159
159
|
const RetryErrorName = "RetryError";
|
|
160
|
+
const NoRetryErrorName = "NoRetryError";
|
|
160
161
|
class RetryError extends Error {
|
|
161
162
|
constructor(message, options) {
|
|
162
163
|
if (typeof message === "object") {
|
|
@@ -180,6 +181,29 @@ class RetryError extends Error {
|
|
|
180
181
|
};
|
|
181
182
|
}
|
|
182
183
|
}
|
|
184
|
+
class NoRetryError extends Error {
|
|
185
|
+
constructor(message) {
|
|
186
|
+
if (typeof message === "object") {
|
|
187
|
+
super(message.message);
|
|
188
|
+
this.message = message.message;
|
|
189
|
+
this.status = message.status;
|
|
190
|
+
this.response = message.response;
|
|
191
|
+
}
|
|
192
|
+
else {
|
|
193
|
+
super(message);
|
|
194
|
+
this.message = message;
|
|
195
|
+
}
|
|
196
|
+
this.name = "NoRetryError";
|
|
197
|
+
}
|
|
198
|
+
toJSON() {
|
|
199
|
+
return {
|
|
200
|
+
name: this.name,
|
|
201
|
+
message: this.message,
|
|
202
|
+
status: this.status,
|
|
203
|
+
response: this.response,
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
}
|
|
183
207
|
class HTTPError extends Error {
|
|
184
208
|
constructor(message, status, response) {
|
|
185
209
|
super(message);
|
|
@@ -477,6 +501,8 @@ function fromJitsuClassic(event) {
|
|
|
477
501
|
|
|
478
502
|
exports.DropRetryErrorName = DropRetryErrorName;
|
|
479
503
|
exports.HTTPError = HTTPError;
|
|
504
|
+
exports.NoRetryError = NoRetryError;
|
|
505
|
+
exports.NoRetryErrorName = NoRetryErrorName;
|
|
480
506
|
exports.RetryError = RetryError;
|
|
481
507
|
exports.RetryErrorName = RetryErrorName;
|
|
482
508
|
exports.TableNameParameter = TableNameParameter;
|
package/dist/index.es.js
CHANGED
|
@@ -155,6 +155,7 @@ function transferValue(target, property, source) {
|
|
|
155
155
|
const TableNameParameter = "JITSU_TABLE_NAME";
|
|
156
156
|
const DropRetryErrorName = "Drop & RetryError";
|
|
157
157
|
const RetryErrorName = "RetryError";
|
|
158
|
+
const NoRetryErrorName = "NoRetryError";
|
|
158
159
|
class RetryError extends Error {
|
|
159
160
|
constructor(message, options) {
|
|
160
161
|
if (typeof message === "object") {
|
|
@@ -178,6 +179,29 @@ class RetryError extends Error {
|
|
|
178
179
|
};
|
|
179
180
|
}
|
|
180
181
|
}
|
|
182
|
+
class NoRetryError extends Error {
|
|
183
|
+
constructor(message) {
|
|
184
|
+
if (typeof message === "object") {
|
|
185
|
+
super(message.message);
|
|
186
|
+
this.message = message.message;
|
|
187
|
+
this.status = message.status;
|
|
188
|
+
this.response = message.response;
|
|
189
|
+
}
|
|
190
|
+
else {
|
|
191
|
+
super(message);
|
|
192
|
+
this.message = message;
|
|
193
|
+
}
|
|
194
|
+
this.name = "NoRetryError";
|
|
195
|
+
}
|
|
196
|
+
toJSON() {
|
|
197
|
+
return {
|
|
198
|
+
name: this.name,
|
|
199
|
+
message: this.message,
|
|
200
|
+
status: this.status,
|
|
201
|
+
response: this.response,
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
}
|
|
181
205
|
class HTTPError extends Error {
|
|
182
206
|
constructor(message, status, response) {
|
|
183
207
|
super(message);
|
|
@@ -473,4 +497,4 @@ function fromJitsuClassic(event) {
|
|
|
473
497
|
});
|
|
474
498
|
}
|
|
475
499
|
|
|
476
|
-
export { DropRetryErrorName, HTTPError, RetryError, RetryErrorName, TableNameParameter, fromJitsuClassic, idToClassic, idToSnakeCaseFast, removeUndefined, toClassic, toJitsuClassic, toSnakeCase, transfer, transferAsClassic, transferAsSnakeCase, transferValue, transferValueAsSnakeCase };
|
|
500
|
+
export { DropRetryErrorName, HTTPError, NoRetryError, NoRetryErrorName, RetryError, RetryErrorName, TableNameParameter, fromJitsuClassic, idToClassic, idToSnakeCaseFast, removeUndefined, toClassic, toJitsuClassic, toSnakeCase, transfer, transferAsClassic, transferAsSnakeCase, transferValue, transferValueAsSnakeCase };
|
package/dist/lib/functions.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { AnalyticsServerEvent } from "@jitsu/protocols/analytics";
|
|
|
3
3
|
export declare const TableNameParameter = "JITSU_TABLE_NAME";
|
|
4
4
|
export declare const DropRetryErrorName = "Drop & RetryError";
|
|
5
5
|
export declare const RetryErrorName = "RetryError";
|
|
6
|
+
export declare const NoRetryErrorName = "NoRetryError";
|
|
6
7
|
export declare class RetryError extends Error {
|
|
7
8
|
status: number;
|
|
8
9
|
response: string;
|
|
@@ -17,6 +18,18 @@ export declare class RetryError extends Error {
|
|
|
17
18
|
response: string;
|
|
18
19
|
};
|
|
19
20
|
}
|
|
21
|
+
export declare class NoRetryError extends Error {
|
|
22
|
+
status: number;
|
|
23
|
+
response: string;
|
|
24
|
+
message: string;
|
|
25
|
+
constructor(message?: any);
|
|
26
|
+
toJSON(): {
|
|
27
|
+
name: string;
|
|
28
|
+
message: string;
|
|
29
|
+
status: number;
|
|
30
|
+
response: string;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
20
33
|
export declare class HTTPError extends Error {
|
|
21
34
|
status: number;
|
|
22
35
|
response: string;
|
package/package.json
CHANGED
package/src/lib/functions.ts
CHANGED
|
@@ -6,6 +6,7 @@ export const TableNameParameter = "JITSU_TABLE_NAME";
|
|
|
6
6
|
|
|
7
7
|
export const DropRetryErrorName = "Drop & RetryError";
|
|
8
8
|
export const RetryErrorName = "RetryError";
|
|
9
|
+
export const NoRetryErrorName = "NoRetryError";
|
|
9
10
|
|
|
10
11
|
export class RetryError extends Error {
|
|
11
12
|
status: number;
|
|
@@ -33,6 +34,32 @@ export class RetryError extends Error {
|
|
|
33
34
|
}
|
|
34
35
|
}
|
|
35
36
|
|
|
37
|
+
export class NoRetryError extends Error {
|
|
38
|
+
status: number;
|
|
39
|
+
response: string;
|
|
40
|
+
message: string;
|
|
41
|
+
constructor(message?: any) {
|
|
42
|
+
if (typeof message === "object") {
|
|
43
|
+
super(message.message);
|
|
44
|
+
this.message = message.message;
|
|
45
|
+
this.status = message.status;
|
|
46
|
+
this.response = message.response;
|
|
47
|
+
} else {
|
|
48
|
+
super(message);
|
|
49
|
+
this.message = message;
|
|
50
|
+
}
|
|
51
|
+
this.name = "NoRetryError";
|
|
52
|
+
}
|
|
53
|
+
toJSON() {
|
|
54
|
+
return {
|
|
55
|
+
name: this.name,
|
|
56
|
+
message: this.message,
|
|
57
|
+
status: this.status,
|
|
58
|
+
response: this.response,
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
36
63
|
export class HTTPError extends Error {
|
|
37
64
|
status: number;
|
|
38
65
|
response: string;
|