every-plugin 0.8.3 → 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.
Files changed (94) hide show
  1. package/dist/_virtual/rolldown_runtime.cjs +1 -7
  2. package/dist/_virtual/rolldown_runtime.mjs +1 -7
  3. package/dist/build/rspack/dev-server-middleware.cjs.map +1 -1
  4. package/dist/build/rspack/dev-server-middleware.mjs.map +1 -1
  5. package/dist/build/rspack/index.cjs +7 -1
  6. package/dist/build/rspack/index.d.cts +2 -1
  7. package/dist/build/rspack/index.d.mts +2 -1
  8. package/dist/build/rspack/index.mjs +2 -1
  9. package/dist/build/rspack/module-federation.cjs +2 -33
  10. package/dist/build/rspack/module-federation.cjs.map +1 -1
  11. package/dist/build/rspack/module-federation.mjs +2 -33
  12. package/dist/build/rspack/module-federation.mjs.map +1 -1
  13. package/dist/build/rspack/plugin.cjs +2 -2
  14. package/dist/build/rspack/plugin.cjs.map +1 -1
  15. package/dist/build/rspack/plugin.d.cts.map +1 -1
  16. package/dist/build/rspack/plugin.d.mts.map +1 -1
  17. package/dist/build/rspack/plugin.mjs.map +1 -1
  18. package/dist/build/rspack/utils.cjs +2 -2
  19. package/dist/build/rspack/utils.cjs.map +1 -1
  20. package/dist/build/shared-deps.cjs +77 -0
  21. package/dist/build/shared-deps.cjs.map +1 -0
  22. package/dist/build/shared-deps.d.cts +16 -0
  23. package/dist/build/shared-deps.d.cts.map +1 -0
  24. package/dist/build/shared-deps.d.mts +16 -0
  25. package/dist/build/shared-deps.d.mts.map +1 -0
  26. package/dist/build/shared-deps.mjs +73 -0
  27. package/dist/build/shared-deps.mjs.map +1 -0
  28. package/dist/errors.cjs +105 -79
  29. package/dist/errors.cjs.map +1 -1
  30. package/dist/errors.d.cts +164 -5
  31. package/dist/errors.d.cts.map +1 -1
  32. package/dist/errors.d.mts +164 -5
  33. package/dist/errors.d.mts.map +1 -1
  34. package/dist/errors.mjs +97 -81
  35. package/dist/errors.mjs.map +1 -1
  36. package/dist/index.cjs +10 -0
  37. package/dist/index.d.cts +3 -3
  38. package/dist/index.d.mts +3 -3
  39. package/dist/index.mjs +3 -3
  40. package/dist/orpc.cjs +15 -15
  41. package/dist/package.cjs +28 -10
  42. package/dist/package.cjs.map +1 -1
  43. package/dist/package.mjs +23 -11
  44. package/dist/package.mjs.map +1 -1
  45. package/dist/plugin.cjs +6 -3
  46. package/dist/plugin.cjs.map +1 -1
  47. package/dist/plugin.d.cts +5 -5
  48. package/dist/plugin.d.cts.map +1 -1
  49. package/dist/plugin.d.mts +5 -5
  50. package/dist/plugin.d.mts.map +1 -1
  51. package/dist/plugin.mjs +4 -1
  52. package/dist/plugin.mjs.map +1 -1
  53. package/dist/runtime/errors.cjs +22 -3
  54. package/dist/runtime/errors.cjs.map +1 -1
  55. package/dist/runtime/errors.d.cts +11 -5
  56. package/dist/runtime/errors.d.cts.map +1 -1
  57. package/dist/runtime/errors.d.mts +11 -5
  58. package/dist/runtime/errors.d.mts.map +1 -1
  59. package/dist/runtime/errors.mjs +20 -2
  60. package/dist/runtime/errors.mjs.map +1 -1
  61. package/dist/runtime/index.cjs +2 -2
  62. package/dist/runtime/index.cjs.map +1 -1
  63. package/dist/runtime/index.d.cts.map +1 -1
  64. package/dist/runtime/index.d.mts.map +1 -1
  65. package/dist/runtime/index.mjs.map +1 -1
  66. package/dist/runtime/services/module-federation.service.cjs +11 -14
  67. package/dist/runtime/services/module-federation.service.cjs.map +1 -1
  68. package/dist/runtime/services/module-federation.service.d.cts.map +1 -1
  69. package/dist/runtime/services/module-federation.service.d.mts.map +1 -1
  70. package/dist/runtime/services/module-federation.service.mjs +6 -9
  71. package/dist/runtime/services/module-federation.service.mjs.map +1 -1
  72. package/dist/runtime/services/normalize.d.cts.map +1 -1
  73. package/dist/runtime/services/normalize.d.mts.map +1 -1
  74. package/dist/runtime/services/plugin-lifecycle.service.d.cts.map +1 -1
  75. package/dist/runtime/services/plugin-lifecycle.service.d.mts.map +1 -1
  76. package/dist/runtime/services/plugin-loader.service.d.cts.map +1 -1
  77. package/dist/runtime/services/plugin-loader.service.d.mts.map +1 -1
  78. package/dist/runtime/services/plugin.service.d.cts.map +1 -1
  79. package/dist/runtime/services/plugin.service.d.mts.map +1 -1
  80. package/dist/runtime/services/secrets.service.cjs.map +1 -1
  81. package/dist/runtime/services/secrets.service.d.cts.map +1 -1
  82. package/dist/runtime/services/secrets.service.d.mts.map +1 -1
  83. package/dist/runtime/services/secrets.service.mjs.map +1 -1
  84. package/dist/testing/index.cjs.map +1 -1
  85. package/dist/testing/index.d.cts.map +1 -1
  86. package/dist/testing/index.d.mts.map +1 -1
  87. package/dist/testing/index.mjs.map +1 -1
  88. package/dist/types.d.cts +26 -27
  89. package/dist/types.d.cts.map +1 -1
  90. package/dist/types.d.mts +26 -27
  91. package/dist/types.d.mts.map +1 -1
  92. package/dist/zod.d.cts.map +1 -1
  93. package/dist/zod.d.mts.map +1 -1
  94. 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.cjs CHANGED
