@dereekb/dbx-cli 13.12.4 → 13.12.6
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/firebase-api-manifest/main.js +32 -3
- package/firebase-api-manifest/package.json +3 -3
- package/generate-firestore-indexes/main.js +2 -2
- package/generate-firestore-indexes/package.json +2 -2
- package/generate-mcp-manifest/package.json +3 -3
- package/lint-cache/package.json +2 -2
- package/manifest-extract/index.cjs.js +120 -11
- package/manifest-extract/index.esm.js +120 -11
- package/manifest-extract/package.json +2 -2
- package/manifest-extract/src/lib/types.d.ts +12 -0
- package/package.json +6 -6
- package/test/package.json +9 -9
|
@@ -244,6 +244,7 @@ function extractCrudEntries(source) {
|
|
|
244
244
|
description: readJsDocSummary(member),
|
|
245
245
|
paramsTypeDescription: paramsDocs?.typeDescription,
|
|
246
246
|
paramsFields: paramsDocs?.fields,
|
|
247
|
+
paramsHasApiParamsTag: paramsDocs?.hasApiParamsTag,
|
|
247
248
|
resultTypeDescription: resultDocs?.typeDescription,
|
|
248
249
|
resultFields: resultDocs?.fields
|
|
249
250
|
});
|
|
@@ -334,6 +335,7 @@ function collectVerbEntries(input) {
|
|
|
334
335
|
description: readJsDocSummary(specMember),
|
|
335
336
|
paramsTypeDescription: paramsDocs2?.typeDescription,
|
|
336
337
|
paramsFields: paramsDocs2?.fields,
|
|
338
|
+
paramsHasApiParamsTag: paramsDocs2?.hasApiParamsTag,
|
|
337
339
|
resultTypeDescription: resultDocs2?.typeDescription,
|
|
338
340
|
resultFields: resultDocs2?.fields
|
|
339
341
|
});
|
|
@@ -353,6 +355,7 @@ function collectVerbEntries(input) {
|
|
|
353
355
|
description: fallbackDescription,
|
|
354
356
|
paramsTypeDescription: paramsDocs?.typeDescription,
|
|
355
357
|
paramsFields: paramsDocs?.fields,
|
|
358
|
+
paramsHasApiParamsTag: paramsDocs?.hasApiParamsTag,
|
|
356
359
|
resultTypeDescription: resultDocs?.typeDescription,
|
|
357
360
|
resultFields: resultDocs?.fields
|
|
358
361
|
});
|
|
@@ -388,17 +391,28 @@ function readTypeDocs(sourceFile, typeName) {
|
|
|
388
391
|
const interfaceDecl = sourceFile.getInterface(typeName);
|
|
389
392
|
if (interfaceDecl) {
|
|
390
393
|
const typeDescription = readJsDocSummary(interfaceDecl);
|
|
394
|
+
const hasApiParamsTag = hasJsDocFlag(interfaceDecl, "dbxModelApiParams");
|
|
391
395
|
const fields = [];
|
|
392
396
|
for (const property of interfaceDecl.getProperties()) {
|
|
393
397
|
const fieldName = property.getName();
|
|
394
398
|
const description = readJsDocSummary(property);
|
|
395
399
|
const typeNode = property.getTypeNode();
|
|
396
400
|
const typeText = typeNode?.getText().trim() ?? "";
|
|
397
|
-
const
|
|
401
|
+
const adminOnly = hasJsDocFlag(property, "dbxModelApiAdminOnly");
|
|
402
|
+
const field = {
|
|
403
|
+
name: fieldName,
|
|
404
|
+
typeText,
|
|
405
|
+
...description ? { description } : {},
|
|
406
|
+
...adminOnly ? { accessLevel: "adminOnly" } : {}
|
|
407
|
+
};
|
|
398
408
|
fields.push(field);
|
|
399
409
|
}
|
|
400
|
-
if (typeDescription || fields.length > 0) {
|
|
401
|
-
result = {
|
|
410
|
+
if (typeDescription || fields.length > 0 || hasApiParamsTag) {
|
|
411
|
+
result = {
|
|
412
|
+
...typeDescription ? { typeDescription } : {},
|
|
413
|
+
...fields.length > 0 ? { fields } : {},
|
|
414
|
+
hasApiParamsTag
|
|
415
|
+
};
|
|
402
416
|
}
|
|
403
417
|
} else {
|
|
404
418
|
const typeAlias = sourceFile.getTypeAlias(typeName);
|
|
@@ -411,6 +425,17 @@ function readTypeDocs(sourceFile, typeName) {
|
|
|
411
425
|
}
|
|
412
426
|
return result;
|
|
413
427
|
}
|
|
428
|
+
function hasJsDocFlag(node, tagName) {
|
|
429
|
+
let result = false;
|
|
430
|
+
for (const doc of node.getJsDocs()) {
|
|
431
|
+
for (const tag of doc.getTags()) {
|
|
432
|
+
if (tag.getTagName() === tagName) {
|
|
433
|
+
result = true;
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
return result;
|
|
438
|
+
}
|
|
414
439
|
function readJsDocSummary(node) {
|
|
415
440
|
let result;
|
|
416
441
|
const docs = node.getJsDocs();
|
|
@@ -1457,6 +1482,10 @@ async function main() {
|
|
|
1457
1482
|
const specPart = entry.specifier ? "/" + entry.specifier : "";
|
|
1458
1483
|
console.warn(`[no-validator] ${pkg.packageName} \xB7 ${entry.model}/${entry.verb}${specPart} \u2192 ${validatorName} not exported`);
|
|
1459
1484
|
}
|
|
1485
|
+
if (entry.paramsHasApiParamsTag === false) {
|
|
1486
|
+
const specPart = entry.specifier ? "/" + entry.specifier : "";
|
|
1487
|
+
console.warn(`[no-api-params-tag] ${pkg.packageName} \xB7 ${entry.model}/${entry.verb}${specPart} \u2192 ${entry.paramsTypeName} missing @dbxModelApiParams`);
|
|
1488
|
+
}
|
|
1460
1489
|
}
|
|
1461
1490
|
collected.push(enriched);
|
|
1462
1491
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dereekb/dbx-cli-firebase-api-manifest",
|
|
3
|
-
"version": "13.12.
|
|
3
|
+
"version": "13.12.6",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"devDependencies": {
|
|
7
7
|
"ts-morph": "^21.0.0"
|
|
8
8
|
},
|
|
9
9
|
"peerDependencies": {
|
|
10
|
-
"@dereekb/dbx-cli": "13.12.
|
|
11
|
-
"@dereekb/util": "13.12.
|
|
10
|
+
"@dereekb/dbx-cli": "13.12.6",
|
|
11
|
+
"@dereekb/util": "13.12.6",
|
|
12
12
|
"prettier": "3.8.3"
|
|
13
13
|
}
|
|
14
14
|
}
|
|
@@ -5,14 +5,14 @@ const require = __createRequire(import.meta.url);
|
|
|
5
5
|
// packages/dbx-cli/generate-firestore-indexes/package.json
|
|
6
6
|
var package_default = {
|
|
7
7
|
name: "@dereekb/dbx-cli-generate-firestore-indexes",
|
|
8
|
-
version: "13.12.
|
|
8
|
+
version: "13.12.6",
|
|
9
9
|
private: true,
|
|
10
10
|
type: "module",
|
|
11
11
|
devDependencies: {
|
|
12
12
|
eslint: "10.4.0"
|
|
13
13
|
},
|
|
14
14
|
peerDependencies: {
|
|
15
|
-
"@dereekb/dbx-cli": "13.12.
|
|
15
|
+
"@dereekb/dbx-cli": "13.12.6"
|
|
16
16
|
}
|
|
17
17
|
};
|
|
18
18
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dereekb/dbx-cli-generate-firestore-indexes",
|
|
3
|
-
"version": "13.12.
|
|
3
|
+
"version": "13.12.6",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"devDependencies": {
|
|
7
7
|
"eslint": "10.4.0"
|
|
8
8
|
},
|
|
9
9
|
"peerDependencies": {
|
|
10
|
-
"@dereekb/dbx-cli": "13.12.
|
|
10
|
+
"@dereekb/dbx-cli": "13.12.6"
|
|
11
11
|
}
|
|
12
12
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dereekb/dbx-cli-generate-mcp-manifest",
|
|
3
|
-
"version": "13.12.
|
|
3
|
+
"version": "13.12.6",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"peerDependencies": {
|
|
7
|
-
"@dereekb/dbx-cli": "13.12.
|
|
8
|
-
"@dereekb/model": "13.12.
|
|
7
|
+
"@dereekb/dbx-cli": "13.12.6",
|
|
8
|
+
"@dereekb/model": "13.12.6",
|
|
9
9
|
"arktype": "^2.2.0",
|
|
10
10
|
"jiti": "2.6.1"
|
|
11
11
|
}
|
package/lint-cache/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dereekb/dbx-cli-lint-cache",
|
|
3
|
-
"version": "13.12.
|
|
3
|
+
"version": "13.12.6",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"devDependencies": {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"eslint": "10.4.0"
|
|
9
9
|
},
|
|
10
10
|
"peerDependencies": {
|
|
11
|
-
"@dereekb/util": "13.12.
|
|
11
|
+
"@dereekb/util": "13.12.6",
|
|
12
12
|
"yargs": "^18.0.0"
|
|
13
13
|
}
|
|
14
14
|
}
|
|
@@ -2,6 +2,53 @@
|
|
|
2
2
|
|
|
3
3
|
var tsMorph = require('ts-morph');
|
|
4
4
|
|
|
5
|
+
function _define_property$1(obj, key, value) {
|
|
6
|
+
if (key in obj) {
|
|
7
|
+
Object.defineProperty(obj, key, {
|
|
8
|
+
value: value,
|
|
9
|
+
enumerable: true,
|
|
10
|
+
configurable: true,
|
|
11
|
+
writable: true
|
|
12
|
+
});
|
|
13
|
+
} else {
|
|
14
|
+
obj[key] = value;
|
|
15
|
+
}
|
|
16
|
+
return obj;
|
|
17
|
+
}
|
|
18
|
+
function _object_spread$1(target) {
|
|
19
|
+
for(var i = 1; i < arguments.length; i++){
|
|
20
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
21
|
+
var ownKeys = Object.keys(source);
|
|
22
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
23
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
24
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
25
|
+
}));
|
|
26
|
+
}
|
|
27
|
+
ownKeys.forEach(function(key) {
|
|
28
|
+
_define_property$1(target, key, source[key]);
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
return target;
|
|
32
|
+
}
|
|
33
|
+
function ownKeys(object, enumerableOnly) {
|
|
34
|
+
var keys = Object.keys(object);
|
|
35
|
+
if (Object.getOwnPropertySymbols) {
|
|
36
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
37
|
+
keys.push.apply(keys, symbols);
|
|
38
|
+
}
|
|
39
|
+
return keys;
|
|
40
|
+
}
|
|
41
|
+
function _object_spread_props(target, source) {
|
|
42
|
+
source = source != null ? source : {};
|
|
43
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
44
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
45
|
+
} else {
|
|
46
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
47
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
return target;
|
|
51
|
+
}
|
|
5
52
|
var SUPPORTED_VERBS = new Set([
|
|
6
53
|
'create',
|
|
7
54
|
'read',
|
|
@@ -150,6 +197,7 @@ function extractCrudEntries(source) {
|
|
|
150
197
|
description: readJsDocSummary(member1),
|
|
151
198
|
paramsTypeDescription: paramsDocs === null || paramsDocs === void 0 ? void 0 : paramsDocs.typeDescription,
|
|
152
199
|
paramsFields: paramsDocs === null || paramsDocs === void 0 ? void 0 : paramsDocs.fields,
|
|
200
|
+
paramsHasApiParamsTag: paramsDocs === null || paramsDocs === void 0 ? void 0 : paramsDocs.hasApiParamsTag,
|
|
153
201
|
resultTypeDescription: resultDocs === null || resultDocs === void 0 ? void 0 : resultDocs.typeDescription,
|
|
154
202
|
resultFields: resultDocs === null || resultDocs === void 0 ? void 0 : resultDocs.fields
|
|
155
203
|
});
|
|
@@ -332,6 +380,7 @@ function collectVerbEntries(input) {
|
|
|
332
380
|
description: readJsDocSummary(specMember),
|
|
333
381
|
paramsTypeDescription: paramsDocs === null || paramsDocs === void 0 ? void 0 : paramsDocs.typeDescription,
|
|
334
382
|
paramsFields: paramsDocs === null || paramsDocs === void 0 ? void 0 : paramsDocs.fields,
|
|
383
|
+
paramsHasApiParamsTag: paramsDocs === null || paramsDocs === void 0 ? void 0 : paramsDocs.hasApiParamsTag,
|
|
335
384
|
resultTypeDescription: resultDocs === null || resultDocs === void 0 ? void 0 : resultDocs.typeDescription,
|
|
336
385
|
resultFields: resultDocs === null || resultDocs === void 0 ? void 0 : resultDocs.fields
|
|
337
386
|
});
|
|
@@ -365,6 +414,7 @@ function collectVerbEntries(input) {
|
|
|
365
414
|
description: fallbackDescription,
|
|
366
415
|
paramsTypeDescription: paramsDocs1 === null || paramsDocs1 === void 0 ? void 0 : paramsDocs1.typeDescription,
|
|
367
416
|
paramsFields: paramsDocs1 === null || paramsDocs1 === void 0 ? void 0 : paramsDocs1.fields,
|
|
417
|
+
paramsHasApiParamsTag: paramsDocs1 === null || paramsDocs1 === void 0 ? void 0 : paramsDocs1.hasApiParamsTag,
|
|
368
418
|
resultTypeDescription: resultDocs1 === null || resultDocs1 === void 0 ? void 0 : resultDocs1.typeDescription,
|
|
369
419
|
resultFields: resultDocs1 === null || resultDocs1 === void 0 ? void 0 : resultDocs1.fields
|
|
370
420
|
});
|
|
@@ -407,6 +457,7 @@ function readTypeDocs(sourceFile, typeName) {
|
|
|
407
457
|
var interfaceDecl = sourceFile.getInterface(typeName);
|
|
408
458
|
if (interfaceDecl) {
|
|
409
459
|
var typeDescription = readJsDocSummary(interfaceDecl);
|
|
460
|
+
var hasApiParamsTag = hasJsDocFlag(interfaceDecl, 'dbxModelApiParams');
|
|
410
461
|
var fields = [];
|
|
411
462
|
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
412
463
|
try {
|
|
@@ -417,14 +468,15 @@ function readTypeDocs(sourceFile, typeName) {
|
|
|
417
468
|
var description = readJsDocSummary(property);
|
|
418
469
|
var typeNode = property.getTypeNode();
|
|
419
470
|
var typeText = (_ref = typeNode === null || typeNode === void 0 ? void 0 : typeNode.getText().trim()) !== null && _ref !== void 0 ? _ref : '';
|
|
420
|
-
var
|
|
421
|
-
|
|
422
|
-
typeText: typeText,
|
|
423
|
-
description: description
|
|
424
|
-
} : {
|
|
471
|
+
var adminOnly = hasJsDocFlag(property, 'dbxModelApiAdminOnly');
|
|
472
|
+
var field = _object_spread$1({
|
|
425
473
|
name: fieldName,
|
|
426
474
|
typeText: typeText
|
|
427
|
-
}
|
|
475
|
+
}, description ? {
|
|
476
|
+
description: description
|
|
477
|
+
} : {}, adminOnly ? {
|
|
478
|
+
accessLevel: 'adminOnly'
|
|
479
|
+
} : {});
|
|
428
480
|
fields.push(field);
|
|
429
481
|
}
|
|
430
482
|
} catch (err) {
|
|
@@ -441,11 +493,14 @@ function readTypeDocs(sourceFile, typeName) {
|
|
|
441
493
|
}
|
|
442
494
|
}
|
|
443
495
|
}
|
|
444
|
-
if (typeDescription || fields.length > 0) {
|
|
445
|
-
result = {
|
|
446
|
-
typeDescription: typeDescription
|
|
447
|
-
|
|
448
|
-
|
|
496
|
+
if (typeDescription || fields.length > 0 || hasApiParamsTag) {
|
|
497
|
+
result = _object_spread_props(_object_spread$1({}, typeDescription ? {
|
|
498
|
+
typeDescription: typeDescription
|
|
499
|
+
} : {}, fields.length > 0 ? {
|
|
500
|
+
fields: fields
|
|
501
|
+
} : {}), {
|
|
502
|
+
hasApiParamsTag: hasApiParamsTag
|
|
503
|
+
});
|
|
449
504
|
}
|
|
450
505
|
} else {
|
|
451
506
|
var typeAlias = sourceFile.getTypeAlias(typeName);
|
|
@@ -460,6 +515,60 @@ function readTypeDocs(sourceFile, typeName) {
|
|
|
460
515
|
}
|
|
461
516
|
return result;
|
|
462
517
|
}
|
|
518
|
+
/**
|
|
519
|
+
* Returns `true` when any JSDoc block on `node` carries the bare `@<tagName>` flag.
|
|
520
|
+
*
|
|
521
|
+
* Used for boolean marker tags like `@dbxModelApiParams` and `@dbxModelApiAdminOnly`
|
|
522
|
+
* where the presence of the tag is the entire signal (no value parsing needed).
|
|
523
|
+
*
|
|
524
|
+
* @param node - Any JSDocable ts-morph node (interface, property, etc.).
|
|
525
|
+
* @param tagName - Tag name without the leading `@` (e.g. `'dbxModelApiAdminOnly'`).
|
|
526
|
+
* @returns `true` when at least one JSDoc tag with `tagName` is present.
|
|
527
|
+
*/ function hasJsDocFlag(node, tagName) {
|
|
528
|
+
var result = false;
|
|
529
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
530
|
+
try {
|
|
531
|
+
for(var _iterator = node.getJsDocs()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
532
|
+
var doc = _step.value;
|
|
533
|
+
var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;
|
|
534
|
+
try {
|
|
535
|
+
for(var _iterator1 = doc.getTags()[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true){
|
|
536
|
+
var tag = _step1.value;
|
|
537
|
+
if (tag.getTagName() === tagName) {
|
|
538
|
+
result = true;
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
} catch (err) {
|
|
542
|
+
_didIteratorError1 = true;
|
|
543
|
+
_iteratorError1 = err;
|
|
544
|
+
} finally{
|
|
545
|
+
try {
|
|
546
|
+
if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
|
|
547
|
+
_iterator1.return();
|
|
548
|
+
}
|
|
549
|
+
} finally{
|
|
550
|
+
if (_didIteratorError1) {
|
|
551
|
+
throw _iteratorError1;
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
} catch (err) {
|
|
557
|
+
_didIteratorError = true;
|
|
558
|
+
_iteratorError = err;
|
|
559
|
+
} finally{
|
|
560
|
+
try {
|
|
561
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
562
|
+
_iterator.return();
|
|
563
|
+
}
|
|
564
|
+
} finally{
|
|
565
|
+
if (_didIteratorError) {
|
|
566
|
+
throw _iteratorError;
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
return result;
|
|
571
|
+
}
|
|
463
572
|
function readJsDocSummary(node) {
|
|
464
573
|
var result;
|
|
465
574
|
var docs = node.getJsDocs();
|
|
@@ -1,5 +1,52 @@
|
|
|
1
1
|
import { Project, Node } from 'ts-morph';
|
|
2
2
|
|
|
3
|
+
function _define_property$1(obj, key, value) {
|
|
4
|
+
if (key in obj) {
|
|
5
|
+
Object.defineProperty(obj, key, {
|
|
6
|
+
value: value,
|
|
7
|
+
enumerable: true,
|
|
8
|
+
configurable: true,
|
|
9
|
+
writable: true
|
|
10
|
+
});
|
|
11
|
+
} else {
|
|
12
|
+
obj[key] = value;
|
|
13
|
+
}
|
|
14
|
+
return obj;
|
|
15
|
+
}
|
|
16
|
+
function _object_spread$1(target) {
|
|
17
|
+
for(var i = 1; i < arguments.length; i++){
|
|
18
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
19
|
+
var ownKeys = Object.keys(source);
|
|
20
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
21
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
22
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
23
|
+
}));
|
|
24
|
+
}
|
|
25
|
+
ownKeys.forEach(function(key) {
|
|
26
|
+
_define_property$1(target, key, source[key]);
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
return target;
|
|
30
|
+
}
|
|
31
|
+
function ownKeys(object, enumerableOnly) {
|
|
32
|
+
var keys = Object.keys(object);
|
|
33
|
+
if (Object.getOwnPropertySymbols) {
|
|
34
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
35
|
+
keys.push.apply(keys, symbols);
|
|
36
|
+
}
|
|
37
|
+
return keys;
|
|
38
|
+
}
|
|
39
|
+
function _object_spread_props(target, source) {
|
|
40
|
+
source = source != null ? source : {};
|
|
41
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
42
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
43
|
+
} else {
|
|
44
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
45
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
return target;
|
|
49
|
+
}
|
|
3
50
|
var SUPPORTED_VERBS = new Set([
|
|
4
51
|
'create',
|
|
5
52
|
'read',
|
|
@@ -148,6 +195,7 @@ function extractCrudEntries(source) {
|
|
|
148
195
|
description: readJsDocSummary(member1),
|
|
149
196
|
paramsTypeDescription: paramsDocs === null || paramsDocs === void 0 ? void 0 : paramsDocs.typeDescription,
|
|
150
197
|
paramsFields: paramsDocs === null || paramsDocs === void 0 ? void 0 : paramsDocs.fields,
|
|
198
|
+
paramsHasApiParamsTag: paramsDocs === null || paramsDocs === void 0 ? void 0 : paramsDocs.hasApiParamsTag,
|
|
151
199
|
resultTypeDescription: resultDocs === null || resultDocs === void 0 ? void 0 : resultDocs.typeDescription,
|
|
152
200
|
resultFields: resultDocs === null || resultDocs === void 0 ? void 0 : resultDocs.fields
|
|
153
201
|
});
|
|
@@ -330,6 +378,7 @@ function collectVerbEntries(input) {
|
|
|
330
378
|
description: readJsDocSummary(specMember),
|
|
331
379
|
paramsTypeDescription: paramsDocs === null || paramsDocs === void 0 ? void 0 : paramsDocs.typeDescription,
|
|
332
380
|
paramsFields: paramsDocs === null || paramsDocs === void 0 ? void 0 : paramsDocs.fields,
|
|
381
|
+
paramsHasApiParamsTag: paramsDocs === null || paramsDocs === void 0 ? void 0 : paramsDocs.hasApiParamsTag,
|
|
333
382
|
resultTypeDescription: resultDocs === null || resultDocs === void 0 ? void 0 : resultDocs.typeDescription,
|
|
334
383
|
resultFields: resultDocs === null || resultDocs === void 0 ? void 0 : resultDocs.fields
|
|
335
384
|
});
|
|
@@ -363,6 +412,7 @@ function collectVerbEntries(input) {
|
|
|
363
412
|
description: fallbackDescription,
|
|
364
413
|
paramsTypeDescription: paramsDocs1 === null || paramsDocs1 === void 0 ? void 0 : paramsDocs1.typeDescription,
|
|
365
414
|
paramsFields: paramsDocs1 === null || paramsDocs1 === void 0 ? void 0 : paramsDocs1.fields,
|
|
415
|
+
paramsHasApiParamsTag: paramsDocs1 === null || paramsDocs1 === void 0 ? void 0 : paramsDocs1.hasApiParamsTag,
|
|
366
416
|
resultTypeDescription: resultDocs1 === null || resultDocs1 === void 0 ? void 0 : resultDocs1.typeDescription,
|
|
367
417
|
resultFields: resultDocs1 === null || resultDocs1 === void 0 ? void 0 : resultDocs1.fields
|
|
368
418
|
});
|
|
@@ -405,6 +455,7 @@ function readTypeDocs(sourceFile, typeName) {
|
|
|
405
455
|
var interfaceDecl = sourceFile.getInterface(typeName);
|
|
406
456
|
if (interfaceDecl) {
|
|
407
457
|
var typeDescription = readJsDocSummary(interfaceDecl);
|
|
458
|
+
var hasApiParamsTag = hasJsDocFlag(interfaceDecl, 'dbxModelApiParams');
|
|
408
459
|
var fields = [];
|
|
409
460
|
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
410
461
|
try {
|
|
@@ -415,14 +466,15 @@ function readTypeDocs(sourceFile, typeName) {
|
|
|
415
466
|
var description = readJsDocSummary(property);
|
|
416
467
|
var typeNode = property.getTypeNode();
|
|
417
468
|
var typeText = (_ref = typeNode === null || typeNode === void 0 ? void 0 : typeNode.getText().trim()) !== null && _ref !== void 0 ? _ref : '';
|
|
418
|
-
var
|
|
419
|
-
|
|
420
|
-
typeText: typeText,
|
|
421
|
-
description: description
|
|
422
|
-
} : {
|
|
469
|
+
var adminOnly = hasJsDocFlag(property, 'dbxModelApiAdminOnly');
|
|
470
|
+
var field = _object_spread$1({
|
|
423
471
|
name: fieldName,
|
|
424
472
|
typeText: typeText
|
|
425
|
-
}
|
|
473
|
+
}, description ? {
|
|
474
|
+
description: description
|
|
475
|
+
} : {}, adminOnly ? {
|
|
476
|
+
accessLevel: 'adminOnly'
|
|
477
|
+
} : {});
|
|
426
478
|
fields.push(field);
|
|
427
479
|
}
|
|
428
480
|
} catch (err) {
|
|
@@ -439,11 +491,14 @@ function readTypeDocs(sourceFile, typeName) {
|
|
|
439
491
|
}
|
|
440
492
|
}
|
|
441
493
|
}
|
|
442
|
-
if (typeDescription || fields.length > 0) {
|
|
443
|
-
result = {
|
|
444
|
-
typeDescription: typeDescription
|
|
445
|
-
|
|
446
|
-
|
|
494
|
+
if (typeDescription || fields.length > 0 || hasApiParamsTag) {
|
|
495
|
+
result = _object_spread_props(_object_spread$1({}, typeDescription ? {
|
|
496
|
+
typeDescription: typeDescription
|
|
497
|
+
} : {}, fields.length > 0 ? {
|
|
498
|
+
fields: fields
|
|
499
|
+
} : {}), {
|
|
500
|
+
hasApiParamsTag: hasApiParamsTag
|
|
501
|
+
});
|
|
447
502
|
}
|
|
448
503
|
} else {
|
|
449
504
|
var typeAlias = sourceFile.getTypeAlias(typeName);
|
|
@@ -458,6 +513,60 @@ function readTypeDocs(sourceFile, typeName) {
|
|
|
458
513
|
}
|
|
459
514
|
return result;
|
|
460
515
|
}
|
|
516
|
+
/**
|
|
517
|
+
* Returns `true` when any JSDoc block on `node` carries the bare `@<tagName>` flag.
|
|
518
|
+
*
|
|
519
|
+
* Used for boolean marker tags like `@dbxModelApiParams` and `@dbxModelApiAdminOnly`
|
|
520
|
+
* where the presence of the tag is the entire signal (no value parsing needed).
|
|
521
|
+
*
|
|
522
|
+
* @param node - Any JSDocable ts-morph node (interface, property, etc.).
|
|
523
|
+
* @param tagName - Tag name without the leading `@` (e.g. `'dbxModelApiAdminOnly'`).
|
|
524
|
+
* @returns `true` when at least one JSDoc tag with `tagName` is present.
|
|
525
|
+
*/ function hasJsDocFlag(node, tagName) {
|
|
526
|
+
var result = false;
|
|
527
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
528
|
+
try {
|
|
529
|
+
for(var _iterator = node.getJsDocs()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
530
|
+
var doc = _step.value;
|
|
531
|
+
var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;
|
|
532
|
+
try {
|
|
533
|
+
for(var _iterator1 = doc.getTags()[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true){
|
|
534
|
+
var tag = _step1.value;
|
|
535
|
+
if (tag.getTagName() === tagName) {
|
|
536
|
+
result = true;
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
} catch (err) {
|
|
540
|
+
_didIteratorError1 = true;
|
|
541
|
+
_iteratorError1 = err;
|
|
542
|
+
} finally{
|
|
543
|
+
try {
|
|
544
|
+
if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
|
|
545
|
+
_iterator1.return();
|
|
546
|
+
}
|
|
547
|
+
} finally{
|
|
548
|
+
if (_didIteratorError1) {
|
|
549
|
+
throw _iteratorError1;
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
} catch (err) {
|
|
555
|
+
_didIteratorError = true;
|
|
556
|
+
_iteratorError = err;
|
|
557
|
+
} finally{
|
|
558
|
+
try {
|
|
559
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
560
|
+
_iterator.return();
|
|
561
|
+
}
|
|
562
|
+
} finally{
|
|
563
|
+
if (_didIteratorError) {
|
|
564
|
+
throw _iteratorError;
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
return result;
|
|
569
|
+
}
|
|
461
570
|
function readJsDocSummary(node) {
|
|
462
571
|
var result;
|
|
463
572
|
var docs = node.getJsDocs();
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dereekb/dbx-cli/manifest-extract",
|
|
3
|
-
"version": "13.12.
|
|
3
|
+
"version": "13.12.6",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"peerDependencies": {
|
|
6
6
|
"ts-morph": "^21.0.0"
|
|
7
7
|
},
|
|
8
8
|
"devDependencies": {
|
|
9
|
-
"@dereekb/firebase": "13.12.
|
|
9
|
+
"@dereekb/firebase": "13.12.6"
|
|
10
10
|
},
|
|
11
11
|
"exports": {
|
|
12
12
|
"./package.json": "./package.json",
|
|
@@ -14,6 +14,11 @@ export interface CrudEntryDocField {
|
|
|
14
14
|
readonly name: string;
|
|
15
15
|
readonly typeText: string;
|
|
16
16
|
readonly description?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Access posture parsed from the property's `@dbxModelApiAdminOnly` JSDoc flag.
|
|
19
|
+
* Omitted when the flag is absent (treated as `'public'` by consumers).
|
|
20
|
+
*/
|
|
21
|
+
readonly accessLevel?: 'public' | 'adminOnly';
|
|
17
22
|
}
|
|
18
23
|
export interface CrudEntry {
|
|
19
24
|
/**
|
|
@@ -57,6 +62,13 @@ export interface CrudEntry {
|
|
|
57
62
|
* Per-field JSDocs read from the params interface's properties.
|
|
58
63
|
*/
|
|
59
64
|
readonly paramsFields?: readonly CrudEntryDocField[];
|
|
65
|
+
/**
|
|
66
|
+
* `true` when the resolved params interface carries the `@dbxModelApiParams` marker tag,
|
|
67
|
+
* `false` when it is present but untagged. `undefined` when no params interface could be
|
|
68
|
+
* resolved (e.g. bare primitive params). Used by the manifest builder to warn about
|
|
69
|
+
* params types referenced from CRUD config that are missing the marker.
|
|
70
|
+
*/
|
|
71
|
+
readonly paramsHasApiParamsTag?: boolean;
|
|
60
72
|
/**
|
|
61
73
|
* JSDoc summary on the result interface itself (e.g. on `DownloadProfileArchiveResult`).
|
|
62
74
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dereekb/dbx-cli",
|
|
3
|
-
"version": "13.12.
|
|
3
|
+
"version": "13.12.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"bin": {
|
|
@@ -41,11 +41,11 @@
|
|
|
41
41
|
}
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
|
-
"@dereekb/date": "13.12.
|
|
45
|
-
"@dereekb/firebase": "13.12.
|
|
46
|
-
"@dereekb/model": "13.12.
|
|
47
|
-
"@dereekb/nestjs": "13.12.
|
|
48
|
-
"@dereekb/util": "13.12.
|
|
44
|
+
"@dereekb/date": "13.12.6",
|
|
45
|
+
"@dereekb/firebase": "13.12.6",
|
|
46
|
+
"@dereekb/model": "13.12.6",
|
|
47
|
+
"@dereekb/nestjs": "13.12.6",
|
|
48
|
+
"@dereekb/util": "13.12.6",
|
|
49
49
|
"@nestjs/common": "^11.1.19",
|
|
50
50
|
"arktype": "^2.2.0",
|
|
51
51
|
"jiti": "2.6.1",
|
package/test/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dereekb/dbx-cli/test",
|
|
3
|
-
"version": "13.12.
|
|
3
|
+
"version": "13.12.6",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
-
"@dereekb/date": "13.12.
|
|
6
|
-
"@dereekb/dbx-cli": "13.12.
|
|
7
|
-
"@dereekb/firebase": "13.12.
|
|
8
|
-
"@dereekb/firebase-server/test": "13.12.
|
|
9
|
-
"@dereekb/model": "13.12.
|
|
10
|
-
"@dereekb/nestjs": "13.12.
|
|
11
|
-
"@dereekb/rxjs": "13.12.
|
|
12
|
-
"@dereekb/util": "13.12.
|
|
5
|
+
"@dereekb/date": "13.12.6",
|
|
6
|
+
"@dereekb/dbx-cli": "13.12.6",
|
|
7
|
+
"@dereekb/firebase": "13.12.6",
|
|
8
|
+
"@dereekb/firebase-server/test": "13.12.6",
|
|
9
|
+
"@dereekb/model": "13.12.6",
|
|
10
|
+
"@dereekb/nestjs": "13.12.6",
|
|
11
|
+
"@dereekb/rxjs": "13.12.6",
|
|
12
|
+
"@dereekb/util": "13.12.6",
|
|
13
13
|
"@nestjs/common": "^11.1.19",
|
|
14
14
|
"arktype": "^2.2.0",
|
|
15
15
|
"vitest": "4.1.5",
|