@loopstack/core 0.0.5 → 0.1.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 (144) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/config/core.yaml +1 -0
  3. package/dist/modules/common/services/context.service.d.ts +2 -2
  4. package/dist/modules/common/services/context.service.js +7 -7
  5. package/dist/modules/common/services/context.service.js.map +1 -1
  6. package/dist/modules/common/services/document-helper.service.d.ts +58 -48
  7. package/dist/modules/common/services/schema-validator.service.d.ts +2 -0
  8. package/dist/modules/common/services/schema-validator.service.js +14 -11
  9. package/dist/modules/common/services/schema-validator.service.js.map +1 -1
  10. package/dist/modules/common/services/value-parser.service.d.ts +2 -6
  11. package/dist/modules/common/services/value-parser.service.js +0 -3
  12. package/dist/modules/common/services/value-parser.service.js.map +1 -1
  13. package/dist/modules/configuration/configuration.module.js +2 -3
  14. package/dist/modules/configuration/configuration.module.js.map +1 -1
  15. package/dist/modules/configuration/services/configuration.service.d.ts +5 -7
  16. package/dist/modules/configuration/services/configuration.service.js +38 -44
  17. package/dist/modules/configuration/services/configuration.service.js.map +1 -1
  18. package/dist/modules/configuration/services/dynamic-schema-generator.service.d.ts +8 -8
  19. package/dist/modules/configuration/services/dynamic-schema-generator.service.js +15 -18
  20. package/dist/modules/configuration/services/dynamic-schema-generator.service.js.map +1 -1
  21. package/dist/modules/configuration/services/index.d.ts +1 -2
  22. package/dist/modules/configuration/services/index.js +1 -2
  23. package/dist/modules/configuration/services/index.js.map +1 -1
  24. package/dist/modules/configuration/services/service-registry.service.d.ts +20 -0
  25. package/dist/modules/configuration/services/{adapter-registry.service.js → service-registry.service.js} +31 -16
  26. package/dist/modules/configuration/services/service-registry.service.js.map +1 -0
  27. package/dist/modules/persistence/__tests__/database-entities-utils.d.ts +2 -2
  28. package/dist/modules/persistence/__tests__/database-entities-utils.js +5 -5
  29. package/dist/modules/persistence/__tests__/database-entities-utils.js.map +1 -1
  30. package/dist/modules/persistence/persistence.module.js +3 -3
  31. package/dist/modules/persistence/persistence.module.js.map +1 -1
  32. package/dist/modules/persistence/services/document.service.d.ts +3 -3
  33. package/dist/modules/persistence/services/document.service.js +6 -6
  34. package/dist/modules/persistence/services/document.service.js.map +1 -1
  35. package/dist/modules/persistence/services/index.d.ts +1 -1
  36. package/dist/modules/persistence/services/index.js +1 -1
  37. package/dist/modules/persistence/services/index.js.map +1 -1
  38. package/dist/modules/persistence/services/namespace.service.d.ts +2 -2
  39. package/dist/modules/persistence/services/namespace.service.js +9 -9
  40. package/dist/modules/persistence/services/namespace.service.js.map +1 -1
  41. package/dist/modules/persistence/services/pipeline.service.d.ts +8 -0
  42. package/dist/modules/persistence/services/{project.service.js → pipeline.service.js} +13 -13
  43. package/dist/modules/persistence/services/pipeline.service.js.map +1 -0
  44. package/dist/modules/persistence/subscriber/workflow.subscriber.js +2 -2
  45. package/dist/modules/persistence/subscriber/workflow.subscriber.js.map +1 -1
  46. package/dist/modules/workflow-processor/services/index.d.ts +2 -1
  47. package/dist/modules/workflow-processor/services/index.js +2 -1
  48. package/dist/modules/workflow-processor/services/index.js.map +1 -1
  49. package/dist/modules/workflow-processor/services/namespace-processor.service.js +1 -1
  50. package/dist/modules/workflow-processor/services/namespace-processor.service.js.map +1 -1
  51. package/dist/modules/workflow-processor/services/pipeline-processor.service.d.ts +15 -0
  52. package/dist/modules/workflow-processor/services/{project-processor.service.js → pipeline-processor.service.js} +24 -24
  53. package/dist/modules/workflow-processor/services/pipeline-processor.service.js.map +1 -0
  54. package/dist/modules/workflow-processor/services/state-machine-config.service.d.ts +7 -7
  55. package/dist/modules/workflow-processor/services/state-machine-config.service.js +0 -4
  56. package/dist/modules/workflow-processor/services/state-machine-config.service.js.map +1 -1
  57. package/dist/modules/workflow-processor/services/state-machine-processor.service.d.ts +3 -1
  58. package/dist/modules/workflow-processor/services/state-machine-processor.service.js +40 -40
  59. package/dist/modules/workflow-processor/services/state-machine-processor.service.js.map +1 -1
  60. package/dist/modules/workflow-processor/services/template-expression-evaluator.service.d.ts +9 -0
  61. package/dist/modules/workflow-processor/services/template-expression-evaluator.service.js +50 -0
  62. package/dist/modules/workflow-processor/services/template-expression-evaluator.service.js.map +1 -0
  63. package/dist/modules/workflow-processor/services/tool-execution.service.d.ts +18 -12
  64. package/dist/modules/workflow-processor/services/tool-execution.service.js +29 -37
  65. package/dist/modules/workflow-processor/services/tool-execution.service.js.map +1 -1
  66. package/dist/modules/workflow-processor/services/tool-schema-validator.service.d.ts +2 -2
  67. package/dist/modules/workflow-processor/services/tool-schema-validator.service.js +3 -3
  68. package/dist/modules/workflow-processor/services/tool-schema-validator.service.js.map +1 -1
  69. package/dist/modules/workflow-processor/services/workflow-processor.service.js +9 -4
  70. package/dist/modules/workflow-processor/services/workflow-processor.service.js.map +1 -1
  71. package/dist/modules/workflow-processor/tool-services/add-namespace.service.d.ts +20 -0
  72. package/dist/modules/workflow-processor/{tools → tool-services}/add-namespace.service.js +16 -13
  73. package/dist/modules/workflow-processor/tool-services/add-namespace.service.js.map +1 -0
  74. package/dist/modules/workflow-processor/tool-services/batch-create-documents.service.d.ts +33 -0
  75. package/dist/modules/workflow-processor/{tools → tool-services}/batch-create-documents.service.js +37 -40
  76. package/dist/modules/workflow-processor/tool-services/batch-create-documents.service.js.map +1 -0
  77. package/dist/modules/workflow-processor/tool-services/create-document.service.d.ts +209 -0
  78. package/dist/modules/workflow-processor/{tools → tool-services}/create-document.service.js +35 -41
  79. package/dist/modules/workflow-processor/tool-services/create-document.service.js.map +1 -0
  80. package/dist/modules/workflow-processor/{tools → tool-services}/index.d.ts +2 -2
  81. package/dist/modules/workflow-processor/{tools → tool-services}/index.js +2 -2
  82. package/dist/modules/workflow-processor/tool-services/index.js.map +1 -0
  83. package/dist/modules/workflow-processor/tool-services/load-document.service.d.ts +68 -0
  84. package/dist/modules/workflow-processor/{tools → tool-services}/load-document.service.js +14 -12
  85. package/dist/modules/workflow-processor/tool-services/load-document.service.js.map +1 -0
  86. package/dist/modules/workflow-processor/tool-services/mock.service.d.ts +17 -0
  87. package/dist/modules/workflow-processor/{tools/debug.service.js → tool-services/mock.service.js} +29 -22
  88. package/dist/modules/workflow-processor/tool-services/mock.service.js.map +1 -0
  89. package/dist/modules/workflow-processor/tool-services/set-context.service.d.ts +18 -0
  90. package/dist/modules/workflow-processor/{tools → tool-services}/set-context.service.js +20 -17
  91. package/dist/modules/workflow-processor/tool-services/set-context.service.js.map +1 -0
  92. package/dist/modules/workflow-processor/tool-services/set-target-place.service.d.ts +14 -0
  93. package/dist/modules/workflow-processor/tool-services/set-target-place.service.js +48 -0
  94. package/dist/modules/workflow-processor/tool-services/set-target-place.service.js.map +1 -0
  95. package/dist/modules/workflow-processor/tool-services/transition-selector.service.d.ts +29 -0
  96. package/dist/modules/workflow-processor/{tools → tool-services}/transition-selector.service.js +22 -19
  97. package/dist/modules/workflow-processor/tool-services/transition-selector.service.js.map +1 -0
  98. package/dist/modules/workflow-processor/tool-services/update-document.service.d.ts +110 -0
  99. package/dist/modules/workflow-processor/{tools → tool-services}/update-document.service.js +22 -19
  100. package/dist/modules/workflow-processor/tool-services/update-document.service.js.map +1 -0
  101. package/dist/modules/workflow-processor/workflow-processor.module.js +13 -12
  102. package/dist/modules/workflow-processor/workflow-processor.module.js.map +1 -1
  103. package/package.json +5 -2
  104. package/dist/config/documents/assistant-message.yaml +0 -13
  105. package/dist/config/documents/info-message.yaml +0 -9
  106. package/dist/config/documents/internal-message.yaml +0 -14
  107. package/dist/config/documents/loading-message.yaml +0 -10
  108. package/dist/config/documents/user-message.yaml +0 -13
  109. package/dist/config/templates/user-input-template.yaml +0 -29
  110. package/dist/config/tools/creat-error-message.yaml +0 -9
  111. package/dist/config/tools/create-assistant-message.yaml +0 -9
  112. package/dist/config/tools/create-chat-message.tool.yaml +0 -7
  113. package/dist/config/tools/create-template-document-user-update.yaml +0 -7
  114. package/dist/config/tools/create-template-document.yaml +0 -5
  115. package/dist/config/tools/create-user-message.tool.yaml +0 -9
  116. package/dist/modules/configuration/services/adapter-registry.service.d.ts +0 -12
  117. package/dist/modules/configuration/services/adapter-registry.service.js.map +0 -1
  118. package/dist/modules/configuration/services/tool.registry.d.ts +0 -13
  119. package/dist/modules/configuration/services/tool.registry.js +0 -59
  120. package/dist/modules/configuration/services/tool.registry.js.map +0 -1
  121. package/dist/modules/persistence/services/project.service.d.ts +0 -8
  122. package/dist/modules/persistence/services/project.service.js.map +0 -1
  123. package/dist/modules/workflow-processor/services/project-processor.service.d.ts +0 -15
  124. package/dist/modules/workflow-processor/services/project-processor.service.js.map +0 -1
  125. package/dist/modules/workflow-processor/tools/add-namespace.service.d.ts +0 -29
  126. package/dist/modules/workflow-processor/tools/add-namespace.service.js.map +0 -1
  127. package/dist/modules/workflow-processor/tools/batch-create-documents.service.d.ts +0 -42
  128. package/dist/modules/workflow-processor/tools/batch-create-documents.service.js.map +0 -1
  129. package/dist/modules/workflow-processor/tools/create-document.service.d.ts +0 -378
  130. package/dist/modules/workflow-processor/tools/create-document.service.js.map +0 -1
  131. package/dist/modules/workflow-processor/tools/debug.service.d.ts +0 -20
  132. package/dist/modules/workflow-processor/tools/debug.service.js.map +0 -1
  133. package/dist/modules/workflow-processor/tools/index.js.map +0 -1
  134. package/dist/modules/workflow-processor/tools/load-document.service.d.ts +0 -242
  135. package/dist/modules/workflow-processor/tools/load-document.service.js.map +0 -1
  136. package/dist/modules/workflow-processor/tools/set-context.service.d.ts +0 -27
  137. package/dist/modules/workflow-processor/tools/set-context.service.js.map +0 -1
  138. package/dist/modules/workflow-processor/tools/tool-call.service.d.ts +0 -29
  139. package/dist/modules/workflow-processor/tools/tool-call.service.js +0 -55
  140. package/dist/modules/workflow-processor/tools/tool-call.service.js.map +0 -1
  141. package/dist/modules/workflow-processor/tools/transition-selector.service.d.ts +0 -50
  142. package/dist/modules/workflow-processor/tools/transition-selector.service.js.map +0 -1
  143. package/dist/modules/workflow-processor/tools/update-document.service.d.ts +0 -198
  144. package/dist/modules/workflow-processor/tools/update-document.service.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # @loopstack/core
