@zlooks.cn/password-auth-server 1.0.8 → 1.1.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.
Files changed (34) hide show
  1. package/.hile-rsc/{build-mu23gtxh-f44b8610/client-browser/chunks/chunk-KAAF6QZA.js → build-mu41ll5m-02df9102/client-browser/chunks/chunk-ZV6MPT36.js} +62 -6
  2. package/.hile-rsc/{build-mu23gtxh-f44b8610/client-browser/src-plugin-page-frame-07c4de56a6-CUBFIRPZ.js → build-mu41ll5m-02df9102/client-browser/src-plugin-page-frame-07c4de56a6-24L24OGL.js} +1 -1
  3. package/.hile-rsc/{build-mu23gtxh-f44b8610/client-browser/src-plugin-password-form-3bd63d69e5-JSE7BG7B.js → build-mu41ll5m-02df9102/client-browser/src-plugin-password-form-3bd63d69e5-MO3JJSBS.js} +93 -87
  4. package/.hile-rsc/{build-mu23gtxh-f44b8610/client-ssr/chunks/chunk-CO2NBEJ7.js → build-mu41ll5m-02df9102/client-ssr/chunks/chunk-EWBYMJX4.js} +63 -7
  5. package/.hile-rsc/{build-mu23gtxh-f44b8610/client-ssr/src-plugin-page-frame-07c4de56a6-UJSSLASH.js → build-mu41ll5m-02df9102/client-ssr/src-plugin-page-frame-07c4de56a6-LN2W67ZP.js} +1 -1
  6. package/.hile-rsc/{build-mu23gtxh-f44b8610/client-ssr/src-plugin-password-form-3bd63d69e5-YEIM2464.js → build-mu41ll5m-02df9102/client-ssr/src-plugin-password-form-3bd63d69e5-MWQ7H3E5.js} +93 -87
  7. package/.hile-rsc/build-mu41ll5m-02df9102/plugin.json +126 -0
  8. package/.hile-rsc/{build-mu23gtxh-f44b8610 → build-mu41ll5m-02df9102}/server-rsc/index.js +94 -88
  9. package/dist/password/password-authenticator.d.ts +4 -1
  10. package/dist/password/password-authenticator.d.ts.map +1 -1
  11. package/dist/password/password-authenticator.js +62 -9
  12. package/dist/password/password-authenticator.js.map +1 -1
  13. package/dist/password/typeorm-credential-repository.d.ts.map +1 -1
  14. package/dist/password/typeorm-credential-repository.js +11 -46
  15. package/dist/password/typeorm-credential-repository.js.map +1 -1
  16. package/dist/persistence/entities.d.ts +1 -12
  17. package/dist/persistence/entities.d.ts.map +1 -1
  18. package/dist/persistence/entities.js +0 -16
  19. package/dist/persistence/entities.js.map +1 -1
  20. package/dist/services/application.service.d.ts.map +1 -1
  21. package/dist/services/application.service.js +2 -1
  22. package/dist/services/application.service.js.map +1 -1
  23. package/dist/services/password-runtime.service.d.ts.map +1 -1
  24. package/dist/services/password-runtime.service.js +7 -17
  25. package/dist/services/password-runtime.service.js.map +1 -1
  26. package/package.json +11 -9
  27. package/.hile-rsc/build-mu23gtxh-f44b8610/plugin.json +0 -90
  28. package/dist/password/credential-lifecycle-outbox.d.ts +0 -42
  29. package/dist/password/credential-lifecycle-outbox.d.ts.map +0 -1
  30. package/dist/password/credential-lifecycle-outbox.js +0 -120
  31. package/dist/password/credential-lifecycle-outbox.js.map +0 -1
  32. /package/.hile-rsc/{build-mu23gtxh-f44b8610 → build-mu41ll5m-02df9102}/client-browser/src-plugin-page-frame-07c4de56a6-3F24AYCH.css +0 -0
  33. /package/.hile-rsc/{build-mu23gtxh-f44b8610 → build-mu41ll5m-02df9102}/client-browser/src-plugin-password-form-3bd63d69e5-TRYMJX4F.css +0 -0
  34. /package/.hile-rsc/{build-mu23gtxh-f44b8610 → build-mu41ll5m-02df9102}/styles/4b3193c4f2b317ffed425ccf401342a4bdd6ccfd5f9c42def3315e776f166975.css +0 -0
@@ -317,7 +317,7 @@ var useSyncExternalStore = React.useSyncExternalStore;
317
317
  var useTransition = React.useTransition;
318
318
  var version = React.version;
319
319
 
