@zlooks.cn/password-auth-server 1.0.3 → 1.0.4

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 (12) hide show
  1. package/.hile-rsc/{build-mtsn68qv-a841a566/client-browser/src-plugin-password-form-3bd63d69e5-G5UQAB5W.js → build-mtu1gn28-ec03cfb2/client-browser/src-plugin-password-form-3bd63d69e5-BCAMXKEX.js} +152 -19
  2. package/.hile-rsc/{build-mtsn68qv-a841a566/client-ssr/src-plugin-password-form-3bd63d69e5-UV3K6EC6.js → build-mtu1gn28-ec03cfb2/client-ssr/src-plugin-password-form-3bd63d69e5-KF6ZLTDT.js} +357 -224
  3. package/.hile-rsc/{build-mtsn68qv-a841a566 → build-mtu1gn28-ec03cfb2}/plugin.json +6 -6
  4. package/.hile-rsc/{build-mtsn68qv-a841a566 → build-mtu1gn28-ec03cfb2}/server-rsc/index.js +160 -27
  5. package/package.json +4 -4
  6. /package/.hile-rsc/{build-mtsn68qv-a841a566 → build-mtu1gn28-ec03cfb2}/client-browser/chunks/chunk-CZF5VGOJ.js +0 -0
  7. /package/.hile-rsc/{build-mtsn68qv-a841a566 → build-mtu1gn28-ec03cfb2}/client-browser/src-plugin-page-frame-07c4de56a6-3F24AYCH.css +0 -0
  8. /package/.hile-rsc/{build-mtsn68qv-a841a566 → build-mtu1gn28-ec03cfb2}/client-browser/src-plugin-page-frame-07c4de56a6-C2WHPDGD.js +0 -0
  9. /package/.hile-rsc/{build-mtsn68qv-a841a566 → build-mtu1gn28-ec03cfb2}/client-browser/src-plugin-password-form-3bd63d69e5-TRYMJX4F.css +0 -0
  10. /package/.hile-rsc/{build-mtsn68qv-a841a566 → build-mtu1gn28-ec03cfb2}/client-ssr/chunks/chunk-RMKQVF3F.js +0 -0
  11. /package/.hile-rsc/{build-mtsn68qv-a841a566 → build-mtu1gn28-ec03cfb2}/client-ssr/src-plugin-page-frame-07c4de56a6-ICZZGKBP.js +0 -0
  12. /package/.hile-rsc/{build-mtsn68qv-a841a566 → build-mtu1gn28-ec03cfb2}/styles/4b3193c4f2b317ffed425ccf401342a4bdd6ccfd5f9c42def3315e776f166975.css +0 -0
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "protocolVersion": 1,
3
3
  "pluginId": "auth.password",
4
- "buildId": "build-mtsn68qv-a841a566",
4
+ "buildId": "build-mtu1gn28-ec03cfb2",
5
5
  "runtime": {
6
6
  "react": "19.2.8",
7
7
  "reactDom": "19.2.8",
@@ -9,7 +9,7 @@
9
9
  },
10
10
  "server": {
11
11
  "entry": "server-rsc/index.js",
12
- "integrity": "sha256-pyqp/IN1dm980p8BduTrOxKfyXkZfwCw9EHPxZd/PkI="
12
+ "integrity": "sha256-5RPMLBgOfaSKRYG/v2FgHD3HmAIWZH1HHgOc//z1jUE="
13
13
  },
14
14
  "serverFunctions": [],
15
15
  "clients": [
@@ -35,8 +35,8 @@
35
35
  },
