@shware/http 3.4.0 → 3.4.1
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/cache/index.d.cts +1 -2
- package/dist/cache/index.d.cts.map +1 -1
- package/dist/cache/index.d.mts +1 -2
- package/dist/cache/index.d.mts.map +1 -1
- package/dist/error/detail.d.cts +14 -15
- package/dist/error/detail.d.cts.map +1 -1
- package/dist/error/detail.d.mts +14 -15
- package/dist/error/detail.d.mts.map +1 -1
- package/dist/error/i18n/en-us.d.cts +1 -2
- package/dist/error/i18n/en-us.d.cts.map +1 -1
- package/dist/error/i18n/en-us.d.mts +1 -2
- package/dist/error/i18n/en-us.d.mts.map +1 -1
- package/dist/error/index.d.cts +5 -6
- package/dist/error/index.d.cts.map +1 -1
- package/dist/error/index.d.mts +5 -6
- package/dist/error/index.d.mts.map +1 -1
- package/dist/error/parse.d.cts +4 -5
- package/dist/error/parse.d.cts.map +1 -1
- package/dist/error/parse.d.mts +4 -5
- package/dist/error/parse.d.mts.map +1 -1
- package/dist/error/reason.d.cts +2 -3
- package/dist/error/reason.d.cts.map +1 -1
- package/dist/error/reason.d.mts +2 -3
- package/dist/error/reason.d.mts.map +1 -1
- package/dist/error/status.d.cts +6 -7
- package/dist/error/status.d.cts.map +1 -1
- package/dist/error/status.d.mts +6 -7
- package/dist/error/status.d.mts.map +1 -1
- package/dist/google-one-tap/index.d.cts +8 -9
- package/dist/google-one-tap/index.d.cts.map +1 -1
- package/dist/google-one-tap/index.d.mts +8 -9
- package/dist/google-one-tap/index.d.mts.map +1 -1
- package/dist/google-one-tap/types.d.cts +6 -7
- package/dist/google-one-tap/types.d.cts.map +1 -1
- package/dist/google-one-tap/types.d.mts +6 -7
- package/dist/google-one-tap/types.d.mts.map +1 -1
- package/dist/hono/authorizer.d.cts +3 -4
- package/dist/hono/authorizer.d.cts.map +1 -1
- package/dist/hono/authorizer.d.mts +3 -4
- package/dist/hono/authorizer.d.mts.map +1 -1
- package/dist/hono/csrf.d.cts +3 -4
- package/dist/hono/csrf.d.cts.map +1 -1
- package/dist/hono/csrf.d.mts +3 -4
- package/dist/hono/csrf.d.mts.map +1 -1
- package/dist/hono/geolocation.d.cts +1 -2
- package/dist/hono/geolocation.d.cts.map +1 -1
- package/dist/hono/geolocation.d.mts +1 -2
- package/dist/hono/geolocation.d.mts.map +1 -1
- package/dist/hono/handler.d.cts +4 -5
- package/dist/hono/handler.d.cts.map +1 -1
- package/dist/hono/handler.d.mts +4 -5
- package/dist/hono/handler.d.mts.map +1 -1
- package/dist/hono/rate-limit.d.cts +5 -6
- package/dist/hono/rate-limit.d.cts.map +1 -1
- package/dist/hono/rate-limit.d.mts +5 -6
- package/dist/hono/rate-limit.d.mts.map +1 -1
- package/dist/hono/validator.d.cts +16 -17
- package/dist/hono/validator.d.cts.map +1 -1
- package/dist/hono/validator.d.mts +17 -18
- package/dist/hono/validator.d.mts.map +1 -1
- package/dist/iso/iso-3601-1.d.cts +2 -3
- package/dist/iso/iso-3601-1.d.cts.map +1 -1
- package/dist/iso/iso-3601-1.d.mts +2 -3
- package/dist/iso/iso-3601-1.d.mts.map +1 -1
- package/dist/max-length/index.d.cts +23 -23
- package/dist/max-length/index.d.cts.map +1 -1
- package/dist/max-length/index.d.mts +23 -23
- package/dist/max-length/index.d.mts.map +1 -1
- package/dist/message.d.cts +1 -2
- package/dist/message.d.cts.map +1 -1
- package/dist/message.d.mts +1 -2
- package/dist/message.d.mts.map +1 -1
- package/dist/response.d.cts +18 -19
- package/dist/response.d.cts.map +1 -1
- package/dist/response.d.mts +18 -19
- package/dist/response.d.mts.map +1 -1
- package/dist/snowflake.d.cts +2 -3
- package/dist/snowflake.d.cts.map +1 -1
- package/dist/snowflake.d.mts +2 -3
- package/dist/snowflake.d.mts.map +1 -1
- package/dist/utils/geolocation.d.cts +5 -6
- package/dist/utils/geolocation.d.cts.map +1 -1
- package/dist/utils/geolocation.d.mts +5 -6
- package/dist/utils/geolocation.d.mts.map +1 -1
- package/dist/utils/google-tag-gateway.d.cts +1 -2
- package/dist/utils/google-tag-gateway.d.cts.map +1 -1
- package/dist/utils/google-tag-gateway.d.mts +1 -2
- package/dist/utils/google-tag-gateway.d.mts.map +1 -1
- package/dist/utils/timing.d.cts +2 -3
- package/dist/utils/timing.d.cts.map +1 -1
- package/dist/utils/timing.d.mts +2 -3
- package/dist/utils/timing.d.mts.map +1 -1
- package/dist/webhook/index.d.cts +1 -2
- package/dist/webhook/index.d.cts.map +1 -1
- package/dist/webhook/index.d.mts +1 -2
- package/dist/webhook/index.d.mts.map +1 -1
- package/package.json +9 -9
package/dist/cache/index.d.cts
CHANGED
|
@@ -5,7 +5,6 @@ interface Props<A extends unknown[], R> {
|
|
|
5
5
|
fn: (...args: A) => R;
|
|
6
6
|
condition?: (...args: A) => boolean;
|
|
7
7
|
}
|
|
8
|
-
declare function cache<A extends unknown[], R>(_props: Props<A, R>): void;
|
|
8
|
+
export declare function cache<A extends unknown[], R>(_props: Props<A, R>): void;
|
|
9
9
|
//#endregion
|
|
10
|
-
export { cache };
|
|
11
10
|
//# sourceMappingURL=index.d.cts.map
|
|
@@ -1 +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;;
|
|
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;;wBAGR,MAAM,qBAAqB,GAAG,QAAQ,MAAM,GAAG"}
|
package/dist/cache/index.d.mts
CHANGED
|
@@ -5,7 +5,6 @@ interface Props<A extends unknown[], R> {
|
|
|
5
5
|
fn: (...args: A) => R;
|
|
6
6
|
condition?: (...args: A) => boolean;
|
|
7
7
|
}
|
|
8
|
-
declare function cache<A extends unknown[], R>(_props: Props<A, R>): void;
|
|
8
|
+
export declare function cache<A extends unknown[], R>(_props: Props<A, R>): void;
|
|
9
9
|
//#endregion
|
|
10
|
-
export { cache };
|
|
11
10
|
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1 +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;;
|
|
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;;wBAGR,MAAM,qBAAqB,GAAG,QAAQ,MAAM,GAAG"}
|
package/dist/error/detail.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ResolvedErrorReason } from "./reason.cjs";
|
|
2
2
|
//#region src/error/detail.d.ts
|
|
3
|
-
declare const DetailType: {
|
|
3
|
+
export declare const DetailType: {
|
|
4
4
|
readonly ERROR_INFO: 'type.googleapis.com/google.rpc.ErrorInfo';
|
|
5
5
|
readonly RETRY_INFO: 'type.googleapis.com/google.rpc.RetryInfo';
|
|
6
6
|
readonly DEBUG_INFO: 'type.googleapis.com/google.rpc.DebugInfo';
|
|
@@ -12,23 +12,23 @@ declare const DetailType: {
|
|
|
12
12
|
readonly HELP: 'type.googleapis.com/google.rpc.Help';
|
|
13
13
|
readonly LOCALIZED_MESSAGE: 'type.googleapis.com/google.rpc.LocalizedMessage';
|
|
14
14
|
};
|
|
15
|
-
type DetailType = (typeof DetailType)[keyof typeof DetailType];
|
|
16
|
-
interface ErrorInfo {
|
|
15
|
+
export type DetailType = (typeof DetailType)[keyof typeof DetailType];
|
|
16
|
+
export interface ErrorInfo {
|
|
17
17
|
'@type': typeof DetailType.ERROR_INFO;
|
|
18
18
|
reason: ResolvedErrorReason;
|
|
19
19
|
domain?: string;
|
|
20
20
|
metadata?: Record<string, string>;
|
|
21
21
|
}
|
|
22
|
-
interface RetryInfo {
|
|
22
|
+
export interface RetryInfo {
|
|
23
23
|
'@type': typeof DetailType.RETRY_INFO;
|
|
24
24
|
retryDelay: number;
|
|
25
25
|
}
|
|
26
|
-
interface DebugInfo {
|
|
26
|
+
export interface DebugInfo {
|
|
27
27
|
'@type': typeof DetailType.DEBUG_INFO;
|
|
28
28
|
stackEntries: string[];
|
|
29
29
|
detail: string;
|
|
30
30
|
}
|
|
31
|
-
interface QuotaFailure {
|
|
31
|
+
export interface QuotaFailure {
|
|
32
32
|
'@type': typeof DetailType.QUOTA_FAILURE;
|
|
33
33
|
violations: {
|
|
34
34
|
subject: string;
|
|
@@ -41,7 +41,7 @@ interface QuotaFailure {
|
|
|
41
41
|
futureQuotaValue: number;
|
|
42
42
|
}[];
|
|
43
43
|
}
|
|
44
|
-
interface PreconditionFailure {
|
|
44
|
+
export interface PreconditionFailure {
|
|
45
45
|
'@type': typeof DetailType.PRECONDITION_FAILURE;
|
|
46
46
|
violations: {
|
|
47
47
|
type: string;
|
|
@@ -49,7 +49,7 @@ interface PreconditionFailure {
|
|
|
49
49
|
description: string;
|
|
50
50
|
}[];
|
|
51
51
|
}
|
|
52
|
-
interface BadRequest {
|
|
52
|
+
export interface BadRequest {
|
|
53
53
|
'@type': typeof DetailType.BAD_REQUEST;
|
|
54
54
|
fieldViolations: {
|
|
55
55
|
field: string;
|
|
@@ -58,38 +58,38 @@ interface BadRequest {
|
|
|
58
58
|
localizedMessage: Omit<LocalizedMessage, '@type'>;
|
|
59
59
|
}[];
|
|
60
60
|
}
|
|
61
|
-
interface RequestInfo {
|
|
61
|
+
export interface RequestInfo {
|
|
62
62
|
'@type': typeof DetailType.REQUEST_INFO;
|
|
63
63
|
requestId: string;
|
|
64
64
|
servingData: string;
|
|
65
65
|
}
|
|
66
|
-
interface ResourceInfo {
|
|
66
|
+
export interface ResourceInfo {
|
|
67
67
|
'@type': typeof DetailType.RESOURCE_INFO;
|
|
68
68
|
resourceType: string;
|
|
69
69
|
resourceName: string;
|
|
70
70
|
owner: string;
|
|
71
71
|
description: string;
|
|
72
72
|
}
|
|
73
|
-
interface Help {
|
|
73
|
+
export interface Help {
|
|
74
74
|
'@type': typeof DetailType.HELP;
|
|
75
75
|
links: {
|
|
76
76
|
url: string;
|
|
77
77
|
description: string;
|
|
78
78
|
}[];
|
|
79
79
|
}
|
|
80
|
-
interface LocalizedMessage {
|
|
80
|
+
export interface LocalizedMessage {
|
|
81
81
|
'@type': typeof DetailType.LOCALIZED_MESSAGE;
|
|
82
82
|
locale: string;
|
|
83
83
|
message: string;
|
|
84
84
|
}
|
|
85
|
-
type Detail = RetryInfo | DebugInfo | QuotaFailure | ErrorInfo | PreconditionFailure | BadRequest | RequestInfo | ResourceInfo | Help | LocalizedMessage;
|
|
85
|
+
export type Detail = RetryInfo | DebugInfo | QuotaFailure | ErrorInfo | PreconditionFailure | BadRequest | RequestInfo | ResourceInfo | Help | LocalizedMessage;
|
|
86
86
|
/**
|
|
87
87
|
* Example usage:
|
|
88
88
|
* const details = Details.new()
|
|
89
89
|
* .requestInfo({ requestId: '1234567890', servingData: '/v1/tests' })
|
|
90
90
|
* .errorInfo({ reason: 'ACCOUNT_LOCKED' });
|
|
91
91
|
* */
|
|
92
|
-
declare class Details {
|
|
92
|
+
export declare class Details {
|
|
93
93
|
readonly list: Detail[];
|
|
94
94
|
private constructor();
|
|
95
95
|
static new(): Details;
|
|
@@ -105,5 +105,4 @@ declare class Details {
|
|
|
105
105
|
localizedMessage(detail: Omit<LocalizedMessage, '@type'>): this;
|
|
106
106
|
}
|
|
107
107
|
//#endregion
|
|
108
|
-
export { BadRequest, DebugInfo, Detail, DetailType, Details, ErrorInfo, Help, LocalizedMessage, PreconditionFailure, QuotaFailure, RequestInfo, ResourceInfo, RetryInfo };
|
|
109
108
|
//# sourceMappingURL=detail.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"detail.d.cts","names":[],"sources":["../../src/error/detail.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"detail.d.cts","names":[],"sources":["../../src/error/detail.ts"],"mappings":";;qBAGa;WACX;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;YAGU,qBAAqB,yBAAyB;iBAEzC;EACf,gBAAgB,WAAW;EAC3B,QAAQ;EACR;EACA,WAAW;;iBAGI;EACf,gBAAgB,WAAW;EAC3B;;iBAGe;EACf,gBAAgB,WAAW;EAC3B;EACA;;iBAGe;EACf,gBAAgB,WAAW;EAC3B;IACE;IACA;IACA;IACA;IACA;IACA;IACA,iBAAiB;IACjB;;;iBAIa;EACf,gBAAgB,WAAW;EAC3B;IAAc;IAAc;IAAiB;;;iBAG9B;EACf,gBAAgB,WAAW;EAC3B;IACE;IACA;IACA;IACA,kBAAkB,KAAK;;;iBAIV;EACf,gBAAgB,WAAW;EAC3B;EACA;;iBAGe;EACf,gBAAgB,WAAW;EAC3B;EACA;EACA;EACA;;iBAGe;EACf,gBAAgB,WAAW;EAC3B;IAAS;IAAa;;;iBAGP;EACf,gBAAgB,WAAW;EAC3B;EACA;;YAGU,SACR,YACA,YACA,eACA,YACA,sBACA,aACA,cACA,eACA,OACA;;;;;;;qBAQS;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.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ResolvedErrorReason } from "./reason.mjs";
|
|
2
2
|
//#region src/error/detail.d.ts
|
|
3
|
-
declare const DetailType: {
|
|
3
|
+
export declare const DetailType: {
|
|
4
4
|
readonly ERROR_INFO: 'type.googleapis.com/google.rpc.ErrorInfo';
|
|
5
5
|
readonly RETRY_INFO: 'type.googleapis.com/google.rpc.RetryInfo';
|
|
6
6
|
readonly DEBUG_INFO: 'type.googleapis.com/google.rpc.DebugInfo';
|
|
@@ -12,23 +12,23 @@ declare const DetailType: {
|
|
|
12
12
|
readonly HELP: 'type.googleapis.com/google.rpc.Help';
|
|
13
13
|
readonly LOCALIZED_MESSAGE: 'type.googleapis.com/google.rpc.LocalizedMessage';
|
|
14
14
|
};
|
|
15
|
-
type DetailType = (typeof DetailType)[keyof typeof DetailType];
|
|
16
|
-
interface ErrorInfo {
|
|
15
|
+
export type DetailType = (typeof DetailType)[keyof typeof DetailType];
|
|
16
|
+
export interface ErrorInfo {
|
|
17
17
|
'@type': typeof DetailType.ERROR_INFO;
|
|
18
18
|
reason: ResolvedErrorReason;
|
|
19
19
|
domain?: string;
|
|
20
20
|
metadata?: Record<string, string>;
|
|
21
21
|
}
|
|
22
|
-
interface RetryInfo {
|
|
22
|
+
export interface RetryInfo {
|
|
23
23
|
'@type': typeof DetailType.RETRY_INFO;
|
|
24
24
|
retryDelay: number;
|
|
25
25
|
}
|
|
26
|
-
interface DebugInfo {
|
|
26
|
+
export interface DebugInfo {
|
|
27
27
|
'@type': typeof DetailType.DEBUG_INFO;
|
|
28
28
|
stackEntries: string[];
|
|
29
29
|
detail: string;
|
|
30
30
|
}
|
|
31
|
-
interface QuotaFailure {
|
|
31
|
+
export interface QuotaFailure {
|
|
32
32
|
'@type': typeof DetailType.QUOTA_FAILURE;
|
|
33
33
|
violations: {
|
|
34
34
|
subject: string;
|
|
@@ -41,7 +41,7 @@ interface QuotaFailure {
|
|
|
41
41
|
futureQuotaValue: number;
|
|
42
42
|
}[];
|
|
43
43
|
}
|
|
44
|
-
interface PreconditionFailure {
|
|
44
|
+
export interface PreconditionFailure {
|
|
45
45
|
'@type': typeof DetailType.PRECONDITION_FAILURE;
|
|
46
46
|
violations: {
|
|
47
47
|
type: string;
|
|
@@ -49,7 +49,7 @@ interface PreconditionFailure {
|
|
|
49
49
|
description: string;
|
|
50
50
|
}[];
|
|
51
51
|
}
|
|
52
|
-
interface BadRequest {
|
|
52
|
+
export interface BadRequest {
|
|
53
53
|
'@type': typeof DetailType.BAD_REQUEST;
|
|
54
54
|
fieldViolations: {
|
|
55
55
|
field: string;
|
|
@@ -58,38 +58,38 @@ interface BadRequest {
|
|
|
58
58
|
localizedMessage: Omit<LocalizedMessage, '@type'>;
|
|
59
59
|
}[];
|
|
60
60
|
}
|
|
61
|
-
interface RequestInfo {
|
|
61
|
+
export interface RequestInfo {
|
|
62
62
|
'@type': typeof DetailType.REQUEST_INFO;
|
|
63
63
|
requestId: string;
|
|
64
64
|
servingData: string;
|
|
65
65
|
}
|
|
66
|
-
interface ResourceInfo {
|
|
66
|
+
export interface ResourceInfo {
|
|
67
67
|
'@type': typeof DetailType.RESOURCE_INFO;
|
|
68
68
|
resourceType: string;
|
|
69
69
|
resourceName: string;
|
|
70
70
|
owner: string;
|
|
71
71
|
description: string;
|
|
72
72
|
}
|
|
73
|
-
interface Help {
|
|
73
|
+
export interface Help {
|
|
74
74
|
'@type': typeof DetailType.HELP;
|
|
75
75
|
links: {
|
|
76
76
|
url: string;
|
|
77
77
|
description: string;
|
|
78
78
|
}[];
|
|
79
79
|
}
|
|
80
|
-
interface LocalizedMessage {
|
|
80
|
+
export interface LocalizedMessage {
|
|
81
81
|
'@type': typeof DetailType.LOCALIZED_MESSAGE;
|
|
82
82
|
locale: string;
|
|
83
83
|
message: string;
|
|
84
84
|
}
|
|
85
|
-
type Detail = RetryInfo | DebugInfo | QuotaFailure | ErrorInfo | PreconditionFailure | BadRequest | RequestInfo | ResourceInfo | Help | LocalizedMessage;
|
|
85
|
+
export type Detail = RetryInfo | DebugInfo | QuotaFailure | ErrorInfo | PreconditionFailure | BadRequest | RequestInfo | ResourceInfo | Help | LocalizedMessage;
|
|
86
86
|
/**
|
|
87
87
|
* Example usage:
|
|
88
88
|
* const details = Details.new()
|
|
89
89
|
* .requestInfo({ requestId: '1234567890', servingData: '/v1/tests' })
|
|
90
90
|
* .errorInfo({ reason: 'ACCOUNT_LOCKED' });
|
|
91
91
|
* */
|
|
92
|
-
declare class Details {
|
|
92
|
+
export declare class Details {
|
|
93
93
|
readonly list: Detail[];
|
|
94
94
|
private constructor();
|
|
95
95
|
static new(): Details;
|
|
@@ -105,5 +105,4 @@ declare class Details {
|
|
|
105
105
|
localizedMessage(detail: Omit<LocalizedMessage, '@type'>): this;
|
|
106
106
|
}
|
|
107
107
|
//#endregion
|
|
108
|
-
export { BadRequest, DebugInfo, Detail, DetailType, Details, ErrorInfo, Help, LocalizedMessage, PreconditionFailure, QuotaFailure, RequestInfo, ResourceInfo, RetryInfo };
|
|
109
108
|
//# sourceMappingURL=detail.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"detail.d.mts","names":[],"sources":["../../src/error/detail.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"detail.d.mts","names":[],"sources":["../../src/error/detail.ts"],"mappings":";;qBAGa;WACX;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;YAGU,qBAAqB,yBAAyB;iBAEzC;EACf,gBAAgB,WAAW;EAC3B,QAAQ;EACR;EACA,WAAW;;iBAGI;EACf,gBAAgB,WAAW;EAC3B;;iBAGe;EACf,gBAAgB,WAAW;EAC3B;EACA;;iBAGe;EACf,gBAAgB,WAAW;EAC3B;IACE;IACA;IACA;IACA;IACA;IACA;IACA,iBAAiB;IACjB;;;iBAIa;EACf,gBAAgB,WAAW;EAC3B;IAAc;IAAc;IAAiB;;;iBAG9B;EACf,gBAAgB,WAAW;EAC3B;IACE;IACA;IACA;IACA,kBAAkB,KAAK;;;iBAIV;EACf,gBAAgB,WAAW;EAC3B;EACA;;iBAGe;EACf,gBAAgB,WAAW;EAC3B;EACA;EACA;EACA;;iBAGe;EACf,gBAAgB,WAAW;EAC3B;IAAS;IAAa;;;iBAGP;EACf,gBAAgB,WAAW;EAC3B;EACA;;YAGU,SACR,YACA,YACA,eACA,YACA,sBACA,aACA,cACA,eACA,OACA;;;;;;;qBAQS;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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"en-us.d.cts","names":[],"sources":["../../../src/error/i18n/en-us.ts"],"mappings":";
|
|
1
|
+
{"version":3,"file":"en-us.d.cts","names":[],"sources":["../../../src/error/i18n/en-us.ts"],"mappings":";qBAAa"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"en-us.d.mts","names":[],"sources":["../../../src/error/i18n/en-us.ts"],"mappings":";
|
|
1
|
+
{"version":3,"file":"en-us.d.mts","names":[],"sources":["../../../src/error/i18n/en-us.ts"],"mappings":";qBAAa"}
|
package/dist/error/index.d.cts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
//#region src/error/index.d.ts
|
|
2
|
-
declare class LoginTimeoutError extends Error {
|
|
2
|
+
export declare class LoginTimeoutError extends Error {
|
|
3
3
|
constructor(timeout: number);
|
|
4
4
|
}
|
|
5
|
-
declare class LoginCanceledError extends Error {
|
|
5
|
+
export declare class LoginCanceledError extends Error {
|
|
6
6
|
constructor();
|
|
7
7
|
}
|
|
8
|
-
declare class CheckoutCreateError extends Error {
|
|
8
|
+
export declare class CheckoutCreateError extends Error {
|
|
9
9
|
constructor();
|
|
10
10
|
}
|
|
11
|
-
declare const PurchaseError: {
|
|
11
|
+
export declare const PurchaseError: {
|
|
12
12
|
readonly LOGIN_TIMEOUT: 'LOGIN_TIMEOUT';
|
|
13
13
|
readonly LOGIN_CANCELED: 'LOGIN_CANCELED';
|
|
14
14
|
readonly CHECKOUT_CANCELED: 'CHECKOUT_CANCELED';
|
|
@@ -16,7 +16,6 @@ declare const PurchaseError: {
|
|
|
16
16
|
readonly CHECKOUT_SESSION_ID_NOT_FOUND: 'CHECKOUT_SESSION_ID_NOT_FOUND';
|
|
17
17
|
readonly UNKNOWN: 'UNKNOWN';
|
|
18
18
|
};
|
|
19
|
-
type PurchaseError = (typeof PurchaseError)[keyof typeof PurchaseError];
|
|
19
|
+
export type PurchaseError = (typeof PurchaseError)[keyof typeof PurchaseError];
|
|
20
20
|
//#endregion
|
|
21
|
-
export { CheckoutCreateError, LoginCanceledError, LoginTimeoutError, PurchaseError };
|
|
22
21
|
//# sourceMappingURL=index.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../../src/error/index.ts"],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../../src/error/index.ts"],"mappings":";qBAAa,0BAA0B;EACrC,YAAY;;qBAMD,2BAA2B;EACtC;;qBAMW,4BAA4B;EACvC;;qBAMW;WACX;WACA;WACA;WACA;WACA;WACA;;YAGU,wBAAwB,4BAA4B"}
|
package/dist/error/index.d.mts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
//#region src/error/index.d.ts
|
|
2
|
-
declare class LoginTimeoutError extends Error {
|
|
2
|
+
export declare class LoginTimeoutError extends Error {
|
|
3
3
|
constructor(timeout: number);
|
|
4
4
|
}
|
|
5
|
-
declare class LoginCanceledError extends Error {
|
|
5
|
+
export declare class LoginCanceledError extends Error {
|
|
6
6
|
constructor();
|
|
7
7
|
}
|
|
8
|
-
declare class CheckoutCreateError extends Error {
|
|
8
|
+
export declare class CheckoutCreateError extends Error {
|
|
9
9
|
constructor();
|
|
10
10
|
}
|
|
11
|
-
declare const PurchaseError: {
|
|
11
|
+
export declare const PurchaseError: {
|
|
12
12
|
readonly LOGIN_TIMEOUT: 'LOGIN_TIMEOUT';
|
|
13
13
|
readonly LOGIN_CANCELED: 'LOGIN_CANCELED';
|
|
14
14
|
readonly CHECKOUT_CANCELED: 'CHECKOUT_CANCELED';
|
|
@@ -16,7 +16,6 @@ declare const PurchaseError: {
|
|
|
16
16
|
readonly CHECKOUT_SESSION_ID_NOT_FOUND: 'CHECKOUT_SESSION_ID_NOT_FOUND';
|
|
17
17
|
readonly UNKNOWN: 'UNKNOWN';
|
|
18
18
|
};
|
|
19
|
-
type PurchaseError = (typeof PurchaseError)[keyof typeof PurchaseError];
|
|
19
|
+
export type PurchaseError = (typeof PurchaseError)[keyof typeof PurchaseError];
|
|
20
20
|
//#endregion
|
|
21
|
-
export { CheckoutCreateError, LoginCanceledError, LoginTimeoutError, PurchaseError };
|
|
22
21
|
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/error/index.ts"],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/error/index.ts"],"mappings":";qBAAa,0BAA0B;EACrC,YAAY;;qBAMD,2BAA2B;EACtC;;qBAMW,4BAA4B;EACvC;;qBAMW;WACX;WACA;WACA;WACA;WACA;WACA;;YAGU,wBAAwB,4BAA4B"}
|
package/dist/error/parse.d.cts
CHANGED
|
@@ -2,7 +2,7 @@ import { ResolvedErrorReason } from "./reason.cjs";
|
|
|
2
2
|
import { BadRequest, ErrorInfo } from "./detail.cjs";
|
|
3
3
|
import { DefaultNamespace, Namespace, TFunction } from "i18next";
|
|
4
4
|
//#region src/error/parse.d.ts
|
|
5
|
-
declare function getErrorInfo(data: unknown): ErrorInfo | null;
|
|
5
|
+
export declare function getErrorInfo(data: unknown): ErrorInfo | null;
|
|
6
6
|
/**
|
|
7
7
|
* @example For axios:
|
|
8
8
|
*
|
|
@@ -11,7 +11,7 @@ declare function getErrorInfo(data: unknown): ErrorInfo | null;
|
|
|
11
11
|
* const { message } = getErrorMessage(error.response.data, t);
|
|
12
12
|
* toast.error(message);
|
|
13
13
|
*/
|
|
14
|
-
declare function getErrorMessage<Ns extends Namespace = DefaultNamespace, KPrefix = undefined>(data: unknown, t: TFunction<Ns, KPrefix>): {
|
|
14
|
+
export declare function getErrorMessage<Ns extends Namespace = DefaultNamespace, KPrefix = undefined>(data: unknown, t: TFunction<Ns, KPrefix>): {
|
|
15
15
|
reason: ResolvedErrorReason | null;
|
|
16
16
|
message: string;
|
|
17
17
|
};
|
|
@@ -37,7 +37,7 @@ declare function getErrorMessage<Ns extends Namespace = DefaultNamespace, KPrefi
|
|
|
37
37
|
* },
|
|
38
38
|
* });
|
|
39
39
|
*/
|
|
40
|
-
declare function isErrorReason(data: unknown, ...reasons: ResolvedErrorReason[]): boolean;
|
|
40
|
+
export declare function isErrorReason(data: unknown, ...reasons: ResolvedErrorReason[]): boolean;
|
|
41
41
|
/**
|
|
42
42
|
* @example For react-hook-form:
|
|
43
43
|
*
|
|
@@ -47,7 +47,6 @@ declare function isErrorReason(data: unknown, ...reasons: ResolvedErrorReason[])
|
|
|
47
47
|
* setError(violation.field, { message: violation.description });
|
|
48
48
|
* });
|
|
49
49
|
*/
|
|
50
|
-
declare function getFieldViolations(data: unknown): BadRequest['fieldViolations'];
|
|
50
|
+
export declare function getFieldViolations(data: unknown): BadRequest['fieldViolations'];
|
|
51
51
|
//#endregion
|
|
52
|
-
export { getErrorInfo, getErrorMessage, getFieldViolations, isErrorReason };
|
|
53
52
|
//# sourceMappingURL=parse.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse.d.cts","names":[],"sources":["../../src/error/parse.ts"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"parse.d.cts","names":[],"sources":["../../src/error/parse.ts"],"mappings":";;;;wBAcgB,aAAa,gBAAgB;;;;;;;;;wBAe7B,gBAAgB,WAAW,YAAY,kBAAkB,qBACvE,eACA,GAAG,UAAU,IAAI;EACd,QAAQ;EAA4B;;;;;;;;;;;;;;;;;;;;;;;;wBAwDzB,cAAc,kBAAkB,SAAS;;;;;;;;;;wBAczC,mBAAmB,gBAAgB"}
|
package/dist/error/parse.d.mts
CHANGED
|
@@ -2,7 +2,7 @@ import { ResolvedErrorReason } from "./reason.mjs";
|
|
|
2
2
|
import { BadRequest, ErrorInfo } from "./detail.mjs";
|
|
3
3
|
import { DefaultNamespace, Namespace, TFunction } from "i18next";
|
|
4
4
|
//#region src/error/parse.d.ts
|
|
5
|
-
declare function getErrorInfo(data: unknown): ErrorInfo | null;
|
|
5
|
+
export declare function getErrorInfo(data: unknown): ErrorInfo | null;
|
|
6
6
|
/**
|
|
7
7
|
* @example For axios:
|
|
8
8
|
*
|
|
@@ -11,7 +11,7 @@ declare function getErrorInfo(data: unknown): ErrorInfo | null;
|
|
|
11
11
|
* const { message } = getErrorMessage(error.response.data, t);
|
|
12
12
|
* toast.error(message);
|
|
13
13
|
*/
|
|
14
|
-
declare function getErrorMessage<Ns extends Namespace = DefaultNamespace, KPrefix = undefined>(data: unknown, t: TFunction<Ns, KPrefix>): {
|
|
14
|
+
export declare function getErrorMessage<Ns extends Namespace = DefaultNamespace, KPrefix = undefined>(data: unknown, t: TFunction<Ns, KPrefix>): {
|
|
15
15
|
reason: ResolvedErrorReason | null;
|
|
16
16
|
message: string;
|
|
17
17
|
};
|
|
@@ -37,7 +37,7 @@ declare function getErrorMessage<Ns extends Namespace = DefaultNamespace, KPrefi
|
|
|
37
37
|
* },
|
|
38
38
|
* });
|
|
39
39
|
*/
|
|
40
|
-
declare function isErrorReason(data: unknown, ...reasons: ResolvedErrorReason[]): boolean;
|
|
40
|
+
export declare function isErrorReason(data: unknown, ...reasons: ResolvedErrorReason[]): boolean;
|
|
41
41
|
/**
|
|
42
42
|
* @example For react-hook-form:
|
|
43
43
|
*
|
|
@@ -47,7 +47,6 @@ declare function isErrorReason(data: unknown, ...reasons: ResolvedErrorReason[])
|
|
|
47
47
|
* setError(violation.field, { message: violation.description });
|
|
48
48
|
* });
|
|
49
49
|
*/
|
|
50
|
-
declare function getFieldViolations(data: unknown): BadRequest['fieldViolations'];
|
|
50
|
+
export declare function getFieldViolations(data: unknown): BadRequest['fieldViolations'];
|
|
51
51
|
//#endregion
|
|
52
|
-
export { getErrorInfo, getErrorMessage, getFieldViolations, isErrorReason };
|
|
53
52
|
//# sourceMappingURL=parse.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse.d.mts","names":[],"sources":["../../src/error/parse.ts"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"parse.d.mts","names":[],"sources":["../../src/error/parse.ts"],"mappings":";;;;wBAcgB,aAAa,gBAAgB;;;;;;;;;wBAe7B,gBAAgB,WAAW,YAAY,kBAAkB,qBACvE,eACA,GAAG,UAAU,IAAI;EACd,QAAQ;EAA4B;;;;;;;;;;;;;;;;;;;;;;;;wBAwDzB,cAAc,kBAAkB,SAAS;;;;;;;;;;wBAczC,mBAAmB,gBAAgB"}
|
package/dist/error/reason.d.cts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
//#region src/error/reason.d.ts
|
|
2
|
-
interface ErrorReason {}
|
|
3
|
-
type ResolvedErrorReason = keyof ErrorReason extends never ? string : keyof ErrorReason;
|
|
2
|
+
export interface ErrorReason {}
|
|
3
|
+
export type ResolvedErrorReason = keyof ErrorReason extends never ? string : keyof ErrorReason;
|
|
4
4
|
//#endregion
|
|
5
|
-
export { ErrorReason, ResolvedErrorReason };
|
|
6
5
|
//# sourceMappingURL=reason.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reason.d.cts","names":[],"sources":["../../src/error/reason.ts"],"mappings":";
|
|
1
|
+
{"version":3,"file":"reason.d.cts","names":[],"sources":["../../src/error/reason.ts"],"mappings":";iBACiB;YAEL,4BAA4B,2CAA2C"}
|
package/dist/error/reason.d.mts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
//#region src/error/reason.d.ts
|
|
2
|
-
interface ErrorReason {}
|
|
3
|
-
type ResolvedErrorReason = keyof ErrorReason extends never ? string : keyof ErrorReason;
|
|
2
|
+
export interface ErrorReason {}
|
|
3
|
+
export type ResolvedErrorReason = keyof ErrorReason extends never ? string : keyof ErrorReason;
|
|
4
4
|
//#endregion
|
|
5
|
-
export { ErrorReason, ResolvedErrorReason };
|
|
6
5
|
//# sourceMappingURL=reason.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reason.d.mts","names":[],"sources":["../../src/error/reason.ts"],"mappings":";
|
|
1
|
+
{"version":3,"file":"reason.d.mts","names":[],"sources":["../../src/error/reason.ts"],"mappings":";iBACiB;YAEL,4BAA4B,2CAA2C"}
|
package/dist/error/status.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Detail, Details } from "./detail.cjs";
|
|
2
2
|
//#region src/error/status.d.ts
|
|
3
|
-
declare const Code: {
|
|
3
|
+
export declare const Code: {
|
|
4
4
|
readonly OK: 200;
|
|
5
5
|
readonly CANCELLED: 499;
|
|
6
6
|
readonly UNKNOWN: 500;
|
|
@@ -20,8 +20,8 @@ declare const Code: {
|
|
|
20
20
|
readonly UNAUTHENTICATED: 401;
|
|
21
21
|
readonly METHOD_NOT_ALLOWED: 405;
|
|
22
22
|
};
|
|
23
|
-
declare const DEFAULT_MESSAGES: Record<keyof typeof Code, string>;
|
|
24
|
-
interface ErrorBody {
|
|
23
|
+
export declare const DEFAULT_MESSAGES: Record<keyof typeof Code, string>;
|
|
24
|
+
export interface ErrorBody {
|
|
25
25
|
error: {
|
|
26
26
|
code: number;
|
|
27
27
|
status: keyof typeof Code;
|
|
@@ -29,12 +29,12 @@ interface ErrorBody {
|
|
|
29
29
|
details: Detail[];
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
|
-
declare class StatusError extends Error {
|
|
32
|
+
export declare class StatusError extends Error {
|
|
33
33
|
readonly status: number;
|
|
34
34
|
readonly body?: ErrorBody;
|
|
35
35
|
constructor(status: number, body?: ErrorBody);
|
|
36
36
|
}
|
|
37
|
-
declare class StatusCode {
|
|
37
|
+
export declare class StatusCode {
|
|
38
38
|
code: keyof typeof Code;
|
|
39
39
|
message?: string;
|
|
40
40
|
private constructor();
|
|
@@ -43,7 +43,7 @@ declare class StatusCode {
|
|
|
43
43
|
error(details?: Details): Error;
|
|
44
44
|
response(details?: Details): Response;
|
|
45
45
|
}
|
|
46
|
-
declare class Status {
|
|
46
|
+
export declare class Status {
|
|
47
47
|
static adapter?: (status: number, response: ErrorBody) => Error;
|
|
48
48
|
static ok: (message?: string) => StatusCode;
|
|
49
49
|
static cancelled: (message?: string) => StatusCode;
|
|
@@ -65,5 +65,4 @@ declare class Status {
|
|
|
65
65
|
static methodNotAllowed: (message?: string) => StatusCode;
|
|
66
66
|
}
|
|
67
67
|
//#endregion
|
|
68
|
-
export { Code, DEFAULT_MESSAGES, ErrorBody, Status, StatusCode, StatusError };
|
|
69
68
|
//# sourceMappingURL=status.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.d.cts","names":[],"sources":["../../src/error/status.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"status.d.cts","names":[],"sources":["../../src/error/status.ts"],"mappings":";;qBAEa;WAIX;WAKA;WASA;WAQA;WASA;WAWA;WAMA;WAYA;WAMA;WAoBA;WASA;WAmBA;WAMA;WAOA;WAWA;WAKA;WAMA;WAKA;;qBAGW,kBAAkB,oBAAoB;iBAsBlC;EACf;IACE;IACA,qBAAqB;IACrB;IACA,SAAS;;;qBAIA,oBAAoB;WACtB;WACA,OAAO;EAEhB,YAAY,gBAAgB,OAAO;;qBASxB;EACX,mBAAmB;EACnB;UACO;SAKA,GAAG,mBAAmB,MAAM,mBAAgB;EAInD,KAAK,UAAU,UAAU;EAWzB,MAAM,UAAU,UAAU;EAM1B,SAAS,UAAU,UAAU;;qBAMlB;SACJ,WAAW,gBAAgB,UAAU,cAAc;SAEnD,KAAE,qBAAoB;SACtB,YAAS,qBAAoB;SAC7B,UAAO,qBAAoB;SAC3B,kBAAe,qBAAoB;SACnC,mBAAgB,qBAAoB;SACpC,WAAQ,qBAAoB;SAC5B,gBAAa,qBAAoB;SACjC,mBAAgB,qBAAoB;SACpC,eAAY,qBAAoB;SAChC,oBAAiB,qBAAoB;SACrC,qBAAkB,qBAAoB;SACtC,UAAO,qBAAoB;SAC3B,aAAU,qBAAoB;SAC9B,gBAAa,qBAAoB;SACjC,WAAQ,qBAAoB;SAC5B,cAAW,qBAAoB;SAC/B,WAAQ,qBAAoB;SAC5B,mBAAgB,qBAAoB"}
|
package/dist/error/status.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Detail, Details } from "./detail.mjs";
|
|
2
2
|
//#region src/error/status.d.ts
|
|
3
|
-
declare const Code: {
|
|
3
|
+
export declare const Code: {
|
|
4
4
|
readonly OK: 200;
|
|
5
5
|
readonly CANCELLED: 499;
|
|
6
6
|
readonly UNKNOWN: 500;
|
|
@@ -20,8 +20,8 @@ declare const Code: {
|
|
|
20
20
|
readonly UNAUTHENTICATED: 401;
|
|
21
21
|
readonly METHOD_NOT_ALLOWED: 405;
|
|
22
22
|
};
|
|
23
|
-
declare const DEFAULT_MESSAGES: Record<keyof typeof Code, string>;
|
|
24
|
-
interface ErrorBody {
|
|
23
|
+
export declare const DEFAULT_MESSAGES: Record<keyof typeof Code, string>;
|
|
24
|
+
export interface ErrorBody {
|
|
25
25
|
error: {
|
|
26
26
|
code: number;
|
|
27
27
|
status: keyof typeof Code;
|
|
@@ -29,12 +29,12 @@ interface ErrorBody {
|
|
|
29
29
|
details: Detail[];
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
|
-
declare class StatusError extends Error {
|
|
32
|
+
export declare class StatusError extends Error {
|
|
33
33
|
readonly status: number;
|
|
34
34
|
readonly body?: ErrorBody;
|
|
35
35
|
constructor(status: number, body?: ErrorBody);
|
|
36
36
|
}
|
|
37
|
-
declare class StatusCode {
|
|
37
|
+
export declare class StatusCode {
|
|
38
38
|
code: keyof typeof Code;
|
|
39
39
|
message?: string;
|
|
40
40
|
private constructor();
|
|
@@ -43,7 +43,7 @@ declare class StatusCode {
|
|
|
43
43
|
error(details?: Details): Error;
|
|
44
44
|
response(details?: Details): Response;
|
|
45
45
|
}
|
|
46
|
-
declare class Status {
|
|
46
|
+
export declare class Status {
|
|
47
47
|
static adapter?: (status: number, response: ErrorBody) => Error;
|
|
48
48
|
static ok: (message?: string) => StatusCode;
|
|
49
49
|
static cancelled: (message?: string) => StatusCode;
|
|
@@ -65,5 +65,4 @@ declare class Status {
|
|
|
65
65
|
static methodNotAllowed: (message?: string) => StatusCode;
|
|
66
66
|
}
|
|
67
67
|
//#endregion
|
|
68
|
-
export { Code, DEFAULT_MESSAGES, ErrorBody, Status, StatusCode, StatusError };
|
|
69
68
|
//# sourceMappingURL=status.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.d.mts","names":[],"sources":["../../src/error/status.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"status.d.mts","names":[],"sources":["../../src/error/status.ts"],"mappings":";;qBAEa;WAIX;WAKA;WASA;WAQA;WASA;WAWA;WAMA;WAYA;WAMA;WAoBA;WASA;WAmBA;WAMA;WAOA;WAWA;WAKA;WAMA;WAKA;;qBAGW,kBAAkB,oBAAoB;iBAsBlC;EACf;IACE;IACA,qBAAqB;IACrB;IACA,SAAS;;;qBAIA,oBAAoB;WACtB;WACA,OAAO;EAEhB,YAAY,gBAAgB,OAAO;;qBASxB;EACX,mBAAmB;EACnB;UACO;SAKA,GAAG,mBAAmB,MAAM,mBAAgB;EAInD,KAAK,UAAU,UAAU;EAWzB,MAAM,UAAU,UAAU;EAM1B,SAAS,UAAU,UAAU;;qBAMlB;SACJ,WAAW,gBAAgB,UAAU,cAAc;SAEnD,KAAE,qBAAoB;SACtB,YAAS,qBAAoB;SAC7B,UAAO,qBAAoB;SAC3B,kBAAe,qBAAoB;SACnC,mBAAgB,qBAAoB;SACpC,WAAQ,qBAAoB;SAC5B,gBAAa,qBAAoB;SACjC,mBAAgB,qBAAoB;SACpC,eAAY,qBAAoB;SAChC,oBAAiB,qBAAoB;SACrC,qBAAkB,qBAAoB;SACtC,UAAO,qBAAoB;SAC3B,aAAU,qBAAoB;SAC9B,gBAAa,qBAAoB;SACjC,WAAQ,qBAAoB;SAC5B,cAAW,qBAAoB;SAC/B,WAAQ,qBAAoB;SAC5B,mBAAgB,qBAAoB"}
|
|
@@ -8,7 +8,7 @@ declare global {
|
|
|
8
8
|
};
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
|
-
type Props = {
|
|
11
|
+
export type Props = {
|
|
12
12
|
/**
|
|
13
13
|
* Opaque nonce string forwarded as-is to Google. Google echoes it back in
|
|
14
14
|
* the ID Token's `nonce` claim per the OIDC spec; the caller is responsible
|
|
@@ -20,7 +20,7 @@ type Props = {
|
|
|
20
20
|
cancel_on_tap_outside?: boolean;
|
|
21
21
|
use_fedcm_for_prompt?: boolean;
|
|
22
22
|
};
|
|
23
|
-
type PromptMoment = {
|
|
23
|
+
export type PromptMoment = {
|
|
24
24
|
skipped: boolean;
|
|
25
25
|
dismissed: boolean;
|
|
26
26
|
dismissedReason: ReturnType<PromptMomentNotification['getDismissedReason']>;
|
|
@@ -32,8 +32,8 @@ type PromptMoment = {
|
|
|
32
32
|
* - `script_load_failed`: the GSI script failed to load (network/CSP).
|
|
33
33
|
* - `prompt_error`: GIS threw synchronously while initializing/prompting.
|
|
34
34
|
*/
|
|
35
|
-
type UnsupportedReason = 'fedcm_unsupported' | 'script_load_failed' | 'prompt_error';
|
|
36
|
-
type PromptResult = {
|
|
35
|
+
export type UnsupportedReason = 'fedcm_unsupported' | 'script_load_failed' | 'prompt_error';
|
|
36
|
+
export type PromptResult = {
|
|
37
37
|
authorized: true;
|
|
38
38
|
credential: CredentialResponse;
|
|
39
39
|
} | {
|
|
@@ -45,8 +45,8 @@ type PromptResult = {
|
|
|
45
45
|
reason: UnsupportedReason;
|
|
46
46
|
};
|
|
47
47
|
/** debug: chrome://settings/content/federatedIdentityApi */
|
|
48
|
-
declare function prompt({ nonce, client_id, auto_select, use_fedcm_for_prompt, cancel_on_tap_outside }: Props): Promise<PromptResult>;
|
|
49
|
-
type CodeProps = {
|
|
48
|
+
export declare function prompt({ nonce, client_id, auto_select, use_fedcm_for_prompt, cancel_on_tap_outside }: Props): Promise<PromptResult>;
|
|
49
|
+
export type CodeProps = {
|
|
50
50
|
client_id: string;
|
|
51
51
|
/**
|
|
52
52
|
* Space-delimited OAuth scopes. Defaults to OpenID Connect scopes so the
|
|
@@ -61,7 +61,7 @@ type CodeProps = {
|
|
|
61
61
|
login_hint?: string;
|
|
62
62
|
hd?: string;
|
|
63
63
|
};
|
|
64
|
-
type CodeResult = {
|
|
64
|
+
export type CodeResult = {
|
|
65
65
|
ok: true;
|
|
66
66
|
response: CodeResponse;
|
|
67
67
|
} | {
|
|
@@ -77,7 +77,6 @@ type CodeResult = {
|
|
|
77
77
|
* exchange, not an ID token, and it must be triggered by a user gesture or the
|
|
78
78
|
* popup may be blocked.
|
|
79
79
|
*/
|
|
80
|
-
declare function requestCode({ client_id, scope, ux_mode, redirect_uri, state, login_hint, hd }: CodeProps): Promise<CodeResult>;
|
|
80
|
+
export declare function requestCode({ client_id, scope, ux_mode, redirect_uri, state, login_hint, hd }: CodeProps): Promise<CodeResult>;
|
|
81
81
|
//#endregion
|
|
82
|
-
export { CodeProps, CodeResult, PromptMoment, PromptResult, Props, UnsupportedReason, prompt, requestCode };
|
|
83
82
|
//# sourceMappingURL=index.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../../src/google-one-tap/index.ts"],"mappings":";;QAQQ;YACI;;IAER;MACE,UAAU;;;;
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../../src/google-one-tap/index.ts"],"mappings":";;QAQQ;YACI;;IAER;MACE,UAAU;;;;YAKJ;;;;;;EAMV;EACA;EACA;EACA;EACA;;YAGU;EACV;EACA;EACA,iBAAiB,WAAW;;;;;;;;;YAUlB;YAEA;EACN;EAAkB,YAAY;;EAC9B;EAAmB,QAAQ;;EAC3B;EAAmB;EAAmB,QAAQ;;;wBAwC9B,SACpB,OACA,WACA,aACA,sBACA,yBACC,QAAQ,QAAQ;YA+DP;EACV;;;;;EAKA;;EAEA;;EAEA;EACA;EACA;EACA;;YAGU;EACN;EAAU,UAAU;;EACpB;EAAW,OAAO,oBAAoB;;;;;;;;;;;wBAWtB,cACpB,WACA,OACA,SACA,cACA,OACA,YACA,MACC,YAAY,QAAQ"}
|