@memberjunction/codegen-lib 4.0.0 → 4.2.0

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 (42) hide show
  1. package/README.md +826 -639
  2. package/dist/Angular/angular-codegen.d.ts +9 -2
  3. package/dist/Angular/angular-codegen.d.ts.map +1 -1
  4. package/dist/Angular/angular-codegen.js +84 -62
  5. package/dist/Angular/angular-codegen.js.map +1 -1
  6. package/dist/Angular/entity-data-grid-related-entity-component.d.ts.map +1 -1
  7. package/dist/Angular/entity-data-grid-related-entity-component.js +2 -1
  8. package/dist/Angular/entity-data-grid-related-entity-component.js.map +1 -1
  9. package/dist/Config/config.d.ts.map +1 -1
  10. package/dist/Config/config.js +10 -0
  11. package/dist/Config/config.js.map +1 -1
  12. package/dist/Database/manage-metadata.d.ts +301 -5
  13. package/dist/Database/manage-metadata.d.ts.map +1 -1
  14. package/dist/Database/manage-metadata.js +1041 -156
  15. package/dist/Database/manage-metadata.js.map +1 -1
  16. package/dist/Database/sql.d.ts.map +1 -1
  17. package/dist/Database/sql.js +4 -0
  18. package/dist/Database/sql.js.map +1 -1
  19. package/dist/Database/sql_codegen.d.ts +13 -0
  20. package/dist/Database/sql_codegen.d.ts.map +1 -1
  21. package/dist/Database/sql_codegen.js +99 -28
  22. package/dist/Database/sql_codegen.js.map +1 -1
  23. package/dist/Misc/advanced_generation.d.ts +68 -6
  24. package/dist/Misc/advanced_generation.d.ts.map +1 -1
  25. package/dist/Misc/advanced_generation.js +94 -49
  26. package/dist/Misc/advanced_generation.js.map +1 -1
  27. package/dist/Misc/entity_subclasses_codegen.d.ts +5 -0
  28. package/dist/Misc/entity_subclasses_codegen.d.ts.map +1 -1
  29. package/dist/Misc/entity_subclasses_codegen.js +24 -6
  30. package/dist/Misc/entity_subclasses_codegen.js.map +1 -1
  31. package/dist/Misc/graphql_server_codegen.d.ts.map +1 -1
  32. package/dist/Misc/graphql_server_codegen.js +3 -1
  33. package/dist/Misc/graphql_server_codegen.js.map +1 -1
  34. package/dist/__tests__/metadataConfig.test.d.ts +12 -0
  35. package/dist/__tests__/metadataConfig.test.d.ts.map +1 -0
  36. package/dist/__tests__/metadataConfig.test.js +604 -0
  37. package/dist/__tests__/metadataConfig.test.js.map +1 -0
  38. package/package.json +21 -17
  39. package/dist/Angular/user-view-grid-related-entity-component.d.ts +0 -43
  40. package/dist/Angular/user-view-grid-related-entity-component.d.ts.map +0 -1
  41. package/dist/Angular/user-view-grid-related-entity-component.js +0 -85
  42. package/dist/Angular/user-view-grid-related-entity-component.js.map +0 -1
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@memberjunction/codegen-lib",
3
3
  "type": "module",
4
- "version": "4.0.0",
4
+ "version": "4.2.0",
5
5
  "description": "Library used by the CodeGen executable to generate code for the MemberJunction platform. Contains a reusable object model that can be called by any other server-side application/library.",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -11,29 +11,33 @@
11
11
  "scripts": {
12
12
  "start": "ts-node-dev src/index.ts",
13
13
  "build": "tsc && tsc-alias -f",
14
- "test": "echo \"Error: no test specified\" && exit 1"
14
+ "test": "jest",
15
+ "test:watch": "jest --watch"
15
16
  },
16
17
  "author": "MemberJunction.com",
17
18
  "license": "ISC",
18
19
  "devDependencies": {
19
20
  "ts-node-dev": "^2.0.0",
20
- "typescript": "^5.9.3"
21
+ "typescript": "^5.9.3",
22
+ "@types/jest": "^30.0.0",
23
+ "jest": "^30.2.0",
24
+ "ts-jest": "^29.4.6"
21
25
  },
