@etohq/utils 1.5.3 → 1.5.4-alpha.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/common/errors.d.ts +4 -8
- package/dist/common/errors.d.ts.map +1 -1
- package/dist/common/errors.js +8 -12
- package/dist/common/errors.js.map +1 -1
- package/dist/feature-flags/draft-overlays.d.ts +3 -0
- package/dist/feature-flags/draft-overlays.d.ts.map +1 -0
- package/dist/feature-flags/draft-overlays.js +10 -0
- package/dist/feature-flags/draft-overlays.js.map +1 -0
- package/dist/feature-flags/draft.d.ts +3 -0
- package/dist/feature-flags/draft.d.ts.map +1 -0
- package/dist/feature-flags/draft.js +10 -0
- package/dist/feature-flags/draft.js.map +1 -0
- package/package.json +2 -2
package/dist/common/errors.d.ts
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* @typedef MedusaErrorType
|
|
3
|
-
*
|
|
4
|
-
*/
|
|
5
|
-
export declare const MedusaErrorTypes: {
|
|
1
|
+
export declare const EtoErrorTypes: {
|
|
6
2
|
/** Errors stemming from the database */
|
|
7
3
|
DB_ERROR: string;
|
|
8
4
|
DUPLICATE_ERROR: string;
|
|
@@ -18,7 +14,7 @@ export declare const MedusaErrorTypes: {
|
|
|
18
14
|
PAYMENT_AUTHORIZATION_ERROR: string;
|
|
19
15
|
PAYMENT_REQUIRES_MORE_ERROR: string;
|
|
20
16
|
};
|
|
21
|
-
export declare const
|
|
17
|
+
export declare const EtoErrorCodes: {
|
|
22
18
|
INSUFFICIENT_INVENTORY: string;
|
|
23
19
|
CART_INCOMPATIBLE_STATE: string;
|
|
24
20
|
UNKNOWN_MODULES: string;
|
|
@@ -28,7 +24,7 @@ export declare const MedusaErrorCodes: {
|
|
|
28
24
|
* @extends Error
|
|
29
25
|
*/
|
|
30
26
|
export declare class EtoError extends Error {
|
|
31
|
-
|
|
27
|
+
__isEtoError: boolean;
|
|
32
28
|
type: string;
|
|
33
29
|
message: string;
|
|
34
30
|
code?: string;
|
|
@@ -65,6 +61,6 @@ export declare class EtoError extends Error {
|
|
|
65
61
|
/**
|
|
66
62
|
* Checks the object for the EtoError type.
|
|
67
63
|
*/
|
|
68
|
-
static
|
|
64
|
+
static isEtoError(error: any): error is EtoError;
|
|
69
65
|
}
|
|
70
66
|
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/common/errors.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/common/errors.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa;IACxB,wCAAwC;;;;;;;;;;;;;;CAczC,CAAA;AAED,eAAO,MAAM,aAAa;;;;CAIzB,CAAA;AAED;;;GAGG;AACH,qBAAa,QAAS,SAAQ,KAAK;IACjC,YAAY,UAAO;IAEZ,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,IAAI,CAAA;IACjB,OAAc,KAAK;QAjCnB,wCAAwC;;;;;;;;;;;;;;MAiCL;IACnC,OAAc,KAAK;;;;MAAgB;IAEnC;;;;;;OAMG;gBACS,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,GAAG;IAaxE;;OAEG;IACH,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,QAAQ;CAGjD"}
|
package/dist/common/errors.js
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EtoError = exports.
|
|
4
|
-
|
|
5
|
-
* @typedef MedusaErrorType
|
|
6
|
-
*
|
|
7
|
-
*/
|
|
8
|
-
exports.MedusaErrorTypes = {
|
|
3
|
+
exports.EtoError = exports.EtoErrorCodes = exports.EtoErrorTypes = void 0;
|
|
4
|
+
exports.EtoErrorTypes = {
|
|
9
5
|
/** Errors stemming from the database */
|
|
10
6
|
DB_ERROR: "database_error",
|
|
11
7
|
DUPLICATE_ERROR: "duplicate_error",
|
|
@@ -21,7 +17,7 @@ exports.MedusaErrorTypes = {
|
|
|
21
17
|
PAYMENT_AUTHORIZATION_ERROR: "payment_authorization_error",
|
|
22
18
|
PAYMENT_REQUIRES_MORE_ERROR: "payment_requires_more_error",
|
|
23
19
|
};
|
|
24
|
-
exports.
|
|
20
|
+
exports.EtoErrorCodes = {
|
|
25
21
|
INSUFFICIENT_INVENTORY: "insufficient_inventory",
|
|
26
22
|
CART_INCOMPATIBLE_STATE: "cart_incompatible_state",
|
|
27
23
|
UNKNOWN_MODULES: "unknown_modules",
|
|
@@ -40,7 +36,7 @@ class EtoError extends Error {
|
|
|
40
36
|
*/
|
|
41
37
|
constructor(type, message, code, ...params) {
|
|
42
38
|
super(...params);
|
|
43
|
-
this.
|
|
39
|
+
this.__isEtoError = true;
|
|
44
40
|
if (Error.captureStackTrace) {
|
|
45
41
|
Error.captureStackTrace(this, EtoError);
|
|
46
42
|
}
|
|
@@ -52,11 +48,11 @@ class EtoError extends Error {
|
|
|
52
48
|
/**
|
|
53
49
|
* Checks the object for the EtoError type.
|
|
54
50
|
*/
|
|
55
|
-
static
|
|
56
|
-
return !!error
|
|
51
|
+
static isEtoError(error) {
|
|
52
|
+
return !!error?.__isEtoError;
|
|
57
53
|
}
|
|
58
54
|
}
|
|
59
55
|
exports.EtoError = EtoError;
|
|
60
|
-
EtoError.Types = exports.
|
|
61
|
-
EtoError.Codes = exports.
|
|
56
|
+
EtoError.Types = exports.EtoErrorTypes;
|
|
57
|
+
EtoError.Codes = exports.EtoErrorCodes;
|
|
62
58
|
//# sourceMappingURL=errors.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/common/errors.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/common/errors.ts"],"names":[],"mappings":";;;AAAa,QAAA,aAAa,GAAG;IAC3B,wCAAwC;IACxC,QAAQ,EAAE,gBAAgB;IAC1B,eAAe,EAAE,iBAAiB;IAClC,gBAAgB,EAAE,kBAAkB;IACpC,YAAY,EAAE,cAAc;IAC5B,YAAY,EAAE,cAAc;IAC5B,SAAS,EAAE,WAAW;IACtB,SAAS,EAAE,WAAW;IACtB,WAAW,EAAE,aAAa;IAC1B,gBAAgB,EAAE,kBAAkB;IACpC,QAAQ,EAAE,UAAU;IACpB,eAAe,EAAE,iBAAiB;IAClC,2BAA2B,EAAE,6BAA6B;IAC1D,2BAA2B,EAAE,6BAA6B;CAC3D,CAAA;AAEY,QAAA,aAAa,GAAG;IAC3B,sBAAsB,EAAE,wBAAwB;IAChD,uBAAuB,EAAE,yBAAyB;IAClD,eAAe,EAAE,iBAAiB;CACnC,CAAA;AAED;;;GAGG;AACH,MAAa,QAAS,SAAQ,KAAK;IAUjC;;;;;;OAMG;IACH,YAAY,IAAY,EAAE,OAAe,EAAE,IAAa,EAAE,GAAG,MAAW;QACtE,KAAK,CAAC,GAAG,MAAM,CAAC,CAAA;QAjBlB,iBAAY,GAAG,IAAI,CAAA;QAmBjB,IAAI,KAAK,CAAC,iBAAiB,EAAE,CAAC;YAC5B,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAA;QACzC,CAAC;QAED,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,IAAI,GAAG,IAAI,IAAI,EAAE,CAAA;IACxB,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,UAAU,CAAC,KAAU;QAC1B,OAAO,CAAC,CAAC,KAAK,EAAE,YAAY,CAAA;IAC9B,CAAC;;AAnCH,4BAoCC;AA7Be,cAAK,GAAG,qBAAa,AAAhB,CAAgB;AACrB,cAAK,GAAG,qBAAa,AAAhB,CAAgB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"draft-overlays.d.ts","sourceRoot":"","sources":["../../src/feature-flags/draft-overlays.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAE/C,eAAO,MAAM,wBAAwB,EAAE,gBAAgB,CAAC,YAKvD,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DraftOverlaysFeatureFlag = void 0;
|
|
4
|
+
exports.DraftOverlaysFeatureFlag = {
|
|
5
|
+
key: "draft_overlays",
|
|
6
|
+
default_val: false,
|
|
7
|
+
env_key: "ETO_FF_DRAFT_OVERLAYS",
|
|
8
|
+
description: "Enable framework-managed draft overlay sessions and workflows",
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=draft-overlays.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"draft-overlays.js","sourceRoot":"","sources":["../../src/feature-flags/draft-overlays.ts"],"names":[],"mappings":";;;AAEa,QAAA,wBAAwB,GAAkC;IACrE,GAAG,EAAE,gBAAgB;IACrB,WAAW,EAAE,KAAK;IAClB,OAAO,EAAE,uBAAuB;IAChC,WAAW,EAAE,+DAA+D;CAC7E,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"draft.d.ts","sourceRoot":"","sources":["../../src/feature-flags/draft.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAE/C,eAAO,MAAM,gBAAgB,EAAE,gBAAgB,CAAC,YAK/C,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DraftFeatureFlag = void 0;
|
|
4
|
+
exports.DraftFeatureFlag = {
|
|
5
|
+
key: "draft",
|
|
6
|
+
default_val: false,
|
|
7
|
+
env_key: "ETO_FF_DRAFT",
|
|
8
|
+
description: "Enable framework-managed draft sessions and workflows",
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=draft.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"draft.js","sourceRoot":"","sources":["../../src/feature-flags/draft.ts"],"names":[],"mappings":";;;AAEa,QAAA,gBAAgB,GAAkC;IAC7D,GAAG,EAAE,OAAO;IACZ,WAAW,EAAE,KAAK;IAClB,OAAO,EAAE,cAAc;IACvB,WAAW,EAAE,uDAAuD;CACrE,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etohq/utils",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.4-alpha.0",
|
|
4
4
|
"description": "Eto utilities functions shared by Eto core and Modules",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"nanoid": "5.1.6",
|
|
66
66
|
"@sindresorhus/slugify": "2.2.1",
|
|
67
67
|
"geojson": "^0.5.0",
|
|
68
|
-
"@etohq/types": "1.5.
|
|
68
|
+
"@etohq/types": "1.5.4-alpha.0"
|
|
69
69
|
},
|
|
70
70
|
"peerDependencies": {
|
|
71
71
|
"@mikro-orm/core": "6.4.3",
|