@shware/http 2.11.4 → 3.0.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 +98 -89
- package/dist/error/detail.cjs.map +1 -1
- package/dist/error/detail.d.cts +80 -80
- package/dist/error/detail.d.cts.map +1 -0
- package/dist/error/detail.d.mts +109 -0
- package/dist/error/detail.d.mts.map +1 -0
- package/dist/error/detail.mjs +97 -64
- 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 +28 -56
- package/dist/error/index.cjs.map +1 -1
- package/dist/error/index.d.cts +15 -12
- package/dist/error/index.d.cts.map +1 -0
- package/dist/error/index.d.mts +22 -0
- package/dist/error/index.d.mts.map +1 -0
- package/dist/error/index.mjs +23 -27
- 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 +33 -33
- 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 +49 -24
- 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,109 @@
|
|
|
1
|
+
import { ResolvedErrorReason } from "./reason.mjs";
|
|
2
|
+
//#region src/error/detail.d.ts
|
|
3
|
+
declare const DetailType: {
|
|
4
|
+
readonly ERROR_INFO: 'type.googleapis.com/google.rpc.ErrorInfo';
|
|
5
|
+
readonly RETRY_INFO: 'type.googleapis.com/google.rpc.RetryInfo';
|
|
6
|
+
readonly DEBUG_INFO: 'type.googleapis.com/google.rpc.DebugInfo';
|
|
7
|
+
readonly QUOTA_FAILURE: 'type.googleapis.com/google.rpc.QuotaFailure';
|
|
8
|
+
readonly PRECONDITION_FAILURE: 'type.googleapis.com/google.rpc.PreconditionFailure';
|
|
9
|
+
readonly BAD_REQUEST: 'type.googleapis.com/google.rpc.BadRequest';
|
|
10
|
+
readonly REQUEST_INFO: 'type.googleapis.com/google.rpc.RequestInfo';
|
|
11
|
+
readonly RESOURCE_INFO: 'type.googleapis.com/google.rpc.ResourceInfo';
|
|
12
|
+
readonly HELP: 'type.googleapis.com/google.rpc.Help';
|
|
13
|
+
readonly LOCALIZED_MESSAGE: 'type.googleapis.com/google.rpc.LocalizedMessage';
|
|
14
|
+
};
|
|
15
|
+
type DetailType = (typeof DetailType)[keyof typeof DetailType];
|
|
16
|
+
interface ErrorInfo {
|
|
17
|
+
'@type': typeof DetailType.ERROR_INFO;
|
|
18
|
+
reason: ResolvedErrorReason;
|
|
19
|
+
domain?: string;
|
|
20
|
+
metadata?: Record<string, string>;
|
|
21
|
+
}
|
|
22
|
+
interface RetryInfo {
|
|
23
|
+
'@type': typeof DetailType.RETRY_INFO;
|
|
24
|
+
retryDelay: number;
|
|
25
|
+
}
|
|
26
|
+
interface DebugInfo {
|
|
27
|
+
'@type': typeof DetailType.DEBUG_INFO;
|
|
28
|
+
stackEntries: string[];
|
|
29
|
+
detail: string;
|
|
30
|
+
}
|
|
31
|
+
interface QuotaFailure {
|
|
32
|
+
'@type': typeof DetailType.QUOTA_FAILURE;
|
|
33
|
+
violations: {
|
|
34
|
+
subject: string;
|
|
35
|
+
description: string;
|
|
36
|
+
apiService: string;
|
|
37
|
+
quoteId: string;
|
|
38
|
+
quoteValue: number;
|
|
39
|
+
quotaMetric: string;
|
|
40
|
+
quotaDimensions: Record<string, string>;
|
|
41
|
+
futureQuotaValue: number;
|
|
42
|
+
}[];
|
|
43
|
+
}
|
|
44
|
+
interface PreconditionFailure {
|
|
45
|
+
'@type': typeof DetailType.PRECONDITION_FAILURE;
|
|
46
|
+
violations: {
|
|
47
|
+
type: string;
|
|
48
|
+
subject: string;
|
|
49
|
+
description: string;
|
|
50
|
+
}[];
|
|
51
|
+
}
|
|
52
|
+
interface BadRequest {
|
|
53
|
+
'@type': typeof DetailType.BAD_REQUEST;
|
|
54
|
+
fieldViolations: {
|
|
55
|
+
field: string;
|
|
56
|
+
description: string;
|
|
57
|
+
reason: string;
|
|
58
|
+
localizedMessage: Omit<LocalizedMessage, '@type'>;
|
|
59
|
+
}[];
|
|
60
|
+
}
|
|
61
|
+
interface RequestInfo {
|
|
62
|
+
'@type': typeof DetailType.REQUEST_INFO;
|
|
63
|
+
requestId: string;
|
|
64
|
+
servingData: string;
|
|
65
|
+
}
|
|
66
|
+
interface ResourceInfo {
|
|
67
|
+
'@type': typeof DetailType.RESOURCE_INFO;
|
|
68
|
+
resourceType: string;
|
|
69
|
+
resourceName: string;
|
|
70
|
+
owner: string;
|
|
71
|
+
description: string;
|
|
72
|
+
}
|
|
73
|
+
interface Help {
|
|
74
|
+
'@type': typeof DetailType.HELP;
|
|
75
|
+
links: {
|
|
76
|
+
url: string;
|
|
77
|
+
description: string;
|
|
78
|
+
}[];
|
|
79
|
+
}
|
|
80
|
+
interface LocalizedMessage {
|
|
81
|
+
'@type': typeof DetailType.LOCALIZED_MESSAGE;
|
|
82
|
+
locale: string;
|
|
83
|
+
message: string;
|
|
84
|
+
}
|
|
85
|
+
type Detail = RetryInfo | DebugInfo | QuotaFailure | ErrorInfo | PreconditionFailure | BadRequest | RequestInfo | ResourceInfo | Help | LocalizedMessage;
|
|
86
|
+
/**
|
|
87
|
+
* Example usage:
|
|
88
|
+
* const details = Details.new()
|
|
89
|
+
* .requestInfo({ requestId: '1234567890', servingData: '/v1/tests' })
|
|
90
|
+
* .errorInfo({ reason: 'ACCOUNT_LOCKED' });
|
|
91
|
+
* */
|
|
92
|
+
declare class Details {
|
|
93
|
+
readonly list: Detail[];
|
|
94
|
+
private constructor();
|
|
95
|
+
static new(): Details;
|
|
96
|
+
errorInfo(detail: Omit<ErrorInfo, '@type'>): this;
|
|
97
|
+
retryInfo(detail: Omit<RetryInfo, '@type'>): this;
|
|
98
|
+
debugInfo(detail: Omit<DebugInfo, '@type'>): this;
|
|
99
|
+
quotaFailure(detail: Omit<QuotaFailure, '@type'>): this;
|
|
100
|
+
preconditionFailure(detail: Omit<PreconditionFailure, '@type'>): this;
|
|
101
|
+
badRequest(detail: Omit<BadRequest, '@type'>): this;
|
|
102
|
+
requestInfo(detail: Omit<RequestInfo, '@type'>): this;
|
|
103
|
+
resourceInfo(detail: Omit<ResourceInfo, '@type'>): this;
|
|
104
|
+
help(detail: Omit<Help, '@type'>): this;
|
|
105
|
+
localizedMessage(detail: Omit<LocalizedMessage, '@type'>): this;
|
|
106
|
+
}
|
|
107
|
+
//#endregion
|
|
108
|
+
export { BadRequest, DebugInfo, Detail, DetailType, Details, ErrorInfo, Help, LocalizedMessage, PreconditionFailure, QuotaFailure, RequestInfo, ResourceInfo, RetryInfo };
|
|
109
|
+
//# sourceMappingURL=detail.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detail.d.mts","names":[],"sources":["../../src/error/detail.ts"],"mappings":";;cAGa;WACX;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;KAGU,qBAAqB,yBAAyB;UAEzC;EACf,gBAAgB,WAAW;EAC3B,QAAQ;EACR;EACA,WAAW;;UAGI;EACf,gBAAgB,WAAW;EAC3B;;UAGe;EACf,gBAAgB,WAAW;EAC3B;EACA;;UAGe;EACf,gBAAgB,WAAW;EAC3B;IACE;IACA;IACA;IACA;IACA;IACA;IACA,iBAAiB;IACjB;;;UAIa;EACf,gBAAgB,WAAW;EAC3B;IAAc;IAAc;IAAiB;;;UAG9B;EACf,gBAAgB,WAAW;EAC3B;IACE;IACA;IACA;IACA,kBAAkB,KAAK;;;UAIV;EACf,gBAAgB,WAAW;EAC3B;EACA;;UAGe;EACf,gBAAgB,WAAW;EAC3B;EACA;EACA;EACA;;UAGe;EACf,gBAAgB,WAAW;EAC3B;IAAS;IAAa;;;UAGP;EACf,gBAAgB,WAAW;EAC3B;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"}
|
package/dist/error/detail.mjs
CHANGED
|
@@ -1,67 +1,100 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return DetailType2;
|
|
14
|
-
})(DetailType || {});
|
|
15
|
-
var Details = class _Details {
|
|
16
|
-
list = [];
|
|
17
|
-
constructor() {
|
|
18
|
-
}
|
|
19
|
-
static new() {
|
|
20
|
-
return new _Details();
|
|
21
|
-
}
|
|
22
|
-
errorInfo(detail) {
|
|
23
|
-
this.list.push({ "@type": "type.googleapis.com/google.rpc.ErrorInfo" /* ERROR_INFO */, ...detail });
|
|
24
|
-
return this;
|
|
25
|
-
}
|
|
26
|
-
retryInfo(detail) {
|
|
27
|
-
this.list.push({ "@type": "type.googleapis.com/google.rpc.RetryInfo" /* RETRY_INFO */, ...detail });
|
|
28
|
-
return this;
|
|
29
|
-
}
|
|
30
|
-
debugInfo(detail) {
|
|
31
|
-
this.list.push({ "@type": "type.googleapis.com/google.rpc.DebugInfo" /* DEBUG_INFO */, ...detail });
|
|
32
|
-
return this;
|
|
33
|
-
}
|
|
34
|
-
quotaFailure(detail) {
|
|
35
|
-
this.list.push({ "@type": "type.googleapis.com/google.rpc.QuotaFailure" /* QUOTA_FAILURE */, ...detail });
|
|
36
|
-
return this;
|
|
37
|
-
}
|
|
38
|
-
preconditionFailure(detail) {
|
|
39
|
-
this.list.push({ "@type": "type.googleapis.com/google.rpc.PreconditionFailure" /* PRECONDITION_FAILURE */, ...detail });
|
|
40
|
-
return this;
|
|
41
|
-
}
|
|
42
|
-
badRequest(detail) {
|
|
43
|
-
this.list.push({ "@type": "type.googleapis.com/google.rpc.BadRequest" /* BAD_REQUEST */, ...detail });
|
|
44
|
-
return this;
|
|
45
|
-
}
|
|
46
|
-
requestInfo(detail) {
|
|
47
|
-
this.list.push({ "@type": "type.googleapis.com/google.rpc.RequestInfo" /* REQUEST_INFO */, ...detail });
|
|
48
|
-
return this;
|
|
49
|
-
}
|
|
50
|
-
resourceInfo(detail) {
|
|
51
|
-
this.list.push({ "@type": "type.googleapis.com/google.rpc.ResourceInfo" /* RESOURCE_INFO */, ...detail });
|
|
52
|
-
return this;
|
|
53
|
-
}
|
|
54
|
-
help(detail) {
|
|
55
|
-
this.list.push({ "@type": "type.googleapis.com/google.rpc.Help" /* HELP */, ...detail });
|
|
56
|
-
return this;
|
|
57
|
-
}
|
|
58
|
-
localizedMessage(detail) {
|
|
59
|
-
this.list.push({ "@type": "type.googleapis.com/google.rpc.LocalizedMessage" /* LOCALIZED_MESSAGE */, ...detail });
|
|
60
|
-
return this;
|
|
61
|
-
}
|
|
1
|
+
//#region src/error/detail.ts
|
|
2
|
+
const DetailType = {
|
|
3
|
+
ERROR_INFO: "type.googleapis.com/google.rpc.ErrorInfo",
|
|
4
|
+
RETRY_INFO: "type.googleapis.com/google.rpc.RetryInfo",
|
|
5
|
+
DEBUG_INFO: "type.googleapis.com/google.rpc.DebugInfo",
|
|
6
|
+
QUOTA_FAILURE: "type.googleapis.com/google.rpc.QuotaFailure",
|
|
7
|
+
PRECONDITION_FAILURE: "type.googleapis.com/google.rpc.PreconditionFailure",
|
|
8
|
+
BAD_REQUEST: "type.googleapis.com/google.rpc.BadRequest",
|
|
9
|
+
REQUEST_INFO: "type.googleapis.com/google.rpc.RequestInfo",
|
|
10
|
+
RESOURCE_INFO: "type.googleapis.com/google.rpc.ResourceInfo",
|
|
11
|
+
HELP: "type.googleapis.com/google.rpc.Help",
|
|
12
|
+
LOCALIZED_MESSAGE: "type.googleapis.com/google.rpc.LocalizedMessage"
|
|
62
13
|
};
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
14
|
+
/**
|
|
15
|
+
* Example usage:
|
|
16
|
+
* const details = Details.new()
|
|
17
|
+
* .requestInfo({ requestId: '1234567890', servingData: '/v1/tests' })
|
|
18
|
+
* .errorInfo({ reason: 'ACCOUNT_LOCKED' });
|
|
19
|
+
* */
|
|
20
|
+
var Details = class Details {
|
|
21
|
+
list = [];
|
|
22
|
+
constructor() {}
|
|
23
|
+
static new() {
|
|
24
|
+
return new Details();
|
|
25
|
+
}
|
|
26
|
+
errorInfo(detail) {
|
|
27
|
+
this.list.push({
|
|
28
|
+
"@type": DetailType.ERROR_INFO,
|
|
29
|
+
...detail
|
|
30
|
+
});
|
|
31
|
+
return this;
|
|
32
|
+
}
|
|
33
|
+
retryInfo(detail) {
|
|
34
|
+
this.list.push({
|
|
35
|
+
"@type": DetailType.RETRY_INFO,
|
|
36
|
+
...detail
|
|
37
|
+
});
|
|
38
|
+
return this;
|
|
39
|
+
}
|
|
40
|
+
debugInfo(detail) {
|
|
41
|
+
this.list.push({
|
|
42
|
+
"@type": DetailType.DEBUG_INFO,
|
|
43
|
+
...detail
|
|
44
|
+
});
|
|
45
|
+
return this;
|
|
46
|
+
}
|
|
47
|
+
quotaFailure(detail) {
|
|
48
|
+
this.list.push({
|
|
49
|
+
"@type": DetailType.QUOTA_FAILURE,
|
|
50
|
+
...detail
|
|
51
|
+
});
|
|
52
|
+
return this;
|
|
53
|
+
}
|
|
54
|
+
preconditionFailure(detail) {
|
|
55
|
+
this.list.push({
|
|
56
|
+
"@type": DetailType.PRECONDITION_FAILURE,
|
|
57
|
+
...detail
|
|
58
|
+
});
|
|
59
|
+
return this;
|
|
60
|
+
}
|
|
61
|
+
badRequest(detail) {
|
|
62
|
+
this.list.push({
|
|
63
|
+
"@type": DetailType.BAD_REQUEST,
|
|
64
|
+
...detail
|
|
65
|
+
});
|
|
66
|
+
return this;
|
|
67
|
+
}
|
|
68
|
+
requestInfo(detail) {
|
|
69
|
+
this.list.push({
|
|
70
|
+
"@type": DetailType.REQUEST_INFO,
|
|
71
|
+
...detail
|
|
72
|
+
});
|
|
73
|
+
return this;
|
|
74
|
+
}
|
|
75
|
+
resourceInfo(detail) {
|
|
76
|
+
this.list.push({
|
|
77
|
+
"@type": DetailType.RESOURCE_INFO,
|
|
78
|
+
...detail
|
|
79
|
+
});
|
|
80
|
+
return this;
|
|
81
|
+
}
|
|
82
|
+
help(detail) {
|
|
83
|
+
this.list.push({
|
|
84
|
+
"@type": DetailType.HELP,
|
|
85
|
+
...detail
|
|
86
|
+
});
|
|
87
|
+
return this;
|
|
88
|
+
}
|
|
89
|
+
localizedMessage(detail) {
|
|
90
|
+
this.list.push({
|
|
91
|
+
"@type": DetailType.LOCALIZED_MESSAGE,
|
|
92
|
+
...detail
|
|
93
|
+
});
|
|
94
|
+
return this;
|
|
95
|
+
}
|
|
66
96
|
};
|
|
97
|
+
//#endregion
|
|
98
|
+
export { DetailType, Details };
|
|
99
|
+
|
|
67
100
|
//# sourceMappingURL=detail.mjs.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
|
|
1
|
+
{"version":3,"file":"detail.mjs","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 const 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} as const;\n\nexport type DetailType = (typeof DetailType)[keyof typeof DetailType];\n\nexport interface ErrorInfo {\n '@type': typeof DetailType.ERROR_INFO;\n reason: ResolvedErrorReason;\n domain?: string;\n metadata?: Record<string, string>;\n}\n\nexport interface RetryInfo {\n '@type': typeof DetailType.RETRY_INFO;\n retryDelay: number;\n}\n\nexport interface DebugInfo {\n '@type': typeof DetailType.DEBUG_INFO;\n stackEntries: string[];\n detail: string;\n}\n\nexport interface QuotaFailure {\n '@type': typeof 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': typeof DetailType.PRECONDITION_FAILURE;\n violations: { type: string; subject: string; description: string }[];\n}\n\nexport interface BadRequest {\n '@type': typeof 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': typeof DetailType.REQUEST_INFO;\n requestId: string;\n servingData: string;\n}\n\nexport interface ResourceInfo {\n '@type': typeof DetailType.RESOURCE_INFO;\n resourceType: string;\n resourceName: string;\n owner: string;\n description: string;\n}\n\nexport interface Help {\n '@type': typeof DetailType.HELP;\n links: { url: string; description: string }[];\n}\n\nexport interface LocalizedMessage {\n '@type': typeof 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,MAAa,aAAa;CACxB,YAAY;CACZ,YAAY;CACZ,YAAY;CACZ,eAAe;CACf,sBAAsB;CACtB,aAAa;CACb,cAAc;CACd,eAAe;CACf,MAAM;CACN,mBAAmB;AACrB;;;;;;;AA8FA,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,SAAS,WAAW;GAAY,GAAG;EAAO,CAAC;EAC5D,OAAO;CACT;CAEA,UAAU,QAAkC;EAC1C,KAAK,KAAK,KAAK;GAAE,SAAS,WAAW;GAAY,GAAG;EAAO,CAAC;EAC5D,OAAO;CACT;CAEA,UAAU,QAAkC;EAC1C,KAAK,KAAK,KAAK;GAAE,SAAS,WAAW;GAAY,GAAG;EAAO,CAAC;EAC5D,OAAO;CACT;CAEA,aAAa,QAAqC;EAChD,KAAK,KAAK,KAAK;GAAE,SAAS,WAAW;GAAe,GAAG;EAAO,CAAC;EAC/D,OAAO;CACT;CAEA,oBAAoB,QAA4C;EAC9D,KAAK,KAAK,KAAK;GAAE,SAAS,WAAW;GAAsB,GAAG;EAAO,CAAC;EACtE,OAAO;CACT;CAEA,WAAW,QAAmC;EAC5C,KAAK,KAAK,KAAK;GAAE,SAAS,WAAW;GAAa,GAAG;EAAO,CAAC;EAC7D,OAAO;CACT;CAEA,YAAY,QAAoC;EAC9C,KAAK,KAAK,KAAK;GAAE,SAAS,WAAW;GAAc,GAAG;EAAO,CAAC;EAC9D,OAAO;CACT;CAEA,aAAa,QAAqC;EAChD,KAAK,KAAK,KAAK;GAAE,SAAS,WAAW;GAAe,GAAG;EAAO,CAAC;EAC/D,OAAO;CACT;CAEA,KAAK,QAA6B;EAChC,KAAK,KAAK,KAAK;GAAE,SAAS,WAAW;GAAM,GAAG;EAAO,CAAC;EACtD,OAAO;CACT;CAEA,iBAAiB,QAAyC;EACxD,KAAK,KAAK,KAAK;GAAE,SAAS,WAAW;GAAmB,GAAG;EAAO,CAAC;EACnE,OAAO;CACT;AACF"}
|
|
@@ -1,31 +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/error/i18n/en-us.ts
|
|
3
|
+
const enUS = {};
|
|
4
|
+
//#endregion
|
|
5
|
+
exports.enUS = enUS;
|
|
19
6
|
|
|
20
|
-
// src/error/i18n/en-us.ts
|
|
21
|
-
var en_us_exports = {};
|
|
22
|
-
__export(en_us_exports, {
|
|
23
|
-
enUS: () => enUS
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(en_us_exports);
|
|
26
|
-
var enUS = {};
|
|
27
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
28
|
-
0 && (module.exports = {
|
|
29
|
-
enUS
|
|
30
|
-
});
|
|
31
7
|
//# sourceMappingURL=en-us.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/error/i18n/en-us.ts"],"sourcesContent":["export const enUS = {};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"en-us.cjs","names":[],"sources":["../../../src/error/i18n/en-us.ts"],"sourcesContent":["export const enUS = {};\n"],"mappings":";;AAAA,MAAa,OAAO,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"en-us.d.cts","names":[],"sources":["../../../src/error/i18n/en-us.ts"],"mappings":";cAAa"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"en-us.d.mts","names":[],"sources":["../../../src/error/i18n/en-us.ts"],"mappings":";cAAa"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
//#region src/error/i18n/en-us.ts
|
|
2
|
+
const enUS = {};
|
|
3
|
+
//#endregion
|
|
4
|
+
export { enUS };
|
|
5
|
+
|
|
6
6
|
//# sourceMappingURL=en-us.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/error/i18n/en-us.ts"],"sourcesContent":["export const enUS = {};\n"],"mappings":";
|
|
1
|
+
{"version":3,"file":"en-us.mjs","names":[],"sources":["../../../src/error/i18n/en-us.ts"],"sourcesContent":["export const enUS = {};\n"],"mappings":";AAAA,MAAa,OAAO,CAAC"}
|
package/dist/error/index.cjs
CHANGED
|
@@ -1,63 +1,35 @@
|
|
|
1
|
-
"
|
|
2
|
-
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
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);
|
|
19
|
-
|
|
20
|
-
// src/error/index.ts
|
|
21
|
-
var error_exports = {};
|
|
22
|
-
__export(error_exports, {
|
|
23
|
-
CheckoutCreateError: () => CheckoutCreateError,
|
|
24
|
-
LoginCanceledError: () => LoginCanceledError,
|
|
25
|
-
LoginTimeoutError: () => LoginTimeoutError,
|
|
26
|
-
PurchaseError: () => PurchaseError
|
|
27
|
-
});
|
|
28
|
-
module.exports = __toCommonJS(error_exports);
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
//#region src/error/index.ts
|
|
29
3
|
var LoginTimeoutError = class extends Error {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
4
|
+
constructor(timeout) {
|
|
5
|
+
super(`Login timeout after ${timeout}ms`);
|
|
6
|
+
this.name = "LoginTimeoutError";
|
|
7
|
+
}
|
|
34
8
|
};
|
|
35
9
|
var LoginCanceledError = class extends Error {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
10
|
+
constructor() {
|
|
11
|
+
super("Login canceled by user");
|
|
12
|
+
this.name = "LoginCanceledError";
|
|
13
|
+
}
|
|
40
14
|
};
|
|
41
15
|
var CheckoutCreateError = class extends Error {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
16
|
+
constructor() {
|
|
17
|
+
super("Failed to create checkout session");
|
|
18
|
+
this.name = "SessionCreateError";
|
|
19
|
+
}
|
|
46
20
|
};
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
PurchaseError
|
|
62
|
-
});
|
|
21
|
+
const PurchaseError = {
|
|
22
|
+
LOGIN_TIMEOUT: "LOGIN_TIMEOUT",
|
|
23
|
+
LOGIN_CANCELED: "LOGIN_CANCELED",
|
|
24
|
+
CHECKOUT_CANCELED: "CHECKOUT_CANCELED",
|
|
25
|
+
CHECKOUT_CREATE_FAILED: "CHECKOUT_CREATE_FAILED",
|
|
26
|
+
CHECKOUT_SESSION_ID_NOT_FOUND: "CHECKOUT_SESSION_ID_NOT_FOUND",
|
|
27
|
+
UNKNOWN: "UNKNOWN"
|
|
28
|
+
};
|
|
29
|
+
//#endregion
|
|
30
|
+
exports.CheckoutCreateError = CheckoutCreateError;
|
|
31
|
+
exports.LoginCanceledError = LoginCanceledError;
|
|
32
|
+
exports.LoginTimeoutError = LoginTimeoutError;
|
|
33
|
+
exports.PurchaseError = PurchaseError;
|
|
34
|
+
|
|
63
35
|
//# sourceMappingURL=index.cjs.map
|
package/dist/error/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/error/index.ts"],"sourcesContent":["export class LoginTimeoutError extends Error {\n constructor(timeout: number) {\n super(`Login timeout after ${timeout}ms`);\n this.name = 'LoginTimeoutError';\n }\n}\n\nexport class LoginCanceledError extends Error {\n constructor() {\n super('Login canceled by user');\n this.name = 'LoginCanceledError';\n }\n}\n\nexport class CheckoutCreateError extends Error {\n constructor() {\n super('Failed to create checkout session');\n this.name = 'SessionCreateError';\n }\n}\n\nexport
|
|
1
|
+
{"version":3,"file":"index.cjs","names":[],"sources":["../../src/error/index.ts"],"sourcesContent":["export class LoginTimeoutError extends Error {\n constructor(timeout: number) {\n super(`Login timeout after ${timeout}ms`);\n this.name = 'LoginTimeoutError';\n }\n}\n\nexport class LoginCanceledError extends Error {\n constructor() {\n super('Login canceled by user');\n this.name = 'LoginCanceledError';\n }\n}\n\nexport class CheckoutCreateError extends Error {\n constructor() {\n super('Failed to create checkout session');\n this.name = 'SessionCreateError';\n }\n}\n\nexport const PurchaseError = {\n LOGIN_TIMEOUT: 'LOGIN_TIMEOUT',\n LOGIN_CANCELED: 'LOGIN_CANCELED',\n CHECKOUT_CANCELED: 'CHECKOUT_CANCELED',\n CHECKOUT_CREATE_FAILED: 'CHECKOUT_CREATE_FAILED',\n CHECKOUT_SESSION_ID_NOT_FOUND: 'CHECKOUT_SESSION_ID_NOT_FOUND',\n UNKNOWN: 'UNKNOWN',\n} as const;\n\nexport type PurchaseError = (typeof PurchaseError)[keyof typeof PurchaseError];\n"],"mappings":";;AAAA,IAAa,oBAAb,cAAuC,MAAM;CAC3C,YAAY,SAAiB;EAC3B,MAAM,uBAAuB,QAAQ,GAAG;EACxC,KAAK,OAAO;CACd;AACF;AAEA,IAAa,qBAAb,cAAwC,MAAM;CAC5C,cAAc;EACZ,MAAM,wBAAwB;EAC9B,KAAK,OAAO;CACd;AACF;AAEA,IAAa,sBAAb,cAAyC,MAAM;CAC7C,cAAc;EACZ,MAAM,mCAAmC;EACzC,KAAK,OAAO;CACd;AACF;AAEA,MAAa,gBAAgB;CAC3B,eAAe;CACf,gBAAgB;CAChB,mBAAmB;CACnB,wBAAwB;CACxB,+BAA+B;CAC/B,SAAS;AACX"}
|
package/dist/error/index.d.cts
CHANGED
|
@@ -1,19 +1,22 @@
|
|
|
1
|
+
//#region src/error/index.d.ts
|
|
1
2
|
declare class LoginTimeoutError extends Error {
|
|
2
|
-
|
|
3
|
+
constructor(timeout: number);
|
|
3
4
|
}
|
|
4
5
|
declare class LoginCanceledError extends Error {
|
|
5
|
-
|
|
6
|
+
constructor();
|
|
6
7
|
}
|
|
7
8
|
declare class CheckoutCreateError extends Error {
|
|
8
|
-
|
|
9
|
+
constructor();
|
|
9
10
|
}
|
|
10
|
-
declare
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
|
|
11
|
+
declare const PurchaseError: {
|
|
12
|
+
readonly LOGIN_TIMEOUT: 'LOGIN_TIMEOUT';
|
|
13
|
+
readonly LOGIN_CANCELED: 'LOGIN_CANCELED';
|
|
14
|
+
readonly CHECKOUT_CANCELED: 'CHECKOUT_CANCELED';
|
|
15
|
+
readonly CHECKOUT_CREATE_FAILED: 'CHECKOUT_CREATE_FAILED';
|
|
16
|
+
readonly CHECKOUT_SESSION_ID_NOT_FOUND: 'CHECKOUT_SESSION_ID_NOT_FOUND';
|
|
17
|
+
readonly UNKNOWN: 'UNKNOWN';
|
|
18
|
+
};
|
|
19
|
+
type PurchaseError = (typeof PurchaseError)[keyof typeof PurchaseError];
|
|
20
|
+
//#endregion
|
|
19
21
|
export { CheckoutCreateError, LoginCanceledError, LoginTimeoutError, PurchaseError };
|
|
22
|
+
//# sourceMappingURL=index.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../../src/error/index.ts"],"mappings":";cAAa,0BAA0B;EACrC,YAAY;;cAMD,2BAA2B;EACtC;;cAMW,4BAA4B;EACvC;;cAMW;WACX;WACA;WACA;WACA;WACA;WACA;;KAGU,wBAAwB,4BAA4B"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//#region src/error/index.d.ts
|
|
2
|
+
declare class LoginTimeoutError extends Error {
|
|
3
|
+
constructor(timeout: number);
|
|
4
|
+
}
|
|
5
|
+
declare class LoginCanceledError extends Error {
|
|
6
|
+
constructor();
|
|
7
|
+
}
|
|
8
|
+
declare class CheckoutCreateError extends Error {
|
|
9
|
+
constructor();
|
|
10
|
+
}
|
|
11
|
+
declare const PurchaseError: {
|
|
12
|
+
readonly LOGIN_TIMEOUT: 'LOGIN_TIMEOUT';
|
|
13
|
+
readonly LOGIN_CANCELED: 'LOGIN_CANCELED';
|
|
14
|
+
readonly CHECKOUT_CANCELED: 'CHECKOUT_CANCELED';
|
|
15
|
+
readonly CHECKOUT_CREATE_FAILED: 'CHECKOUT_CREATE_FAILED';
|
|
16
|
+
readonly CHECKOUT_SESSION_ID_NOT_FOUND: 'CHECKOUT_SESSION_ID_NOT_FOUND';
|
|
17
|
+
readonly UNKNOWN: 'UNKNOWN';
|
|
18
|
+
};
|
|
19
|
+
type PurchaseError = (typeof PurchaseError)[keyof typeof PurchaseError];
|
|
20
|
+
//#endregion
|
|
21
|
+
export { CheckoutCreateError, LoginCanceledError, LoginTimeoutError, PurchaseError };
|
|
22
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/error/index.ts"],"mappings":";cAAa,0BAA0B;EACrC,YAAY;;cAMD,2BAA2B;EACtC;;cAMW,4BAA4B;EACvC;;cAMW;WACX;WACA;WACA;WACA;WACA;WACA;;KAGU,wBAAwB,4BAA4B"}
|
package/dist/error/index.mjs
CHANGED
|
@@ -1,35 +1,31 @@
|
|
|
1
|
-
|
|
1
|
+
//#region src/error/index.ts
|
|
2
2
|
var LoginTimeoutError = class extends Error {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
constructor(timeout) {
|
|
4
|
+
super(`Login timeout after ${timeout}ms`);
|
|
5
|
+
this.name = "LoginTimeoutError";
|
|
6
|
+
}
|
|
7
7
|
};
|
|
8
8
|
var LoginCanceledError = class extends Error {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
constructor() {
|
|
10
|
+
super("Login canceled by user");
|
|
11
|
+
this.name = "LoginCanceledError";
|
|
12
|
+
}
|
|
13
13
|
};
|
|
14
14
|
var CheckoutCreateError = class extends Error {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
constructor() {
|
|
16
|
+
super("Failed to create checkout session");
|
|
17
|
+
this.name = "SessionCreateError";
|
|
18
|
+
}
|
|
19
19
|
};
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
return PurchaseError2;
|
|
28
|
-
})(PurchaseError || {});
|
|
29
|
-
export {
|
|
30
|
-
CheckoutCreateError,
|
|
31
|
-
LoginCanceledError,
|
|
32
|
-
LoginTimeoutError,
|
|
33
|
-
PurchaseError
|
|
20
|
+
const PurchaseError = {
|
|
21
|
+
LOGIN_TIMEOUT: "LOGIN_TIMEOUT",
|
|
22
|
+
LOGIN_CANCELED: "LOGIN_CANCELED",
|
|
23
|
+
CHECKOUT_CANCELED: "CHECKOUT_CANCELED",
|
|
24
|
+
CHECKOUT_CREATE_FAILED: "CHECKOUT_CREATE_FAILED",
|
|
25
|
+
CHECKOUT_SESSION_ID_NOT_FOUND: "CHECKOUT_SESSION_ID_NOT_FOUND",
|
|
26
|
+
UNKNOWN: "UNKNOWN"
|
|
34
27
|
};
|
|
28
|
+
//#endregion
|
|
29
|
+
export { CheckoutCreateError, LoginCanceledError, LoginTimeoutError, PurchaseError };
|
|
30
|
+
|
|
35
31
|
//# sourceMappingURL=index.mjs.map
|
package/dist/error/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/error/index.ts"],"sourcesContent":["export class LoginTimeoutError extends Error {\n constructor(timeout: number) {\n super(`Login timeout after ${timeout}ms`);\n this.name = 'LoginTimeoutError';\n }\n}\n\nexport class LoginCanceledError extends Error {\n constructor() {\n super('Login canceled by user');\n this.name = 'LoginCanceledError';\n }\n}\n\nexport class CheckoutCreateError extends Error {\n constructor() {\n super('Failed to create checkout session');\n this.name = 'SessionCreateError';\n }\n}\n\nexport
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/error/index.ts"],"sourcesContent":["export class LoginTimeoutError extends Error {\n constructor(timeout: number) {\n super(`Login timeout after ${timeout}ms`);\n this.name = 'LoginTimeoutError';\n }\n}\n\nexport class LoginCanceledError extends Error {\n constructor() {\n super('Login canceled by user');\n this.name = 'LoginCanceledError';\n }\n}\n\nexport class CheckoutCreateError extends Error {\n constructor() {\n super('Failed to create checkout session');\n this.name = 'SessionCreateError';\n }\n}\n\nexport const PurchaseError = {\n LOGIN_TIMEOUT: 'LOGIN_TIMEOUT',\n LOGIN_CANCELED: 'LOGIN_CANCELED',\n CHECKOUT_CANCELED: 'CHECKOUT_CANCELED',\n CHECKOUT_CREATE_FAILED: 'CHECKOUT_CREATE_FAILED',\n CHECKOUT_SESSION_ID_NOT_FOUND: 'CHECKOUT_SESSION_ID_NOT_FOUND',\n UNKNOWN: 'UNKNOWN',\n} as const;\n\nexport type PurchaseError = (typeof PurchaseError)[keyof typeof PurchaseError];\n"],"mappings":";AAAA,IAAa,oBAAb,cAAuC,MAAM;CAC3C,YAAY,SAAiB;EAC3B,MAAM,uBAAuB,QAAQ,GAAG;EACxC,KAAK,OAAO;CACd;AACF;AAEA,IAAa,qBAAb,cAAwC,MAAM;CAC5C,cAAc;EACZ,MAAM,wBAAwB;EAC9B,KAAK,OAAO;CACd;AACF;AAEA,IAAa,sBAAb,cAAyC,MAAM;CAC7C,cAAc;EACZ,MAAM,mCAAmC;EACzC,KAAK,OAAO;CACd;AACF;AAEA,MAAa,gBAAgB;CAC3B,eAAe;CACf,gBAAgB;CAChB,mBAAmB;CACnB,wBAAwB;CACxB,+BAA+B;CAC/B,SAAS;AACX"}
|