36
36
  {
37
37
  "id": "auth.password/src/plugin/password-form#default",
38
- "module": "client-browser/src-plugin-password-form-3bd63d69e5-G5UQAB5W.js",
39
- "ssrModule": "client-ssr/src-plugin-password-form-3bd63d69e5-UV3K6EC6.js",
38
+ "module": "client-browser/src-plugin-password-form-3bd63d69e5-BCAMXKEX.js",
39
+ "ssrModule": "client-ssr/src-plugin-password-form-3bd63d69e5-KF6ZLTDT.js",
40
40
  "exportName": "default",
41
41
  "chunks": [
42
42
  {
@@ -50,8 +50,8 @@
50
50
  "integrity": "sha256-9mEuRp91q4zeT9AfbPC17MtOxaceAFHFcAqTSwMfIVw="
51
51
  }
52
52
  ],
53
- "integrity": "sha256-sQJh7ByCre8PMuL4by0ns3ACwNUdVBSdnYze5EJa79o=",
54
- "ssrIntegrity": "sha256-roRxqRsdqGfPQenk3YHNKjbeTxnUVsTVYsbAoOAulUc="
53
+ "integrity": "sha256-6UhHzo7BIH2EfzPm51tsjicq1rueq//QCiL33FTB2S0=",
54
+ "ssrIntegrity": "sha256-cfAEB/+Iv3ZqRySrczBN4PcrFdtjearq0G22BlmLIcM="
55
55
  }
56
56
  ],
