every-plugin 0.8.3 → 0.8.4
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/errors.cjs +105 -79
- package/dist/errors.cjs.map +1 -1
- package/dist/errors.d.cts +164 -5
- package/dist/errors.d.cts.map +1 -1
- package/dist/errors.d.mts +164 -5
- package/dist/errors.d.mts.map +1 -1
- package/dist/errors.mjs +97 -81
- package/dist/errors.mjs.map +1 -1
- package/dist/index.cjs +10 -0
- package/dist/index.d.cts +3 -3
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +3 -3
- package/dist/package.cjs +1 -1
- package/dist/package.cjs.map +1 -1
- package/dist/package.mjs +1 -1
- package/dist/package.mjs.map +1 -1
- package/dist/plugin.cjs +3 -0
- package/dist/plugin.cjs.map +1 -1
- package/dist/plugin.d.cts.map +1 -1
- package/dist/plugin.d.mts.map +1 -1
- package/dist/plugin.mjs +4 -1
- package/dist/plugin.mjs.map +1 -1
- package/dist/runtime/errors.cjs +19 -0
- package/dist/runtime/errors.cjs.map +1 -1
- package/dist/runtime/errors.d.cts +11 -5
- package/dist/runtime/errors.d.cts.map +1 -1
- package/dist/runtime/errors.d.mts +11 -5
- package/dist/runtime/errors.d.mts.map +1 -1
- package/dist/runtime/errors.mjs +20 -2
- package/dist/runtime/errors.mjs.map +1 -1
- package/package.json +1 -1
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
|
|
36
|
+
* Import individually or use the grouped PluginErrors export.
|
|
37
37
|
*
|
|
38
38
|
* @example
|
|
39
39
|
* ```typescript
|
|
40
|
-
* import {
|
|
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(
|
|
44
|
+
* .errors({ NOT_FOUND, FORBIDDEN, UNAUTHORIZED })
|
|
45
45
|
* });
|
|
46
46
|
* ```
|
|
47
47
|
*/
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
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;
|
package/dist/errors.cjs.map
CHANGED
|
@@ -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
|
|
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
|
|
20
|
+
* Import individually or use the grouped PluginErrors export.
|
|
21
21
|
*
|
|
22
22
|
* @example
|
|
23
23
|
* ```typescript
|
|
24
|
-
* import {
|
|
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(
|
|
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
|
package/dist/errors.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.cts","names":[],"sources":["../src/errors.ts"],"sourcesContent":[],"mappings":";;;;;;;AAKa,cAAA,cASH,EAAA;
|
|
1
|
+
{"version":3,"file":"errors.d.cts","names":[],"sources":["../src/errors.ts"],"sourcesContent":[],"mappings":";;;;;;;AAKa,cAAA,cASH,EAAA;EAiBG,SAAA,kBAOH,EAAA,SAAA,CAAA,cAAA,CAAA;;;;;;;;;AAEV;;;;;;;;;;;AAUA;;;cAnBa;;;;;;;MA4BA,KAAA,EAUH,OAAA;;;;;cA7BG;;;;;;;;;;IA+BA,CAAA,CAAA,CAAA;;;cArBA;;;;;IA6BA,eAMH,6BAAA,0BAAA,CAAA;;;cA1BG;;;;;;MA4BA,OAOH,2BAAA;;;;;cAvBG;;;;;EAyBA,CAAA,6BAAA,CAAA;;cAjBA;;;;;;;cAQA;;;IAuBA,SAAA,6BASH,0BAAA,CAAA;;;;;cAvBG;;;;;;;;;;;;;cAcA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAcA,SAAA,SAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAAA"}
|
package/dist/errors.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { zod_d_exports } from "./zod.mjs";
|
|
2
|
-
import { ModuleFederationError, PluginRuntimeError, ValidationError, formatORPCError, isRetryableORPCCode, toPluginRuntimeError, wrapORPCError } from "./runtime/errors.mjs";
|
|
2
|
+
import { ModuleFederationError, PluginRuntimeError, ValidationError, extractFromFiberFailure, formatORPCError, isRetryableORPCCode, toPluginRuntimeError, wrapORPCError } from "./runtime/errors.mjs";
|
|
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
|
|
20
|
+
* Import individually or use the grouped PluginErrors export.
|
|
21
21
|
*
|
|
22
22
|
* @example
|
|
23
23
|
* ```typescript
|
|
24
|
-
* import {
|
|
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(
|
|
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.mts.map
|
package/dist/errors.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.mts","names":[],"sources":["../src/errors.ts"],"sourcesContent":[],"mappings":";;;;;;;AAKa,cAAA,cASH,EAAA;
|
|
1
|
+
{"version":3,"file":"errors.d.mts","names":[],"sources":["../src/errors.ts"],"sourcesContent":[],"mappings":";;;;;;;AAKa,cAAA,cASH,EAAA;EAiBG,SAAA,kBAOH,EAAA,SAAA,CAAA,cAAA,CAAA;;;;;;;;;AAEV;;;;;;;;;;;AAUA;;;cAnBa;;;;;;;MA4BA,KAAA,EAUH,OAAA;;;;;cA7BG;;;;;;;;;;IA+BA,CAAA,CAAA,CAAA;;;cArBA;;;;;IA6BA,eAMH,6BAAA,0BAAA,CAAA;;;cA1BG;;;;;;MA4BA,OAOH,2BAAA;;;;;cAvBG;;;;;EAyBA,CAAA,6BAAA,CAAA;;cAjBA;;;;;;;cAQA;;;IAuBA,SAAA,6BASH,0BAAA,CAAA;;;;;cAvBG;;;;;;;;;;;;;cAcA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAcA,SAAA,SAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAAA"}
|