@jskit-ai/crud-ui-generator 0.1.29 → 0.1.31

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.
@@ -1,7 +1,7 @@
1
1
  export default Object.freeze({
2
2
  packageVersion: 1,
3
3
  packageId: "@jskit-ai/crud-ui-generator",
4
- version: "0.1.29",
4
+ version: "0.1.31",
5
5
  kind: "generator",
6
6
  description: "Generate CRUD route trees from resource validators at an explicit route root relative to src/pages/.",
7
7
  options: {
@@ -70,7 +70,7 @@ export default Object.freeze({
70
70
  inputType: "text",
71
71
  defaultValue: "",
72
72
  promptLabel: "Namespace override",
73
- promptHint: "Optional CRUD namespace override when the resource export does not expose resource.resource."
73
+ promptHint: "Optional CRUD namespace override when the resource export does not expose resource.namespace."
74
74
  }
75
75
  },
76
76
  dependsOn: [],
@@ -168,7 +168,7 @@ export default Object.freeze({
168
168
  mutations: {
169
169
  dependencies: {
170
170
  runtime: {
171
- "@jskit-ai/users-web": "0.1.61"
171
+ "@jskit-ai/users-web": "0.1.63"
172
172
  },
173
173
  dev: {}
174
174
  },
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@jskit-ai/crud-ui-generator",
3
- "version": "0.1.29",
3
+ "version": "0.1.31",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "test": "node --test"
7
7
  },
8
8
  "dependencies": {
9
- "@jskit-ai/crud-core": "0.1.54",
10
- "@jskit-ai/kernel": "0.1.46"
9
+ "@jskit-ai/crud-core": "0.1.56",
10
+ "@jskit-ai/kernel": "0.1.48"
11
11
  },
12
12
  "exports": {
13
13
  "./server/buildTemplateContext": "./src/server/buildTemplateContext.js"
@@ -305,7 +305,7 @@ function resolveResourceNamespace(resource = {}, pageTarget = {}, options = {})
305
305
  return explicitNamespace;
306
306
  }
307
307
 
308
- const resourceNamespace = normalizeText(resource?.resource).toLowerCase();
308
+ const resourceNamespace = normalizeText(resource?.namespace).toLowerCase();
309
309
  if (resourceNamespace) {
310
310
  return resourceNamespace;
311
311
  }
@@ -480,9 +480,11 @@ function buildResourceFieldMetaMap(resource = {}) {
480
480
  const nextEntry = {
481
481
  key
482
482
  };
483
- const dbColumn = normalizeText(rawEntry.dbColumn);
484
- if (dbColumn) {
485
- nextEntry.dbColumn = dbColumn;
483
+ const repositoryColumn = normalizeText(rawEntry?.repository?.column);
484
+ if (repositoryColumn) {
485
+ nextEntry.repository = {
486
+ column: repositoryColumn
487
+ };
486
488
  }
487
489
 
488
490
  const relation = normalizeLookupRelation(rawEntry.relation);
@@ -82,7 +82,7 @@ const customerBodySchema = {
82
82
  };
83
83
 
84
84
  const resource = {
85
- resource: "customers",
85
+ namespace: "customers",
86
86
  operations: {
87
87
  list: {
88
88
  outputValidator: {
@@ -146,7 +146,7 @@ const customerBodySchema = {
146
146
  };
147
147
 
148
148
  const resource = {
149
- resource: "customers",
149
+ namespace: "customers",
150
150
  operations: {
151
151
  list: {
152
152
  outputValidator: {
@@ -210,7 +210,7 @@ const bodySchema = {
210
210
  };
211
211
 
212
212
  const resource = {
213
- resource: "customers",
213
+ namespace: "customers",
214
214
  operations: {
215
215
  list: {
216
216
  outputValidator: {
@@ -391,16 +391,16 @@ test("buildUiTemplateContext derives menu auth visibility from the target surfac
391
391
  })
392
392
  });
393
393
 
394
- assert.equal(context.__JSKIT_UI_MENU_WHEN_LINE__, " when: ({ auth }) => Boolean(auth?.authenticated)\n");
394
+ assert.equal(context.__JSKIT_UI_MENU_WHEN_LINE__, " when: ({ auth }) => auth?.authenticated === true\n");
395
395
  });
396
396
  });
397
397
 
398
- test("buildUiTemplateContext falls back to target-root leaf for namespace when resource.resource is missing", async () => {
398
+ test("buildUiTemplateContext falls back to target-root leaf for namespace when resource.namespace is missing", async () => {
399
399
  await withTempApp(async (appRoot) => {
400
400
  await writeResource(
401
401
  appRoot,
402
402
  RESOURCE_FILE,
403
- FULL_RESOURCE_SOURCE.replace(' resource: "customers",\n', "")
403
+ FULL_RESOURCE_SOURCE.replace(' namespace: "customers",\n', "")
404
404
  );
405
405
 
406
406
  const context = await buildUiTemplateContext({