@jskit-ai/kernel 0.1.31 → 0.1.33

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jskit-ai/kernel",
3
- "version": "0.1.31",
3
+ "version": "0.1.33",
4
4
  "type": "module",
5
5
  "dependencies": {
6
6
  "typebox": "^1.0.81"
@@ -236,7 +236,7 @@ test("registerRoutes attaches visibilityContext from route visibility resolvers"
236
236
  }
237
237
 
238
238
  return {
239
- userOwnerId: context?.actor?.id,
239
+ userId: context?.actor?.id,
240
240
  requiresActorScope: true
241
241
  };
242
242
  }
@@ -281,7 +281,7 @@ test("registerRoutes attaches visibilityContext from route visibility resolvers"
281
281
  scopeKind: null,
282
282
  requiresActorScope: true,
283
283
  scopeOwnerId: null,
284
- userOwnerId: 23
284
+ userId: "23"
285
285
  });
286
286
  assert.deepEqual(observed[0].context.requestMeta.visibilityContext, observed[0].context.visibilityContext);
287
287
  assert.equal(observed[0].context.requestMeta.routeVisibility, "user");
@@ -309,7 +309,7 @@ test("registerRoutes keeps actor scope requirement for core user visibility with
309
309
  }
310
310
 
311
311
  return {
312
- userOwnerId: context?.actor?.id
312
+ userId: context?.actor?.id
313
313
  };
314
314
  }
315
315
  }));
@@ -353,7 +353,7 @@ test("registerRoutes keeps actor scope requirement for core user visibility with
353
353
  scopeKind: null,
354
354
  requiresActorScope: true,
355
355
  scopeOwnerId: null,
356
- userOwnerId: 23
356
+ userId: "23"
357
357
  });
358
358
  assert.equal(observed[0].context.requestMeta.routeVisibility, "user");
359
359
  });
@@ -399,7 +399,7 @@ test("registerRoutes does not infer actor scope from non-core route visibility t
399
399
  scopeKind: null,
400
400
  requiresActorScope: false,
401
401
  scopeOwnerId: null,
402
- userOwnerId: null
402
+ userId: null
403
403
  });
404
404
  assert.equal(observed[0].context.requestMeta.routeVisibility, "workspace_user");
405
405
  });
@@ -43,10 +43,10 @@ function resolveVisibilityScope(visibilityContext = {}, runtimeContext = {}) {
43
43
  const visibility = normalizeText(visibilityContext.visibility).toLowerCase();
44
44
  const scopeKind = normalizeText(visibilityContext.scopeKind || visibility).toLowerCase();
45
45
  const scopeOwnerId = normalizeOpaqueId(visibilityContext.scopeOwnerId);
46
- const userOwnerId = normalizeOpaqueId(visibilityContext.userOwnerId);
46
+ const userId = normalizeOpaqueId(visibilityContext.userId);
47
47
  const requiresActorScope = visibilityContext.requiresActorScope === true;
48
48
 
49
- if (requiresActorScope && userOwnerId == null) {
49
+ if (requiresActorScope && userId == null) {
50
50
  return null;
51
51
  }
52
52
 
@@ -57,7 +57,7 @@ function resolveVisibilityScope(visibilityContext = {}, runtimeContext = {}) {
57
57
  };
58
58
  if (requiresActorScope) {
59
59
  scope.scopeId = scopeOwnerId;
60
- scope.userId = userOwnerId;
60
+ scope.userId = userId;
61
61
  }
62
62
  return scope;
63
63
  }
@@ -72,10 +72,10 @@ function resolveVisibilityScope(visibilityContext = {}, runtimeContext = {}) {
72
72
  };
73
73
  }
74
74
 
75
- if (scopeKind === "user" && userOwnerId != null) {
75
+ if (scopeKind === "user" && userId != null) {
76
76
  return {
77
77
  kind: "user",
78
- id: userOwnerId
78
+ id: userId
79
79
  };
80
80
  }
81
81
 
@@ -33,9 +33,9 @@ test("entity change publisher emits normalized event payload", async () => {
33
33
  });
34
34
 
35
35
  assert.equal(payload?.operation, "created");
36
- assert.equal(payload?.entityId, 5);
37
- assert.deepEqual(payload?.scope, { kind: "scope", id: 23 });
38
- assert.equal(payload?.actorId, 17);
36
+ assert.equal(payload?.entityId, "5");
37
+ assert.deepEqual(payload?.scope, { kind: "scope", id: "23" });
38
+ assert.equal(payload?.actorId, "17");
39
39
  assert.equal(payload?.commandId, "cmd-1");
40
40
  assert.equal(payload?.sourceClientId, "client-a");
41
41
  assert.equal(payload?.meta?.service?.token, "crud.customers");
@@ -111,7 +111,7 @@ test("entity change publisher infers scoped owner from service context when visi
111
111
  }
112
112
  );
113
113
 
114
- assert.deepEqual(payload?.scope, { kind: "workspace", id: 23 });
114
+ assert.deepEqual(payload?.scope, { kind: "workspace", id: "23" });
115
115
  assert.equal(published.length, 1);
116
116
  });
117
117
 
@@ -133,7 +133,7 @@ test("entity change publisher supports opaque actor and scope identifiers", asyn
133
133
  visibilityContext: {
134
134
  scopeKind: "workspace_user",
135
135
  scopeOwnerId: "workspace_23",
136
- userOwnerId: "user_17",
136
+ userId: "user_17",
137
137
  requiresActorScope: true
138
138
  }
139
139
  }
@@ -24,7 +24,7 @@ test("requireAuth accepts actor context", () => {
24
24
  }
25
25
  });
26
26
 
27
- assert.equal(actor.id, 7);
27
+ assert.equal(actor.id, "7");
28
28
  });
29
29
 
30
30
  test("requireAuth accepts non-numeric actor ids", () => {
@@ -2,6 +2,16 @@ export { symlinkSafeRequire } from "./symlinkSafeRequire.js";
2
2
  export { resolveAppConfig } from "./appConfig.js";
3
3
  export { loadAppConfigFromModuleUrl } from "./appConfigFiles.js";
4
4
  export { resolveRequiredAppRoot, toPosixPath } from "./path.js";
5
+ export {
6
+ DEFAULT_PAGE_LINK_COMPONENT_TOKEN,
7
+ DEFAULT_SUBPAGE_LINK_COMPONENT_TOKEN,
8
+ normalizePagesRelativeTargetFile,
9
+ normalizePagesRelativeTargetRoot,
10
+ resolvePageTargetDetails,
11
+ deriveDefaultSubpagesHost,
12
+ resolveNearestParentSubpagesHost,
13
+ resolvePageLinkTargetDetails
14
+ } from "./pageTargets.js";
5
15
  export {
6
16
  discoverShellOutletTargetsFromApp,
7
17
  resolveShellOutletPlacementTargetFromApp