every-plugin 0.8.4 → 0.8.5
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/_virtual/rolldown_runtime.cjs +1 -7
- package/dist/_virtual/rolldown_runtime.mjs +1 -7
- package/dist/build/rspack/dev-server-middleware.cjs.map +1 -1
- package/dist/build/rspack/dev-server-middleware.mjs.map +1 -1
- package/dist/build/rspack/index.cjs +7 -1
- package/dist/build/rspack/index.d.cts +2 -1
- package/dist/build/rspack/index.d.mts +2 -1
- package/dist/build/rspack/index.mjs +2 -1
- package/dist/build/rspack/module-federation.cjs +2 -33
- package/dist/build/rspack/module-federation.cjs.map +1 -1
- package/dist/build/rspack/module-federation.mjs +2 -33
- package/dist/build/rspack/module-federation.mjs.map +1 -1
- package/dist/build/rspack/plugin.cjs +2 -2
- package/dist/build/rspack/plugin.cjs.map +1 -1
- package/dist/build/rspack/plugin.d.cts.map +1 -1
- package/dist/build/rspack/plugin.d.mts.map +1 -1
- package/dist/build/rspack/plugin.mjs.map +1 -1
- package/dist/build/rspack/utils.cjs +2 -2
- package/dist/build/rspack/utils.cjs.map +1 -1
- package/dist/build/shared-deps.cjs +77 -0
- package/dist/build/shared-deps.cjs.map +1 -0
- package/dist/build/shared-deps.d.cts +16 -0
- package/dist/build/shared-deps.d.cts.map +1 -0
- package/dist/build/shared-deps.d.mts +16 -0
- package/dist/build/shared-deps.d.mts.map +1 -0
- package/dist/build/shared-deps.mjs +73 -0
- package/dist/build/shared-deps.mjs.map +1 -0
- package/dist/errors.d.cts.map +1 -1
- package/dist/errors.d.mts.map +1 -1
- package/dist/orpc.cjs +15 -15
- package/dist/package.cjs +27 -9
- package/dist/package.cjs.map +1 -1
- package/dist/package.mjs +22 -10
- package/dist/package.mjs.map +1 -1
- package/dist/plugin.cjs +5 -5
- package/dist/plugin.cjs.map +1 -1
- package/dist/plugin.d.cts +5 -5
- package/dist/plugin.d.cts.map +1 -1
- package/dist/plugin.d.mts +5 -5
- package/dist/plugin.d.mts.map +1 -1
- package/dist/plugin.mjs.map +1 -1
- package/dist/runtime/errors.cjs +5 -5
- package/dist/runtime/errors.cjs.map +1 -1
- package/dist/runtime/errors.d.cts.map +1 -1
- package/dist/runtime/errors.d.mts.map +1 -1
- package/dist/runtime/errors.mjs.map +1 -1
- package/dist/runtime/index.cjs +2 -2
- package/dist/runtime/index.cjs.map +1 -1
- package/dist/runtime/index.d.cts.map +1 -1
- package/dist/runtime/index.d.mts.map +1 -1
- package/dist/runtime/index.mjs.map +1 -1
- package/dist/runtime/services/module-federation.service.cjs +11 -14
- package/dist/runtime/services/module-federation.service.cjs.map +1 -1
- package/dist/runtime/services/module-federation.service.d.cts.map +1 -1
- package/dist/runtime/services/module-federation.service.d.mts.map +1 -1
- package/dist/runtime/services/module-federation.service.mjs +6 -9
- package/dist/runtime/services/module-federation.service.mjs.map +1 -1
- package/dist/runtime/services/normalize.d.cts.map +1 -1
- package/dist/runtime/services/normalize.d.mts.map +1 -1
- package/dist/runtime/services/plugin-lifecycle.service.d.cts.map +1 -1
- package/dist/runtime/services/plugin-lifecycle.service.d.mts.map +1 -1
- package/dist/runtime/services/plugin-loader.service.d.cts.map +1 -1
- package/dist/runtime/services/plugin-loader.service.d.mts.map +1 -1
- package/dist/runtime/services/plugin.service.d.cts.map +1 -1
- package/dist/runtime/services/plugin.service.d.mts.map +1 -1
- package/dist/runtime/services/secrets.service.cjs.map +1 -1
- package/dist/runtime/services/secrets.service.d.cts.map +1 -1
- package/dist/runtime/services/secrets.service.d.mts.map +1 -1
- package/dist/runtime/services/secrets.service.mjs.map +1 -1
- package/dist/testing/index.cjs.map +1 -1
- package/dist/testing/index.d.cts.map +1 -1
- package/dist/testing/index.d.mts.map +1 -1
- package/dist/testing/index.mjs.map +1 -1
- package/dist/types.d.cts +26 -27
- package/dist/types.d.cts.map +1 -1
- package/dist/types.d.mts +26 -27
- package/dist/types.d.mts.map +1 -1
- package/dist/zod.d.cts.map +1 -1
- package/dist/zod.d.mts.map +1 -1
- package/package.json +54 -24
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { dependencies, sharedDependencies, version } from "../package.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/build/shared-deps.ts
|
|
4
|
+
const uiDeps = sharedDependencies.ui;
|
|
5
|
+
function getPluginSharedDependencies() {
|
|
6
|
+
return {
|
|
7
|
+
"every-plugin": {
|
|
8
|
+
version,
|
|
9
|
+
singleton: true,
|
|
10
|
+
strictVersion: false,
|
|
11
|
+
eager: false
|
|
12
|
+
},
|
|
13
|
+
effect: {
|
|
14
|
+
version: dependencies.effect,
|
|
15
|
+
singleton: true,
|
|
16
|
+
strictVersion: false,
|
|
17
|
+
eager: false
|
|
18
|
+
},
|
|
19
|
+
zod: {
|
|
20
|
+
version: dependencies.zod,
|
|
21
|
+
singleton: true,
|
|
22
|
+
strictVersion: false,
|
|
23
|
+
eager: false
|
|
24
|
+
},
|
|
25
|
+
"@orpc/contract": {
|
|
26
|
+
version: dependencies["@orpc/contract"],
|
|
27
|
+
singleton: true,
|
|
28
|
+
strictVersion: false,
|
|
29
|
+
eager: false
|
|
30
|
+
},
|
|
31
|
+
"@orpc/server": {
|
|
32
|
+
version: dependencies["@orpc/server"],
|
|
33
|
+
singleton: true,
|
|
34
|
+
strictVersion: false,
|
|
35
|
+
eager: false
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
function getUISharedDependencies() {
|
|
40
|
+
if (!uiDeps) return {};
|
|
41
|
+
const result = {};
|
|
42
|
+
for (const [name, version$1] of Object.entries(uiDeps)) result[name] = {
|
|
43
|
+
version: version$1,
|
|
44
|
+
singleton: true,
|
|
45
|
+
strictVersion: false,
|
|
46
|
+
eager: name === "react" || name === "react-dom"
|
|
47
|
+
};
|
|
48
|
+
return result;
|
|
49
|
+
}
|
|
50
|
+
function getHostSharedDependencies() {
|
|
51
|
+
return {
|
|
52
|
+
...getPluginSharedDependencies(),
|
|
53
|
+
...getUISharedDependencies()
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
function getMajorMinorVersion(version$1) {
|
|
57
|
+
const match = version$1.replace(/^[\^~>=<]+/, "").match(/^(\d+)\.(\d+)/);
|
|
58
|
+
if (!match) return "^0.0.0";
|
|
59
|
+
return `^${match[1]}.${match[2]}.0`;
|
|
60
|
+
}
|
|
61
|
+
function getPluginSharedDependenciesVersionRange() {
|
|
62
|
+
const deps = getPluginSharedDependencies();
|
|
63
|
+
const result = {};
|
|
64
|
+
for (const [key, config] of Object.entries(deps)) result[key] = {
|
|
65
|
+
...config,
|
|
66
|
+
version: getMajorMinorVersion(config.version)
|
|
67
|
+
};
|
|
68
|
+
return result;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
//#endregion
|
|
72
|
+
export { getHostSharedDependencies, getMajorMinorVersion, getPluginSharedDependencies, getPluginSharedDependenciesVersionRange, getUISharedDependencies };
|
|
73
|
+
//# sourceMappingURL=shared-deps.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared-deps.mjs","names":["pkg.version","version"],"sources":["../../src/build/shared-deps.ts"],"sourcesContent":["import pkg from \"../../package.json\";\n\nexport interface SharedDependencyConfig {\n version: string;\n singleton: boolean;\n strictVersion: boolean;\n eager: boolean;\n}\n\nexport type SharedDependencies = Record<string, SharedDependencyConfig>;\n\nconst uiDeps = (pkg as any).sharedDependencies?.ui as Record<string, string> | undefined;\n\nexport function getPluginSharedDependencies(): SharedDependencies {\n return {\n \"every-plugin\": {\n version: pkg.version,\n singleton: true,\n strictVersion: false,\n eager: false,\n },\n effect: {\n version: pkg.dependencies.effect,\n singleton: true,\n strictVersion: false,\n eager: false,\n },\n zod: {\n version: pkg.dependencies.zod,\n singleton: true,\n strictVersion: false,\n eager: false,\n },\n \"@orpc/contract\": {\n version: pkg.dependencies[\"@orpc/contract\"],\n singleton: true,\n strictVersion: false,\n eager: false,\n },\n \"@orpc/server\": {\n version: pkg.dependencies[\"@orpc/server\"],\n singleton: true,\n strictVersion: false,\n eager: false,\n },\n };\n}\n\nexport function getUISharedDependencies(): SharedDependencies {\n if (!uiDeps) return {};\n \n const result: SharedDependencies = {};\n for (const [name, version] of Object.entries(uiDeps)) {\n result[name] = {\n version,\n singleton: true,\n strictVersion: false,\n eager: name === \"react\" || name === \"react-dom\",\n };\n }\n return result;\n}\n\nexport function getHostSharedDependencies(): SharedDependencies {\n return {\n ...getPluginSharedDependencies(),\n ...getUISharedDependencies(),\n };\n}\n\nexport function getMajorMinorVersion(version: string): string {\n const clean = version.replace(/^[\\^~>=<]+/, \"\");\n const match = clean.match(/^(\\d+)\\.(\\d+)/);\n if (!match) return \"^0.0.0\";\n return `^${match[1]}.${match[2]}.0`;\n}\n\nexport function getPluginSharedDependenciesVersionRange(): SharedDependencies {\n const deps = getPluginSharedDependencies();\n const result: SharedDependencies = {};\n \n for (const [key, config] of Object.entries(deps)) {\n result[key] = {\n ...config,\n version: getMajorMinorVersion(config.version),\n };\n }\n \n return result;\n}\n"],"mappings":";;;AAWA,MAAM,4BAA0C;AAEhD,SAAgB,8BAAkD;AAChE,QAAO;EACL,gBAAgB;GACLA;GACT,WAAW;GACX,eAAe;GACf,OAAO;GACR;EACD,QAAQ;GACN,sBAA0B;GAC1B,WAAW;GACX,eAAe;GACf,OAAO;GACR;EACD,KAAK;GACH,sBAA0B;GAC1B,WAAW;GACX,eAAe;GACf,OAAO;GACR;EACD,kBAAkB;GAChB,sBAA0B;GAC1B,WAAW;GACX,eAAe;GACf,OAAO;GACR;EACD,gBAAgB;GACd,sBAA0B;GAC1B,WAAW;GACX,eAAe;GACf,OAAO;GACR;EACF;;AAGH,SAAgB,0BAA8C;AAC5D,KAAI,CAAC,OAAQ,QAAO,EAAE;CAEtB,MAAM,SAA6B,EAAE;AACrC,MAAK,MAAM,CAAC,MAAMC,cAAY,OAAO,QAAQ,OAAO,CAClD,QAAO,QAAQ;EACb;EACA,WAAW;EACX,eAAe;EACf,OAAO,SAAS,WAAW,SAAS;EACrC;AAEH,QAAO;;AAGT,SAAgB,4BAAgD;AAC9D,QAAO;EACL,GAAG,6BAA6B;EAChC,GAAG,yBAAyB;EAC7B;;AAGH,SAAgB,qBAAqB,WAAyB;CAE5D,MAAM,QADQA,UAAQ,QAAQ,cAAc,GAAG,CAC3B,MAAM,gBAAgB;AAC1C,KAAI,CAAC,MAAO,QAAO;AACnB,QAAO,IAAI,MAAM,GAAG,GAAG,MAAM,GAAG;;AAGlC,SAAgB,0CAA8D;CAC5E,MAAM,OAAO,6BAA6B;CAC1C,MAAM,SAA6B,EAAE;AAErC,MAAK,MAAM,CAAC,KAAK,WAAW,OAAO,QAAQ,KAAK,CAC9C,QAAO,OAAO;EACZ,GAAG;EACH,SAAS,qBAAqB,OAAO,QAAQ;EAC9C;AAGH,QAAO"}
|
package/dist/errors.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.cts","names":[],"sources":["../src/errors.ts"],"
|
|
1
|
+
{"version":3,"file":"errors.d.cts","names":[],"sources":["../src/errors.ts"],"mappings":";;;;;AAKA;AA0BA;cA1Ba,cAAA;EAAA,SAAA,kBAAA;EAAA,SAAA,cAAA;EAAA,SAAA,OAAA;EAAA,SAAA,gBAAA;EAAA,SAAA,UAAA;EAAA,SAAA,IAAA;EAAA,SAAA,YAAA;EAAA,SAAA,mBAAA;AAAA;AAAA;AA0Bb;;;;;;;;;AASA;;;;AAnCa,cA0BA,YAAA;EAAA,SAAA,MAAA;EAAA,SAAA,IAAA;;;;;;;;;;cASA,YAAA;EAAA,SAAA,MAAA;EAAA,SAAA,IAAA;;;;;;;;;;;cAUA,mBAAA;EAAA,SAAA,MAAA;EAAA,SAAA,IAAA;;;;;;cASA,WAAA;EAAA,SAAA,MAAA;EAAA,SAAA,IAAA;;;;;;;;;cAYA,SAAA;EAAA,SAAA,MAAA;EAAA,SAAA,IAAA;;;;;cAQA,SAAA;EAAA,SAAA,MAAA;EAAA,SAAA,IAAA;;;;;cAQA,OAAA;EAAA,SAAA,MAAA;EAAA,SAAA,IAAA;;;;;;cASA,gBAAA;EAAA,SAAA,MAAA;EAAA,SAAA,IAAA;;;;;;;;;;AAcb;cAAa,YAAA;EAAA,SAAA,YAAA;IAAA,SAAA,MAAA;IAAA,SAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAcA,kBAAA;EAAA,SAAA,YAAA;IAAA,SAAA,MAAA;IAAA,SAAA,IAAA"}
|
package/dist/errors.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.mts","names":[],"sources":["../src/errors.ts"],"
|
|
1
|
+
{"version":3,"file":"errors.d.mts","names":[],"sources":["../src/errors.ts"],"mappings":";;;;;AAKA;AA0BA;cA1Ba,cAAA;EAAA,SAAA,kBAAA;EAAA,SAAA,cAAA;EAAA,SAAA,OAAA;EAAA,SAAA,gBAAA;EAAA,SAAA,UAAA;EAAA,SAAA,IAAA;EAAA,SAAA,YAAA;EAAA,SAAA,mBAAA;AAAA;AAAA;AA0Bb;;;;;;;;;AASA;;;;AAnCa,cA0BA,YAAA;EAAA,SAAA,MAAA;EAAA,SAAA,IAAA;;;;;;;;;;cASA,YAAA;EAAA,SAAA,MAAA;EAAA,SAAA,IAAA;;;;;;;;;;;cAUA,mBAAA;EAAA,SAAA,MAAA;EAAA,SAAA,IAAA;;;;;;cASA,WAAA;EAAA,SAAA,MAAA;EAAA,SAAA,IAAA;;;;;;;;;cAYA,SAAA;EAAA,SAAA,MAAA;EAAA,SAAA,IAAA;;;;;cAQA,SAAA;EAAA,SAAA,MAAA;EAAA,SAAA,IAAA;;;;;cAQA,OAAA;EAAA,SAAA,MAAA;EAAA,SAAA,IAAA;;;;;;cASA,gBAAA;EAAA,SAAA,MAAA;EAAA,SAAA,IAAA;;;;;;;;;;AAcb;cAAa,YAAA;EAAA,SAAA,YAAA;IAAA,SAAA,MAAA;IAAA,SAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAcA,kBAAA;EAAA,SAAA,YAAA;IAAA,SAAA,MAAA;IAAA,SAAA,IAAA"}
|
package/dist/orpc.cjs
CHANGED
|
@@ -1,46 +1,46 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
|
|
2
|
-
let
|
|
3
|
-
let
|
|
4
|
-
let
|
|
2
|
+
let _orpc_experimental_publisher_ioredis = require("@orpc/experimental-publisher/ioredis");
|
|
3
|
+
let _orpc_experimental_publisher_memory = require("@orpc/experimental-publisher/memory");
|
|
4
|
+
let _orpc_experimental_publisher_upstash_redis = require("@orpc/experimental-publisher/upstash-redis");
|
|
5
5
|
|
|
6
6
|
Object.defineProperty(exports, 'IORedisPublisher', {
|
|
7
7
|
enumerable: true,
|
|
8
8
|
get: function () {
|
|
9
|
-
return
|
|
9
|
+
return _orpc_experimental_publisher_ioredis.IORedisPublisher;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, 'MemoryPublisher', {
|
|
13
13
|
enumerable: true,
|
|
14
14
|
get: function () {
|
|
15
|
-
return
|
|
15
|
+
return _orpc_experimental_publisher_memory.MemoryPublisher;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
18
|
Object.defineProperty(exports, 'UpstashRedisPublisher', {
|
|
19
19
|
enumerable: true,
|
|
20
20
|
get: function () {
|
|
21
|
-
return
|
|
21
|
+
return _orpc_experimental_publisher_upstash_redis.UpstashRedisPublisher;
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
|
-
var
|
|
25
|
-
Object.keys(
|
|
24
|
+
var _orpc_contract = require("@orpc/contract");
|
|
25
|
+
Object.keys(_orpc_contract).forEach(function (k) {
|
|
26
26
|
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
27
27
|
enumerable: true,
|
|
28
|
-
get: function () { return
|
|
28
|
+
get: function () { return _orpc_contract[k]; }
|
|
29
29
|
});
|
|
30
30
|
});
|
|
31
31
|
|
|
32
|
-
var
|
|
33
|
-
Object.keys(
|
|
32
|
+
var _orpc_server = require("@orpc/server");
|
|
33
|
+
Object.keys(_orpc_server).forEach(function (k) {
|
|
34
34
|
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
35
35
|
enumerable: true,
|
|
36
|
-
get: function () { return
|
|
36
|
+
get: function () { return _orpc_server[k]; }
|
|
37
37
|
});
|
|
38
38
|
});
|
|
39
39
|
|
|
40
|
-
var
|
|
41
|
-
Object.keys(
|
|
40
|
+
var _orpc_experimental_publisher = require("@orpc/experimental-publisher");
|
|
41
|
+
Object.keys(_orpc_experimental_publisher).forEach(function (k) {
|
|
42
42
|
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
43
43
|
enumerable: true,
|
|
44
|
-
get: function () { return
|
|
44
|
+
get: function () { return _orpc_experimental_publisher[k]; }
|
|
45
45
|
});
|
|
46
46
|
});
|
package/dist/package.cjs
CHANGED
|
@@ -2,16 +2,28 @@
|
|
|
2
2
|
//#region package.json
|
|
3
3
|
var version = "0.8.4";
|
|
4
4
|
var dependencies = {
|
|
5
|
-
"@module-federation/enhanced": "^0.
|
|
6
|
-
"@module-federation/node": "^2.7.
|
|
7
|
-
"@module-federation/runtime-core": "^0.
|
|
8
|
-
"@orpc/
|
|
9
|
-
"@orpc/
|
|
10
|
-
"@orpc/
|
|
11
|
-
"@orpc/
|
|
12
|
-
"
|
|
13
|
-
"
|
|
5
|
+
"@module-federation/enhanced": "^0.22.1",
|
|
6
|
+
"@module-federation/node": "^2.7.27",
|
|
7
|
+
"@module-federation/runtime-core": "^0.22.1",
|
|
8
|
+
"@orpc/client": "^1.12.3",
|
|
9
|
+
"@orpc/contract": "^1.13.4",
|
|
10
|
+
"@orpc/experimental-publisher": "^1.13.4",
|
|
11
|
+
"@orpc/openapi": "^1.12.3",
|
|
12
|
+
"@orpc/react-query": "^1.13.4",
|
|
13
|
+
"@orpc/server": "^1.13.4",
|
|
14
|
+
"@orpc/tanstack-query": "^1.13.4",
|
|
15
|
+
"@orpc/zod": "^1.13.4",
|
|
16
|
+
"effect": "3.19.14",
|
|
17
|
+
"zod": "4.3.5"
|
|
14
18
|
};
|
|
19
|
+
var sharedDependencies = { "ui": {
|
|
20
|
+
"react": "^19.2.0",
|
|
21
|
+
"react-dom": "^19.2.0",
|
|
22
|
+
"@tanstack/react-query": "^5.90.11",
|
|
23
|
+
"@tanstack/react-router": "^1.139.14",
|
|
24
|
+
"@hot-labs/near-connect": "^0.6.11",
|
|
25
|
+
"near-kit": "^0.7.0"
|
|
26
|
+
} };
|
|
15
27
|
|
|
16
28
|
//#endregion
|
|
17
29
|
Object.defineProperty(exports, 'dependencies', {
|
|
@@ -20,6 +32,12 @@ Object.defineProperty(exports, 'dependencies', {
|
|
|
20
32
|
return dependencies;
|
|
21
33
|
}
|
|
22
34
|
});
|
|
35
|
+
Object.defineProperty(exports, 'sharedDependencies', {
|
|
36
|
+
enumerable: true,
|
|
37
|
+
get: function () {
|
|
38
|
+
return sharedDependencies;
|
|
39
|
+
}
|
|
40
|
+
});
|
|
23
41
|
Object.defineProperty(exports, 'version', {
|
|
24
42
|
enumerable: true,
|
|
25
43
|
get: function () {
|
package/dist/package.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package.cjs","names":[],"sources":["../package.json"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"package.cjs","names":[],"sources":["../package.json"],"sourcesContent":[""],"mappings":""}
|
package/dist/package.mjs
CHANGED
|
@@ -1,17 +1,29 @@
|
|
|
1
1
|
//#region package.json
|
|
2
2
|
var version = "0.8.4";
|
|
3
3
|
var dependencies = {
|
|
4
|
-
"@module-federation/enhanced": "^0.
|
|
5
|
-
"@module-federation/node": "^2.7.
|
|
6
|
-
"@module-federation/runtime-core": "^0.
|
|
7
|
-
"@orpc/
|
|
8
|
-
"@orpc/
|
|
9
|
-
"@orpc/
|
|
10
|
-
"@orpc/
|
|
11
|
-
"
|
|
12
|
-
"
|
|
4
|
+
"@module-federation/enhanced": "^0.22.1",
|
|
5
|
+
"@module-federation/node": "^2.7.27",
|
|
6
|
+
"@module-federation/runtime-core": "^0.22.1",
|
|
7
|
+
"@orpc/client": "^1.12.3",
|
|
8
|
+
"@orpc/contract": "^1.13.4",
|
|
9
|
+
"@orpc/experimental-publisher": "^1.13.4",
|
|
10
|
+
"@orpc/openapi": "^1.12.3",
|
|
11
|
+
"@orpc/react-query": "^1.13.4",
|
|
12
|
+
"@orpc/server": "^1.13.4",
|
|
13
|
+
"@orpc/tanstack-query": "^1.13.4",
|
|
14
|
+
"@orpc/zod": "^1.13.4",
|
|
15
|
+
"effect": "3.19.14",
|
|
16
|
+
"zod": "4.3.5"
|
|
13
17
|
};
|
|
18
|
+
var sharedDependencies = { "ui": {
|
|
19
|
+
"react": "^19.2.0",
|
|
20
|
+
"react-dom": "^19.2.0",
|
|
21
|
+
"@tanstack/react-query": "^5.90.11",
|
|
22
|
+
"@tanstack/react-router": "^1.139.14",
|
|
23
|
+
"@hot-labs/near-connect": "^0.6.11",
|
|
24
|
+
"near-kit": "^0.7.0"
|
|
25
|
+
} };
|
|
14
26
|
|
|
15
27
|
//#endregion
|
|
16
|
-
export { dependencies, version };
|
|
28
|
+
export { dependencies, sharedDependencies, version };
|
|
17
29
|
//# sourceMappingURL=package.mjs.map
|
package/dist/package.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package.mjs","names":[],"sources":["../package.json"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"package.mjs","names":[],"sources":["../package.json"],"sourcesContent":[""],"mappings":""}
|
package/dist/plugin.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
|
|
2
2
|
const require_errors = require('./runtime/errors.cjs');
|
|
3
|
-
let
|
|
3
|
+
let _orpc_contract = require("@orpc/contract");
|
|
4
4
|
let effect = require("effect");
|
|
5
|
-
let
|
|
5
|
+
let _orpc_server = require("@orpc/server");
|
|
6
6
|
|
|
7
7
|
//#region src/plugin.ts
|
|
8
8
|
/**
|
|
@@ -32,12 +32,12 @@ function createPlugin(config) {
|
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
34
|
createRouter(deps) {
|
|
35
|
-
const base =
|
|
35
|
+
const base = _orpc_server.os.$context().use((0, _orpc_server.onError)((error) => {
|
|
36
36
|
const unwrapped = require_errors.extractFromFiberFailure(error);
|
|
37
|
-
if (unwrapped !== error && unwrapped instanceof
|
|
37
|
+
if (unwrapped !== error && unwrapped instanceof _orpc_contract.ORPCError) throw unwrapped;
|
|
38
38
|
require_errors.formatORPCError(error);
|
|
39
39
|
}));
|
|
40
|
-
const builder = (0,
|
|
40
|
+
const builder = (0, _orpc_server.implement)(config.contract, base);
|
|
41
41
|
return config.createRouter(deps, builder);
|
|
42
42
|
}
|
|
43
43
|
}
|
package/dist/plugin.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.cjs","names":["
|
|
1
|
+
{"version":3,"file":"plugin.cjs","names":["Effect","os","extractFromFiberFailure","ORPCError"],"sources":["../src/plugin.ts"],"sourcesContent":["import type { AnyContractRouter, AnySchema, InferSchemaOutput } from \"@orpc/contract\";\nimport type { Context, Implementer, Router } from \"@orpc/server\";\nimport { ORPCError } from \"@orpc/contract\";\nimport { implement, onError, os } from \"@orpc/server\";\nimport { Effect, type Scope } from \"effect\";\nimport { extractFromFiberFailure, formatORPCError } from \"./runtime/errors\";\n\ntype ContextOutput<T> = T extends AnySchema ? InferSchemaOutput<T> : {};\n\n/**\n * Helper type that correctly constructs the config schema type\n */\nexport type PluginConfigFor<V extends AnySchema, S extends AnySchema, TRequestContext extends AnySchema | undefined> = {\n\tvariables: V;\n\tsecrets: S;\n\tcontext: TRequestContext;\n};\n\n/**\n * Loaded plugin with static binding property\n */\nexport interface LoadedPluginWithBinding<\n\tTContract extends AnyContractRouter,\n\tTVariables extends AnySchema,\n\tTSecrets extends AnySchema,\n\tTRequestContext extends AnySchema | undefined,\n\tTDeps extends Context = Record<never, never>\n> {\n\tnew(): Plugin<TContract, TVariables, TSecrets, TRequestContext, TDeps>;\n\tbinding: {\n\t\tcontract: TContract;\n\t\tvariables: TVariables;\n\t\tsecrets: TSecrets;\n\t\tcontext: TRequestContext;\n\t};\n}\n\n/**\n * Plugin interface\n */\nexport interface Plugin<\n\tTContract extends AnyContractRouter,\n\tTVariables extends AnySchema,\n\tTSecrets extends AnySchema,\n\tTRequestContext extends AnySchema | undefined,\n\tTDeps extends Context = Record<never, never>\n> {\n\treadonly id: string;\n\treadonly contract: TContract;\n\treadonly configSchema: PluginConfigFor<TVariables, TSecrets, TRequestContext>;\n\n\t// Plugin lifecycle\n\tinitialize(\n\t\tconfig: { variables: InferSchemaOutput<TVariables>; secrets: InferSchemaOutput<TSecrets> }\n\t): Effect.Effect<TDeps, unknown, Scope.Scope>;\n\n\tshutdown(): Effect.Effect<void, never>;\n\n\t/**\n\t * Creates the strongly-typed oRPC router for this plugin.\n\t * The router's procedure types are inferred directly from the contract.\n\t * @param deps The initialized plugin dependencies\n\t * @returns A router with procedures matching the plugin's contract\n\t */\n\tcreateRouter(deps: TDeps): Router<TContract, any>;\n}\n\n/**\n * Factory function to create plugins\n */\nexport function createPlugin<\n\tV extends AnySchema,\n\tS extends AnySchema,\n\tTContract extends AnyContractRouter,\n\tTRequestContext extends AnySchema | undefined = undefined,\n\tTDeps extends Context = Record<never, never>\n>(config: {\n\tvariables: V;\n\tsecrets: S;\n\tcontract: TContract;\n\tcontext?: TRequestContext;\n\tinitialize?: (\n\t\tconfig: { variables: InferSchemaOutput<V>; secrets: InferSchemaOutput<S> }\n\t) => Effect.Effect<TDeps, Error, Scope.Scope>;\n\tcreateRouter: (\n\t\tdeps: TDeps,\n\t\tbuilder: Implementer<TContract, ContextOutput<TRequestContext>, ContextOutput<TRequestContext>>\n\t) => Router<TContract, any>;\n\tshutdown?: (deps: TDeps) => Effect.Effect<void, Error, never>;\n}) {\n\tconst configSchema: PluginConfigFor<V, S, TRequestContext> = {\n\t\tvariables: config.variables,\n\t\tsecrets: config.secrets,\n\t\tcontext: config.context as TRequestContext\n\t};\n\n\tclass CreatedPlugin implements Plugin<TContract, V, S, TRequestContext, TDeps> {\n\t\t/** set during instantiation - registry key */\n\t\tid!: string;\n\t\treadonly contract = config.contract;\n\t\treadonly configSchema = configSchema;\n\n\t\tprivate _deps: TDeps | null = null;\n\n\t\tinitialize(\n\t\t\tpluginConfig: { variables: InferSchemaOutput<V>; secrets: InferSchemaOutput<S> }\n\t\t): Effect.Effect<TDeps, unknown, Scope.Scope> {\n\t\t\tconst init = config.initialize ?? (() => Effect.succeed({} as TDeps));\n\n\t\t\treturn init(pluginConfig).pipe(\n\t\t\t\tEffect.tap((deps) => Effect.sync(() => { this._deps = deps; })),\n\t\t\t\tEffect.map(() => this._deps as TDeps),\n\t\t\t\tEffect.mapError((error) => error as unknown)\n\t\t\t);\n\t\t}\n\n\t\tshutdown(): Effect.Effect<void, never> {\n\t\t\tconst self = this;\n\t\t\treturn Effect.gen(function* () {\n\t\t\t\tif (config.shutdown && self._deps) {\n\t\t\t\t\tyield* config.shutdown(self._deps).pipe(\n\t\t\t\t\t\tEffect.catchAll(() => Effect.void)\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tcreateRouter(deps: TDeps): Router<TContract, any> {\n\t\t\tconst base = os\n\t\t\t\t.$context<ContextOutput<TRequestContext>>()\n\t\t\t\t.use(onError((error) => {\n\t\t\t\t\tconst unwrapped = extractFromFiberFailure(error);\n\t\t\t\t\t\n\t\t\t\t\tif (unwrapped !== error && unwrapped instanceof ORPCError) {\n\t\t\t\t\t\tthrow unwrapped;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tformatORPCError(error);\n\t\t\t\t}));\n\t\t\tconst builder = implement(config.contract, base);\n\t\t\tconst router = config.createRouter(deps, builder);\n\t\t\treturn router as Router<TContract, any>;\n\t\t}\n\t}\n\n\tconst PluginConstructor = CreatedPlugin as unknown as {\n\t\tnew(): Plugin<TContract, V, S, TRequestContext, TDeps>;\n\t\tbinding: {\n\t\t\tcontract: TContract;\n\t\t\tvariables: V;\n\t\t\tsecrets: S;\n\t\t\tcontext: TRequestContext;\n\t\t};\n\t};\n\n\tPluginConstructor.binding = {\n\t\tcontract: config.contract,\n\t\tvariables: config.variables,\n\t\tsecrets: config.secrets,\n\t\tcontext: config.context as TRequestContext\n\t};\n\n\treturn PluginConstructor as LoadedPluginWithBinding<TContract, V, S, TRequestContext, TDeps>;\n}\n"],"mappings":";;;;;;;;;;AAsEA,SAAgB,aAMd,QAaC;CACF,MAAM,eAAuD;EAC5D,WAAW,OAAO;EAClB,SAAS,OAAO;EAChB,SAAS,OAAO;EAChB;CAED,MAAM,cAAyE;;EAE9E;EACA,AAAS,WAAW,OAAO;EAC3B,AAAS,eAAe;EAExB,AAAQ,QAAsB;EAE9B,WACC,cAC6C;AAG7C,WAFa,OAAO,qBAAqBA,cAAO,QAAQ,EAAE,CAAU,GAExD,aAAa,CAAC,KACzBA,cAAO,KAAK,SAASA,cAAO,WAAW;AAAE,SAAK,QAAQ;KAAQ,CAAC,EAC/DA,cAAO,UAAU,KAAK,MAAe,EACrCA,cAAO,UAAU,UAAU,MAAiB,CAC5C;;EAGF,WAAuC;GACtC,MAAM,OAAO;AACb,UAAOA,cAAO,IAAI,aAAa;AAC9B,QAAI,OAAO,YAAY,KAAK,MAC3B,QAAO,OAAO,SAAS,KAAK,MAAM,CAAC,KAClCA,cAAO,eAAeA,cAAO,KAAK,CAClC;KAED;;EAGH,aAAa,MAAqC;GACjD,MAAM,OAAOC,gBACX,UAA0C,CAC1C,+BAAa,UAAU;IACvB,MAAM,YAAYC,uCAAwB,MAAM;AAEhD,QAAI,cAAc,SAAS,qBAAqBC,yBAC/C,OAAM;AAGP,mCAAgB,MAAM;KACrB,CAAC;GACJ,MAAM,sCAAoB,OAAO,UAAU,KAAK;AAEhD,UADe,OAAO,aAAa,MAAM,QAAQ;;;CAKnD,MAAM,oBAAoB;AAU1B,mBAAkB,UAAU;EAC3B,UAAU,OAAO;EACjB,WAAW,OAAO;EAClB,SAAS,OAAO;EAChB,SAAS,OAAO;EAChB;AAED,QAAO"}
|
package/dist/plugin.d.cts
CHANGED
|
@@ -37,11 +37,11 @@ interface Plugin<TContract extends AnyContractRouter, TVariables extends AnySche
|
|
|
37
37
|
}): Effect.Effect<TDeps, unknown, Scope.Scope>;
|
|
38
38
|
shutdown(): Effect.Effect<void, never>;
|
|
39
39
|
/**
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
40
|
+
* Creates the strongly-typed oRPC router for this plugin.
|
|
41
|
+
* The router's procedure types are inferred directly from the contract.
|
|
42
|
+
* @param deps The initialized plugin dependencies
|
|
43
|
+
* @returns A router with procedures matching the plugin's contract
|
|
44
|
+
*/
|
|
45
45
|
createRouter(deps: TDeps): Router<TContract, any>;
|
|
46
46
|
}
|
|
47
47
|
/**
|
package/dist/plugin.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.cts","names":[],"sources":["../src/plugin.ts"],"
|
|
1
|
+
{"version":3,"file":"plugin.d.cts","names":[],"sources":["../src/plugin.ts"],"mappings":";;;;;KAOK,aAAA,MAAmB,CAAA,SAAU,SAAA,GAAY,iBAAA,CAAkB,CAAA;AAAA;;;AAAA,KAKpD,eAAA,WAA0B,SAAA,YAAqB,SAAA,0BAAmC,SAAA;EAAA,SAAA,EAClF,CAAA;EAAA,OAAA,EACF,CAAA;EAAA,OAAA,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AAA,GAAA,IAAA,EAEhC,KAAA,EAAA,OAAA,EACG,WAAA,CAAY,SAAA,EAAW,aAAA,CAAc,eAAA,GAAkB,aAAA,CAAc,eAAA,OAC1E,MAAA,CAAO,SAAA;EAAA,QAAA,IAAA,IAAA,EACM,KAAA,KAAU,MAAA,CAAO,MAAA,OAAa,KAAA;AAAA,IA0EpB,uBAAA,CAAwB,SAAA,EAAW,CAAA,EAAG,CAAA,EAAG,eAAA,EAAiB,KAAA"}
|
package/dist/plugin.d.mts
CHANGED
|
@@ -37,11 +37,11 @@ interface Plugin<TContract extends AnyContractRouter, TVariables extends AnySche
|
|
|
37
37
|
}): Effect.Effect<TDeps, unknown, Scope.Scope>;
|
|
38
38
|
shutdown(): Effect.Effect<void, never>;
|
|
39
39
|
/**
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
40
|
+
* Creates the strongly-typed oRPC router for this plugin.
|
|
41
|
+
* The router's procedure types are inferred directly from the contract.
|
|
42
|
+
* @param deps The initialized plugin dependencies
|
|
43
|
+
* @returns A router with procedures matching the plugin's contract
|
|
44
|
+
*/
|
|
45
45
|
createRouter(deps: TDeps): Router<TContract, any>;
|
|
46
46
|
}
|
|
47
47
|
/**
|
package/dist/plugin.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.mts","names":[],"sources":["../src/plugin.ts"],"
|
|
1
|
+
{"version":3,"file":"plugin.d.mts","names":[],"sources":["../src/plugin.ts"],"mappings":";;;;;KAOK,aAAA,MAAmB,CAAA,SAAU,SAAA,GAAY,iBAAA,CAAkB,CAAA;AAAA;;;AAAA,KAKpD,eAAA,WAA0B,SAAA,YAAqB,SAAA,0BAAmC,SAAA;EAAA,SAAA,EAClF,CAAA;EAAA,OAAA,EACF,CAAA;EAAA,OAAA,EACA,eAAA;AAAA;AAAA;;AAMV;AANU,UAMO,uBAAA,mBACE,iBAAA,qBACC,SAAA,mBACF,SAAA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AAA,GAAkB,aAAA,CAAc,eAAA,OAC1E,MAAA,CAAO,SAAA;EAAA,QAAA,IAAA,IAAA,EACM,KAAA,KAAU,MAAA,CAAO,MAAA,OAAa,KAAA;AAAA,IA0EpB,uBAAA,CAAwB,SAAA,EAAW,CAAA,EAAG,CAAA,EAAG,eAAA,EAAiB,KAAA"}
|
package/dist/plugin.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.mjs","names":[
|
|
1
|
+
{"version":3,"file":"plugin.mjs","names":[],"sources":["../src/plugin.ts"],"sourcesContent":["import type { AnyContractRouter, AnySchema, InferSchemaOutput } from \"@orpc/contract\";\nimport type { Context, Implementer, Router } from \"@orpc/server\";\nimport { ORPCError } from \"@orpc/contract\";\nimport { implement, onError, os } from \"@orpc/server\";\nimport { Effect, type Scope } from \"effect\";\nimport { extractFromFiberFailure, formatORPCError } from \"./runtime/errors\";\n\ntype ContextOutput<T> = T extends AnySchema ? InferSchemaOutput<T> : {};\n\n/**\n * Helper type that correctly constructs the config schema type\n */\nexport type PluginConfigFor<V extends AnySchema, S extends AnySchema, TRequestContext extends AnySchema | undefined> = {\n\tvariables: V;\n\tsecrets: S;\n\tcontext: TRequestContext;\n};\n\n/**\n * Loaded plugin with static binding property\n */\nexport interface LoadedPluginWithBinding<\n\tTContract extends AnyContractRouter,\n\tTVariables extends AnySchema,\n\tTSecrets extends AnySchema,\n\tTRequestContext extends AnySchema | undefined,\n\tTDeps extends Context = Record<never, never>\n> {\n\tnew(): Plugin<TContract, TVariables, TSecrets, TRequestContext, TDeps>;\n\tbinding: {\n\t\tcontract: TContract;\n\t\tvariables: TVariables;\n\t\tsecrets: TSecrets;\n\t\tcontext: TRequestContext;\n\t};\n}\n\n/**\n * Plugin interface\n */\nexport interface Plugin<\n\tTContract extends AnyContractRouter,\n\tTVariables extends AnySchema,\n\tTSecrets extends AnySchema,\n\tTRequestContext extends AnySchema | undefined,\n\tTDeps extends Context = Record<never, never>\n> {\n\treadonly id: string;\n\treadonly contract: TContract;\n\treadonly configSchema: PluginConfigFor<TVariables, TSecrets, TRequestContext>;\n\n\t// Plugin lifecycle\n\tinitialize(\n\t\tconfig: { variables: InferSchemaOutput<TVariables>; secrets: InferSchemaOutput<TSecrets> }\n\t): Effect.Effect<TDeps, unknown, Scope.Scope>;\n\n\tshutdown(): Effect.Effect<void, never>;\n\n\t/**\n\t * Creates the strongly-typed oRPC router for this plugin.\n\t * The router's procedure types are inferred directly from the contract.\n\t * @param deps The initialized plugin dependencies\n\t * @returns A router with procedures matching the plugin's contract\n\t */\n\tcreateRouter(deps: TDeps): Router<TContract, any>;\n}\n\n/**\n * Factory function to create plugins\n */\nexport function createPlugin<\n\tV extends AnySchema,\n\tS extends AnySchema,\n\tTContract extends AnyContractRouter,\n\tTRequestContext extends AnySchema | undefined = undefined,\n\tTDeps extends Context = Record<never, never>\n>(config: {\n\tvariables: V;\n\tsecrets: S;\n\tcontract: TContract;\n\tcontext?: TRequestContext;\n\tinitialize?: (\n\t\tconfig: { variables: InferSchemaOutput<V>; secrets: InferSchemaOutput<S> }\n\t) => Effect.Effect<TDeps, Error, Scope.Scope>;\n\tcreateRouter: (\n\t\tdeps: TDeps,\n\t\tbuilder: Implementer<TContract, ContextOutput<TRequestContext>, ContextOutput<TRequestContext>>\n\t) => Router<TContract, any>;\n\tshutdown?: (deps: TDeps) => Effect.Effect<void, Error, never>;\n}) {\n\tconst configSchema: PluginConfigFor<V, S, TRequestContext> = {\n\t\tvariables: config.variables,\n\t\tsecrets: config.secrets,\n\t\tcontext: config.context as TRequestContext\n\t};\n\n\tclass CreatedPlugin implements Plugin<TContract, V, S, TRequestContext, TDeps> {\n\t\t/** set during instantiation - registry key */\n\t\tid!: string;\n\t\treadonly contract = config.contract;\n\t\treadonly configSchema = configSchema;\n\n\t\tprivate _deps: TDeps | null = null;\n\n\t\tinitialize(\n\t\t\tpluginConfig: { variables: InferSchemaOutput<V>; secrets: InferSchemaOutput<S> }\n\t\t): Effect.Effect<TDeps, unknown, Scope.Scope> {\n\t\t\tconst init = config.initialize ?? (() => Effect.succeed({} as TDeps));\n\n\t\t\treturn init(pluginConfig).pipe(\n\t\t\t\tEffect.tap((deps) => Effect.sync(() => { this._deps = deps; })),\n\t\t\t\tEffect.map(() => this._deps as TDeps),\n\t\t\t\tEffect.mapError((error) => error as unknown)\n\t\t\t);\n\t\t}\n\n\t\tshutdown(): Effect.Effect<void, never> {\n\t\t\tconst self = this;\n\t\t\treturn Effect.gen(function* () {\n\t\t\t\tif (config.shutdown && self._deps) {\n\t\t\t\t\tyield* config.shutdown(self._deps).pipe(\n\t\t\t\t\t\tEffect.catchAll(() => Effect.void)\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tcreateRouter(deps: TDeps): Router<TContract, any> {\n\t\t\tconst base = os\n\t\t\t\t.$context<ContextOutput<TRequestContext>>()\n\t\t\t\t.use(onError((error) => {\n\t\t\t\t\tconst unwrapped = extractFromFiberFailure(error);\n\t\t\t\t\t\n\t\t\t\t\tif (unwrapped !== error && unwrapped instanceof ORPCError) {\n\t\t\t\t\t\tthrow unwrapped;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tformatORPCError(error);\n\t\t\t\t}));\n\t\t\tconst builder = implement(config.contract, base);\n\t\t\tconst router = config.createRouter(deps, builder);\n\t\t\treturn router as Router<TContract, any>;\n\t\t}\n\t}\n\n\tconst PluginConstructor = CreatedPlugin as unknown as {\n\t\tnew(): Plugin<TContract, V, S, TRequestContext, TDeps>;\n\t\tbinding: {\n\t\t\tcontract: TContract;\n\t\t\tvariables: V;\n\t\t\tsecrets: S;\n\t\t\tcontext: TRequestContext;\n\t\t};\n\t};\n\n\tPluginConstructor.binding = {\n\t\tcontract: config.contract,\n\t\tvariables: config.variables,\n\t\tsecrets: config.secrets,\n\t\tcontext: config.context as TRequestContext\n\t};\n\n\treturn PluginConstructor as LoadedPluginWithBinding<TContract, V, S, TRequestContext, TDeps>;\n}\n"],"mappings":";;;;;;;;;AAsEA,SAAgB,aAMd,QAaC;CACF,MAAM,eAAuD;EAC5D,WAAW,OAAO;EAClB,SAAS,OAAO;EAChB,SAAS,OAAO;EAChB;CAED,MAAM,cAAyE;;EAE9E;EACA,AAAS,WAAW,OAAO;EAC3B,AAAS,eAAe;EAExB,AAAQ,QAAsB;EAE9B,WACC,cAC6C;AAG7C,WAFa,OAAO,qBAAqB,OAAO,QAAQ,EAAE,CAAU,GAExD,aAAa,CAAC,KACzB,OAAO,KAAK,SAAS,OAAO,WAAW;AAAE,SAAK,QAAQ;KAAQ,CAAC,EAC/D,OAAO,UAAU,KAAK,MAAe,EACrC,OAAO,UAAU,UAAU,MAAiB,CAC5C;;EAGF,WAAuC;GACtC,MAAM,OAAO;AACb,UAAO,OAAO,IAAI,aAAa;AAC9B,QAAI,OAAO,YAAY,KAAK,MAC3B,QAAO,OAAO,SAAS,KAAK,MAAM,CAAC,KAClC,OAAO,eAAe,OAAO,KAAK,CAClC;KAED;;EAGH,aAAa,MAAqC;GACjD,MAAM,OAAO,GACX,UAA0C,CAC1C,IAAI,SAAS,UAAU;IACvB,MAAM,YAAY,wBAAwB,MAAM;AAEhD,QAAI,cAAc,SAAS,qBAAqB,UAC/C,OAAM;AAGP,oBAAgB,MAAM;KACrB,CAAC;GACJ,MAAM,UAAU,UAAU,OAAO,UAAU,KAAK;AAEhD,UADe,OAAO,aAAa,MAAM,QAAQ;;;CAKnD,MAAM,oBAAoB;AAU1B,mBAAkB,UAAU;EAC3B,UAAU,OAAO;EACjB,WAAW,OAAO;EAClB,SAAS,OAAO;EAChB,SAAS,OAAO;EAChB;AAED,QAAO"}
|
package/dist/runtime/errors.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
-
let
|
|
2
|
+
let _orpc_contract = require("@orpc/contract");
|
|
3
3
|
let effect = require("effect");
|
|
4
4
|
|
|
5
5
|
//#region src/runtime/errors.ts
|
|
@@ -61,7 +61,7 @@ const formatORPCValidationError = (error) => {
|
|
|
61
61
|
return lines;
|
|
62
62
|
};
|
|
63
63
|
const formatORPCError = (error) => {
|
|
64
|
-
if (!(error instanceof
|
|
64
|
+
if (!(error instanceof _orpc_contract.ORPCError)) return;
|
|
65
65
|
const validationLines = formatORPCValidationError(error);
|
|
66
66
|
if (validationLines) {
|
|
67
67
|
console.error(validationLines.join("\n"));
|
|
@@ -177,15 +177,15 @@ const extractFromFiberFailure = (error) => {
|
|
|
177
177
|
const cause = error.cause;
|
|
178
178
|
if (cause && typeof cause === "object" && "_tag" in cause) try {
|
|
179
179
|
const squashed = effect.Cause.squash(cause);
|
|
180
|
-
if (squashed instanceof
|
|
180
|
+
if (squashed instanceof _orpc_contract.ORPCError) return squashed;
|
|
181
181
|
return squashed;
|
|
182
182
|
} catch {}
|
|
183
|
-
if (cause instanceof
|
|
183
|
+
if (cause instanceof _orpc_contract.ORPCError) return cause;
|
|
184
184
|
}
|
|
185
185
|
return error;
|
|
186
186
|
};
|
|
187
187
|
const toPluginRuntimeError = (error, pluginId, procedureName, operation, defaultRetryable = false) => {
|
|
188
|
-
if (error instanceof
|
|
188
|
+
if (error instanceof _orpc_contract.ORPCError) return wrapORPCError(error, pluginId, procedureName, operation);
|
|
189
189
|
if (error instanceof PluginRuntimeError) return error;
|
|
190
190
|
const validationLines = formatORPCValidationError(error);
|
|
191
191
|
if (validationLines) console.error(validationLines.join("\n"));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.cjs","names":["Data","lines: string[]","ORPCError","Cause"],"sources":["../../src/runtime/errors.ts"],"sourcesContent":["import { ORPCError } from \"@orpc/contract\";\nimport { Cause, Data } from \"effect\";\nimport type { z } from \"zod\";\n\nexport class PluginRuntimeError extends Data.TaggedError(\"PluginRuntimeError\")<{\n\treadonly pluginId?: string;\n\treadonly operation?: string;\n\treadonly procedureName?: string;\n\treadonly cause?: Error;\n\treadonly retryable: boolean;\n}> { }\n\nexport class ModuleFederationError extends Data.TaggedError(\n\t\"ModuleFederationError\",\n)<{\n\treadonly pluginId: string;\n\treadonly remoteUrl: string;\n\treadonly cause?: Error;\n}> { }\n\nexport class ValidationError extends Data.TaggedError(\"ValidationError\")<{\n\treadonly pluginId: string;\n\treadonly stage: \"config\" | \"input\" | \"output\" | \"state\";\n\treadonly zodError: z.ZodError;\n}> { }\n\nconst extractErrorMessage = (error: unknown): string => {\n\tif (!error) return 'Unknown error';\n\n\tif (error instanceof Error) {\n\t\tif (error.message) return error.message;\n\t\tif ((error as any).cause instanceof Error) {\n\t\t\treturn extractErrorMessage((error as any).cause);\n\t\t}\n\t}\n\n\tif (error instanceof AggregateError && error.errors?.length) {\n\t\treturn error.errors.map(e => extractErrorMessage(e)).join('; ');\n\t}\n\n\tif (typeof error === 'object' && 'message' in error) {\n\t\treturn String((error as any).message);\n\t}\n\n\treturn String(error);\n};\n\nconst formatValidationIssue = (issue: any, index: number, maxDisplay: number): string => {\n\tif (index >= maxDisplay) return '';\n\t\n\tconst path = Array.isArray(issue.path) && issue.path.length > 0\n\t\t? issue.path.join('.')\n\t\t: issue.path || 'root';\n\t\n\tconst message = issue.message || 'Validation failed';\n\t\n\treturn `│ ${index + 1}. ${path}: ${message}`;\n};\n\nconst formatDataPreview = (data: unknown, maxLength = 100): string => {\n\tif (!data) return 'undefined';\n\t\n\ttry {\n\t\tconst str = JSON.stringify(data);\n\t\tif (str.length <= maxLength) return str;\n\t\t\n\t\tif (typeof data === 'object' && data !== null) {\n\t\t\tif (Array.isArray(data)) {\n\t\t\t\treturn `Array(${data.length}) [...]`;\n\t\t\t}\n\t\t\tconst keys = Object.keys(data);\n\t\t\treturn `{ ${keys.slice(0, 3).join(', ')}${keys.length > 3 ? ', ...' : ''} }`;\n\t\t}\n\t\t\n\t\treturn str.slice(0, maxLength) + '...';\n\t} catch {\n\t\treturn String(data).slice(0, maxLength);\n\t}\n};\n\nconst formatORPCValidationError = (error: any): string[] | null => {\n\tconst cause = error?.cause || error;\n\t\n\tif (!cause?.issues || !Array.isArray(cause.issues) || cause.issues.length === 0) {\n\t\treturn null;\n\t}\n\n\tconst lines: string[] = [];\n\tconst errorType = error?.message || cause?.message || 'Validation failed';\n\t\n\tlines.push(`\\n╭─ oRPC Validation Error ${'─'.repeat(30)}`);\n\tlines.push(`│ ${errorType}`);\n\tlines.push(`│`);\n\t\n\tconst maxDisplay = 10;\n\tconst totalIssues = cause.issues.length;\n\t\n\tlines.push(`│ Issues (${totalIssues}):`);\n\t\n\tconst displayedIssues = cause.issues.slice(0, maxDisplay);\n\tdisplayedIssues.forEach((issue: any, idx: number) => {\n\t\tconst formatted = formatValidationIssue(issue, idx, maxDisplay);\n\t\tif (formatted) lines.push(formatted);\n\t});\n\t\n\tif (totalIssues > maxDisplay) {\n\t\tlines.push(`│ ... and ${totalIssues - maxDisplay} more`);\n\t}\n\t\n\tif (cause.data !== undefined) {\n\t\tlines.push(`│`);\n\t\tlines.push(`│ Data preview: ${formatDataPreview(cause.data, 80)}`);\n\t}\n\t\n\tlines.push(`╰${'─'.repeat(50)}\\n`);\n\t\n\treturn lines;\n};\n\nexport const formatORPCError = (error: any): void => {\n\tif (!(error instanceof ORPCError)) {\n\t\treturn;\n\t}\n\n\tconst validationLines = formatORPCValidationError(error);\n\tif (validationLines) {\n\t\tconsole.error(validationLines.join('\\n'));\n\t\treturn;\n\t}\n\n\tconst lines: string[] = [];\n\tconst code = error.code || 'UNKNOWN';\n\tconst status = error.status || 500;\n\tconst message = error.message || 'An error occurred';\n\n\tlines.push(`\\n╭─ oRPC Error ${'─'.repeat(40)}`);\n\tlines.push(`│ ${message}`);\n\tlines.push(`│ Code: ${code} (${status})`);\n\tlines.push(`│`);\n\n\tif (error.data) {\n\t\tconst dataType = typeof error.data;\n\t\tif (dataType === 'object' && error.data !== null) {\n\t\t\tif ('retryAfter' in error.data) {\n\t\t\t\tlines.push(`│ Retry after: ${error.data.retryAfter} seconds`);\n\t\t\t}\n\t\t\tif ('remainingRequests' in error.data) {\n\t\t\t\tlines.push(`│ Remaining: ${error.data.remainingRequests} requests`);\n\t\t\t}\n\t\t\tif ('host' in error.data) {\n\t\t\t\tlines.push(`│ Host: ${error.data.host}`);\n\t\t\t}\n\t\t\tif ('port' in error.data) {\n\t\t\t\tlines.push(`│ Port: ${error.data.port}`);\n\t\t\t}\n\t\t\tif ('suggestion' in error.data) {\n\t\t\t\tlines.push(`│ → ${error.data.suggestion}`);\n\t\t\t}\n\t\t\tif ('resource' in error.data) {\n\t\t\t\tlines.push(`│ Resource: ${error.data.resource}`);\n\t\t\t}\n\t\t\tif ('resourceId' in error.data) {\n\t\t\t\tlines.push(`│ ID: ${error.data.resourceId}`);\n\t\t\t}\n\t\t}\n\t}\n\n\tswitch (code) {\n\t\tcase 'UNAUTHORIZED':\n\t\t\tlines.push(`│ → Check your API key or credentials`);\n\t\t\tbreak;\n\t\tcase 'TOO_MANY_REQUESTS':\n\t\t\tlines.push(`│ → Wait before retrying`);\n\t\t\tbreak;\n\t\tcase 'SERVICE_UNAVAILABLE':\n\t\tcase 'BAD_GATEWAY':\n\t\tcase 'GATEWAY_TIMEOUT':\n\t\t\tlines.push(`│ → The service may be temporarily unavailable`);\n\t\t\tbreak;\n\t\tcase 'TIMEOUT':\n\t\t\tlines.push(`│ → The operation took too long`);\n\t\t\tbreak;\n\t}\n\n\tlines.push(`╰${'─'.repeat(50)}\\n`);\n\tconsole.error(lines.join('\\n'));\n};\n\nconst formatPluginError = (\n\tpluginId: string | undefined,\n\toperation: string | undefined,\n\tmessage: string\n): void => {\n\tconst lines: string[] = [];\n\n\tlines.push(`\\n╭─ Plugin Error ${'─'.repeat(40)}`);\n\tif (pluginId) lines.push(`│ Plugin: ${pluginId}`);\n\tif (operation) lines.push(`│ During: ${operation}`);\n\tlines.push(`│`);\n\n\tif (message.includes('ECONNREFUSED')) {\n\t\tlines.push(`│ ❌ Connection refused`);\n\t\tlines.push(`│ `);\n\t\tlines.push(`│ A required service is not running.`);\n\t\tlines.push(`│ → Run: docker compose up -d`);\n\t} else if (message.includes('ENOTFOUND')) {\n\t\tlines.push(`│ ❌ Host not found`);\n\t\tlines.push(`│ `);\n\t\tlines.push(`│ Check your connection URL or network settings.`);\n\t} else if (message.includes('ETIMEDOUT') || message.includes('timeout')) {\n\t\tlines.push(`│ ❌ Connection timeout`);\n\t\tlines.push(`│ `);\n\t\tlines.push(`│ The service took too long to respond.`);\n\t} else if (message.includes('EACCES') || message.includes('permission')) {\n\t\tlines.push(`│ ❌ Permission denied`);\n\t\tlines.push(`│ `);\n\t\tlines.push(`│ Check credentials or access permissions.`);\n\t} else if (message.includes('401') || message.includes('unauthorized')) {\n\t\tlines.push(`│ ❌ Authentication failed`);\n\t\tlines.push(`│ `);\n\t\tlines.push(`│ Check your API key or credentials.`);\n\t} else {\n\t\tlines.push(`│ ❌ ${message}`);\n\t}\n\n\tlines.push(`╰${'─'.repeat(50)}\\n`);\n\n\tconsole.error(lines.join('\\n'));\n};\n\nconst isRetryableError = (message: string): boolean => {\n\tconst retryablePatterns = ['ETIMEDOUT', 'ECONNRESET', 'timeout', '503', '429'];\n\treturn retryablePatterns.some(p => message.toLowerCase().includes(p.toLowerCase()));\n};\n\n// Helper to determine if an oRPC error code is retryable\nexport const isRetryableORPCCode = (code: string): boolean => {\n\tswitch (code) {\n\t\tcase 'TOO_MANY_REQUESTS':\n\t\tcase 'SERVICE_UNAVAILABLE':\n\t\tcase 'BAD_GATEWAY':\n\t\tcase 'GATEWAY_TIMEOUT':\n\t\tcase 'TIMEOUT':\n\t\t\treturn true;\n\t\tdefault:\n\t\t\treturn false;\n\t}\n};\n\n// Convert ORPC errors from plugin procedures to PluginRuntimeError\nexport const wrapORPCError = (\n\torpcError: ORPCError<string, unknown>,\n\tpluginId?: string,\n\tprocedureName?: string,\n\toperation?: string\n): PluginRuntimeError => {\n\tconst validationLines = formatORPCValidationError(orpcError);\n\tif (validationLines) {\n\t\tconsole.error(validationLines.join('\\n'));\n\t}\n\t\n\treturn new PluginRuntimeError({\n\t\tpluginId,\n\t\toperation,\n\t\tprocedureName,\n\t\tretryable: isRetryableORPCCode(orpcError.code),\n\t\tcause: orpcError as Error\n\t});\n};\n\n/**\n * Extracts the underlying error from Effect's FiberFailure wrapper.\n * When Effect.runPromise rejects, errors are wrapped in FiberFailure.\n * This extracts the original error so oRPC can handle it properly.\n */\nexport const extractFromFiberFailure = (error: unknown): unknown => {\n\tif (!error || typeof error !== 'object') return error;\n\t\n\tif ('cause' in error) {\n\t\tconst cause = (error as { cause?: unknown }).cause;\n\t\t\n\t\tif (cause && typeof cause === 'object' && '_tag' in cause) {\n\t\t\ttry {\n\t\t\t\tconst squashed = Cause.squash(cause as Cause.Cause<unknown>);\n\t\t\t\tif (squashed instanceof ORPCError) {\n\t\t\t\t\treturn squashed;\n\t\t\t\t}\n\t\t\t\treturn squashed;\n\t\t\t} catch {\n\t\t\t\t// Not a valid Cause\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (cause instanceof ORPCError) {\n\t\t\treturn cause;\n\t\t}\n\t}\n\t\n\treturn error;\n};\n\n// Universal error converter for the runtime\nexport const toPluginRuntimeError = (\n\terror: unknown,\n\tpluginId?: string,\n\tprocedureName?: string,\n\toperation?: string,\n\tdefaultRetryable = false\n): PluginRuntimeError => {\n\tif (error instanceof ORPCError) {\n\t\treturn wrapORPCError(error, pluginId, procedureName, operation);\n\t}\n\n\tif (error instanceof PluginRuntimeError) {\n\t\treturn error;\n\t}\n\n\tconst validationLines = formatORPCValidationError(error);\n\tif (validationLines) {\n\t\tconsole.error(validationLines.join('\\n'));\n\t} else {\n\t\tconst message = extractErrorMessage(error);\n\t\tformatPluginError(pluginId, operation, message);\n\t}\n\n\treturn new PluginRuntimeError({\n\t\tpluginId,\n\t\toperation,\n\t\tprocedureName,\n\t\tretryable: defaultRetryable || isRetryableError(extractErrorMessage(error)),\n\t\tcause: error instanceof Error ? error : new Error(extractErrorMessage(error))\n\t});\n};\n"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C;AAG1C,QAAO,IAAI,mBAAmB;EAC7B;EACA;EACA;EACA,WAAW,oBAAoB,UAAU,KAAK;EAC9C,OAAO;EACP,CAAC;;;;;;;AAQH,MAAa,2BAA2B,UAA4B;AACnE,KAAI,CAAC,SAAS,OAAO,UAAU,SAAU,QAAO;AAEhD,KAAI,WAAW,OAAO;EACrB,MAAM,QAAS,MAA8B;AAE7C,MAAI,SAAS,OAAO,UAAU,YAAY,UAAU,MACnD,KAAI;GACH,MAAM,WAAWE,aAAM,OAAO,MAA8B;AAC5D,OAAI,oBAAoBD,0BACvB,QAAO;AAER,UAAO;UACA;AAKT,MAAI,iBAAiBA,0BACpB,QAAO;;AAIT,QAAO;;AAIR,MAAa,wBACZ,OACA,UACA,eACA,WACA,mBAAmB,UACK;AACxB,KAAI,iBAAiBA,0BACpB,QAAO,cAAc,OAAO,UAAU,eAAe,UAAU;AAGhE,KAAI,iBAAiB,mBACpB,QAAO;CAGR,MAAM,kBAAkB,0BAA0B,MAAM;AACxD,KAAI,gBACH,SAAQ,MAAM,gBAAgB,KAAK,KAAK,CAAC;KAGzC,mBAAkB,UAAU,WADZ,oBAAoB,MAAM,CACK;AAGhD,QAAO,IAAI,mBAAmB;EAC7B;EACA;EACA;EACA,WAAW,oBAAoB,iBAAiB,oBAAoB,MAAM,CAAC;EAC3E,OAAO,iBAAiB,QAAQ,QAAQ,IAAI,MAAM,oBAAoB,MAAM,CAAC;EAC7E,CAAC"}
|
|
1
|
+
{"version":3,"file":"errors.cjs","names":["Data","ORPCError","Cause"],"sources":["../../src/runtime/errors.ts"],"sourcesContent":["import { ORPCError } from \"@orpc/contract\";\nimport { Cause, Data } from \"effect\";\nimport type { z } from \"zod\";\n\nexport class PluginRuntimeError extends Data.TaggedError(\"PluginRuntimeError\")<{\n\treadonly pluginId?: string;\n\treadonly operation?: string;\n\treadonly procedureName?: string;\n\treadonly cause?: Error;\n\treadonly retryable: boolean;\n}> { }\n\nexport class ModuleFederationError extends Data.TaggedError(\n\t\"ModuleFederationError\",\n)<{\n\treadonly pluginId: string;\n\treadonly remoteUrl: string;\n\treadonly cause?: Error;\n}> { }\n\nexport class ValidationError extends Data.TaggedError(\"ValidationError\")<{\n\treadonly pluginId: string;\n\treadonly stage: \"config\" | \"input\" | \"output\" | \"state\";\n\treadonly zodError: z.ZodError;\n}> { }\n\nconst extractErrorMessage = (error: unknown): string => {\n\tif (!error) return 'Unknown error';\n\n\tif (error instanceof Error) {\n\t\tif (error.message) return error.message;\n\t\tif ((error as any).cause instanceof Error) {\n\t\t\treturn extractErrorMessage((error as any).cause);\n\t\t}\n\t}\n\n\tif (error instanceof AggregateError && error.errors?.length) {\n\t\treturn error.errors.map(e => extractErrorMessage(e)).join('; ');\n\t}\n\n\tif (typeof error === 'object' && 'message' in error) {\n\t\treturn String((error as any).message);\n\t}\n\n\treturn String(error);\n};\n\nconst formatValidationIssue = (issue: any, index: number, maxDisplay: number): string => {\n\tif (index >= maxDisplay) return '';\n\t\n\tconst path = Array.isArray(issue.path) && issue.path.length > 0\n\t\t? issue.path.join('.')\n\t\t: issue.path || 'root';\n\t\n\tconst message = issue.message || 'Validation failed';\n\t\n\treturn `│ ${index + 1}. ${path}: ${message}`;\n};\n\nconst formatDataPreview = (data: unknown, maxLength = 100): string => {\n\tif (!data) return 'undefined';\n\t\n\ttry {\n\t\tconst str = JSON.stringify(data);\n\t\tif (str.length <= maxLength) return str;\n\t\t\n\t\tif (typeof data === 'object' && data !== null) {\n\t\t\tif (Array.isArray(data)) {\n\t\t\t\treturn `Array(${data.length}) [...]`;\n\t\t\t}\n\t\t\tconst keys = Object.keys(data);\n\t\t\treturn `{ ${keys.slice(0, 3).join(', ')}${keys.length > 3 ? ', ...' : ''} }`;\n\t\t}\n\t\t\n\t\treturn str.slice(0, maxLength) + '...';\n\t} catch {\n\t\treturn String(data).slice(0, maxLength);\n\t}\n};\n\nconst formatORPCValidationError = (error: any): string[] | null => {\n\tconst cause = error?.cause || error;\n\t\n\tif (!cause?.issues || !Array.isArray(cause.issues) || cause.issues.length === 0) {\n\t\treturn null;\n\t}\n\n\tconst lines: string[] = [];\n\tconst errorType = error?.message || cause?.message || 'Validation failed';\n\t\n\tlines.push(`\\n╭─ oRPC Validation Error ${'─'.repeat(30)}`);\n\tlines.push(`│ ${errorType}`);\n\tlines.push(`│`);\n\t\n\tconst maxDisplay = 10;\n\tconst totalIssues = cause.issues.length;\n\t\n\tlines.push(`│ Issues (${totalIssues}):`);\n\t\n\tconst displayedIssues = cause.issues.slice(0, maxDisplay);\n\tdisplayedIssues.forEach((issue: any, idx: number) => {\n\t\tconst formatted = formatValidationIssue(issue, idx, maxDisplay);\n\t\tif (formatted) lines.push(formatted);\n\t});\n\t\n\tif (totalIssues > maxDisplay) {\n\t\tlines.push(`│ ... and ${totalIssues - maxDisplay} more`);\n\t}\n\t\n\tif (cause.data !== undefined) {\n\t\tlines.push(`│`);\n\t\tlines.push(`│ Data preview: ${formatDataPreview(cause.data, 80)}`);\n\t}\n\t\n\tlines.push(`╰${'─'.repeat(50)}\\n`);\n\t\n\treturn lines;\n};\n\nexport const formatORPCError = (error: any): void => {\n\tif (!(error instanceof ORPCError)) {\n\t\treturn;\n\t}\n\n\tconst validationLines = formatORPCValidationError(error);\n\tif (validationLines) {\n\t\tconsole.error(validationLines.join('\\n'));\n\t\treturn;\n\t}\n\n\tconst lines: string[] = [];\n\tconst code = error.code || 'UNKNOWN';\n\tconst status = error.status || 500;\n\tconst message = error.message || 'An error occurred';\n\n\tlines.push(`\\n╭─ oRPC Error ${'─'.repeat(40)}`);\n\tlines.push(`│ ${message}`);\n\tlines.push(`│ Code: ${code} (${status})`);\n\tlines.push(`│`);\n\n\tif (error.data) {\n\t\tconst dataType = typeof error.data;\n\t\tif (dataType === 'object' && error.data !== null) {\n\t\t\tif ('retryAfter' in error.data) {\n\t\t\t\tlines.push(`│ Retry after: ${error.data.retryAfter} seconds`);\n\t\t\t}\n\t\t\tif ('remainingRequests' in error.data) {\n\t\t\t\tlines.push(`│ Remaining: ${error.data.remainingRequests} requests`);\n\t\t\t}\n\t\t\tif ('host' in error.data) {\n\t\t\t\tlines.push(`│ Host: ${error.data.host}`);\n\t\t\t}\n\t\t\tif ('port' in error.data) {\n\t\t\t\tlines.push(`│ Port: ${error.data.port}`);\n\t\t\t}\n\t\t\tif ('suggestion' in error.data) {\n\t\t\t\tlines.push(`│ → ${error.data.suggestion}`);\n\t\t\t}\n\t\t\tif ('resource' in error.data) {\n\t\t\t\tlines.push(`│ Resource: ${error.data.resource}`);\n\t\t\t}\n\t\t\tif ('resourceId' in error.data) {\n\t\t\t\tlines.push(`│ ID: ${error.data.resourceId}`);\n\t\t\t}\n\t\t}\n\t}\n\n\tswitch (code) {\n\t\tcase 'UNAUTHORIZED':\n\t\t\tlines.push(`│ → Check your API key or credentials`);\n\t\t\tbreak;\n\t\tcase 'TOO_MANY_REQUESTS':\n\t\t\tlines.push(`│ → Wait before retrying`);\n\t\t\tbreak;\n\t\tcase 'SERVICE_UNAVAILABLE':\n\t\tcase 'BAD_GATEWAY':\n\t\tcase 'GATEWAY_TIMEOUT':\n\t\t\tlines.push(`│ → The service may be temporarily unavailable`);\n\t\t\tbreak;\n\t\tcase 'TIMEOUT':\n\t\t\tlines.push(`│ → The operation took too long`);\n\t\t\tbreak;\n\t}\n\n\tlines.push(`╰${'─'.repeat(50)}\\n`);\n\tconsole.error(lines.join('\\n'));\n};\n\nconst formatPluginError = (\n\tpluginId: string | undefined,\n\toperation: string | undefined,\n\tmessage: string\n): void => {\n\tconst lines: string[] = [];\n\n\tlines.push(`\\n╭─ Plugin Error ${'─'.repeat(40)}`);\n\tif (pluginId) lines.push(`│ Plugin: ${pluginId}`);\n\tif (operation) lines.push(`│ During: ${operation}`);\n\tlines.push(`│`);\n\n\tif (message.includes('ECONNREFUSED')) {\n\t\tlines.push(`│ ❌ Connection refused`);\n\t\tlines.push(`│ `);\n\t\tlines.push(`│ A required service is not running.`);\n\t\tlines.push(`│ → Run: docker compose up -d`);\n\t} else if (message.includes('ENOTFOUND')) {\n\t\tlines.push(`│ ❌ Host not found`);\n\t\tlines.push(`│ `);\n\t\tlines.push(`│ Check your connection URL or network settings.`);\n\t} else if (message.includes('ETIMEDOUT') || message.includes('timeout')) {\n\t\tlines.push(`│ ❌ Connection timeout`);\n\t\tlines.push(`│ `);\n\t\tlines.push(`│ The service took too long to respond.`);\n\t} else if (message.includes('EACCES') || message.includes('permission')) {\n\t\tlines.push(`│ ❌ Permission denied`);\n\t\tlines.push(`│ `);\n\t\tlines.push(`│ Check credentials or access permissions.`);\n\t} else if (message.includes('401') || message.includes('unauthorized')) {\n\t\tlines.push(`│ ❌ Authentication failed`);\n\t\tlines.push(`│ `);\n\t\tlines.push(`│ Check your API key or credentials.`);\n\t} else {\n\t\tlines.push(`│ ❌ ${message}`);\n\t}\n\n\tlines.push(`╰${'─'.repeat(50)}\\n`);\n\n\tconsole.error(lines.join('\\n'));\n};\n\nconst isRetryableError = (message: string): boolean => {\n\tconst retryablePatterns = ['ETIMEDOUT', 'ECONNRESET', 'timeout', '503', '429'];\n\treturn retryablePatterns.some(p => message.toLowerCase().includes(p.toLowerCase()));\n};\n\n// Helper to determine if an oRPC error code is retryable\nexport const isRetryableORPCCode = (code: string): boolean => {\n\tswitch (code) {\n\t\tcase 'TOO_MANY_REQUESTS':\n\t\tcase 'SERVICE_UNAVAILABLE':\n\t\tcase 'BAD_GATEWAY':\n\t\tcase 'GATEWAY_TIMEOUT':\n\t\tcase 'TIMEOUT':\n\t\t\treturn true;\n\t\tdefault:\n\t\t\treturn false;\n\t}\n};\n\n// Convert ORPC errors from plugin procedures to PluginRuntimeError\nexport const wrapORPCError = (\n\torpcError: ORPCError<string, unknown>,\n\tpluginId?: string,\n\tprocedureName?: string,\n\toperation?: string\n): PluginRuntimeError => {\n\tconst validationLines = formatORPCValidationError(orpcError);\n\tif (validationLines) {\n\t\tconsole.error(validationLines.join('\\n'));\n\t}\n\t\n\treturn new PluginRuntimeError({\n\t\tpluginId,\n\t\toperation,\n\t\tprocedureName,\n\t\tretryable: isRetryableORPCCode(orpcError.code),\n\t\tcause: orpcError as Error\n\t});\n};\n\n/**\n * Extracts the underlying error from Effect's FiberFailure wrapper.\n * When Effect.runPromise rejects, errors are wrapped in FiberFailure.\n * This extracts the original error so oRPC can handle it properly.\n */\nexport const extractFromFiberFailure = (error: unknown): unknown => {\n\tif (!error || typeof error !== 'object') return error;\n\t\n\tif ('cause' in error) {\n\t\tconst cause = (error as { cause?: unknown }).cause;\n\t\t\n\t\tif (cause && typeof cause === 'object' && '_tag' in cause) {\n\t\t\ttry {\n\t\t\t\tconst squashed = Cause.squash(cause as Cause.Cause<unknown>);\n\t\t\t\tif (squashed instanceof ORPCError) {\n\t\t\t\t\treturn squashed;\n\t\t\t\t}\n\t\t\t\treturn squashed;\n\t\t\t} catch {\n\t\t\t\t// Not a valid Cause\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (cause instanceof ORPCError) {\n\t\t\treturn cause;\n\t\t}\n\t}\n\t\n\treturn error;\n};\n\n// Universal error converter for the runtime\nexport const toPluginRuntimeError = (\n\terror: unknown,\n\tpluginId?: string,\n\tprocedureName?: string,\n\toperation?: string,\n\tdefaultRetryable = false\n): PluginRuntimeError => {\n\tif (error instanceof ORPCError) {\n\t\treturn wrapORPCError(error, pluginId, procedureName, operation);\n\t}\n\n\tif (error instanceof PluginRuntimeError) {\n\t\treturn error;\n\t}\n\n\tconst validationLines = formatORPCValidationError(error);\n\tif (validationLines) {\n\t\tconsole.error(validationLines.join('\\n'));\n\t} else {\n\t\tconst message = extractErrorMessage(error);\n\t\tformatPluginError(pluginId, operation, message);\n\t}\n\n\treturn new PluginRuntimeError({\n\t\tpluginId,\n\t\toperation,\n\t\tprocedureName,\n\t\tretryable: defaultRetryable || isRetryableError(extractErrorMessage(error)),\n\t\tcause: error instanceof Error ? error : new Error(extractErrorMessage(error))\n\t});\n};\n"],"mappings":";;;;;AAIA,IAAa,qBAAb,cAAwCA,YAAK,YAAY,qBAAq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oB,UAAU,KAAK;EAC9C,OAAO;EACP,CAAC;;;;;;;AAQH,MAAa,2BAA2B,UAA4B;AACnE,KAAI,CAAC,SAAS,OAAO,UAAU,SAAU,QAAO;AAEhD,KAAI,WAAW,OAAO;EACrB,MAAM,QAAS,MAA8B;AAE7C,MAAI,SAAS,OAAO,UAAU,YAAY,UAAU,MACnD,KAAI;GACH,MAAM,WAAWC,aAAM,OAAO,MAA8B;AAC5D,OAAI,oBAAoBD,yBACvB,QAAO;AAER,UAAO;UACA;AAKT,MAAI,iBAAiBA,yBACpB,QAAO;;AAIT,QAAO;;AAIR,MAAa,wBACZ,OACA,UACA,eACA,WACA,mBAAmB,UACK;AACxB,KAAI,iBAAiBA,yBACpB,QAAO,cAAc,OAAO,UAAU,eAAe,UAAU;AAGhE,KAAI,iBAAiB,mBACpB,QAAO;CAGR,MAAM,kBAAkB,0BAA0B,MAAM;AACxD,KAAI,gBACH,SAAQ,MAAM,gBAAgB,KAAK,KAAK,CAAC;KAGzC,mBAAkB,UAAU,WADZ,oBAAoB,MAAM,CACK;AAGhD,QAAO,IAAI,mBAAmB;EAC7B;EACA;EACA;EACA,WAAW,oBAAoB,iBAAiB,oBAAoB,MAAM,CAAC;EAC3E,OAAO,iBAAiB,QAAQ,QAAQ,IAAI,MAAM,oBAAoB,MAAM,CAAC;EAC7E,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.cts","names":[],"sources":["../../src/runtime/errors.ts"],"
|
|
1
|
+
{"version":3,"file":"errors.d.cts","names":[],"sources":["../../src/runtime/errors.ts"],"mappings":";;;;;;cAE6B,uBAAA;;;cAEhB,kBAAA,SAA2B,uBAAA;EAAA,SAAA,QAAA;EAAA,SAAA,SAAA;EAAA,SAAA,aAAA;EAAA,SAAA,KAAA,GAItB,KAAA;EAAA,SAAA,SAAA;AAAA;AAAA,cAEZ,0BAAA;;;cAEO,qBAAA,SAA8B,0BAAA;EAAA,SAAA,QAAA;EAAA,SAAA,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