@@ -33,102 +33,128 @@ const ERROR_PATTERNS = {
33
33
  };
34
34
  /**
35
35
  * Common error schemas for plugin contracts.
36
- * Import these to ensure consistent error handling across plugins.
36
+ * Import individually or use the grouped PluginErrors export.
37
37
  *
38
38
  * @example
39
39
  * ```typescript
40
- * import { CommonPluginErrors } from "every-plugin/errors";
40
+ * import { NOT_FOUND, FORBIDDEN, UNAUTHORIZED } from "every-plugin/errors";
41
41
  *
42
42
  * export const contract = oc.router({
43
43
  * getData: oc.route(...)
44
- * .errors(CommonPluginErrors)
44
+ * .errors({ NOT_FOUND, FORBIDDEN, UNAUTHORIZED })
45
45
  * });
46
46
  * ```
47
47
  */
48
- const CommonPluginErrors = {
49
- UNAUTHORIZED: {
50
- status: 401,
51
- data: require_zod.zod_exports.z.object({
52
- apiKeyProvided: require_zod.zod_exports.z.boolean(),
53
- provider: require_zod.zod_exports.z.string().optional(),
54
- authType: require_zod.zod_exports.z.enum([
55
- "apiKey",
56
- "oauth",
57
- "token"
58
- ]).optional()
59
- })
60
- },
61
- RATE_LIMITED: {
62
- status: 429,
63
- data: require_zod.zod_exports.z.object({
64
- retryAfter: require_zod.zod_exports.z.number().int().min(1),
65
- remainingRequests: require_zod.zod_exports.z.number().int().min(0).optional(),
66
- resetTime: require_zod.zod_exports.z.string().datetime().optional(),
67
- limitType: require_zod.zod_exports.z.enum([
68
- "requests",
69
- "tokens",
70
- "bandwidth"
71
- ]).optional()
72
- })
73
- },
74
- SERVICE_UNAVAILABLE: {
75
- status: 503,
76
- data: require_zod.zod_exports.z.object({
77
- retryAfter: require_zod.zod_exports.z.number().int().optional(),
78
- maintenanceWindow: require_zod.zod_exports.z.boolean().default(false),
79
- estimatedUptime: require_zod.zod_exports.z.string().datetime().optional()
80
- })
81
- },
82
- BAD_REQUEST: {
83
- status: 400,
84
- data: require_zod.zod_exports.z.object({
85
- invalidFields: require_zod.zod_exports.z.array(require_zod.zod_exports.z.string()).optional(),
86
- validationErrors: require_zod.zod_exports.z.array(require_zod.zod_exports.z.object({
87
- field: require_zod.zod_exports.z.string(),
88
- message: require_zod.zod_exports.z.string(),
89
- code: require_zod.zod_exports.z.string().optional()
90
- })).optional()
91
- })
92
- },
93
- NOT_FOUND: {
94
- status: 404,
95
- data: require_zod.zod_exports.z.object({
96
- resource: require_zod.zod_exports.z.string().optional(),
97
- resourceId: require_zod.zod_exports.z.string().optional()
98
- })
99
- },
100
- FORBIDDEN: {
101
- status: 403,
102
- data: require_zod.zod_exports.z.object({
103
- requiredPermissions: require_zod.zod_exports.z.array(require_zod.zod_exports.z.string()).optional(),
104
- action: require_zod.zod_exports.z.string().optional()
105
- })
106
- },
107
- TIMEOUT: {
108
- status: 504,
109
- data: require_zod.zod_exports.z.object({
110
- timeoutMs: require_zod.zod_exports.z.number().int().min(0).optional(),
111
- operation: require_zod.zod_exports.z.string().optional(),
112
- retryable: require_zod.zod_exports.z.boolean().default(true)
113
- })
114
- },
115
- CONNECTION_ERROR: {
116
- status: 502,
117
- data: require_zod.zod_exports.z.object({
118
- errorCode: require_zod.zod_exports.z.string().optional(),
119
- host: require_zod.zod_exports.z.string().optional(),
120
- port: require_zod.zod_exports.z.number().int().optional(),
121
- suggestion: require_zod.zod_exports.z.string().optional()
122
- })
123
- }
48
+ const UNAUTHORIZED = {
49
+ status: 401,
50
+ data: require_zod.zod_exports.z.object({
51
+ apiKeyProvided: require_zod.zod_exports.z.boolean(),
52
+ provider: require_zod.zod_exports.z.string().optional(),
53
+ authType: require_zod.zod_exports.z.enum([
54
+ "apiKey",
55
+ "oauth",
56
+ "token"
57
+ ]).optional()
58
+ })
124
59
  };
60
+ const RATE_LIMITED = {
61
+ status: 429,
62
+ data: require_zod.zod_exports.z.object({
63
+ retryAfter: require_zod.zod_exports.z.number().int().min(1),
64
+ remainingRequests: require_zod.zod_exports.z.number().int().min(0).optional(),
65
+ resetTime: require_zod.zod_exports.z.string().datetime().optional(),
66
+ limitType: require_zod.zod_exports.z.enum([
67
+ "requests",
68
+ "tokens",
69
+ "bandwidth"
70
+ ]).optional()
71
+ })
72
+ };
73
+ const SERVICE_UNAVAILABLE = {
74
+ status: 503,
75
+ data: require_zod.zod_exports.z.object({
76
+ retryAfter: require_zod.zod_exports.z.number().int().optional(),
77
+ maintenanceWindow: require_zod.zod_exports.z.boolean().default(false),
78
+ estimatedUptime: require_zod.zod_exports.z.string().datetime().optional()
79
+ })
80
+ };
81
+ const BAD_REQUEST = {
82
+ status: 400,
83
+ data: require_zod.zod_exports.z.object({
84
+ invalidFields: require_zod.zod_exports.z.array(require_zod.zod_exports.z.string()).optional(),
85
+ validationErrors: require_zod.zod_exports.z.array(require_zod.zod_exports.z.object({
86
+ field: require_zod.zod_exports.z.string(),
87
+ message: require_zod.zod_exports.z.string(),
88
+ code: require_zod.zod_exports.z.string().optional()
89
+ })).optional()
90
+ })
91
+ };
92
+ const NOT_FOUND = {
93
+ status: 404,
94
+ data: require_zod.zod_exports.z.object({
95
+ resource: require_zod.zod_exports.z.string().optional(),
96
+ resourceId: require_zod.zod_exports.z.string().optional()
97
+ })
98
+ };
99
+ const FORBIDDEN = {
100
+ status: 403,
101
+ data: require_zod.zod_exports.z.object({
102
+ requiredPermissions: require_zod.zod_exports.z.array(require_zod.zod_exports.z.string()).optional(),
103
+ action: require_zod.zod_exports.z.string().optional()
104
+ })
105
+ };
106
+ const TIMEOUT = {
107
+ status: 504,
108
+ data: require_zod.zod_exports.z.object({
109
+ timeoutMs: require_zod.zod_exports.z.number().int().min(0).optional(),
110
+ operation: require_zod.zod_exports.z.string().optional(),
111
+ retryable: require_zod.zod_exports.z.boolean().default(true)
112
+ })
113
+ };
114
+ const CONNECTION_ERROR = {
115
+ status: 502,
116
+ data: require_zod.zod_exports.z.object({
117
+ errorCode: require_zod.zod_exports.z.string().optional(),
118
+ host: require_zod.zod_exports.z.string().optional(),
119
+ port: require_zod.zod_exports.z.number().int().optional(),
120
+ suggestion: require_zod.zod_exports.z.string().optional()
121
+ })
122
+ };
123
+ /**
124
+ * Grouped export for all plugin errors.
125
+ * Use individual imports for cleaner code.
126
+ */
127
+ const PluginErrors = {
128
+ UNAUTHORIZED,
129
+ RATE_LIMITED,
130
+ SERVICE_UNAVAILABLE,
131
+ BAD_REQUEST,
132
+ NOT_FOUND,
133
+ FORBIDDEN,
134
+ TIMEOUT,
135
+ CONNECTION_ERROR
136
+ };
137
+ /**
138
+ * @deprecated Use individual imports or PluginErrors instead
139
+ */
140
+ const CommonPluginErrors = PluginErrors;
125
141
 
126
142
  //#endregion
143
+ exports.BAD_REQUEST = BAD_REQUEST;
144
+ exports.CONNECTION_ERROR = CONNECTION_ERROR;
127
145
  exports.CommonPluginErrors = CommonPluginErrors;
128
146
  exports.ERROR_PATTERNS = ERROR_PATTERNS;
147
+ exports.FORBIDDEN = FORBIDDEN;
129
148
  exports.ModuleFederationError = require_errors.ModuleFederationError;
149
+ exports.NOT_FOUND = NOT_FOUND;
150
+ exports.PluginErrors = PluginErrors;
130
151
  exports.PluginRuntimeError = require_errors.PluginRuntimeError;
152
+ exports.RATE_LIMITED = RATE_LIMITED;
153
+ exports.SERVICE_UNAVAILABLE = SERVICE_UNAVAILABLE;
154
+ exports.TIMEOUT = TIMEOUT;
155
+ exports.UNAUTHORIZED = UNAUTHORIZED;
131
156
  exports.ValidationError = require_errors.ValidationError;
157
+ exports.extractFromFiberFailure = require_errors.extractFromFiberFailure;
132
158
  exports.formatORPCError = require_errors.formatORPCError;
133
159
  exports.isRetryableORPCCode = require_errors.isRetryableORPCCode;
134
160
  exports.toPluginRuntimeError = require_errors.toPluginRuntimeError;
@@ -1 +1 @@
1
- {"version":3,"file":"errors.cjs","names":[],"sources":["../src/errors.ts"],"sourcesContent":["import { z } from \"./zod\";\n\n/**\n * Error pattern constants for categorizing infrastructure errors\n */\nexport const ERROR_PATTERNS = {\n\tCONNECTION_REFUSED: ['ECONNREFUSED'],\n\tHOST_NOT_FOUND: ['ENOTFOUND', 'EHOSTUNREACH'],\n\tTIMEOUT: ['ETIMEDOUT', 'ESOCKETTIMEDOUT', 'timeout'],\n\tCONNECTION_RESET: ['ECONNRESET', 'EPIPE'],\n\tPERMISSION: ['EACCES', 'EPERM', 'permission denied'],\n\tAUTH: ['401', 'unauthorized', 'authentication failed'],\n\tRATE_LIMITED: ['429', 'too many requests', 'rate limit'],\n\tSERVICE_UNAVAILABLE: ['503', 'service unavailable'],\n} as const;\n\n/**\n * Common error schemas for plugin contracts.\n * Import these to ensure consistent error handling across plugins.\n *\n * @example\n * ```typescript\n * import { CommonPluginErrors } from \"every-plugin/errors\";\n *\n * export const contract = oc.router({\n * getData: oc.route(...)\n * .errors(CommonPluginErrors)\n * });\n * ```\n */\nexport const CommonPluginErrors = {\n\tUNAUTHORIZED: {\n\t\tstatus: 401,\n\t\tdata: z.object({\n\t\t\tapiKeyProvided: z.boolean(),\n\t\t\tprovider: z.string().optional(),\n\t\t\tauthType: z.enum(['apiKey', 'oauth', 'token']).optional(),\n\t\t})\n\t},\n\tRATE_LIMITED: {\n\t\tstatus: 429,\n\t\tdata: z.object({\n\t\t\tretryAfter: z.number().int().min(1),\n\t\t\tremainingRequests: z.number().int().min(0).optional(),\n\t\t\tresetTime: z.string().datetime().optional(),\n\t\t\tlimitType: z.enum(['requests', 'tokens', 'bandwidth']).optional(),\n\t\t})\n\t},\n\tSERVICE_UNAVAILABLE: {\n\t\tstatus: 503,\n\t\tdata: z.object({\n\t\t\tretryAfter: z.number().int().optional(),\n\t\t\tmaintenanceWindow: z.boolean().default(false),\n\t\t\testimatedUptime: z.string().datetime().optional(),\n\t\t})\n\t},\n\tBAD_REQUEST: {\n\t\tstatus: 400,\n\t\tdata: z.object({\n\t\t\tinvalidFields: z.array(z.string()).optional(),\n\t\t\tvalidationErrors: z.array(z.object({\n\t\t\t\tfield: z.string(),\n\t\t\t\tmessage: z.string(),\n\t\t\t\tcode: z.string().optional(),\n\t\t\t})).optional(),\n\t\t})\n\t},\n\tNOT_FOUND: {\n\t\tstatus: 404,\n\t\tdata: z.object({\n\t\t\tresource: z.string().optional(),\n\t\t\tresourceId: z.string().optional(),\n\t\t})\n\t},\n\tFORBIDDEN: {\n\t\tstatus: 403,\n\t\tdata: z.object({\n\t\t\trequiredPermissions: z.array(z.string()).optional(),\n\t\t\taction: z.string().optional(),\n\t\t})\n\t},\n\tTIMEOUT: {\n\t\tstatus: 504,\n\t\tdata: z.object({\n\t\t\ttimeoutMs: z.number().int().min(0).optional(),\n\t\t\toperation: z.string().optional(),\n\t\t\tretryable: z.boolean().default(true),\n\t\t})\n\t},\n\tCONNECTION_ERROR: {\n\t\tstatus: 502,\n\t\tdata: z.object({\n\t\t\terrorCode: z.string().optional(),\n\t\t\thost: z.string().optional(),\n\t\t\tport: z.number().int().optional(),\n\t\t\tsuggestion: z.string().optional(),\n\t\t})\n\t}\n} as const;\n\nexport {\n\tformatORPCError,\n\tisRetryableORPCCode,\n\twrapORPCError,\n\ttoPluginRuntimeError,\n\tPluginRuntimeError,\n\tModuleFederationError,\n\tValidationError,\n} from \"./runtime/errors\";\n"],"mappings":";;;;;;;AAKA,MAAa,iBAAiB;CAC7B,oBAAoB,CAAC,eAAe;CACpC,gBAAgB,CAAC,aAAa,eAAe;CAC7C,SAAS;EAAC;EAAa;EAAmB;EAAU;CACpD,kBAAkB,CAAC,cAAc,QAAQ;CACzC,YAAY;EAAC;EAAU;EAAS;EAAoB;CACpD,MAAM;EAAC;EAAO;EAAgB;EAAwB;CACtD,cAAc;EAAC;EAAO;EAAqB;EAAa;CACxD,qBAAqB,CAAC,OAAO,sBAAsB;CACnD;;;;;;;;;;;;;;;AAgBD,MAAa,qBAAqB;CACjC,cAAc;EACb,QAAQ;EACR,8BAAM,EAAE,OAAO;GACd,wCAAgB,EAAE,SAAS;GAC3B,kCAAU,EAAE,QAAQ,CAAC,UAAU;GAC/B,kCAAU,EAAE,KAAK;IAAC;IAAU;IAAS;IAAQ,CAAC,CAAC,UAAU;GACzD,CAAC;EACF;CACD,cAAc;EACb,QAAQ;EACR,8BAAM,EAAE,OAAO;GACd,oCAAY,EAAE,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE;GACnC,2CAAmB,EAAE,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,UAAU;GACrD,mCAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,UAAU;GAC3C,mCAAW,EAAE,KAAK;IAAC;IAAY;IAAU;IAAY,CAAC,CAAC,UAAU;GACjE,CAAC;EACF;CACD,qBAAqB;EACpB,QAAQ;EACR,8BAAM,EAAE,OAAO;GACd,oCAAY,EAAE,QAAQ,CAAC,KAAK,CAAC,UAAU;GACvC,2CAAmB,EAAE,SAAS,CAAC,QAAQ,MAAM;GAC7C,yCAAiB,EAAE,QAAQ,CAAC,UAAU,CAAC,UAAU;GACjD,CAAC;EACF;CACD,aAAa;EACZ,QAAQ;EACR,8BAAM,EAAE,OAAO;GACd,uCAAe,EAAE,8BAAM,EAAE,QAAQ,CAAC,CAAC,UAAU;GAC7C,0CAAkB,EAAE,8BAAM,EAAE,OAAO;IAClC,+BAAO,EAAE,QAAQ;IACjB,iCAAS,EAAE,QAAQ;IACnB,8BAAM,EAAE,QAAQ,CAAC,UAAU;IAC3B,CAAC,CAAC,CAAC,UAAU;GACd,CAAC;EACF;CACD,WAAW;EACV,QAAQ;EACR,8BAAM,EAAE,OAAO;GACd,kCAAU,EAAE,QAAQ,CAAC,UAAU;GAC/B,oCAAY,EAAE,QAAQ,CAAC,UAAU;GACjC,CAAC;EACF;CACD,WAAW;EACV,QAAQ;EACR,8BAAM,EAAE,OAAO;GACd,6CAAqB,EAAE,8BAAM,EAAE,QAAQ,CAAC,CAAC,UAAU;GACnD,gCAAQ,EAAE,QAAQ,CAAC,UAAU;GAC7B,CAAC;EACF;CACD,SAAS;EACR,QAAQ;EACR,8BAAM,EAAE,OAAO;GACd,mCAAW,EAAE,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,UAAU;GAC7C,mCAAW,EAAE,QAAQ,CAAC,UAAU;GAChC,mCAAW,EAAE,SAAS,CAAC,QAAQ,KAAK;GACpC,CAAC;EACF;CACD,kBAAkB;EACjB,QAAQ;EACR,8BAAM,EAAE,OAAO;GACd,mCAAW,EAAE,QAAQ,CAAC,UAAU;GAChC,8BAAM,EAAE,QAAQ,CAAC,UAAU;GAC3B,8BAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,UAAU;GACjC,oCAAY,EAAE,QAAQ,CAAC,UAAU;GACjC,CAAC;EACF;CACD"}
1
+ {"version":3,"file":"errors.cjs","names":[],"sources":["../src/errors.ts"],"sourcesContent":["import { z } from \"./zod\";\n\n/**\n * Error pattern constants for categorizing infrastructure errors\n */\nexport const ERROR_PATTERNS = {\n\tCONNECTION_REFUSED: ['ECONNREFUSED'],\n\tHOST_NOT_FOUND: ['ENOTFOUND', 'EHOSTUNREACH'],\n\tTIMEOUT: ['ETIMEDOUT', 'ESOCKETTIMEDOUT', 'timeout'],\n\tCONNECTION_RESET: ['ECONNRESET', 'EPIPE'],\n\tPERMISSION: ['EACCES', 'EPERM', 'permission denied'],\n\tAUTH: ['401', 'unauthorized', 'authentication failed'],\n\tRATE_LIMITED: ['429', 'too many requests', 'rate limit'],\n\tSERVICE_UNAVAILABLE: ['503', 'service unavailable'],\n} as const;\n\n/**\n * Common error schemas for plugin contracts.\n * Import individually or use the grouped PluginErrors export.\n *\n * @example\n * ```typescript\n * import { NOT_FOUND, FORBIDDEN, UNAUTHORIZED } from \"every-plugin/errors\";\n *\n * export const contract = oc.router({\n * getData: oc.route(...)\n * .errors({ NOT_FOUND, FORBIDDEN, UNAUTHORIZED })\n * });\n * ```\n */\n\nexport const UNAUTHORIZED = {\n\tstatus: 401,\n\tdata: z.object({\n\t\tapiKeyProvided: z.boolean(),\n\t\tprovider: z.string().optional(),\n\t\tauthType: z.enum(['apiKey', 'oauth', 'token']).optional(),\n\t})\n} as const;\n\nexport const RATE_LIMITED = {\n\tstatus: 429,\n\tdata: z.object({\n\t\tretryAfter: z.number().int().min(1),\n\t\tremainingRequests: z.number().int().min(0).optional(),\n\t\tresetTime: z.string().datetime().optional(),\n\t\tlimitType: z.enum(['requests', 'tokens', 'bandwidth']).optional(),\n\t})\n} as const;\n\nexport const SERVICE_UNAVAILABLE = {\n\tstatus: 503,\n\tdata: z.object({\n\t\tretryAfter: z.number().int().optional(),\n\t\tmaintenanceWindow: z.boolean().default(false),\n\t\testimatedUptime: z.string().datetime().optional(),\n\t})\n} as const;\n\nexport const BAD_REQUEST = {\n\tstatus: 400,\n\tdata: z.object({\n\t\tinvalidFields: z.array(z.string()).optional(),\n\t\tvalidationErrors: z.array(z.object({\n\t\t\tfield: z.string(),\n\t\t\tmessage: z.string(),\n\t\t\tcode: z.string().optional(),\n\t\t})).optional(),\n\t})\n} as const;\n\nexport const NOT_FOUND = {\n\tstatus: 404,\n\tdata: z.object({\n\t\tresource: z.string().optional(),\n\t\tresourceId: z.string().optional(),\n\t})\n} as const;\n\nexport const FORBIDDEN = {\n\tstatus: 403,\n\tdata: z.object({\n\t\trequiredPermissions: z.array(z.string()).optional(),\n\t\taction: z.string().optional(),\n\t})\n} as const;\n\nexport const TIMEOUT = {\n\tstatus: 504,\n\tdata: z.object({\n\t\ttimeoutMs: z.number().int().min(0).optional(),\n\t\toperation: z.string().optional(),\n\t\tretryable: z.boolean().default(true),\n\t})\n} as const;\n\nexport const CONNECTION_ERROR = {\n\tstatus: 502,\n\tdata: z.object({\n\t\terrorCode: z.string().optional(),\n\t\thost: z.string().optional(),\n\t\tport: z.number().int().optional(),\n\t\tsuggestion: z.string().optional(),\n\t})\n} as const;\n\n/**\n * Grouped export for all plugin errors.\n * Use individual imports for cleaner code.\n */\nexport const PluginErrors = {\n\tUNAUTHORIZED,\n\tRATE_LIMITED,\n\tSERVICE_UNAVAILABLE,\n\tBAD_REQUEST,\n\tNOT_FOUND,\n\tFORBIDDEN,\n\tTIMEOUT,\n\tCONNECTION_ERROR,\n} as const;\n\n/**\n * @deprecated Use individual imports or PluginErrors instead\n */\nexport const CommonPluginErrors = PluginErrors;\n\nexport {\n\tformatORPCError,\n\tisRetryableORPCCode,\n\twrapORPCError,\n\ttoPluginRuntimeError,\n\textractFromFiberFailure,\n\tPluginRuntimeError,\n\tModuleFederationError,\n\tValidationError,\n} from \"./runtime/errors\";\n"],"mappings":";;;;;;;AAKA,MAAa,iBAAiB;CAC7B,oBAAoB,CAAC,eAAe;CACpC,gBAAgB,CAAC,aAAa,eAAe;CAC7C,SAAS;EAAC;EAAa;EAAmB;EAAU;CACpD,kBAAkB,CAAC,cAAc,QAAQ;CACzC,YAAY;EAAC;EAAU;EAAS;EAAoB;CACpD,MAAM;EAAC;EAAO;EAAgB;EAAwB;CACtD,cAAc;EAAC;EAAO;EAAqB;EAAa;CACxD,qBAAqB,CAAC,OAAO,sBAAsB;CACnD;;;;;;;;;;;;;;;AAiBD,MAAa,eAAe;CAC3B,QAAQ;CACR,8BAAM,EAAE,OAAO;EACd,wCAAgB,EAAE,SAAS;EAC3B,kCAAU,EAAE,QAAQ,CAAC,UAAU;EAC/B,kCAAU,EAAE,KAAK;GAAC;GAAU;GAAS;GAAQ,CAAC,CAAC,UAAU;EACzD,CAAC;CACF;AAED,MAAa,eAAe;CAC3B,QAAQ;CACR,8BAAM,EAAE,OAAO;EACd,oCAAY,EAAE,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE;EACnC,2CAAmB,EAAE,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,UAAU;EACrD,mCAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,UAAU;EAC3C,mCAAW,EAAE,KAAK;GAAC;GAAY;GAAU;GAAY,CAAC,CAAC,UAAU;EACjE,CAAC;CACF;AAED,MAAa,sBAAsB;CAClC,QAAQ;CACR,8BAAM,EAAE,OAAO;EACd,oCAAY,EAAE,QAAQ,CAAC,KAAK,CAAC,UAAU;EACvC,2CAAmB,EAAE,SAAS,CAAC,QAAQ,MAAM;EAC7C,yCAAiB,EAAE,QAAQ,CAAC,UAAU,CAAC,UAAU;EACjD,CAAC;CACF;AAED,MAAa,cAAc;CAC1B,QAAQ;CACR,8BAAM,EAAE,OAAO;EACd,uCAAe,EAAE,8BAAM,EAAE,QAAQ,CAAC,CAAC,UAAU;EAC7C,0CAAkB,EAAE,8BAAM,EAAE,OAAO;GAClC,+BAAO,EAAE,QAAQ;GACjB,iCAAS,EAAE,QAAQ;GACnB,8BAAM,EAAE,QAAQ,CAAC,UAAU;GAC3B,CAAC,CAAC,CAAC,UAAU;EACd,CAAC;CACF;AAED,MAAa,YAAY;CACxB,QAAQ;CACR,8BAAM,EAAE,OAAO;EACd,kCAAU,EAAE,QAAQ,CAAC,UAAU;EAC/B,oCAAY,EAAE,QAAQ,CAAC,UAAU;EACjC,CAAC;CACF;AAED,MAAa,YAAY;CACxB,QAAQ;CACR,8BAAM,EAAE,OAAO;EACd,6CAAqB,EAAE,8BAAM,EAAE,QAAQ,CAAC,CAAC,UAAU;EACnD,gCAAQ,EAAE,QAAQ,CAAC,UAAU;EAC7B,CAAC;CACF;AAED,MAAa,UAAU;CACtB,QAAQ;CACR,8BAAM,EAAE,OAAO;EACd,mCAAW,EAAE,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,UAAU;EAC7C,mCAAW,EAAE,QAAQ,CAAC,UAAU;EAChC,mCAAW,EAAE,SAAS,CAAC,QAAQ,KAAK;EACpC,CAAC;CACF;AAED,MAAa,mBAAmB;CAC/B,QAAQ;CACR,8BAAM,EAAE,OAAO;EACd,mCAAW,EAAE,QAAQ,CAAC,UAAU;EAChC,8BAAM,EAAE,QAAQ,CAAC,UAAU;EAC3B,8BAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,UAAU;EACjC,oCAAY,EAAE,QAAQ,CAAC,UAAU;EACjC,CAAC;CACF;;;;;AAMD,MAAa,eAAe;CAC3B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;;;;AAKD,MAAa,qBAAqB"}
package/dist/errors.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { zod_d_exports } from "./zod.cjs";
2
- import { ModuleFederationError, PluginRuntimeError, ValidationError, formatORPCError, isRetryableORPCCode, toPluginRuntimeError, wrapORPCError } from "./runtime/errors.cjs";
2
+ import { ModuleFederationError, PluginRuntimeError, ValidationError, extractFromFiberFailure, formatORPCError, isRetryableORPCCode, toPluginRuntimeError, wrapORPCError } from "./runtime/errors.cjs";
3
3
 
4
4
  //#region src/errors.d.ts
5
5
  /**
@@ -17,18 +17,177 @@ declare const ERROR_PATTERNS: {
17
17
  };
18
18
  /**
19
19
  * Common error schemas for plugin contracts.
20
- * Import these to ensure consistent error handling across plugins.
20
+ * Import individually or use the grouped PluginErrors export.
21
21
  *
22
22
  * @example
23
23
  * ```typescript
24
- * import { CommonPluginErrors } from "every-plugin/errors";
24
+ * import { NOT_FOUND, FORBIDDEN, UNAUTHORIZED } from "every-plugin/errors";
25
25
  *
26
26
  * export const contract = oc.router({
27
27
  * getData: oc.route(...)
28
- * .errors(CommonPluginErrors)
28
+ * .errors({ NOT_FOUND, FORBIDDEN, UNAUTHORIZED })
29
29
  * });
30
30
  * ```
31
31
  */
32
+ declare const UNAUTHORIZED: {
33
+ readonly status: 401;
34
+ readonly data: zod_d_exports.z.ZodObject<{
35
+ apiKeyProvided: zod_d_exports.z.ZodBoolean;
36
+ provider: zod_d_exports.z.ZodOptional<zod_d_exports.z.ZodString>;
37
+ authType: zod_d_exports.z.ZodOptional<zod_d_exports.z.ZodEnum<{
38
+ apiKey: "apiKey";
39
+ oauth: "oauth";
40
+ token: "token";
41
+ }>>;
42
+ }, zod_d_exports.z.core.$strip>;
43
+ };
44
+ declare const RATE_LIMITED: {
45
+ readonly status: 429;
46
+ readonly data: zod_d_exports.z.ZodObject<{
47
+ retryAfter: zod_d_exports.z.ZodNumber;
48
+ remainingRequests: zod_d_exports.z.ZodOptional<zod_d_exports.z.ZodNumber>;
49
+ resetTime: zod_d_exports.z.ZodOptional<zod_d_exports.z.ZodString>;
50
+ limitType: zod_d_exports.z.ZodOptional<zod_d_exports.z.ZodEnum<{
51
+ requests: "requests";
52
+ tokens: "tokens";
53
+ bandwidth: "bandwidth";
54
+ }>>;
55
+ }, zod_d_exports.z.core.$strip>;
56
+ };
57
+ declare const SERVICE_UNAVAILABLE: {
58
+ readonly status: 503;
59
+ readonly data: zod_d_exports.z.ZodObject<{
60
+ retryAfter: zod_d_exports.z.ZodOptional<zod_d_exports.z.ZodNumber>;
61
+ maintenanceWindow: zod_d_exports.z.ZodDefault<zod_d_exports.z.ZodBoolean>;
62
+ estimatedUptime: zod_d_exports.z.ZodOptional<zod_d_exports.z.ZodString>;
63
+ }, zod_d_exports.z.core.$strip>;
64
+ };
65
+ declare const BAD_REQUEST: {
66
+ readonly status: 400;
67
+ readonly data: zod_d_exports.z.ZodObject<{
68
+ invalidFields: zod_d_exports.z.ZodOptional<zod_d_exports.z.ZodArray<zod_d_exports.z.ZodString>>;
69
+ validationErrors: zod_d_exports.z.ZodOptional<zod_d_exports.z.ZodArray<zod_d_exports.z.ZodObject<{
70
+ field: zod_d_exports.z.ZodString;
71
+ message: zod_d_exports.z.ZodString;
72
+ code: zod_d_exports.z.ZodOptional<zod_d_exports.z.ZodString>;
73
+ }, zod_d_exports.z.core.$strip>>>;
74
+ }, zod_d_exports.z.core.$strip>;
75
+ };
76
+ declare const NOT_FOUND: {
77
+ readonly status: 404;
78
+ readonly data: zod_d_exports.z.ZodObject<{
79
+ resource: zod_d_exports.z.ZodOptional<zod_d_exports.z.ZodString>;
80
+ resourceId: zod_d_exports.z.ZodOptional<zod_d_exports.z.ZodString>;
81
+ }, zod_d_exports.z.core.$strip>;
82
+ };
83
+ declare const FORBIDDEN: {
84
+ readonly status: 403;
85
+ readonly data: zod_d_exports.z.ZodObject<{
86
+ requiredPermissions: zod_d_exports.z.ZodOptional<zod_d_exports.z.ZodArray<zod_d_exports.z.ZodString>>;
87
+ action: zod_d_exports.z.ZodOptional<zod_d_exports.z.ZodString>;
88
+ }, zod_d_exports.z.core.$strip>;
89
+ };
90
+ declare const TIMEOUT: {
91
+ readonly status: 504;
92
+ readonly data: zod_d_exports.z.ZodObject<{
93
+ timeoutMs: zod_d_exports.z.ZodOptional<zod_d_exports.z.ZodNumber>;
94
+ operation: zod_d_exports.z.ZodOptional<zod_d_exports.z.ZodString>;
95
+ retryable: zod_d_exports.z.ZodDefault<zod_d_exports.z.ZodBoolean>;
96
+ }, zod_d_exports.z.core.$strip>;
97
+ };
98
+ declare const CONNECTION_ERROR: {
99
+ readonly status: 502;
100
+ readonly data: zod_d_exports.z.ZodObject<{
101
+ errorCode: zod_d_exports.z.ZodOptional<zod_d_exports.z.ZodString>;
102
+ host: zod_d_exports.z.ZodOptional<zod_d_exports.z.ZodString>;
103
+ port: zod_d_exports.z.ZodOptional<zod_d_exports.z.ZodNumber>;
104
+ suggestion: zod_d_exports.z.ZodOptional<zod_d_exports.z.ZodString>;
105
+ }, zod_d_exports.z.core.$strip>;
106
+ };
107
+ /**
108
+ * Grouped export for all plugin errors.
109
+ * Use individual imports for cleaner code.
110
+ */
111
+ declare const PluginErrors: {
112
+ readonly UNAUTHORIZED: {
113
+ readonly status: 401;
114
+ readonly data: zod_d_exports.z.ZodObject<{
115
+ apiKeyProvided: zod_d_exports.z.ZodBoolean;
116
+ provider: zod_d_exports.z.ZodOptional<zod_d_exports.z.ZodString>;
117
+ authType: zod_d_exports.z.ZodOptional<zod_d_exports.z.ZodEnum<{
118
+ apiKey: "apiKey";
119
+ oauth: "oauth";
120
+ token: "token";
121
+ }>>;
122
+ }, zod_d_exports.z.core.$strip>;
123
+ };
124
+ readonly RATE_LIMITED: {
125
+ readonly status: 429;
126
+ readonly data: zod_d_exports.z.ZodObject<{
127
+ retryAfter: zod_d_exports.z.ZodNumber;
128
+ remainingRequests: zod_d_exports.z.ZodOptional<zod_d_exports.z.ZodNumber>;
129
+ resetTime: zod_d_exports.z.ZodOptional<zod_d_exports.z.ZodString>;
130
+ limitType: zod_d_exports.z.ZodOptional<zod_d_exports.z.ZodEnum<{
131
+ requests: "requests";
132
+ tokens: "tokens";
133
+ bandwidth: "bandwidth";
134
+ }>>;
135
+ }, zod_d_exports.z.core.$strip>;
136
+ };
137
+ readonly SERVICE_UNAVAILABLE: {
138
+ readonly status: 503;
139
+ readonly data: zod_d_exports.z.ZodObject<{
140
+ retryAfter: zod_d_exports.z.ZodOptional<zod_d_exports.z.ZodNumber>;
141
+ maintenanceWindow: zod_d_exports.z.ZodDefault<zod_d_exports.z.ZodBoolean>;
142
+ estimatedUptime: zod_d_exports.z.ZodOptional<zod_d_exports.z.ZodString>;
143
+ }, zod_d_exports.z.core.$strip>;
144
+ };
145
+ readonly BAD_REQUEST: {
146
+ readonly status: 400;
147
+ readonly data: zod_d_exports.z.ZodObject<{
148
+ invalidFields: zod_d_exports.z.ZodOptional<zod_d_exports.z.ZodArray<zod_d_exports.z.ZodString>>;
149
+ validationErrors: zod_d_exports.z.ZodOptional<zod_d_exports.z.ZodArray<zod_d_exports.z.ZodObject<{
150
+ field: zod_d_exports.z.ZodString;
151
+ message: zod_d_exports.z.ZodString;
152
+ code: zod_d_exports.z.ZodOptional<zod_d_exports.z.ZodString>;
153
+ }, zod_d_exports.z.core.$strip>>>;
154
+ }, zod_d_exports.z.core.$strip>;
155
+ };
156
+ readonly NOT_FOUND: {
157
+ readonly status: 404;
158
+ readonly data: zod_d_exports.z.ZodObject<{
159
+ resource: zod_d_exports.z.ZodOptional<zod_d_exports.z.ZodString>;
160
+ resourceId: zod_d_exports.z.ZodOptional<zod_d_exports.z.ZodString>;
161
+ }, zod_d_exports.z.core.$strip>;
162
+ };
163
+ readonly FORBIDDEN: {
164
+ readonly status: 403;
165
+ readonly data: zod_d_exports.z.ZodObject<{
166
+ requiredPermissions: zod_d_exports.z.ZodOptional<zod_d_exports.z.ZodArray<zod_d_exports.z.ZodString>>;
167
+ action: zod_d_exports.z.ZodOptional<zod_d_exports.z.ZodString>;
168
+ }, zod_d_exports.z.core.$strip>;
169
+ };
170
+ readonly TIMEOUT: {
171
+ readonly status: 504;
172
+ readonly data: zod_d_exports.z.ZodObject<{
173
+ timeoutMs: zod_d_exports.z.ZodOptional<zod_d_exports.z.ZodNumber>;
174
+ operation: zod_d_exports.z.ZodOptional<zod_d_exports.z.ZodString>;
175
+ retryable: zod_d_exports.z.ZodDefault<zod_d_exports.z.ZodBoolean>;
176
+ }, zod_d_exports.z.core.$strip>;
177
+ };
178
+ readonly CONNECTION_ERROR: {
179
+ readonly status: 502;
180
+ readonly data: zod_d_exports.z.ZodObject<{
181
+ errorCode: zod_d_exports.z.ZodOptional<zod_d_exports.z.ZodString>;
182
+ host: zod_d_exports.z.ZodOptional<zod_d_exports.z.ZodString>;
183
+ port: zod_d_exports.z.ZodOptional<zod_d_exports.z.ZodNumber>;
184
+ suggestion: zod_d_exports.z.ZodOptional<zod_d_exports.z.ZodString>;
185
+ }, zod_d_exports.z.core.$strip>;
186
+ };
187
+ };
188
+ /**
189
+ * @deprecated Use individual imports or PluginErrors instead
190
+ */
32
191
  declare const CommonPluginErrors: {
33
192
  readonly UNAUTHORIZED: {
34
193
  readonly status: 401;
@@ -107,5 +266,5 @@ declare const CommonPluginErrors: {
107
266
  };
108
267
  };
109
268
  //#endregion
110
- export { CommonPluginErrors, ERROR_PATTERNS, ModuleFederationError, PluginRuntimeError, ValidationError, formatORPCError, isRetryableORPCCode, toPluginRuntimeError, wrapORPCError };
269
+ export { BAD_REQUEST, CONNECTION_ERROR, CommonPluginErrors, ERROR_PATTERNS, FORBIDDEN, ModuleFederationError, NOT_FOUND, PluginErrors, PluginRuntimeError, RATE_LIMITED, SERVICE_UNAVAILABLE, TIMEOUT, UNAUTHORIZED, ValidationError, extractFromFiberFailure, formatORPCError, isRetryableORPCCode, toPluginRuntimeError, wrapORPCError };
111
270
  //# sourceMappingURL=errors.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.cts","names":[],"sources":["../src/errors.ts"],"sourcesContent":[],"mappings":";;;;;;;AAKa,cAAA,cASH,EAAA;EAgBG,SAAA,kBAoEH,EAAA,SAAA,CAAA,cAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;cApEG"}
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"}