57
57
  "styles": [
@@ -11333,12 +11333,12 @@ function _check(fn, params) {
11333
11333
  return ch;
11334
11334
  }
11335
11335
  // @__NO_SIDE_EFFECTS__
11336
- function describe(description) {
11336
+ function describe(description2) {
11337
11337
  const ch = new $ZodCheck({ check: "describe" });
11338
11338
  ch._zod.onattach = [
11339
11339
  (inst) => {
11340
11340
  const existing = globalRegistry.get(inst) ?? {};
11341
- globalRegistry.add(inst, { ...existing, description });
11341
+ globalRegistry.add(inst, { ...existing, description: description2 });
11342
11342
  }
11343
11343
  ];
11344
11344
  ch._zod.check = () => {
@@ -12845,9 +12845,9 @@ var ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
12845
12845
  readonly() {
12846
12846
  return readonly(this);
12847
12847
  },
12848
- describe(description) {
12848
+ describe(description2) {
12849
12849
  const cl = this.clone();
12850
- globalRegistry.add(cl, { description });
12850
+ globalRegistry.add(cl, { description: description2 });
12851
12851
  return cl;
12852
12852
  },
12853
12853
  meta(...args) {
@@ -14848,6 +14848,12 @@ var eventType = external_exports.string().max(256).regex(/^[a-z][a-z0-9]*(?:\.[a
14848
14848
  var serviceNamespace = external_exports.string().max(256).regex(/^[a-z][a-z0-9]*(?:\.[a-z][a-z0-9]*)+$/);
14849
14849
  var aggregateType = external_exports.string().regex(/^[a-z][a-z0-9-]{0,63}$/);
14850
14850
  var aggregateId = external_exports.string().trim().min(1).max(256);
14851
+ var providerId = external_exports.string().max(128).regex(/^[a-z][a-z0-9]*(?:[._-][a-z0-9]+)*$/);
14852
+ var contractPackage = external_exports.string().max(128).regex(/^@zlooks\.cn\/[a-z0-9]+(?:-[a-z0-9]+)*$/);
14853
+ var exportName = external_exports.string().max(128).regex(/^[A-Za-z_$][A-Za-z0-9_$]*$/);
14854
+ var title = external_exports.string().trim().min(1).max(120);
14855
+ var description = external_exports.string().trim().min(1).max(1e3);
14856
+ var jsonValueSchema = external_exports.json();
14851
14857
  var eventEnvelopeSchema = external_exports.strictObject({
14852
14858
  protocol: external_exports.literal("zlooks.event"),
14853
14859
  protocolVersion: external_exports.literal(1),
@@ -14859,42 +14865,130 @@ var eventEnvelopeSchema = external_exports.strictObject({
14859
14865
  id: aggregateId
14860
14866
  }).readonly(),
14861
14867
  occurredAt: external_exports.iso.datetime({ offset: true }),
14862
- data: external_exports.unknown()
14868
+ data: jsonValueSchema
14863
14869
  }).readonly();
14864
- function defineEvent(type, dataSchema5) {
14870
+ function parseDomainEvent(input) {
14871
+ const envelope = eventEnvelopeSchema.parse(input);
14872
+ return Object.freeze({
14873
+ ...envelope,
14874
+ aggregate: Object.freeze({ ...envelope.aggregate })
14875
+ });
14876
+ }
14877
+ function defineEvent(type, dataSchema5, options) {
14865
14878
  const parsedType2 = eventType.parse(type);
14879
+ const producer = serviceNamespace.parse(options.producer);
14880
+ const parsedAggregateType = aggregateType.parse(options.aggregateType);
14881
+ const selectAggregateId = options.aggregateId;
14882
+ if (typeof selectAggregateId !== "function")
14883
+ throw new TypeError("Event aggregateId must be a function");
14866
14884
  return Object.freeze({
14867
14885
  type: parsedType2,
14886
+ producer,
14887
+ aggregateType: parsedAggregateType,
14888
+ dataSchema: dataSchema5,
14868
14889
  parse(value) {
14869
- const envelope = eventEnvelopeSchema.parse(value);
14890
+ const envelope = parseDomainEvent(value);
14870
14891
  if (envelope.type !== parsedType2) {
14871
14892
  throw new TypeError(`Expected event type ${parsedType2}`);
14872
14893
  }
14894
+ if (envelope.producer !== producer) {
14895
+ throw new TypeError(`Expected event producer ${producer}`);
14896
+ }
14897
+ const data = dataSchema5.parse(envelope.data);
14898
+ jsonValueSchema.parse(data);
14899
+ const expectedAggregateId = aggregateId.parse(selectAggregateId(data));
14900
+ if (envelope.aggregate.type !== parsedAggregateType || envelope.aggregate.id !== expectedAggregateId) {
14901
+ throw new TypeError(`${parsedType2} aggregate does not identify its event data`);
14902
+ }
14873
14903
  return Object.freeze({
14874
14904
  ...envelope,
14875
14905
  type: parsedType2,
14876
14906
  aggregate: Object.freeze({ ...envelope.aggregate }),
14877
- data: dataSchema5.parse(envelope.data)
14907
+ data
14878
14908
  });
14879
14909
  }
14880
14910
  });
14881
14911
  }
14912
+ function defineEventCatalog(input) {
14913
+ const parsedProviderId = providerId.parse(input.providerId);
14914
+ const parsedDisplayName = title.parse(input.displayName);
14915
+ const parsedContractPackage = contractPackage.parse(input.contractPackage);
14916
+ if (input.events.length === 0 || input.events.length > 256) {
14917
+ throw new TypeError("Event catalog must contain between 1 and 256 events");
14918
+ }
14919
+ const producer = input.events[0].definition.producer;
14920
+ const eventTypes = /* @__PURE__ */ new Set();
14921
+ const consumerExports = /* @__PURE__ */ new Set();
14922
+ const events = input.events.map((entry) => {
14923
+ if (entry.definition.producer !== producer) {
14924
+ throw new TypeError("Event catalog definitions must have one producer");
14925
+ }
14926
+ if (eventTypes.has(entry.definition.type)) {
14927
+ throw new TypeError("Event catalog event types must be unique");
14928
+ }
14929
+ const parsedConsumerExport = exportName.parse(entry.consumerExport);
14930
+ if (consumerExports.has(parsedConsumerExport)) {
14931
+ throw new TypeError("Event catalog Consumer exports must be unique");
14932
+ }
14933
+ eventTypes.add(entry.definition.type);
14934
+ consumerExports.add(parsedConsumerExport);
14935
+ const dataSchema5 = immutableJson(external_exports.toJSONSchema(entry.definition.dataSchema, {
14936
+ target: "draft-2020-12",
14937
+ unrepresentable: "any",
14938
+ io: "input"
14939
+ }));
14940
+ if (!isJsonObject(dataSchema5))
14941
+ throw new TypeError("Event data schema must serialize to a JSON object");
14942
+ return Object.freeze({
14943
+ type: entry.definition.type,
14944
+ title: title.parse(entry.title),
14945
+ description: description.parse(entry.description),
14946
+ producer,
14947
+ aggregateType: entry.definition.aggregateType,
14948
+ consumer: Object.freeze({
14949
+ packageName: parsedContractPackage,
14950
+ exportName: parsedConsumerExport
14951
+ }),
14952
+ dataSchema: dataSchema5
14953
+ });
14954
+ });
14955
+ return Object.freeze({
14956
+ protocol: "zlooks.event-catalog",
14957
+ protocolVersion: 1,
14958
+ providerId: parsedProviderId,
14959
+ displayName: parsedDisplayName,
14960
+ producer,
14961
+ contractPackage: parsedContractPackage,
14962
+ count: events.length,
14963
+ delivery: Object.freeze({ guarantee: "at-least-once", deduplicateBy: "eventId" }),
14964
+ events: Object.freeze(events)
14965
+ });
14966
+ }
14967
+ function immutableJson(value) {
14968
+ if (value === null || typeof value === "string" || typeof value === "boolean")
14969
+ return value;
14970
+ if (typeof value === "number" && Number.isFinite(value))
14971
+ return value;
14972
+ if (Array.isArray(value))
14973
+ return Object.freeze(value.map(immutableJson));
14974
+ if (isRecord(value)) {
14975
+ return Object.freeze(Object.fromEntries(Object.entries(value).filter(([, item]) => item !== void 0).map(([key, item]) => [key, immutableJson(item)])));
14976
+ }
14977
+ throw new TypeError("Event JSON Schema contains a non-JSON value");
14978
+ }
14979
+ function isJsonObject(value) {
14980
+ return value !== null && typeof value === "object" && !Array.isArray(value);
14981
+ }
14982
+ function isRecord(value) {
14983
+ return value !== null && typeof value === "object" && !Array.isArray(value);
14984
+ }
14882
14985
 
14883
14986
  // ../user-shared/dist/events/definition.js
14884
14987
  function defineUserEvent(type, aggregateType2, dataSchema5, aggregateId2) {
14885
- const base = defineEvent(type, dataSchema5);
14886
- return Object.freeze({
14887
- type: base.type,
14888
- parse(input) {
14889
- const event = base.parse(input);
14890
- if (event.producer !== USER_SERVICE_NAMESPACE) {
14891
- throw new TypeError(`Expected event producer ${USER_SERVICE_NAMESPACE}`);
14892
- }
14893
- if (event.aggregate.type !== aggregateType2 || event.aggregate.id !== aggregateId2(event.data)) {
14894
- throw new TypeError(`${type} aggregate does not identify its event data`);
14895
- }
14896
- return event;
14897
- }
14988
+ return defineEvent(type, dataSchema5, {
14989
+ producer: USER_SERVICE_NAMESPACE,
14990
+ aggregateType: aggregateType2,
14991
+ aggregateId: aggregateId2
14898
14992
  });
14899
14993
  }
14900
14994
 
@@ -14979,6 +15073,45 @@ var dataSchema4 = external_exports.strictObject({
14979
15073
  }).readonly();
14980
15074
  var userSessionRevokedEvent = defineUserEvent(USER_SESSION_REVOKED_EVENT_TYPE, "session-family", dataSchema4, (data) => data.sessionFamily.id);
14981
15075
 
15076
+ // ../user-shared/dist/events/catalog.js
15077
+ var USER_EVENT_CATALOG = defineEventCatalog({
15078
+ providerId: "user",
15079
+ displayName: "\u7528\u6237\u670D\u52A1\u4E8B\u4EF6",
15080
+ contractPackage: "@zlooks.cn/user-shared",
15081
+ events: [
15082
+ {
15083
+ definition: userRegisteredEvent,
15084
+ title: "\u7528\u6237\u5DF2\u6CE8\u518C",
15085
+ description: "\u7528\u6237\u8D26\u6237\u5DF2\u7ECF\u5B8C\u6210\u6301\u4E45\u5316\u521B\u5EFA\u5E76\u5904\u4E8E\u53EF\u7528\u72B6\u6001\u3002",
15086
+ consumerExport: "consumeUserRegisteredEvent"
15087
+ },
15088
+ {
15089
+ definition: userEmailVerifiedEvent,
15090
+ title: "\u7528\u6237\u90AE\u7BB1\u5DF2\u9A8C\u8BC1",
15091
+ description: "\u7528\u6237\u90AE\u7BB1\u4ECE\u672A\u9A8C\u8BC1\u72B6\u6001\u771F\u5B9E\u8F6C\u6362\u4E3A\u5DF2\u9A8C\u8BC1\u72B6\u6001\u3002",
15092
+ consumerExport: "consumeUserEmailVerifiedEvent"
15093
+ },
15094
+ {
15095
+ definition: userProfileUpdatedEvent,
15096
+ title: "\u7528\u6237\u8D44\u6599\u5DF2\u66F4\u65B0",
15097
+ 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",
15098
+ consumerExport: "consumeUserProfileUpdatedEvent"
15099
+ },
15100
+ {
15101
+ definition: userSessionCreatedEvent,
15102
+ title: "\u7528\u6237\u4F1A\u8BDD\u65CF\u5DF2\u521B\u5EFA",
15103
+ 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",
15104
+ consumerExport: "consumeUserSessionCreatedEvent"
15105
+ },
15106
+ {
15107
+ definition: userSessionRevokedEvent,
15108
+ title: "\u7528\u6237\u4F1A\u8BDD\u65CF\u5DF2\u64A4\u9500",
15109
+ description: "\u7528\u6237\u4F1A\u8BDD\u65CF\u4ECE\u6D3B\u52A8\u72B6\u6001\u771F\u5B9E\u8F6C\u6362\u4E3A\u5DF2\u64A4\u9500\u72B6\u6001\u3002",
15110
+ consumerExport: "consumeUserSessionRevokedEvent"
15111
+ }
15112
+ ]
15113
+ });
15114
+
14982
15115
  // ../user-shared/dist/index.js
14983
15116
  var USER_BROWSER_API_PUBLIC_ROUTES = Object.freeze([
14984
15117
  Object.freeze({
@@ -15217,7 +15350,7 @@ var __hileRemoteClientBoundary = __hileRegisterClientReference(function() {
15217
15350
  function __hileDefault(props) {
15218
15351
  return React.createElement(__hileRemoteClientBoundary, {
15219
15352
  pluginId: "auth.password",
15220
- buildId: "build-mtsn68qv-a841a566",
15353
+ buildId: "build-mtu1gn28-ec03cfb2",
15221
15354
  referenceId: "auth.password/src/plugin/password-form#default",
15222
15355
  exportName: "default",
15223
15356
  props
@@ -15234,7 +15367,7 @@ var __hileRemoteClientBoundary2 = __hileRegisterClientReference2(function() {
15234
15367
  function __hileDefault2(props) {
15235
15368
  return React2.createElement(__hileRemoteClientBoundary2, {
15236
15369
  pluginId: "auth.password",
15237
- buildId: "build-mtsn68qv-a841a566",
15370
+ buildId: "build-mtu1gn28-ec03cfb2",
15238
15371
  referenceId: "auth.password/src/plugin/page-frame#default",
15239
15372
  exportName: "default",
15240
15373
  props
@@ -15264,15 +15397,15 @@ function RecoveryPage(props) {
15264
15397
  }
15265
15398
  function PageFrame({
15266
15399
  children,
15267
- description,
15400
+ description: description2,
15268
15401
  shell,
15269
15402
  site,
15270
- title
15403
+ title: title2
15271
15404
  }) {
15272
15405
  return /* @__PURE__ */ jsxs(Fragment, { children: [
15273
15406
  /* @__PURE__ */ jsx(ZlooksSeo, { seo: createZlooksPageSeo({
15274
- title,
15275
- description,
15407
+ title: title2,
15408
+ description: description2,
15276
15409
  origin: shell.origin,
15277
15410
  pathname: shell.pathname,
15278
15411
  siteName: site.value.identity.name,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zlooks.cn/password-auth-server",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "engines": {
@@ -60,8 +60,8 @@
60
60
  "@zlooks.cn/infrastructure": "1.0.0",
61
61
  "@zlooks.cn/registry-config": "1.0.0",
62
62
  "@zlooks.cn/service-command": "1.0.0",
63
- "@zlooks.cn/ui": "1.0.1",
64
- "@zlooks.cn/user-shared": "1.0.0",
63
+ "@zlooks.cn/ui": "1.0.2",
64
+ "@zlooks.cn/user-shared": "1.0.1",
65
65
  "@zlooks.cn/utils": "1.0.0",
66
66
  "antd": "6.6.1",
67
67
  "detect-port": "2.1.0",
@@ -86,5 +86,5 @@
86
86
  "typescript": "7.0.2",
87
87
  "vitest": "4.1.11"
88
88
  },
89
- "gitHead": "d0c3ea8bfcf3040e8f3556f328fb96baac3b4935"
89
+ "gitHead": "b118899f7646d3cb4e82563f0d32f68238bb38d0"
90
90
  }