@slicemachine/manager 0.26.3-alpha.jp-fix-volumes-move-error.1 → 0.26.3-alpha.jp-suppress-abort-error.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/_node_modules/@amplitude/analytics-node/lib/esm/transports/http.cjs +6 -6
- package/dist/_node_modules/@amplitude/analytics-node/lib/esm/transports/http.js +4 -4
- package/dist/_node_modules/@amplitude/analytics-node/lib/esm/transports/http.js.map +1 -1
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/transport/http.cjs +4 -4
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/transport/http.cjs.map +1 -1
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/transport/http.js +4 -4
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/transport/http.js.map +1 -1
- package/dist/errors.cjs +7 -0
- package/dist/errors.cjs.map +1 -1
- package/dist/errors.d.ts +5 -1
- package/dist/errors.js +7 -0
- package/dist/errors.js.map +1 -1
- package/dist/index.cjs +1 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -1
- package/dist/managers/customTypes/CustomTypesManager.cjs +17 -7
- package/dist/managers/customTypes/CustomTypesManager.cjs.map +1 -1
- package/dist/managers/customTypes/CustomTypesManager.js +19 -9
- package/dist/managers/customTypes/CustomTypesManager.js.map +1 -1
- package/package.json +2 -2
- package/src/errors.ts +12 -1
- package/src/index.ts +1 -0
- package/src/managers/customTypes/CustomTypesManager.ts +29 -18
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/constants.cjs +0 -5
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/constants.cjs.map +0 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/constants.js +0 -5
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/constants.js.map +0 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/debug-build.cjs +0 -5
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/debug-build.cjs.map +0 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/debug-build.js +0 -5
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/debug-build.js.map +0 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/eventProcessors.cjs +0 -29
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/eventProcessors.cjs.map +0 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/eventProcessors.js +0 -29
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/eventProcessors.js.map +0 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/exports.cjs +0 -17
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/exports.cjs.map +0 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/exports.js +0 -17
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/exports.js.map +0 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/hub.cjs +0 -535
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/hub.cjs.map +0 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/hub.js +0 -535
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/hub.js.map +0 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/scope.cjs +0 -545
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/scope.cjs.map +0 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/scope.js +0 -545
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/scope.js.map +0 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/session.cjs +0 -109
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/session.cjs.map +0 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/session.js +0 -109
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/session.js.map +0 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/tracing/dynamicSamplingContext.cjs +0 -50
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/tracing/dynamicSamplingContext.cjs.map +0 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/tracing/dynamicSamplingContext.js +0 -50
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/tracing/dynamicSamplingContext.js.map +0 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/utils/applyScopeDataToEvent.cjs +0 -85
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/utils/applyScopeDataToEvent.cjs.map +0 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/utils/applyScopeDataToEvent.js +0 -85
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/utils/applyScopeDataToEvent.js.map +0 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/utils/getRootSpan.cjs +0 -7
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/utils/getRootSpan.cjs.map +0 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/utils/getRootSpan.js +0 -7
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/utils/getRootSpan.js.map +0 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/utils/prepareEvent.cjs +0 -35
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/utils/prepareEvent.cjs.map +0 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/utils/prepareEvent.js +0 -35
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/utils/prepareEvent.js.map +0 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/utils/spanUtils.cjs +0 -39
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/utils/spanUtils.cjs.map +0 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/utils/spanUtils.js +0 -39
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/utils/spanUtils.js.map +0 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/version.cjs +0 -5
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/version.cjs.map +0 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/version.js +0 -5
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/version.js.map +0 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/debug-build.cjs +0 -5
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/debug-build.cjs.map +0 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/debug-build.js +0 -5
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/debug-build.js.map +0 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/is.cjs +0 -15
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/is.cjs.map +0 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/is.js +0 -15
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/is.js.map +0 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/logger.cjs +0 -69
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/logger.cjs.map +0 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/logger.js +0 -69
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/logger.js.map +0 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/misc.cjs +0 -34
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/misc.cjs.map +0 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/misc.js +0 -34
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/misc.js.map +0 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/object.cjs +0 -49
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/object.cjs.map +0 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/object.js +0 -49
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/object.js.map +0 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/syncpromise.cjs +0 -142
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/syncpromise.cjs.map +0 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/syncpromise.js +0 -142
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/syncpromise.js.map +0 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/time.cjs +0 -45
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/time.cjs.map +0 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/time.js +0 -45
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/time.js.map +0 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/worldwide.cjs +0 -18
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/worldwide.cjs.map +0 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/worldwide.js +0 -18
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/worldwide.js.map +0 -1
- package/dist/lib/checkIsSentryEnabled.d.ts +0 -9
- package/dist/lib/sentryErrorHandlers.cjs +0 -10
- package/dist/lib/sentryErrorHandlers.cjs.map +0 -1
- package/dist/lib/sentryErrorHandlers.d.ts +0 -1
- package/dist/lib/sentryErrorHandlers.js +0 -10
- package/dist/lib/sentryErrorHandlers.js.map +0 -1
- package/src/lib/checkIsSentryEnabled.ts +0 -12
- package/src/lib/sentryErrorHandlers.ts +0 -13
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const tslib_es6 = require('./../../../_node_modules/tslib/tslib.es6.cjs');
|
|
4
|
-
const
|
|
5
|
-
const
|
|
4
|
+
const require$$0 = require("http");
|
|
5
|
+
const require$$1 = require("https");
|
|
6
6
|
const base = require("../../../../analytics-core/lib/esm/transports/base.cjs");
|
|
7
7
|
function _interopNamespaceDefault(e) {
|
|
8
8
|
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
@@ -20,8 +20,8 @@ function _interopNamespaceDefault(e) {
|
|
|
20
20
|
n.default = e;
|
|
21
21
|
return Object.freeze(n);
|
|
22
22
|
}
|
|
23
|
-
const
|
|
24
|
-
const
|
|
23
|
+
const require$$0__namespace = /* @__PURE__ */ _interopNamespaceDefault(require$$0);
|
|
24
|
+
const require$$1__namespace = /* @__PURE__ */ _interopNamespaceDefault(require$$1);
|
|
25
25
|
var Http = (
|
|
26
26
|
/** @class */
|
|
27
27
|
function(_super) {
|
|
@@ -33,9 +33,9 @@ var Http = (
|
|
|
33
33
|
var _this = this;
|
|
34
34
|
var protocol;
|
|
35
35
|
if (serverUrl.startsWith("http://")) {
|
|
36
|
-
protocol =
|
|
36
|
+
protocol = require$$0__namespace;
|
|
37
37
|
} else if (serverUrl.startsWith("https://")) {
|
|
38
|
-
protocol =
|
|
38
|
+
protocol = require$$1__namespace;
|
|
39
39
|
} else {
|
|
40
40
|
throw new Error("Invalid server url");
|
|
41
41
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __extends } from './../../../_node_modules/tslib/tslib.es6.js';
|
|
2
|
-
import * as
|
|
3
|
-
import * as
|
|
2
|
+
import * as require$$0 from "http";
|
|
3
|
+
import * as require$$1 from "https";
|
|
4
4
|
import { BaseTransport } from "../../../../analytics-core/lib/esm/transports/base.js";
|
|
5
5
|
var Http = (
|
|
6
6
|
/** @class */
|
|
@@ -13,9 +13,9 @@ var Http = (
|
|
|
13
13
|
var _this = this;
|
|
14
14
|
var protocol;
|
|
15
15
|
if (serverUrl.startsWith("http://")) {
|
|
16
|
-
protocol =
|
|
16
|
+
protocol = require$$0;
|
|
17
17
|
} else if (serverUrl.startsWith("https://")) {
|
|
18
|
-
protocol =
|
|
18
|
+
protocol = require$$1;
|
|
19
19
|
} else {
|
|
20
20
|
throw new Error("Invalid server url");
|
|
21
21
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.js","sources":["../../../../../../../../../node_modules/@amplitude/analytics-node/lib/esm/transports/http.js"],"sourcesContent":["import { __extends } from \"tslib\";\nimport { BaseTransport } from '@amplitude/analytics-core';\nimport * as http from 'http';\nimport * as https from 'https';\nvar Http = /** @class */ (function (_super) {\n __extends(Http, _super);\n function Http() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Http.prototype.send = function (serverUrl, payload) {\n var _this = this;\n var protocol;\n if (serverUrl.startsWith('http://')) {\n protocol = http;\n }\n else if (serverUrl.startsWith('https://')) {\n protocol = https;\n }\n else {\n throw new Error('Invalid server url');\n }\n var url = new URL(serverUrl);\n var requestPayload = JSON.stringify(payload);\n var options = {\n headers: {\n 'Content-Type': 'application/json',\n 'Content-Length': Buffer.byteLength(requestPayload),\n },\n hostname: url.hostname,\n method: 'POST',\n path: url.pathname,\n port: url.port,\n protocol: url.protocol,\n };\n return new Promise(function (resolve) {\n var req = protocol.request(options, function (res) {\n res.setEncoding('utf8');\n var responsePayload = '';\n res.on('data', function (chunk) {\n responsePayload += chunk;\n });\n res.on('end', function () {\n if (res.complete && responsePayload.length > 0) {\n try {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n var parsedResponsePayload = JSON.parse(responsePayload);\n var result = _this.buildResponse(parsedResponsePayload);\n resolve(result);\n return;\n }\n catch (_a) {\n resolve(null);\n }\n }\n });\n });\n req.on('error', function () { return resolve(null); });\n req.end(requestPayload);\n });\n };\n return Http;\n}(BaseTransport));\nexport { Http };\n//# sourceMappingURL=http.js.map"],"names":["Http"],"mappings":";;;;AAIG,IAAC;AAAA;AAAA,EAAsB,SAAU,QAAQ;AACxC,cAAUA,OAAM,MAAM;AACtB,aAASA,QAAO;AACZ,aAAO,WAAW,QAAQ,OAAO,MAAM,MAAM,SAAS,KAAK;AAAA,IAC/D;AACA,IAAAA,MAAK,UAAU,OAAO,SAAU,WAAW,SAAS;AAChD,UAAI,QAAQ;AACZ,UAAI;AACJ,UAAI,UAAU,WAAW,SAAS,GAAG;AACjC,
|
|
1
|
+
{"version":3,"file":"http.js","sources":["../../../../../../../../../node_modules/@amplitude/analytics-node/lib/esm/transports/http.js"],"sourcesContent":["import { __extends } from \"tslib\";\nimport { BaseTransport } from '@amplitude/analytics-core';\nimport * as http from 'http';\nimport * as https from 'https';\nvar Http = /** @class */ (function (_super) {\n __extends(Http, _super);\n function Http() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Http.prototype.send = function (serverUrl, payload) {\n var _this = this;\n var protocol;\n if (serverUrl.startsWith('http://')) {\n protocol = http;\n }\n else if (serverUrl.startsWith('https://')) {\n protocol = https;\n }\n else {\n throw new Error('Invalid server url');\n }\n var url = new URL(serverUrl);\n var requestPayload = JSON.stringify(payload);\n var options = {\n headers: {\n 'Content-Type': 'application/json',\n 'Content-Length': Buffer.byteLength(requestPayload),\n },\n hostname: url.hostname,\n method: 'POST',\n path: url.pathname,\n port: url.port,\n protocol: url.protocol,\n };\n return new Promise(function (resolve) {\n var req = protocol.request(options, function (res) {\n res.setEncoding('utf8');\n var responsePayload = '';\n res.on('data', function (chunk) {\n responsePayload += chunk;\n });\n res.on('end', function () {\n if (res.complete && responsePayload.length > 0) {\n try {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n var parsedResponsePayload = JSON.parse(responsePayload);\n var result = _this.buildResponse(parsedResponsePayload);\n resolve(result);\n return;\n }\n catch (_a) {\n resolve(null);\n }\n }\n });\n });\n req.on('error', function () { return resolve(null); });\n req.end(requestPayload);\n });\n };\n return Http;\n}(BaseTransport));\nexport { Http };\n//# sourceMappingURL=http.js.map"],"names":["Http","http","https"],"mappings":";;;;AAIG,IAAC;AAAA;AAAA,EAAsB,SAAU,QAAQ;AACxC,cAAUA,OAAM,MAAM;AACtB,aAASA,QAAO;AACZ,aAAO,WAAW,QAAQ,OAAO,MAAM,MAAM,SAAS,KAAK;AAAA,IAC/D;AACA,IAAAA,MAAK,UAAU,OAAO,SAAU,WAAW,SAAS;AAChD,UAAI,QAAQ;AACZ,UAAI;AACJ,UAAI,UAAU,WAAW,SAAS,GAAG;AACjC,mBAAWC;AAAAA,MACf,WACS,UAAU,WAAW,UAAU,GAAG;AACvC,mBAAWC;AAAAA,MACf,OACK;AACD,cAAM,IAAI,MAAM,oBAAoB;AAAA,MACxC;AACA,UAAI,MAAM,IAAI,IAAI,SAAS;AAC3B,UAAI,iBAAiB,KAAK,UAAU,OAAO;AAC3C,UAAI,UAAU;AAAA,QACV,SAAS;AAAA,UACL,gBAAgB;AAAA,UAChB,kBAAkB,OAAO,WAAW,cAAc;AAAA,QAClE;AAAA,QACY,UAAU,IAAI;AAAA,QACd,QAAQ;AAAA,QACR,MAAM,IAAI;AAAA,QACV,MAAM,IAAI;AAAA,QACV,UAAU,IAAI;AAAA,MAC1B;AACQ,aAAO,IAAI,QAAQ,SAAU,SAAS;AAClC,YAAI,MAAM,SAAS,QAAQ,SAAS,SAAU,KAAK;AAC/C,cAAI,YAAY,MAAM;AACtB,cAAI,kBAAkB;AACtB,cAAI,GAAG,QAAQ,SAAU,OAAO;AAC5B,+BAAmB;AAAA,UACvB,CAAC;AACD,cAAI,GAAG,OAAO,WAAY;AACtB,gBAAI,IAAI,YAAY,gBAAgB,SAAS,GAAG;AAC5C,kBAAI;AAEA,oBAAI,wBAAwB,KAAK,MAAM,eAAe;AACtD,oBAAI,SAAS,MAAM,cAAc,qBAAqB;AACtD,wBAAQ,MAAM;AACd;AAAA,cACJ,SACO,IAAI;AACP,wBAAQ,IAAI;AAAA,cAChB;AAAA,YACJ;AAAA,UACJ,CAAC;AAAA,QACL,CAAC;AACD,YAAI,GAAG,SAAS,WAAY;AAAE,iBAAO,QAAQ,IAAI;AAAA,QAAG,CAAC;AACrD,YAAI,IAAI,cAAc;AAAA,MAC1B,CAAC;AAAA,IACL;AACA,WAAOF;AAAA,EACX,EAAE,aAAa;AAAA;","x_google_ignoreList":[0]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const _commonjsHelpers = require("../../../../../../_virtual/_commonjsHelpers.cjs");
|
|
3
3
|
const http = require("../../../../../../_virtual/http.cjs");
|
|
4
|
-
const
|
|
5
|
-
const
|
|
4
|
+
const require$$0 = require("http");
|
|
5
|
+
const require$$1 = require("https");
|
|
6
6
|
const require$$2 = require("url");
|
|
7
7
|
var __awaiter = _commonjsHelpers.commonjsGlobal && _commonjsHelpers.commonjsGlobal.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
8
8
|
function adopt(value) {
|
|
@@ -36,8 +36,8 @@ var __importDefault = _commonjsHelpers.commonjsGlobal && _commonjsHelpers.common
|
|
|
36
36
|
};
|
|
37
37
|
Object.defineProperty(http.__exports, "__esModule", { value: true });
|
|
38
38
|
http.__exports.WrapperClient = http.__exports.FetchHttpClient = void 0;
|
|
39
|
-
const http_1 = __importDefault(
|
|
40
|
-
const https_1 = __importDefault(
|
|
39
|
+
const http_1 = __importDefault(require$$0);
|
|
40
|
+
const https_1 = __importDefault(require$$1);
|
|
41
41
|
const url_1 = __importDefault(require$$2);
|
|
42
42
|
const defaultHttpAgent = new https_1.default.Agent({
|
|
43
43
|
keepAlive: true
|
package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/transport/http.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.cjs","sources":["../../../../../../../../../node_modules/@amplitude/experiment-node-server/dist/src/transport/http.js"],"sourcesContent":["\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.WrapperClient = exports.FetchHttpClient = void 0;\nconst http_1 = __importDefault(require(\"http\"));\nconst https_1 = __importDefault(require(\"https\"));\nconst url_1 = __importDefault(require(\"url\"));\nconst defaultHttpAgent = new https_1.default.Agent({\n keepAlive: true,\n});\nclass FetchHttpClient {\n constructor(httpAgent) {\n this.httpAgent = httpAgent || defaultHttpAgent;\n }\n /**\n * Wraps the http and https libraries in a fetch()-like interface\n * @param requestUrl\n * @param method HTTP Method (GET, POST, etc.)\n * @param headers HTTP Headers\n * @param Request body\n */\n request(requestUrl, method, headers, body, timeoutMillis) {\n return new Promise((resolve, reject) => {\n if (timeoutMillis === 0) {\n reject(Error('Response timed out'));\n return;\n }\n const urlParams = url_1.default.parse(requestUrl);\n const options = Object.assign(Object.assign({}, urlParams), { method: method, headers: headers, body: body, agent: this.httpAgent, timeout: timeoutMillis });\n const protocol = urlParams.protocol === 'http:' ? http_1.default : https_1.default;\n const req = protocol.request(options);\n req.on('response', (res) => {\n res.setEncoding('utf-8');\n let responseBody = '';\n res.on('data', (chunk) => {\n responseBody += chunk;\n });\n res.on('end', () => {\n resolve({\n status: res.statusCode,\n body: responseBody,\n });\n });\n });\n req.on('timeout', () => {\n req.destroy(Error('Socket connection timed out'));\n });\n req.on('error', (e) => {\n reject(e);\n });\n if (method !== 'GET' && body) {\n req.write(body);\n }\n req.end();\n });\n }\n}\nexports.FetchHttpClient = FetchHttpClient;\n/**\n * Wrap the exposed HttpClient in a CoreClient implementation to work with\n * FlagApi and EvaluationApi.\n */\nclass WrapperClient {\n constructor(client) {\n this.client = client;\n }\n request(request) {\n return __awaiter(this, void 0, void 0, function* () {\n return yield this.client.request(request.requestUrl, request.method, request.headers, null, request.timeoutMillis);\n });\n }\n}\nexports.WrapperClient = WrapperClient;\n"],"names":["this","http"
|
|
1
|
+
{"version":3,"file":"http.cjs","sources":["../../../../../../../../../node_modules/@amplitude/experiment-node-server/dist/src/transport/http.js"],"sourcesContent":["\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.WrapperClient = exports.FetchHttpClient = void 0;\nconst http_1 = __importDefault(require(\"http\"));\nconst https_1 = __importDefault(require(\"https\"));\nconst url_1 = __importDefault(require(\"url\"));\nconst defaultHttpAgent = new https_1.default.Agent({\n keepAlive: true,\n});\nclass FetchHttpClient {\n constructor(httpAgent) {\n this.httpAgent = httpAgent || defaultHttpAgent;\n }\n /**\n * Wraps the http and https libraries in a fetch()-like interface\n * @param requestUrl\n * @param method HTTP Method (GET, POST, etc.)\n * @param headers HTTP Headers\n * @param Request body\n */\n request(requestUrl, method, headers, body, timeoutMillis) {\n return new Promise((resolve, reject) => {\n if (timeoutMillis === 0) {\n reject(Error('Response timed out'));\n return;\n }\n const urlParams = url_1.default.parse(requestUrl);\n const options = Object.assign(Object.assign({}, urlParams), { method: method, headers: headers, body: body, agent: this.httpAgent, timeout: timeoutMillis });\n const protocol = urlParams.protocol === 'http:' ? http_1.default : https_1.default;\n const req = protocol.request(options);\n req.on('response', (res) => {\n res.setEncoding('utf-8');\n let responseBody = '';\n res.on('data', (chunk) => {\n responseBody += chunk;\n });\n res.on('end', () => {\n resolve({\n status: res.statusCode,\n body: responseBody,\n });\n });\n });\n req.on('timeout', () => {\n req.destroy(Error('Socket connection timed out'));\n });\n req.on('error', (e) => {\n reject(e);\n });\n if (method !== 'GET' && body) {\n req.write(body);\n }\n req.end();\n });\n }\n}\nexports.FetchHttpClient = FetchHttpClient;\n/**\n * Wrap the exposed HttpClient in a CoreClient implementation to work with\n * FlagApi and EvaluationApi.\n */\nclass WrapperClient {\n constructor(client) {\n this.client = client;\n }\n request(request) {\n return __awaiter(this, void 0, void 0, function* () {\n return yield this.client.request(request.requestUrl, request.method, request.headers, null, request.timeoutMillis);\n });\n }\n}\nexports.WrapperClient = WrapperClient;\n"],"names":["this","http"],"mappings":"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","x_google_ignoreList":[0]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { commonjsGlobal } from "../../../../../../_virtual/_commonjsHelpers.js";
|
|
2
2
|
import { __exports as http } from "../../../../../../_virtual/http.js";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
3
|
+
import require$$0__default from "http";
|
|
4
|
+
import require$$1__default from "https";
|
|
5
5
|
import require$$2 from "url";
|
|
6
6
|
var __awaiter = commonjsGlobal && commonjsGlobal.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
7
7
|
function adopt(value) {
|
|
@@ -35,8 +35,8 @@ var __importDefault = commonjsGlobal && commonjsGlobal.__importDefault || functi
|
|
|
35
35
|
};
|
|
36
36
|
Object.defineProperty(http, "__esModule", { value: true });
|
|
37
37
|
http.WrapperClient = http.FetchHttpClient = void 0;
|
|
38
|
-
const http_1 = __importDefault(
|
|
39
|
-
const https_1 = __importDefault(
|
|
38
|
+
const http_1 = __importDefault(require$$0__default);
|
|
39
|
+
const https_1 = __importDefault(require$$1__default);
|
|
40
40
|
const url_1 = __importDefault(require$$2);
|
|
41
41
|
const defaultHttpAgent = new https_1.default.Agent({
|
|
42
42
|
keepAlive: true
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.js","sources":["../../../../../../../../../node_modules/@amplitude/experiment-node-server/dist/src/transport/http.js"],"sourcesContent":["\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.WrapperClient = exports.FetchHttpClient = void 0;\nconst http_1 = __importDefault(require(\"http\"));\nconst https_1 = __importDefault(require(\"https\"));\nconst url_1 = __importDefault(require(\"url\"));\nconst defaultHttpAgent = new https_1.default.Agent({\n keepAlive: true,\n});\nclass FetchHttpClient {\n constructor(httpAgent) {\n this.httpAgent = httpAgent || defaultHttpAgent;\n }\n /**\n * Wraps the http and https libraries in a fetch()-like interface\n * @param requestUrl\n * @param method HTTP Method (GET, POST, etc.)\n * @param headers HTTP Headers\n * @param Request body\n */\n request(requestUrl, method, headers, body, timeoutMillis) {\n return new Promise((resolve, reject) => {\n if (timeoutMillis === 0) {\n reject(Error('Response timed out'));\n return;\n }\n const urlParams = url_1.default.parse(requestUrl);\n const options = Object.assign(Object.assign({}, urlParams), { method: method, headers: headers, body: body, agent: this.httpAgent, timeout: timeoutMillis });\n const protocol = urlParams.protocol === 'http:' ? http_1.default : https_1.default;\n const req = protocol.request(options);\n req.on('response', (res) => {\n res.setEncoding('utf-8');\n let responseBody = '';\n res.on('data', (chunk) => {\n responseBody += chunk;\n });\n res.on('end', () => {\n resolve({\n status: res.statusCode,\n body: responseBody,\n });\n });\n });\n req.on('timeout', () => {\n req.destroy(Error('Socket connection timed out'));\n });\n req.on('error', (e) => {\n reject(e);\n });\n if (method !== 'GET' && body) {\n req.write(body);\n }\n req.end();\n });\n }\n}\nexports.FetchHttpClient = FetchHttpClient;\n/**\n * Wrap the exposed HttpClient in a CoreClient implementation to work with\n * FlagApi and EvaluationApi.\n */\nclass WrapperClient {\n constructor(client) {\n this.client = client;\n }\n request(request) {\n return __awaiter(this, void 0, void 0, function* () {\n return yield this.client.request(request.requestUrl, request.method, request.headers, null, request.timeoutMillis);\n });\n }\n}\nexports.WrapperClient = WrapperClient;\n"],"names":["this","require$$0","require$$1"],"mappings":";;;;;AACA,IAAI,YAAaA,kBAAQA,eAAK,aAAc,SAAU,SAAS,YAAY,GAAG,WAAW;AACrF,WAAS,MAAM,OAAO;AAAE,WAAO,iBAAiB,IAAI,QAAQ,IAAI,EAAE,SAAU,SAAS;AAAE,cAAQ,KAAK;AAAA,IAAE,CAAE;AAAA,EAAE;AAC1G,SAAO,KAAK,MAAM,IAAI,UAAU,SAAU,SAAS,QAAQ;AACvD,aAAS,UAAU,OAAO;AAAE,UAAI;AAAE,aAAK,UAAU,KAAK,KAAK,CAAC;AAAA,MAAE,SAAU,GAAG;AAAE,eAAO,CAAC;AAAA;IAAI;AACzF,aAAS,SAAS,OAAO;AAAE,UAAI;AAAE,aAAK,UAAU,OAAO,EAAE,KAAK,CAAC;AAAA,MAAE,SAAU,GAAG;AAAE,eAAO,CAAC;AAAA;IAAI;AAC5F,aAAS,KAAK,QAAQ;AAAE,aAAO,OAAO,QAAQ,OAAO,KAAK,IAAI,MAAM,OAAO,KAAK,EAAE,KAAK,WAAW,QAAQ;AAAA,IAAE;AAC5G,UAAM,YAAY,UAAU,MAAM,SAAS,cAAc,CAAA,CAAE,GAAG,MAAM;AAAA,EAC5E,CAAK;AACL;AACA,IAAI,kBAAmBA,kBAAQA,eAAK,mBAAoB,SAAU,KAAK;AACnE,SAAQ,OAAO,IAAI,aAAc,MAAM,EAAE,WAAW,IAAG;AAC3D;AACA,OAAO,eAAe,MAAS,cAAc,EAAE,OAAO,KAAI,CAAE;AAC5D,KAAA,gBAAwB,KAAA,kBAA0B;AAClD,MAAM,SAAS,gBAAgBC,
|
|
1
|
+
{"version":3,"file":"http.js","sources":["../../../../../../../../../node_modules/@amplitude/experiment-node-server/dist/src/transport/http.js"],"sourcesContent":["\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.WrapperClient = exports.FetchHttpClient = void 0;\nconst http_1 = __importDefault(require(\"http\"));\nconst https_1 = __importDefault(require(\"https\"));\nconst url_1 = __importDefault(require(\"url\"));\nconst defaultHttpAgent = new https_1.default.Agent({\n keepAlive: true,\n});\nclass FetchHttpClient {\n constructor(httpAgent) {\n this.httpAgent = httpAgent || defaultHttpAgent;\n }\n /**\n * Wraps the http and https libraries in a fetch()-like interface\n * @param requestUrl\n * @param method HTTP Method (GET, POST, etc.)\n * @param headers HTTP Headers\n * @param Request body\n */\n request(requestUrl, method, headers, body, timeoutMillis) {\n return new Promise((resolve, reject) => {\n if (timeoutMillis === 0) {\n reject(Error('Response timed out'));\n return;\n }\n const urlParams = url_1.default.parse(requestUrl);\n const options = Object.assign(Object.assign({}, urlParams), { method: method, headers: headers, body: body, agent: this.httpAgent, timeout: timeoutMillis });\n const protocol = urlParams.protocol === 'http:' ? http_1.default : https_1.default;\n const req = protocol.request(options);\n req.on('response', (res) => {\n res.setEncoding('utf-8');\n let responseBody = '';\n res.on('data', (chunk) => {\n responseBody += chunk;\n });\n res.on('end', () => {\n resolve({\n status: res.statusCode,\n body: responseBody,\n });\n });\n });\n req.on('timeout', () => {\n req.destroy(Error('Socket connection timed out'));\n });\n req.on('error', (e) => {\n reject(e);\n });\n if (method !== 'GET' && body) {\n req.write(body);\n }\n req.end();\n });\n }\n}\nexports.FetchHttpClient = FetchHttpClient;\n/**\n * Wrap the exposed HttpClient in a CoreClient implementation to work with\n * FlagApi and EvaluationApi.\n */\nclass WrapperClient {\n constructor(client) {\n this.client = client;\n }\n request(request) {\n return __awaiter(this, void 0, void 0, function* () {\n return yield this.client.request(request.requestUrl, request.method, request.headers, null, request.timeoutMillis);\n });\n }\n}\nexports.WrapperClient = WrapperClient;\n"],"names":["this","require$$0","require$$1"],"mappings":"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","x_google_ignoreList":[0]}
|
package/dist/errors.cjs
CHANGED
|
@@ -66,6 +66,12 @@ class UnsupportedError extends SliceMachineError {
|
|
|
66
66
|
__publicField(this, "name", "SMUnsupportedError");
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
|
+
class InferSliceAbortError extends SliceMachineError {
|
|
70
|
+
constructor() {
|
|
71
|
+
super(...arguments);
|
|
72
|
+
__publicField(this, "name", "SMInferSliceAbortError");
|
|
73
|
+
}
|
|
74
|
+
}
|
|
69
75
|
const isSliceMachineError = (error, name) => {
|
|
70
76
|
const isErrorInstance = error instanceof Error;
|
|
71
77
|
return name === void 0 ? isErrorInstance && error.name.startsWith("SM") : isErrorInstance && error.name === name;
|
|
@@ -94,6 +100,7 @@ const isInvalidActiveEnvironmentError = (error) => {
|
|
|
94
100
|
const isUnsupportedError = (error) => {
|
|
95
101
|
return isSliceMachineError(error, "SMUnsupportedError");
|
|
96
102
|
};
|
|
103
|
+
exports.InferSliceAbortError = InferSliceAbortError;
|
|
97
104
|
exports.InternalError = InternalError;
|
|
98
105
|
exports.InvalidActiveEnvironmentError = InvalidActiveEnvironmentError;
|
|
99
106
|
exports.NotFoundError = NotFoundError;
|
package/dist/errors.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.cjs","sources":["../../src/errors.ts"],"sourcesContent":["import { HookError } from \"@slicemachine/plugin-kit\";\n\nexport class SliceMachineError extends Error {\n\tname = \"SMSliceMachineError\";\n}\nexport class UnauthorizedError extends SliceMachineError {\n\tname = \"SMUnauthorizedError\" as const;\n}\nexport class UnauthenticatedError extends SliceMachineError {\n\tname = \"SMUnauthenticatedError\" as const;\n\tmessage = \"Authenticate before trying again.\";\n}\nexport class NotFoundError extends SliceMachineError {\n\tname = \"SMNotFoundError\" as const;\n}\nexport class UnexpectedDataError extends SliceMachineError {\n\tname = \"SMUnexpectedDataError\" as const;\n}\nexport class InternalError extends SliceMachineError {\n\tname = \"SMInternalError\" as const;\n}\nexport class PluginError extends SliceMachineError {\n\tname = \"SMPluginError\" as const;\n}\nexport class PluginHookResultError extends SliceMachineError {\n\tname = \"SMPluginHookResultError\" as const;\n\n\tconstructor(errors: HookError[]) {\n\t\tsuper(\n\t\t\t`${errors.length} error${\n\t\t\t\terrors.length === 1 ? \"\" : \"s\"\n\t\t\t} were returned by one or more plugins.`,\n\t\t\t{\n\t\t\t\tcause: errors,\n\t\t\t},\n\t\t);\n\t}\n}\nexport class InvalidActiveEnvironmentError extends SliceMachineError {\n\tname = \"SMInvalidActiveEnvironmentError\" as const;\n}\nexport class UnsupportedError extends SliceMachineError {\n\tname = \"SMUnsupportedError\" as const;\n}\n\ntype SliceMachineErrorNames =\n\t| \"SMSliceMachineError\"\n\t| UnauthorizedError[\"name\"]\n\t| UnauthenticatedError[\"name\"]\n\t| NotFoundError[\"name\"]\n\t| UnexpectedDataError[\"name\"]\n\t| InternalError[\"name\"]\n\t| PluginError[\"name\"]\n\t| PluginHookResultError[\"name\"]\n\t| InvalidActiveEnvironmentError[\"name\"]\n\t| UnsupportedError[\"name\"];\n\ntype ShallowSliceMachineError<TName extends SliceMachineErrorNames> = Error & {\n\tname: TName;\n};\n\nexport const isSliceMachineError = <TName extends SliceMachineErrorNames>(\n\terror: unknown,\n\tname?: TName,\n): error is TName extends string ? ShallowSliceMachineError<TName> : Error => {\n\tconst isErrorInstance = error instanceof Error;\n\n\treturn name === undefined\n\t\t? isErrorInstance && error.name.startsWith(\"SM\")\n\t\t: isErrorInstance && error.name === name;\n};\n\nexport const isUnauthorizedError = (\n\terror: unknown,\n): error is ShallowSliceMachineError<\"SMUnauthorizedError\"> => {\n\treturn isSliceMachineError(error, \"SMUnauthorizedError\");\n};\n\nexport const isUnauthenticatedError = (\n\terror: unknown,\n): error is ShallowSliceMachineError<\"SMUnauthenticatedError\"> => {\n\treturn isSliceMachineError(error, \"SMUnauthenticatedError\");\n};\n\nexport const isNotFoundError = (\n\terror: unknown,\n): error is ShallowSliceMachineError<\"SMNotFoundError\"> => {\n\treturn isSliceMachineError(error, \"SMNotFoundError\");\n};\n\nexport const isUnexpectedDataError = (\n\terror: unknown,\n): error is ShallowSliceMachineError<\"SMUnexpectedDataError\"> => {\n\treturn isSliceMachineError(error, \"SMUnexpectedDataError\");\n};\n\nexport const isInternalError = (\n\terror: unknown,\n): error is ShallowSliceMachineError<\"SMInternalError\"> => {\n\treturn isSliceMachineError(error, \"SMInternalError\");\n};\n\nexport const isPluginError = (\n\terror: unknown,\n): error is ShallowSliceMachineError<\"SMPluginError\"> => {\n\treturn isSliceMachineError(error, \"SMPluginError\");\n};\n\nexport const isInvalidActiveEnvironmentError = (\n\terror: unknown,\n): error is ShallowSliceMachineError<\"SMInvalidActiveEnvironmentError\"> => {\n\treturn isSliceMachineError(error, \"SMInvalidActiveEnvironmentError\");\n};\n\nexport const isUnsupportedError = (\n\terror: unknown,\n): error is ShallowSliceMachineError<\"SMUnsupportedError\"> => {\n\treturn isSliceMachineError(error, \"SMUnsupportedError\");\n};\n"],"names":[],"mappings":";;;;;AAEM,MAAO,0BAA0B,MAAK;AAAA,EAAtC;AAAA;AACL,gCAAO;AAAA;AACP;AACK,MAAO,0BAA0B,kBAAiB;AAAA,EAAlD;AAAA;AACL,gCAAO;AAAA;AACP;AACK,MAAO,6BAA6B,kBAAiB;AAAA,EAArD;AAAA;AACL,gCAAO;AACP,mCAAU;AAAA;AACV;AACK,MAAO,sBAAsB,kBAAiB;AAAA,EAA9C;AAAA;AACL,gCAAO;AAAA;AACP;AACK,MAAO,4BAA4B,kBAAiB;AAAA,EAApD;AAAA;AACL,gCAAO;AAAA;AACP;AACK,MAAO,sBAAsB,kBAAiB;AAAA,EAA9C;AAAA;AACL,gCAAO;AAAA;AACP;AACK,MAAO,oBAAoB,kBAAiB;AAAA,EAA5C;AAAA;AACL,gCAAO;AAAA;AACP;AACK,MAAO,8BAA8B,kBAAiB;AAAA,EAG3D,YAAY,QAAmB;AAC9B,UACC,GAAG,OAAO,MAAM,SACf,OAAO,WAAW,IAAI,KAAK,GAC5B,0CACA;AAAA,MACC,OAAO;AAAA,IAAA,CACP;AATH,gCAAO;AAAA,EAWP;AACA;AACK,MAAO,sCAAsC,kBAAiB;AAAA,EAA9D;AAAA;AACL,gCAAO;AAAA;AACP;AACK,MAAO,yBAAyB,kBAAiB;AAAA,EAAjD;AAAA;AACL,gCAAO;AAAA;AACP;
|
|
1
|
+
{"version":3,"file":"errors.cjs","sources":["../../src/errors.ts"],"sourcesContent":["import { HookError } from \"@slicemachine/plugin-kit\";\n\nexport class SliceMachineError extends Error {\n\tname = \"SMSliceMachineError\";\n}\nexport class UnauthorizedError extends SliceMachineError {\n\tname = \"SMUnauthorizedError\" as const;\n}\nexport class UnauthenticatedError extends SliceMachineError {\n\tname = \"SMUnauthenticatedError\" as const;\n\tmessage = \"Authenticate before trying again.\";\n}\nexport class NotFoundError extends SliceMachineError {\n\tname = \"SMNotFoundError\" as const;\n}\nexport class UnexpectedDataError extends SliceMachineError {\n\tname = \"SMUnexpectedDataError\" as const;\n}\nexport class InternalError extends SliceMachineError {\n\tname = \"SMInternalError\" as const;\n}\nexport class PluginError extends SliceMachineError {\n\tname = \"SMPluginError\" as const;\n}\nexport class PluginHookResultError extends SliceMachineError {\n\tname = \"SMPluginHookResultError\" as const;\n\n\tconstructor(errors: HookError[]) {\n\t\tsuper(\n\t\t\t`${errors.length} error${\n\t\t\t\terrors.length === 1 ? \"\" : \"s\"\n\t\t\t} were returned by one or more plugins.`,\n\t\t\t{\n\t\t\t\tcause: errors,\n\t\t\t},\n\t\t);\n\t}\n}\nexport class InvalidActiveEnvironmentError extends SliceMachineError {\n\tname = \"SMInvalidActiveEnvironmentError\" as const;\n}\nexport class UnsupportedError extends SliceMachineError {\n\tname = \"SMUnsupportedError\" as const;\n}\n\nexport class InferSliceAbortError extends SliceMachineError {\n\tname = \"SMInferSliceAbortError\" as const;\n}\n\ntype SliceMachineErrorNames =\n\t| \"SMSliceMachineError\"\n\t| UnauthorizedError[\"name\"]\n\t| UnauthenticatedError[\"name\"]\n\t| NotFoundError[\"name\"]\n\t| UnexpectedDataError[\"name\"]\n\t| InternalError[\"name\"]\n\t| PluginError[\"name\"]\n\t| PluginHookResultError[\"name\"]\n\t| InvalidActiveEnvironmentError[\"name\"]\n\t| UnsupportedError[\"name\"]\n\t| InferSliceAbortError[\"name\"];\n\ntype ShallowSliceMachineError<TName extends SliceMachineErrorNames> = Error & {\n\tname: TName;\n};\n\nexport const isSliceMachineError = <TName extends SliceMachineErrorNames>(\n\terror: unknown,\n\tname?: TName,\n): error is TName extends string ? ShallowSliceMachineError<TName> : Error => {\n\tconst isErrorInstance = error instanceof Error;\n\n\treturn name === undefined\n\t\t? isErrorInstance && error.name.startsWith(\"SM\")\n\t\t: isErrorInstance && error.name === name;\n};\n\nexport const isUnauthorizedError = (\n\terror: unknown,\n): error is ShallowSliceMachineError<\"SMUnauthorizedError\"> => {\n\treturn isSliceMachineError(error, \"SMUnauthorizedError\");\n};\n\nexport const isUnauthenticatedError = (\n\terror: unknown,\n): error is ShallowSliceMachineError<\"SMUnauthenticatedError\"> => {\n\treturn isSliceMachineError(error, \"SMUnauthenticatedError\");\n};\n\nexport const isNotFoundError = (\n\terror: unknown,\n): error is ShallowSliceMachineError<\"SMNotFoundError\"> => {\n\treturn isSliceMachineError(error, \"SMNotFoundError\");\n};\n\nexport const isUnexpectedDataError = (\n\terror: unknown,\n): error is ShallowSliceMachineError<\"SMUnexpectedDataError\"> => {\n\treturn isSliceMachineError(error, \"SMUnexpectedDataError\");\n};\n\nexport const isInternalError = (\n\terror: unknown,\n): error is ShallowSliceMachineError<\"SMInternalError\"> => {\n\treturn isSliceMachineError(error, \"SMInternalError\");\n};\n\nexport const isPluginError = (\n\terror: unknown,\n): error is ShallowSliceMachineError<\"SMPluginError\"> => {\n\treturn isSliceMachineError(error, \"SMPluginError\");\n};\n\nexport const isInvalidActiveEnvironmentError = (\n\terror: unknown,\n): error is ShallowSliceMachineError<\"SMInvalidActiveEnvironmentError\"> => {\n\treturn isSliceMachineError(error, \"SMInvalidActiveEnvironmentError\");\n};\n\nexport const isUnsupportedError = (\n\terror: unknown,\n): error is ShallowSliceMachineError<\"SMUnsupportedError\"> => {\n\treturn isSliceMachineError(error, \"SMUnsupportedError\");\n};\n\nexport const isInferSliceAbortError = (\n\terror: unknown,\n): error is ShallowSliceMachineError<\"SMInferSliceAbortError\"> => {\n\treturn isSliceMachineError(error, \"SMInferSliceAbortError\");\n};\n"],"names":[],"mappings":";;;;;AAEM,MAAO,0BAA0B,MAAK;AAAA,EAAtC;AAAA;AACL,gCAAO;AAAA;AACP;AACK,MAAO,0BAA0B,kBAAiB;AAAA,EAAlD;AAAA;AACL,gCAAO;AAAA;AACP;AACK,MAAO,6BAA6B,kBAAiB;AAAA,EAArD;AAAA;AACL,gCAAO;AACP,mCAAU;AAAA;AACV;AACK,MAAO,sBAAsB,kBAAiB;AAAA,EAA9C;AAAA;AACL,gCAAO;AAAA;AACP;AACK,MAAO,4BAA4B,kBAAiB;AAAA,EAApD;AAAA;AACL,gCAAO;AAAA;AACP;AACK,MAAO,sBAAsB,kBAAiB;AAAA,EAA9C;AAAA;AACL,gCAAO;AAAA;AACP;AACK,MAAO,oBAAoB,kBAAiB;AAAA,EAA5C;AAAA;AACL,gCAAO;AAAA;AACP;AACK,MAAO,8BAA8B,kBAAiB;AAAA,EAG3D,YAAY,QAAmB;AAC9B,UACC,GAAG,OAAO,MAAM,SACf,OAAO,WAAW,IAAI,KAAK,GAC5B,0CACA;AAAA,MACC,OAAO;AAAA,IAAA,CACP;AATH,gCAAO;AAAA,EAWP;AACA;AACK,MAAO,sCAAsC,kBAAiB;AAAA,EAA9D;AAAA;AACL,gCAAO;AAAA;AACP;AACK,MAAO,yBAAyB,kBAAiB;AAAA,EAAjD;AAAA;AACL,gCAAO;AAAA;AACP;AAEK,MAAO,6BAA6B,kBAAiB;AAAA,EAArD;AAAA;AACL,gCAAO;AAAA;AACP;AAmBM,MAAM,sBAAsB,CAClC,OACA,SAC4E;AAC5E,QAAM,kBAAkB,iBAAiB;AAEzC,SAAO,SAAS,SACb,mBAAmB,MAAM,KAAK,WAAW,IAAI,IAC7C,mBAAmB,MAAM,SAAS;AACtC;AAEO,MAAM,sBAAsB,CAClC,UAC6D;AAC7D,SAAO,oBAAoB,OAAO,qBAAqB;AACxD;AAEO,MAAM,yBAAyB,CACrC,UACgE;AAChE,SAAO,oBAAoB,OAAO,wBAAwB;AAC3D;AAEO,MAAM,kBAAkB,CAC9B,UACyD;AACzD,SAAO,oBAAoB,OAAO,iBAAiB;AACpD;AAEO,MAAM,wBAAwB,CACpC,UAC+D;AAC/D,SAAO,oBAAoB,OAAO,uBAAuB;AAC1D;AAEO,MAAM,kBAAkB,CAC9B,UACyD;AACzD,SAAO,oBAAoB,OAAO,iBAAiB;AACpD;AAEO,MAAM,gBAAgB,CAC5B,UACuD;AACvD,SAAO,oBAAoB,OAAO,eAAe;AAClD;AAEO,MAAM,kCAAkC,CAC9C,UACyE;AACzE,SAAO,oBAAoB,OAAO,iCAAiC;AACpE;AAEO,MAAM,qBAAqB,CACjC,UAC4D;AAC5D,SAAO,oBAAoB,OAAO,oBAAoB;AACvD;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/errors.d.ts
CHANGED
|
@@ -31,7 +31,10 @@ export declare class InvalidActiveEnvironmentError extends SliceMachineError {
|
|
|
31
31
|
export declare class UnsupportedError extends SliceMachineError {
|
|
32
32
|
name: "SMUnsupportedError";
|
|
33
33
|
}
|
|
34
|
-
|
|
34
|
+
export declare class InferSliceAbortError extends SliceMachineError {
|
|
35
|
+
name: "SMInferSliceAbortError";
|
|
36
|
+
}
|
|
37
|
+
type SliceMachineErrorNames = "SMSliceMachineError" | UnauthorizedError["name"] | UnauthenticatedError["name"] | NotFoundError["name"] | UnexpectedDataError["name"] | InternalError["name"] | PluginError["name"] | PluginHookResultError["name"] | InvalidActiveEnvironmentError["name"] | UnsupportedError["name"] | InferSliceAbortError["name"];
|
|
35
38
|
type ShallowSliceMachineError<TName extends SliceMachineErrorNames> = Error & {
|
|
36
39
|
name: TName;
|
|
37
40
|
};
|
|
@@ -44,4 +47,5 @@ export declare const isInternalError: (error: unknown) => error is ShallowSliceM
|
|
|
44
47
|
export declare const isPluginError: (error: unknown) => error is ShallowSliceMachineError<"SMPluginError">;
|
|
45
48
|
export declare const isInvalidActiveEnvironmentError: (error: unknown) => error is ShallowSliceMachineError<"SMInvalidActiveEnvironmentError">;
|
|
46
49
|
export declare const isUnsupportedError: (error: unknown) => error is ShallowSliceMachineError<"SMUnsupportedError">;
|
|
50
|
+
export declare const isInferSliceAbortError: (error: unknown) => error is ShallowSliceMachineError<"SMInferSliceAbortError">;
|
|
47
51
|
export {};
|
package/dist/errors.js
CHANGED
|
@@ -64,6 +64,12 @@ class UnsupportedError extends SliceMachineError {
|
|
|
64
64
|
__publicField(this, "name", "SMUnsupportedError");
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
|
+
class InferSliceAbortError extends SliceMachineError {
|
|
68
|
+
constructor() {
|
|
69
|
+
super(...arguments);
|
|
70
|
+
__publicField(this, "name", "SMInferSliceAbortError");
|
|
71
|
+
}
|
|
72
|
+
}
|
|
67
73
|
const isSliceMachineError = (error, name) => {
|
|
68
74
|
const isErrorInstance = error instanceof Error;
|
|
69
75
|
return name === void 0 ? isErrorInstance && error.name.startsWith("SM") : isErrorInstance && error.name === name;
|
|
@@ -93,6 +99,7 @@ const isUnsupportedError = (error) => {
|
|
|
93
99
|
return isSliceMachineError(error, "SMUnsupportedError");
|
|
94
100
|
};
|
|
95
101
|
export {
|
|
102
|
+
InferSliceAbortError,
|
|
96
103
|
InternalError,
|
|
97
104
|
InvalidActiveEnvironmentError,
|
|
98
105
|
NotFoundError,
|
package/dist/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sources":["../../src/errors.ts"],"sourcesContent":["import { HookError } from \"@slicemachine/plugin-kit\";\n\nexport class SliceMachineError extends Error {\n\tname = \"SMSliceMachineError\";\n}\nexport class UnauthorizedError extends SliceMachineError {\n\tname = \"SMUnauthorizedError\" as const;\n}\nexport class UnauthenticatedError extends SliceMachineError {\n\tname = \"SMUnauthenticatedError\" as const;\n\tmessage = \"Authenticate before trying again.\";\n}\nexport class NotFoundError extends SliceMachineError {\n\tname = \"SMNotFoundError\" as const;\n}\nexport class UnexpectedDataError extends SliceMachineError {\n\tname = \"SMUnexpectedDataError\" as const;\n}\nexport class InternalError extends SliceMachineError {\n\tname = \"SMInternalError\" as const;\n}\nexport class PluginError extends SliceMachineError {\n\tname = \"SMPluginError\" as const;\n}\nexport class PluginHookResultError extends SliceMachineError {\n\tname = \"SMPluginHookResultError\" as const;\n\n\tconstructor(errors: HookError[]) {\n\t\tsuper(\n\t\t\t`${errors.length} error${\n\t\t\t\terrors.length === 1 ? \"\" : \"s\"\n\t\t\t} were returned by one or more plugins.`,\n\t\t\t{\n\t\t\t\tcause: errors,\n\t\t\t},\n\t\t);\n\t}\n}\nexport class InvalidActiveEnvironmentError extends SliceMachineError {\n\tname = \"SMInvalidActiveEnvironmentError\" as const;\n}\nexport class UnsupportedError extends SliceMachineError {\n\tname = \"SMUnsupportedError\" as const;\n}\n\ntype SliceMachineErrorNames =\n\t| \"SMSliceMachineError\"\n\t| UnauthorizedError[\"name\"]\n\t| UnauthenticatedError[\"name\"]\n\t| NotFoundError[\"name\"]\n\t| UnexpectedDataError[\"name\"]\n\t| InternalError[\"name\"]\n\t| PluginError[\"name\"]\n\t| PluginHookResultError[\"name\"]\n\t| InvalidActiveEnvironmentError[\"name\"]\n\t| UnsupportedError[\"name\"];\n\ntype ShallowSliceMachineError<TName extends SliceMachineErrorNames> = Error & {\n\tname: TName;\n};\n\nexport const isSliceMachineError = <TName extends SliceMachineErrorNames>(\n\terror: unknown,\n\tname?: TName,\n): error is TName extends string ? ShallowSliceMachineError<TName> : Error => {\n\tconst isErrorInstance = error instanceof Error;\n\n\treturn name === undefined\n\t\t? isErrorInstance && error.name.startsWith(\"SM\")\n\t\t: isErrorInstance && error.name === name;\n};\n\nexport const isUnauthorizedError = (\n\terror: unknown,\n): error is ShallowSliceMachineError<\"SMUnauthorizedError\"> => {\n\treturn isSliceMachineError(error, \"SMUnauthorizedError\");\n};\n\nexport const isUnauthenticatedError = (\n\terror: unknown,\n): error is ShallowSliceMachineError<\"SMUnauthenticatedError\"> => {\n\treturn isSliceMachineError(error, \"SMUnauthenticatedError\");\n};\n\nexport const isNotFoundError = (\n\terror: unknown,\n): error is ShallowSliceMachineError<\"SMNotFoundError\"> => {\n\treturn isSliceMachineError(error, \"SMNotFoundError\");\n};\n\nexport const isUnexpectedDataError = (\n\terror: unknown,\n): error is ShallowSliceMachineError<\"SMUnexpectedDataError\"> => {\n\treturn isSliceMachineError(error, \"SMUnexpectedDataError\");\n};\n\nexport const isInternalError = (\n\terror: unknown,\n): error is ShallowSliceMachineError<\"SMInternalError\"> => {\n\treturn isSliceMachineError(error, \"SMInternalError\");\n};\n\nexport const isPluginError = (\n\terror: unknown,\n): error is ShallowSliceMachineError<\"SMPluginError\"> => {\n\treturn isSliceMachineError(error, \"SMPluginError\");\n};\n\nexport const isInvalidActiveEnvironmentError = (\n\terror: unknown,\n): error is ShallowSliceMachineError<\"SMInvalidActiveEnvironmentError\"> => {\n\treturn isSliceMachineError(error, \"SMInvalidActiveEnvironmentError\");\n};\n\nexport const isUnsupportedError = (\n\terror: unknown,\n): error is ShallowSliceMachineError<\"SMUnsupportedError\"> => {\n\treturn isSliceMachineError(error, \"SMUnsupportedError\");\n};\n"],"names":[],"mappings":";;;AAEM,MAAO,0BAA0B,MAAK;AAAA,EAAtC;AAAA;AACL,gCAAO;AAAA;AACP;AACK,MAAO,0BAA0B,kBAAiB;AAAA,EAAlD;AAAA;AACL,gCAAO;AAAA;AACP;AACK,MAAO,6BAA6B,kBAAiB;AAAA,EAArD;AAAA;AACL,gCAAO;AACP,mCAAU;AAAA;AACV;AACK,MAAO,sBAAsB,kBAAiB;AAAA,EAA9C;AAAA;AACL,gCAAO;AAAA;AACP;AACK,MAAO,4BAA4B,kBAAiB;AAAA,EAApD;AAAA;AACL,gCAAO;AAAA;AACP;AACK,MAAO,sBAAsB,kBAAiB;AAAA,EAA9C;AAAA;AACL,gCAAO;AAAA;AACP;AACK,MAAO,oBAAoB,kBAAiB;AAAA,EAA5C;AAAA;AACL,gCAAO;AAAA;AACP;AACK,MAAO,8BAA8B,kBAAiB;AAAA,EAG3D,YAAY,QAAmB;AAC9B,UACC,GAAG,OAAO,MAAM,SACf,OAAO,WAAW,IAAI,KAAK,GAC5B,0CACA;AAAA,MACC,OAAO;AAAA,IAAA,CACP;AATH,gCAAO;AAAA,EAWP;AACA;AACK,MAAO,sCAAsC,kBAAiB;AAAA,EAA9D;AAAA;AACL,gCAAO;AAAA;AACP;AACK,MAAO,yBAAyB,kBAAiB;AAAA,EAAjD;AAAA;AACL,gCAAO;AAAA;AACP;
|
|
1
|
+
{"version":3,"file":"errors.js","sources":["../../src/errors.ts"],"sourcesContent":["import { HookError } from \"@slicemachine/plugin-kit\";\n\nexport class SliceMachineError extends Error {\n\tname = \"SMSliceMachineError\";\n}\nexport class UnauthorizedError extends SliceMachineError {\n\tname = \"SMUnauthorizedError\" as const;\n}\nexport class UnauthenticatedError extends SliceMachineError {\n\tname = \"SMUnauthenticatedError\" as const;\n\tmessage = \"Authenticate before trying again.\";\n}\nexport class NotFoundError extends SliceMachineError {\n\tname = \"SMNotFoundError\" as const;\n}\nexport class UnexpectedDataError extends SliceMachineError {\n\tname = \"SMUnexpectedDataError\" as const;\n}\nexport class InternalError extends SliceMachineError {\n\tname = \"SMInternalError\" as const;\n}\nexport class PluginError extends SliceMachineError {\n\tname = \"SMPluginError\" as const;\n}\nexport class PluginHookResultError extends SliceMachineError {\n\tname = \"SMPluginHookResultError\" as const;\n\n\tconstructor(errors: HookError[]) {\n\t\tsuper(\n\t\t\t`${errors.length} error${\n\t\t\t\terrors.length === 1 ? \"\" : \"s\"\n\t\t\t} were returned by one or more plugins.`,\n\t\t\t{\n\t\t\t\tcause: errors,\n\t\t\t},\n\t\t);\n\t}\n}\nexport class InvalidActiveEnvironmentError extends SliceMachineError {\n\tname = \"SMInvalidActiveEnvironmentError\" as const;\n}\nexport class UnsupportedError extends SliceMachineError {\n\tname = \"SMUnsupportedError\" as const;\n}\n\nexport class InferSliceAbortError extends SliceMachineError {\n\tname = \"SMInferSliceAbortError\" as const;\n}\n\ntype SliceMachineErrorNames =\n\t| \"SMSliceMachineError\"\n\t| UnauthorizedError[\"name\"]\n\t| UnauthenticatedError[\"name\"]\n\t| NotFoundError[\"name\"]\n\t| UnexpectedDataError[\"name\"]\n\t| InternalError[\"name\"]\n\t| PluginError[\"name\"]\n\t| PluginHookResultError[\"name\"]\n\t| InvalidActiveEnvironmentError[\"name\"]\n\t| UnsupportedError[\"name\"]\n\t| InferSliceAbortError[\"name\"];\n\ntype ShallowSliceMachineError<TName extends SliceMachineErrorNames> = Error & {\n\tname: TName;\n};\n\nexport const isSliceMachineError = <TName extends SliceMachineErrorNames>(\n\terror: unknown,\n\tname?: TName,\n): error is TName extends string ? ShallowSliceMachineError<TName> : Error => {\n\tconst isErrorInstance = error instanceof Error;\n\n\treturn name === undefined\n\t\t? isErrorInstance && error.name.startsWith(\"SM\")\n\t\t: isErrorInstance && error.name === name;\n};\n\nexport const isUnauthorizedError = (\n\terror: unknown,\n): error is ShallowSliceMachineError<\"SMUnauthorizedError\"> => {\n\treturn isSliceMachineError(error, \"SMUnauthorizedError\");\n};\n\nexport const isUnauthenticatedError = (\n\terror: unknown,\n): error is ShallowSliceMachineError<\"SMUnauthenticatedError\"> => {\n\treturn isSliceMachineError(error, \"SMUnauthenticatedError\");\n};\n\nexport const isNotFoundError = (\n\terror: unknown,\n): error is ShallowSliceMachineError<\"SMNotFoundError\"> => {\n\treturn isSliceMachineError(error, \"SMNotFoundError\");\n};\n\nexport const isUnexpectedDataError = (\n\terror: unknown,\n): error is ShallowSliceMachineError<\"SMUnexpectedDataError\"> => {\n\treturn isSliceMachineError(error, \"SMUnexpectedDataError\");\n};\n\nexport const isInternalError = (\n\terror: unknown,\n): error is ShallowSliceMachineError<\"SMInternalError\"> => {\n\treturn isSliceMachineError(error, \"SMInternalError\");\n};\n\nexport const isPluginError = (\n\terror: unknown,\n): error is ShallowSliceMachineError<\"SMPluginError\"> => {\n\treturn isSliceMachineError(error, \"SMPluginError\");\n};\n\nexport const isInvalidActiveEnvironmentError = (\n\terror: unknown,\n): error is ShallowSliceMachineError<\"SMInvalidActiveEnvironmentError\"> => {\n\treturn isSliceMachineError(error, \"SMInvalidActiveEnvironmentError\");\n};\n\nexport const isUnsupportedError = (\n\terror: unknown,\n): error is ShallowSliceMachineError<\"SMUnsupportedError\"> => {\n\treturn isSliceMachineError(error, \"SMUnsupportedError\");\n};\n\nexport const isInferSliceAbortError = (\n\terror: unknown,\n): error is ShallowSliceMachineError<\"SMInferSliceAbortError\"> => {\n\treturn isSliceMachineError(error, \"SMInferSliceAbortError\");\n};\n"],"names":[],"mappings":";;;AAEM,MAAO,0BAA0B,MAAK;AAAA,EAAtC;AAAA;AACL,gCAAO;AAAA;AACP;AACK,MAAO,0BAA0B,kBAAiB;AAAA,EAAlD;AAAA;AACL,gCAAO;AAAA;AACP;AACK,MAAO,6BAA6B,kBAAiB;AAAA,EAArD;AAAA;AACL,gCAAO;AACP,mCAAU;AAAA;AACV;AACK,MAAO,sBAAsB,kBAAiB;AAAA,EAA9C;AAAA;AACL,gCAAO;AAAA;AACP;AACK,MAAO,4BAA4B,kBAAiB;AAAA,EAApD;AAAA;AACL,gCAAO;AAAA;AACP;AACK,MAAO,sBAAsB,kBAAiB;AAAA,EAA9C;AAAA;AACL,gCAAO;AAAA;AACP;AACK,MAAO,oBAAoB,kBAAiB;AAAA,EAA5C;AAAA;AACL,gCAAO;AAAA;AACP;AACK,MAAO,8BAA8B,kBAAiB;AAAA,EAG3D,YAAY,QAAmB;AAC9B,UACC,GAAG,OAAO,MAAM,SACf,OAAO,WAAW,IAAI,KAAK,GAC5B,0CACA;AAAA,MACC,OAAO;AAAA,IAAA,CACP;AATH,gCAAO;AAAA,EAWP;AACA;AACK,MAAO,sCAAsC,kBAAiB;AAAA,EAA9D;AAAA;AACL,gCAAO;AAAA;AACP;AACK,MAAO,yBAAyB,kBAAiB;AAAA,EAAjD;AAAA;AACL,gCAAO;AAAA;AACP;AAEK,MAAO,6BAA6B,kBAAiB;AAAA,EAArD;AAAA;AACL,gCAAO;AAAA;AACP;AAmBM,MAAM,sBAAsB,CAClC,OACA,SAC4E;AAC5E,QAAM,kBAAkB,iBAAiB;AAEzC,SAAO,SAAS,SACb,mBAAmB,MAAM,KAAK,WAAW,IAAI,IAC7C,mBAAmB,MAAM,SAAS;AACtC;AAEO,MAAM,sBAAsB,CAClC,UAC6D;AAC7D,SAAO,oBAAoB,OAAO,qBAAqB;AACxD;AAEO,MAAM,yBAAyB,CACrC,UACgE;AAChE,SAAO,oBAAoB,OAAO,wBAAwB;AAC3D;AAEO,MAAM,kBAAkB,CAC9B,UACyD;AACzD,SAAO,oBAAoB,OAAO,iBAAiB;AACpD;AAEO,MAAM,wBAAwB,CACpC,UAC+D;AAC/D,SAAO,oBAAoB,OAAO,uBAAuB;AAC1D;AAEO,MAAM,kBAAkB,CAC9B,UACyD;AACzD,SAAO,oBAAoB,OAAO,iBAAiB;AACpD;AAEO,MAAM,gBAAgB,CAC5B,UACuD;AACvD,SAAO,oBAAoB,OAAO,eAAe;AAClD;AAEO,MAAM,kCAAkC,CAC9C,UACyE;AACzE,SAAO,oBAAoB,OAAO,iCAAiC;AACpE;AAEO,MAAM,qBAAqB,CACjC,UAC4D;AAC5D,SAAO,oBAAoB,OAAO,oBAAoB;AACvD;"}
|
package/dist/index.cjs
CHANGED
|
@@ -12,6 +12,7 @@ exports.createSliceMachineManager = createSliceMachineManager.createSliceMachine
|
|
|
12
12
|
exports.createSliceMachineManagerMiddleware = createSliceMachineManagerMiddleware.createSliceMachineManagerMiddleware;
|
|
13
13
|
exports.createPrismicAuthManager = createPrismicAuthManager.createPrismicAuthManager;
|
|
14
14
|
exports.createPrismicAuthManagerMiddleware = createPrismicAuthManagerMiddleware.createPrismicAuthManagerMiddleware;
|
|
15
|
+
exports.InferSliceAbortError = errors.InferSliceAbortError;
|
|
15
16
|
exports.InternalError = errors.InternalError;
|
|
16
17
|
exports.InvalidActiveEnvironmentError = errors.InvalidActiveEnvironmentError;
|
|
17
18
|
exports.NotFoundError = errors.NotFoundError;
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export type { PrismicAuthManager, PrismicUserProfile, PrismicAuthState, } from "
|
|
|
9
9
|
export { createPrismicAuthManager } from "./auth/createPrismicAuthManager";
|
|
10
10
|
export { createPrismicAuthManagerMiddleware } from "./auth/createPrismicAuthManagerMiddleware";
|
|
11
11
|
export type { CreatePrismicAuthManagerMiddlewareArgs, PrismicAuthCheckStatusResponse, } from "./auth/createPrismicAuthManagerMiddleware";
|
|
12
|
-
export { SliceMachineError, UnauthorizedError, UnauthenticatedError, NotFoundError, UnexpectedDataError, InternalError, PluginError, PluginHookResultError, InvalidActiveEnvironmentError, UnsupportedError, } from "./errors";
|
|
12
|
+
export { SliceMachineError, UnauthorizedError, UnauthenticatedError, NotFoundError, UnexpectedDataError, InternalError, PluginError, PluginHookResultError, InvalidActiveEnvironmentError, UnsupportedError, InferSliceAbortError, } from "./errors";
|
|
13
13
|
export { getEnvironmentInfo } from "./getEnvironmentInfo";
|
|
14
14
|
export { DecodeError } from "./lib/DecodeError";
|
|
15
15
|
export type { SliceMachineConfig, PackageManager } from "./types";
|
package/dist/index.js
CHANGED
|
@@ -2,12 +2,13 @@ import { createSliceMachineManager } from "./managers/createSliceMachineManager.
|
|
|
2
2
|
import { createSliceMachineManagerMiddleware } from "./managers/createSliceMachineManagerMiddleware.js";
|
|
3
3
|
import { createPrismicAuthManager } from "./auth/createPrismicAuthManager.js";
|
|
4
4
|
import { createPrismicAuthManagerMiddleware } from "./auth/createPrismicAuthManagerMiddleware.js";
|
|
5
|
-
import { InternalError, InvalidActiveEnvironmentError, NotFoundError, PluginError, PluginHookResultError, SliceMachineError, UnauthenticatedError, UnauthorizedError, UnexpectedDataError, UnsupportedError } from "./errors.js";
|
|
5
|
+
import { InferSliceAbortError, InternalError, InvalidActiveEnvironmentError, NotFoundError, PluginError, PluginHookResultError, SliceMachineError, UnauthenticatedError, UnauthorizedError, UnexpectedDataError, UnsupportedError } from "./errors.js";
|
|
6
6
|
import { getEnvironmentInfo } from "./getEnvironmentInfo.js";
|
|
7
7
|
import { DecodeError } from "./lib/DecodeError.js";
|
|
8
8
|
import { REPOSITORY_NAME_VALIDATION } from "./constants/REPOSITORY_NAME_VALIDATION.js";
|
|
9
9
|
export {
|
|
10
10
|
DecodeError,
|
|
11
|
+
InferSliceAbortError,
|
|
11
12
|
InternalError,
|
|
12
13
|
InvalidActiveEnvironmentError,
|
|
13
14
|
NotFoundError,
|
|
@@ -20,7 +20,6 @@ const crypto = require("node:crypto");
|
|
|
20
20
|
const path = require("node:path");
|
|
21
21
|
const fs = require("node:fs/promises");
|
|
22
22
|
const claudeAgentSdk = require("@anthropic-ai/claude-agent-sdk");
|
|
23
|
-
const sentryErrorHandlers = require("../../lib/sentryErrorHandlers.cjs");
|
|
24
23
|
function _interopNamespaceDefault(e) {
|
|
25
24
|
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
26
25
|
if (e) {
|
|
@@ -324,6 +323,7 @@ class CustomTypesManager extends BaseManager.BaseManager {
|
|
|
324
323
|
this.inferSliceAbortControllers.set(requestId, abortController);
|
|
325
324
|
console.info(`inferSlice (${source}) started for request ${requestId}`);
|
|
326
325
|
const startTime = Date.now();
|
|
326
|
+
const claudeErrors = [];
|
|
327
327
|
try {
|
|
328
328
|
if (source === "figma") {
|
|
329
329
|
const { libraryID } = args;
|
|
@@ -333,7 +333,6 @@ class CustomTypesManager extends BaseManager.BaseManager {
|
|
|
333
333
|
}
|
|
334
334
|
const { llmProxyUrl } = index.default.object({ llmProxyUrl: index.default.string().url() }).parse(exp.payload);
|
|
335
335
|
let tmpDir;
|
|
336
|
-
const claudeErrors = [];
|
|
337
336
|
try {
|
|
338
337
|
const config = await this.project.getSliceMachineConfig();
|
|
339
338
|
let framework;
|
|
@@ -578,7 +577,11 @@ x-prismic-repository: ${repository}
|
|
|
578
577
|
case "result":
|
|
579
578
|
switch (query.subtype) {
|
|
580
579
|
case "success":
|
|
581
|
-
|
|
580
|
+
if (!query.is_error) {
|
|
581
|
+
newSliceAbsPath = (_a = query.result.match(/<new_slice_path>(.*)<\/new_slice_path>/s)) == null ? void 0 : _a[1];
|
|
582
|
+
} else {
|
|
583
|
+
claudeErrors.push(query.result);
|
|
584
|
+
}
|
|
582
585
|
break;
|
|
583
586
|
case "error_during_execution":
|
|
584
587
|
case "error_max_budget_usd":
|
|
@@ -608,9 +611,6 @@ x-prismic-repository: ${repository}
|
|
|
608
611
|
if (tmpDir && node_fs.existsSync(tmpDir)) {
|
|
609
612
|
await fs.rm(tmpDir, { recursive: true });
|
|
610
613
|
}
|
|
611
|
-
if (claudeErrors.length > 0) {
|
|
612
|
-
sentryErrorHandlers.trackSentryError(new Error(`inferSlice - Claude encountered errors for request ${requestId}`, { cause: { errors: claudeErrors } }));
|
|
613
|
-
}
|
|
614
614
|
}
|
|
615
615
|
} else {
|
|
616
616
|
const searchParams = new URLSearchParams({ repository });
|
|
@@ -629,8 +629,18 @@ x-prismic-repository: ${repository}
|
|
|
629
629
|
return InferSliceResponse.parse(json);
|
|
630
630
|
}
|
|
631
631
|
} catch (error) {
|
|
632
|
+
if (error instanceof claudeAgentSdk.AbortError || error instanceof Error && error.name === "AbortError") {
|
|
633
|
+
console.warn(`inferSlice (${source}) request ${requestId} was aborted`);
|
|
634
|
+
throw new errors.InferSliceAbortError();
|
|
635
|
+
}
|
|
632
636
|
console.error(`inferSlice (${source}) failed for request ${requestId}`, error);
|
|
633
|
-
throw
|
|
637
|
+
throw new Error(`inferSlice encountered errors`, {
|
|
638
|
+
cause: {
|
|
639
|
+
error,
|
|
640
|
+
...claudeErrors.length > 0 ? { claudeErrors } : {},
|
|
641
|
+
args
|
|
642
|
+
}
|
|
643
|
+
});
|
|
634
644
|
} finally {
|
|
635
645
|
this.inferSliceAbortControllers.delete(requestId);
|
|
636
646
|
clearTimeout(timeoutId);
|