22
26
  "dependencies": {
23
- "@memberjunction/actions": "4.0.0",
24
- "@memberjunction/actions-base": "4.0.0",
25
- "@memberjunction/ai": "4.0.0",
26
- "@memberjunction/ai-core-plus": "4.0.0",
27
- "@memberjunction/ai-prompts": "4.0.0",
28
- "@memberjunction/ai-provider-bundle": "4.0.0",
29
- "@memberjunction/aiengine": "4.0.0",
30
- "@memberjunction/config": "4.0.0",
31
- "@memberjunction/core": "4.0.0",
32
- "@memberjunction/core-entities": "4.0.0",
33
- "@memberjunction/core-entities-server": "4.0.0",
34
- "@memberjunction/global": "4.0.0",
35
- "@memberjunction/server-bootstrap-lite": "4.0.0",
36
- "@memberjunction/sqlserver-dataprovider": "4.0.0",
27
+ "@memberjunction/actions": "4.2.0",
28
+ "@memberjunction/actions-base": "4.2.0",
29
+ "@memberjunction/ai": "4.2.0",
30
+ "@memberjunction/ai-core-plus": "4.2.0",
31
+ "@memberjunction/ai-prompts": "4.2.0",
32
+ "@memberjunction/ai-provider-bundle": "4.2.0",
33
+ "@memberjunction/aiengine": "4.2.0",
34
+ "@memberjunction/config": "4.2.0",
35
+ "@memberjunction/core": "4.2.0",
36
+ "@memberjunction/core-entities": "4.2.0",
37
+ "@memberjunction/core-entities-server": "4.2.0",
38
+ "@memberjunction/global": "4.2.0",
39
+ "@memberjunction/server-bootstrap-lite": "4.2.0",
40
+ "@memberjunction/sqlserver-dataprovider": "4.2.0",
37
41
  "cosmiconfig": "9.0.0",
38
42
  "fs-extra": "^11.3.3",
39
43
  "glob": "^13.0.1",
@@ -1,43 +0,0 @@
1
- import { AngularComponentInfo, ComponentConfigBase, GenerationInput, GenerationResult, RelatedEntityDisplayComponentGeneratorBase } from "./related-entity-components.js";
2
- /**
3
- * Default generator class for creating UserViewGrid components that display related entity data
4
- * in a standard data grid format. This is the most commonly used related entity display component,
5
- * providing full CRUD capabilities, filtering, sorting, and pagination.
6
- *
7
- * The UserViewGrid component provides:
8
- * - Tabular display of related entity records
9
- * - In-line editing capabilities
10
- * - Advanced filtering and search
11
- * - Column sorting and customization
12
- * - Pagination for large datasets
13
- * - Integration with MemberJunction user views
14
- * - Automatic relationship parameter binding
15
- */
16
- export declare class UserViewGridRelatedEntityGenerator extends RelatedEntityDisplayComponentGeneratorBase {
17
- /**
18
- * Returns the NPM package path for importing the UserViewGrid Angular component
19
- * @returns The import path for the ng-user-view-grid module
20
- */
21
- get ImportPath(): string;
22
- /**
23
- * Returns the Angular component information needed for imports and module declarations
24
- * @returns Empty array since UserViewGrid uses module-level imports, not component imports
25
- */
26
- get ImportItems(): AngularComponentInfo[];
27
- /**
28
- * Generates the Angular template for a UserViewGrid component that displays related entity data.
29
- * The generated template includes proper parameter binding for relationships, deferred loading,
30
- * and integration with the parent form's edit mode and styling.
31
- * @param input The generation input containing entity and relationship information
32
- * @returns Promise resolving to the generation result with the Angular grid template
33
- */
34
- Generate(input: GenerationInput): Promise<GenerationResult>;
35
- /**
36
- * Returns the configuration type for this component. UserViewGrid uses the base
37
- * ComponentConfigBase since it doesn't require additional configuration beyond
38
- * the standard relationship metadata.
39
- * @returns null since no additional configuration is required
40
- */
41
- get ConfigType(): typeof ComponentConfigBase;
42
- }
43
- //# sourceMappingURL=user-view-grid-related-entity-component.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"user-view-grid-related-entity-component.d.ts","sourceRoot":"","sources":["../../src/Angular/user-view-grid-related-entity-component.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,eAAe,EAAE,gBAAgB,EAAE,0CAA0C,EAAE,MAAM,6BAA6B,CAAC;AAEvK;;;;;;;;;;;;;GAaG;AACH,qBACa,kCAAmC,SAAQ,0CAA0C;IAC9F;;;OAGG;IACH,IAAW,UAAU,IAAI,MAAM,CAE9B;IACD;;;OAGG;IACH,IAAW,WAAW,IAAI,oBAAoB,EAAE,CAE/C;IACD;;;;;;OAMG;IACU,QAAQ,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,gBAAgB,CAAC;IA0BxE;;;;;OAKG;IACH,IAAW,UAAU,IAAI,OAAO,mBAAmB,CAElD;CACJ"}
@@ -1,85 +0,0 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.UserViewGridRelatedEntityGenerator = void 0;
10
- const global_1 = require("@memberjunction/global");
11
- const related_entity_components_1 = require("./related-entity-components.js");
12
- /**
13
- * Default generator class for creating UserViewGrid components that display related entity data
14
- * in a standard data grid format. This is the most commonly used related entity display component,
15
- * providing full CRUD capabilities, filtering, sorting, and pagination.
16
- *
17
- * The UserViewGrid component provides:
18
- * - Tabular display of related entity records
19
- * - In-line editing capabilities
20
- * - Advanced filtering and search
21
- * - Column sorting and customization
22
- * - Pagination for large datasets
23
- * - Integration with MemberJunction user views
24
- * - Automatic relationship parameter binding
25
- */
26
- let UserViewGridRelatedEntityGenerator = class UserViewGridRelatedEntityGenerator extends related_entity_components_1.RelatedEntityDisplayComponentGeneratorBase {
27
- /**
28
- * Returns the NPM package path for importing the UserViewGrid Angular component
29
- * @returns The import path for the ng-user-view-grid module
30
- */
31
- get ImportPath() {
32
- return "@memberjunction/ng-user-view-grid";
33
- }
34
- /**
35
- * Returns the Angular component information needed for imports and module declarations
36
- * @returns Empty array since UserViewGrid uses module-level imports, not component imports
37
- */
38
- get ImportItems() {
39
- return [];
40
- }
41
- /**
42
- * Generates the Angular template for a UserViewGrid component that displays related entity data.
43
- * The generated template includes proper parameter binding for relationships, deferred loading,
44
- * and integration with the parent form's edit mode and styling.
45
- * @param input The generation input containing entity and relationship information
46
- * @returns Promise resolving to the generation result with the Angular grid template
47
- */
48
- async Generate(input) {
49
- // Use IsSectionExpanded for new collapsible section-based forms, IsCurrentTab for legacy tab-based forms
50
- const allowLoadCheck = input.SectionKey && input.SectionKey.length > 0
51
- ? `IsSectionExpanded('${input.SectionKey.trim()}')`
52
- : `IsCurrentTab('${input.TabName.trim()}')`;
53
- // Add dataLoaded event binding to capture row count
54
- const dataLoadedEvent = input.SectionKey && input.SectionKey.length > 0
55
- ? `(dataLoaded)="SetSectionRowCount('${input.SectionKey.trim()}', $event.totalRowCount)"`
56
- : '';
57
- const template = `<mj-user-view-grid
58
- [Params]="BuildRelationshipViewParamsByEntityName('${input.RelationshipInfo.RelatedEntity.trim()}','${input.RelationshipInfo.RelatedEntityJoinField.trim()}')"
59
- [NewRecordValues]="NewRecordValues('${input.RelationshipInfo.RelatedEntity.trim()}')"
60
- [AllowLoad]="${allowLoadCheck}"
61
- [EditMode]="GridEditMode()"${dataLoadedEvent ? `\n ${dataLoadedEvent}` : ''}
62
- >
63
- </mj-user-view-grid>`;
64
- return {
65
- Success: true,
66
- TemplateOutput: template,
67
- CodeOutput: "",
68
- Component: this
69
- };
70
- }
71
- /**
72
- * Returns the configuration type for this component. UserViewGrid uses the base
73
- * ComponentConfigBase since it doesn't require additional configuration beyond
74
- * the standard relationship metadata.
75
- * @returns null since no additional configuration is required
76
- */
77
- get ConfigType() {
78
- return null;
79
- }
80
- };
81
- exports.UserViewGridRelatedEntityGenerator = UserViewGridRelatedEntityGenerator;
82
- exports.UserViewGridRelatedEntityGenerator = UserViewGridRelatedEntityGenerator = __decorate([
83
- (0, global_1.RegisterClass)(related_entity_components_1.RelatedEntityDisplayComponentGeneratorBase, "UserViewGrid")
84
- ], UserViewGridRelatedEntityGenerator);
85
- //# sourceMappingURL=user-view-grid-related-entity-component.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"user-view-grid-related-entity-component.js","sourceRoot":"","sources":["../../src/Angular/user-view-grid-related-entity-component.ts"],"names":[],"mappings":";;;;;;;;;AAAA,mDAAuD;AACvD,2EAAuK;AAEvK;;;;;;;;;;;;;GAaG;AAEI,IAAM,kCAAkC,GAAxC,MAAM,kCAAmC,SAAQ,sEAA0C;IAC9F;;;OAGG;IACH,IAAW,UAAU;QACjB,OAAO,mCAAmC,CAAC;IAC/C,CAAC;I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