@zlooks.cn/password-auth-server 1.0.3 → 1.0.5
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/.hile-rsc/{build-mtsn68qv-a841a566/client-browser/chunks/chunk-CZF5VGOJ.js → build-mtwvmb9w-8d24cd70/client-browser/chunks/chunk-Q4E7K4YZ.js} +22 -70
- package/.hile-rsc/{build-mtsn68qv-a841a566/client-browser/src-plugin-page-frame-07c4de56a6-C2WHPDGD.js → build-mtwvmb9w-8d24cd70/client-browser/src-plugin-page-frame-07c4de56a6-3RB2NF7F.js} +1 -1
- package/.hile-rsc/{build-mtsn68qv-a841a566/client-browser/src-plugin-password-form-3bd63d69e5-G5UQAB5W.js → build-mtwvmb9w-8d24cd70/client-browser/src-plugin-password-form-3bd63d69e5-LHEMP4OP.js} +388 -134
- package/.hile-rsc/{build-mtsn68qv-a841a566/client-ssr/chunks/chunk-RMKQVF3F.js → build-mtwvmb9w-8d24cd70/client-ssr/chunks/chunk-IR7T4YHX.js} +21 -69
- package/.hile-rsc/{build-mtsn68qv-a841a566/client-ssr/src-plugin-page-frame-07c4de56a6-ICZZGKBP.js → build-mtwvmb9w-8d24cd70/client-ssr/src-plugin-page-frame-07c4de56a6-5ALGD76V.js} +1 -1
- package/.hile-rsc/{build-mtsn68qv-a841a566/client-ssr/src-plugin-password-form-3bd63d69e5-UV3K6EC6.js → build-mtwvmb9w-8d24cd70/client-ssr/src-plugin-password-form-3bd63d69e5-TF7ZOD75.js} +593 -339
- package/.hile-rsc/{build-mtsn68qv-a841a566 → build-mtwvmb9w-8d24cd70}/plugin.json +18 -18
- package/.hile-rsc/{build-mtsn68qv-a841a566 → build-mtwvmb9w-8d24cd70}/server-rsc/index.js +308 -156
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/config/schema.js +37 -6
- package/dist/config/schema.js.map +1 -1
- package/dist/messages/auth-extension/begin.msg.js +6 -5
- package/dist/messages/auth-extension/begin.msg.js.map +1 -1
- package/dist/messages/auth-extension/complete.msg.js +6 -5
- package/dist/messages/auth-extension/complete.msg.js.map +1 -1
- package/dist/models/begin-authentication.model.d.ts +22 -0
- package/dist/models/begin-authentication.model.d.ts.map +1 -0
- package/dist/models/begin-authentication.model.js +13 -0
- package/dist/models/begin-authentication.model.js.map +1 -0
- package/dist/models/complete-authentication.model.d.ts +35 -0
- package/dist/models/complete-authentication.model.d.ts.map +1 -0
- package/dist/models/complete-authentication.model.js +13 -0
- package/dist/models/complete-authentication.model.js.map +1 -0
- package/dist/runtime/password-state-store.d.ts.map +1 -1
- package/dist/runtime/password-state-store.js +23 -10
- package/dist/runtime/password-state-store.js.map +1 -1
- package/package.json +26 -25
- /package/.hile-rsc/{build-mtsn68qv-a841a566 → build-mtwvmb9w-8d24cd70}/client-browser/src-plugin-page-frame-07c4de56a6-3F24AYCH.css +0 -0
- /package/.hile-rsc/{build-mtsn68qv-a841a566 → build-mtwvmb9w-8d24cd70}/client-browser/src-plugin-password-form-3bd63d69e5-TRYMJX4F.css +0 -0
- /package/.hile-rsc/{build-mtsn68qv-a841a566 → build-mtwvmb9w-8d24cd70}/styles/4b3193c4f2b317ffed425ccf401342a4bdd6ccfd5f9c42def3315e776f166975.css +0 -0
|
@@ -27,12 +27,11 @@ import {
|
|
|
27
27
|
RscLink,
|
|
28
28
|
SizeContext_default,
|
|
29
29
|
TextArea_default,
|
|
30
|
-
USER_SESSION_COOKIE,
|
|
31
30
|
VariantContext,
|
|
32
31
|
__commonJS,
|
|
33
32
|
__toESM,
|
|
34
33
|
_toConsumableArray,
|
|
35
|
-
|
|
34
|
+
browserApiPath,
|
|
36
35
|
browserApiResponseSchema,
|
|
37
36
|
cloneElement,
|
|
38
37
|
clsx,
|
|
@@ -121,7 +120,7 @@ import {
|
|
|
121
120
|
version,
|
|
122
121
|
warning_default,
|
|
123
122
|
zoomIn
|
|
124
|
-
} from "./chunks/chunk-
|
|
123
|
+
} from "./chunks/chunk-Q4E7K4YZ.js";
|
|
125
124
|
|
|
126
125
|
// ../../node_modules/.pnpm/@ant-design+icons-svg@4.5.0/node_modules/@ant-design/icons-svg/lib/asn/SearchOutlined.js
|
|
127
126
|
var require_SearchOutlined = __commonJS({
|
|
@@ -254,6 +253,12 @@ var eventType = external_exports.string().max(256).regex(/^[a-z][a-z0-9]*(?:\.[a
|
|
|
254
253
|
var serviceNamespace = external_exports.string().max(256).regex(/^[a-z][a-z0-9]*(?:\.[a-z][a-z0-9]*)+$/);
|
|
255
254
|
var aggregateType = external_exports.string().regex(/^[a-z][a-z0-9-]{0,63}$/);
|
|
256
255
|
var aggregateId = external_exports.string().trim().min(1).max(256);
|
|
256
|
+
var providerId = external_exports.string().max(128).regex(/^[a-z][a-z0-9]*(?:[._-][a-z0-9]+)*$/);
|
|
257
|
+
var contractPackage = external_exports.string().max(128).regex(/^@zlooks\.cn\/[a-z0-9]+(?:-[a-z0-9]+)*$/);
|
|
258
|
+
var exportName = external_exports.string().max(128).regex(/^[A-Za-z_$][A-Za-z0-9_$]*$/);
|
|
259
|
+
var title = external_exports.string().trim().min(1).max(120);
|
|
260
|
+
var description = external_exports.string().trim().min(1).max(1e3);
|
|
261
|
+
var jsonValueSchema = external_exports.json();
|
|
257
262
|
var eventEnvelopeSchema = external_exports.strictObject({
|
|
258
263
|
protocol: external_exports.literal("zlooks.event"),
|
|
259
264
|
protocolVersion: external_exports.literal(1),
|
|
@@ -265,42 +270,130 @@ var eventEnvelopeSchema = external_exports.strictObject({
|
|
|
265
270
|
id: aggregateId
|
|
266
271
|
}).readonly(),
|
|
267
272
|
occurredAt: external_exports.iso.datetime({ offset: true }),
|
|
268
|
-
data:
|
|
273
|
+
data: jsonValueSchema
|
|
269
274
|
}).readonly();
|
|
270
|
-
function
|
|
275
|
+
function parseDomainEvent(input) {
|
|
276
|
+
const envelope = eventEnvelopeSchema.parse(input);
|
|
277
|
+
return Object.freeze({
|
|
278
|
+
...envelope,
|
|
279
|
+
aggregate: Object.freeze({ ...envelope.aggregate })
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
function defineEvent(type, dataSchema5, options) {
|
|
271
283
|
const parsedType = eventType.parse(type);
|
|
284
|
+
const producer = serviceNamespace.parse(options.producer);
|
|
285
|
+
const parsedAggregateType = aggregateType.parse(options.aggregateType);
|
|
286
|
+
const selectAggregateId = options.aggregateId;
|
|
287
|
+
if (typeof selectAggregateId !== "function")
|
|
288
|
+
throw new TypeError("Event aggregateId must be a function");
|
|
272
289
|
return Object.freeze({
|
|
273
290
|
type: parsedType,
|
|
291
|
+
producer,
|
|
292
|
+
aggregateType: parsedAggregateType,
|
|
293
|
+
dataSchema: dataSchema5,
|
|
274
294
|
parse(value) {
|
|
275
|
-
const envelope =
|
|
295
|
+
const envelope = parseDomainEvent(value);
|
|
276
296
|
if (envelope.type !== parsedType) {
|
|
277
297
|
throw new TypeError(`Expected event type ${parsedType}`);
|
|
278
298
|
}
|
|
299
|
+
if (envelope.producer !== producer) {
|
|
300
|
+
throw new TypeError(`Expected event producer ${producer}`);
|
|
301
|
+
}
|
|
302
|
+
const data = dataSchema5.parse(envelope.data);
|
|
303
|
+
jsonValueSchema.parse(data);
|
|
304
|
+
const expectedAggregateId = aggregateId.parse(selectAggregateId(data));
|
|
305
|
+
if (envelope.aggregate.type !== parsedAggregateType || envelope.aggregate.id !== expectedAggregateId) {
|
|
306
|
+
throw new TypeError(`${parsedType} aggregate does not identify its event data`);
|
|
307
|
+
}
|
|
279
308
|
return Object.freeze({
|
|
280
309
|
...envelope,
|
|
281
310
|
type: parsedType,
|
|
282
311
|
aggregate: Object.freeze({ ...envelope.aggregate }),
|
|
283
|
-
data
|
|
312
|
+
data
|
|
284
313
|
});
|
|
285
314
|
}
|
|
286
315
|
});
|
|
287
316
|
}
|
|
317
|
+
function defineEventCatalog(input) {
|
|
318
|
+
const parsedProviderId = providerId.parse(input.providerId);
|
|
319
|
+
const parsedDisplayName = title.parse(input.displayName);
|
|
320
|
+
const parsedContractPackage = contractPackage.parse(input.contractPackage);
|
|
321
|
+
if (input.events.length === 0 || input.events.length > 256) {
|
|
322
|
+
throw new TypeError("Event catalog must contain between 1 and 256 events");
|
|
323
|
+
}
|
|
324
|
+
const producer = input.events[0].definition.producer;
|
|
325
|
+
const eventTypes = /* @__PURE__ */ new Set();
|
|
326
|
+
const consumerExports = /* @__PURE__ */ new Set();
|
|
327
|
+
const events = input.events.map((entry) => {
|
|
328
|
+
if (entry.definition.producer !== producer) {
|
|
329
|
+
throw new TypeError("Event catalog definitions must have one producer");
|
|
330
|
+
}
|
|
331
|
+
if (eventTypes.has(entry.definition.type)) {
|
|
332
|
+
throw new TypeError("Event catalog event types must be unique");
|
|
333
|
+
}
|
|
334
|
+
const parsedConsumerExport = exportName.parse(entry.consumerExport);
|
|
335
|
+
if (consumerExports.has(parsedConsumerExport)) {
|
|
336
|
+
throw new TypeError("Event catalog Consumer exports must be unique");
|
|
337
|
+
}
|
|
338
|
+
eventTypes.add(entry.definition.type);
|
|
339
|
+
consumerExports.add(parsedConsumerExport);
|
|
340
|
+
const dataSchema5 = immutableJson(external_exports.toJSONSchema(entry.definition.dataSchema, {
|
|
341
|
+
target: "draft-2020-12",
|
|
342
|
+
unrepresentable: "any",
|
|
343
|
+
io: "input"
|
|
344
|
+
}));
|
|
345
|
+
if (!isJsonObject(dataSchema5))
|
|
346
|
+
throw new TypeError("Event data schema must serialize to a JSON object");
|
|
347
|
+
return Object.freeze({
|
|
348
|
+
type: entry.definition.type,
|
|
349
|
+
title: title.parse(entry.title),
|
|
350
|
+
description: description.parse(entry.description),
|
|
351
|
+
producer,
|
|
352
|
+
aggregateType: entry.definition.aggregateType,
|
|
353
|
+
consumer: Object.freeze({
|
|
354
|
+
packageName: parsedContractPackage,
|
|
355
|
+
exportName: parsedConsumerExport
|
|
356
|
+
}),
|
|
357
|
+
dataSchema: dataSchema5
|
|
358
|
+
});
|
|
359
|
+
});
|
|
360
|
+
return Object.freeze({
|
|
361
|
+
protocol: "zlooks.event-catalog",
|
|
362
|
+
protocolVersion: 1,
|
|
363
|
+
providerId: parsedProviderId,
|
|
364
|
+
displayName: parsedDisplayName,
|
|
365
|
+
producer,
|
|
366
|
+
contractPackage: parsedContractPackage,
|
|
367
|
+
count: events.length,
|
|
368
|
+
delivery: Object.freeze({ guarantee: "at-least-once", deduplicateBy: "eventId" }),
|
|
369
|
+
events: Object.freeze(events)
|
|
370
|
+
});
|
|
371
|
+
}
|
|
372
|
+
function immutableJson(value) {
|
|
373
|
+
if (value === null || typeof value === "string" || typeof value === "boolean")
|
|
374
|
+
return value;
|
|
375
|
+
if (typeof value === "number" && Number.isFinite(value))
|
|
376
|
+
return value;
|
|
377
|
+
if (Array.isArray(value))
|
|
378
|
+
return Object.freeze(value.map(immutableJson));
|
|
379
|
+
if (isRecord(value)) {
|
|
380
|
+
return Object.freeze(Object.fromEntries(Object.entries(value).filter(([, item]) => item !== void 0).map(([key, item]) => [key, immutableJson(item)])));
|
|
381
|
+
}
|
|
382
|
+
throw new TypeError("Event JSON Schema contains a non-JSON value");
|
|
383
|
+
}
|
|
384
|
+
function isJsonObject(value) {
|
|
385
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
386
|
+
}
|
|
387
|
+
function isRecord(value) {
|
|
388
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
389
|
+
}
|
|
288
390
|
|
|
289
391
|
// ../user-shared/dist/events/definition.js
|
|
290
392
|
function defineUserEvent(type, aggregateType2, dataSchema5, aggregateId2) {
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
const event = base.parse(input);
|
|
296
|
-
if (event.producer !== USER_SERVICE_NAMESPACE) {
|
|
297
|
-
throw new TypeError(`Expected event producer ${USER_SERVICE_NAMESPACE}`);
|
|
298
|
-
}
|
|
299
|
-
if (event.aggregate.type !== aggregateType2 || event.aggregate.id !== aggregateId2(event.data)) {
|
|
300
|
-
throw new TypeError(`${type} aggregate does not identify its event data`);
|
|
301
|
-
}
|
|
302
|
-
return event;
|
|
303
|
-
}
|
|
393
|
+
return defineEvent(type, dataSchema5, {
|
|
394
|
+
producer: USER_SERVICE_NAMESPACE,
|
|
395
|
+
aggregateType: aggregateType2,
|
|
396
|
+
aggregateId: aggregateId2
|
|
304
397
|
});
|
|
305
398
|
}
|
|
306
399
|
|
|
@@ -385,55 +478,53 @@ var dataSchema4 = external_exports.strictObject({
|
|
|
385
478
|
}).readonly();
|
|
386
479
|
var userSessionRevokedEvent = defineUserEvent(USER_SESSION_REVOKED_EVENT_TYPE, "session-family", dataSchema4, (data) => data.sessionFamily.id);
|
|
387
480
|
|
|
481
|
+
// ../user-shared/dist/events/catalog.js
|
|
482
|
+
var USER_EVENT_CATALOG = defineEventCatalog({
|
|
483
|
+
providerId: "user",
|
|
484
|
+
displayName: "\u7528\u6237\u670D\u52A1\u4E8B\u4EF6",
|
|
485
|
+
contractPackage: "@zlooks.cn/user-shared",
|
|
486
|
+
events: [
|
|
487
|
+
{
|
|
488
|
+
definition: userRegisteredEvent,
|
|
489
|
+
title: "\u7528\u6237\u5DF2\u6CE8\u518C",
|
|
490
|
+
description: "\u7528\u6237\u8D26\u6237\u5DF2\u7ECF\u5B8C\u6210\u6301\u4E45\u5316\u521B\u5EFA\u5E76\u5904\u4E8E\u53EF\u7528\u72B6\u6001\u3002",
|
|
491
|
+
consumerExport: "consumeUserRegisteredEvent"
|
|
492
|
+
},
|
|
493
|
+
{
|
|
494
|
+
definition: userEmailVerifiedEvent,
|
|
495
|
+
title: "\u7528\u6237\u90AE\u7BB1\u5DF2\u9A8C\u8BC1",
|
|
496
|
+
description: "\u7528\u6237\u90AE\u7BB1\u4ECE\u672A\u9A8C\u8BC1\u72B6\u6001\u771F\u5B9E\u8F6C\u6362\u4E3A\u5DF2\u9A8C\u8BC1\u72B6\u6001\u3002",
|
|
497
|
+
consumerExport: "consumeUserEmailVerifiedEvent"
|
|
498
|
+
},
|
|
499
|
+
{
|
|
500
|
+
definition: userProfileUpdatedEvent,
|
|
501
|
+
title: "\u7528\u6237\u8D44\u6599\u5DF2\u66F4\u65B0",
|
|
502
|
+
description: "\u7528\u6237\u516C\u5F00\u8D44\u6599\u5B57\u6BB5\u53D1\u751F\u771F\u5B9E\u53D8\u5316\u5E76\u643A\u5E26\u53D8\u66F4\u540E\u7684\u5B8C\u6574\u5B89\u5168\u5FEB\u7167\u3002",
|
|
503
|
+
consumerExport: "consumeUserProfileUpdatedEvent"
|
|
504
|
+
},
|
|
505
|
+
{
|
|
506
|
+
definition: userSessionCreatedEvent,
|
|
507
|
+
title: "\u7528\u6237\u4F1A\u8BDD\u65CF\u5DF2\u521B\u5EFA",
|
|
508
|
+
description: "\u767B\u5F55\u3001\u6CE8\u518C\u6216\u6062\u590D\u6D41\u7A0B\u5DF2\u7ECF\u521B\u5EFA\u4E00\u4E2A\u65B0\u7684\u6D3B\u52A8\u4F1A\u8BDD\u65CF\u3002",
|
|
509
|
+
consumerExport: "consumeUserSessionCreatedEvent"
|
|
510
|
+
},
|
|
511
|
+
{
|
|
512
|
+
definition: userSessionRevokedEvent,
|
|
513
|
+
title: "\u7528\u6237\u4F1A\u8BDD\u65CF\u5DF2\u64A4\u9500",
|
|
514
|
+
description: "\u7528\u6237\u4F1A\u8BDD\u65CF\u4ECE\u6D3B\u52A8\u72B6\u6001\u771F\u5B9E\u8F6C\u6362\u4E3A\u5DF2\u64A4\u9500\u72B6\u6001\u3002",
|
|
515
|
+
consumerExport: "consumeUserSessionRevokedEvent"
|
|
516
|
+
}
|
|
517
|
+
]
|
|
518
|
+
});
|
|
519
|
+
|
|
388
520
|
// ../user-shared/dist/index.js
|
|
389
|
-
var USER_BROWSER_API_PUBLIC_ROUTES = Object.freeze([
|
|
390
|
-
Object.freeze({
|
|
391
|
-
exact: "/api/auth/methods",
|
|
392
|
-
methods: Object.freeze(["GET"]),
|
|
393
|
-
forwardCookieNames: Object.freeze([])
|
|
394
|
-
}),
|
|
395
|
-
Object.freeze({
|
|
396
|
-
exact: "/api/user/shell",
|
|
397
|
-
methods: Object.freeze(["GET"]),
|
|
398
|
-
forwardCookieNames: Object.freeze([USER_SESSION_COOKIE])
|
|
399
|
-
}),
|
|
400
|
-
Object.freeze({
|
|
401
|
-
exact: "/api/user",
|
|
402
|
-
methods: Object.freeze(["GET", "PATCH"]),
|
|
403
|
-
forwardCookieNames: Object.freeze([USER_SESSION_COOKIE])
|
|
404
|
-
}),
|
|
405
|
-
Object.freeze({
|
|
406
|
-
exact: "/api/user/sessions",
|
|
407
|
-
methods: Object.freeze(["GET"]),
|
|
408
|
-
forwardCookieNames: Object.freeze([USER_SESSION_COOKIE])
|
|
409
|
-
}),
|
|
410
|
-
Object.freeze({
|
|
411
|
-
exact: "/api/auth/transactions",
|
|
412
|
-
methods: Object.freeze(["POST"]),
|
|
413
|
-
forwardCookieNames: Object.freeze([])
|
|
414
|
-
}),
|
|
415
|
-
Object.freeze({
|
|
416
|
-
prefix: "/api/auth/transactions/",
|
|
417
|
-
methods: Object.freeze(["POST"]),
|
|
418
|
-
forwardCookieNames: Object.freeze([])
|
|
419
|
-
}),
|
|
420
|
-
Object.freeze({
|
|
421
|
-
exact: "/api/auth/logout",
|
|
422
|
-
methods: Object.freeze(["POST"]),
|
|
423
|
-
forwardCookieNames: Object.freeze([USER_SESSION_COOKIE])
|
|
424
|
-
}),
|
|
425
|
-
Object.freeze({
|
|
426
|
-
exact: "/api/auth/session/refresh",
|
|
427
|
-
methods: Object.freeze(["POST"]),
|
|
428
|
-
forwardCookieNames: Object.freeze([USER_SESSION_COOKIE])
|
|
429
|
-
}),
|
|
430
|
-
Object.freeze({
|
|
431
|
-
prefix: "/api/user/sessions/",
|
|
432
|
-
methods: Object.freeze(["POST"]),
|
|
433
|
-
forwardCookieNames: Object.freeze([USER_SESSION_COOKIE])
|
|
434
|
-
})
|
|
435
|
-
]);
|
|
436
521
|
var USER_ACCOUNT_HREF = "/user.account/account";
|
|
522
|
+
var USER_BROWSER_AUTH_METHODS_PATH = browserApiPath(USER_SERVICE_NAMESPACE, "/api/auth/methods");
|
|
523
|
+
var USER_BROWSER_AUTH_TRANSACTIONS_PATH = browserApiPath(USER_SERVICE_NAMESPACE, "/api/auth/transactions");
|
|
524
|
+
var USER_BROWSER_LOGOUT_PATH = browserApiPath(USER_SERVICE_NAMESPACE, "/api/auth/logout");
|
|
525
|
+
var USER_BROWSER_SESSION_REFRESH_PATH = browserApiPath(USER_SERVICE_NAMESPACE, "/api/auth/session/refresh");
|
|
526
|
+
var USER_BROWSER_USER_PATH = browserApiPath(USER_SERVICE_NAMESPACE, "/api/user");
|
|
527
|
+
var USER_BROWSER_USER_SESSIONS_PATH = browserApiPath(USER_SERVICE_NAMESPACE, "/api/user/sessions");
|
|
437
528
|
var USER_BROWSER_API_ERROR_CODES = Object.freeze({
|
|
438
529
|
crossOriginRejected: 1001,
|
|
439
530
|
requestRejected: 1002,
|
|
@@ -479,6 +570,121 @@ var sessionCookieSchema = external_exports.discriminatedUnion("action", [
|
|
|
479
570
|
}),
|
|
480
571
|
external_exports.strictObject({ action: external_exports.literal("clear") })
|
|
481
572
|
]);
|
|
573
|
+
var sessionTokenSchema = external_exports.string().min(1).max(4096);
|
|
574
|
+
var authenticationMethodSchema = external_exports.strictObject({
|
|
575
|
+
id: external_exports.string().regex(/^[a-z][a-z0-9._-]{0,127}$/),
|
|
576
|
+
label: external_exports.string().trim().min(1).max(80),
|
|
577
|
+
capabilities: external_exports.strictObject({
|
|
578
|
+
login: external_exports.boolean(),
|
|
579
|
+
registration: external_exports.boolean()
|
|
580
|
+
}),
|
|
581
|
+
rsc: external_exports.strictObject({
|
|
582
|
+
pluginId: external_exports.string().regex(/^[a-z][a-z0-9._-]{0,127}$/),
|
|
583
|
+
slots: external_exports.strictObject({
|
|
584
|
+
login: absolutePath.optional(),
|
|
585
|
+
registration: absolutePath.optional()
|
|
586
|
+
})
|
|
587
|
+
})
|
|
588
|
+
}).readonly();
|
|
589
|
+
var userEmptyRequestSchema = external_exports.strictObject({}).readonly();
|
|
590
|
+
var userAuthenticationCatalogResponseSchema = external_exports.strictObject({
|
|
591
|
+
methods: external_exports.array(authenticationMethodSchema).max(64).readonly()
|
|
592
|
+
}).readonly();
|
|
593
|
+
var userAuthenticationBeginRequestSchema = external_exports.strictObject({
|
|
594
|
+
methodId: external_exports.string().regex(/^[a-z][a-z0-9._-]{0,127}$/),
|
|
595
|
+
intent: external_exports.enum(["login", "registration", "linking", "reauthentication", "recovery"]),
|
|
596
|
+
loginHint: external_exports.string().trim().min(1).max(320).optional(),
|
|
597
|
+
requestContext: external_exports.strictObject({ clientKey: external_exports.string().min(16).max(128) })
|
|
598
|
+
}).readonly();
|
|
599
|
+
var userAuthenticationBeginResponseSchema = external_exports.discriminatedUnion("status", [
|
|
600
|
+
external_exports.strictObject({
|
|
601
|
+
status: external_exports.literal("input-required"),
|
|
602
|
+
transactionId: external_exports.uuid(),
|
|
603
|
+
methodId: external_exports.string().regex(/^[a-z][a-z0-9._-]{0,127}$/)
|
|
604
|
+
}),
|
|
605
|
+
external_exports.strictObject({
|
|
606
|
+
status: external_exports.literal("redirect-required"),
|
|
607
|
+
transactionId: external_exports.uuid(),
|
|
608
|
+
methodId: external_exports.string().regex(/^[a-z][a-z0-9._-]{0,127}$/),
|
|
609
|
+
redirectUrl: external_exports.url().max(4096)
|
|
610
|
+
}),
|
|
611
|
+
external_exports.strictObject({
|
|
612
|
+
status: external_exports.literal("pending"),
|
|
613
|
+
transactionId: external_exports.uuid(),
|
|
614
|
+
methodId: external_exports.string().regex(/^[a-z][a-z0-9._-]{0,127}$/),
|
|
615
|
+
retryAfterMs: external_exports.number().int().min(250).max(6e4)
|
|
616
|
+
})
|
|
617
|
+
]).readonly();
|
|
618
|
+
var userAuthenticationCompleteRequestSchema = external_exports.strictObject({
|
|
619
|
+
input: external_exports.unknown()
|
|
620
|
+
}).readonly();
|
|
621
|
+
var userAuthenticationCompletionResponseSchema = external_exports.discriminatedUnion("status", [
|
|
622
|
+
external_exports.strictObject({
|
|
623
|
+
status: external_exports.literal("verified"),
|
|
624
|
+
session: external_exports.strictObject({ token: sessionTokenSchema, expiresAt: external_exports.iso.datetime({ offset: true }) }),
|
|
625
|
+
user: external_exports.unknown()
|
|
626
|
+
}),
|
|
627
|
+
external_exports.strictObject({ status: external_exports.literal("denied"), code: external_exports.string().min(1).max(128) }),
|
|
628
|
+
external_exports.strictObject({
|
|
629
|
+
status: external_exports.literal("pending"),
|
|
630
|
+
retryAfterMs: external_exports.number().int().min(250).max(6e4)
|
|
631
|
+
})
|
|
632
|
+
]).readonly();
|
|
633
|
+
var userAccountSchema = external_exports.strictObject({
|
|
634
|
+
id: external_exports.string().min(1).max(128),
|
|
635
|
+
displayName: external_exports.string().min(1).max(160).optional(),
|
|
636
|
+
avatar: external_exports.url({ protocol: /^https?$/ }).max(2048).optional(),
|
|
637
|
+
homepage: external_exports.url({ protocol: /^https?$/ }).max(2048).optional(),
|
|
638
|
+
bio: external_exports.string().max(500).optional(),
|
|
639
|
+
email: external_exports.email().max(320).optional(),
|
|
640
|
+
emailVerified: external_exports.boolean()
|
|
641
|
+
}).readonly();
|
|
642
|
+
var userAccountReadResponseSchema = external_exports.strictObject({ user: userAccountSchema }).readonly();
|
|
643
|
+
var userAccountUpdateRequestSchema = external_exports.strictObject({ input: external_exports.unknown() }).readonly();
|
|
644
|
+
var userSessionSchema = external_exports.strictObject({
|
|
645
|
+
id: external_exports.string().min(1).max(128),
|
|
646
|
+
createdAt: external_exports.iso.datetime(),
|
|
647
|
+
lastSeenAt: external_exports.iso.datetime(),
|
|
648
|
+
expiresAt: external_exports.iso.datetime(),
|
|
649
|
+
revoked: external_exports.boolean()
|
|
650
|
+
}).readonly();
|
|
651
|
+
var userAccountSessionsResponseSchema = external_exports.strictObject({
|
|
652
|
+
sessions: external_exports.array(userSessionSchema).max(100).readonly()
|
|
653
|
+
}).readonly();
|
|
654
|
+
var userSessionRevokeResponseSchema = external_exports.strictObject({ revoked: external_exports.boolean() }).readonly();
|
|
655
|
+
var userLogoutResponseSchema = external_exports.strictObject({ revoked: external_exports.boolean() }).readonly();
|
|
656
|
+
var userRefreshSessionResponseSchema = external_exports.strictObject({
|
|
657
|
+
session: external_exports.strictObject({
|
|
658
|
+
token: sessionTokenSchema,
|
|
659
|
+
expiresAt: external_exports.iso.datetime({ offset: true }),
|
|
660
|
+
user: userAccountSchema
|
|
661
|
+
})
|
|
662
|
+
}).readonly();
|
|
663
|
+
var userEventCatalogResponseSchema = external_exports.strictObject({
|
|
664
|
+
protocol: external_exports.literal("zlooks.event-catalog"),
|
|
665
|
+
protocolVersion: external_exports.literal(1),
|
|
666
|
+
providerId: external_exports.literal("user"),
|
|
667
|
+
displayName: external_exports.string().min(1).max(160),
|
|
668
|
+
producer: external_exports.literal(USER_SERVICE_NAMESPACE),
|
|
669
|
+
contractPackage: external_exports.literal("@zlooks.cn/user-shared"),
|
|
670
|
+
count: external_exports.literal(5),
|
|
671
|
+
delivery: external_exports.strictObject({
|
|
672
|
+
guarantee: external_exports.literal("at-least-once"),
|
|
673
|
+
deduplicateBy: external_exports.literal("eventId")
|
|
674
|
+
}),
|
|
675
|
+
events: external_exports.array(external_exports.strictObject({
|
|
676
|
+
type: external_exports.string().min(1).max(256),
|
|
677
|
+
title: external_exports.string().min(1).max(160),
|
|
678
|
+
description: external_exports.string().min(1).max(1e3),
|
|
679
|
+
producer: external_exports.literal(USER_SERVICE_NAMESPACE),
|
|
680
|
+
aggregateType: external_exports.string().min(1).max(128),
|
|
681
|
+
consumer: external_exports.strictObject({
|
|
682
|
+
packageName: external_exports.literal("@zlooks.cn/user-shared"),
|
|
683
|
+
exportName: external_exports.string().min(1).max(128)
|
|
684
|
+
}),
|
|
685
|
+
dataSchema: external_exports.record(external_exports.string(), external_exports.unknown())
|
|
686
|
+
})).length(5).readonly()
|
|
687
|
+
}).readonly();
|
|
482
688
|
var userCurrentUserRequestSchema = external_exports.strictObject({}).readonly();
|
|
483
689
|
var userPublicProfileSchema = external_exports.strictObject({
|
|
484
690
|
id: external_exports.uuid(),
|
|
@@ -499,7 +705,9 @@ var userPublicProfilesRequestSchema = external_exports.strictObject({
|
|
|
499
705
|
userIds: external_exports.array(external_exports.uuid()).min(1).max(100).refine((userIds) => new Set(userIds).size === userIds.length, { message: "User IDs must be unique" }).readonly()
|
|
500
706
|
}).readonly();
|
|
501
707
|
var userPublicProfilesResponseSchema = external_exports.strictObject({
|
|
502
|
-
users: external_exports.array(userPublicProfileSchema).max(100).refine((users) => new Set(users.map((user) => user.id)).size === users.length, {
|
|
708
|
+
users: external_exports.array(userPublicProfileSchema).max(100).refine((users) => new Set(users.map((user) => user.id)).size === users.length, {
|
|
709
|
+
message: "Public user profiles must be unique"
|
|
710
|
+
}).readonly()
|
|
503
711
|
}).readonly();
|
|
504
712
|
var userBrowserApiRequestSchema = external_exports.strictObject({
|
|
505
713
|
method: external_exports.enum(["GET", "POST", "PATCH"]),
|
|
@@ -508,24 +716,6 @@ var userBrowserApiRequestSchema = external_exports.strictObject({
|
|
|
508
716
|
clientKey: external_exports.string().regex(/^[a-f0-9]{64}$/),
|
|
509
717
|
body: external_exports.unknown().optional()
|
|
510
718
|
}).readonly();
|
|
511
|
-
var userBrowserApiProviderRequestSchema = external_exports.strictObject({
|
|
512
|
-
method: external_exports.enum(["GET", "POST", "PATCH"]),
|
|
513
|
-
path: absolutePath,
|
|
514
|
-
origin: external_exports.string().max(2048).optional(),
|
|
515
|
-
clientKey: external_exports.string().regex(/^[a-f0-9]{64}$/),
|
|
516
|
-
body: external_exports.unknown().optional()
|
|
517
|
-
}).readonly();
|
|
518
|
-
var userBrowserApiProviderResponseSchema = browserApiDispatchResponseSchema.superRefine((response, context) => {
|
|
519
|
-
for (const [index, effect] of (response.cookieEffects ?? []).entries()) {
|
|
520
|
-
if (effect.name === USER_SESSION_COOKIE)
|
|
521
|
-
continue;
|
|
522
|
-
context.addIssue({
|
|
523
|
-
code: "custom",
|
|
524
|
-
message: "User Browser API may only mutate its declared session cookie",
|
|
525
|
-
path: ["cookieEffects", index, "name"]
|
|
526
|
-
});
|
|
527
|
-
}
|
|
528
|
-
}).readonly();
|
|
529
719
|
var userBrowserApiResponseSchema = external_exports.strictObject({
|
|
530
720
|
status: external_exports.number().int().min(200).max(599).refine((status) => status < 300 || status >= 400),
|
|
531
721
|
body: browserApiResponseSchema,
|
|
@@ -553,6 +743,9 @@ var userCredentialLifecycleEventSchema = external_exports.strictObject({
|
|
|
553
743
|
var userCredentialLifecycleResponseSchema = external_exports.strictObject({
|
|
554
744
|
acknowledged: external_exports.literal(true)
|
|
555
745
|
}).readonly();
|
|
746
|
+
function userBrowserTransactionCompletePath(transactionId) {
|
|
747
|
+
return `${USER_BROWSER_AUTH_TRANSACTIONS_PATH}/${encodeURIComponent(external_exports.string().trim().min(1).max(128).parse(transactionId))}/complete`;
|
|
748
|
+
}
|
|
556
749
|
|
|
557
750
|
// ../../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/_util/getReactMajorVersionCanDelMe.js
|
|
558
751
|
function getReactMajorVersion() {
|
|
@@ -1191,7 +1384,7 @@ var InternalSegmentedOption = ({
|
|
|
1191
1384
|
disabled,
|
|
1192
1385
|
checked,
|
|
1193
1386
|
label,
|
|
1194
|
-
title,
|
|
1387
|
+
title: title2,
|
|
1195
1388
|
value,
|
|
1196
1389
|
name,
|
|
1197
1390
|
onChange,
|
|
@@ -1227,7 +1420,7 @@ var InternalSegmentedOption = ({
|
|
|
1227
1420
|
onKeyUp
|
|
1228
1421
|
}), /* @__PURE__ */ createElement("div", {
|
|
1229
1422
|
className: clsx(`${prefixCls}-item-label`, segmentedClassNames?.label),
|
|
1230
|
-
title,
|
|
1423
|
+
title: title2,
|
|
1231
1424
|
style: styles?.label
|
|
1232
1425
|
}, label));
|
|
1233
1426
|
return itemRender(itemContent, {
|
|
@@ -4256,7 +4449,7 @@ function PasswordForm(props) {
|
|
|
4256
4449
|
if (countdown <= 0) return;
|
|
4257
4450
|
const timer = window.setInterval(() => setCountdown((value) => Math.max(0, value - 1)), 1e3);
|
|
4258
4451
|
return () => window.clearInterval(timer);
|
|
4259
|
-
}, [countdown
|
|
4452
|
+
}, [countdown]);
|
|
4260
4453
|
async function ensureTransaction() {
|
|
4261
4454
|
if (transactionId) return transactionId;
|
|
4262
4455
|
const created = await beginTransaction(request, props.intent);
|
|
@@ -4271,7 +4464,7 @@ function PasswordForm(props) {
|
|
|
4271
4464
|
const requestId = pendingSend.current?.email === email ? pendingSend.current.requestId : crypto.randomUUID();
|
|
4272
4465
|
pendingSend.current = { email, requestId };
|
|
4273
4466
|
const challenge = await request(
|
|
4274
|
-
|
|
4467
|
+
userBrowserTransactionCompletePath(currentTransactionId),
|
|
4275
4468
|
{
|
|
4276
4469
|
method: "POST",
|
|
4277
4470
|
headers: { "content-type": "application/json" },
|
|
@@ -4299,12 +4492,16 @@ function PasswordForm(props) {
|
|
|
4299
4492
|
code: values.code,
|
|
4300
4493
|
...needsPassword ? { password: values.password } : {}
|
|
4301
4494
|
} : { action: "password-login", email: values.email, password: values.password };
|
|
4302
|
-
await request(
|
|
4303
|
-
|
|
4304
|
-
|
|
4305
|
-
|
|
4306
|
-
|
|
4307
|
-
|
|
4495
|
+
await request(
|
|
4496
|
+
userBrowserTransactionCompletePath(currentTransactionId),
|
|
4497
|
+
{
|
|
4498
|
+
method: "POST",
|
|
4499
|
+
headers: { "content-type": "application/json" },
|
|
4500
|
+
credentials: "same-origin",
|
|
4501
|
+
body: JSON.stringify({ input })
|
|
4502
|
+
},
|
|
4503
|
+
{ errorMessage: "\u6CA1\u6709\u5B8C\u6210\uFF0C\u8BF7\u68C0\u67E5\u8F93\u5165\u540E\u91CD\u8BD5", parse: parseAuthenticationCompletion }
|
|
4504
|
+
);
|
|
4308
4505
|
if (props.intent === "registration") {
|
|
4309
4506
|
navigation.replace(USER_ACCOUNT_HREF);
|
|
4310
4507
|
return;
|
|
@@ -4346,7 +4543,10 @@ function PasswordForm(props) {
|
|
|
4346
4543
|
{
|
|
4347
4544
|
"aria-label": "\u9009\u62E9\u767B\u5F55\u65B9\u5F0F",
|
|
4348
4545
|
block: true,
|
|
4349
|
-
options: [
|
|
4546
|
+
options: [
|
|
4547
|
+
{ label: "\u5BC6\u7801\u767B\u5F55", value: "password" },
|
|
4548
|
+
{ label: "\u9A8C\u8BC1\u7801\u767B\u5F55", value: "code" }
|
|
4549
|
+
],
|
|
4350
4550
|
size: "large",
|
|
4351
4551
|
value: mode,
|
|
4352
4552
|
onChange: (value) => {
|
|
@@ -4359,7 +4559,18 @@ function PasswordForm(props) {
|
|
|
4359
4559
|
}
|
|
4360
4560
|
}
|
|
4361
4561
|
) }) : null,
|
|
4362
|
-
/* @__PURE__ */ jsx(form_default.Item, { label: "\u90AE\u7BB1", name: "email", rules: emailRules, children: /* @__PURE__ */ jsx(
|
|
4562
|
+
/* @__PURE__ */ jsx(form_default.Item, { label: "\u90AE\u7BB1", name: "email", rules: emailRules, children: /* @__PURE__ */ jsx(
|
|
4563
|
+
input_default,
|
|
4564
|
+
{
|
|
4565
|
+
autoComplete: "username",
|
|
4566
|
+
disabled: codeSent,
|
|
4567
|
+
inputMode: "email",
|
|
4568
|
+
maxLength: 320,
|
|
4569
|
+
placeholder: "name@example.com",
|
|
4570
|
+
size: "large",
|
|
4571
|
+
type: "email"
|
|
4572
|
+
}
|
|
4573
|
+
) }),
|
|
4363
4574
|
codeSent ? /* @__PURE__ */ jsx(
|
|
4364
4575
|
button_default,
|
|
4365
4576
|
{
|
|
@@ -4378,7 +4589,29 @@ function PasswordForm(props) {
|
|
|
4378
4589
|
}
|
|
4379
4590
|
) : null,
|
|
4380
4591
|
usesCode ? /* @__PURE__ */ jsx(form_default.Item, { label: "\u9A8C\u8BC1\u7801", required: true, children: /* @__PURE__ */ jsxs("div", { className: password_form_default.codeRow, children: [
|
|
4381
|
-
/* @__PURE__ */ jsx(
|
|
4592
|
+
/* @__PURE__ */ jsx(
|
|
4593
|
+
form_default.Item,
|
|
4594
|
+
{
|
|
4595
|
+
noStyle: true,
|
|
4596
|
+
name: "code",
|
|
4597
|
+
rules: [
|
|
4598
|
+
{ required: true, message: "\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801" },
|
|
4599
|
+
{ len: 6, message: "\u9A8C\u8BC1\u7801\u5E94\u4E3A 6 \u4F4D\u6570\u5B57" },
|
|
4600
|
+
{ pattern: /^\d{6}$/, message: "\u9A8C\u8BC1\u7801\u5E94\u4E3A 6 \u4F4D\u6570\u5B57" }
|
|
4601
|
+
],
|
|
4602
|
+
children: /* @__PURE__ */ jsx(
|
|
4603
|
+
input_default,
|
|
4604
|
+
{
|
|
4605
|
+
"aria-label": "\u9A8C\u8BC1\u7801",
|
|
4606
|
+
autoComplete: "one-time-code",
|
|
4607
|
+
inputMode: "numeric",
|
|
4608
|
+
maxLength: 6,
|
|
4609
|
+
placeholder: "6 \u4F4D\u9A8C\u8BC1\u7801",
|
|
4610
|
+
size: "large"
|
|
4611
|
+
}
|
|
4612
|
+
)
|
|
4613
|
+
}
|
|
4614
|
+
),
|
|
4382
4615
|
/* @__PURE__ */ jsx(button_default, { disabled: countdown > 0 || submitting, loading: sending, onClick: sendCode, size: "large", children: countdown > 0 ? `${countdown} \u79D2\u540E\u91CD\u53D1` : codeSent ? "\u91CD\u65B0\u53D1\u9001" : "\u53D1\u9001\u9A8C\u8BC1\u7801" })
|
|
4383
4616
|
] }) }) : null,
|
|
4384
4617
|
needsPassword ? /* @__PURE__ */ jsx(
|
|
@@ -4399,7 +4632,18 @@ function PasswordForm(props) {
|
|
|
4399
4632
|
)
|
|
4400
4633
|
}
|
|
4401
4634
|
) : null,
|
|
4402
|
-
/* @__PURE__ */ jsx(
|
|
4635
|
+
/* @__PURE__ */ jsx(
|
|
4636
|
+
button_default,
|
|
4637
|
+
{
|
|
4638
|
+
block: true,
|
|
4639
|
+
htmlType: "submit",
|
|
4640
|
+
loading: submitting,
|
|
4641
|
+
size: "large",
|
|
4642
|
+
type: "primary",
|
|
4643
|
+
disabled: sending || usesCode && !codeSent,
|
|
4644
|
+
children: copy.submit
|
|
4645
|
+
}
|
|
4646
|
+
)
|
|
4403
4647
|
]
|
|
4404
4648
|
}
|
|
4405
4649
|
) }),
|
|
@@ -4413,14 +4657,16 @@ function PasswordForm(props) {
|
|
|
4413
4657
|
);
|
|
4414
4658
|
}
|
|
4415
4659
|
function AlternateLinks({ intent }) {
|
|
4416
|
-
if (intent === "registration")
|
|
4417
|
-
"
|
|
4418
|
-
|
|
4419
|
-
|
|
4420
|
-
|
|
4421
|
-
|
|
4422
|
-
/* @__PURE__ */
|
|
4423
|
-
|
|
4660
|
+
if (intent === "registration")
|
|
4661
|
+
return /* @__PURE__ */ jsxs("p", { className: password_form_default.alternate, children: [
|
|
4662
|
+
"\u5DF2\u7ECF\u6709\u8D26\u53F7\uFF1F",
|
|
4663
|
+
/* @__PURE__ */ jsx(RscLink, { href: "/auth.password/login", children: "\u8FD4\u56DE\u767B\u5F55" })
|
|
4664
|
+
] });
|
|
4665
|
+
if (intent === "recovery")
|
|
4666
|
+
return /* @__PURE__ */ jsxs("p", { className: password_form_default.alternate, children: [
|
|
4667
|
+
"\u60F3\u8D77\u5BC6\u7801\u4E86\uFF1F",
|
|
4668
|
+
/* @__PURE__ */ jsx(RscLink, { href: "/auth.password/login", children: "\u8FD4\u56DE\u767B\u5F55" })
|
|
4669
|
+
] });
|
|
4424
4670
|
return /* @__PURE__ */ jsxs("div", { className: password_form_default.alternateLinks, children: [
|
|
4425
4671
|
/* @__PURE__ */ jsxs("p", { children: [
|
|
4426
4672
|
/* @__PURE__ */ jsx("span", { children: "\u8FD8\u6CA1\u6709\u8D26\u6237\uFF1F" }),
|
|
@@ -4433,12 +4679,16 @@ function AlternateLinks({ intent }) {
|
|
|
4433
4679
|
] });
|
|
4434
4680
|
}
|
|
4435
4681
|
async function beginTransaction(request, intent) {
|
|
4436
|
-
return request(
|
|
4437
|
-
|
|
4438
|
-
|
|
4439
|
-
|
|
4440
|
-
|
|
4441
|
-
|
|
4682
|
+
return request(
|
|
4683
|
+
USER_BROWSER_AUTH_TRANSACTIONS_PATH,
|
|
4684
|
+
{
|
|
4685
|
+
method: "POST",
|
|
4686
|
+
headers: { "content-type": "application/json" },
|
|
4687
|
+
credentials: "same-origin",
|
|
4688
|
+
body: JSON.stringify({ methodId: "password", intent })
|
|
4689
|
+
},
|
|
4690
|
+
{ errorMessage: "\u6682\u65F6\u65E0\u6CD5\u7EE7\u7EED\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5", parse: parseTransactionId }
|
|
4691
|
+
);
|
|
4442
4692
|
}
|
|
4443
4693
|
function parseTransactionId(data) {
|
|
4444
4694
|
if (data === null || typeof data !== "object" || Array.isArray(data)) throw new Error("Invalid transaction response");
|
|
@@ -4456,31 +4706,35 @@ var emailRules = [
|
|
|
4456
4706
|
function passwordRules(requireMinimum) {
|
|
4457
4707
|
return [
|
|
4458
4708
|
{ required: true, message: "\u8BF7\u8F93\u5165\u5BC6\u7801" },
|
|
4459
|
-
...requireMinimum ? [
|
|
4460
|
-
|
|
4461
|
-
|
|
4462
|
-
|
|
4463
|
-
|
|
4709
|
+
...requireMinimum ? [
|
|
4710
|
+
{
|
|
4711
|
+
validator: async (_rule, value) => {
|
|
4712
|
+
if (!value) return;
|
|
4713
|
+
if (Array.from(value).length < 12) throw new Error("\u5BC6\u7801\u81F3\u5C11\u9700\u8981 12 \u4E2A\u5B57\u7B26");
|
|
4714
|
+
if (new TextEncoder().encode(value).byteLength > 128) throw new Error("\u5BC6\u7801\u8FC7\u957F\uFF0C\u8BF7\u7F29\u77ED\u540E\u91CD\u8BD5");
|
|
4715
|
+
}
|
|
4464
4716
|
}
|
|
4465
|
-
|
|
4717
|
+
] : [{ max: 128, message: "\u5BC6\u7801\u4E0D\u80FD\u8D85\u8FC7 128 \u4E2A\u5B57\u7B26" }]
|
|
4466
4718
|
];
|
|
4467
4719
|
}
|
|
4468
4720
|
var UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
|
4469
4721
|
function pageCopy(intent) {
|
|
4470
|
-
if (intent === "registration")
|
|
4471
|
-
|
|
4472
|
-
|
|
4473
|
-
|
|
4474
|
-
|
|
4475
|
-
|
|
4476
|
-
|
|
4477
|
-
|
|
4478
|
-
|
|
4479
|
-
|
|
4480
|
-
|
|
4481
|
-
|
|
4482
|
-
|
|
4483
|
-
|
|
4722
|
+
if (intent === "registration")
|
|
4723
|
+
return {
|
|
4724
|
+
introduction: "\u9A8C\u8BC1\u90AE\u7BB1\u5E76\u521B\u5EFA\u8D26\u53F7\u540E\uFF0C\u53EF\u4EE5\u7EE7\u7EED\u5B8C\u5584\u8D44\u6599\uFF0C\u6574\u7406\u5C5E\u4E8E\u4F60\u7684\u8BB0\u5F55\u3002",
|
|
4725
|
+
step: "ACCOUNT / REGISTER",
|
|
4726
|
+
title: "\u521B\u5EFA\u8D26\u6237",
|
|
4727
|
+
description: "\u4F7F\u7528\u90AE\u7BB1\u9A8C\u8BC1\u7801\u548C\u5BC6\u7801\u521B\u5EFA\u8D26\u53F7\u3002",
|
|
4728
|
+
submit: "\u521B\u5EFA\u8D26\u53F7"
|
|
4729
|
+
};
|
|
4730
|
+
if (intent === "recovery")
|
|
4731
|
+
return {
|
|
4732
|
+
introduction: "\u9A8C\u8BC1\u6CE8\u518C\u90AE\u7BB1\u540E\u8BBE\u7F6E\u65B0\u5BC6\u7801\uFF0C\u65E7\u8BBE\u5907\u4E0A\u7684\u767B\u5F55\u4F1A\u81EA\u52A8\u9000\u51FA\u3002",
|
|
4733
|
+
step: "ACCOUNT / RECOVERY",
|
|
4734
|
+
title: "\u627E\u56DE\u5BC6\u7801",
|
|
4735
|
+
description: "\u9A8C\u8BC1\u7801\u53EA\u4F1A\u53D1\u9001\u5230\u5DF2\u7ECF\u6CE8\u518C\u7684\u90AE\u7BB1\u3002",
|
|
4736
|
+
submit: "\u66F4\u65B0\u5BC6\u7801\u5E76\u767B\u5F55"
|
|
4737
|
+
};
|
|
4484
4738
|
return {
|
|
4485
4739
|
introduction: "\u767B\u5F55\u540E\u53EF\u4EE5\u7BA1\u7406\u4E2A\u4EBA\u8D44\u6599\u4E0E\u767B\u5F55\u4F1A\u8BDD\u3002",
|
|
4486
4740
|
step: "ACCOUNT / SIGN IN",
|