320
- // ../../node_modules/.pnpm/@hile+rsc@1.0.23_react-dom@19.2.8_react@19.2.8__react@19.2.8_webpack@5.109.2_esbuild@0._018ec7a173afc56bd84b34a004a4af63/node_modules/@hile/rsc/dist/client/navigation-internals.js
320
+ // ../../node_modules/.pnpm/@hile+rsc@1.0.24_react-dom@19.2.8_react@19.2.8__react@19.2.8_webpack@5.109.2_esbuild@0._4a79a70f5d2c56efc9d87074da83a607/node_modules/@hile/rsc/dist/client/navigation-internals.js
321
321
  function resolveRscNavigationUrl(href, currentHref) {
322
322
  try {
323
323
  const destination = new URL(href, currentHref);
@@ -335,7 +335,7 @@ function shouldHandleRscNavigationClick(event, anchor, currentHref) {
335
335
  return current !== void 0 && destination !== void 0 && destination.origin === current.origin;
336
336
  }
337
337
 
338
- // ../../node_modules/.pnpm/@hile+rsc@1.0.23_react-dom@19.2.8_react@19.2.8__react@19.2.8_webpack@5.109.2_esbuild@0._018ec7a173afc56bd84b34a004a4af63/node_modules/@hile/rsc/dist/client/navigation-runtime.js
338
+ // ../../node_modules/.pnpm/@hile+rsc@1.0.24_react-dom@19.2.8_react@19.2.8__react@19.2.8_webpack@5.109.2_esbuild@0._4a79a70f5d2c56efc9d87074da83a607/node_modules/@hile/rsc/dist/client/navigation-runtime.js
339
339
  var runtimeStateKey = /* @__PURE__ */ Symbol.for("@hile/rsc/client/navigation/runtime");
340
340
  function runtimeState() {
341
341
  const scope = globalThis;
@@ -345,7 +345,7 @@ function getRscNavigationRuntime() {
345
345
  return runtimeState().installations.at(-1)?.navigation;
346
346
  }
347
347
 
348
- // ../../node_modules/.pnpm/@hile+rsc@1.0.23_react-dom@19.2.8_react@19.2.8__react@19.2.8_webpack@5.109.2_esbuild@0._018ec7a173afc56bd84b34a004a4af63/node_modules/@hile/rsc/dist/client/navigation.js
348
+ // ../../node_modules/.pnpm/@hile+rsc@1.0.24_react-dom@19.2.8_react@19.2.8__react@19.2.8_webpack@5.109.2_esbuild@0._4a79a70f5d2c56efc9d87074da83a607/node_modules/@hile/rsc/dist/client/navigation.js
349
349
  function browserLocation() {
350
350
  return typeof window === "undefined" ? void 0 : window.location;
351
351
  }
@@ -403,7 +403,51 @@ var browserNavigation = Object.freeze({
403
403
  function useRscNavigation() {
404
404
  return browserNavigation;
405
405
  }
406
- var RscLink = forwardRef(function RscLink2({ href, replace: replace2 = false, scroll, target, download, onClick, ...props }, ref) {
406
+ function shouldPrefetchRscNavigation(href, currentHref) {
407
+ const current = resolveRscNavigationUrl(currentHref, currentHref);
408
+ const destination = resolveRscNavigationUrl(href, currentHref);
409
+ return current !== void 0 && destination !== void 0 && destination.origin === current.origin;
410
+ }
411
+ function prefetchDeclaredRscRoute(navigation, href, currentHref) {
412
+ return shouldPrefetchRscNavigation(href, currentHref) && navigation.prefetchRoute?.(href) === true;
413
+ }
414
+ function assignRef(ref, value) {
415
+ if (typeof ref === "function")
416
+ ref(value);
417
+ else if (ref)
418
+ ref.current = value;
419
+ }
420
+ var RscLink = forwardRef(function RscLink2({ href, replace: replace2 = false, scroll, prefetch = false, target, download, onClick, onFocus, onPointerEnter, ...props }, ref) {
421
+ const anchorRef = useRef(null);
422
+ const prefetchedHref = useRef(void 0);
423
+ const setAnchorRef = useCallback((node2) => {
424
+ anchorRef.current = node2;
425
+ assignRef(ref, node2);
426
+ }, [ref]);
427
+ const triggerPrefetch = useCallback(() => {
428
+ const location = browserLocation();
429
+ const navigation = installedNavigation();
430
+ if (!location || !navigation || prefetchedHref.current === href || !shouldPrefetchRscNavigation(href, location.href)) {
431
+ return false;
432
+ }
433
+ if (!prefetchDeclaredRscRoute(navigation, href, location.href))
434
+ return false;
435
+ prefetchedHref.current = href;
436
+ return true;
437
+ }, [href]);
438
+ useEffect(() => {
439
+ if (prefetch !== "viewport" || typeof IntersectionObserver === "undefined" || !anchorRef.current) {
440
+ return;
441
+ }
442
+ const observer2 = new IntersectionObserver((entries) => {
443
+ if (entries.some(({ isIntersecting }) => isIntersecting)) {
444
+ if (triggerPrefetch())
445
+ observer2.disconnect();
446
+ }
447
+ });
448
+ observer2.observe(anchorRef.current);
449
+ return () => observer2.disconnect();
450
+ }, [prefetch, triggerPrefetch]);
407
451
  function handleClick(event) {
408
452
  onClick?.(event);
409
453
  if (typeof window === "undefined" || !shouldHandleRscNavigationClick(event, { href, target, download }, window.location.href)) {
@@ -419,13 +463,25 @@ var RscLink = forwardRef(function RscLink2({ href, replace: replace2 = false, sc
419
463
  else
420
464
  navigation.push(href, options);
421
465
  }
466
+ function handleFocus(event) {
467
+ onFocus?.(event);
468
+ if (prefetch === "intent" && !event.defaultPrevented)
469
+ triggerPrefetch();
470
+ }
471
+ function handlePointerEnter(event) {
472
+ onPointerEnter?.(event);
473
+ if (prefetch === "intent" && !event.defaultPrevented)
474
+ triggerPrefetch();
475
+ }
422
476
  return react_default.createElement("a", {
423
477
  ...props,
424
- ref,
478
+ ref: setAnchorRef,
425
479
  href,
426
480
  target,
427
481
  download,
428
- onClick: handleClick
482
+ onClick: handleClick,
483
+ onFocus: handleFocus,
484
+ onPointerEnter: handlePointerEnter
429
485
  });
430
486
  });
431
487
 
@@ -73,7 +73,7 @@ import {
73
73
  useSyncExternalStore,
74
74
  useZlooksApp,
75
75
  warning_default
76
- } from "./chunks/chunk-KAAF6QZA.js";
76
+ } from "./chunks/chunk-ZV6MPT36.js";
77
77
 
78
78
  // ../../node_modules/.pnpm/@ant-design+icons-svg@4.5.0/node_modules/@ant-design/icons-svg/lib/asn/EditOutlined.js
79
79
  var require_EditOutlined = __commonJS({
@@ -120,7 +120,7 @@ import {
120
120
  version,
121
121
  warning_default,
122
122
  zoomIn
123
- } from "./chunks/chunk-KAAF6QZA.js";
123
+ } from "./chunks/chunk-ZV6MPT36.js";
124
124
 
125
125
  // ../../node_modules/.pnpm/@ant-design+icons-svg@4.5.0/node_modules/@ant-design/icons-svg/lib/asn/SearchOutlined.js
126
126
  var require_SearchOutlined = __commonJS({
@@ -162,92 +162,6 @@ var require_EyeOutlined = __commonJS({
162
162
  }
163
163
  });
164
164
 
165
- // ../user-shared/dist/identity.js
166
- var USER_SERVICE_NAMESPACE = "cn.zlooks.user.server";
167
-
168
- // ../user-shared/dist/events/snapshots.js
169
- var userSessionRevocationReasonSchema = external_exports.enum([
170
- "logout",
171
- "user-request",
172
- "family-limit",
173
- "credential-recovery"
174
- ]);
175
- var displayNameSchema = external_exports.string().refine((value) => value === value.trim().normalize("NFKC"), "Display name must be normalized").refine((value) => Array.from(value).length >= 1 && Array.from(value).length <= 160, "Display name must contain 1 to 160 Unicode code points");
176
- var bioSchema = external_exports.string().refine((value) => value === value.trim().normalize("NFKC"), "Bio must be normalized").refine((value) => Array.from(value).length >= 1 && Array.from(value).length <= 500, "Bio must contain 1 to 500 Unicode code points");
177
- var httpUrlSchema = external_exports.url().max(2048).refine((value) => {
178
- const protocol = new URL(value).protocol;
179
- return protocol === "http:" || protocol === "https:";
180
- }, "URL must use HTTP or HTTPS").refine((value) => value === new URL(value).toString(), "URL must be canonical");
181
- var emailSchema = external_exports.email().max(320).refine((value) => value === value.toLocaleLowerCase("en-US"), "Email must be lowercase");
182
- var userEventSnapshotSchema = external_exports.strictObject({
183
- id: external_exports.uuid(),
184
- displayName: displayNameSchema.nullable(),
185
- avatar: httpUrlSchema.nullable(),
186
- homepage: httpUrlSchema.nullable(),
187
- bio: bioSchema.nullable(),
188
- email: emailSchema.nullable(),
189
- emailVerified: external_exports.boolean(),
190
- status: external_exports.enum(["active", "disabled", "deleted"]),
191
- createdAt: external_exports.iso.datetime({ offset: true }),
192
- updatedAt: external_exports.iso.datetime({ offset: true }),
193
- version: external_exports.number().int().positive()
194
- }).superRefine((user, context) => {
195
- if (user.emailVerified && user.email === null) {
196
- context.addIssue({
197
- code: "custom",
198
- message: "A verified user snapshot must include its email",
199
- path: ["email"]
200
- });
201
- }
202
- if (Date.parse(user.updatedAt) < Date.parse(user.createdAt)) {
203
- context.addIssue({
204
- code: "custom",
205
- message: "User updated time must not precede creation time",
206
- path: ["updatedAt"]
207
- });
208
- }
209
- }).readonly();
210
- var userSessionFamilyEventSnapshotSchema = external_exports.strictObject({
211
- id: external_exports.uuid(),
212
- userId: external_exports.uuid(),
213
- createdAt: external_exports.iso.datetime({ offset: true }),
214
- expiresAt: external_exports.iso.datetime({ offset: true }),
215
- lastSeenAt: external_exports.iso.datetime({ offset: true }),
216
- revokedAt: external_exports.iso.datetime({ offset: true }).nullable(),
217
- revokeReason: userSessionRevocationReasonSchema.nullable()
218
- }).superRefine((session, context) => {
219
- const createdAt = Date.parse(session.createdAt);
220
- if (session.revokedAt === null !== (session.revokeReason === null)) {
221
- context.addIssue({
222
- code: "custom",
223
- message: "Session revocation time and reason must be present together",
224
- path: ["revokedAt"]
225
- });
226
- }
227
- if (Date.parse(session.expiresAt) <= createdAt) {
228
- context.addIssue({
229
- code: "custom",
230
- message: "Session expiry must follow creation time",
231
- path: ["expiresAt"]
232
- });
233
- }
234
- const lastSeenAt = Date.parse(session.lastSeenAt);
235
- if (lastSeenAt < createdAt || lastSeenAt > Date.parse(session.expiresAt)) {
236
- context.addIssue({
237
- code: "custom",
238
- message: "Session last-seen time must fall within its lifetime",
239
- path: ["lastSeenAt"]
240
- });
241
- }
242
- if (session.revokedAt !== null && Date.parse(session.revokedAt) < createdAt) {
243
- context.addIssue({
244
- code: "custom",
245
- message: "Session revoked time must not precede creation time",
246
- path: ["revokedAt"]
247
- });
248
- }
249
- }).readonly();
250
-
251
165
  // ../event-bus/dist/index.js
252
166
  var EVENT_PROTOCOL = "zlooks.event";
253
167
  var EVENT_PROTOCOL_VERSION = 1;
@@ -390,6 +304,92 @@ function isRecord(value) {
390
304
  return value !== null && typeof value === "object" && !Array.isArray(value);
391
305
  }
392
306
 
307
+ // ../user-shared/dist/identity.js
308
+ var USER_SERVICE_NAMESPACE = "cn.zlooks.user.server";
309
+
310
+ // ../user-shared/dist/events/snapshots.js
311
+ var userSessionRevocationReasonSchema = external_exports.enum([
312
+ "logout",
313
+ "user-request",
314
+ "family-limit",
315
+ "credential-recovery"
316
+ ]);
317
+ var displayNameSchema = external_exports.string().refine((value) => value === value.trim().normalize("NFKC"), "Display name must be normalized").refine((value) => Array.from(value).length >= 1 && Array.from(value).length <= 160, "Display name must contain 1 to 160 Unicode code points");
318
+ var bioSchema = external_exports.string().refine((value) => value === value.trim().normalize("NFKC"), "Bio must be normalized").refine((value) => Array.from(value).length >= 1 && Array.from(value).length <= 500, "Bio must contain 1 to 500 Unicode code points");
319
+ var httpUrlSchema = external_exports.url().max(2048).refine((value) => {
320
+ const protocol = new URL(value).protocol;
321
+ return protocol === "http:" || protocol === "https:";
322
+ }, "URL must use HTTP or HTTPS").refine((value) => value === new URL(value).toString(), "URL must be canonical");
323
+ var emailSchema = external_exports.email().max(320).refine((value) => value === value.toLocaleLowerCase("en-US"), "Email must be lowercase");
324
+ var userEventSnapshotSchema = external_exports.strictObject({
325
+ id: external_exports.uuid(),
326
+ displayName: displayNameSchema.nullable(),
327
+ avatar: httpUrlSchema.nullable(),
328
+ homepage: httpUrlSchema.nullable(),
329
+ bio: bioSchema.nullable(),
330
+ email: emailSchema.nullable(),
331
+ emailVerified: external_exports.boolean(),
332
+ status: external_exports.enum(["active", "disabled", "deleted"]),
333
+ createdAt: external_exports.iso.datetime({ offset: true }),
334
+ updatedAt: external_exports.iso.datetime({ offset: true }),
335
+ version: external_exports.number().int().positive()
336
+ }).superRefine((user, context) => {
337
+ if (user.emailVerified && user.email === null) {
338
+ context.addIssue({
339
+ code: "custom",
340
+ message: "A verified user snapshot must include its email",
341
+ path: ["email"]
342
+ });
343
+ }
344
+ if (Date.parse(user.updatedAt) < Date.parse(user.createdAt)) {
345
+ context.addIssue({
346
+ code: "custom",
347
+ message: "User updated time must not precede creation time",
348
+ path: ["updatedAt"]
349
+ });
350
+ }
351
+ }).readonly();
352
+ var userSessionFamilyEventSnapshotSchema = external_exports.strictObject({
353
+ id: external_exports.uuid(),
354
+ userId: external_exports.uuid(),
355
+ createdAt: external_exports.iso.datetime({ offset: true }),
356
+ expiresAt: external_exports.iso.datetime({ offset: true }),
357
+ lastSeenAt: external_exports.iso.datetime({ offset: true }),
358
+ revokedAt: external_exports.iso.datetime({ offset: true }).nullable(),
359
+ revokeReason: userSessionRevocationReasonSchema.nullable()
360
+ }).superRefine((session, context) => {
361
+ const createdAt = Date.parse(session.createdAt);
362
+ if (session.revokedAt === null !== (session.revokeReason === null)) {
363
+ context.addIssue({
364
+ code: "custom",
365
+ message: "Session revocation time and reason must be present together",
366
+ path: ["revokedAt"]
367
+ });
368
+ }
369
+ if (Date.parse(session.expiresAt) <= createdAt) {
370
+ context.addIssue({
371
+ code: "custom",
372
+ message: "Session expiry must follow creation time",
373
+ path: ["expiresAt"]
374
+ });
375
+ }
376
+ const lastSeenAt = Date.parse(session.lastSeenAt);
377
+ if (lastSeenAt < createdAt || lastSeenAt > Date.parse(session.expiresAt)) {
378
+ context.addIssue({
379
+ code: "custom",
380
+ message: "Session last-seen time must fall within its lifetime",
381
+ path: ["lastSeenAt"]
382
+ });
383
+ }
384
+ if (session.revokedAt !== null && Date.parse(session.revokedAt) < createdAt) {
385
+ context.addIssue({
386
+ code: "custom",
387
+ message: "Session revoked time must not precede creation time",
388
+ path: ["revokedAt"]
389
+ });
390
+ }
391
+ }).readonly();
392
+
393
393
  // ../user-shared/dist/events/definition.js
394
394
  function defineUserEvent(type, aggregateType2, dataSchema5, aggregateId2) {
395
395
  return defineEvent(type, dataSchema5, {
@@ -521,6 +521,7 @@ var USER_EVENT_CATALOG = defineEventCatalog({
521
521
 
522
522
  // ../user-shared/dist/index.js
523
523
  var USER_CREDENTIAL_LIFECYCLE_PROTOCOL = "zlooks.user.credential-lifecycle";
524
+ var USER_CREDENTIAL_LIFECYCLE_EVENT_TYPE = "cn.zlooks.password.credential-lifecycle.v1";
524
525
  var USER_ACCOUNT_HREF = "/user.account/account";
525
526
  var USER_BROWSER_AUTH_METHODS_PATH = browserApiPath(USER_SERVICE_NAMESPACE, "/api/auth/methods");
526
527
  var USER_BROWSER_AUTH_TRANSACTIONS_PATH = browserApiPath(USER_SERVICE_NAMESPACE, "/api/auth/transactions");
@@ -744,6 +745,11 @@ var userCredentialLifecycleEventSchema = external_exports.strictObject({
744
745
  email: external_exports.email().max(320),
745
746
  occurredAt: external_exports.iso.datetime({ offset: true })
746
747
  }).readonly();
748
+ var userCredentialLifecycleDomainEvent = defineEvent(USER_CREDENTIAL_LIFECYCLE_EVENT_TYPE, userCredentialLifecycleEventSchema, {
749
+ producer: "cn.zlooks.password.auth.server",
750
+ aggregateType: "credential",
751
+ aggregateId: ({ subject }) => subject
752
+ });
747
753
  var userCredentialLifecycleResponseSchema = external_exports.strictObject({
748
754
  acknowledged: external_exports.literal(true)
749
755
  }).readonly();
@@ -21286,10 +21286,10 @@ var require_CopyOutlined = __commonJS({
21286
21286
  }
21287
21287
  });
21288
21288
 
21289
- // ../../node_modules/.pnpm/@hile+rsc@1.0.23_react-dom@19.2.8_react@19.2.8__react@19.2.8_webpack@5.109.2_esbuild@0._018ec7a173afc56bd84b34a004a4af63/node_modules/@hile/rsc/dist/client/navigation.js
21289
+ // ../../node_modules/.pnpm/@hile+rsc@1.0.24_react-dom@19.2.8_react@19.2.8__react@19.2.8_webpack@5.109.2_esbuild@0._4a79a70f5d2c56efc9d87074da83a607/node_modules/@hile/rsc/dist/client/navigation.js
21290
21290
  init_react();
21291
21291
 
21292
- // ../../node_modules/.pnpm/@hile+rsc@1.0.23_react-dom@19.2.8_react@19.2.8__react@19.2.8_webpack@5.109.2_esbuild@0._018ec7a173afc56bd84b34a004a4af63/node_modules/@hile/rsc/dist/client/navigation-internals.js
21292
+ // ../../node_modules/.pnpm/@hile+rsc@1.0.24_react-dom@19.2.8_react@19.2.8__react@19.2.8_webpack@5.109.2_esbuild@0._4a79a70f5d2c56efc9d87074da83a607/node_modules/@hile/rsc/dist/client/navigation-internals.js
21293
21293
  function resolveRscNavigationUrl(href, currentHref) {
21294
21294
  try {
21295
21295
  const destination = new URL(href, currentHref);
@@ -21307,7 +21307,7 @@ function shouldHandleRscNavigationClick(event, anchor, currentHref) {
21307
21307
  return current !== void 0 && destination !== void 0 && destination.origin === current.origin;
21308
21308
  }
21309
21309
 
21310
- // ../../node_modules/.pnpm/@hile+rsc@1.0.23_react-dom@19.2.8_react@19.2.8__react@19.2.8_webpack@5.109.2_esbuild@0._018ec7a173afc56bd84b34a004a4af63/node_modules/@hile/rsc/dist/client/navigation-runtime.js
21310
+ // ../../node_modules/.pnpm/@hile+rsc@1.0.24_react-dom@19.2.8_react@19.2.8__react@19.2.8_webpack@5.109.2_esbuild@0._4a79a70f5d2c56efc9d87074da83a607/node_modules/@hile/rsc/dist/client/navigation-runtime.js
21311
21311
  var runtimeStateKey = /* @__PURE__ */ Symbol.for("@hile/rsc/client/navigation/runtime");
21312
21312
  function runtimeState() {
21313
21313
  const scope = globalThis;
@@ -21317,7 +21317,7 @@ function getRscNavigationRuntime() {
21317
21317
  return runtimeState().installations.at(-1)?.navigation;
21318
21318
  }
21319
21319
 
21320
- // ../../node_modules/.pnpm/@hile+rsc@1.0.23_react-dom@19.2.8_react@19.2.8__react@19.2.8_webpack@5.109.2_esbuild@0._018ec7a173afc56bd84b34a004a4af63/node_modules/@hile/rsc/dist/client/navigation.js
21320
+ // ../../node_modules/.pnpm/@hile+rsc@1.0.24_react-dom@19.2.8_react@19.2.8__react@19.2.8_webpack@5.109.2_esbuild@0._4a79a70f5d2c56efc9d87074da83a607/node_modules/@hile/rsc/dist/client/navigation.js
21321
21321
  function browserLocation() {
21322
21322
  return typeof window === "undefined" ? void 0 : window.location;
21323
21323
  }
@@ -21375,7 +21375,51 @@ var browserNavigation = Object.freeze({
21375
21375
  function useRscNavigation() {
21376
21376
  return browserNavigation;
21377
21377
  }
21378
- var RscLink = forwardRef(function RscLink2({ href, replace = false, scroll, target, download, onClick, ...props }, ref) {
21378
+ function shouldPrefetchRscNavigation(href, currentHref) {
21379
+ const current = resolveRscNavigationUrl(currentHref, currentHref);
21380
+ const destination = resolveRscNavigationUrl(href, currentHref);
21381
+ return current !== void 0 && destination !== void 0 && destination.origin === current.origin;
21382
+ }
21383
+ function prefetchDeclaredRscRoute(navigation, href, currentHref) {
21384
+ return shouldPrefetchRscNavigation(href, currentHref) && navigation.prefetchRoute?.(href) === true;
21385
+ }
21386
+ function assignRef(ref, value) {
21387
+ if (typeof ref === "function")
21388
+ ref(value);
21389
+ else if (ref)
21390
+ ref.current = value;
21391
+ }
21392
+ var RscLink = forwardRef(function RscLink2({ href, replace = false, scroll, prefetch = false, target, download, onClick, onFocus, onPointerEnter, ...props }, ref) {
21393
+ const anchorRef = useRef(null);
21394
+ const prefetchedHref = useRef(void 0);
21395
+ const setAnchorRef = useCallback((node) => {
21396
+ anchorRef.current = node;
21397
+ assignRef(ref, node);
21398
+ }, [ref]);
21399
+ const triggerPrefetch = useCallback(() => {
21400
+ const location = browserLocation();
21401
+ const navigation = installedNavigation();
21402
+ if (!location || !navigation || prefetchedHref.current === href || !shouldPrefetchRscNavigation(href, location.href)) {
21403
+ return false;
21404
+ }
21405
+ if (!prefetchDeclaredRscRoute(navigation, href, location.href))
21406
+ return false;
21407
+ prefetchedHref.current = href;
21408
+ return true;
21409
+ }, [href]);
21410
+ useEffect(() => {
21411
+ if (prefetch !== "viewport" || typeof IntersectionObserver === "undefined" || !anchorRef.current) {
21412
+ return;
21413
+ }
21414
+ const observer = new IntersectionObserver((entries) => {
21415
+ if (entries.some(({ isIntersecting }) => isIntersecting)) {
21416
+ if (triggerPrefetch())
21417
+ observer.disconnect();
21418
+ }
21419
+ });
21420
+ observer.observe(anchorRef.current);
21421
+ return () => observer.disconnect();
21422
+ }, [prefetch, triggerPrefetch]);
21379
21423
  function handleClick(event) {
21380
21424
  onClick?.(event);
21381
21425
  if (typeof window === "undefined" || !shouldHandleRscNavigationClick(event, { href, target, download }, window.location.href)) {
@@ -21391,13 +21435,25 @@ var RscLink = forwardRef(function RscLink2({ href, replace = false, scroll, targ
21391
21435
  else
21392
21436
  navigation.push(href, options);
21393
21437
  }
21438
+ function handleFocus(event) {
21439
+ onFocus?.(event);
21440
+ if (prefetch === "intent" && !event.defaultPrevented)
21441
+ triggerPrefetch();
21442
+ }
21443
+ function handlePointerEnter(event) {
21444
+ onPointerEnter?.(event);
21445
+ if (prefetch === "intent" && !event.defaultPrevented)
21446
+ triggerPrefetch();
21447
+ }
21394
21448
  return react_default.createElement("a", {
21395
21449
  ...props,
21396
- ref,
21450
+ ref: setAnchorRef,
21397
21451
  href,
21398
21452
  target,
21399
21453
  download,
21400
- onClick: handleClick
21454
+ onClick: handleClick,
21455
+ onFocus: handleFocus,
21456
+ onPointerEnter: handlePointerEnter
21401
21457
  });
21402
21458
  });
21403
21459
 
@@ -54,7 +54,7 @@ import {
54
54
  useState,
55
55
  useSyncExternalStore,
56
56
  useZlooksApp
57
- } from "./chunks/chunk-CO2NBEJ7.js";
57
+ } from "./chunks/chunk-EWBYMJX4.js";
58
58
 
59
59
  // ../../node_modules/.pnpm/antd@6.6.1_luxon@3.7.2_moment@2.30.1_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/antd/es/app/App.js
60
60
  init_react();
@@ -74,7 +74,7 @@ import {
74
74
  useRequest,
75
75
  useRscNavigation,
76
76
  useState
77
- } from "./chunks/chunk-CO2NBEJ7.js";
77
+ } from "./chunks/chunk-EWBYMJX4.js";
78
78
 
79
79
  // ../../node_modules/.pnpm/antd@6.6.1_luxon@3.7.2_moment@2.30.1_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/antd/lib/_util/getReactMajorVersionCanDelMe.js
80
80
  var require_getReactMajorVersionCanDelMe = __commonJS({
@@ -119703,92 +119703,6 @@ var require_lib48 = __commonJS({
119703
119703
  }
119704
119704
  });
119705
119705
 
119706
- // ../user-shared/dist/identity.js
119707
- var USER_SERVICE_NAMESPACE = "cn.zlooks.user.server";
119708
-
119709
- // ../user-shared/dist/events/snapshots.js
119710
- var userSessionRevocationReasonSchema = external_exports.enum([
119711
- "logout",
119712
- "user-request",
119713
- "family-limit",
119714
- "credential-recovery"
119715
- ]);
119716
- var displayNameSchema = external_exports.string().refine((value) => value === value.trim().normalize("NFKC"), "Display name must be normalized").refine((value) => Array.from(value).length >= 1 && Array.from(value).length <= 160, "Display name must contain 1 to 160 Unicode code points");
119717
- var bioSchema = external_exports.string().refine((value) => value === value.trim().normalize("NFKC"), "Bio must be normalized").refine((value) => Array.from(value).length >= 1 && Array.from(value).length <= 500, "Bio must contain 1 to 500 Unicode code points");
119718
- var httpUrlSchema = external_exports.url().max(2048).refine((value) => {
119719
- const protocol = new URL(value).protocol;
119720
- return protocol === "http:" || protocol === "https:";
119721
- }, "URL must use HTTP or HTTPS").refine((value) => value === new URL(value).toString(), "URL must be canonical");
119722
- var emailSchema = external_exports.email().max(320).refine((value) => value === value.toLocaleLowerCase("en-US"), "Email must be lowercase");
119723
- var userEventSnapshotSchema = external_exports.strictObject({
119724
- id: external_exports.uuid(),
119725
- displayName: displayNameSchema.nullable(),
119726
- avatar: httpUrlSchema.nullable(),
119727
- homepage: httpUrlSchema.nullable(),
119728
- bio: bioSchema.nullable(),
119729
- email: emailSchema.nullable(),
119730
- emailVerified: external_exports.boolean(),
119731
- status: external_exports.enum(["active", "disabled", "deleted"]),
119732
- createdAt: external_exports.iso.datetime({ offset: true }),
119733
- updatedAt: external_exports.iso.datetime({ offset: true }),
119734
- version: external_exports.number().int().positive()
119735
- }).superRefine((user, context) => {
119736
- if (user.emailVerified && user.email === null) {
119737
- context.addIssue({
119738
- code: "custom",
119739
- message: "A verified user snapshot must include its email",
119740
- path: ["email"]
119741
- });
119742
- }
119743
- if (Date.parse(user.updatedAt) < Date.parse(user.createdAt)) {
119744
- context.addIssue({
119745
- code: "custom",
119746
- message: "User updated time must not precede creation time",
119747
- path: ["updatedAt"]
119748
- });
119749
- }
119750
- }).readonly();
119751
- var userSessionFamilyEventSnapshotSchema = external_exports.strictObject({
119752
- id: external_exports.uuid(),
119753
- userId: external_exports.uuid(),
119754
- createdAt: external_exports.iso.datetime({ offset: true }),
119755
- expiresAt: external_exports.iso.datetime({ offset: true }),
119756
- lastSeenAt: external_exports.iso.datetime({ offset: true }),
119757
- revokedAt: external_exports.iso.datetime({ offset: true }).nullable(),
119758
- revokeReason: userSessionRevocationReasonSchema.nullable()
119759
- }).superRefine((session, context) => {
119760
- const createdAt = Date.parse(session.createdAt);
119761
- if (session.revokedAt === null !== (session.revokeReason === null)) {
119762
- context.addIssue({
119763
- code: "custom",
119764
- message: "Session revocation time and reason must be present together",
119765
- path: ["revokedAt"]
119766
- });
119767
- }
119768
- if (Date.parse(session.expiresAt) <= createdAt) {
119769
- context.addIssue({
119770
- code: "custom",
119771
- message: "Session expiry must follow creation time",
119772
- path: ["expiresAt"]
119773
- });
119774
- }
119775
- const lastSeenAt = Date.parse(session.lastSeenAt);
119776
- if (lastSeenAt < createdAt || lastSeenAt > Date.parse(session.expiresAt)) {
119777
- context.addIssue({
119778
- code: "custom",
119779
- message: "Session last-seen time must fall within its lifetime",
119780
- path: ["lastSeenAt"]
119781
- });
119782
- }
119783
- if (session.revokedAt !== null && Date.parse(session.revokedAt) < createdAt) {
119784
- context.addIssue({
119785
- code: "custom",
119786
- message: "Session revoked time must not precede creation time",
119787
- path: ["revokedAt"]
119788
- });
119789
- }
119790
- }).readonly();
119791
-
119792
119706
  // ../event-bus/dist/index.js
119793
119707
  var EVENT_PROTOCOL = "zlooks.event";
119794
119708
  var EVENT_PROTOCOL_VERSION = 1;
@@ -119931,6 +119845,92 @@ function isRecord(value) {
119931
119845
  return value !== null && typeof value === "object" && !Array.isArray(value);
119932
119846
  }
119933
119847
 
119848
+ // ../user-shared/dist/identity.js
119849
+ var USER_SERVICE_NAMESPACE = "cn.zlooks.user.server";
119850
+
119851
+ // ../user-shared/dist/events/snapshots.js
119852
+ var userSessionRevocationReasonSchema = external_exports.enum([
119853
+ "logout",
119854
+ "user-request",
119855
+ "family-limit",
119856
+ "credential-recovery"
119857
+ ]);
119858
+ var displayNameSchema = external_exports.string().refine((value) => value === value.trim().normalize("NFKC"), "Display name must be normalized").refine((value) => Array.from(value).length >= 1 && Array.from(value).length <= 160, "Display name must contain 1 to 160 Unicode code points");
119859
+ var bioSchema = external_exports.string().refine((value) => value === value.trim().normalize("NFKC"), "Bio must be normalized").refine((value) => Array.from(value).length >= 1 && Array.from(value).length <= 500, "Bio must contain 1 to 500 Unicode code points");
119860
+ var httpUrlSchema = external_exports.url().max(2048).refine((value) => {
119861
+ const protocol = new URL(value).protocol;
119862
+ return protocol === "http:" || protocol === "https:";
119863
+ }, "URL must use HTTP or HTTPS").refine((value) => value === new URL(value).toString(), "URL must be canonical");
119864
+ var emailSchema = external_exports.email().max(320).refine((value) => value === value.toLocaleLowerCase("en-US"), "Email must be lowercase");
119865
+ var userEventSnapshotSchema = external_exports.strictObject({
119866
+ id: external_exports.uuid(),
119867
+ displayName: displayNameSchema.nullable(),
119868
+ avatar: httpUrlSchema.nullable(),
119869
+ homepage: httpUrlSchema.nullable(),
119870
+ bio: bioSchema.nullable(),
119871
+ email: emailSchema.nullable(),
119872
+ emailVerified: external_exports.boolean(),
119873
+ status: external_exports.enum(["active", "disabled", "deleted"]),
119874
+ createdAt: external_exports.iso.datetime({ offset: true }),
119875
+ updatedAt: external_exports.iso.datetime({ offset: true }),
119876
+ version: external_exports.number().int().positive()
119877
+ }).superRefine((user, context) => {
119878
+ if (user.emailVerified && user.email === null) {
119879
+ context.addIssue({
119880
+ code: "custom",
119881
+ message: "A verified user snapshot must include its email",
119882
+ path: ["email"]
119883
+ });
119884
+ }
119885
+ if (Date.parse(user.updatedAt) < Date.parse(user.createdAt)) {
119886
+ context.addIssue({
119887
+ code: "custom",
119888
+ message: "User updated time must not precede creation time",
119889
+ path: ["updatedAt"]
119890
+ });
119891
+ }
119892
+ }).readonly();
119893
+ var userSessionFamilyEventSnapshotSchema = external_exports.strictObject({
119894
+ id: external_exports.uuid(),
119895
+ userId: external_exports.uuid(),
119896
+ createdAt: external_exports.iso.datetime({ offset: true }),
119897
+ expiresAt: external_exports.iso.datetime({ offset: true }),
119898
+ lastSeenAt: external_exports.iso.datetime({ offset: true }),
119899
+ revokedAt: external_exports.iso.datetime({ offset: true }).nullable(),
119900
+ revokeReason: userSessionRevocationReasonSchema.nullable()
119901
+ }).superRefine((session, context) => {
119902
+ const createdAt = Date.parse(session.createdAt);
119903
+ if (session.revokedAt === null !== (session.revokeReason === null)) {
119904
+ context.addIssue({
119905
+ code: "custom",
119906
+ message: "Session revocation time and reason must be present together",
119907
+ path: ["revokedAt"]
119908
+ });
119909
+ }
119910
+ if (Date.parse(session.expiresAt) <= createdAt) {
119911
+ context.addIssue({
119912
+ code: "custom",
119913
+ message: "Session expiry must follow creation time",
119914
+ path: ["expiresAt"]
119915
+ });
119916
+ }
119917
+ const lastSeenAt = Date.parse(session.lastSeenAt);
119918
+ if (lastSeenAt < createdAt || lastSeenAt > Date.parse(session.expiresAt)) {
119919
+ context.addIssue({
119920
+ code: "custom",
119921
+ message: "Session last-seen time must fall within its lifetime",
119922
+ path: ["lastSeenAt"]
119923
+ });
119924
+ }
119925
+ if (session.revokedAt !== null && Date.parse(session.revokedAt) < createdAt) {
119926
+ context.addIssue({
119927
+ code: "custom",
119928
+ message: "Session revoked time must not precede creation time",
119929
+ path: ["revokedAt"]
119930
+ });
119931
+ }
119932
+ }).readonly();
119933
+
119934
119934
  // ../user-shared/dist/events/definition.js
119935
119935
  function defineUserEvent(type, aggregateType2, dataSchema5, aggregateId2) {
119936
119936
  return defineEvent(type, dataSchema5, {
@@ -120062,6 +120062,7 @@ var USER_EVENT_CATALOG = defineEventCatalog({
120062
120062
 
120063
120063
  // ../user-shared/dist/index.js
120064
120064
  var USER_CREDENTIAL_LIFECYCLE_PROTOCOL = "zlooks.user.credential-lifecycle";
120065
+ var USER_CREDENTIAL_LIFECYCLE_EVENT_TYPE = "cn.zlooks.password.credential-lifecycle.v1";
120065
120066
  var USER_ACCOUNT_HREF = "/user.account/account";
120066
120067
  var USER_BROWSER_AUTH_METHODS_PATH = browserApiPath(USER_SERVICE_NAMESPACE, "/api/auth/methods");
120067
120068
  var USER_BROWSER_AUTH_TRANSACTIONS_PATH = browserApiPath(USER_SERVICE_NAMESPACE, "/api/auth/transactions");
@@ -120285,6 +120286,11 @@ var userCredentialLifecycleEventSchema = external_exports.strictObject({
120285
120286
  email: external_exports.email().max(320),
120286
120287
  occurredAt: external_exports.iso.datetime({ offset: true })
120287
120288
  }).readonly();
120289
+ var userCredentialLifecycleDomainEvent = defineEvent(USER_CREDENTIAL_LIFECYCLE_EVENT_TYPE, userCredentialLifecycleEventSchema, {
120290
+ producer: "cn.zlooks.password.auth.server",
120291
+ aggregateType: "credential",
120292
+ aggregateId: ({ subject }) => subject
120293
+ });
120288
120294
  var userCredentialLifecycleResponseSchema = external_exports.strictObject({
120289
120295
  acknowledged: external_exports.literal(true)
120290
120296
  }).readonly();