@shware/http 2.11.0 → 2.11.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.
@@ -32,10 +32,10 @@ function loadScript() {
32
32
  resolve();
33
33
  } else {
34
34
  script.addEventListener("load", () => resolve());
35
- script.addEventListener(
36
- "error",
37
- () => reject(new Error("Failed to load Google One Tap script"))
38
- );
35
+ script.addEventListener("error", () => {
36
+ script = null;
37
+ reject(new Error("Failed to load Google One Tap script"));
38
+ });
39
39
  }
40
40
  return;
41
41
  }
@@ -45,7 +45,10 @@ function loadScript() {
45
45
  script.defer = true;
46
46
  script.src = "https://accounts.google.com/gsi/client";
47
47
  script.onload = () => resolve();
48
- script.onerror = () => reject(new Error("Failed to load Google One Tap script"));
48
+ script.onerror = () => {
49
+ script = null;
50
+ reject(new Error("Failed to load Google One Tap script"));
51
+ };
49
52
  document.head.appendChild(script);
50
53
  });
51
54
  }
@@ -88,15 +91,13 @@ async function prompt({
88
91
  });
89
92
  window.google.accounts.id.prompt((notification) => {
90
93
  if (settled) return;
91
- if (notification.isSkippedMoment() || notification.isDismissedMoment() && notification.getDismissedReason() !== "credential_returned") {
94
+ const skipped = notification.isSkippedMoment();
95
+ const dismissed = notification.isDismissedMoment();
96
+ const dismissedReason = notification.getDismissedReason();
97
+ if (skipped || dismissed && dismissedReason !== "credential_returned") {
92
98
  settle({
93
99
  authorized: false,
94
- moment: {
95
- momentType: notification.getMomentType(),
96
- skipped: notification.isSkippedMoment(),
97
- dismissed: notification.isDismissedMoment(),
98
- dismissedReason: notification.getDismissedReason()
99
- }
100
+ moment: { skipped, dismissed, dismissedReason }
100
101
  });
101
102
  }
102
103
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/google-one-tap/index.ts"],"sourcesContent":["import type {\n ClientConfigError,\n CodeResponse,\n CredentialResponse,\n GoogleAccounts,\n PromptMomentNotification,\n} from './types';\n\ndeclare global {\n interface Window {\n google: {\n accounts: GoogleAccounts;\n };\n }\n}\n\nexport type Props = {\n /**\n * Opaque nonce string forwarded as-is to Google. Google echoes it back in\n * the ID Token's `nonce` claim per the OIDC spec; the caller is responsible\n * for any hashing/encoding required by its verifier.\n */\n nonce?: string;\n client_id: string;\n auto_select?: boolean;\n cancel_on_tap_outside?: boolean;\n use_fedcm_for_prompt?: boolean;\n};\n\nexport type PromptMoment = {\n skipped: boolean;\n dismissed: boolean;\n momentType: ReturnType<PromptMomentNotification['getMomentType']>;\n dismissedReason: ReturnType<PromptMomentNotification['getDismissedReason']>;\n};\n\n/**\n * Why prompt() could not run One Tap, so the caller can decide to fall back\n * to requestCode().\n * - `fedcm_unsupported`: browser has no FedCM (Safari/Firefox/pre-117 Chrome).\n * - `script_load_failed`: the GSI script failed to load (network/CSP).\n * - `prompt_error`: GIS threw synchronously while initializing/prompting.\n */\nexport type UnsupportedReason = 'fedcm_unsupported' | 'script_load_failed' | 'prompt_error';\n\nexport type PromptResult =\n | { authorized: true; credential: CredentialResponse }\n | { authorized: false; moment: PromptMoment }\n | { authorized: false; unsupported: true; reason: UnsupportedReason };\n\nlet script: HTMLScriptElement | null = null;\n\nfunction loadScript(): Promise<void> {\n return new Promise((resolve, reject) => {\n if (script) {\n if (window.google?.accounts?.id) {\n resolve();\n } else {\n script.addEventListener('load', () => resolve());\n script.addEventListener('error', () =>\n reject(new Error('Failed to load Google One Tap script'))\n );\n }\n return;\n }\n\n script = document.createElement('script');\n script.id = 'google-one-tap';\n script.async = true;\n script.defer = true;\n script.src = 'https://accounts.google.com/gsi/client';\n script.onload = () => resolve();\n script.onerror = () => reject(new Error('Failed to load Google One Tap script'));\n\n document.head.appendChild(script);\n });\n}\n\n/** FedCM feature detection — `IdentityCredential` is absent on Safari, Firefox and pre-117 Chrome. */\nfunction isFedcmSupported(): boolean {\n return typeof window !== 'undefined' && 'IdentityCredential' in window;\n}\n\n/** debug: chrome://settings/content/federatedIdentityApi */\nexport async function prompt({\n nonce,\n client_id,\n auto_select = false,\n use_fedcm_for_prompt = true,\n cancel_on_tap_outside = false,\n}: Props): Promise<PromptResult> {\n // FedCM is mandatory for One Tap on capable browsers (GIS completed the\n // migration in early 2025) and there is no viable legacy fallback anymore.\n // When the caller wants FedCM but the browser lacks it, bail early instead\n // of letting GIS throw an async `NotSupportedError: Missing request type`\n // from navigator.credentials.get. Callers should fall back to requestCode().\n if (use_fedcm_for_prompt !== false && !isFedcmSupported()) {\n return { authorized: false, unsupported: true, reason: 'fedcm_unsupported' };\n }\n\n try {\n await loadScript();\n } catch {\n return { authorized: false, unsupported: true, reason: 'script_load_failed' };\n }\n\n return new Promise<PromptResult>((resolve) => {\n let settled = false;\n const settle = (result: PromptResult) => {\n if (settled) return;\n settled = true;\n resolve(result);\n };\n\n try {\n window.google.accounts.id.initialize({\n ux_mode: 'popup',\n context: 'signin',\n auto_select,\n nonce,\n client_id,\n use_fedcm_for_prompt,\n cancel_on_tap_outside,\n callback: (credential) => settle({ authorized: true, credential }),\n native_callback: (credential) => settle({ authorized: true, credential }),\n });\n\n window.google.accounts.id.prompt((notification) => {\n if (settled) return;\n\n if (\n notification.isSkippedMoment() ||\n (notification.isDismissedMoment() &&\n notification.getDismissedReason() !== 'credential_returned')\n ) {\n settle({\n authorized: false,\n moment: {\n momentType: notification.getMomentType(),\n skipped: notification.isSkippedMoment(),\n dismissed: notification.isDismissedMoment(),\n dismissedReason: notification.getDismissedReason(),\n },\n });\n }\n });\n } catch {\n settle({ authorized: false, unsupported: true, reason: 'prompt_error' });\n }\n });\n}\n\nexport type CodeProps = {\n client_id: string;\n /**\n * Space-delimited OAuth scopes. Defaults to OpenID Connect scopes so the\n * backend can exchange the code for an ID token, mirroring One Tap's intent.\n */\n scope?: string;\n /** 'popup' resolves the returned promise; 'redirect' navigates away and never resolves. */\n ux_mode?: 'popup' | 'redirect';\n /** Required when ux_mode is 'redirect'; for 'popup' Google uses postMessage. */\n redirect_uri?: string;\n state?: string;\n login_hint?: string;\n hd?: string;\n};\n\nexport type CodeResult =\n | { ok: true; response: CodeResponse }\n | { ok: false; error: ClientConfigError | CodeResponse };\n\n/**\n * OAuth 2.0 authorization-code fallback for environments where One Tap / FedCM\n * is unavailable (i.e. prompt() resolved with `unsupported: true`). It reuses\n * the same GSI script, so there is no extra dependency.\n *\n * Unlike One Tap it returns an authorization `code` for the backend to\n * exchange, not an ID token, and it must be triggered by a user gesture or the\n * popup may be blocked.\n */\nexport async function requestCode({\n client_id,\n scope = 'openid email profile',\n ux_mode = 'popup',\n redirect_uri,\n state,\n login_hint,\n hd,\n}: CodeProps): Promise<CodeResult> {\n await loadScript();\n\n return new Promise<CodeResult>((resolve) => {\n let settled = false;\n const settle = (result: CodeResult) => {\n if (settled) return;\n settled = true;\n resolve(result);\n };\n\n const client = window.google.accounts.oauth2.initCodeClient({\n client_id,\n scope,\n ux_mode,\n redirect_uri,\n state,\n login_hint,\n hd,\n callback: (response) =>\n settle(response.code ? { ok: true, response } : { ok: false, error: response }),\n error_callback: (error) => settle({ ok: false, error }),\n });\n\n client.requestCode();\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAkDA,IAAI,SAAmC;AAEvC,SAAS,aAA4B;AACnC,SAAO,IAAI,QAAQ,CAAC,SAAS,WAAW;AACtC,QAAI,QAAQ;AACV,UAAI,OAAO,QAAQ,UAAU,IAAI;AAC/B,gBAAQ;AAAA,MACV,OAAO;AACL,eAAO,iBAAiB,QAAQ,MAAM,QAAQ,CAAC;AAC/C,eAAO;AAAA,UAAiB;AAAA,UAAS,MAC/B,OAAO,IAAI,MAAM,sCAAsC,CAAC;AAAA,QAC1D;AAAA,MACF;AACA;AAAA,IACF;AAEA,aAAS,SAAS,cAAc,QAAQ;AACxC,WAAO,KAAK;AACZ,WAAO,QAAQ;AACf,WAAO,QAAQ;AACf,WAAO,MAAM;AACb,WAAO,SAAS,MAAM,QAAQ;AAC9B,WAAO,UAAU,MAAM,OAAO,IAAI,MAAM,sCAAsC,CAAC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B;AAAA,YACnD;AAAA,UACF,CAAC;AAAA,QACH;AAAA,MACF,CAAC;AAAA,IACH,QAAQ;AACN,aAAO,EAAE,YAAY,OAAO,aAAa,MAAM,QAAQ,eAAe,CAAC;AAAA,IACzE;AAAA,EACF,CAAC;AACH;AA+BA,eAAsB,YAAY;AAAA,EAChC;AAAA,EACA,QAAQ;AAAA,EACR,UAAU;AAAA,EACV;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAmC;AACjC,QAAM,WAAW;AAEjB,SAAO,IAAI,QAAoB,CAAC,YAAY;AAC1C,QAAI,UAAU;AACd,UAAM,SAAS,CAAC,WAAuB;AACrC,UAAI,QAAS;AACb,gBAAU;AACV,cAAQ,MAAM;AAAA,IAChB;AAEA,UAAM,SAAS,OAAO,OAAO,SAAS,OAAO,eAAe;AAAA,MAC1D;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,UAAU,CAAC,aACT,OAAO,SAAS,OAAO,EAAE,IAAI,MAAM,SAAS,IAAI,EAAE,IAAI,OAAO,OAAO,SAAS,CAAC;AAAA,MAChF,gBAAgB,CAAC,UAAU,OAAO,EAAE,IAAI,OAAO,MAAM,CAAC;AAAA,IACxD,CAAC;AAED,WAAO,YAAY;AAAA,EACrB,CAAC;AACH;","names":[]}
1
+ {"version":3,"sources":["../../src/google-one-tap/index.ts"],"sourcesContent":["import type {\n ClientConfigError,\n CodeResponse,\n CredentialResponse,\n GoogleAccounts,\n PromptMomentNotification,\n} from './types';\n\ndeclare global {\n interface Window {\n google: {\n accounts: GoogleAccounts;\n };\n }\n}\n\nexport type Props = {\n /**\n * Opaque nonce string forwarded as-is to Google. Google echoes it back in\n * the ID Token's `nonce` claim per the OIDC spec; the caller is responsible\n * for any hashing/encoding required by its verifier.\n */\n nonce?: string;\n client_id: string;\n auto_select?: boolean;\n cancel_on_tap_outside?: boolean;\n use_fedcm_for_prompt?: boolean;\n};\n\nexport type PromptMoment = {\n skipped: boolean;\n dismissed: boolean;\n dismissedReason: ReturnType<PromptMomentNotification['getDismissedReason']>;\n};\n\n/**\n * Why prompt() could not run One Tap, so the caller can decide to fall back\n * to requestCode().\n * - `fedcm_unsupported`: browser has no FedCM (Safari/Firefox/pre-117 Chrome).\n * - `script_load_failed`: the GSI script failed to load (network/CSP).\n * - `prompt_error`: GIS threw synchronously while initializing/prompting.\n */\nexport type UnsupportedReason = 'fedcm_unsupported' | 'script_load_failed' | 'prompt_error';\n\nexport type PromptResult =\n | { authorized: true; credential: CredentialResponse }\n | { authorized: false; moment: PromptMoment }\n | { authorized: false; unsupported: true; reason: UnsupportedReason };\n\nlet script: HTMLScriptElement | null = null;\n\nfunction loadScript(): Promise<void> {\n return new Promise((resolve, reject) => {\n if (script) {\n if (window.google?.accounts?.id) {\n resolve();\n } else {\n script.addEventListener('load', () => resolve());\n script.addEventListener('error', () => {\n script = null; // allow a later call to recreate the element instead of hanging\n reject(new Error('Failed to load Google One Tap script'));\n });\n }\n return;\n }\n\n script = document.createElement('script');\n script.id = 'google-one-tap';\n script.async = true;\n script.defer = true;\n script.src = 'https://accounts.google.com/gsi/client';\n script.onload = () => resolve();\n script.onerror = () => {\n script = null; // allow a later call to recreate the element instead of hanging\n reject(new Error('Failed to load Google One Tap script'));\n };\n\n document.head.appendChild(script);\n });\n}\n\n/** FedCM feature detection — `IdentityCredential` is absent on Safari, Firefox and pre-117 Chrome. */\nfunction isFedcmSupported(): boolean {\n return typeof window !== 'undefined' && 'IdentityCredential' in window;\n}\n\n/** debug: chrome://settings/content/federatedIdentityApi */\nexport async function prompt({\n nonce,\n client_id,\n auto_select = false,\n use_fedcm_for_prompt = true,\n cancel_on_tap_outside = false,\n}: Props): Promise<PromptResult> {\n // FedCM is mandatory for One Tap on capable browsers (GIS completed the\n // migration in early 2025) and there is no viable legacy fallback anymore.\n // When the caller wants FedCM but the browser lacks it, bail early instead\n // of letting GIS throw an async `NotSupportedError: Missing request type`\n // from navigator.credentials.get. Callers should fall back to requestCode().\n if (use_fedcm_for_prompt !== false && !isFedcmSupported()) {\n return { authorized: false, unsupported: true, reason: 'fedcm_unsupported' };\n }\n\n try {\n await loadScript();\n } catch {\n return { authorized: false, unsupported: true, reason: 'script_load_failed' };\n }\n\n return new Promise<PromptResult>((resolve) => {\n let settled = false;\n const settle = (result: PromptResult) => {\n if (settled) return;\n settled = true;\n resolve(result);\n };\n\n try {\n window.google.accounts.id.initialize({\n ux_mode: 'popup',\n context: 'signin',\n auto_select,\n nonce,\n client_id,\n use_fedcm_for_prompt,\n cancel_on_tap_outside,\n callback: (credential) => settle({ authorized: true, credential }),\n native_callback: (credential) => settle({ authorized: true, credential }),\n });\n\n window.google.accounts.id.prompt((notification) => {\n if (settled) return;\n\n const skipped = notification.isSkippedMoment();\n const dismissed = notification.isDismissedMoment();\n const dismissedReason = notification.getDismissedReason();\n\n if (skipped || (dismissed && dismissedReason !== 'credential_returned')) {\n settle({\n authorized: false,\n moment: { skipped, dismissed, dismissedReason },\n });\n }\n });\n } catch {\n settle({ authorized: false, unsupported: true, reason: 'prompt_error' });\n }\n });\n}\n\nexport type CodeProps = {\n client_id: string;\n /**\n * Space-delimited OAuth scopes. Defaults to OpenID Connect scopes so the\n * backend can exchange the code for an ID token, mirroring One Tap's intent.\n */\n scope?: string;\n /** 'popup' resolves the returned promise; 'redirect' navigates away and never resolves. */\n ux_mode?: 'popup' | 'redirect';\n /** Required when ux_mode is 'redirect'; for 'popup' Google uses postMessage. */\n redirect_uri?: string;\n state?: string;\n login_hint?: string;\n hd?: string;\n};\n\nexport type CodeResult =\n | { ok: true; response: CodeResponse }\n | { ok: false; error: ClientConfigError | CodeResponse };\n\n/**\n * OAuth 2.0 authorization-code fallback for environments where One Tap / FedCM\n * is unavailable (i.e. prompt() resolved with `unsupported: true`). It reuses\n * the same GSI script, so there is no extra dependency.\n *\n * Unlike One Tap it returns an authorization `code` for the backend to\n * exchange, not an ID token, and it must be triggered by a user gesture or the\n * popup may be blocked.\n */\nexport async function requestCode({\n client_id,\n scope = 'openid email profile',\n ux_mode = 'popup',\n redirect_uri,\n state,\n login_hint,\n hd,\n}: CodeProps): Promise<CodeResult> {\n await loadScript();\n\n return new Promise<CodeResult>((resolve) => {\n let settled = false;\n const settle = (result: CodeResult) => {\n if (settled) return;\n settled = true;\n resolve(result);\n };\n\n const client = window.google.accounts.oauth2.initCodeClient({\n client_id,\n scope,\n ux_mode,\n redirect_uri,\n state,\n login_hint,\n hd,\n callback: (response) =>\n settle(response.code ? { ok: true, response } : { ok: false, error: response }),\n error_callback: (error) => settle({ ok: false, error }),\n });\n\n client.requestCode();\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAiDA,IAAI,SAAmC;AAEvC,SAAS,aAA4B;AACnC,SAAO,IAAI,QAAQ,CAAC,SAAS,WAAW;AACtC,QAAI,QAAQ;AACV,UAAI,OAAO,QAAQ,UAAU,IAAI;AAC/B,gBAAQ;AAAA,MACV,OAAO;AACL,eAAO,iBAAiB,QAAQ,MAAM,QAAQ,CAAC;AAC/C,eAAO,iBAAiB,SAAS,MAAM;AACrC,mBAAS;AACT,iBAAO,IAAI,MAAM,sCAAsC,CAAC;AAAA,QAC1D,CAAC;AAAA,MACH;AACA;AAAA,IACF;AAEA,aAAS,SAAS,cAAc,QAAQ;AACxC,WAAO,KAAK;AACZ,WAAO,QAAQ;AACf,WAAO,QAAQ;AACf,WAAO,MAAM;AACb,WAAO,SAAS,MAAM,QAAQ;AAC9B,WAAO,UAAU,MAAM;AACrB,eAAS;AACT,aAAO,IAAI,MAAM,sCAAsC,CAAC;AAAA,IAC1D;AAEA,aAAS,KAAK,YAAY,MAAM;AAAA,EAClC,CAAC;AACH;AAGA,SAAS,mBAA4B;AACnC,SAAO,OAAO,WAAW,eAAe,wBAAwB;AAClE;AAGA,eAAsB,OAAO;AAAA,EAC3B;AAAA,EACA;AAAA,EACA,cAAc;AAAA,EACd,uBAAuB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AA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAmC;AACjC,QAAM,WAAW;AAEjB,SAAO,IAAI,QAAoB,CAAC,YAAY;AAC1C,QAAI,UAAU;AACd,UAAM,SAAS,CAAC,WAAuB;AACrC,UAAI,QAAS;AACb,gBAAU;AACV,cAAQ,MAAM;AAAA,IAChB;AAEA,UAAM,SAAS,OAAO,OAAO,SAAS,OAAO,eAAe;AAAA,MAC1D;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,UAAU,CAAC,aACT,OAAO,SAAS,OAAO,EAAE,IAAI,MAAM,SAAS,IAAI,EAAE,IAAI,OAAO,OAAO,SAAS,CAAC;AAAA,MAChF,gBAAgB,CAAC,UAAU,OAAO,EAAE,IAAI,OAAO,MAAM,CAAC;AAAA,IACxD,CAAC;AAED,WAAO,YAAY;AAAA,EACrB,CAAC;AACH;","names":[]}
@@ -22,7 +22,6 @@ type Props = {
22
22
  type PromptMoment = {
23
23
  skipped: boolean;
24
24
  dismissed: boolean;
25
- momentType: ReturnType<PromptMomentNotification['getMomentType']>;
26
25
  dismissedReason: ReturnType<PromptMomentNotification['getDismissedReason']>;
27
26
  };
28
27
  /**
@@ -22,7 +22,6 @@ type Props = {
22
22
  type PromptMoment = {
23
23
  skipped: boolean;
24
24
  dismissed: boolean;
25
- momentType: ReturnType<PromptMomentNotification['getMomentType']>;
26
25
  dismissedReason: ReturnType<PromptMomentNotification['getDismissedReason']>;
27
26
  };
28
27
  /**
@@ -7,10 +7,10 @@ function loadScript() {
7
7
  resolve();
8
8
  } else {
9
9
  script.addEventListener("load", () => resolve());
10
- script.addEventListener(
11
- "error",
12
- () => reject(new Error("Failed to load Google One Tap script"))
13
- );
10
+ script.addEventListener("error", () => {
11
+ script = null;
12
+ reject(new Error("Failed to load Google One Tap script"));
13
+ });
14
14
  }
15
15
  return;
16
16
  }
@@ -20,7 +20,10 @@ function loadScript() {
20
20
  script.defer = true;
21
21
  script.src = "https://accounts.google.com/gsi/client";
22
22
  script.onload = () => resolve();
23
- script.onerror = () => reject(new Error("Failed to load Google One Tap script"));
23
+ script.onerror = () => {
24
+ script = null;
25
+ reject(new Error("Failed to load Google One Tap script"));
26
+ };
24
27
  document.head.appendChild(script);
25
28
  });
26
29
  }
@@ -63,15 +66,13 @@ async function prompt({
63
66
  });
64
67
  window.google.accounts.id.prompt((notification) => {
65
68
  if (settled) return;
66
- if (notification.isSkippedMoment() || notification.isDismissedMoment() && notification.getDismissedReason() !== "credential_returned") {
69
+ const skipped = notification.isSkippedMoment();
70
+ const dismissed = notification.isDismissedMoment();
71
+ const dismissedReason = notification.getDismissedReason();
72
+ if (skipped || dismissed && dismissedReason !== "credential_returned") {
67
73
  settle({
68
74
  authorized: false,
69
- moment: {
70
- momentType: notification.getMomentType(),
71
- skipped: notification.isSkippedMoment(),
72
- dismissed: notification.isDismissedMoment(),
73
- dismissedReason: notification.getDismissedReason()
74
- }
75
+ moment: { skipped, dismissed, dismissedReason }
75
76
  });
76
77
  }
77
78
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/google-one-tap/index.ts"],"sourcesContent":["import type {\n ClientConfigError,\n CodeResponse,\n CredentialResponse,\n GoogleAccounts,\n PromptMomentNotification,\n} from './types';\n\ndeclare global {\n interface Window {\n google: {\n accounts: GoogleAccounts;\n };\n }\n}\n\nexport type Props = {\n /**\n * Opaque nonce string forwarded as-is to Google. Google echoes it back in\n * the ID Token's `nonce` claim per the OIDC spec; the caller is responsible\n * for any hashing/encoding required by its verifier.\n */\n nonce?: string;\n client_id: string;\n auto_select?: boolean;\n cancel_on_tap_outside?: boolean;\n use_fedcm_for_prompt?: boolean;\n};\n\nexport type PromptMoment = {\n skipped: boolean;\n dismissed: boolean;\n momentType: ReturnType<PromptMomentNotification['getMomentType']>;\n dismissedReason: ReturnType<PromptMomentNotification['getDismissedReason']>;\n};\n\n/**\n * Why prompt() could not run One Tap, so the caller can decide to fall back\n * to requestCode().\n * - `fedcm_unsupported`: browser has no FedCM (Safari/Firefox/pre-117 Chrome).\n * - `script_load_failed`: the GSI script failed to load (network/CSP).\n * - `prompt_error`: GIS threw synchronously while initializing/prompting.\n */\nexport type UnsupportedReason = 'fedcm_unsupported' | 'script_load_failed' | 'prompt_error';\n\nexport type PromptResult =\n | { authorized: true; credential: CredentialResponse }\n | { authorized: false; moment: PromptMoment }\n | { authorized: false; unsupported: true; reason: UnsupportedReason };\n\nlet script: HTMLScriptElement | null = null;\n\nfunction loadScript(): Promise<void> {\n return new Promise((resolve, reject) => {\n if (script) {\n if (window.google?.accounts?.id) {\n resolve();\n } else {\n script.addEventListener('load', () => resolve());\n script.addEventListener('error', () =>\n reject(new Error('Failed to load Google One Tap script'))\n );\n }\n return;\n }\n\n script = document.createElement('script');\n script.id = 'google-one-tap';\n script.async = true;\n script.defer = true;\n script.src = 'https://accounts.google.com/gsi/client';\n script.onload = () => resolve();\n script.onerror = () => reject(new Error('Failed to load Google One Tap script'));\n\n document.head.appendChild(script);\n });\n}\n\n/** FedCM feature detection — `IdentityCredential` is absent on Safari, Firefox and pre-117 Chrome. */\nfunction isFedcmSupported(): boolean {\n return typeof window !== 'undefined' && 'IdentityCredential' in window;\n}\n\n/** debug: chrome://settings/content/federatedIdentityApi */\nexport async function prompt({\n nonce,\n client_id,\n auto_select = false,\n use_fedcm_for_prompt = true,\n cancel_on_tap_outside = false,\n}: Props): Promise<PromptResult> {\n // FedCM is mandatory for One Tap on capable browsers (GIS completed the\n // migration in early 2025) and there is no viable legacy fallback anymore.\n // When the caller wants FedCM but the browser lacks it, bail early instead\n // of letting GIS throw an async `NotSupportedError: Missing request type`\n // from navigator.credentials.get. Callers should fall back to requestCode().\n if (use_fedcm_for_prompt !== false && !isFedcmSupported()) {\n return { authorized: false, unsupported: true, reason: 'fedcm_unsupported' };\n }\n\n try {\n await loadScript();\n } catch {\n return { authorized: false, unsupported: true, reason: 'script_load_failed' };\n }\n\n return new Promise<PromptResult>((resolve) => {\n let settled = false;\n const settle = (result: PromptResult) => {\n if (settled) return;\n settled = true;\n resolve(result);\n };\n\n try {\n window.google.accounts.id.initialize({\n ux_mode: 'popup',\n context: 'signin',\n auto_select,\n nonce,\n client_id,\n use_fedcm_for_prompt,\n cancel_on_tap_outside,\n callback: (credential) => settle({ authorized: true, credential }),\n native_callback: (credential) => settle({ authorized: true, credential }),\n });\n\n window.google.accounts.id.prompt((notification) => {\n if (settled) return;\n\n if (\n notification.isSkippedMoment() ||\n (notification.isDismissedMoment() &&\n notification.getDismissedReason() !== 'credential_returned')\n ) {\n settle({\n authorized: false,\n moment: {\n momentType: notification.getMomentType(),\n skipped: notification.isSkippedMoment(),\n dismissed: notification.isDismissedMoment(),\n dismissedReason: notification.getDismissedReason(),\n },\n });\n }\n });\n } catch {\n settle({ authorized: false, unsupported: true, reason: 'prompt_error' });\n }\n });\n}\n\nexport type CodeProps = {\n client_id: string;\n /**\n * Space-delimited OAuth scopes. Defaults to OpenID Connect scopes so the\n * backend can exchange the code for an ID token, mirroring One Tap's intent.\n */\n scope?: string;\n /** 'popup' resolves the returned promise; 'redirect' navigates away and never resolves. */\n ux_mode?: 'popup' | 'redirect';\n /** Required when ux_mode is 'redirect'; for 'popup' Google uses postMessage. */\n redirect_uri?: string;\n state?: string;\n login_hint?: string;\n hd?: string;\n};\n\nexport type CodeResult =\n | { ok: true; response: CodeResponse }\n | { ok: false; error: ClientConfigError | CodeResponse };\n\n/**\n * OAuth 2.0 authorization-code fallback for environments where One Tap / FedCM\n * is unavailable (i.e. prompt() resolved with `unsupported: true`). It reuses\n * the same GSI script, so there is no extra dependency.\n *\n * Unlike One Tap it returns an authorization `code` for the backend to\n * exchange, not an ID token, and it must be triggered by a user gesture or the\n * popup may be blocked.\n */\nexport async function requestCode({\n client_id,\n scope = 'openid email profile',\n ux_mode = 'popup',\n redirect_uri,\n state,\n login_hint,\n hd,\n}: CodeProps): Promise<CodeResult> {\n await loadScript();\n\n return new Promise<CodeResult>((resolve) => {\n let settled = false;\n const settle = (result: CodeResult) => {\n if (settled) return;\n settled = true;\n resolve(result);\n };\n\n const client = window.google.accounts.oauth2.initCodeClient({\n client_id,\n scope,\n ux_mode,\n redirect_uri,\n state,\n login_hint,\n hd,\n callback: (response) =>\n settle(response.code ? { ok: true, response } : { ok: false, error: response }),\n error_callback: (error) => settle({ ok: false, error }),\n });\n\n client.requestCode();\n });\n}\n"],"mappings":";AAkDA,IAAI,SAAmC;AAEvC,SAAS,aAA4B;AACnC,SAAO,IAAI,QAAQ,CAAC,SAAS,WAAW;AACtC,QAAI,QAAQ;AACV,UAAI,OAAO,QAAQ,UAAU,IAAI;AAC/B,gBAAQ;AAAA,MACV,OAAO;AACL,eAAO,iBAAiB,QAAQ,MAAM,QAAQ,CAAC;AAC/C,eAAO;AAAA,UAAiB;AAAA,UAAS,MAC/B,OAAO,IAAI,MAAM,sCAAsC,CAAC;AAAA,QAC1D;AAAA,MACF;AACA;AAAA,IACF;AAEA,aAAS,SAAS,cAAc,QAAQ;AACxC,WAAO,KAAK;AACZ,WAAO,QAAQ;AACf,WAAO,QAAQ;AACf,WAAO,MAAM;AACb,WAAO,SAAS,MAAM,QAAQ;AAC9B,WAAO,UAAU,MAAM,OAAO,IAAI,MAAM,sCAAsC,CAAC;AAE/E,aAAS,KAAK,YAAY,MAAM;AAAA,EAClC,CAAC;AACH;AAGA,SAAS,mBAA4B;AACnC,SAAO,OAAO,WAAW,eAAe,wBAAwB;AAClE;AAGA,eAAsB,OAAO;AAAA,EAC3B;AAAA,EACA;AAAA,EACA,cAAc;AAAA,EACd,uBAAuB;AAAA,EACvB,wBAAwB;AAC1B,GAAiC;AAM/B,MAAI,yBAAyB,SAAS,CAAC,iBAAiB,GAAG;AACzD,WAAO,EAAE,YAAY,OAAO,aAAa,MAAM,QAAQ,oBAAoB;AAAA,EAC7E;AAEA,MAAI;AACF,UAAM,WAAW;AAAA,EACnB,QAAQ;AACN,WAAO,EAAE,YAAY,OAAO,aAAa,MAAM,QAAQ,q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A,IAChB;AAEA,UAAM,SAAS,OAAO,OAAO,SAAS,OAAO,eAAe;AAAA,MAC1D;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,UAAU,CAAC,aACT,OAAO,SAAS,OAAO,EAAE,IAAI,MAAM,SAAS,IAAI,EAAE,IAAI,OAAO,OAAO,SAAS,CAAC;AAAA,MAChF,gBAAgB,CAAC,UAAU,OAAO,EAAE,IAAI,OAAO,MAAM,CAAC;AAAA,IACxD,CAAC;AAED,WAAO,YAAY;AAAA,EACrB,CAAC;AACH;","names":[]}
1
+ {"version":3,"sources":["../../src/google-one-tap/index.ts"],"sourcesContent":["import type {\n ClientConfigError,\n CodeResponse,\n CredentialResponse,\n GoogleAccounts,\n PromptMomentNotification,\n} from './types';\n\ndeclare global {\n interface Window {\n google: {\n accounts: GoogleAccounts;\n };\n }\n}\n\nexport type Props = {\n /**\n * Opaque nonce string forwarded as-is to Google. Google echoes it back in\n * the ID Token's `nonce` claim per the OIDC spec; the caller is responsible\n * for any hashing/encoding required by its verifier.\n */\n nonce?: string;\n client_id: string;\n auto_select?: boolean;\n cancel_on_tap_outside?: boolean;\n use_fedcm_for_prompt?: boolean;\n};\n\nexport type PromptMoment = {\n skipped: boolean;\n dismissed: boolean;\n dismissedReason: ReturnType<PromptMomentNotification['getDismissedReason']>;\n};\n\n/**\n * Why prompt() could not run One Tap, so the caller can decide to fall back\n * to requestCode().\n * - `fedcm_unsupported`: browser has no FedCM (Safari/Firefox/pre-117 Chrome).\n * - `script_load_failed`: the GSI script failed to load (network/CSP).\n * - `prompt_error`: GIS threw synchronously while initializing/prompting.\n */\nexport type UnsupportedReason = 'fedcm_unsupported' | 'script_load_failed' | 'prompt_error';\n\nexport type PromptResult =\n | { authorized: true; credential: CredentialResponse }\n | { authorized: false; moment: PromptMoment }\n | { authorized: false; unsupported: true; reason: UnsupportedReason };\n\nlet script: HTMLScriptElement | null = null;\n\nfunction loadScript(): Promise<void> {\n return new Promise((resolve, reject) => {\n if (script) {\n if (window.google?.accounts?.id) {\n resolve();\n } else {\n script.addEventListener('load', () => resolve());\n script.addEventListener('error', () => {\n script = null; // allow a later call to recreate the element instead of hanging\n reject(new Error('Failed to load Google One Tap script'));\n });\n }\n return;\n }\n\n script = document.createElement('script');\n script.id = 'google-one-tap';\n script.async = true;\n script.defer = true;\n script.src = 'https://accounts.google.com/gsi/client';\n script.onload = () => resolve();\n script.onerror = () => {\n script = null; // allow a later call to recreate the element instead of hanging\n reject(new Error('Failed to load Google One Tap script'));\n };\n\n document.head.appendChild(script);\n });\n}\n\n/** FedCM feature detection — `IdentityCredential` is absent on Safari, Firefox and pre-117 Chrome. */\nfunction isFedcmSupported(): boolean {\n return typeof window !== 'undefined' && 'IdentityCredential' in window;\n}\n\n/** debug: chrome://settings/content/federatedIdentityApi */\nexport async function prompt({\n nonce,\n client_id,\n auto_select = false,\n use_fedcm_for_prompt = true,\n cancel_on_tap_outside = false,\n}: Props): Promise<PromptResult> {\n // FedCM is mandatory for One Tap on capable browsers (GIS completed the\n // migration in early 2025) and there is no viable legacy fallback anymore.\n // When the caller wants FedCM but the browser lacks it, bail early instead\n // of letting GIS throw an async `NotSupportedError: Missing request type`\n // from navigator.credentials.get. Callers should fall back to requestCode().\n if (use_fedcm_for_prompt !== false && !isFedcmSupported()) {\n return { authorized: false, unsupported: true, reason: 'fedcm_unsupported' };\n }\n\n try {\n await loadScript();\n } catch {\n return { authorized: false, unsupported: true, reason: 'script_load_failed' };\n }\n\n return new Promise<PromptResult>((resolve) => {\n let settled = false;\n const settle = (result: PromptResult) => {\n if (settled) return;\n settled = true;\n resolve(result);\n };\n\n try {\n window.google.accounts.id.initialize({\n ux_mode: 'popup',\n context: 'signin',\n auto_select,\n nonce,\n client_id,\n use_fedcm_for_prompt,\n cancel_on_tap_outside,\n callback: (credential) => settle({ authorized: true, credential }),\n native_callback: (credential) => settle({ authorized: true, credential }),\n });\n\n window.google.accounts.id.prompt((notification) => {\n if (settled) return;\n\n const skipped = notification.isSkippedMoment();\n const dismissed = notification.isDismissedMoment();\n const dismissedReason = notification.getDismissedReason();\n\n if (skipped || (dismissed && dismissedReason !== 'credential_returned')) {\n settle({\n authorized: false,\n moment: { skipped, dismissed, dismissedReason },\n });\n }\n });\n } catch {\n settle({ authorized: false, unsupported: true, reason: 'prompt_error' });\n }\n });\n}\n\nexport type CodeProps = {\n client_id: string;\n /**\n * Space-delimited OAuth scopes. Defaults to OpenID Connect scopes so the\n * backend can exchange the code for an ID token, mirroring One Tap's intent.\n */\n scope?: string;\n /** 'popup' resolves the returned promise; 'redirect' navigates away and never resolves. */\n ux_mode?: 'popup' | 'redirect';\n /** Required when ux_mode is 'redirect'; for 'popup' Google uses postMessage. */\n redirect_uri?: string;\n state?: string;\n login_hint?: string;\n hd?: string;\n};\n\nexport type CodeResult =\n | { ok: true; response: CodeResponse }\n | { ok: false; error: ClientConfigError | CodeResponse };\n\n/**\n * OAuth 2.0 authorization-code fallback for environments where One Tap / FedCM\n * is unavailable (i.e. prompt() resolved with `unsupported: true`). It reuses\n * the same GSI script, so there is no extra dependency.\n *\n * Unlike One Tap it returns an authorization `code` for the backend to\n * exchange, not an ID token, and it must be triggered by a user gesture or the\n * popup may be blocked.\n */\nexport async function requestCode({\n client_id,\n scope = 'openid email profile',\n ux_mode = 'popup',\n redirect_uri,\n state,\n login_hint,\n hd,\n}: CodeProps): Promise<CodeResult> {\n await loadScript();\n\n return new Promise<CodeResult>((resolve) => {\n let settled = false;\n const settle = (result: CodeResult) => {\n if (settled) return;\n settled = true;\n resolve(result);\n };\n\n const client = window.google.accounts.oauth2.initCodeClient({\n client_id,\n scope,\n ux_mode,\n redirect_uri,\n state,\n login_hint,\n hd,\n callback: (response) =>\n settle(response.code ? { ok: true, response } : { ok: false, error: response }),\n error_callback: (error) => settle({ ok: false, error }),\n });\n\n client.requestCode();\n });\n}\n"],"mappings":";AAiDA,IAAI,SAAmC;AAEvC,SAAS,aAA4B;AACn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AAC;AAAA,IACxD,CAAC;AAED,WAAO,YAAY;AAAA,EACrB,CAAC;AACH;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shware/http",
3
- "version": "2.11.0",
3
+ "version": "2.11.1",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",