@shware/http 0.4.2 → 1.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.
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
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/google-one-tap/index.tsx
21
+ var google_one_tap_exports = {};
22
+ __export(google_one_tap_exports, {
23
+ GoogleOneTap: () => GoogleOneTap,
24
+ prompt: () => prompt
25
+ });
26
+ module.exports = __toCommonJS(google_one_tap_exports);
27
+ var import_jsx_runtime = require("react/jsx-runtime");
28
+ function prompt(callback) {
29
+ window.google.accounts.id.prompt(callback);
30
+ }
31
+ function GoogleOneTap({ client_id, login_uri, callback }) {
32
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
33
+ "script",
34
+ {
35
+ async: true,
36
+ defer: true,
37
+ id: "google-one-tap",
38
+ src: "https://accounts.google.com/gsi/client",
39
+ onLoad: () => window.google.accounts.id.initialize({
40
+ client_id,
41
+ auto_select: false,
42
+ cancel_on_tap_outside: false,
43
+ context: "signin",
44
+ ux_mode: "popup",
45
+ login_uri,
46
+ callback
47
+ })
48
+ }
49
+ );
50
+ }
51
+ // Annotate the CommonJS export names for ESM import in node:
52
+ 0 && (module.exports = {
53
+ GoogleOneTap,
54
+ prompt
55
+ });
56
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/google-one-tap/index.tsx"],"sourcesContent":["import type { GoogleAccounts, CredentialResponse, PromptMomentNotification } from './types';\n\ndeclare global {\n interface Window {\n google: {\n accounts: GoogleAccounts;\n };\n }\n}\n\nexport function prompt(callback?: (res: PromptMomentNotification) => void) {\n window.google.accounts.id.prompt(callback);\n}\n\nexport type Props = {\n client_id: string;\n login_uri?: string;\n callback?: (response: CredentialResponse) => void;\n};\n\nexport function GoogleOneTap({ client_id, login_uri, callback }: Props) {\n return (\n <script\n async\n defer\n id=\"google-one-tap\"\n src=\"https://accounts.google.com/gsi/client\"\n onLoad={() =>\n window.google.accounts.id.initialize({\n client_id,\n auto_select: false,\n cancel_on_tap_outside: false,\n context: 'signin',\n ux_mode: 'popup',\n login_uri,\n callback,\n })\n }\n />\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAsBI;AAZG,SAAS,OAAO,UAAoD;AACzE,SAAO,OAAO,SAAS,GAAG,OAAO,QAAQ;AAC3C;AAQO,SAAS,aAAa,EAAE,WAAW,WAAW,SAAS,GAAU;AACtE,SACE;AAAA,IAAC;AAAA;AAAA,MACC,OAAK;AAAA,MACL,OAAK;AAAA,MACL,IAAG;AAAA,MACH,KAAI;AAAA,MACJ,QAAQ,MACN,OAAO,OAAO,SAAS,GAAG,WAAW;AAAA,QACnC;AAAA,QACA,aAAa;AAAA,QACb,uBAAuB;AAAA,QACvB,SAAS;AAAA,QACT,SAAS;AAAA,QACT;AAAA,QACA;AAAA,MACF,CAAC;AAAA;AAAA,EAEL;AAEJ;","names":[]}
@@ -0,0 +1,19 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { GoogleAccounts, PromptMomentNotification, CredentialResponse } from './types.cjs';
3
+
4
+ declare global {
5
+ interface Window {
6
+ google: {
7
+ accounts: GoogleAccounts;
8
+ };
9
+ }
10
+ }
11
+ declare function prompt(callback?: (res: PromptMomentNotification) => void): void;
12
+ type Props = {
13
+ client_id: string;
14
+ login_uri?: string;
15
+ callback?: (response: CredentialResponse) => void;
16
+ };
17
+ declare function GoogleOneTap({ client_id, login_uri, callback }: Props): react_jsx_runtime.JSX.Element;
18
+
19
+ export { GoogleOneTap, type Props, prompt };
@@ -0,0 +1,19 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { GoogleAccounts, PromptMomentNotification, CredentialResponse } from './types.js';
3
+
4
+ declare global {
5
+ interface Window {
6
+ google: {
7
+ accounts: GoogleAccounts;
8
+ };
9
+ }
10
+ }
11
+ declare function prompt(callback?: (res: PromptMomentNotification) => void): void;
12
+ type Props = {
13
+ client_id: string;
14
+ login_uri?: string;
15
+ callback?: (response: CredentialResponse) => void;
16
+ };
17
+ declare function GoogleOneTap({ client_id, login_uri, callback }: Props): react_jsx_runtime.JSX.Element;
18
+
19
+ export { GoogleOneTap, type Props, prompt };
@@ -0,0 +1,30 @@
1
+ // src/google-one-tap/index.tsx
2
+ import { jsx } from "react/jsx-runtime";
3
+ function prompt(callback) {
4
+ window.google.accounts.id.prompt(callback);
5
+ }
6
+ function GoogleOneTap({ client_id, login_uri, callback }) {
7
+ return /* @__PURE__ */ jsx(
8
+ "script",
9
+ {
10
+ async: true,
11
+ defer: true,
12
+ id: "google-one-tap",
13
+ src: "https://accounts.google.com/gsi/client",
14
+ onLoad: () => window.google.accounts.id.initialize({
15
+ client_id,
16
+ auto_select: false,
17
+ cancel_on_tap_outside: false,
18
+ context: "signin",
19
+ ux_mode: "popup",
20
+ login_uri,
21
+ callback
22
+ })
23
+ }
24
+ );
25
+ }
26
+ export {
27
+ GoogleOneTap,
28
+ prompt
29
+ };
30
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/google-one-tap/index.tsx"],"sourcesContent":["import type { GoogleAccounts, CredentialResponse, PromptMomentNotification } from './types';\n\ndeclare global {\n interface Window {\n google: {\n accounts: GoogleAccounts;\n };\n }\n}\n\nexport function prompt(callback?: (res: PromptMomentNotification) => void) {\n window.google.accounts.id.prompt(callback);\n}\n\nexport type Props = {\n client_id: string;\n login_uri?: string;\n callback?: (response: CredentialResponse) => void;\n};\n\nexport function GoogleOneTap({ client_id, login_uri, callback }: Props) {\n return (\n <script\n async\n defer\n id=\"google-one-tap\"\n src=\"https://accounts.google.com/gsi/client\"\n onLoad={() =>\n window.google.accounts.id.initialize({\n client_id,\n auto_select: false,\n cancel_on_tap_outside: false,\n context: 'signin',\n ux_mode: 'popup',\n login_uri,\n callback,\n })\n }\n />\n );\n}\n"],"mappings":";AAsBI;AAZG,SAAS,OAAO,UAAoD;AACzE,SAAO,OAAO,SAAS,GAAG,OAAO,QAAQ;AAC3C;AAQO,SAAS,aAAa,EAAE,WAAW,WAAW,SAAS,GAAU;AACtE,SACE;AAAA,IAAC;AAAA;AAAA,MACC,OAAK;AAAA,MACL,OAAK;AAAA,MACL,IAAG;AAAA,MACH,KAAI;AAAA,MACJ,QAAQ,MACN,OAAO,OAAO,SAAS,GAAG,WAAW;AAAA,QACnC;AAAA,QACA,aAAa;AAAA,QACb,uBAAuB;AAAA,QACvB,SAAS;AAAA,QACT,SAAS;AAAA,QACT;AAAA,QACA;AAAA,MACF,CAAC;AAAA;AAAA,EAEL;AAEJ;","names":[]}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+
16
+ // src/google-one-tap/types.ts
17
+ var types_exports = {};
18
+ module.exports = __toCommonJS(types_exports);
19
+ //# sourceMappingURL=types.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/google-one-tap/types.ts"],"sourcesContent":["interface ClientConfigError extends Error {\n message: string;\n stack?: string;\n type: 'unknown' | 'popup_closed' | 'popup_failed_to_open';\n}\n\ninterface OverridableTokenClientConfig {\n scope?: string;\n include_granted_scopes?: boolean;\n prompt?: string;\n enable_granular_consent?: boolean;\n enable_serial_consent?: boolean;\n login_hint?: string;\n hint?: string;\n state?: string;\n}\n\ninterface TokenClient {\n requestAccessToken: (overrideConfig?: OverridableTokenClientConfig) => void;\n}\n\ninterface CodeClient {\n requestCode: () => void;\n}\n\ninterface TokenResponse {\n access_token: string;\n expires_in: string;\n hd: string;\n prompt: string;\n token_type: string;\n scope: string;\n state: string;\n error: string;\n error_description: string;\n error_uri: string;\n}\n\ninterface CodeResponse {\n code: string;\n scope: string;\n state: string;\n error: string;\n error_description: string;\n error_uri: string;\n}\n\ninterface TokenClientConfig {\n client_id: string;\n scope: string;\n include_granted_scopes?: boolean;\n prompt?: '' | 'none' | 'consent' | 'select_account';\n enable_granular_consent?: boolean;\n enable_serial_consent?: boolean;\n login_hint?: string;\n hint?: string;\n hd?: string;\n hosted_domain?: string;\n state?: string;\n callback: (tokenResponse: TokenResponse) => void;\n error_callback?: (error: ClientConfigError) => void;\n}\n\ninterface CodeClientConfig {\n client_id: string;\n scope: string;\n include_granted_scopes?: boolean;\n redirect_uri?: string;\n state?: string;\n enable_granular_consent?: boolean;\n enable_serial_consent?: boolean;\n login_hint?: string;\n hint?: string;\n hd?: string;\n hosted_domain?: string;\n ux_mode?: 'popup' | 'redirect';\n select_account?: boolean;\n callback?: (response: CodeResponse) => void;\n error_callback?: (error: ClientConfigError) => void;\n}\n\ninterface RevocationResponse {\n successful: boolean;\n error?: string;\n}\n\ninterface Credential {\n id: string;\n password: string;\n}\n\nexport interface CredentialResponse {\n credential: string;\n select_by: string;\n}\n\nexport interface IdConfiguration {\n client_id: string;\n auto_select?: boolean;\n login_uri?: string;\n cancel_on_tap_outside?: boolean;\n prompt_parent_id?: string;\n nonce?: string;\n context?: 'signin' | 'signup' | 'use';\n state_cookie_domain?: string;\n ux_mode?: 'popup' | 'redirect';\n allowed_parent_origin?: string | string[];\n itp_support?: boolean;\n login_hint?: string;\n hd?: string;\n use_fedcm_for_prompt?: boolean;\n callback?: (response: CredentialResponse) => void;\n native_callback?: (response: CredentialResponse) => void;\n intermediate_iframe_close_callback?: () => void;\n}\n\nexport interface PromptMomentNotification {\n isDisplayMoment(): boolean;\n isDisplayed(): boolean;\n isNotDisplayed(): boolean;\n getNotDisplayedReason():\n | 'browser_not_supported'\n | 'invalid_client'\n | 'missing_client_id'\n | 'opt_out_or_no_session'\n | 'secure_http_required'\n | 'suppressed_by_user'\n | 'unregistered_origin'\n | 'unknown_reason';\n\n isSkippedMoment(): boolean;\n getSkippedReason(): 'auto_cancel' | 'user_cancel' | 'tap_outside' | 'issuing_failed';\n isDismissedMoment(): boolean;\n getDismissedReason(): 'credential_returned' | 'cancel_called' | 'flow_restarted';\n getMomentType(): 'display' | 'skipped' | 'dismissed';\n}\n\ninterface GsiButtonConfiguration {\n type: 'standard' | 'icon';\n theme?: 'outline' | 'filled_blue' | 'filled_black';\n size?: 'small' | 'medium' | 'large';\n text?: 'signin_with' | 'signup_with' | 'continue_with' | 'signin';\n shape?: 'rectangular' | 'pill' | 'circle' | 'square';\n logo_alignment?: 'left' | 'center';\n width?: number;\n locale?: string;\n state?: string;\n click_listener?: () => void;\n}\n\nexport interface GoogleAccounts {\n oauth2: {\n initCodeClient(config: CodeClientConfig): CodeClient;\n initTokenClient(config: TokenClientConfig): TokenClient;\n hasGrantedAllScopes(\n tokenResponse: TokenResponse,\n firstScope: string,\n ...restScopes: string[]\n ): boolean;\n hasGrantedAnyScope(\n tokenResponse: TokenResponse,\n firstScope: string,\n ...restScopes: string[]\n ): boolean;\n revoke(accessToken: string, done: () => void): void;\n };\n id: {\n initialize(idConfig: IdConfiguration): void;\n prompt(momentListener?: (promptMomentNotification: PromptMomentNotification) => void): void;\n renderButton(parent: HTMLElement, options: GsiButtonConfiguration): void;\n disableAutoSelect(): void;\n storeCredential(credential: Credential, callback?: () => void): void;\n cancel(): void;\n revoke(hint: string, callback?: (response: RevocationResponse) => void): void;\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -0,0 +1,147 @@
1
+ interface ClientConfigError extends Error {
2
+ message: string;
3
+ stack?: string;
4
+ type: 'unknown' | 'popup_closed' | 'popup_failed_to_open';
5
+ }
6
+ interface OverridableTokenClientConfig {
7
+ scope?: string;
8
+ include_granted_scopes?: boolean;
9
+ prompt?: string;
10
+ enable_granular_consent?: boolean;
11
+ enable_serial_consent?: boolean;
12
+ login_hint?: string;
13
+ hint?: string;
14
+ state?: string;
15
+ }
16
+ interface TokenClient {
17
+ requestAccessToken: (overrideConfig?: OverridableTokenClientConfig) => void;
18
+ }
19
+ interface CodeClient {
20
+ requestCode: () => void;
21
+ }
22
+ interface TokenResponse {
23
+ access_token: string;
24
+ expires_in: string;
25
+ hd: string;
26
+ prompt: string;
27
+ token_type: string;
28
+ scope: string;
29
+ state: string;
30
+ error: string;
31
+ error_description: string;
32
+ error_uri: string;
33
+ }
34
+ interface CodeResponse {
35
+ code: string;
36
+ scope: string;
37
+ state: string;
38
+ error: string;
39
+ error_description: string;
40
+ error_uri: string;
41
+ }
42
+ interface TokenClientConfig {
43
+ client_id: string;
44
+ scope: string;
45
+ include_granted_scopes?: boolean;
46
+ prompt?: '' | 'none' | 'consent' | 'select_account';
47
+ enable_granular_consent?: boolean;
48
+ enable_serial_consent?: boolean;
49
+ login_hint?: string;
50
+ hint?: string;
51
+ hd?: string;
52
+ hosted_domain?: string;
53
+ state?: string;
54
+ callback: (tokenResponse: TokenResponse) => void;
55
+ error_callback?: (error: ClientConfigError) => void;
56
+ }
57
+ interface CodeClientConfig {
58
+ client_id: string;
59
+ scope: string;
60
+ include_granted_scopes?: boolean;
61
+ redirect_uri?: string;
62
+ state?: string;
63
+ enable_granular_consent?: boolean;
64
+ enable_serial_consent?: boolean;
65
+ login_hint?: string;
66
+ hint?: string;
67
+ hd?: string;
68
+ hosted_domain?: string;
69
+ ux_mode?: 'popup' | 'redirect';
70
+ select_account?: boolean;
71
+ callback?: (response: CodeResponse) => void;
72
+ error_callback?: (error: ClientConfigError) => void;
73
+ }
74
+ interface RevocationResponse {
75
+ successful: boolean;
76
+ error?: string;
77
+ }
78
+ interface Credential {
79
+ id: string;
80
+ password: string;
81
+ }
82
+ interface CredentialResponse {
83
+ credential: string;
84
+ select_by: string;
85
+ }
86
+ interface IdConfiguration {
87
+ client_id: string;
88
+ auto_select?: boolean;
89
+ login_uri?: string;
90
+ cancel_on_tap_outside?: boolean;
91
+ prompt_parent_id?: string;
92
+ nonce?: string;
93
+ context?: 'signin' | 'signup' | 'use';
94
+ state_cookie_domain?: string;
95
+ ux_mode?: 'popup' | 'redirect';
96
+ allowed_parent_origin?: string | string[];
97
+ itp_support?: boolean;
98
+ login_hint?: string;
99
+ hd?: string;
100
+ use_fedcm_for_prompt?: boolean;
101
+ callback?: (response: CredentialResponse) => void;
102
+ native_callback?: (response: CredentialResponse) => void;
103
+ intermediate_iframe_close_callback?: () => void;
104
+ }
105
+ interface PromptMomentNotification {
106
+ isDisplayMoment(): boolean;
107
+ isDisplayed(): boolean;
108
+ isNotDisplayed(): boolean;
109
+ getNotDisplayedReason(): 'browser_not_supported' | 'invalid_client' | 'missing_client_id' | 'opt_out_or_no_session' | 'secure_http_required' | 'suppressed_by_user' | 'unregistered_origin' | 'unknown_reason';
110
+ isSkippedMoment(): boolean;
111
+ getSkippedReason(): 'auto_cancel' | 'user_cancel' | 'tap_outside' | 'issuing_failed';
112
+ isDismissedMoment(): boolean;
113
+ getDismissedReason(): 'credential_returned' | 'cancel_called' | 'flow_restarted';
114
+ getMomentType(): 'display' | 'skipped' | 'dismissed';
115
+ }
116
+ interface GsiButtonConfiguration {
117
+ type: 'standard' | 'icon';
118
+ theme?: 'outline' | 'filled_blue' | 'filled_black';
119
+ size?: 'small' | 'medium' | 'large';
120
+ text?: 'signin_with' | 'signup_with' | 'continue_with' | 'signin';
121
+ shape?: 'rectangular' | 'pill' | 'circle' | 'square';
122
+ logo_alignment?: 'left' | 'center';
123
+ width?: number;
124
+ locale?: string;
125
+ state?: string;
126
+ click_listener?: () => void;
127
+ }
128
+ interface GoogleAccounts {
129
+ oauth2: {
130
+ initCodeClient(config: CodeClientConfig): CodeClient;
131
+ initTokenClient(config: TokenClientConfig): TokenClient;
132
+ hasGrantedAllScopes(tokenResponse: TokenResponse, firstScope: string, ...restScopes: string[]): boolean;
133
+ hasGrantedAnyScope(tokenResponse: TokenResponse, firstScope: string, ...restScopes: string[]): boolean;
134
+ revoke(accessToken: string, done: () => void): void;
135
+ };
136
+ id: {
137
+ initialize(idConfig: IdConfiguration): void;
138
+ prompt(momentListener?: (promptMomentNotification: PromptMomentNotification) => void): void;
139
+ renderButton(parent: HTMLElement, options: GsiButtonConfiguration): void;
140
+ disableAutoSelect(): void;
141
+ storeCredential(credential: Credential, callback?: () => void): void;
142
+ cancel(): void;
143
+ revoke(hint: string, callback?: (response: RevocationResponse) => void): void;
144
+ };
145
+ }
146
+
147
+ export type { CredentialResponse, GoogleAccounts, IdConfiguration, PromptMomentNotification };
@@ -0,0 +1,147 @@
1
+ interface ClientConfigError extends Error {
2
+ message: string;
3
+ stack?: string;
4
+ type: 'unknown' | 'popup_closed' | 'popup_failed_to_open';
5
+ }
6
+ interface OverridableTokenClientConfig {
7
+ scope?: string;
8
+ include_granted_scopes?: boolean;
9
+ prompt?: string;
10
+ enable_granular_consent?: boolean;
11
+ enable_serial_consent?: boolean;
12
+ login_hint?: string;
13
+ hint?: string;
14
+ state?: string;
15
+ }
16
+ interface TokenClient {
17
+ requestAccessToken: (overrideConfig?: OverridableTokenClientConfig) => void;
18
+ }
19
+ interface CodeClient {
20
+ requestCode: () => void;
21
+ }
22
+ interface TokenResponse {
23
+ access_token: string;
24
+ expires_in: string;
25
+ hd: string;
26
+ prompt: string;
27
+ token_type: string;
28
+ scope: string;
29
+ state: string;
30
+ error: string;
31
+ error_description: string;
32
+ error_uri: string;
33
+ }
34
+ interface CodeResponse {
35
+ code: string;
36
+ scope: string;
37
+ state: string;
38
+ error: string;
39
+ error_description: string;
40
+ error_uri: string;
41
+ }
42
+ interface TokenClientConfig {
43
+ client_id: string;
44
+ scope: string;
45
+ include_granted_scopes?: boolean;
46
+ prompt?: '' | 'none' | 'consent' | 'select_account';
47
+ enable_granular_consent?: boolean;
48
+ enable_serial_consent?: boolean;
49
+ login_hint?: string;
50
+ hint?: string;
51
+ hd?: string;
52
+ hosted_domain?: string;
53
+ state?: string;
54
+ callback: (tokenResponse: TokenResponse) => void;
55
+ error_callback?: (error: ClientConfigError) => void;
56
+ }
57
+ interface CodeClientConfig {
58
+ client_id: string;
59
+ scope: string;
60
+ include_granted_scopes?: boolean;
61
+ redirect_uri?: string;
62
+ state?: string;
63
+ enable_granular_consent?: boolean;
64
+ enable_serial_consent?: boolean;
65
+ login_hint?: string;
66
+ hint?: string;
67
+ hd?: string;
68
+ hosted_domain?: string;
69
+ ux_mode?: 'popup' | 'redirect';
70
+ select_account?: boolean;
71
+ callback?: (response: CodeResponse) => void;
72
+ error_callback?: (error: ClientConfigError) => void;
73
+ }
74
+ interface RevocationResponse {
75
+ successful: boolean;
76
+ error?: string;
77
+ }
78
+ interface Credential {
79
+ id: string;
80
+ password: string;
81
+ }
82
+ interface CredentialResponse {
83
+ credential: string;
84
+ select_by: string;
85
+ }
86
+ interface IdConfiguration {
87
+ client_id: string;
88
+ auto_select?: boolean;
89
+ login_uri?: string;
90
+ cancel_on_tap_outside?: boolean;
91
+ prompt_parent_id?: string;
92
+ nonce?: string;
93
+ context?: 'signin' | 'signup' | 'use';
94
+ state_cookie_domain?: string;
95
+ ux_mode?: 'popup' | 'redirect';
96
+ allowed_parent_origin?: string | string[];
97
+ itp_support?: boolean;
98
+ login_hint?: string;
99
+ hd?: string;
100
+ use_fedcm_for_prompt?: boolean;
101
+ callback?: (response: CredentialResponse) => void;
102
+ native_callback?: (response: CredentialResponse) => void;
103
+ intermediate_iframe_close_callback?: () => void;
104
+ }
105
+ interface PromptMomentNotification {
106
+ isDisplayMoment(): boolean;
107
+ isDisplayed(): boolean;
108
+ isNotDisplayed(): boolean;
109
+ getNotDisplayedReason(): 'browser_not_supported' | 'invalid_client' | 'missing_client_id' | 'opt_out_or_no_session' | 'secure_http_required' | 'suppressed_by_user' | 'unregistered_origin' | 'unknown_reason';
110
+ isSkippedMoment(): boolean;
111
+ getSkippedReason(): 'auto_cancel' | 'user_cancel' | 'tap_outside' | 'issuing_failed';
112
+ isDismissedMoment(): boolean;
113
+ getDismissedReason(): 'credential_returned' | 'cancel_called' | 'flow_restarted';
114
+ getMomentType(): 'display' | 'skipped' | 'dismissed';
115
+ }
116
+ interface GsiButtonConfiguration {
117
+ type: 'standard' | 'icon';
118
+ theme?: 'outline' | 'filled_blue' | 'filled_black';
119
+ size?: 'small' | 'medium' | 'large';
120
+ text?: 'signin_with' | 'signup_with' | 'continue_with' | 'signin';
121
+ shape?: 'rectangular' | 'pill' | 'circle' | 'square';
122
+ logo_alignment?: 'left' | 'center';
123
+ width?: number;
124
+ locale?: string;
125
+ state?: string;
126
+ click_listener?: () => void;
127
+ }
128
+ interface GoogleAccounts {
129
+ oauth2: {
130
+ initCodeClient(config: CodeClientConfig): CodeClient;
131
+ initTokenClient(config: TokenClientConfig): TokenClient;
132
+ hasGrantedAllScopes(tokenResponse: TokenResponse, firstScope: string, ...restScopes: string[]): boolean;
133
+ hasGrantedAnyScope(tokenResponse: TokenResponse, firstScope: string, ...restScopes: string[]): boolean;
134
+ revoke(accessToken: string, done: () => void): void;
135
+ };
136
+ id: {
137
+ initialize(idConfig: IdConfiguration): void;
138
+ prompt(momentListener?: (promptMomentNotification: PromptMomentNotification) => void): void;
139
+ renderButton(parent: HTMLElement, options: GsiButtonConfiguration): void;
140
+ disableAutoSelect(): void;
141
+ storeCredential(credential: Credential, callback?: () => void): void;
142
+ cancel(): void;
143
+ revoke(hint: string, callback?: (response: RevocationResponse) => void): void;
144
+ };
145
+ }
146
+
147
+ export type { CredentialResponse, GoogleAccounts, IdConfiguration, PromptMomentNotification };
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=types.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shware/http",
3
- "version": "0.4.2",
3
+ "version": "1.0.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "scripts": {
@@ -27,6 +27,11 @@
27
27
  "types": "./dist/hono/index.d.ts",
28
28
  "import": "./dist/hono/index.mjs",
29
29
  "require": "./dist/hono/index.cjs"
30
+ },
31
+ "./google-one-tap": {
32
+ "types": "./dist/google-one-tap/index.d.ts",
33
+ "import": "./dist/google-one-tap/index.mjs",
34
+ "require": "./dist/google-one-tap/index.cjs"
30
35
  }
31
36
  },
32
37
  "files": [
@@ -35,6 +40,7 @@
35
40
  "devDependencies": {
36
41
  "@types/jest": "^29.5.14",
37
42
  "@types/node": "^24.0.1",
43
+ "@types/react": "^19.1.8",
38
44
  "jest": "^30.0.0",
39
45
  "ts-jest": "^29.4.0",
40
46
  "typescript": "^5.8.3"
@@ -43,8 +49,9 @@
43
49
  "zod": "^3.25.63"
44
50
  },
45
51
  "peerDependencies": {
52
+ "axios": "^1.10.0",
46
53
  "hono": "^4.7.9",
47
- "axios": "^1.10.0"
54
+ "react": "^19.0.0"
48
55
  },
49
56
  "peerDependenciesMeta": {
50
57
  "hono": {
@@ -52,6 +59,9 @@
52
59
  },
53
60
  "axios": {
54
61
  "optional": true
62
+ },
63
+ "react": {
64
+ "optional": true
55
65
  }
56
66
  }
57
67
  }