@crvouga/mockingbird-service-oauth 1.2.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -3,8 +3,8 @@ import {
3
3
  runCli,
4
4
  serveCommand,
5
5
  serveTarget
6
- } from "./chunk-U4WWQUOX.js";
7
- import "./chunk-XUUSJ73W.js";
6
+ } from "./chunk-MKBPAVYU.js";
7
+ import "./chunk-WHI7Y2UA.js";
8
8
 
9
9
  // src/cli.ts
10
10
  var code = await runCli(
package/dist/index.d.ts CHANGED
@@ -839,6 +839,16 @@ type NotificationDelivery = {
839
839
  status?: number;
840
840
  error?: string;
841
841
  };
842
+ /** What one client sees for one account: see `OAuthAPI.grant`. */
843
+ type GrantView = {
844
+ subject: string;
845
+ granted: boolean;
846
+ scopes: string[];
847
+ emailChoice: "share" | "hide" | null;
848
+ email: string;
849
+ isPrivateEmail: boolean;
850
+ userDisclosed: boolean;
851
+ };
842
852
 
843
853
  /**
844
854
  * The slice of OpenAPI 3.1 (and JSON Schema 2020-12) Mockingbird understands.
@@ -1119,6 +1129,16 @@ declare class OAuthAPI {
1119
1129
  private notify;
1120
1130
  /** Drops one client's grant for an account: consent, identity, first-use disclosure, codes, tokens. */
1121
1131
  private forget;
1132
+ /**
1133
+ * What `clientId` sees for `accountId` (a test control mirroring private provider state), or
1134
+ * `null` for an unknown client or account. For a client that never authorized the account,
1135
+ * `subject` is the id token `sub` it would receive and `email` the real address.
1136
+ */
1137
+ grant(clientId: string, accountId: string): Promise<GrantView | null>;
1138
+ /** The grant view of every account that has authorized `clientId`, oldest account first. */
1139
+ grants(clientId: string): Promise<(GrantView & {
1140
+ accountId: string;
1141
+ })[] | null>;
1122
1142
  private paths;
1123
1143
  private supportedScopes;
1124
1144
  private identityKey;
@@ -1140,4 +1160,4 @@ declare class OAuthAPI {
1140
1160
  }
1141
1161
 
1142
1162
  export { OAUTH_PRESETS, OAUTH_SCENARIOS, OAuthAPI, createMultiRuntime, createRuntime, document, operationIds, supportedOperationIds };
1143
- export type { Account, AppleNotificationType, BehaviorEvent, BehaviorInput, Client, EdgeCase, NotificationDelivery, OAuthAPIOptions, OAuthBehavior, OAuthMount, OAuthMultiRuntime, OAuthMultiRuntimeOptions, OAuthRuntime, OAuthRuntimeOptions, OAuthScenario, Provider };
1163
+ export type { Account, AppleNotificationType, BehaviorEvent, BehaviorInput, Client, EdgeCase, GrantView, NotificationDelivery, OAuthAPIOptions, OAuthBehavior, OAuthMount, OAuthMultiRuntime, OAuthMultiRuntimeOptions, OAuthRuntime, OAuthRuntimeOptions, OAuthScenario, Provider };
package/dist/index.js CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  document,
8
8
  operationIds,
9
9
  supportedOperationIds
10
- } from "./chunk-XUUSJ73W.js";
10
+ } from "./chunk-WHI7Y2UA.js";
11
11
  export {
12
12
  OAUTH_PRESETS,
13
13
  OAUTH_SCENARIOS,
package/dist/server.d.ts CHANGED
@@ -1378,6 +1378,16 @@ type NotificationDelivery = {
1378
1378
  status?: number;
1379
1379
  error?: string;
1380
1380
  };
1381
+ /** What one client sees for one account: see `OAuthAPI.grant`. */
1382
+ type GrantView = {
1383
+ subject: string;
1384
+ granted: boolean;
1385
+ scopes: string[];
1386
+ emailChoice: "share" | "hide" | null;
1387
+ email: string;
1388
+ isPrivateEmail: boolean;
1389
+ userDisclosed: boolean;
1390
+ };
1381
1391
 
1382
1392
  type OAuthAPIOptions = APIOptions & {
1383
1393
  /** Browser Fetch forbids Cookie/Set-Cookie; local transports may explicitly remap them. */
@@ -1455,6 +1465,16 @@ declare class OAuthAPI {
1455
1465
  private notify;
1456
1466
  /** Drops one client's grant for an account: consent, identity, first-use disclosure, codes, tokens. */
1457
1467
  private forget;
1468
+ /**
1469
+ * What `clientId` sees for `accountId` (a test control mirroring private provider state), or
1470
+ * `null` for an unknown client or account. For a client that never authorized the account,
1471
+ * `subject` is the id token `sub` it would receive and `email` the real address.
1472
+ */
1473
+ grant(clientId: string, accountId: string): Promise<GrantView | null>;
1474
+ /** The grant view of every account that has authorized `clientId`, oldest account first. */
1475
+ grants(clientId: string): Promise<(GrantView & {
1476
+ accountId: string;
1477
+ })[] | null>;
1458
1478
  private paths;
1459
1479
  private supportedScopes;
1460
1480
  private identityKey;
package/dist/server.js CHANGED
@@ -3,8 +3,8 @@ import {
3
3
  createMultiServer,
4
4
  createServer,
5
5
  serveTarget
6
- } from "./chunk-U4WWQUOX.js";
7
- import "./chunk-XUUSJ73W.js";
6
+ } from "./chunk-MKBPAVYU.js";
7
+ import "./chunk-WHI7Y2UA.js";
8
8
  export {
9
9
  DEFAULT_PORT,
10
10
  createMultiServer,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crvouga/mockingbird-service-oauth",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "description": "Portable social-login mock with Google, Apple, Microsoft, GitHub and generic OIDC profiles, private relay identities, reproducible edge cases, signed tokens and an accessible UI.",
5
5
  "license": "MIT",
6
6
  "type": "module",