@absolutejs/auth 0.76.2 → 0.77.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.
@@ -467,8 +467,14 @@ export declare const linkedProviderGrantsTable: import("drizzle-orm/pg-core").Pg
467
467
  }>;
468
468
  export type LinkedProviderGrantRow = typeof linkedProviderGrantsTable.$inferSelect;
469
469
  export type LinkedProviderBindingRow = typeof linkedProviderBindingsTable.$inferSelect;
470
- export declare const createNeonLinkedProviderBindingStore: <DB extends AnyPgDatabase>(db: DB) => LinkedProviderBindingStore;
471
- export declare const createNeonLinkedProviderGrantStore: <DB extends AnyPgDatabase>(db: DB) => LinkedProviderGrantStore;
470
+ /**
471
+ * These two take a database rather than a connection string, so an application
472
+ * that already has one uses it instead of opening a second. Nothing in either
473
+ * is specific to Neon -- the Neon helpers below are the convenience that opens
474
+ * a connection for a caller who has none.
475
+ */
476
+ export declare const createLinkedProviderBindingStore: <DB extends AnyPgDatabase>(db: DB) => LinkedProviderBindingStore;
477
+ export declare const createLinkedProviderGrantStore: <DB extends AnyPgDatabase>(db: DB) => LinkedProviderGrantStore;
472
478
  export declare const createNeonLinkedProviderStores: (databaseUrl: string) => {
473
479
  bindingStore: LinkedProviderBindingStore;
474
480
  db: import("drizzle-orm/neon-http").NeonHttpDatabase<import("drizzle-orm").EmptyRelations> & {
@@ -12,6 +12,21 @@ export type CreateLinkedProviderCredentialResolverOptions = {
12
12
  requiredScopes?: string[];
13
13
  }) => Promise<LinkedProviderRefreshResult | null> | LinkedProviderRefreshResult | null;
14
14
  now?: () => number;
15
+ /**
16
+ * What a reported failure does to the stored grant and binding.
17
+ *
18
+ * `latch`, the default, marks an unauthorized or revoked credential
19
+ * unusable, which is what a sign-in identity needs: nothing works again
20
+ * until the person authorizes again.
21
+ *
22
+ * `record` writes the same failure detail and leaves both statuses alone.
23
+ * A connector credential wants this. Its calls fail for reasons that live
24
+ * on the provider's side -- an app installation dropped from a repository,
25
+ * a project unshared -- and latching turns one refused call into a
26
+ * connection that stays shut until it is rebuilt, which does not fix
27
+ * anything because the credential was never the problem.
28
+ */
29
+ failurePolicy?: 'latch' | 'record';
15
30
  onReportFailure?: (input: {
16
31
  credential: ResolvedLinkedProviderCredential;
17
32
  report: LinkedProviderCredentialFailureReport;
@@ -19,4 +34,4 @@ export type CreateLinkedProviderCredentialResolverOptions = {
19
34
  binding?: LinkedProviderBinding;
20
35
  }) => Promise<void> | void;
21
36
  };
22
- export declare const createLinkedProviderCredentialResolver: ({ grantStore, bindingStore, loadAccessTokenLease, refreshAccessTokenLease, now, onReportFailure }: CreateLinkedProviderCredentialResolverOptions) => LinkedProviderCredentialResolver;
37
+ export declare const createLinkedProviderCredentialResolver: ({ grantStore, bindingStore, failurePolicy, loadAccessTokenLease, refreshAccessTokenLease, now, onReportFailure }: CreateLinkedProviderCredentialResolverOptions) => LinkedProviderCredentialResolver;