@happyvertical/smrt-users 0.57.7 → 0.57.8

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.
@@ -50,16 +50,28 @@
50
50
  */
51
51
  import '../__smrt-register__.js';
52
52
  import { PasswordCredentialService, type PasswordCredentialServiceOptions } from '../services/PasswordCredentialService.js';
53
+ /**
54
+ * Structural cookie subset. Options are always supplied by this module and
55
+ * match SvelteKit's required cookie path without making it a root dependency.
56
+ */
57
+ type CookieOptions = {
58
+ path: string;
59
+ domain?: string;
60
+ httpOnly?: boolean;
61
+ secure?: boolean;
62
+ sameSite?: 'strict' | 'lax' | 'none';
63
+ maxAge?: number;
64
+ };
53
65
  type Cookies = {
54
66
  get: (name: string) => string | undefined;
55
- set: (name: string, value: string, options?: Record<string, unknown>) => void;
56
- delete: (name: string, options?: Record<string, unknown>) => void;
67
+ set: (name: string, value: string, options: CookieOptions) => void;
68
+ delete: (name: string, options: CookieOptions) => void;
57
69
  };
58
70
  /** The parts of a SvelteKit `RequestEvent` these handlers use. */
59
71
  export type PasswordRequestEvent = {
60
72
  cookies: Cookies;
61
73
  getClientAddress?: () => string;
62
- locals?: Record<string, unknown>;
74
+ locals?: object;
63
75
  request: Request;
64
76
  url: URL;
65
77
  };
@@ -69,7 +81,7 @@ export interface CreatePasswordCredentialHandlersOptions extends PasswordCredent
69
81
  * it. A value or a per-request resolver. Null/omitted signs in with no
70
82
  * tenant context.
71
83
  */
72
- tenantId?: string | null | ((event: PasswordRequestEvent) => string | null | undefined | Promise<string | null | undefined>);
84
+ tenantId?: string | null | 'unique-active-membership' | ((event: PasswordRequestEvent) => string | null | undefined | 'unique-active-membership' | Promise<string | null | undefined | 'unique-active-membership'>);
73
85
  /** Session cookie name; must match `createSessionHandler`. Default `sid`. */
74
86
  cookieName?: string;
75
87
  cookiePath?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"password-handlers.d.ts","sourceRoot":"","sources":["../../src/sveltekit/password-handlers.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IAC3D,WAAW,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;IAChE,cAAc,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;IACnE,aAAa,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;IAClE,aAAa,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;IAClE;;;;OAIG;IACH,wBAAwB,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC7E,sEAAsE;IACtE,OAAO,EAAE,MAAM,OAAO,CAAC,yBAAyB,CAAC,CAAC;CACnD;AAuHD,wBAAgB,gCAAgC,CAC9C,OAAO,EAAE,uCAAuC,GAC/C,0BAA0B,CAmJ5B"}
package/dist/sveltekit.js CHANGED
@@ -1,4 +1,4 @@
1
- import { A as withSessionPermissionContext, B as resolveOidcProviderConfig, C as OperationPermissionError, F as OidcLoginError, G as DeviceCredentialForbiddenError, I as OidcLoginService, K as DeviceCredentialPolicyError, L as decodeOidcTransaction, M as MobileAuthService, N as readMobileBearerToken, P as validateMobileRedirectUri, Q as SessionService, R as encodeOidcTransaction, W as DeviceCredentialError, _ as PasswordCredentialError, a as TerminalAuthError, b as PasswordPolicyError, j as MobileAuthError, lt as LoginRateLimitError, o as TerminalAuthRateLimitError, q as DeviceCredentialService, s as TerminalAuthService, v as PasswordCredentialForbiddenError, y as PasswordCredentialService, z as getUsersOidcConfig } from "./chunks/TerminalAuthService-D4skXg_Q.js";
1
+ import { A as withSessionPermissionContext, B as resolveOidcProviderConfig, C as OperationPermissionError, F as OidcLoginError, G as DeviceCredentialForbiddenError, I as OidcLoginService, K as DeviceCredentialPolicyError, L as decodeOidcTransaction, M as MobileAuthService, N as readMobileBearerToken, P as validateMobileRedirectUri, Q as SessionService, R as encodeOidcTransaction, W as DeviceCredentialError, _ as PasswordCredentialError, a as TerminalAuthError, b as PasswordPolicyError, j as MobileAuthError, lt as LoginRateLimitError, o as TerminalAuthRateLimitError, q as DeviceCredentialService, s as TerminalAuthService, v as PasswordCredentialForbiddenError, y as PasswordCredentialService, z as getUsersOidcConfig } from "./chunks/TerminalAuthService-BpRwohDW.js";
2
2
  import { DiscoveryArtifactValidationError, SMRT_APP_RESULT_CONTRACT, SMRT_APP_RESULT_SCHEMA, SMRT_APP_RESULT_VERSION, SMRT_DISCOVERY_CONFORMANCE_ARTIFACT_SCHEMA, SMRT_DISCOVERY_CONFORMANCE_SCHEMA, SMRT_DISCOVERY_CONFORMANCE_VERSION, SMRT_MCP_RESULT_METADATA_KEY, canonicalizeDiscoveryArtifact, createDiscoveryConformanceArtifact, deriveCommandRequirements, validateDiscoveryConformanceArtifact } from "./app-contract.js";
3
3
  import { ObjectRegistry, createClassNamePredicate, resolveCustomActionMetadata, resolveEffectiveActionMetadata } from "@happyvertical/smrt-core";
4
4
  import { createLogger } from "@happyvertical/logger";