@mxpicture/gcp-functions-common 0.2.70 → 1.1.2

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 (119) hide show
  1. package/dist/annotation/anno.head.d.ts +7 -0
  2. package/dist/annotation/anno.head.d.ts.map +1 -0
  3. package/dist/annotation/anno.head.js +34 -0
  4. package/dist/annotation/anno.head.js.map +1 -0
  5. package/dist/annotation/anno.property.d.ts +4 -0
  6. package/dist/annotation/anno.property.d.ts.map +1 -0
  7. package/dist/annotation/anno.property.js +14 -0
  8. package/dist/annotation/anno.property.js.map +1 -0
  9. package/dist/annotation/index.d.ts +3 -0
  10. package/dist/annotation/index.d.ts.map +1 -0
  11. package/dist/annotation/index.js +4 -0
  12. package/dist/annotation/index.js.map +1 -0
  13. package/dist/decorator/DecoArray.d.ts +22 -0
  14. package/dist/decorator/DecoArray.d.ts.map +1 -0
  15. package/dist/decorator/DecoArray.js +41 -0
  16. package/dist/decorator/DecoArray.js.map +1 -0
  17. package/dist/decorator/DecoBoolean.d.ts +11 -0
  18. package/dist/decorator/DecoBoolean.d.ts.map +1 -0
  19. package/dist/decorator/DecoBoolean.js +13 -0
  20. package/dist/decorator/DecoBoolean.js.map +1 -0
  21. package/dist/decorator/DecoDate.d.ts +12 -0
  22. package/dist/decorator/DecoDate.d.ts.map +1 -0
  23. package/dist/decorator/DecoDate.js +13 -0
  24. package/dist/decorator/DecoDate.js.map +1 -0
  25. package/dist/decorator/DecoNumber.d.ts +23 -0
  26. package/dist/decorator/DecoNumber.d.ts.map +1 -0
  27. package/dist/decorator/DecoNumber.js +37 -0
  28. package/dist/decorator/DecoNumber.js.map +1 -0
  29. package/dist/decorator/DecoObject.d.ts +11 -0
  30. package/dist/decorator/DecoObject.d.ts.map +1 -0
  31. package/dist/decorator/DecoObject.js +9 -0
  32. package/dist/decorator/DecoObject.js.map +1 -0
  33. package/dist/decorator/DecoProperty.d.ts +27 -0
  34. package/dist/decorator/DecoProperty.d.ts.map +1 -0
  35. package/dist/decorator/DecoProperty.js +68 -0
  36. package/dist/decorator/DecoProperty.js.map +1 -0
  37. package/dist/decorator/DecoString.d.ts +21 -0
  38. package/dist/decorator/DecoString.d.ts.map +1 -0
  39. package/dist/decorator/DecoString.js +33 -0
  40. package/dist/decorator/DecoString.js.map +1 -0
  41. package/dist/decorator/Decorator.d.ts +33 -0
  42. package/dist/decorator/Decorator.d.ts.map +1 -0
  43. package/dist/decorator/Decorator.js +73 -0
  44. package/dist/decorator/Decorator.js.map +1 -0
  45. package/dist/decorator/deco.cast.d.ts +9 -0
  46. package/dist/decorator/deco.cast.d.ts.map +1 -0
  47. package/dist/decorator/deco.cast.js +13 -0
  48. package/dist/decorator/deco.cast.js.map +1 -0
  49. package/dist/decorator/deco.enum.d.ts +50 -0
  50. package/dist/decorator/deco.enum.d.ts.map +1 -0
  51. package/dist/decorator/deco.enum.js +73 -0
  52. package/dist/decorator/deco.enum.js.map +1 -0
  53. package/dist/decorator/deco.names.d.ts +20 -0
  54. package/dist/decorator/deco.names.d.ts.map +1 -0
  55. package/dist/decorator/deco.names.js +20 -0
  56. package/dist/decorator/deco.names.js.map +1 -0
  57. package/dist/decorator/deco.paths.d.ts +7 -0
  58. package/dist/decorator/deco.paths.d.ts.map +1 -0
  59. package/dist/decorator/deco.paths.js +14 -0
  60. package/dist/decorator/deco.paths.js.map +1 -0
  61. package/dist/decorator/deco.properties.d.ts +9 -0
  62. package/dist/decorator/deco.properties.d.ts.map +1 -0
  63. package/dist/decorator/deco.properties.js +43 -0
  64. package/dist/decorator/deco.properties.js.map +1 -0
  65. package/dist/decorator/deco.routes.d.ts +4 -0
  66. package/dist/decorator/deco.routes.d.ts.map +1 -0
  67. package/dist/decorator/deco.routes.js +22 -0
  68. package/dist/decorator/deco.routes.js.map +1 -0
  69. package/dist/decorator/index.d.ts +15 -0
  70. package/dist/decorator/index.d.ts.map +1 -0
  71. package/dist/decorator/index.js +16 -0
  72. package/dist/decorator/index.js.map +1 -0
  73. package/dist/helper/helper.annotation.d.ts +3 -8
  74. package/dist/helper/helper.annotation.d.ts.map +1 -1
  75. package/dist/helper/helper.annotation.js +3 -40
  76. package/dist/helper/helper.annotation.js.map +1 -1
  77. package/dist/helper/helper.document.d.ts +1 -2
  78. package/dist/helper/helper.document.d.ts.map +1 -1
  79. package/dist/helper/helper.document.js +0 -1
  80. package/dist/helper/helper.document.js.map +1 -1
  81. package/dist/types/index.d.ts +2 -1
  82. package/dist/types/index.d.ts.map +1 -1
  83. package/dist/types/index.js +2 -1
  84. package/dist/types/index.js.map +1 -1
  85. package/dist/types/types.annotation.d.ts +14 -17
  86. package/dist/types/types.annotation.d.ts.map +1 -1
  87. package/dist/types/types.annotation.js +1 -46
  88. package/dist/types/types.annotation.js.map +1 -1
  89. package/dist/types/types.deco.common.d.ts +21 -0
  90. package/dist/types/types.deco.common.d.ts.map +1 -0
  91. package/dist/types/types.deco.common.js +2 -0
  92. package/dist/types/types.deco.common.js.map +1 -0
  93. package/dist/types/types.deco.property.d.ts +62 -0
  94. package/dist/types/types.deco.property.d.ts.map +1 -0
  95. package/dist/types/types.deco.property.js +2 -0
  96. package/dist/types/types.deco.property.js.map +1 -0
  97. package/dist/types/types.document.d.ts +0 -1
  98. package/dist/types/types.document.d.ts.map +1 -1
  99. package/package.json +5 -4
  100. package/dist/meta/index.d.ts +0 -4
  101. package/dist/meta/index.d.ts.map +0 -1
  102. package/dist/meta/index.js +0 -5
  103. package/dist/meta/index.js.map +0 -1
  104. package/dist/meta/meta.enum.d.ts +0 -104
  105. package/dist/meta/meta.enum.d.ts.map +0 -1
  106. package/dist/meta/meta.enum.js +0 -132
  107. package/dist/meta/meta.enum.js.map +0 -1
  108. package/dist/meta/meta.main.d.ts +0 -44
  109. package/dist/meta/meta.main.d.ts.map +0 -1
  110. package/dist/meta/meta.main.js +0 -60
  111. package/dist/meta/meta.main.js.map +0 -1
  112. package/dist/meta/meta.properties.d.ts +0 -80
  113. package/dist/meta/meta.properties.d.ts.map +0 -1
  114. package/dist/meta/meta.properties.js +0 -91
  115. package/dist/meta/meta.properties.js.map +0 -1
  116. package/dist/types/types.meta.d.ts +0 -145
  117. package/dist/types/types.meta.d.ts.map +0 -1
  118. package/dist/types/types.meta.js +0 -43
  119. package/dist/types/types.meta.js.map +0 -1
