@shware/http 2.11.3 → 2.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/_rolldown/runtime.cjs +13 -0
- package/dist/_virtual/_rolldown/runtime.mjs +13 -0
- package/dist/cache/index.cjs +5 -30
- package/dist/cache/index.cjs.map +1 -1
- package/dist/cache/index.d.cts +7 -5
- package/dist/cache/index.d.cts.map +1 -0
- package/dist/cache/index.d.mts +11 -0
- package/dist/cache/index.d.mts.map +1 -0
- package/dist/cache/index.mjs +5 -6
- package/dist/cache/index.mjs.map +1 -1
- package/dist/error/detail.cjs +100 -90
- package/dist/error/detail.cjs.map +1 -1
- package/dist/error/detail.d.cts +77 -78
- package/dist/error/detail.d.cts.map +1 -0
- package/dist/error/detail.d.mts +108 -0
- package/dist/error/detail.d.mts.map +1 -0
- package/dist/error/detail.mjs +99 -65
- package/dist/error/detail.mjs.map +1 -1
- package/dist/error/i18n/en-us.cjs +5 -29
- package/dist/error/i18n/en-us.cjs.map +1 -1
- package/dist/error/i18n/en-us.d.cts +3 -1
- package/dist/error/i18n/en-us.d.cts.map +1 -0
- package/dist/error/i18n/en-us.d.mts +5 -0
- package/dist/error/i18n/en-us.d.mts.map +1 -0
- package/dist/error/i18n/en-us.mjs +5 -5
- package/dist/error/i18n/en-us.mjs.map +1 -1
- package/dist/error/index.cjs +29 -56
- package/dist/error/index.cjs.map +1 -1
- package/dist/error/index.d.cts +12 -10
- package/dist/error/index.d.cts.map +1 -0
- package/dist/error/index.d.mts +21 -0
- package/dist/error/index.d.mts.map +1 -0
- package/dist/error/index.mjs +25 -28
- package/dist/error/index.mjs.map +1 -1
- package/dist/error/parse.cjs +63 -61
- package/dist/error/parse.cjs.map +1 -1
- package/dist/error/parse.d.cts +8 -7
- package/dist/error/parse.d.cts.map +1 -0
- package/dist/error/{parse.d.ts → parse.d.mts} +8 -7
- package/dist/error/parse.d.mts.map +1 -0
- package/dist/error/parse.mjs +59 -33
- package/dist/error/parse.mjs.map +1 -1
- package/dist/error/reason.cjs +0 -19
- package/dist/error/reason.d.cts +5 -4
- package/dist/error/reason.d.cts.map +1 -0
- package/dist/error/reason.d.mts +6 -0
- package/dist/error/reason.d.mts.map +1 -0
- package/dist/error/reason.mjs +1 -1
- package/dist/error/status.cjs +103 -256
- package/dist/error/status.cjs.map +1 -1
- package/dist/error/status.d.cts +58 -58
- package/dist/error/status.d.cts.map +1 -0
- package/dist/error/status.d.mts +69 -0
- package/dist/error/status.d.mts.map +1 -0
- package/dist/error/status.mjs +98 -227
- package/dist/error/status.mjs.map +1 -1
- package/dist/google-one-tap/index.cjs +135 -138
- package/dist/google-one-tap/index.cjs.map +1 -1
- package/dist/google-one-tap/index.d.cts +49 -48
- package/dist/google-one-tap/index.d.cts.map +1 -0
- package/dist/google-one-tap/index.d.mts +82 -0
- package/dist/google-one-tap/index.d.mts.map +1 -0
- package/dist/google-one-tap/index.mjs +133 -112
- package/dist/google-one-tap/index.mjs.map +1 -1
- package/dist/google-one-tap/types.cjs +0 -19
- package/dist/google-one-tap/types.d.cts +124 -122
- package/dist/google-one-tap/types.d.cts.map +1 -0
- package/dist/google-one-tap/types.d.mts +157 -0
- package/dist/google-one-tap/types.d.mts.map +1 -0
- package/dist/google-one-tap/types.mjs +1 -1
- package/dist/hono/authorizer.cjs +28 -65
- package/dist/hono/authorizer.cjs.map +1 -1
- package/dist/hono/authorizer.d.cts +12 -11
- package/dist/hono/authorizer.d.cts.map +1 -0
- package/dist/hono/authorizer.d.mts +19 -0
- package/dist/hono/authorizer.d.mts.map +1 -0
- package/dist/hono/authorizer.mjs +23 -36
- package/dist/hono/authorizer.mjs.map +1 -1
- package/dist/hono/csrf.cjs +81 -92
- package/dist/hono/csrf.cjs.map +1 -1
- package/dist/hono/csrf.d.cts +46 -45
- package/dist/hono/csrf.d.cts.map +1 -0
- package/dist/hono/csrf.d.mts +76 -0
- package/dist/hono/csrf.d.mts.map +1 -0
- package/dist/hono/csrf.mjs +76 -63
- package/dist/hono/csrf.mjs.map +1 -1
- package/dist/hono/geolocation.cjs +10 -34
- package/dist/hono/geolocation.cjs.map +1 -1
- package/dist/hono/geolocation.d.cts +5 -4
- package/dist/hono/geolocation.d.cts.map +1 -0
- package/dist/hono/geolocation.d.mts +7 -0
- package/dist/hono/geolocation.d.mts.map +1 -0
- package/dist/hono/geolocation.mjs +8 -12
- package/dist/hono/geolocation.mjs.map +1 -1
- package/dist/hono/handler.cjs +37 -61
- package/dist/hono/handler.cjs.map +1 -1
- package/dist/hono/handler.d.cts +26 -25
- package/dist/hono/handler.d.cts.map +1 -0
- package/dist/hono/handler.d.mts +32 -0
- package/dist/hono/handler.d.mts.map +1 -0
- package/dist/hono/handler.mjs +34 -34
- package/dist/hono/handler.mjs.map +1 -1
- package/dist/hono/index.cjs +14 -48
- package/dist/hono/index.d.cts +7 -15
- package/dist/hono/index.d.mts +7 -0
- package/dist/hono/index.mjs +4 -14
- package/dist/hono/rate-limit.cjs +65 -110
- package/dist/hono/rate-limit.cjs.map +1 -1
- package/dist/hono/rate-limit.d.cts +27 -26
- package/dist/hono/rate-limit.d.cts.map +1 -0
- package/dist/hono/rate-limit.d.mts +36 -0
- package/dist/hono/rate-limit.d.mts.map +1 -0
- package/dist/hono/rate-limit.mjs +60 -81
- package/dist/hono/rate-limit.mjs.map +1 -1
- package/dist/hono/validator.cjs +47 -66
- package/dist/hono/validator.cjs.map +1 -1
- package/dist/hono/validator.d.cts +25 -30
- package/dist/hono/validator.d.cts.map +1 -0
- package/dist/hono/validator.d.mts +26 -0
- package/dist/hono/validator.d.mts.map +1 -0
- package/dist/hono/validator.mjs +43 -43
- package/dist/hono/validator.mjs.map +1 -1
- package/dist/index.cjs +39 -95
- package/dist/index.d.cts +12 -14
- package/dist/index.d.mts +12 -0
- package/dist/index.mjs +5 -48
- package/dist/iso/iso_3601_1.cjs +1512 -290
- package/dist/iso/iso_3601_1.cjs.map +1 -1
- package/dist/iso/iso_3601_1.d.cts +8 -6
- package/dist/iso/iso_3601_1.d.cts.map +1 -0
- package/dist/iso/iso_3601_1.d.mts +11 -0
- package/dist/iso/iso_3601_1.d.mts.map +1 -0
- package/dist/iso/iso_3601_1.mjs +1511 -265
- package/dist/iso/iso_3601_1.mjs.map +1 -1
- package/dist/max-length/index.cjs +158 -91
- package/dist/max-length/index.cjs.map +1 -1
- package/dist/max-length/index.d.cts +110 -1
- package/dist/max-length/index.d.cts.map +1 -0
- package/dist/{index-BhgdyigB.d.ts → max-length/index.d.mts} +9 -28
- package/dist/max-length/index.d.mts.map +1 -0
- package/dist/max-length/index.mjs +133 -47
- package/dist/max-length/index.mjs.map +1 -1
- package/dist/message.cjs +5 -30
- package/dist/message.cjs.map +1 -1
- package/dist/message.d.cts +3 -1
- package/dist/message.d.cts.map +1 -0
- package/dist/{message.d.ts → message.d.mts} +3 -1
- package/dist/message.d.mts.map +1 -0
- package/dist/message.mjs +5 -6
- package/dist/message.mjs.map +1 -1
- package/dist/polyfills/index.cjs +4 -4
- package/dist/polyfills/index.cjs.map +1 -1
- package/dist/polyfills/index.d.cts +1 -2
- package/dist/polyfills/index.d.mts +1 -0
- package/dist/polyfills/index.mjs +5 -2
- package/dist/polyfills/index.mjs.map +1 -1
- package/dist/response.cjs +191 -208
- package/dist/response.cjs.map +1 -1
- package/dist/response.d.cts +53 -54
- package/dist/response.d.cts.map +1 -0
- package/dist/response.d.mts +82 -0
- package/dist/response.d.mts.map +1 -0
- package/dist/response.mjs +182 -175
- package/dist/response.mjs.map +1 -1
- package/dist/snowflake.cjs +48 -70
- package/dist/snowflake.cjs.map +1 -1
- package/dist/snowflake.d.cts +16 -14
- package/dist/snowflake.d.cts.map +1 -0
- package/dist/snowflake.d.mts +31 -0
- package/dist/snowflake.d.mts.map +1 -0
- package/dist/snowflake.mjs +46 -44
- package/dist/snowflake.mjs.map +1 -1
- package/dist/utils/geolocation.cjs +51 -75
- package/dist/utils/geolocation.cjs.map +1 -1
- package/dist/utils/geolocation.d.cts +14 -12
- package/dist/utils/geolocation.d.cts.map +1 -0
- package/dist/utils/{geolocation.d.ts → geolocation.d.mts} +14 -12
- package/dist/utils/geolocation.d.mts.map +1 -0
- package/dist/utils/geolocation.mjs +47 -47
- package/dist/utils/geolocation.mjs.map +1 -1
- package/dist/utils/google-tag-gateway.cjs +35 -56
- package/dist/utils/google-tag-gateway.cjs.map +1 -1
- package/dist/utils/google-tag-gateway.d.cts +3 -1
- package/dist/utils/google-tag-gateway.d.cts.map +1 -0
- package/dist/utils/{google-tag-gateway.d.ts → google-tag-gateway.d.mts} +3 -1
- package/dist/utils/google-tag-gateway.d.mts.map +1 -0
- package/dist/utils/google-tag-gateway.mjs +33 -30
- package/dist/utils/google-tag-gateway.mjs.map +1 -1
- package/dist/utils/timing.cjs +50 -71
- package/dist/utils/timing.cjs.map +1 -1
- package/dist/utils/timing.d.cts +11 -9
- package/dist/utils/timing.d.cts.map +1 -0
- package/dist/utils/timing.d.mts +15 -0
- package/dist/utils/timing.d.mts.map +1 -0
- package/dist/utils/timing.mjs +49 -46
- package/dist/utils/timing.mjs.map +1 -1
- package/dist/webhook/index.cjs +43 -72
- package/dist/webhook/index.cjs.map +1 -1
- package/dist/webhook/index.d.cts +3 -1
- package/dist/webhook/index.d.cts.map +1 -0
- package/dist/webhook/{index.d.ts → index.d.mts} +3 -1
- package/dist/webhook/index.d.mts.map +1 -0
- package/dist/webhook/index.mjs +41 -46
- package/dist/webhook/index.mjs.map +1 -1
- package/package.json +50 -25
- package/dist/cache/index.d.ts +0 -9
- package/dist/error/detail.d.ts +0 -109
- package/dist/error/i18n/en-us.d.ts +0 -3
- package/dist/error/index.d.ts +0 -19
- package/dist/error/reason.cjs.map +0 -1
- package/dist/error/reason.d.ts +0 -5
- package/dist/error/reason.mjs.map +0 -1
- package/dist/error/status.d.ts +0 -69
- package/dist/google-one-tap/index.d.ts +0 -81
- package/dist/google-one-tap/types.cjs.map +0 -1
- package/dist/google-one-tap/types.d.ts +0 -155
- package/dist/google-one-tap/types.mjs.map +0 -1
- package/dist/hono/authorizer.d.ts +0 -18
- package/dist/hono/csrf.d.ts +0 -75
- package/dist/hono/geolocation.d.ts +0 -6
- package/dist/hono/handler.d.ts +0 -31
- package/dist/hono/index.cjs.map +0 -1
- package/dist/hono/index.d.ts +0 -15
- package/dist/hono/index.mjs.map +0 -1
- package/dist/hono/rate-limit.d.ts +0 -35
- package/dist/hono/validator.d.ts +0 -31
- package/dist/index-BhgdyigB.d.cts +0 -129
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.ts +0 -14
- package/dist/index.mjs.map +0 -1
- package/dist/iso/iso_3601_1.d.ts +0 -9
- package/dist/max-length/index.d.ts +0 -1
- package/dist/polyfills/index.d.ts +0 -2
- package/dist/response.d.ts +0 -83
- package/dist/snowflake.d.ts +0 -29
- package/dist/utils/timing.d.ts +0 -13
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __exportAll = (all, no_symbols) => {
|
|
4
|
+
let target = {};
|
|
5
|
+
for (var name in all) __defProp(target, name, {
|
|
6
|
+
get: all[name],
|
|
7
|
+
enumerable: true
|
|
8
|
+
});
|
|
9
|
+
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
10
|
+
return target;
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
13
|
+
exports.__exportAll = __exportAll;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __exportAll = (all, no_symbols) => {
|
|
4
|
+
let target = {};
|
|
5
|
+
for (var name in all) __defProp(target, name, {
|
|
6
|
+
get: all[name],
|
|
7
|
+
enumerable: true
|
|
8
|
+
});
|
|
9
|
+
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
10
|
+
return target;
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
13
|
+
export { __exportAll };
|
package/dist/cache/index.cjs
CHANGED
|
@@ -1,32 +1,7 @@
|
|
|
1
|
-
"
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
//#region src/cache/index.ts
|
|
3
|
+
function cache(_props) {}
|
|
4
|
+
//#endregion
|
|
5
|
+
exports.cache = cache;
|
|
19
6
|
|
|
20
|
-
// src/cache/index.ts
|
|
21
|
-
var cache_exports = {};
|
|
22
|
-
__export(cache_exports, {
|
|
23
|
-
cache: () => cache
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(cache_exports);
|
|
26
|
-
function cache(_props) {
|
|
27
|
-
}
|
|
28
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
29
|
-
0 && (module.exports = {
|
|
30
|
-
cache
|
|
31
|
-
});
|
|
32
7
|
//# sourceMappingURL=index.cjs.map
|
package/dist/cache/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/cache/index.ts"],"sourcesContent":["interface Props<A extends unknown[], R> {\n name: string;\n key: (...args: A) => string;\n fn: (...args: A) => R;\n condition?: (...args: A) => boolean;\n}\n\nexport function cache<A extends unknown[], R>(_props: Props<A, R>) {}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","names":[],"sources":["../../src/cache/index.ts"],"sourcesContent":["interface Props<A extends unknown[], R> {\n name: string;\n key: (...args: A) => string;\n fn: (...args: A) => R;\n condition?: (...args: A) => boolean;\n}\n\nexport function cache<A extends unknown[], R>(_props: Props<A, R>) {}\n"],"mappings":";;AAOA,SAAgB,MAA8B,QAAqB,CAAC"}
|
package/dist/cache/index.d.cts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
//#region src/cache/index.d.ts
|
|
1
2
|
interface Props<A extends unknown[], R> {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
name: string;
|
|
4
|
+
key: (...args: A) => string;
|
|
5
|
+
fn: (...args: A) => R;
|
|
6
|
+
condition?: (...args: A) => boolean;
|
|
6
7
|
}
|
|
7
8
|
declare function cache<A extends unknown[], R>(_props: Props<A, R>): void;
|
|
8
|
-
|
|
9
|
+
//#endregion
|
|
9
10
|
export { cache };
|
|
11
|
+
//# sourceMappingURL=index.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../../src/cache/index.ts"],"mappings":";UAAU,MAAM,qBAAqB;EACnC;EACA,SAAS,MAAM;EACf,QAAQ,MAAM,MAAM;EACpB,gBAAgB,MAAM;;iBAGR,MAAM,qBAAqB,GAAG,QAAQ,MAAM,GAAG"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//#region src/cache/index.d.ts
|
|
2
|
+
interface Props<A extends unknown[], R> {
|
|
3
|
+
name: string;
|
|
4
|
+
key: (...args: A) => string;
|
|
5
|
+
fn: (...args: A) => R;
|
|
6
|
+
condition?: (...args: A) => boolean;
|
|
7
|
+
}
|
|
8
|
+
declare function cache<A extends unknown[], R>(_props: Props<A, R>): void;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { cache };
|
|
11
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/cache/index.ts"],"mappings":";UAAU,MAAM,qBAAqB;EACnC;EACA,SAAS,MAAM;EACf,QAAQ,MAAM,MAAM;EACpB,gBAAgB,MAAM;;iBAGR,MAAM,qBAAqB,GAAG,QAAQ,MAAM,GAAG"}
|
package/dist/cache/index.mjs
CHANGED
package/dist/cache/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/cache/index.ts"],"sourcesContent":["interface Props<A extends unknown[], R> {\n name: string;\n key: (...args: A) => string;\n fn: (...args: A) => R;\n condition?: (...args: A) => boolean;\n}\n\nexport function cache<A extends unknown[], R>(_props: Props<A, R>) {}\n"],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/cache/index.ts"],"sourcesContent":["interface Props<A extends unknown[], R> {\n name: string;\n key: (...args: A) => string;\n fn: (...args: A) => R;\n condition?: (...args: A) => boolean;\n}\n\nexport function cache<A extends unknown[], R>(_props: Props<A, R>) {}\n"],"mappings":";AAOA,SAAgB,MAA8B,QAAqB,CAAC"}
|
package/dist/error/detail.cjs
CHANGED
|
@@ -1,93 +1,103 @@
|
|
|
1
|
-
"
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
//#region src/error/detail.ts
|
|
3
|
+
let DetailType = /* @__PURE__ */ function(DetailType) {
|
|
4
|
+
DetailType["ERROR_INFO"] = "type.googleapis.com/google.rpc.ErrorInfo";
|
|
5
|
+
DetailType["RETRY_INFO"] = "type.googleapis.com/google.rpc.RetryInfo";
|
|
6
|
+
DetailType["DEBUG_INFO"] = "type.googleapis.com/google.rpc.DebugInfo";
|
|
7
|
+
DetailType["QUOTA_FAILURE"] = "type.googleapis.com/google.rpc.QuotaFailure";
|
|
8
|
+
DetailType["PRECONDITION_FAILURE"] = "type.googleapis.com/google.rpc.PreconditionFailure";
|
|
9
|
+
DetailType["BAD_REQUEST"] = "type.googleapis.com/google.rpc.BadRequest";
|
|
10
|
+
DetailType["REQUEST_INFO"] = "type.googleapis.com/google.rpc.RequestInfo";
|
|
11
|
+
DetailType["RESOURCE_INFO"] = "type.googleapis.com/google.rpc.ResourceInfo";
|
|
12
|
+
DetailType["HELP"] = "type.googleapis.com/google.rpc.Help";
|
|
13
|
+
DetailType["LOCALIZED_MESSAGE"] = "type.googleapis.com/google.rpc.LocalizedMessage";
|
|
14
|
+
return DetailType;
|
|
15
|
+
}({});
|
|
16
|
+
/**
|
|
17
|
+
* Example usage:
|
|
18
|
+
* const details = Details.new()
|
|
19
|
+
* .requestInfo({ requestId: '1234567890', servingData: '/v1/tests' })
|
|
20
|
+
* .errorInfo({ reason: 'ACCOUNT_LOCKED' });
|
|
21
|
+
* */
|
|
22
|
+
var Details = class Details {
|
|
23
|
+
list = [];
|
|
24
|
+
constructor() {}
|
|
25
|
+
static new() {
|
|
26
|
+
return new Details();
|
|
27
|
+
}
|
|
28
|
+
errorInfo(detail) {
|
|
29
|
+
this.list.push({
|
|
30
|
+
"@type": "type.googleapis.com/google.rpc.ErrorInfo",
|
|
31
|
+
...detail
|
|
32
|
+
});
|
|
33
|
+
return this;
|
|
34
|
+
}
|
|
35
|
+
retryInfo(detail) {
|
|
36
|
+
this.list.push({
|
|
37
|
+
"@type": "type.googleapis.com/google.rpc.RetryInfo",
|
|
38
|
+
...detail
|
|
39
|
+
});
|
|
40
|
+
return this;
|
|
41
|
+
}
|
|
42
|
+
debugInfo(detail) {
|
|
43
|
+
this.list.push({
|
|
44
|
+
"@type": "type.googleapis.com/google.rpc.DebugInfo",
|
|
45
|
+
...detail
|
|
46
|
+
});
|
|
47
|
+
return this;
|
|
48
|
+
}
|
|
49
|
+
quotaFailure(detail) {
|
|
50
|
+
this.list.push({
|
|
51
|
+
"@type": "type.googleapis.com/google.rpc.QuotaFailure",
|
|
52
|
+
...detail
|
|
53
|
+
});
|
|
54
|
+
return this;
|
|
55
|
+
}
|
|
56
|
+
preconditionFailure(detail) {
|
|
57
|
+
this.list.push({
|
|
58
|
+
"@type": "type.googleapis.com/google.rpc.PreconditionFailure",
|
|
59
|
+
...detail
|
|
60
|
+
});
|
|
61
|
+
return this;
|
|
62
|
+
}
|
|
63
|
+
badRequest(detail) {
|
|
64
|
+
this.list.push({
|
|
65
|
+
"@type": "type.googleapis.com/google.rpc.BadRequest",
|
|
66
|
+
...detail
|
|
67
|
+
});
|
|
68
|
+
return this;
|
|
69
|
+
}
|
|
70
|
+
requestInfo(detail) {
|
|
71
|
+
this.list.push({
|
|
72
|
+
"@type": "type.googleapis.com/google.rpc.RequestInfo",
|
|
73
|
+
...detail
|
|
74
|
+
});
|
|
75
|
+
return this;
|
|
76
|
+
}
|
|
77
|
+
resourceInfo(detail) {
|
|
78
|
+
this.list.push({
|
|
79
|
+
"@type": "type.googleapis.com/google.rpc.ResourceInfo",
|
|
80
|
+
...detail
|
|
81
|
+
});
|
|
82
|
+
return this;
|
|
83
|
+
}
|
|
84
|
+
help(detail) {
|
|
85
|
+
this.list.push({
|
|
86
|
+
"@type": "type.googleapis.com/google.rpc.Help",
|
|
87
|
+
...detail
|
|
88
|
+
});
|
|
89
|
+
return this;
|
|
90
|
+
}
|
|
91
|
+
localizedMessage(detail) {
|
|
92
|
+
this.list.push({
|
|
93
|
+
"@type": "type.googleapis.com/google.rpc.LocalizedMessage",
|
|
94
|
+
...detail
|
|
95
|
+
});
|
|
96
|
+
return this;
|
|
97
|
+
}
|
|
9
98
|
};
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
99
|
+
//#endregion
|
|
100
|
+
exports.DetailType = DetailType;
|
|
101
|
+
exports.Details = Details;
|
|
19
102
|
|
|
20
|
-
// src/error/detail.ts
|
|
21
|
-
var detail_exports = {};
|
|
22
|
-
__export(detail_exports, {
|
|
23
|
-
DetailType: () => DetailType,
|
|
24
|
-
Details: () => Details
|
|
25
|
-
});
|
|
26
|
-
module.exports = __toCommonJS(detail_exports);
|
|
27
|
-
var DetailType = /* @__PURE__ */ ((DetailType2) => {
|
|
28
|
-
DetailType2["ERROR_INFO"] = "type.googleapis.com/google.rpc.ErrorInfo";
|
|
29
|
-
DetailType2["RETRY_INFO"] = "type.googleapis.com/google.rpc.RetryInfo";
|
|
30
|
-
DetailType2["DEBUG_INFO"] = "type.googleapis.com/google.rpc.DebugInfo";
|
|
31
|
-
DetailType2["QUOTA_FAILURE"] = "type.googleapis.com/google.rpc.QuotaFailure";
|
|
32
|
-
DetailType2["PRECONDITION_FAILURE"] = "type.googleapis.com/google.rpc.PreconditionFailure";
|
|
33
|
-
DetailType2["BAD_REQUEST"] = "type.googleapis.com/google.rpc.BadRequest";
|
|
34
|
-
DetailType2["REQUEST_INFO"] = "type.googleapis.com/google.rpc.RequestInfo";
|
|
35
|
-
DetailType2["RESOURCE_INFO"] = "type.googleapis.com/google.rpc.ResourceInfo";
|
|
36
|
-
DetailType2["HELP"] = "type.googleapis.com/google.rpc.Help";
|
|
37
|
-
DetailType2["LOCALIZED_MESSAGE"] = "type.googleapis.com/google.rpc.LocalizedMessage";
|
|
38
|
-
return DetailType2;
|
|
39
|
-
})(DetailType || {});
|
|
40
|
-
var Details = class _Details {
|
|
41
|
-
list = [];
|
|
42
|
-
constructor() {
|
|
43
|
-
}
|
|
44
|
-
static new() {
|
|
45
|
-
return new _Details();
|
|
46
|
-
}
|
|
47
|
-
errorInfo(detail) {
|
|
48
|
-
this.list.push({ "@type": "type.googleapis.com/google.rpc.ErrorInfo" /* ERROR_INFO */, ...detail });
|
|
49
|
-
return this;
|
|
50
|
-
}
|
|
51
|
-
retryInfo(detail) {
|
|
52
|
-
this.list.push({ "@type": "type.googleapis.com/google.rpc.RetryInfo" /* RETRY_INFO */, ...detail });
|
|
53
|
-
return this;
|
|
54
|
-
}
|
|
55
|
-
debugInfo(detail) {
|
|
56
|
-
this.list.push({ "@type": "type.googleapis.com/google.rpc.DebugInfo" /* DEBUG_INFO */, ...detail });
|
|
57
|
-
return this;
|
|
58
|
-
}
|
|
59
|
-
quotaFailure(detail) {
|
|
60
|
-
this.list.push({ "@type": "type.googleapis.com/google.rpc.QuotaFailure" /* QUOTA_FAILURE */, ...detail });
|
|
61
|
-
return this;
|
|
62
|
-
}
|
|
63
|
-
preconditionFailure(detail) {
|
|
64
|
-
this.list.push({ "@type": "type.googleapis.com/google.rpc.PreconditionFailure" /* PRECONDITION_FAILURE */, ...detail });
|
|
65
|
-
return this;
|
|
66
|
-
}
|
|
67
|
-
badRequest(detail) {
|
|
68
|
-
this.list.push({ "@type": "type.googleapis.com/google.rpc.BadRequest" /* BAD_REQUEST */, ...detail });
|
|
69
|
-
return this;
|
|
70
|
-
}
|
|
71
|
-
requestInfo(detail) {
|
|
72
|
-
this.list.push({ "@type": "type.googleapis.com/google.rpc.RequestInfo" /* REQUEST_INFO */, ...detail });
|
|
73
|
-
return this;
|
|
74
|
-
}
|
|
75
|
-
resourceInfo(detail) {
|
|
76
|
-
this.list.push({ "@type": "type.googleapis.com/google.rpc.ResourceInfo" /* RESOURCE_INFO */, ...detail });
|
|
77
|
-
return this;
|
|
78
|
-
}
|
|
79
|
-
help(detail) {
|
|
80
|
-
this.list.push({ "@type": "type.googleapis.com/google.rpc.Help" /* HELP */, ...detail });
|
|
81
|
-
return this;
|
|
82
|
-
}
|
|
83
|
-
localizedMessage(detail) {
|
|
84
|
-
this.list.push({ "@type": "type.googleapis.com/google.rpc.LocalizedMessage" /* LOCALIZED_MESSAGE */, ...detail });
|
|
85
|
-
return this;
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
89
|
-
0 && (module.exports = {
|
|
90
|
-
DetailType,
|
|
91
|
-
Details
|
|
92
|
-
});
|
|
93
103
|
//# sourceMappingURL=detail.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/error/detail.ts"],"sourcesContent":["/** reference: https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto */\nimport type { ResolvedErrorReason } from './reason';\n\nexport enum DetailType {\n ERROR_INFO = 'type.googleapis.com/google.rpc.ErrorInfo',\n RETRY_INFO = 'type.googleapis.com/google.rpc.RetryInfo',\n DEBUG_INFO = 'type.googleapis.com/google.rpc.DebugInfo',\n QUOTA_FAILURE = 'type.googleapis.com/google.rpc.QuotaFailure',\n PRECONDITION_FAILURE = 'type.googleapis.com/google.rpc.PreconditionFailure',\n BAD_REQUEST = 'type.googleapis.com/google.rpc.BadRequest',\n REQUEST_INFO = 'type.googleapis.com/google.rpc.RequestInfo',\n RESOURCE_INFO = 'type.googleapis.com/google.rpc.ResourceInfo',\n HELP = 'type.googleapis.com/google.rpc.Help',\n LOCALIZED_MESSAGE = 'type.googleapis.com/google.rpc.LocalizedMessage',\n}\n\nexport interface ErrorInfo {\n '@type': DetailType.ERROR_INFO;\n reason: ResolvedErrorReason;\n domain?: string;\n metadata?: Record<string, string>;\n}\n\nexport interface RetryInfo {\n '@type': DetailType.RETRY_INFO;\n retryDelay: number;\n}\n\nexport interface DebugInfo {\n '@type': DetailType.DEBUG_INFO;\n stackEntries: string[];\n detail: string;\n}\n\nexport interface QuotaFailure {\n '@type': DetailType.QUOTA_FAILURE;\n violations: {\n subject: string;\n description: string;\n apiService: string;\n quoteId: string;\n quoteValue: number;\n quotaMetric: string;\n quotaDimensions: Record<string, string>;\n futureQuotaValue: number;\n }[];\n}\n\nexport interface PreconditionFailure {\n '@type': DetailType.PRECONDITION_FAILURE;\n violations: { type: string; subject: string; description: string }[];\n}\n\nexport interface BadRequest {\n '@type': DetailType.BAD_REQUEST;\n fieldViolations: {\n field: string;\n description: string;\n reason: string;\n localizedMessage: Omit<LocalizedMessage, '@type'>;\n }[];\n}\n\nexport interface RequestInfo {\n '@type': DetailType.REQUEST_INFO;\n requestId: string;\n servingData: string;\n}\n\nexport interface ResourceInfo {\n '@type': DetailType.RESOURCE_INFO;\n resourceType: string;\n resourceName: string;\n owner: string;\n description: string;\n}\n\nexport interface Help {\n '@type': DetailType.HELP;\n links: { url: string; description: string }[];\n}\n\nexport interface LocalizedMessage {\n '@type': DetailType.LOCALIZED_MESSAGE;\n locale: string;\n message: string;\n}\n\nexport type Detail =\n | RetryInfo\n | DebugInfo\n | QuotaFailure\n | ErrorInfo\n | PreconditionFailure\n | BadRequest\n | RequestInfo\n | ResourceInfo\n | Help\n | LocalizedMessage;\n\n/**\n * Example usage:\n * const details = Details.new()\n * .requestInfo({ requestId: '1234567890', servingData: '/v1/tests' })\n * .errorInfo({ reason: 'ACCOUNT_LOCKED' });\n * */\nexport class Details {\n readonly list: Detail[] = [];\n private constructor() {}\n\n static new() {\n return new Details();\n }\n\n errorInfo(detail: Omit<ErrorInfo, '@type'>) {\n this.list.push({ '@type': DetailType.ERROR_INFO, ...detail });\n return this;\n }\n\n retryInfo(detail: Omit<RetryInfo, '@type'>) {\n this.list.push({ '@type': DetailType.RETRY_INFO, ...detail });\n return this;\n }\n\n debugInfo(detail: Omit<DebugInfo, '@type'>) {\n this.list.push({ '@type': DetailType.DEBUG_INFO, ...detail });\n return this;\n }\n\n quotaFailure(detail: Omit<QuotaFailure, '@type'>) {\n this.list.push({ '@type': DetailType.QUOTA_FAILURE, ...detail });\n return this;\n }\n\n preconditionFailure(detail: Omit<PreconditionFailure, '@type'>) {\n this.list.push({ '@type': DetailType.PRECONDITION_FAILURE, ...detail });\n return this;\n }\n\n badRequest(detail: Omit<BadRequest, '@type'>) {\n this.list.push({ '@type': DetailType.BAD_REQUEST, ...detail });\n return this;\n }\n\n requestInfo(detail: Omit<RequestInfo, '@type'>) {\n this.list.push({ '@type': DetailType.REQUEST_INFO, ...detail });\n return this;\n }\n\n resourceInfo(detail: Omit<ResourceInfo, '@type'>) {\n this.list.push({ '@type': DetailType.RESOURCE_INFO, ...detail });\n return this;\n }\n\n help(detail: Omit<Help, '@type'>) {\n this.list.push({ '@type': DetailType.HELP, ...detail });\n return this;\n }\n\n localizedMessage(detail: Omit<LocalizedMessage, '@type'>) {\n this.list.push({ '@type': DetailType.LOCALIZED_MESSAGE, ...detail });\n return this;\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"detail.cjs","names":[],"sources":["../../src/error/detail.ts"],"sourcesContent":["/** reference: https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto */\nimport type { ResolvedErrorReason } from './reason';\n\nexport enum DetailType {\n ERROR_INFO = 'type.googleapis.com/google.rpc.ErrorInfo',\n RETRY_INFO = 'type.googleapis.com/google.rpc.RetryInfo',\n DEBUG_INFO = 'type.googleapis.com/google.rpc.DebugInfo',\n QUOTA_FAILURE = 'type.googleapis.com/google.rpc.QuotaFailure',\n PRECONDITION_FAILURE = 'type.googleapis.com/google.rpc.PreconditionFailure',\n BAD_REQUEST = 'type.googleapis.com/google.rpc.BadRequest',\n REQUEST_INFO = 'type.googleapis.com/google.rpc.RequestInfo',\n RESOURCE_INFO = 'type.googleapis.com/google.rpc.ResourceInfo',\n HELP = 'type.googleapis.com/google.rpc.Help',\n LOCALIZED_MESSAGE = 'type.googleapis.com/google.rpc.LocalizedMessage',\n}\n\nexport interface ErrorInfo {\n '@type': DetailType.ERROR_INFO;\n reason: ResolvedErrorReason;\n domain?: string;\n metadata?: Record<string, string>;\n}\n\nexport interface RetryInfo {\n '@type': DetailType.RETRY_INFO;\n retryDelay: number;\n}\n\nexport interface DebugInfo {\n '@type': DetailType.DEBUG_INFO;\n stackEntries: string[];\n detail: string;\n}\n\nexport interface QuotaFailure {\n '@type': DetailType.QUOTA_FAILURE;\n violations: {\n subject: string;\n description: string;\n apiService: string;\n quoteId: string;\n quoteValue: number;\n quotaMetric: string;\n quotaDimensions: Record<string, string>;\n futureQuotaValue: number;\n }[];\n}\n\nexport interface PreconditionFailure {\n '@type': DetailType.PRECONDITION_FAILURE;\n violations: { type: string; subject: string; description: string }[];\n}\n\nexport interface BadRequest {\n '@type': DetailType.BAD_REQUEST;\n fieldViolations: {\n field: string;\n description: string;\n reason: string;\n localizedMessage: Omit<LocalizedMessage, '@type'>;\n }[];\n}\n\nexport interface RequestInfo {\n '@type': DetailType.REQUEST_INFO;\n requestId: string;\n servingData: string;\n}\n\nexport interface ResourceInfo {\n '@type': DetailType.RESOURCE_INFO;\n resourceType: string;\n resourceName: string;\n owner: string;\n description: string;\n}\n\nexport interface Help {\n '@type': DetailType.HELP;\n links: { url: string; description: string }[];\n}\n\nexport interface LocalizedMessage {\n '@type': DetailType.LOCALIZED_MESSAGE;\n locale: string;\n message: string;\n}\n\nexport type Detail =\n | RetryInfo\n | DebugInfo\n | QuotaFailure\n | ErrorInfo\n | PreconditionFailure\n | BadRequest\n | RequestInfo\n | ResourceInfo\n | Help\n | LocalizedMessage;\n\n/**\n * Example usage:\n * const details = Details.new()\n * .requestInfo({ requestId: '1234567890', servingData: '/v1/tests' })\n * .errorInfo({ reason: 'ACCOUNT_LOCKED' });\n * */\nexport class Details {\n readonly list: Detail[] = [];\n private constructor() {}\n\n static new() {\n return new Details();\n }\n\n errorInfo(detail: Omit<ErrorInfo, '@type'>) {\n this.list.push({ '@type': DetailType.ERROR_INFO, ...detail });\n return this;\n }\n\n retryInfo(detail: Omit<RetryInfo, '@type'>) {\n this.list.push({ '@type': DetailType.RETRY_INFO, ...detail });\n return this;\n }\n\n debugInfo(detail: Omit<DebugInfo, '@type'>) {\n this.list.push({ '@type': DetailType.DEBUG_INFO, ...detail });\n return this;\n }\n\n quotaFailure(detail: Omit<QuotaFailure, '@type'>) {\n this.list.push({ '@type': DetailType.QUOTA_FAILURE, ...detail });\n return this;\n }\n\n preconditionFailure(detail: Omit<PreconditionFailure, '@type'>) {\n this.list.push({ '@type': DetailType.PRECONDITION_FAILURE, ...detail });\n return this;\n }\n\n badRequest(detail: Omit<BadRequest, '@type'>) {\n this.list.push({ '@type': DetailType.BAD_REQUEST, ...detail });\n return this;\n }\n\n requestInfo(detail: Omit<RequestInfo, '@type'>) {\n this.list.push({ '@type': DetailType.REQUEST_INFO, ...detail });\n return this;\n }\n\n resourceInfo(detail: Omit<ResourceInfo, '@type'>) {\n this.list.push({ '@type': DetailType.RESOURCE_INFO, ...detail });\n return this;\n }\n\n help(detail: Omit<Help, '@type'>) {\n this.list.push({ '@type': DetailType.HELP, ...detail });\n return this;\n }\n\n localizedMessage(detail: Omit<LocalizedMessage, '@type'>) {\n this.list.push({ '@type': DetailType.LOCALIZED_MESSAGE, ...detail });\n return this;\n }\n}\n"],"mappings":";;AAGA,IAAY,aAAL,yBAAA,YAAA;CACL,WAAA,gBAAA;CACA,WAAA,gBAAA;CACA,WAAA,gBAAA;CACA,WAAA,mBAAA;CACA,WAAA,0BAAA;CACA,WAAA,iBAAA;CACA,WAAA,kBAAA;CACA,WAAA,mBAAA;CACA,WAAA,UAAA;CACA,WAAA,uBAAA;;AACF,EAAA,CAAA,CAAA;;;;;;;AA4FA,IAAa,UAAb,MAAa,QAAQ;CACnB,OAA0B,CAAC;CAC3B,cAAsB,CAAC;CAEvB,OAAO,MAAM;EACX,OAAO,IAAI,QAAQ;CACrB;CAEA,UAAU,QAAkC;EAC1C,KAAK,KAAK,KAAK;GAAE,SAAA;GAAgC,GAAG;EAAO,CAAC;EAC5D,OAAO;CACT;CAEA,UAAU,QAAkC;EAC1C,KAAK,KAAK,KAAK;GAAE,SAAA;GAAgC,GAAG;EAAO,CAAC;EAC5D,OAAO;CACT;CAEA,UAAU,QAAkC;EAC1C,KAAK,KAAK,KAAK;GAAE,SAAA;GAAgC,GAAG;EAAO,CAAC;EAC5D,OAAO;CACT;CAEA,aAAa,QAAqC;EAChD,KAAK,KAAK,KAAK;GAAE,SAAA;GAAmC,GAAG;EAAO,CAAC;EAC/D,OAAO;CACT;CAEA,oBAAoB,QAA4C;EAC9D,KAAK,KAAK,KAAK;GAAE,SAAA;GAA0C,GAAG;EAAO,CAAC;EACtE,OAAO;CACT;CAEA,WAAW,QAAmC;EAC5C,KAAK,KAAK,KAAK;GAAE,SAAA;GAAiC,GAAG;EAAO,CAAC;EAC7D,OAAO;CACT;CAEA,YAAY,QAAoC;EAC9C,KAAK,KAAK,KAAK;GAAE,SAAA;GAAkC,GAAG;EAAO,CAAC;EAC9D,OAAO;CACT;CAEA,aAAa,QAAqC;EAChD,KAAK,KAAK,KAAK;GAAE,SAAA;GAAmC,GAAG;EAAO,CAAC;EAC/D,OAAO;CACT;CAEA,KAAK,QAA6B;EAChC,KAAK,KAAK,KAAK;GAAE,SAAA;GAA0B,GAAG;EAAO,CAAC;EACtD,OAAO;CACT;CAEA,iBAAiB,QAAyC;EACxD,KAAK,KAAK,KAAK;GAAE,SAAA;GAAuC,GAAG;EAAO,CAAC;EACnE,OAAO;CACT;AACF"}
|
package/dist/error/detail.d.cts
CHANGED
|
@@ -1,87 +1,85 @@
|
|
|
1
|
-
import { ResolvedErrorReason } from
|
|
2
|
-
|
|
3
|
-
/** reference: https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto */
|
|
4
|
-
|
|
1
|
+
import { ResolvedErrorReason } from "./reason.cjs";
|
|
2
|
+
//#region src/error/detail.d.ts
|
|
5
3
|
declare enum DetailType {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
4
|
+
ERROR_INFO = "type.googleapis.com/google.rpc.ErrorInfo",
|
|
5
|
+
RETRY_INFO = "type.googleapis.com/google.rpc.RetryInfo",
|
|
6
|
+
DEBUG_INFO = "type.googleapis.com/google.rpc.DebugInfo",
|
|
7
|
+
QUOTA_FAILURE = "type.googleapis.com/google.rpc.QuotaFailure",
|
|
8
|
+
PRECONDITION_FAILURE = "type.googleapis.com/google.rpc.PreconditionFailure",
|
|
9
|
+
BAD_REQUEST = "type.googleapis.com/google.rpc.BadRequest",
|
|
10
|
+
REQUEST_INFO = "type.googleapis.com/google.rpc.RequestInfo",
|
|
11
|
+
RESOURCE_INFO = "type.googleapis.com/google.rpc.ResourceInfo",
|
|
12
|
+
HELP = "type.googleapis.com/google.rpc.Help",
|
|
13
|
+
LOCALIZED_MESSAGE = "type.googleapis.com/google.rpc.LocalizedMessage"
|
|
16
14
|
}
|
|
17
15
|
interface ErrorInfo {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
'@type': DetailType.ERROR_INFO;
|
|
17
|
+
reason: ResolvedErrorReason;
|
|
18
|
+
domain?: string;
|
|
19
|
+
metadata?: Record<string, string>;
|
|
22
20
|
}
|
|
23
21
|
interface RetryInfo {
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
'@type': DetailType.RETRY_INFO;
|
|
23
|
+
retryDelay: number;
|
|
26
24
|
}
|
|
27
25
|
interface DebugInfo {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
'@type': DetailType.DEBUG_INFO;
|
|
27
|
+
stackEntries: string[];
|
|
28
|
+
detail: string;
|
|
31
29
|
}
|
|
32
30
|
interface QuotaFailure {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
31
|
+
'@type': DetailType.QUOTA_FAILURE;
|
|
32
|
+
violations: {
|
|
33
|
+
subject: string;
|
|
34
|
+
description: string;
|
|
35
|
+
apiService: string;
|
|
36
|
+
quoteId: string;
|
|
37
|
+
quoteValue: number;
|
|
38
|
+
quotaMetric: string;
|
|
39
|
+
quotaDimensions: Record<string, string>;
|
|
40
|
+
futureQuotaValue: number;
|
|
41
|
+
}[];
|
|
44
42
|
}
|
|
45
43
|
interface PreconditionFailure {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
44
|
+
'@type': DetailType.PRECONDITION_FAILURE;
|
|
45
|
+
violations: {
|
|
46
|
+
type: string;
|
|
47
|
+
subject: string;
|
|
48
|
+
description: string;
|
|
49
|
+
}[];
|
|
52
50
|
}
|
|
53
51
|
interface BadRequest {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
52
|
+
'@type': DetailType.BAD_REQUEST;
|
|
53
|
+
fieldViolations: {
|
|
54
|
+
field: string;
|
|
55
|
+
description: string;
|
|
56
|
+
reason: string;
|
|
57
|
+
localizedMessage: Omit<LocalizedMessage, '@type'>;
|
|
58
|
+
}[];
|
|
61
59
|
}
|
|
62
60
|
interface RequestInfo {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
61
|
+
'@type': DetailType.REQUEST_INFO;
|
|
62
|
+
requestId: string;
|
|
63
|
+
servingData: string;
|
|
66
64
|
}
|
|
67
65
|
interface ResourceInfo {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
66
|
+
'@type': DetailType.RESOURCE_INFO;
|
|
67
|
+
resourceType: string;
|
|
68
|
+
resourceName: string;
|
|
69
|
+
owner: string;
|
|
70
|
+
description: string;
|
|
73
71
|
}
|
|
74
72
|
interface Help {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
73
|
+
'@type': DetailType.HELP;
|
|
74
|
+
links: {
|
|
75
|
+
url: string;
|
|
76
|
+
description: string;
|
|
77
|
+
}[];
|
|
80
78
|
}
|
|
81
79
|
interface LocalizedMessage {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
80
|
+
'@type': DetailType.LOCALIZED_MESSAGE;
|
|
81
|
+
locale: string;
|
|
82
|
+
message: string;
|
|
85
83
|
}
|
|
86
84
|
type Detail = RetryInfo | DebugInfo | QuotaFailure | ErrorInfo | PreconditionFailure | BadRequest | RequestInfo | ResourceInfo | Help | LocalizedMessage;
|
|
87
85
|
/**
|
|
@@ -91,19 +89,20 @@ type Detail = RetryInfo | DebugInfo | QuotaFailure | ErrorInfo | PreconditionFai
|
|
|
91
89
|
* .errorInfo({ reason: 'ACCOUNT_LOCKED' });
|
|
92
90
|
* */
|
|
93
91
|
declare class Details {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
92
|
+
readonly list: Detail[];
|
|
93
|
+
private constructor();
|
|
94
|
+
static new(): Details;
|
|
95
|
+
errorInfo(detail: Omit<ErrorInfo, '@type'>): this;
|
|
96
|
+
retryInfo(detail: Omit<RetryInfo, '@type'>): this;
|
|
97
|
+
debugInfo(detail: Omit<DebugInfo, '@type'>): this;
|
|
98
|
+
quotaFailure(detail: Omit<QuotaFailure, '@type'>): this;
|
|
99
|
+
preconditionFailure(detail: Omit<PreconditionFailure, '@type'>): this;
|
|
100
|
+
badRequest(detail: Omit<BadRequest, '@type'>): this;
|
|
101
|
+
requestInfo(detail: Omit<RequestInfo, '@type'>): this;
|
|
102
|
+
resourceInfo(detail: Omit<ResourceInfo, '@type'>): this;
|
|
103
|
+
help(detail: Omit<Help, '@type'>): this;
|
|
104
|
+
localizedMessage(detail: Omit<LocalizedMessage, '@type'>): this;
|
|
107
105
|
}
|
|
108
|
-
|
|
109
|
-
export {
|
|
106
|
+
//#endregion
|
|
107
|
+
export { BadRequest, DebugInfo, Detail, DetailType, Details, ErrorInfo, Help, LocalizedMessage, PreconditionFailure, QuotaFailure, RequestInfo, ResourceInfo, RetryInfo };
|
|
108
|
+
//# sourceMappingURL=detail.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detail.d.cts","names":[],"sources":["../../src/error/detail.ts"],"mappings":";;aAGY;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf,SAAS,WAAW;EACpB,QAAQ;EACR;EACA,WAAW;;UAGI;EACf,SAAS,WAAW;EACpB;;UAGe;EACf,SAAS,WAAW;EACpB;EACA;;UAGe;EACf,SAAS,WAAW;EACpB;IACE;IACA;IACA;IACA;IACA;IACA;IACA,iBAAiB;IACjB;;;UAIa;EACf,SAAS,WAAW;EACpB;IAAc;IAAc;IAAiB;;;UAG9B;EACf,SAAS,WAAW;EACpB;IACE;IACA;IACA;IACA,kBAAkB,KAAK;;;UAIV;EACf,SAAS,WAAW;EACpB;EACA;;UAGe;EACf,SAAS,WAAW;EACpB;EACA;EACA;EACA;;UAGe;EACf,SAAS,WAAW;EACpB;IAAS;IAAa;;;UAGP;EACf,SAAS,WAAW;EACpB;EACA;;KAGU,SACR,YACA,YACA,eACA,YACA,sBACA,aACA,cACA,eACA,OACA;;;;;;;cAQS;WACF,MAAM;UACR;SAEA,OAAG;EAIV,UAAU,QAAQ,KAAK;EAKvB,UAAU,QAAQ,KAAK;EAKvB,UAAU,QAAQ,KAAK;EAKvB,aAAa,QAAQ,KAAK;EAK1B,oBAAoB,QAAQ,KAAK;EAKjC,WAAW,QAAQ,KAAK;EAKxB,YAAY,QAAQ,KAAK;EAKzB,aAAa,QAAQ,KAAK;EAK1B,KAAK,QAAQ,KAAK;EAKlB,iBAAiB,QAAQ,KAAK"}
|