2
2
 
3
+ ## 0.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Rework various config schemas and their underlying functionality
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies
12
+ - @loopstack/shared@0.1.0
13
+
3
14
  ## 0.0.5
4
15
 
5
16
  ### Patch Changes
@@ -0,0 +1 @@
1
+ workspaces: []
@@ -1,5 +1,5 @@
1
- import { ContextInterface, ProcessRunInterface, ProjectEntity } from '@loopstack/shared';
1
+ import { ContextInterface, ProcessRunInterface, PipelineEntity } from '@loopstack/shared';
2
2
  export declare class ContextService {
3
- createRootContext(project: ProjectEntity, additional: Partial<ContextInterface>): ContextInterface;
3
+ createRootContext(pipeline: PipelineEntity, additional: Partial<ContextInterface>): ContextInterface;
4
4
  create(payload: ProcessRunInterface | ContextInterface): ContextInterface;
5
5
  }
@@ -13,14 +13,14 @@ exports.ContextService = void 0;
13
13
  const common_1 = require("@nestjs/common");
14
14
  const lodash_1 = __importDefault(require("lodash"));
15
15
  let ContextService = class ContextService {
16
- createRootContext(project, additional) {
16
+ createRootContext(pipeline, additional) {
17
17
  return {
18
- model: project.model,
19
- userId: project.createdBy,
20
- projectId: project.id,
21
- workspaceId: project.workspaceId,
22
- labels: project.labels,
23
- index: project.index,
18
+ model: pipeline.model,
19
+ userId: pipeline.createdBy,
20
+ pipelineId: pipeline.id,
21
+ workspaceId: pipeline.workspaceId,
22
+ labels: pipeline.labels,
23
+ index: pipeline.index,
24
24
  ...additional,
25
25
  };
26
26
  }
@@ -1 +1 @@
1
- {"version":3,"file":"context.service.js","sourceRoot":"","sources":["../../../../src/modules/common/services/context.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,oDAAuB;AAQhB,IAAM,cAAc,GAApB,MAAM,cAAc;IACzB,iBAAiB,CACf,OAAsB,EACtB,UAAqC;QAErC,OAAO;YACL,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,MAAM,EAAE,OAAO,CAAC,SAAS;YACzB,SAAS,EAAE,OAAO,CAAC,EAAE;YACrB,WAAW,EAAE,OAAO,CAAC,WAAW;YAChC,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,GAAG,UAAU;SACM,CAAC;IACxB,CAAC;IAED,MAAM,CAAC,OAA+C;QACpD,OAAO,gBAAC,CAAC,SAAS,CAAC,OAAO,CAAqB,CAAC;IAClD,CAAC;CACF,CAAA;AAnBY,wCAAc;yBAAd,cAAc;IAD1B,IAAA,mBAAU,GAAE;GACA,cAAc,CAmB1B"}
1
+ {"version":3,"file":"context.service.js","sourceRoot":"","sources":["../../../../src/modules/common/services/context.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,oDAAuB;AAQhB,IAAM,cAAc,GAApB,MAAM,cAAc;IACzB,iBAAiB,CACf,QAAwB,EACxB,UAAqC;QAErC,OAAO;YACL,KAAK,EAAE,QAAQ,CAAC,KAAK;YACrB,MAAM,EAAE,QAAQ,CAAC,SAAS;YAC1B,UAAU,EAAE,QAAQ,CAAC,EAAE;YACvB,WAAW,EAAE,QAAQ,CAAC,WAAW;YACjC,MAAM,EAAE,QAAQ,CAAC,MAAM;YACvB,KAAK,EAAE,QAAQ,CAAC,KAAK;YACrB,GAAG,UAAU;SACM,CAAC;IACxB,CAAC;IAED,MAAM,CAAC,OAA+C;QACpD,OAAO,gBAAC,CAAC,SAAS,CAAC,OAAO,CAAqB,CAAC;IAClD,CAAC;CACF,CAAA;AAnBY,wCAAc;yBAAd,cAAc;IAD1B,IAAA,mBAAU,GAAE;GACA,cAAc,CAmB1B"}
@@ -4,6 +4,7 @@ import { ValueParserService } from './value-parser.service';
4
4
  export declare const CreateDocumentWithSchema: z.ZodObject<{
5
5
  update: z.ZodOptional<z.ZodObject<{
6
6
  name: z.ZodOptional<z.ZodString>;
7
+ description: z.ZodOptional<z.ZodOptional<z.ZodString>>;
7
8
  content: z.ZodOptional<z.ZodAny>;
8
9
  schema: z.ZodOptional<z.ZodType<any, z.ZodTypeDef, any>>;
9
10
  ui: z.ZodOptional<z.ZodOptional<z.ZodType<any, z.ZodTypeDef, any>>>;
@@ -16,51 +17,54 @@ export declare const CreateDocumentWithSchema: z.ZodObject<{
16
17
  hideAtPlaces: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
17
18
  data: z.ZodOptional<z.ZodAny>;
18
19
  }, "strip", z.ZodTypeAny, {
19
- invalidate?: boolean | undefined;
20
20
  data?: any;
21
- mimeType?: "text/plain" | "text/html" | "text/css" | "text/xml" | "text/markdown" | "application/javascript" | "application/typescript" | "application/json" | "application/xml" | "application/yaml" | undefined;
21
+ invalidate?: boolean | undefined;
22
+ mimeType?: "application/xml" | "text/html" | "text/xml" | "text/plain" | "text/css" | "text/markdown" | "application/javascript" | "application/typescript" | "application/json" | "application/yaml" | undefined;
22
23
  enableTransitions?: string[] | undefined;
23
24
  enableAtPlaces?: string[] | undefined;
24
25
  hideAtPlaces?: string[] | undefined;
25
26
  }, {
26
- invalidate?: boolean | undefined;
27
27
  data?: any;
28
- mimeType?: "text/plain" | "text/html" | "text/css" | "text/xml" | "text/markdown" | "application/javascript" | "application/typescript" | "application/json" | "application/xml" | "application/yaml" | undefined;
28
+ invalidate?: boolean | undefined;
29
+ mimeType?: "application/xml" | "text/html" | "text/xml" | "text/plain" | "text/css" | "text/markdown" | "application/javascript" | "application/typescript" | "application/json" | "application/yaml" | undefined;
29
30
  enableTransitions?: string[] | undefined;
30
31
  enableAtPlaces?: string[] | undefined;
31
32
  hideAtPlaces?: string[] | undefined;
32
33
  }>>>;
33
34
  }, "strip", z.ZodTypeAny, {
34
- schema?: any;
35
35
  name?: string | undefined;
36
36
  content?: any;
37
- ui?: any;
38
- tags?: string[] | undefined;
39
37
  meta?: {
40
- invalidate?: boolean | undefined;
41
38
  data?: any;
42
- mimeType?: "text/plain" | "text/html" | "text/css" | "text/xml" | "text/markdown" | "application/javascript" | "application/typescript" | "application/json" | "application/xml" | "application/yaml" | undefined;
39
+ invalidate?: boolean | undefined;
40
+ mimeType?: "application/xml" | "text/html" | "text/xml" | "text/plain" | "text/css" | "text/markdown" | "application/javascript" | "application/typescript" | "application/json" | "application/yaml" | undefined;
43
41
  enableTransitions?: string[] | undefined;
44
42
  enableAtPlaces?: string[] | undefined;
45
43
  hideAtPlaces?: string[] | undefined;
46
44
  } | undefined;
47
- }, {
45
+ description?: string | undefined;
48
46
  schema?: any;
49
- name?: string | undefined;
50
- content?: any;
51
47
  ui?: any;
52
48
  tags?: string[] | undefined;
49
+ }, {
50
+ name?: string | undefined;
51
+ content?: any;
53
52
  meta?: {
54
- invalidate?: boolean | undefined;
55
53
  data?: any;
56
- mimeType?: "text/plain" | "text/html" | "text/css" | "text/xml" | "text/markdown" | "application/javascript" | "application/typescript" | "application/json" | "application/xml" | "application/yaml" | undefined;
54
+ invalidate?: boolean | undefined;
55
+ mimeType?: "application/xml" | "text/html" | "text/xml" | "text/plain" | "text/css" | "text/markdown" | "application/javascript" | "application/typescript" | "application/json" | "application/yaml" | undefined;
57
56
  enableTransitions?: string[] | undefined;
58
57
  enableAtPlaces?: string[] | undefined;
59
58
  hideAtPlaces?: string[] | undefined;
60
59
  } | undefined;
60
+ description?: string | undefined;
61
+ schema?: any;
62
+ ui?: any;
63
+ tags?: string[] | undefined;
61
64
  }>>;
62
65
  create: z.ZodOptional<z.ZodObject<{
63
66
  name: z.ZodString;
67
+ description: z.ZodOptional<z.ZodString>;
64
68
  content: z.ZodAny;
65
69
  schema: z.ZodType<any, z.ZodTypeDef, any>;
66
70
  ui: z.ZodOptional<z.ZodType<any, z.ZodTypeDef, any>>;
@@ -73,110 +77,116 @@ export declare const CreateDocumentWithSchema: z.ZodObject<{
73
77
  hideAtPlaces: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
74
78
  data: z.ZodOptional<z.ZodAny>;
75
79
  }, "strip", z.ZodTypeAny, {
76
- invalidate?: boolean | undefined;
77
80
  data?: any;
78
- mimeType?: "text/plain" | "text/html" | "text/css" | "text/xml" | "text/markdown" | "application/javascript" | "application/typescript" | "application/json" | "application/xml" | "application/yaml" | undefined;
81
+ invalidate?: boolean | undefined;
82
+ mimeType?: "application/xml" | "text/html" | "text/xml" | "text/plain" | "text/css" | "text/markdown" | "application/javascript" | "application/typescript" | "application/json" | "application/yaml" | undefined;
79
83
  enableTransitions?: string[] | undefined;
80
84
  enableAtPlaces?: string[] | undefined;
81
85
  hideAtPlaces?: string[] | undefined;
82
86
  }, {
83
- invalidate?: boolean | undefined;
84
87
  data?: any;
85
- mimeType?: "text/plain" | "text/html" | "text/css" | "text/xml" | "text/markdown" | "application/javascript" | "application/typescript" | "application/json" | "application/xml" | "application/yaml" | undefined;
88
+ invalidate?: boolean | undefined;
89
+ mimeType?: "application/xml" | "text/html" | "text/xml" | "text/plain" | "text/css" | "text/markdown" | "application/javascript" | "application/typescript" | "application/json" | "application/yaml" | undefined;
86
90
  enableTransitions?: string[] | undefined;
87
91
  enableAtPlaces?: string[] | undefined;
88
92
  hideAtPlaces?: string[] | undefined;
89
93
  }>>;
90
94
  }, "strip", z.ZodTypeAny, {
91
95
  name: string;
92
- schema?: any;
93
96
  content?: any;
94
- ui?: any;
95
- tags?: string[] | undefined;
96
97
  meta?: {
97
- invalidate?: boolean | undefined;
98
98
  data?: any;
99
- mimeType?: "text/plain" | "text/html" | "text/css" | "text/xml" | "text/markdown" | "application/javascript" | "application/typescript" | "application/json" | "application/xml" | "application/yaml" | undefined;
99
+ invalidate?: boolean | undefined;
100
+ mimeType?: "application/xml" | "text/html" | "text/xml" | "text/plain" | "text/css" | "text/markdown" | "application/javascript" | "application/typescript" | "application/json" | "application/yaml" | undefined;
100
101
  enableTransitions?: string[] | undefined;
101
102
  enableAtPlaces?: string[] | undefined;
102
103
  hideAtPlaces?: string[] | undefined;
103
104
  } | undefined;
104
- }, {
105
- name: string;
105
+ description?: string | undefined;
106
106
  schema?: any;
107
- content?: any;
108
107
  ui?: any;
109
108
  tags?: string[] | undefined;
109
+ }, {
110
+ name: string;
111
+ content?: any;
110
112
  meta?: {
111
- invalidate?: boolean | undefined;
112
113
  data?: any;
113
- mimeType?: "text/plain" | "text/html" | "text/css" | "text/xml" | "text/markdown" | "application/javascript" | "application/typescript" | "application/json" | "application/xml" | "application/yaml" | undefined;
114
+ invalidate?: boolean | undefined;
115
+ mimeType?: "application/xml" | "text/html" | "text/xml" | "text/plain" | "text/css" | "text/markdown" | "application/javascript" | "application/typescript" | "application/json" | "application/yaml" | undefined;
114
116
  enableTransitions?: string[] | undefined;
115
117
  enableAtPlaces?: string[] | undefined;
116
118
  hideAtPlaces?: string[] | undefined;
117
119
  } | undefined;
120
+ description?: string | undefined;
121
+ schema?: any;
122
+ ui?: any;
123
+ tags?: string[] | undefined;
118
124
  }>>;
119
125
  }, "strip", z.ZodTypeAny, {
120
126
  create?: {
121
127
  name: string;
122
- schema?: any;
123
128
  content?: any;
124
- ui?: any;
125
- tags?: string[] | undefined;
126
129
  meta?: {
127
- invalidate?: boolean | undefined;
128
130
  data?: any;
129
- mimeType?: "text/plain" | "text/html" | "text/css" | "text/xml" | "text/markdown" | "application/javascript" | "application/typescript" | "application/json" | "application/xml" | "application/yaml" | undefined;
131
+ invalidate?: boolean | undefined;
132
+ mimeType?: "application/xml" | "text/html" | "text/xml" | "text/plain" | "text/css" | "text/markdown" | "application/javascript" | "application/typescript" | "application/json" | "application/yaml" | undefined;
130
133
  enableTransitions?: string[] | undefined;
131
134
  enableAtPlaces?: string[] | undefined;
132
135
  hideAtPlaces?: string[] | undefined;
133
136
  } | undefined;
137
+ description?: string | undefined;
138
+ schema?: any;
139
+ ui?: any;
140
+ tags?: string[] | undefined;
134
141
  } | undefined;
135
142
  update?: {
136
- schema?: any;
137
143
  name?: string | undefined;
138
144
  content?: any;
139
- ui?: any;
140
- tags?: string[] | undefined;
141
145
  meta?: {
142
- invalidate?: boolean | undefined;
143
146
  data?: any;
144
- mimeType?: "text/plain" | "text/html" | "text/css" | "text/xml" | "text/markdown" | "application/javascript" | "application/typescript" | "application/json" | "application/xml" | "application/yaml" | undefined;
147
+ invalidate?: boolean | undefined;
148
+ mimeType?: "application/xml" | "text/html" | "text/xml" | "text/plain" | "text/css" | "text/markdown" | "application/javascript" | "application/typescript" | "application/json" | "application/yaml" | undefined;
145
149
  enableTransitions?: string[] | undefined;
146
150
  enableAtPlaces?: string[] | undefined;
147
151
  hideAtPlaces?: string[] | undefined;
148
152
  } | undefined;
153
+ description?: string | undefined;
154
+ schema?: any;
155
+ ui?: any;
156
+ tags?: string[] | undefined;
149
157
  } | undefined;
150
158
  }, {
151
159
  create?: {
152
160
  name: string;
153
- schema?: any;
154
161
  content?: any;
155
- ui?: any;
156
- tags?: string[] | undefined;
157
162
  meta?: {
158
- invalidate?: boolean | undefined;
159
163
  data?: any;
160
- mimeType?: "text/plain" | "text/html" | "text/css" | "text/xml" | "text/markdown" | "application/javascript" | "application/typescript" | "application/json" | "application/xml" | "application/yaml" | undefined;
164
+ invalidate?: boolean | undefined;
165
+ mimeType?: "application/xml" | "text/html" | "text/xml" | "text/plain" | "text/css" | "text/markdown" | "application/javascript" | "application/typescript" | "application/json" | "application/yaml" | undefined;
161
166
  enableTransitions?: string[] | undefined;
162
167
  enableAtPlaces?: string[] | undefined;
163
168
  hideAtPlaces?: string[] | undefined;
164
169
  } | undefined;
170
+ description?: string | undefined;
171
+ schema?: any;
172
+ ui?: any;
173
+ tags?: string[] | undefined;
165
174
  } | undefined;
166
175
  update?: {
167
- schema?: any;
168
176
  name?: string | undefined;
169
177
  content?: any;
170
- ui?: any;
171
- tags?: string[] | undefined;
172
178
  meta?: {
173
- invalidate?: boolean | undefined;
174
179
  data?: any;
175
- mimeType?: "text/plain" | "text/html" | "text/css" | "text/xml" | "text/markdown" | "application/javascript" | "application/typescript" | "application/json" | "application/xml" | "application/yaml" | undefined;
180
+ invalidate?: boolean | undefined;
181
+ mimeType?: "application/xml" | "text/html" | "text/xml" | "text/plain" | "text/css" | "text/markdown" | "application/javascript" | "application/typescript" | "application/json" | "application/yaml" | undefined;
176
182
  enableTransitions?: string[] | undefined;
177
183
  enableAtPlaces?: string[] | undefined;
178
184
  hideAtPlaces?: string[] | undefined;
179
185
  } | undefined;
186
+ description?: string | undefined;
187
+ schema?: any;
188
+ ui?: any;
189
+ tags?: string[] | undefined;
180
190
  } | undefined;
181
191
  }>;
182
192
  export declare class DocumentHelperService {
@@ -1,5 +1,7 @@
1
+ import { JSONSchemaType } from 'ajv';
1
2
  import { DocumentEntity } from '@loopstack/shared';
2
3
  export declare class SchemaValidatorService {
3
4
  private readonly logger;
5
+ validate(data: any, schema: JSONSchemaType<any>): void;
4
6
  validateDocument(data: Partial<DocumentEntity>): void;
5
7
  }
@@ -15,19 +15,22 @@ const common_1 = require("@nestjs/common");
15
15
  const ajv_1 = __importDefault(require("ajv"));
16
16
  let SchemaValidatorService = SchemaValidatorService_1 = class SchemaValidatorService {
17
17
  logger = new common_1.Logger(SchemaValidatorService_1.name);
18
+ validate(data, schema) {
19
+ const ajv = new ajv_1.default({
20
+ strict: false,
21
+ keywords: ['ui'],
22
+ });
23
+ const validate = ajv.compile(schema);
24
+ const valid = validate(data);
25
+ if (!valid) {
26
+ this.logger.error(data);
27
+ this.logger.error(validate.errors);
28
+ throw new Error(`Validating data failed.`);
29
+ }
30
+ }
18
31
  validateDocument(data) {
19
32
  if (data.schema) {
20
- const ajv = new ajv_1.default({
21
- strict: false,
22
- keywords: ['ui'],
23
- });
24
- const validate = ajv.compile(data.schema);
25
- const valid = validate(data.content);
26
- if (!valid) {
27
- this.logger.error(data.content);
28
- this.logger.error(validate.errors);
29
- throw new Error(`Error validating document content.`);
30
- }
33
+ this.validate(data.content, data.schema);
31
34
  }
32
35
  }
33
36
  };
@@ -1 +1 @@
1
- {"version":3,"file":"schema-validator.service.js","sourceRoot":"","sources":["../../../../src/modules/common/services/schema-validator.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAoD;AACpD,8CAAsB;AAIf,IAAM,sBAAsB,8BAA5B,MAAM,sBAAsB;IAChB,MAAM,GAAG,IAAI,eAAM,CAAC,wBAAsB,CAAC,IAAI,CAAC,CAAC;IAElE,gBAAgB,CAAC,IAA6B;QAC5C,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAChB,MAAM,GAAG,GAAG,IAAI,aAAG,CAAC;gBAClB,MAAM,EAAE,KAAK;gBACb,QAAQ,EAAE,CAAC,IAAI,CAAC;aACjB,CAAC,CAAC;YACH,MAAM,QAAQ,GAAG,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YAC1C,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACrC,IAAI,CAAC,KAAK,EAAE,CAAC;gBACX,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;gBAChC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;gBACnC,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;YACxD,CAAC;QACH,CAAC;IACH,CAAC;CACF,CAAA;AAlBY,wDAAsB;iCAAtB,sBAAsB;IADlC,IAAA,mBAAU,GAAE;GACA,sBAAsB,CAkBlC"}
1
+ {"version":3,"file":"schema-validator.service.js","sourceRoot":"","sources":["../../../../src/modules/common/services/schema-validator.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAoD;AACpD,8CAA0C;AAInC,IAAM,sBAAsB,8BAA5B,MAAM,sBAAsB;IAChB,MAAM,GAAG,IAAI,eAAM,CAAC,wBAAsB,CAAC,IAAI,CAAC,CAAC;IAElE,QAAQ,CAAC,IAAS,EAAE,MAA2B;QAC7C,MAAM,GAAG,GAAG,IAAI,aAAG,CAAC;YAClB,MAAM,EAAE,KAAK;YACb,QAAQ,EAAE,CAAC,IAAI,CAAC;SACjB,CAAC,CAAC;QACH,MAAM,QAAQ,GAAG,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACrC,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;QAC7B,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YACxB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;YACnC,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;QAC7C,CAAC;IACH,CAAC;IAED,gBAAgB,CAAC,IAA6B;QAC5C,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAChB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QAC3C,CAAC;IACH,CAAC;CACF,CAAA;AAtBY,wDAAsB;iCAAtB,sBAAsB;IADlC,IAAA,mBAAU,GAAE;GACA,sBAAsB,CAsBlC"}
@@ -1,5 +1,5 @@
1
1
  import { ExpressionEvaluatorService } from './expression-evaluator.service';
2
- import { ContextInterface, WorkflowRunContext } from '@loopstack/shared';
2
+ import { ContextInterface } from '@loopstack/shared';
3
3
  import { TemplateEngineService } from './template-engine.service';
4
4
  export declare class ValueParserService {
5
5
  private expressionEvaluatorService;
@@ -10,14 +10,10 @@ export declare class ValueParserService {
10
10
  evalWithContext<T>(obj: any, variables: {
11
11
  context: ContextInterface;
12
12
  }): T;
13
- evalWithContextAndInfo<T extends {}>(obj: any, variables: {
14
- context: ContextInterface;
15
- workflow: WorkflowRunContext;
16
- }): T;
17
13
  evalWithContextAndItem<T extends {}>(obj: any, variables: {
18
14
  context: ContextInterface;
19
15
  item: string;
20
16
  index: number;
21
17
  }): T;
22
- evalWithContextVariables<T extends {}>(obj: any, variables: any): T;
18
+ evalWithContextVariables<T>(obj: any, variables: any): T;
23
19
  }
@@ -52,9 +52,6 @@ let ValueParserService = class ValueParserService {
52
52
  evalWithContext(obj, variables) {
53
53
  return obj ? this.evalObjectLeafs(obj, variables) : {};
54
54
  }
55
- evalWithContextAndInfo(obj, variables) {
56
- return obj ? this.evalObjectLeafs(obj, variables) : {};
57
- }
58
55
  evalWithContextAndItem(obj, variables) {
59
56
  return obj ? this.evalObjectLeafs(obj, variables) : {};
60
57
  }
@@ -1 +1 @@
1
- {"version":3,"file":"value-parser.service.js","sourceRoot":"","sources":["../../../../src/modules/common/services/value-parser.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,iFAA4E;AAM5E,mCAAwC;AACxC,uEAAkE;AAG3D,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAEnB;IACA;IAFV,YACU,0BAAsD,EACtD,qBAA4C;QAD5C,+BAA0B,GAA1B,0BAA0B,CAA4B;QACtD,0BAAqB,GAArB,qBAAqB,CAAuB;IACnD,CAAC;IAEJ,eAAe,CAAI,GAAM,EAAE,SAAc;QACvC,IAAI,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;YACtC,OAAO,GAAG,CAAC;QACb,CAAC;QAED,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;YAC5B,OAAO,IAAI,CAAC,0BAA0B,CAAC,YAAY,CAAC,GAAG,CAAC;gBACtD,CAAC,CAAC,IAAI,CAAC,0BAA0B,CAAC,QAAQ,CAAC,GAAG,EAAE,SAAS,CAAC;gBAC1D,CAAC,CAAE,IAAI,CAAC,qBAAqB,CAAC,QAAQ,CAAC,GAAG,EAAE,SAAS,CAAkB,CAAC;QAC5E,CAAC;QAED,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;YACvB,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CACtB,IAAI,CAAC,eAAe,CAAC,IAAI,EAAE,SAAS,CAAC,CACtB,CAAC;QACpB,CAAC;QAED,MAAM,MAAM,GAAG,EAAO,CAAC;QACvB,KAAK,MAAM,GAAG,IAAI,GAAG,EAAE,CAAC;YACtB,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC;gBACnD,MAAM,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,SAAS,CAAC,CAAC;YAC1D,CAAC;QACH,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,qBAAqB,CACnB,cAAmC,EACnC,UAA+B;QAE/B,OAAO,cAAc;YACnB,CAAC,CAAC,IAAA,kBAAS,EACP,cAAc,EACd,CAAC,MAA2B,EAAE,IAAc,EAAE,GAAW,EAAE,EAAE;gBAC3D,MAAM,QAAQ,GAAG,IAAA,YAAG,EAAC,UAAU,EAAE,IAAI,CAAC,CAAC;gBACvC,MAAM,CAAC,GAAG,CAAC,GAAG,QAAQ,EAAE,OAAO,CAAC;YAClC,CAAC,EACD,EAAE,CACH;YACH,CAAC,CAAC,EAAE,CAAC;IACT,CAAC;IAED,eAAe,CAAI,GAAQ,EAAE,SAAwC;QACnE,OAAO,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAI,GAAG,EAAE,SAAS,CAAC,CAAC,CAAC,CAAE,EAAU,CAAC;IACrE,CAAC;IAED,sBAAsB,CACpB,GAAQ,EACR,SAAsE;QAEtE,OAAO,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAI,GAAG,EAAE,SAAS,CAAC,CAAC,CAAC,CAAE,EAAU,CAAC;IACrE,CAAC;IAED,sBAAsB,CACpB,GAAQ,EACR,SAAqE;QAErE,OAAO,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAI,GAAG,EAAE,SAAS,CAAC,CAAC,CAAC,CAAE,EAAU,CAAC;IACrE,CAAC;IAED,wBAAwB,CAAe,GAAQ,EAAE,SAAc;QAC7D,OAAO,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAI,GAAG,EAAE,SAAS,CAAC,CAAC,CAAC,CAAE,EAAU,CAAC;IACrE,CAAC;CACF,CAAA;AAtEY,gDAAkB;6BAAlB,kBAAkB;IAD9B,IAAA,mBAAU,GAAE;qCAG2B,yDAA0B;QAC/B,+CAAqB;GAH3C,kBAAkB,CAsE9B"}
1
+ {"version":3,"file":"value-parser.service.js","sourceRoot":"","sources":["../../../../src/modules/common/services/value-parser.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,iFAA4E;AAI5E,mCAAwC;AACxC,uEAAkE;AAG3D,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAEnB;IACA;IAFV,YACU,0BAAsD,EACtD,qBAA4C;QAD5C,+BAA0B,GAA1B,0BAA0B,CAA4B;QACtD,0BAAqB,GAArB,qBAAqB,CAAuB;IACnD,CAAC;IAEJ,eAAe,CAAI,GAAM,EAAE,SAAc;QACvC,IAAI,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;YACtC,OAAO,GAAG,CAAC;QACb,CAAC;QAED,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;YAC5B,OAAO,IAAI,CAAC,0BAA0B,CAAC,YAAY,CAAC,GAAG,CAAC;gBACtD,CAAC,CAAC,IAAI,CAAC,0BAA0B,CAAC,QAAQ,CAAC,GAAG,EAAE,SAAS,CAAC;gBAC1D,CAAC,CAAE,IAAI,CAAC,qBAAqB,CAAC,QAAQ,CAAC,GAAG,EAAE,SAAS,CAAkB,CAAC;QAC5E,CAAC;QAED,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;YACvB,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CACtB,IAAI,CAAC,eAAe,CAAC,IAAI,EAAE,SAAS,CAAC,CACtB,CAAC;QACpB,CAAC;QAED,MAAM,MAAM,GAAG,EAAO,CAAC;QACvB,KAAK,MAAM,GAAG,IAAI,GAAG,EAAE,CAAC;YACtB,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC;gBACnD,MAAM,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,SAAS,CAAC,CAAC;YAC1D,CAAC;QACH,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,qBAAqB,CACnB,cAAmC,EACnC,UAA+B;QAE/B,OAAO,cAAc;YACnB,CAAC,CAAC,IAAA,kBAAS,EACP,cAAc,EACd,CAAC,MAA2B,EAAE,IAAc,EAAE,GAAW,EAAE,EAAE;gBAC3D,MAAM,QAAQ,GAAG,IAAA,YAAG,EAAC,UAAU,EAAE,IAAI,CAAC,CAAC;gBACvC,MAAM,CAAC,GAAG,CAAC,GAAG,QAAQ,EAAE,OAAO,CAAC;YAClC,CAAC,EACD,EAAE,CACH;YACH,CAAC,CAAC,EAAE,CAAC;IACT,CAAC;IAED,eAAe,CAAI,GAAQ,EAAE,SAAwC;QACnE,OAAO,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAI,GAAG,EAAE,SAAS,CAAC,CAAC,CAAC,CAAE,EAAU,CAAC;IACrE,CAAC;IACD,sBAAsB,CACpB,GAAQ,EACR,SAAqE;QAErE,OAAO,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAI,GAAG,EAAE,SAAS,CAAC,CAAC,CAAC,CAAE,EAAU,CAAC;IACrE,CAAC;IAED,wBAAwB,CAAI,GAAQ,EAAE,SAAc;QAClD,OAAO,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAI,GAAG,EAAE,SAAS,CAAC,CAAC,CAAC,CAAE,EAAU,CAAC;IACrE,CAAC;CACF,CAAA;AA9DY,gDAAkB;6BAAlB,kBAAkB;IAD9B,IAAA,mBAAU,GAAE;qCAG2B,yDAA0B;QAC/B,+CAAqB;GAH3C,kBAAkB,CA8D9B"}
@@ -21,15 +21,14 @@ exports.ConfigurationModule = ConfigurationModule = __decorate([
21
21
  (0, common_1.Module)({
22
22
  imports: [core_1.DiscoveryModule],
23
23
  providers: [
24
- services_2.ToolRegistry,
25
- services_1.AdapterRegistry,
24
+ services_2.ServiceRegistry,
26
25
  services_1.ConfigProviderRegistry,
27
26
  services_1.ConfigurationService,
28
27
  json_schema_generator_service_1.JsonSchemaGeneratorService,
29
28
  generate_schemas_command_1.GenerateSchemasCommand,
30
29
  dynamic_schema_generator_service_1.DynamicSchemaGeneratorService,
31
30
  ],
32
- exports: [services_1.ConfigurationService, services_2.ToolRegistry, services_1.AdapterRegistry],
31
+ exports: [services_1.ConfigurationService, services_2.ServiceRegistry],
33
32
  })
34
33
  ], ConfigurationModule);
35
34
  //# sourceMappingURL=configuration.module.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"configuration.module.js","sourceRoot":"","sources":["../../../src/modules/configuration/configuration.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,yCAIoB;AACpB,4FAAsF;AACtF,yCAA0C;AAC1C,kFAA6E;AAC7E,kGAA4F;AAC5F,uCAA+C;AAexC,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;CAAG,CAAA;AAAtB,kDAAmB;8BAAnB,mBAAmB;IAb/B,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,sBAAe,CAAC;QAC1B,SAAS,EAAE;YACT,uBAAY;YACZ,0BAAe;YACf,iCAAsB;YACtB,+BAAoB;YACpB,0DAA0B;YAC1B,iDAAsB;YACtB,gEAA6B;SAC9B;QACD,OAAO,EAAE,CAAC,+BAAoB,EAAE,uBAAY,EAAE,0BAAe,CAAC;KAC/D,CAAC;GACW,mBAAmB,CAAG"}
1
+ {"version":3,"file":"configuration.module.js","sourceRoot":"","sources":["../../../src/modules/configuration/configuration.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,yCAGoB;AACpB,4FAAsF;AACtF,yCAA6C;AAC7C,kFAA6E;AAC7E,kGAA4F;AAC5F,uCAA+C;AAcxC,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;CAAG,CAAA;AAAtB,kDAAmB;8BAAnB,mBAAmB;IAZ/B,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,sBAAe,CAAC;QAC1B,SAAS,EAAE;YACT,0BAAe;YACf,iCAAsB;YACtB,+BAAoB;YACpB,0DAA0B;YAC1B,iDAAsB;YACtB,gEAA6B;SAC9B;QACD,OAAO,EAAE,CAAC,+BAAoB,EAAE,0BAAe,CAAC;KACjD,CAAC;GACW,mBAAmB,CAAG"}
@@ -1,19 +1,17 @@
1
1
  import { OnModuleInit } from '@nestjs/common';
2
2
  import { DynamicSchemaGeneratorService } from './dynamic-schema-generator.service';
3
- import { AdapterRegistry } from './adapter-registry.service';
4
- import { ToolRegistry } from './tool.registry';
3
+ import { ServiceRegistry } from './service-registry.service';
5
4
  import { ConfigService } from '@nestjs/config';
6
5
  import { ConfigSourceInterface, NamedCollectionItem } from '@loopstack/shared';
7
6
  import { ConfigProviderRegistry } from './config-provider.registry';
8
7
  export declare class ConfigurationService implements OnModuleInit {
9
8
  private configService;
10
- private adapterRegistry;
11
- private toolRegistry;
9
+ private serviceRegistry;
12
10
  private configProviderRegistry;
13
11
  private mainSchemaGenerator;
14
12
  private logger;
15
13
  registry: Map<string, Map<string, any>>;
16
- constructor(configService: ConfigService, adapterRegistry: AdapterRegistry, toolRegistry: ToolRegistry, configProviderRegistry: ConfigProviderRegistry, mainSchemaGenerator: DynamicSchemaGeneratorService);
14
+ constructor(configService: ConfigService, serviceRegistry: ServiceRegistry, configProviderRegistry: ConfigProviderRegistry, mainSchemaGenerator: DynamicSchemaGeneratorService);
17
15
  onModuleInit(): void;
18
16
  createDefaultConfig(): Map<string, Map<any, any>>;
19
17
  clear(): void;
@@ -22,8 +20,8 @@ export declare class ConfigurationService implements OnModuleInit {
22
20
  getAll<T>(registry: string): T[];
23
21
  get<T>(registry: string, searchKey: string): T | undefined;
24
22
  createFromConfig(source: ConfigSourceInterface): any;
25
- private createProjectEntrypointValidation;
26
- private createProjectWorkspaceValidation;
23
+ private createPipelineEntrypointValidation;
24
+ private createPipelineWorkspaceValidation;
27
25
  private createWorkflowToolCallValidation;
28
26
  private createWorkflowTemplateToolCallValidation;
29
27
  validate(source: ConfigSourceInterface): any;
@@ -13,23 +13,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
13
13
  exports.ConfigurationService = void 0;
14
14
  const common_1 = require("@nestjs/common");
15
15
  const dynamic_schema_generator_service_1 = require("./dynamic-schema-generator.service");
16
- const adapter_registry_service_1 = require("./adapter-registry.service");
17
- const tool_registry_1 = require("./tool.registry");
16
+ const service_registry_service_1 = require("./service-registry.service");
18
17
  const config_1 = require("@nestjs/config");
19
18
  const config_provider_registry_1 = require("./config-provider.registry");
20
19
  const zod_1 = require("zod");
21
20
  let ConfigurationService = ConfigurationService_1 = class ConfigurationService {
22
21
  configService;
23
- adapterRegistry;
24
- toolRegistry;
22
+ serviceRegistry;
25
23
  configProviderRegistry;
26
24
  mainSchemaGenerator;
27
25
  logger = new common_1.Logger(ConfigurationService_1.name);
28
26
  registry;
29
- constructor(configService, adapterRegistry, toolRegistry, configProviderRegistry, mainSchemaGenerator) {
27
+ constructor(configService, serviceRegistry, configProviderRegistry, mainSchemaGenerator) {
30
28
  this.configService = configService;
31
- this.adapterRegistry = adapterRegistry;
32
- this.toolRegistry = toolRegistry;
29
+ this.serviceRegistry = serviceRegistry;
33
30
  this.configProviderRegistry = configProviderRegistry;
34
31
  this.mainSchemaGenerator = mainSchemaGenerator;
35
32
  }
@@ -40,8 +37,7 @@ let ConfigurationService = ConfigurationService_1 = class ConfigurationService {
40
37
  }
41
38
  this.clear();
42
39
  this.configProviderRegistry.initialize();
43
- this.adapterRegistry.initialize();
44
- this.toolRegistry.initialize();
40
+ this.serviceRegistry.initialize();
45
41
  const appConfigs = this.configService.get('configs') ?? [];
46
42
  const moduleConfigs = this.configProviderRegistry.getConfigs();
47
43
  const configs = [...appConfigs, ...moduleConfigs];
@@ -58,7 +54,7 @@ let ConfigurationService = ConfigurationService_1 = class ConfigurationService {
58
54
  createDefaultConfig() {
59
55
  return new Map(Object.entries({
60
56
  workspaces: new Map(),
61
- projects: new Map(),
57
+ pipelines: new Map(),
62
58
  workflows: new Map(),
63
59
  documents: new Map(),
64
60
  tools: new Map(),
@@ -114,31 +110,31 @@ let ConfigurationService = ConfigurationService_1 = class ConfigurationService {
114
110
  this.handleConfigError(error, source.path);
115
111
  }
116
112
  }
117
- createProjectEntrypointValidation() {
113
+ createPipelineEntrypointValidation() {
118
114
  return zod_1.z.any().refine((data) => {
119
- if (!data.projects) {
115
+ if (!data.pipelines) {
120
116
  return true;
121
117
  }
122
- return data.projects.every((project) => undefined !== this.get('workflows', project.entrypoint));
118
+ return data.pipelines.every((pipeline) => undefined !== this.get('workflows', pipeline.entrypoint));
123
119
  }, (data) => {
124
- const invalidIndex = data.projects?.findIndex((project) => undefined === this.get('workspaces', project.workspace)) ?? -1;
120
+ const invalidIndex = data.pipelines?.findIndex((pipeline) => undefined === this.get('workspaces', pipeline.workspace)) ?? -1;
125
121
  return {
126
- message: `project references non-existent workflow.`,
127
- path: ['projects', invalidIndex, 'entrypoint'],
122
+ message: `pipeline references non-existent workflow.`,
123
+ path: ['pipelines', invalidIndex, 'entrypoint'],
128
124
  };
129
125
  });
130
126
  }
131
- createProjectWorkspaceValidation() {
127
+ createPipelineWorkspaceValidation() {
132
128
  return zod_1.z.any().refine((data) => {
133
- if (!data.projects) {
129
+ if (!data.pipelines) {
134
130
  return true;
135
131
  }
136
- return data.projects.every((project) => undefined !== this.get('workspaces', project.workspace));
132
+ return data.pipelines.every((pipeline) => undefined !== this.get('workspaces', pipeline.workspace));
137
133
  }, (data) => {
138
- const invalidIndex = data.projects?.findIndex((project) => undefined === this.get('workspaces', project.workspace)) ?? -1;
134
+ const invalidIndex = data.pipelines?.findIndex((pipeline) => undefined === this.get('workspaces', pipeline.workspace)) ?? -1;
139
135
  return {
140
- message: `project references non-existent workspace.`,
141
- path: ['projects', invalidIndex, 'workspace'],
136
+ message: `pipeline references non-existent workspace.`,
137
+ path: ['pipelines', invalidIndex, 'workspace'],
142
138
  };
143
139
  });
144
140
  }
@@ -148,19 +144,18 @@ let ConfigurationService = ConfigurationService_1 = class ConfigurationService {
148
144
  return true;
149
145
  }
150
146
  const toolCalls = data.workflows
151
- .map((wf) => wf.type === 'stateMachine' ? wf.handlers?.map((h) => h.call) : [])
152
- .flat()
147
+ .map((wf) => wf.type === 'stateMachine' ? wf.transitions?.map((h) => h.call?.map((call) => call.tool)) : [])
148
+ .flat(2)
153
149
  .filter((toolName) => undefined !== toolName);
154
150
  return toolCalls.every((toolName) => undefined !== this.get('tools', toolName));
155
151
  }, (data) => {
156
- const items = data.workflows?.map((wf) => wf.type === 'stateMachine' &&
157
- wf.handlers?.find((h) => undefined === this.get('tools', h.call))) ?? [];
158
- const errorItem = items
159
- .flat()
160
- .filter((i) => undefined !== i)
161
- .shift();
152
+ const toolCalls = data.workflows.map((wf) => wf.type === 'stateMachine' ? wf.transitions?.map((h) => h.call?.map((call) => call.tool)) : [])
153
+ .flat(2)
154
+ .filter((toolName) => undefined !== toolName);
155
+ const errorItem = toolCalls
156
+ .find((toolName) => undefined === this.get('tools', toolName));
162
157
  return {
163
- message: `workflow handler references non-existent tool "${errorItem.call}".`,
158
+ message: `workflow handler references non-existent tool "${errorItem.tool}".`,
164
159
  path: ['workflows', 'handlers'],
165
160
  };
166
161
  });
@@ -171,22 +166,22 @@ let ConfigurationService = ConfigurationService_1 = class ConfigurationService {
171
166
  return true;
172
167
  }
173
168
  const stateMachineWorkflows = data.workflowTemplates.filter((wf) => wf.type === 'stateMachine');
174
- const templateIndex = stateMachineWorkflows.findIndex((wf) => wf.handlers &&
175
- wf.handlers.find((handler) => !this.has('tools', handler.call)));
169
+ const templateIndex = stateMachineWorkflows.findIndex((wf) => wf.transitions &&
170
+ wf.transitions.find((t) => t.call?.find((call) => !this.has('tools', call.tool))));
176
171
  return templateIndex === -1;
177
172
  }, (data) => {
178
173
  const stateMachineWorkflows = data.workflowTemplates.filter((wf) => wf.type === 'stateMachine');
179
- const templateIndex = stateMachineWorkflows.findIndex((wf) => wf.handlers &&
180
- wf.handlers.find((handler) => !this.has('tools', handler.call)));
181
- const handlerIndex = stateMachineWorkflows[templateIndex].handlers.findIndex((handler) => !this.has('tools', handler.call));
182
- const wrongToolName = stateMachineWorkflows[templateIndex].handlers[handlerIndex].call;
174
+ const templateIndex = stateMachineWorkflows.findIndex((wf) => wf.transitions &&
175
+ wf.transitions.find((t) => t.call?.find((call) => !this.has('tools', call.tool))));
176
+ const transitionIndex = stateMachineWorkflows[templateIndex].transitions.findIndex((t) => t.call?.find((call) => !this.has('tools', call.tool)));
177
+ const wrongToolName = stateMachineWorkflows[templateIndex].transitions[transitionIndex].call?.find((call) => !this.has('tools', call.tool));
183
178
  return {
184
- message: `state machine template handler references non-existent tool "${wrongToolName}".`,
179
+ message: `state machine template transition references non-existent tool "${wrongToolName}".`,
185
180
  path: [
186
181
  'workflowTemplates',
187
182
  templateIndex,
188
- 'handlers',
189
- handlerIndex,
183
+ 'transitions',
184
+ transitionIndex,
190
185
  'call',
191
186
  ],
192
187
  };
@@ -196,8 +191,8 @@ let ConfigurationService = ConfigurationService_1 = class ConfigurationService {
196
191
  try {
197
192
  this.mainSchemaGenerator
198
193
  .getSchema()
199
- .and(this.createProjectEntrypointValidation())
200
- .and(this.createProjectWorkspaceValidation())
194
+ .and(this.createPipelineEntrypointValidation())
195
+ .and(this.createPipelineWorkspaceValidation())
201
196
  .and(this.createWorkflowToolCallValidation())
202
197
  .and(this.createWorkflowTemplateToolCallValidation())
203
198
  .parse(source.config);
@@ -222,8 +217,7 @@ exports.ConfigurationService = ConfigurationService;
222
217
  exports.ConfigurationService = ConfigurationService = ConfigurationService_1 = __decorate([
223
218
  (0, common_1.Injectable)(),
224
219
  __metadata("design:paramtypes", [config_1.ConfigService,
225
- adapter_registry_service_1.AdapterRegistry,
226
- tool_registry_1.ToolRegistry,
220
+ service_registry_service_1.ServiceRegistry,
227
221
  config_provider_registry_1.ConfigProviderRegistry,
228
222
  dynamic_schema_generator_service_1.DynamicSchemaGeneratorService])
229
223
  ], ConfigurationService);