@@ -0,0 +1,7 @@
1
+ import { DecoPropertyType } from "../decorator/deco.enum.js";
2
+ import { DecoratorData } from "../decorator/Decorator.js";
3
+ import { AnnotationsHeader, AnnotationsProperty } from "../types/types.annotation.js";
4
+ import { DecoPropertyBase, DecoPropertyRaw } from "../types/types.deco.property.js";
5
+ export declare const mapAnnotationsHeader: (data: DecoratorData, properties: Record<string, DecoPropertyRaw<DecoPropertyBase>>) => AnnotationsHeader;
6
+ export declare const extractAnnotationsPaths: (properties: AnnotationsProperty<DecoPropertyBase>[], ...types: DecoPropertyType[]) => string[];
7
+ //# sourceMappingURL=anno.head.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"anno.head.d.ts","sourceRoot":"","sources":["../../src/annotation/anno.head.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACpB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,gBAAgB,EAChB,eAAe,EAChB,MAAM,iCAAiC,CAAC;AAGzC,eAAO,MAAM,oBAAoB,GAC/B,MAAM,aAAa,EACnB,YAAY,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,gBAAgB,CAAC,CAAC,KAC5D,iBAmBF,CAAC;AA0BF,eAAO,MAAM,uBAAuB,GAClC,YAAY,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,EACnD,GAAG,OAAO,gBAAgB,EAAE,aACwB,CAAC"}
@@ -0,0 +1,34 @@
1
+ import { DecoPropertyType } from "../decorator/deco.enum.js";
2
+ import { mapAnnotationsProperty } from "./anno.property.js";
3
+ export const mapAnnotationsHeader = (data, properties) => {
4
+ const result = {
5
+ name: data.name,
6
+ namespace: data.namespace,
7
+ properties: [],
8
+ additionalImports: data.additionalImports,
9
+ };
10
+ result.properties = Object.entries(properties).map(([propertyKey, prop]) => mapAnnotationsProperty(propertyKey, prop));
11
+ if (data.routes)
12
+ result.routes = Object.entries(data.routes).map(([name, route]) => ({
13
+ ...route,
14
+ name,
15
+ }));
16
+ return structuredClone(result);
17
+ };
18
+ const _extractAnnotationsPaths = (types, properties, path) => {
19
+ const paths = [];
20
+ for (const prop of properties) {
21
+ const propPath = path ? `${path}/${prop.propertyKey}` : prop.propertyKey;
22
+ if (types.includes(prop.data.type)) {
23
+ paths.push(propPath);
24
+ continue;
25
+ }
26
+ if (prop.data.type === DecoPropertyType.object && prop.sub) {
27
+ paths.push(..._extractAnnotationsPaths(types, prop.sub.properties, propPath));
28
+ continue;
29
+ }
30
+ }
31
+ return paths;
32
+ };
33
+ export const extractAnnotationsPaths = (properties, ...types) => _extractAnnotationsPaths(types, properties, null);
34
+ //# sourceMappingURL=anno.head.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"anno.head.js","sourceRoot":"","sources":["../../src/annotation/anno.head.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAU7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAE5D,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAClC,IAAmB,EACnB,UAA6D,EAC1C,EAAE;IACrB,MAAM,MAAM,GAAsB;QAChC,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,SAAS,EAAE,IAAI,CAAC,SAAS;QACzB,UAAU,EAAE,EAAE;QACd,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;KAC1C,CAAC;IAEF,MAAM,CAAC,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,GAAG,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AyB,EAC5B,EAAE,CAAC,wBAAwB,CAAC,KAAK,EAAE,UAAU,EAAE,IAAI,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { AnnotationsProperty } from "../types/types.annotation.js";
2
+ import { DecoPropertyBase, DecoPropertyRaw } from "../types/types.deco.property.js";
3
+ export declare const mapAnnotationsProperty: <T extends DecoPropertyBase>(propertyKey: string, prop: DecoPropertyRaw<T>) => AnnotationsProperty<T>;
4
+ //# sourceMappingURL=anno.property.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"anno.property.d.ts","sourceRoot":"","sources":["../../src/annotation/anno.property.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EACL,gBAAgB,EAChB,eAAe,EAChB,MAAM,iCAAiC,CAAC;AAKzC,eAAO,MAAM,sBAAsB,GAAI,CAAC,SAAS,gBAAgB,EAC/D,aAAa,MAAM,EACnB,MAAM,eAAe,CAAC,CAAC,CAAC,KACvB,mBAAmB,CAAC,CAAC,CAUvB,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { DecoPropertyType } from "../decorator/deco.enum.js";
2
+ import { Decorator } from "../decorator/Decorator.js";
3
+ const isDecoObjectData = (data) => data.type === DecoPropertyType.object && "deco" in data;
4
+ export const mapAnnotationsProperty = (propertyKey, prop) => {
5
+ const decoRef = isDecoObjectData(prop.data) ? prop.data.deco : undefined;
6
+ const sub = decoRef instanceof Decorator ? decoRef : undefined;
7
+ return structuredClone({
8
+ ...prop,
9
+ propertyKey,
10
+ propertyType: sub ? sub.name : prop.data.type,
11
+ sub: sub?.extractAnnotations(),
12
+ });
13
+ };
14
+ //# sourceMappingURL=anno.property.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"anno.property.js","sourceRoot":"","sources":["../../src/annotation/anno.property.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAE7D,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAOtD,MAAM,gBAAgB,GAAG,CAAC,IAAsB,EAA0B,EAAE,CAC1E,IAAI,CAAC,IAAI,KAAK,gBAAgB,CAAC,MAAM,IAAI,MAAM,IAAI,IAAI,CAAC;AAE1D,MAAM,CAAC,MAAM,sBAAsB,GAAG,CACpC,WAAmB,EACnB,IAAwB,EACA,EAAE;IAC1B,MAAM,OAAO,GAAG,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;IACzE,MAAM,GAAG,GAAG,OAAO,YAAY,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;IAE/D,OAAO,eAAe,CAAC;QACrB,GAAG,IAAI;QACP,WAAW;QACX,YAAY,EAAE,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI;QAC7C,GAAG,EAAE,GAAG,EAAE,kBAAkB,EAAE;KAC/B,CAAC,CAAC;AACL,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from "./anno.head.js";
2
+ export * from "./anno.property.js";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/annotation/index.ts"],"names":[],"mappings":"AACA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC"}
@@ -0,0 +1,4 @@
1
+ // This file is auto-generated by build-cli. Do not edit manually.
2
+ export * from "./anno.head.js";
3
+ export * from "./anno.property.js";
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/annotation/index.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC"}
@@ -0,0 +1,22 @@
1
+ import { DecoPropertyBase } from "../types/types.deco.property.js";
2
+ import { DecoPropertyType } from "./deco.enum.js";
3
+ import { DecoProperty } from "./DecoProperty.js";
4
+ export interface DecoArrayData extends DecoPropertyBase {
5
+ properties?: DecoProperty<DecoPropertyBase>[] | DecoPropertyType;
6
+ minLength?: number;
7
+ maxLength?: number;
8
+ exactLength?: number;
9
+ }
10
+ export declare const decoArray: () => DecoArray;
11
+ export declare class DecoArray extends DecoProperty<DecoArrayData> {
12
+ constructor();
13
+ string(): this;
14
+ number(): this;
15
+ boolean(): this;
16
+ date(): this;
17
+ object(val: DecoProperty<DecoPropertyBase>[]): this;
18
+ minLength(val: number): this;
19
+ maxLength(val: number): this;
20
+ exactLength(val: number): this;
21
+ }
22
+ //# sourceMappingURL=DecoArray.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DecoArray.d.ts","sourceRoot":"","sources":["../../src/decorator/DecoArray.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,MAAM,WAAW,aAAc,SAAQ,gBAAgB;IACrD,UAAU,CAAC,EAAE,YAAY,CAAC,gBAAgB,CAAC,EAAE,GAAG,gBAAgB,CAAC;IACjE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,SAAS,iBAAwB,CAAC;AAE/C,qBAAa,SAAU,SAAQ,YAAY,CAAC,aAAa,CAAC;;IAKjD,MAAM,IAAI,IAAI;IAId,MAAM,IAAI,IAAI;IAId,OAAO,IAAI,IAAI;IAIf,IAAI,IAAI,IAAI;IAIZ,MAAM,CAAC,GAAG,EAAE,YAAY,CAAC,gBAAgB,CAAC,EAAE,GAAG,IAAI;IAInD,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAI5B,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAI5B,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;CAItC"}
@@ -0,0 +1,41 @@
1
+ import { DecoPropertyType } from "./deco.enum.js";
2
+ import { DecoProperty } from "./DecoProperty.js";
3
+ export const decoArray = () => new DecoArray();
4
+ export class DecoArray extends DecoProperty {
5
+ constructor() {
6
+ super(DecoPropertyType.array, {});
7
+ }
8
+ string() {
9
+ this.data.properties = DecoPropertyType.string;
10
+ return this;
11
+ }
12
+ number() {
13
+ this.data.properties = DecoPropertyType.number;
14
+ return this;
15
+ }
16
+ boolean() {
17
+ this.data.properties = DecoPropertyType.boolean;
18
+ return this;
19
+ }
20
+ date() {
21
+ this.data.properties = DecoPropertyType.date;
22
+ return this;
23
+ }
24
+ object(val) {
25
+ this.data.properties = val;
26
+ return this;
27
+ }
28
+ minLength(val) {
29
+ this.data.minLength = val;
30
+ return this;
31
+ }
32
+ maxLength(val) {
33
+ this.data.maxLength = val;
34
+ return this;
35
+ }
36
+ exactLength(val) {
37
+ this.data.exactLength = val;
38
+ return this;
39
+ }
40
+ }
41
+ //# sourceMappingURL=DecoArray.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DecoArray.js","sourceRoot":"","sources":["../../src/decorator/DecoArray.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AASjD,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,EAAE,CAAC,IAAI,SAAS,EAAE,CAAC;AAE/C,MAAM,OAAO,SAAU,SAAQ,YAA2B;IACxD;QACE,KAAK,CAAC,gBAAgB,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACpC,CAAC;IAEM,MAAM;QACX,IAAI,CAAC,IAAI,CAAC,UAAU,GAAG,gBAAgB,CAAC,MAAM,CAAC;QAC/C,OAAO,IAAI,CAAC;IACd,CAAC;IACM,MAAM;QACX,IAAI,CAAC,IAAI,CAAC,UAAU,GAAG,gBAAgB,CAAC,MAAM,CAAC;QAC/C,OAAO,IAAI,CAAC;IACd,CAAC;IACM,OAAO;QACZ,IAAI,CAAC,IAAI,CAAC,UAAU,GAAG,gBAAgB,CAAC,OAAO,CAAC;QAChD,OAAO,IAAI,CAAC;IACd,CAAC;IACM,IAAI;QACT,IAAI,CAAC,IAAI,CAAC,UAAU,GAAG,gBAAgB,CAAC,IAAI,CAAC;QAC7C,OAAO,IAAI,CAAC;IACd,CAAC;IACM,MAAM,CAAC,GAAqC;QACjD,IAAI,CAAC,IAAI,CAAC,UAAU,GAAG,GAAG,CAAC;QAC3B,OAAO,IAAI,CAAC;IACd,CAAC;IACM,SAAS,CAAC,GAAW;QAC1B,IAAI,CAAC,IAAI,CAAC,SAAS,GAAG,GAAG,CAAC;QAC1B,OAAO,IAAI,CAAC;IACd,CAAC;IACM,SAAS,CAAC,GAAW;QAC1B,IAAI,CAAC,IAAI,CAAC,SAAS,GAAG,GAAG,CAAC;QAC1B,OAAO,IAAI,CAAC;IACd,CAAC;IACM,WAAW,CAAC,GAAW;QAC5B,IAAI,CAAC,IAAI,CAAC,WAAW,GAAG,GAAG,CAAC;QAC5B,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
@@ -0,0 +1,11 @@
1
+ import { DecoPropertyBase } from "../types/types.deco.property.js";
2
+ import { DecoProperty } from "./DecoProperty.js";
3
+ export interface DecoBooleanData extends DecoPropertyBase {
4
+ default?: boolean;
5
+ }
6
+ export declare const decoBoolean: () => DecoBoolean;
7
+ export declare class DecoBoolean extends DecoProperty<DecoBooleanData> {
8
+ constructor();
9
+ default(val: boolean): this;
10
+ }
11
+ //# sourceMappingURL=DecoBoolean.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DecoBoolean.d.ts","sourceRoot":"","sources":["../../src/decorator/DecoBoolean.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAEnE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,MAAM,WAAW,eAAgB,SAAQ,gBAAgB;IACvD,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,eAAO,MAAM,WAAW,mBAA0B,CAAC;AAEnD,qBAAa,WAAY,SAAQ,YAAY,CAAC,eAAe,CAAC;;IAKrD,OAAO,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI;CAInC"}
@@ -0,0 +1,13 @@
1
+ import { DecoPropertyType } from "./deco.enum.js";
2
+ import { DecoProperty } from "./DecoProperty.js";
3
+ export const decoBoolean = () => new DecoBoolean();
4
+ export class DecoBoolean extends DecoProperty {
5
+ constructor() {
6
+ super(DecoPropertyType.boolean, {});
7
+ }
8
+ default(val) {
9
+ this.data.default = val;
10
+ return this;
11
+ }
12
+ }
13
+ //# sourceMappingURL=DecoBoolean.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DecoBoolean.js","sourceRoot":"","sources":["../../src/decorator/DecoBoolean.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAMjD,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,EAAE,CAAC,IAAI,WAAW,EAAE,CAAC;AAEnD,MAAM,OAAO,WAAY,SAAQ,YAA6B;IAC5D;QACE,KAAK,CAAC,gBAAgB,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IACtC,CAAC;IAEM,OAAO,CAAC,GAAY;QACzB,IAAI,CAAC,IAAI,CAAC,OAAO,GAAG,GAAG,CAAC;QACxB,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
@@ -0,0 +1,12 @@
1
+ import { DecoPropertyBase } from "../types/types.deco.property.js";
2
+ import { DecoDateFormat } from "./deco.enum.js";
3
+ import { DecoProperty } from "./DecoProperty.js";
4
+ export interface DecoDateData extends DecoPropertyBase {
5
+ dateFormat: DecoDateFormat;
6
+ }
7
+ export declare const decoDate: () => DecoDate;
8
+ export declare class DecoDate extends DecoProperty<DecoDateData> {
9
+ constructor();
10
+ format(dateFormat: DecoDateFormat): this;
11
+ }
12
+ //# sourceMappingURL=DecoDate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DecoDate.d.ts","sourceRoot":"","sources":["../../src/decorator/DecoDate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,cAAc,EAAoB,MAAM,gBAAgB,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,MAAM,WAAW,YAAa,SAAQ,gBAAgB;IACpD,UAAU,EAAE,cAAc,CAAC;CAC5B;AAED,eAAO,MAAM,QAAQ,gBAAuB,CAAC;AAE7C,qBAAa,QAAS,SAAQ,YAAY,CAAC,YAAY,CAAC;;IAK/C,MAAM,CAAC,UAAU,EAAE,cAAc,GAAG,IAAI;CAIhD"}
@@ -0,0 +1,13 @@
1
+ import { DecoDateFormat, DecoPropertyType } from "./deco.enum.js";
2
+ import { DecoProperty } from "./DecoProperty.js";
3
+ export const decoDate = () => new DecoDate();
4
+ export class DecoDate extends DecoProperty {
5
+ constructor() {
6
+ super(DecoPropertyType.date, { dateFormat: DecoDateFormat.timestamp });
7
+ }
8
+ format(dateFormat) {
9
+ this.data.dateFormat = dateFormat;
10
+ return this;
11
+ }
12
+ }
13
+ //# sourceMappingURL=DecoDate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DecoDate.js","sourceRoot":"","sources":["../../src/decorator/DecoDate.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAMjD,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAG,EAAE,CAAC,IAAI,QAAQ,EAAE,CAAC;AAE7C,MAAM,OAAO,QAAS,SAAQ,YAA0B;IACtD;QACE,KAAK,CAAC,gBAAgB,CAAC,IAAI,EAAE,EAAE,UAAU,EAAE,cAAc,CAAC,SAAS,EAAE,CAAC,CAAC;IACzE,CAAC;IAEM,MAAM,CAAC,UAA0B;QACtC,IAAI,CAAC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAClC,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
@@ -0,0 +1,23 @@
1
+ import { DecoPropertyBase } from "../types/types.deco.property.js";
2
+ import { DecoProperty } from "./DecoProperty.js";
3
+ export interface DecoNumberData extends DecoPropertyBase {
4
+ default?: number;
5
+ min?: number;
6
+ minExcl?: boolean;
7
+ max?: number;
8
+ maxExcl?: boolean;
9
+ multipleOf?: number;
10
+ fractionDigits?: number;
11
+ }
12
+ export declare const decoNumber: () => DecoNumber;
13
+ export declare class DecoNumber extends DecoProperty<DecoNumberData> {
14
+ constructor();
15
+ default(def: number): this;
16
+ min(m: number): this;
17
+ minExcl(excl?: boolean): this;
18
+ max(m: number): this;
19
+ maxExcl(excl?: boolean): this;
20
+ multipleOf(val: number): this;
21
+ fraction(digits: number): this;
22
+ }
23
+ //# sourceMappingURL=DecoNumber.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DecoNumber.d.ts","sourceRoot":"","sources":["../../src/decorator/DecoNumber.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAEnE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,MAAM,WAAW,cAAe,SAAQ,gBAAgB;IACtD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,eAAO,MAAM,UAAU,kBAAyB,CAAC;AAEjD,qBAAa,UAAW,SAAQ,YAAY,CAAC,cAAc,CAAC;;IAKnD,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAI1B,GAAG,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI;IAIpB,OAAO,CAAC,IAAI,GAAE,OAAc,GAAG,IAAI;IAInC,GAAG,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI;IAIpB,OAAO,CAAC,IAAI,GAAE,OAAc,GAAG,IAAI;IAInC,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAI7B,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;CAItC"}
@@ -0,0 +1,37 @@
1
+ import { DecoPropertyType } from "./deco.enum.js";
2
+ import { DecoProperty } from "./DecoProperty.js";
3
+ export const decoNumber = () => new DecoNumber();
4
+ export class DecoNumber extends DecoProperty {
5
+ constructor() {
6
+ super(DecoPropertyType.number, {});
7
+ }
8
+ default(def) {
9
+ this.data.default = def;
10
+ return this;
11
+ }
12
+ min(m) {
13
+ this.data.min = m;
14
+ return this;
15
+ }
16
+ minExcl(excl = true) {
17
+ this.data.minExcl = excl;
18
+ return this;
19
+ }
20
+ max(m) {
21
+ this.data.max = m;
22
+ return this;
23
+ }
24
+ maxExcl(excl = true) {
25
+ this.data.maxExcl = excl;
26
+ return this;
27
+ }
28
+ multipleOf(val) {
29
+ this.data.multipleOf = val;
30
+ return this;
31
+ }
32
+ fraction(digits) {
33
+ this.data.fractionDigits = digits;
34
+ return this;
35
+ }
36
+ }
37
+ //# sourceMappingURL=DecoNumber.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DecoNumber.js","sourceRoot":"","sources":["../../src/decorator/DecoNumber.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAYjD,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,EAAE,CAAC,IAAI,UAAU,EAAE,CAAC;AAEjD,MAAM,OAAO,UAAW,SAAQ,YAA4B;IAC1D;QACE,KAAK,CAAC,gBAAgB,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IACrC,CAAC;IAEM,OAAO,CAAC,GAAW;QACxB,IAAI,CAAC,IAAI,CAAC,OAAO,GAAG,GAAG,CAAC;QACxB,OAAO,IAAI,CAAC;IACd,CAAC;IACM,GAAG,CAAC,CAAS;QAClB,IAAI,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC;QAClB,OAAO,IAAI,CAAC;IACd,CAAC;IACM,OAAO,CAAC,OAAgB,IAAI;QACjC,IAAI,CAAC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACzB,OAAO,IAAI,CAAC;IACd,CAAC;IACM,GAAG,CAAC,CAAS;QAClB,IAAI,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC;QAClB,OAAO,IAAI,CAAC;IACd,CAAC;IACM,OAAO,CAAC,OAAgB,IAAI;QACjC,IAAI,CAAC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACzB,OAAO,IAAI,CAAC;IACd,CAAC;IACM,UAAU,CAAC,GAAW;QAC3B,IAAI,CAAC,IAAI,CAAC,UAAU,GAAG,GAAG,CAAC;QAC3B,OAAO,IAAI,CAAC;IACd,CAAC;IACM,QAAQ,CAAC,MAAc;QAC5B,IAAI,CAAC,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC;QAClC,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
@@ -0,0 +1,11 @@
1
+ import { DecoPropertyBase } from "../types/types.deco.property.js";
2
+ import { DecoProperty } from "./DecoProperty.js";
3
+ import { Decorator } from "./Decorator.js";
4
+ export interface DecoObjectData extends DecoPropertyBase {
5
+ deco: Decorator;
6
+ }
7
+ export declare const decoObject: (deco: Decorator) => DecoObject;
8
+ export declare class DecoObject extends DecoProperty<DecoObjectData> {
9
+ constructor(deco: Decorator);
10
+ }
11
+ //# sourceMappingURL=DecoObject.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DecoObject.d.ts","sourceRoot":"","sources":["../../src/decorator/DecoObject.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAEnE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,MAAM,WAAW,cAAe,SAAQ,gBAAgB;IACtD,IAAI,EAAE,SAAS,CAAC;CACjB;AAED,eAAO,MAAM,UAAU,GAAI,MAAM,SAAS,eAAyB,CAAC;AAEpE,qBAAa,UAAW,SAAQ,YAAY,CAAC,cAAc,CAAC;gBACvC,IAAI,EAAE,SAAS;CAGnC"}
@@ -0,0 +1,9 @@
1
+ import { DecoPropertyType } from "./deco.enum.js";
2
+ import { DecoProperty } from "./DecoProperty.js";
3
+ export const decoObject = (deco) => new DecoObject(deco);
4
+ export class DecoObject extends DecoProperty {
5
+ constructor(deco) {
6
+ super(DecoPropertyType.object, { deco });
7
+ }
8
+ }
9
+ //# sourceMappingURL=DecoObject.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DecoObject.js","sourceRoot":"","sources":["../../src/decorator/DecoObject.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAOjD,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,IAAe,EAAE,EAAE,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC;AAEpE,MAAM,OAAO,UAAW,SAAQ,YAA4B;IAC1D,YAAmB,IAAe;QAChC,KAAK,CAAC,gBAAgB,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;IAC3C,CAAC;CACF"}
@@ -0,0 +1,27 @@
1
+ import type { DecoPropertyType } from "./deco.enum.js";
2
+ import type { DecoParamsKind } from "../types/types.deco.common.js";
3
+ import { DecoPropertyBase, DecoPropertyCommon, DecoPropertyRaw } from "../types/types.deco.property.js";
4
+ import { AnnotationsProperty } from "../types/types.annotation.js";
5
+ export type DecoProperties = Record<string, DecoProperty<DecoPropertyBase>>;
6
+ export declare class DecoProperty<T extends DecoPropertyBase> {
7
+ protected common: DecoPropertyCommon;
8
+ protected data: T;
9
+ constructor(type: DecoPropertyType, initData: Omit<T, "type">);
10
+ setAll(p: {
11
+ common?: DecoPropertyCommon;
12
+ data?: T;
13
+ }): this;
14
+ title(val: DecoParamsKind<string>): this;
15
+ description(val: DecoParamsKind<string>): this;
16
+ optional(val?: boolean): this;
17
+ editable(val?: boolean): this;
18
+ sortable(val?: boolean): this;
19
+ filterable(val?: boolean): this;
20
+ hidden(val?: DecoParamsKind<boolean>): this;
21
+ width(val: string): this;
22
+ depandPopin(val?: boolean): this;
23
+ order(val: DecoParamsKind<number>): this;
24
+ extractRaw(): DecoPropertyRaw<T>;
25
+ extractAnnotations(propertyKey: string): AnnotationsProperty<T>;
26
+ }
27
+ //# sourceMappingURL=DecoProperty.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DecoProperty.d.ts","sourceRoot":"","sources":["../../src/decorator/DecoProperty.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,EAChB,MAAM,iCAAiC,CAAC;AACz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
2
+ export class DecoProperty {
3
+ common;
4
+ data;
5
+ constructor(type, initData) {
6
+ this.common = {};
7
+ this.data = { ...initData, type };
8
+ }
9
+ setAll(p) {
10
+ if (p.common)
11
+ this.common = structuredClone(p.common);
12
+ if (p.data) {
13
+ const type = this.data.type;
14
+ this.data = structuredClone({ ...p.data, type });
15
+ }
16
+ return this;
17
+ }
18
+ title(val) {
19
+ this.common.title = val;
20
+ return this;
21
+ }
22
+ description(val) {
23
+ this.common.description = val;
24
+ return this;
25
+ }
26
+ optional(val = true) {
27
+ this.common.optional = val;
28
+ return this;
29
+ }
30
+ editable(val = true) {
31
+ this.common.editable = val;
32
+ return this;
33
+ }
34
+ sortable(val = true) {
35
+ this.common.sortable = val;
36
+ return this;
37
+ }
38
+ filterable(val = true) {
39
+ this.common.filterable = val;
40
+ return this;
41
+ }
42
+ hidden(val = true) {
43
+ this.common.hidden = val;
44
+ return this;
45
+ }
46
+ width(val) {
47
+ this.common.width = val;
48
+ return this;
49
+ }
50
+ depandPopin(val = true) {
51
+ this.common.depandPopin = val;
52
+ return this;
53
+ }
54
+ order(val) {
55
+ this.common.order = val;
56
+ return this;
57
+ }
58
+ extractRaw() {
59
+ return structuredClone({
60
+ common: this.common,
61
+ data: this.data,
62
+ });
63
+ }
64
+ extractAnnotations(propertyKey) {
65
+ return mapAnnotationsProperty(propertyKey, this.extractRaw());
66
+ }
67
+ }
68
+ //# sourceMappingURL=DecoProperty.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DecoProperty.js","sourceRoot":"","sources":["../../src/decorator/DecoProperty.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAIxE,MAAM,OAAO,YAAY;IACb,MAAM,CAAqB;IAC3B,IAAI,CAAI;IAElB,YAAmB,IAAsB,EAAE,QAAyB;QAClE,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,EAAE,GAAG,QAAQ,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CAAC;IACd,CAAC;IACM,KAAK,CAAC,GAAW;QACtB,IAAI,CAAC,MAAM,CAAC,KAAK,GAAG,GAAG,CAAC;QACxB,OAAO,IAAI,CAAC;IACd,CAAC;IACM,WAAW,CAAC,MAAe,IAAI;QACpC,IAAI,CAAC,MAAM,CAAC,WAAW,GAAG,GAAG,CAAC;QAC9B,OAAO,IAAI,CAAC;IACd,CAAC;IACM,KAAK,CAAC,GAA2B;QACtC,IAAI,CAAC,MAAM,CAAC,KAAK,GAAG,GAAG,CAAC;QACxB,OAAO,IAAI,CAAC;IACd,CAAC;IAEM,UAAU;QACf,OAAO,eAAe,CAAC;YACrB,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,IAAI,EAAE,IAAI,CAAC,IAAI;SAChB,CAAC,CAAC;IACL,CAAC;IAEM,kBAAkB,CAAC,WAAmB;QAC3C,OAAO,sBAAsB,CAAC,WAAW,EAAE,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;IAChE,CAAC;CACF"}
@@ -0,0 +1,21 @@
1
+ import { DecoPropertyBase } from "../types/types.deco.property.js";
2
+ import { DecoProperty } from "./DecoProperty.js";
3
+ export interface DecoStringData extends DecoPropertyBase {
4
+ default?: string;
5
+ minLength?: number;
6
+ maxLength?: number;
7
+ exactLength?: number;
8
+ regex?: string;
9
+ key?: boolean;
10
+ }
11
+ export declare const decoString: () => DecoString;
12
+ export declare class DecoString extends DecoProperty<DecoStringData> {
13
+ constructor();
14
+ default(val: string): this;
15
+ minLength(val: number): this;
16
+ maxLength(val: number): this;
17
+ exactLength(val: number): this;
18
+ regex(val: string): this;
19
+ key(val?: boolean): this;
20
+ }
21
+ //# sourceMappingURL=DecoString.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DecoString.d.ts","sourceRoot":"","sources":["../../src/decorator/DecoString.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAEnE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,MAAM,WAAW,cAAe,SAAQ,gBAAgB;IACtD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AAED,eAAO,MAAM,UAAU,kBAAyB,CAAC;AAEjD,qBAAa,UAAW,SAAQ,YAAY,CAAC,cAAc,CAAC;;IAKnD,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAI1B,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAI5B,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAI5B,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAI9B,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAIxB,GAAG,CAAC,GAAG,GAAE,OAAc,GAAG,IAAI;CAItC"}
@@ -0,0 +1,33 @@
1
+ import { DecoPropertyType } from "./deco.enum.js";
2
+ import { DecoProperty } from "./DecoProperty.js";
3
+ export const decoString = () => new DecoString();
4
+ export class DecoString extends DecoProperty {
5
+ constructor() {
6
+ super(DecoPropertyType.string, {});
7
+ }
8
+ default(val) {
9
+ this.data.default = val;
10
+ return this;
11
+ }
12
+ minLength(val) {
13
+ this.data.minLength = val;
14
+ return this;
15
+ }
16
+ maxLength(val) {
17
+ this.data.maxLength = val;
18
+ return this;
19
+ }
20
+ exactLength(val) {
21
+ this.data.exactLength = val;
22
+ return this;
23
+ }
24
+ regex(val) {
25
+ this.data.regex = val;
26
+ return this;
27
+ }
28
+ key(val = true) {
29
+ this.data.key = val;
30
+ return this;
31
+ }
32
+ }
33
+ //# sourceMappingURL=DecoString.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DecoString.js","sourceRoot":"","sources":["../../src/decorator/DecoString.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAWjD,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,EAAE,CAAC,IAAI,UAAU,EAAE,CAAC;AAEjD,MAAM,OAAO,UAAW,SAAQ,YAA4B;IAC1D;QACE,KAAK,CAAC,gBAAgB,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IACrC,CAAC;IAEM,OAAO,CAAC,GAAW;QACxB,IAAI,CAAC,IAAI,CAAC,OAAO,GAAG,GAAG,CAAC;QACxB,OAAO,IAAI,CAAC;IACd,CAAC;IACM,SAAS,CAAC,GAAW;QAC1B,IAAI,CAAC,IAAI,CAAC,SAAS,GAAG,GAAG,CAAC;QAC1B,OAAO,IAAI,CAAC;IACd,CAAC;IACM,SAAS,CAAC,GAAW;QAC1B,IAAI,CAAC,IAAI,CAAC,SAAS,GAAG,GAAG,CAAC;QAC1B,OAAO,IAAI,CAAC;IACd,CAAC;IACM,WAAW,CAAC,GAAW;QAC5B,IAAI,CAAC,IAAI,CAAC,WAAW,GAAG,GAAG,CAAC;QAC5B,OAAO,IAAI,CAAC;IACd,CAAC;IACM,KAAK,CAAC,GAAW;QACtB,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,GAAG,CAAC;QACtB,OAAO,IAAI,CAAC;IACd,CAAC;IACM,GAAG,CAAC,MAAe,IAAI;QAC5B,IAAI,CAAC,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACpB,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
@@ -0,0 +1,33 @@
1
+ import { DecoImport, DecoRoutes } from "../types/types.deco.common.js";
2
+ import { DecoProperties } from "./DecoProperty.js";
3
+ import { AnnotationsHeader } from "../types/types.annotation.js";
4
+ export interface DecoratorData {
5
+ name: string;
6
+ title?: string;
7
+ namespace?: string;
8
+ routes?: DecoRoutes;
9
+ additionalImports?: DecoImport[];
10
+ lead?: boolean;
11
+ properties?: DecoProperties;
12
+ decoPath: string;
13
+ inputDirPath: string;
14
+ inputFilename: string;
15
+ inputFilePath: string;
16
+ }
17
+ export declare const createDecorator: (filePath: string) => (name: string) => Decorator;
18
+ export type Decorators = Record<string, Decorator>;
19
+ export declare class Decorator {
20
+ readonly name: string;
21
+ protected data: DecoratorData;
22
+ constructor(name: string, inputFilePath: string);
23
+ title(val: string): this;
24
+ namespace(val: string): this;
25
+ properties(properties: DecoProperties): this;
26
+ additionalImports(...imps: DecoImport[]): this;
27
+ routes(routes: DecoRoutes): this;
28
+ routesCrud(): this;
29
+ lead(lead?: boolean): this;
30
+ extractRaw(): DecoratorData;
31
+ extractAnnotations(): AnnotationsHeader;
32
+ }
33
+ //# sourceMappingURL=Decorator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Decorator.d.ts","sourceRoot":"","sources":["../../src/decorator/Decorator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AASvE,OAAO,EAAE,cAAc,EAAgB,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAGjE,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,iBAAiB,CAAC,EAAE,UAAU,EAAE,CAAC;IACjC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,UAAU,CAAC,EAAE,cAAc,CAAC;IAG5B,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,eAAO,MAAM,eAAe,GACzB,UAAU,MAAM,MAChB,MAAM,MAAM,KAAG,SACe,CAAC;AAElC,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;AAEnD,qBAAa,SAAS;aAIF,IAAI,EAAE,MAAM;IAH9B,SAAS,CAAC,IAAI,EAAE,aAAa,CAAC;gBAGZ,IAAI,EAAE,MAAM,EAC5B,aAAa,EAAE,MAAM;IAQhB,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAIxB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAI5B,UAAU,CAAC,UAAU,EAAE,cAAc,GAAG,IAAI;IAM5C,iBAAiB,CAAC,GAAG,IAAI,EAAE,UAAU,EAAE,GAAG,IAAI;IAK9C,MAAM,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI;IAMhC,UAAU,IAAI,IAAI;IAGlB,IAAI,CAAC,IAAI,GAAE,OAAc,GAAG,IAAI;IAKhC,UAAU,IAAI,aAAa;IAQ3B,kBAAkB,IAAI,iBAAiB;CAiB/C"}
@@ -0,0 +1,73 @@
1
+ import { basename, dirname } from "path";
2
+ import { DecoPropertyType } from "./deco.enum.js";
3
+ import { toDecoPath } from "./deco.paths.js";
4
+ import { crudRoutes } from "./deco.routes.js";
5
+ import { mapAnnotationsHeader } from "../annotation/anno.head.js";
6
+ export const createDecorator = (filePath) => (name) => new Decorator(name, filePath);
7
+ export class Decorator {
8
+ name;
9
+ data;
10
+ constructor(name, inputFilePath) {
11
+ this.name = name;
12
+ const inputDirPath = dirname(inputFilePath);
13
+ const inputFilename = basename(inputFilePath);
14
+ const decoPath = toDecoPath(name, inputDirPath, inputFilename);
15
+ this.data = { name, inputDirPath, inputFilename, decoPath, inputFilePath };
16
+ }
17
+ title(val) {
18
+ this.data.title = val;
19
+ return this;
20
+ }
21
+ namespace(val) {
22
+ this.data.namespace = val;
23
+ return this;
24
+ }
25
+ properties(properties) {
26
+ if (!this.data.properties)
27
+ this.data.properties = {};
28
+ for (const [key, prop] of Object.entries(properties))
29
+ this.data.properties[key] = prop;
30
+ return this;
31
+ }
32
+ additionalImports(...imps) {
33
+ if (!this.data.additionalImports)
34
+ this.data.additionalImports = [];
35
+ this.data.additionalImports.push(...imps);
36
+ return this;
37
+ }
38
+ routes(routes) {
39
+ if (!this.data.routes)
40
+ this.data.routes = {};
41
+ for (const [key, route] of Object.entries(routes))
42
+ this.data.routes[key] = route;
43
+ return this;
44
+ }
45
+ routesCrud() {
46
+ return this.routes(crudRoutes(`${this.data.name}Doc`));
47
+ }
48
+ lead(lead = true) {
49
+ this.data.lead = lead;
50
+ return this;
51
+ }
52
+ extractRaw() {
53
+ const { properties, ...rest } = this.data;
54
+ return {
55
+ ...structuredClone(rest),
56
+ ...(properties ? { properties: { ...properties } } : {}),
57
+ };
58
+ }
59
+ extractAnnotations() {
60
+ const rawProperties = {};
61
+ for (const [key, prop] of Object.entries(this.data.properties ?? {})) {
62
+ const raw = prop.extractRaw();
63
+ // Preserve Decorator reference for object types (structuredClone strips prototypes)
64
+ if (raw.data.type === DecoPropertyType.object &&
65
+ "deco" in prop["data"]) {
66
+ raw.data.deco = prop["data"].deco;
67
+ }
68
+ rawProperties[key] = raw;
69
+ }
70
+ return mapAnnotationsHeader(this.extractRaw(), rawProperties);
71
+ }
72
+ }
73
+ //# sourceMappingURL=Decorator.js.map