@loopstack/core 0.23.0 → 0.24.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.
- package/dist/documents/error-document.d.ts +10 -0
- package/dist/documents/error-document.d.ts.map +1 -0
- package/dist/documents/error-document.js +39 -0
- package/dist/documents/error-document.js.map +1 -0
- package/dist/documents/error-document.yaml +5 -0
- package/dist/documents/index.d.ts +7 -0
- package/dist/documents/index.d.ts.map +1 -0
- package/dist/documents/index.js +23 -0
- package/dist/documents/index.js.map +1 -0
- package/dist/documents/link-document.d.ts +16 -0
- package/dist/documents/link-document.d.ts.map +1 -0
- package/dist/documents/link-document.js +45 -0
- package/dist/documents/link-document.js.map +1 -0
- package/dist/documents/link-document.yaml +3 -0
- package/dist/documents/markdown-document.d.ts +10 -0
- package/dist/documents/markdown-document.d.ts.map +1 -0
- package/dist/documents/markdown-document.js +39 -0
- package/dist/documents/markdown-document.js.map +1 -0
- package/dist/documents/markdown-document.yaml +3 -0
- package/dist/documents/message-document.d.ts +11 -0
- package/dist/documents/message-document.d.ts.map +1 -0
- package/dist/documents/message-document.js +40 -0
- package/dist/documents/message-document.js.map +1 -0
- package/dist/documents/message-document.yaml +5 -0
- package/dist/documents/plain-document.d.ts +10 -0
- package/dist/documents/plain-document.d.ts.map +1 -0
- package/dist/documents/plain-document.js +39 -0
- package/dist/documents/plain-document.js.map +1 -0
- package/dist/documents/plain-document.yaml +3 -0
- package/dist/documents/secret-request-document.d.ts +13 -0
- package/dist/documents/secret-request-document.d.ts.map +1 -0
- package/dist/documents/secret-request-document.js +40 -0
- package/dist/documents/secret-request-document.js.map +1 -0
- package/dist/documents/secret-request-document.yaml +23 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/loop-core.module.d.ts.map +1 -1
- package/dist/loop-core.module.js +33 -2
- package/dist/loop-core.module.js.map +1 -1
- package/dist/persistence/persistence.module.d.ts.map +1 -1
- package/dist/persistence/persistence.module.js +3 -0
- package/dist/persistence/persistence.module.js.map +1 -1
- package/dist/persistence/services/document.service.d.ts.map +1 -1
- package/dist/persistence/services/document.service.js +2 -1
- package/dist/persistence/services/document.service.js.map +1 -1
- package/dist/persistence/services/event-subscriber.service.d.ts +1 -1
- package/dist/persistence/services/event-subscriber.service.d.ts.map +1 -1
- package/dist/persistence/services/event-subscriber.service.js +2 -1
- package/dist/persistence/services/event-subscriber.service.js.map +1 -1
- package/dist/persistence/services/index.d.ts +1 -0
- package/dist/persistence/services/index.d.ts.map +1 -1
- package/dist/persistence/services/index.js +1 -0
- package/dist/persistence/services/index.js.map +1 -1
- package/dist/persistence/services/secret.service.d.ts +20 -0
- package/dist/persistence/services/secret.service.d.ts.map +1 -0
- package/dist/persistence/services/secret.service.js +76 -0
- package/dist/persistence/services/secret.service.js.map +1 -0
- package/dist/scheduler/services/event-processor.service.d.ts.map +1 -1
- package/dist/scheduler/services/event-processor.service.js +4 -1
- package/dist/scheduler/services/event-processor.service.js.map +1 -1
- package/dist/scheduler/services/task-processor/run-pipeline-task-processor.service.d.ts.map +1 -1
- package/dist/scheduler/services/task-processor/run-pipeline-task-processor.service.js +6 -1
- package/dist/scheduler/services/task-processor/run-pipeline-task-processor.service.js.map +1 -1
- package/dist/tools/create-document.tool.d.ts +73 -0
- package/dist/tools/create-document.tool.d.ts.map +1 -0
- package/dist/tools/create-document.tool.js +151 -0
- package/dist/tools/create-document.tool.js.map +1 -0
- package/dist/tools/get-secret-keys.tool.d.ts +6 -0
- package/dist/tools/get-secret-keys.tool.d.ts.map +1 -0
- package/dist/tools/get-secret-keys.tool.js +40 -0
- package/dist/tools/get-secret-keys.tool.js.map +1 -0
- package/dist/tools/index.d.ts +6 -1
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +6 -1
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/request-secrets-task.tool.d.ts +19 -0
- package/dist/tools/request-secrets-task.tool.d.ts.map +1 -0
- package/dist/tools/request-secrets-task.tool.js +110 -0
- package/dist/tools/request-secrets-task.tool.js.map +1 -0
- package/dist/tools/request-secrets.tool.d.ts +14 -0
- package/dist/tools/request-secrets.tool.d.ts.map +1 -0
- package/dist/tools/request-secrets.tool.js +45 -0
- package/dist/tools/request-secrets.tool.js.map +1 -0
- package/dist/tools/secrets-request.workflow.d.ts +19 -0
- package/dist/tools/secrets-request.workflow.d.ts.map +1 -0
- package/dist/tools/secrets-request.workflow.js +70 -0
- package/dist/tools/secrets-request.workflow.js.map +1 -0
- package/dist/tools/secrets-request.workflow.yaml +22 -0
- package/dist/tools/{execute-workflow-async.tool.d.ts → task.tool.d.ts} +9 -11
- package/dist/tools/task.tool.d.ts.map +1 -0
- package/dist/tools/{execute-workflow-async.tool.js → task.tool.js} +42 -37
- package/dist/tools/task.tool.js.map +1 -0
- package/dist/workflow-processor/index.d.ts +1 -0
- package/dist/workflow-processor/index.d.ts.map +1 -1
- package/dist/workflow-processor/index.js +1 -0
- package/dist/workflow-processor/index.js.map +1 -1
- package/dist/workflow-processor/services/create-pipeline.service.d.ts +4 -3
- package/dist/workflow-processor/services/create-pipeline.service.d.ts.map +1 -1
- package/dist/workflow-processor/services/create-pipeline.service.js +24 -11
- package/dist/workflow-processor/services/create-pipeline.service.js.map +1 -1
- package/dist/workflow-processor/services/root-processor.service.d.ts +2 -0
- package/dist/workflow-processor/services/root-processor.service.d.ts.map +1 -1
- package/dist/workflow-processor/services/root-processor.service.js +25 -6
- package/dist/workflow-processor/services/root-processor.service.js.map +1 -1
- package/dist/workflow-processor/services/state-machine-processor.service.d.ts.map +1 -1
- package/dist/workflow-processor/services/state-machine-processor.service.js +4 -2
- package/dist/workflow-processor/services/state-machine-processor.service.js.map +1 -1
- package/dist/workflow-processor/services/state-machine-tool-call-processor.service.d.ts +9 -5
- package/dist/workflow-processor/services/state-machine-tool-call-processor.service.d.ts.map +1 -1
- package/dist/workflow-processor/services/state-machine-tool-call-processor.service.js +91 -42
- package/dist/workflow-processor/services/state-machine-tool-call-processor.service.js.map +1 -1
- package/dist/workflow-processor/services/workflow-state.service.d.ts.map +1 -1
- package/dist/workflow-processor/services/workflow-state.service.js +1 -0
- package/dist/workflow-processor/services/workflow-state.service.js.map +1 -1
- package/dist/workflow-processor/utils/index.d.ts +4 -0
- package/dist/workflow-processor/utils/index.d.ts.map +1 -0
- package/dist/workflow-processor/utils/index.js +20 -0
- package/dist/workflow-processor/utils/index.js.map +1 -0
- package/dist/workflow-processor/workflow-processor.module.d.ts.map +1 -1
- package/dist/workflow-processor/workflow-processor.module.js +1 -0
- package/dist/workflow-processor/workflow-processor.module.js.map +1 -1
- package/package.json +2 -2
- package/dist/tools/execute-workflow-async.tool.d.ts.map +0 -1
- package/dist/tools/execute-workflow-async.tool.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document.service.js","sourceRoot":"","sources":["../../../src/persistence/services/document.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA4C;AAC5C,6CAAmD;AACnD,qCAAqC;AACrC,8CAA0G;AAGnG,IAAM,eAAe,GAArB,MAAM,eAAe;IAGhB;IAFV,YAEU,kBAA8C;QAA9C,uBAAkB,GAAlB,kBAAkB,CAA4B;IACrD,CAAC;IAEJ,MAAM,CAAC,OAAmB,EAAE,QAAmC,EAAE,IAA6B;QAC5F,MAAM,UAAU,GAAG,QAAQ,CAAC,UAAW,CAAC;QACxC,IAAI,CAAC,UAAU,CAAC,EAAE,EAAE,CAAC;YACnB,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;QAChE,CAAC;QAED,OAAO,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC;YACpC,GAAG,IAAI;YACP,UAAU,EAAE,UAAU,CAAC,EAAE;YACzB,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"document.service.js","sourceRoot":"","sources":["../../../src/persistence/services/document.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA4C;AAC5C,6CAAmD;AACnD,qCAAqC;AACrC,8CAA0G;AAGnG,IAAM,eAAe,GAArB,MAAM,eAAe;IAGhB;IAFV,YAEU,kBAA8C;QAA9C,uBAAkB,GAAlB,kBAAkB,CAA4B;IACrD,CAAC;IAEJ,MAAM,CAAC,OAAmB,EAAE,QAAmC,EAAE,IAA6B;QAC5F,MAAM,UAAU,GAAG,QAAQ,CAAC,UAAW,CAAC;QACxC,IAAI,CAAC,UAAU,CAAC,EAAE,EAAE,CAAC;YACnB,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;QAChE,CAAC;QAED,OAAO,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC;YACpC,GAAG,IAAI;YACP,UAAU,EAAE,UAAU,CAAC,EAAE;YACzB,KAAK,EAAE,CAAC;YACR,aAAa,EAAE,OAAO,CAAC,KAAK;YAC5B,KAAK,EAAE,UAAU,CAAC,EAAE;YACpB,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,QAAQ,EAAE,EAAE,EAAE,EAAE,OAAO,CAAC,UAAU,EAAoB;YACtD,UAAU,EAAE,OAAO,CAAC,UAAU;YAC9B,WAAW,EAAE,OAAO,CAAC,WAAW;YAChC,UAAU,EAAE,OAAO,CAAC,UAAU;YAC9B,SAAS,EAAE,OAAO,CAAC,MAAM;SAC1B,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AA1BY,0CAAe;0BAAf,eAAe;IAD3B,IAAA,mBAAU,GAAE;IAGR,WAAA,IAAA,0BAAgB,EAAC,uBAAc,CAAC,CAAA;qCACL,oBAAU;GAH7B,eAAe,CA0B3B"}
|
|
@@ -15,7 +15,7 @@ export declare class EventSubscriberService {
|
|
|
15
15
|
private entityRepository;
|
|
16
16
|
private readonly logger;
|
|
17
17
|
constructor(entityRepository: Repository<EventSubscriberEntity>);
|
|
18
|
-
registerSubscriber(subscriberPipelineId: string | undefined, subscriberWorkflowId: string, subscriberTransition: string, eventCorrelationId: string, eventName: string, userId: string, workspaceId?: string): Promise<EventSubscriberEntity>;
|
|
18
|
+
registerSubscriber(subscriberPipelineId: string | undefined, subscriberWorkflowId: string, subscriberTransition: string, eventCorrelationId: string, eventName: string, userId: string, workspaceId?: string, metadata?: Record<string, unknown>): Promise<EventSubscriberEntity>;
|
|
19
19
|
findSubscribers(eventCorrelationId: string, eventName: string, workspaceId: string): Promise<EventSubscriberEntity[]>;
|
|
20
20
|
removeSubscribersByPipelineId(pipelineId: string): Promise<void>;
|
|
21
21
|
removeSubscriber(id: string): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-subscriber.service.d.ts","sourceRoot":"","sources":["../../../src/persistence/services/event-subscriber.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,MAAM,WAAW,oBAAoB;IACnC,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE;QACJ,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;QAC/B,MAAM,EAAE,aAAa,CAAC;QACtB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;KACxC,CAAC;CACH;AAED,qBACa,sBAAsB;IAK/B,OAAO,CAAC,gBAAgB;IAJ1B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA2C;gBAIxD,gBAAgB,EAAE,UAAU,CAAC,qBAAqB,CAAC;IAGvD,kBAAkB,CACtB,oBAAoB,EAAE,MAAM,GAAG,SAAS,EACxC,oBAAoB,EAAE,MAAM,EAC5B,oBAAoB,EAAE,MAAM,EAC5B,kBAAkB,EAAE,MAAM,EAC1B,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,WAAW,CAAC,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"event-subscriber.service.d.ts","sourceRoot":"","sources":["../../../src/persistence/services/event-subscriber.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,MAAM,WAAW,oBAAoB;IACnC,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE;QACJ,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;QAC/B,MAAM,EAAE,aAAa,CAAC;QACtB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;KACxC,CAAC;CACH;AAED,qBACa,sBAAsB;IAK/B,OAAO,CAAC,gBAAgB;IAJ1B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA2C;gBAIxD,gBAAgB,EAAE,UAAU,CAAC,qBAAqB,CAAC;IAGvD,kBAAkB,CACtB,oBAAoB,EAAE,MAAM,GAAG,SAAS,EACxC,oBAAoB,EAAE,MAAM,EAC5B,oBAAoB,EAAE,MAAM,EAC5B,kBAAkB,EAAE,MAAM,EAC1B,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,WAAW,CAAC,EAAE,MAAM,EACpB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACjC,OAAO,CAAC,qBAAqB,CAAC;IA4B3B,eAAe,CACnB,kBAAkB,EAAE,MAAM,EAC1B,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,qBAAqB,EAAE,CAAC;IAU7B,6BAA6B,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAMhE,gBAAgB,CAAC,EAAE,EAAE,MAAM;CAGlC"}
|
|
@@ -24,7 +24,7 @@ let EventSubscriberService = EventSubscriberService_1 = class EventSubscriberSer
|
|
|
24
24
|
constructor(entityRepository) {
|
|
25
25
|
this.entityRepository = entityRepository;
|
|
26
26
|
}
|
|
27
|
-
async registerSubscriber(subscriberPipelineId, subscriberWorkflowId, subscriberTransition, eventCorrelationId, eventName, userId, workspaceId) {
|
|
27
|
+
async registerSubscriber(subscriberPipelineId, subscriberWorkflowId, subscriberTransition, eventCorrelationId, eventName, userId, workspaceId, metadata) {
|
|
28
28
|
const existing = await this.entityRepository.findOne({
|
|
29
29
|
where: {
|
|
30
30
|
subscriberWorkflowId,
|
|
@@ -44,6 +44,7 @@ let EventSubscriberService = EventSubscriberService_1 = class EventSubscriberSer
|
|
|
44
44
|
eventName,
|
|
45
45
|
userId,
|
|
46
46
|
workspaceId,
|
|
47
|
+
metadata: metadata ?? null,
|
|
47
48
|
});
|
|
48
49
|
return await this.entityRepository.save(subscriber);
|
|
49
50
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-subscriber.service.js","sourceRoot":"","sources":["../../../src/persistence/services/event-subscriber.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAoD;AACpD,6CAAmD;AACnD,qCAAqC;AACrC,8CAA0D;AAenD,IAAM,sBAAsB,8BAA5B,MAAM,sBAAsB;IAKvB;IAJO,MAAM,GAAG,IAAI,eAAM,CAAC,wBAAsB,CAAC,IAAI,CAAC,CAAC;IAElE,YAEU,gBAAmD;QAAnD,qBAAgB,GAAhB,gBAAgB,CAAmC;IAC1D,CAAC;IAEJ,KAAK,CAAC,kBAAkB,CACtB,oBAAwC,EACxC,oBAA4B,EAC5B,oBAA4B,EAC5B,kBAA0B,EAC1B,SAAiB,EACjB,MAAc,EACd,WAAoB;
|
|
1
|
+
{"version":3,"file":"event-subscriber.service.js","sourceRoot":"","sources":["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D,MAAM,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC;YACjC,oBAAoB,EAAE,UAAU;SACjC,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,gBAAgB,CAAC,EAAU;QAC/B,MAAM,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;IAC7C,CAAC;CACF,CAAA;AApEY,wDAAsB;iCAAtB,sBAAsB;IADlC,IAAA,mBAAU,GAAE;IAKR,WAAA,IAAA,0BAAgB,EAAC,8BAAqB,CAAC,CAAA;qCACd,oBAAU;GAL3B,sBAAsB,CAoElC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/persistence/services/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/persistence/services/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kBAAkB,CAAC"}
|
|
@@ -21,4 +21,5 @@ __exportStar(require("./pipeline.service"), exports);
|
|
|
21
21
|
__exportStar(require("./document.service"), exports);
|
|
22
22
|
__exportStar(require("./migrations.service"), exports);
|
|
23
23
|
__exportStar(require("./event-subscriber.service"), exports);
|
|
24
|
+
__exportStar(require("./secret.service"), exports);
|
|
24
25
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/persistence/services/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAmC;AACnC,sDAAoC;AACpC,sDAAoC;AACpC,qDAAmC;AACnC,qDAAmC;AACnC,uDAAqC;AACrC,6DAA2C"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/persistence/services/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAmC;AACnC,sDAAoC;AACpC,sDAAoC;AACpC,qDAAmC;AACnC,qDAAmC;AACnC,uDAAqC;AACrC,6DAA2C;AAC3C,mDAAiC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Repository } from 'typeorm';
|
|
2
|
+
import { SecretEntity } from '@loopstack/common';
|
|
3
|
+
export declare class SecretService {
|
|
4
|
+
private secretRepository;
|
|
5
|
+
constructor(secretRepository: Repository<SecretEntity>);
|
|
6
|
+
findAllByWorkspace(workspaceId: string): Promise<SecretEntity[]>;
|
|
7
|
+
create(workspaceId: string, data: {
|
|
8
|
+
key: string;
|
|
9
|
+
value: string;
|
|
10
|
+
}): Promise<SecretEntity>;
|
|
11
|
+
update(id: string, workspaceId: string, data: {
|
|
12
|
+
value?: string;
|
|
13
|
+
}): Promise<SecretEntity>;
|
|
14
|
+
upsert(workspaceId: string, data: {
|
|
15
|
+
key: string;
|
|
16
|
+
value: string;
|
|
17
|
+
}): Promise<SecretEntity>;
|
|
18
|
+
delete(id: string, workspaceId: string): Promise<void>;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=secret.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"secret.service.d.ts","sourceRoot":"","sources":["../../../src/persistence/services/secret.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,qBACa,aAAa;IAGtB,OAAO,CAAC,gBAAgB;gBAAhB,gBAAgB,EAAE,UAAU,CAAC,YAAY,CAAC;IAG9C,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;IAOhE,MAAM,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,YAAY,CAAC;IASxF,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,YAAY,CAAC;IAcxF,MAAM,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,YAAY,CAAC;IAaxF,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAW7D"}
|
|
@@ -0,0 +1,76 @@
|
|
|
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
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.SecretService = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const typeorm_1 = require("@nestjs/typeorm");
|
|
18
|
+
const typeorm_2 = require("typeorm");
|
|
19
|
+
const common_2 = require("@loopstack/common");
|
|
20
|
+
let SecretService = class SecretService {
|
|
21
|
+
secretRepository;
|
|
22
|
+
constructor(secretRepository) {
|
|
23
|
+
this.secretRepository = secretRepository;
|
|
24
|
+
}
|
|
25
|
+
async findAllByWorkspace(workspaceId) {
|
|
26
|
+
return this.secretRepository.find({
|
|
27
|
+
where: { workspaceId },
|
|
28
|
+
order: { key: 'ASC' },
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
async create(workspaceId, data) {
|
|
32
|
+
const secret = this.secretRepository.create({
|
|
33
|
+
workspaceId,
|
|
34
|
+
key: data.key,
|
|
35
|
+
value: data.value,
|
|
36
|
+
});
|
|
37
|
+
return this.secretRepository.save(secret);
|
|
38
|
+
}
|
|
39
|
+
async update(id, workspaceId, data) {
|
|
40
|
+
const secret = await this.secretRepository.findOne({
|
|
41
|
+
where: { id, workspaceId },
|
|
42
|
+
});
|
|
43
|
+
if (!secret) {
|
|
44
|
+
throw new common_1.NotFoundException(`Secret with ID ${id} not found`);
|
|
45
|
+
}
|
|
46
|
+
if (data.value !== undefined)
|
|
47
|
+
secret.value = data.value;
|
|
48
|
+
return this.secretRepository.save(secret);
|
|
49
|
+
}
|
|
50
|
+
async upsert(workspaceId, data) {
|
|
51
|
+
const existing = await this.secretRepository.findOne({
|
|
52
|
+
where: { workspaceId, key: data.key },
|
|
53
|
+
});
|
|
54
|
+
if (existing) {
|
|
55
|
+
existing.value = data.value;
|
|
56
|
+
return this.secretRepository.save(existing);
|
|
57
|
+
}
|
|
58
|
+
return this.create(workspaceId, data);
|
|
59
|
+
}
|
|
60
|
+
async delete(id, workspaceId) {
|
|
61
|
+
const secret = await this.secretRepository.findOne({
|
|
62
|
+
where: { id, workspaceId },
|
|
63
|
+
});
|
|
64
|
+
if (!secret) {
|
|
65
|
+
throw new common_1.NotFoundException(`Secret with ID ${id} not found`);
|
|
66
|
+
}
|
|
67
|
+
await this.secretRepository.remove(secret);
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
exports.SecretService = SecretService;
|
|
71
|
+
exports.SecretService = SecretService = __decorate([
|
|
72
|
+
(0, common_1.Injectable)(),
|
|
73
|
+
__param(0, (0, typeorm_1.InjectRepository)(common_2.SecretEntity)),
|
|
74
|
+
__metadata("design:paramtypes", [typeorm_2.Repository])
|
|
75
|
+
], SecretService);
|
|
76
|
+
//# sourceMappingURL=secret.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"secret.service.js","sourceRoot":"","sources":["../../../src/persistence/services/secret.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA+D;AAC/D,6CAAmD;AACnD,qCAAqC;AACrC,8CAAiD;AAG1C,IAAM,aAAa,GAAnB,MAAM,aAAa;IAGd;IAFV,YAEU,gBAA0C;QAA1C,qBAAgB,GAAhB,gBAAgB,CAA0B;IACjD,CAAC;IAEJ,KAAK,CAAC,kBAAkB,CAAC,WAAmB;QAC1C,OAAO,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC;YAChC,KAAK,EAAE,EAAE,WAAW,EAAE;YACtB,KAAK,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE;SACtB,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,WAAmB,EAAE,IAAoC;QACpE,MAAM,MAAM,GAAG,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC;YAC1C,WAAW;YACX,GAAG,EAAE,IAAI,CAAC,GAAG;YACb,KA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AE;SAC3B,CAAC,CAAC;QAEH,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,MAAM,IAAI,0BAAiB,CAAC,kBAAkB,EAAE,YAAY,CAAC,CAAC;QAChE,CAAC;QAED,MAAM,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC7C,CAAC;CACF,CAAA;AA5DY,sCAAa;wBAAb,aAAa;IADzB,IAAA,mBAAU,GAAE;IAGR,WAAA,IAAA,0BAAgB,EAAC,qBAAY,CAAC,CAAA;qCACL,oBAAU;GAH3B,aAAa,CA4DzB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-processor.service.d.ts","sourceRoot":"","sources":["../../../src/scheduler/services/event-processor.service.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACjF,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEhE,qBACa,qBAAqB;IAI9B,OAAO,CAAC,QAAQ,CAAC,sBAAsB;IACvC,OAAO,CAAC,QAAQ,CAAC,oBAAoB;IAJvC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA2C;gBAG/C,sBAAsB,EAAE,sBAAsB,EAC9C,oBAAoB,EAAE,oBAAoB;IAIvD,mBAAmB,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"event-processor.service.d.ts","sourceRoot":"","sources":["../../../src/scheduler/services/event-processor.service.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACjF,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEhE,qBACa,qBAAqB;IAI9B,OAAO,CAAC,QAAQ,CAAC,sBAAsB;IACvC,OAAO,CAAC,QAAQ,CAAC,oBAAoB;IAJvC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA2C;gBAG/C,sBAAsB,EAAE,sBAAsB,EAC9C,oBAAoB,EAAE,oBAAoB;IAIvD,mBAAmB,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC;CAyCxE"}
|
|
@@ -41,7 +41,10 @@ let EventProcessorService = class EventProcessorService {
|
|
|
41
41
|
transition: {
|
|
42
42
|
id: subscriber.subscriberTransition,
|
|
43
43
|
workflowId: subscriber.subscriberWorkflowId,
|
|
44
|
-
payload:
|
|
44
|
+
payload: {
|
|
45
|
+
...data,
|
|
46
|
+
...(subscriber.metadata ? { _subscriberMetadata: subscriber.metadata } : {}),
|
|
47
|
+
},
|
|
45
48
|
},
|
|
46
49
|
},
|
|
47
50
|
user: subscriber.userId,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-processor.service.js","sourceRoot":"","sources":["../../../src/scheduler/services/event-processor.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAoD;AACpD,yDAAgD;AAChD,6CAAyC;AAEzC,mDAAiF;AACjF,qEAAgE;AAGzD,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IAIb;IACA;IAJF,MAAM,GAAG,IAAI,eAAM,CAAC,oCAAsB,CAAC,IAAI,CAAC,CAAC;IAElE,YACmB,sBAA8C,EAC9C,oBAA0C;QAD1C,2BAAsB,GAAtB,sBAAsB,CAAwB;QAC9C,yBAAoB,GAApB,oBAAoB,CAAsB;IAC1D,CAAC;IAGE,AAAN,KAAK,CAAC,mBAAmB,CAAC,OAA6B;QACrD,MAAM,EAAE,aAAa,EAAE,SAAS,EAAE,WAAW,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;QAEhE,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,sBAAsB,CAAC,eAAe,CAAC,aAAa,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC;QAE7G,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE,CAAC;YACrC,IAAI,CAAC,MAAM,CAAC,GAAG,CACb,uCAAuC,UAAU,CAAC,oBAAoB,IAAI;gBACxE,YAAY,UAAU,CAAC,oBAAoB,gBAAgB,UAAU,CAAC,oBAAoB,EAAE,CAC/F,CAAC;YAEF,IAAI,CAAC;gBACH,MAAM,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC;oBACtC,EAAE,EAAE,6BAA6B,GAAG,IAAA,wBAAU,GAAE;oBAChD,WAAW;oBACX,IAAI,EAAE;wBACJ,IAAI,EAAE,4BAA4B;wBAClC,IAAI,EAAE,cAAc;wBACpB,UAAU,EAAE,UAAU,CAAC,oBAAoB;wBAC3C,OAAO,EAAE;4BACP,UAAU,EAAE;gCACV,EAAE,EAAE,UAAU,CAAC,oBAAoB;gCACnC,UAAU,EAAE,UAAU,CAAC,oBAAoB;gCAC3C,OAAO,EAAE,IAAI;
|
|
1
|
+
{"version":3,"file":"event-processor.service.js","sourceRoot":"","sources":["../../../src/scheduler/services/event-processor.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAoD;AACpD,yDAAgD;AAChD,6CAAyC;AAEzC,mDAAiF;AACjF,qEAAgE;AAGzD,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IAIb;IACA;IAJF,MAAM,GAAG,IAAI,eAAM,CAAC,oCAAsB,CAAC,IAAI,CAAC,CAAC;IAElE,YACmB,sBAA8C,EAC9C,oBAA0C;QAD1C,2BAAsB,GAAtB,sBAAsB,CAAwB;QAC9C,yBAAoB,GAApB,oBAAoB,CAAsB;IAC1D,CAAC;IAGE,AAAN,KAAK,CAAC,mBAAmB,CAAC,OAA6B;QACrD,MAAM,EAAE,aAAa,EAAE,SAAS,EAAE,WAAW,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;QAEhE,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,sBAAsB,CAAC,eAAe,CAAC,aAAa,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC;QAE7G,KAAK,MAAM,UAAU,IAAI,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;qCAKgC,oCAAsB;QACxB,6CAAoB;GALlD,qBAAqB,CAkDjC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-pipeline-task-processor.service.d.ts","sourceRoot":"","sources":["../../../../src/scheduler/services/task-processor/run-pipeline-task-processor.service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAEnE,qBACa,+BAA+B;IAIxC,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IACjC,OAAO,CAAC,QAAQ,CAAC,eAAe;IAChC,OAAO,CAAC,QAAQ,CAAC,oBAAoB;IALvC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAoD;gBAGxD,gBAAgB,EAAE,gBAAgB,EAClC,eAAe,EAAE,eAAe,EAChC,oBAAoB,EAAE,oBAAoB;IAGhD,OAAO,CAAC,IAAI,EAAE,eAAe;
|
|
1
|
+
{"version":3,"file":"run-pipeline-task-processor.service.d.ts","sourceRoot":"","sources":["../../../../src/scheduler/services/task-processor/run-pipeline-task-processor.service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAEnE,qBACa,+BAA+B;IAIxC,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IACjC,OAAO,CAAC,QAAQ,CAAC,eAAe;IAChC,OAAO,CAAC,QAAQ,CAAC,oBAAoB;IALvC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAoD;gBAGxD,gBAAgB,EAAE,gBAAgB,EAClC,eAAe,EAAE,eAAe,EAChC,oBAAoB,EAAE,oBAAoB;IAGhD,OAAO,CAAC,IAAI,EAAE,eAAe;CA+C3C"}
|
|
@@ -26,7 +26,12 @@ let RunPipelineTaskProcessorService = RunPipelineTaskProcessorService_1 = class
|
|
|
26
26
|
}
|
|
27
27
|
async process(task) {
|
|
28
28
|
if (task.pipelineId) {
|
|
29
|
-
const pipeline = await this.pipelineService.getPipeline(task.pipelineId, task.user, [
|
|
29
|
+
const pipeline = await this.pipelineService.getPipeline(task.pipelineId, task.user, [
|
|
30
|
+
'workspace',
|
|
31
|
+
'workspace.environments',
|
|
32
|
+
'parent',
|
|
33
|
+
'parent.workspace',
|
|
34
|
+
]);
|
|
30
35
|
if (!pipeline) {
|
|
31
36
|
throw new Error(`Pipeline with id ${task.pipelineId} not found.`);
|
|
32
37
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-pipeline-task-processor.service.js","sourceRoot":"","sources":["../../../../src/scheduler/services/task-processor/run-pipeline-task-processor.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAoD;AAEpD,sDAAyE;AACzE,oEAAmE;AAG5D,IAAM,+BAA+B,uCAArC,MAAM,+BAA+B;IAIvB;IACA;IACA;IALF,MAAM,GAAG,IAAI,eAAM,CAAC,iCAA+B,CAAC,IAAI,CAAC,CAAC;IAE3E,YACmB,gBAAkC,EAClC,eAAgC,EAChC,oBAA0C;QAF1C,qBAAgB,GAAhB,gBAAgB,CAAkB;QAClC,oBAAe,GAAf,eAAe,CAAiB;QAChC,yBAAoB,GAApB,oBAAoB,CAAsB;IAC1D,CAAC;IAEG,KAAK,CAAC,OAAO,CAAC,IAAqB;QACxC,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YACpB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"run-pipeline-task-processor.service.js","sourceRoot":"","sources":["../../../../src/scheduler/services/task-processor/run-pipeline-task-processor.service.ts"],"names":[],"mappings":";;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CAAC;YAEF,IAAI,CAAC,SAAS,EAAE,CAAC;gBACf,MAAM,IAAI,KAAK,CAAC,qBAAqB,IAAI,CAAC,WAAW,aAAa,CAAC,CAAC;YACtE,CAAC;YAED,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,wCAAwC,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;YAE5E,MAAM,IAAI,CAAC,oBAAoB,CAAC,YAAY,CAC1C;gBACE,WAAW,EAAE,IAAI,CAAC,WAAW;gBAC7B,aAAa,EAAE,SAAS,CAAC,SAAS;gBAClC,aAAa,EAAE,IAAI,CAAC,aAAa;gBACjC,SAAS,EAAE,IAAI,CAAC,SAAS;gBACzB,MAAM,EAAE,IAAI,CAAC,IAAI;gBACjB,IAAI,EAAE,IAAI,CAAC,IAAI;aAChB,EACD,IAAI,CAAC,OAAO,CACb,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAA;AAxDY,0EAA+B;0CAA/B,+BAA+B;IAD3C,IAAA,mBAAU,GAAE;qCAK0B,8BAAgB;QACjB,6BAAe;QACV,yCAAoB;GANlD,+BAA+B,CAwD3C"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { Logger } from '@nestjs/common';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { RunContext, ToolInterface, ToolResult, WorkflowInterface, WorkflowMetadataInterface } from '@loopstack/common';
|
|
4
|
+
export declare const CreateDocumentInputSchema: z.ZodObject<{
|
|
5
|
+
id: z.ZodOptional<z.ZodString>;
|
|
6
|
+
document: z.ZodString;
|
|
7
|
+
validate: z.ZodDefault<z.ZodUnion<readonly [z.ZodLiteral<"strict">, z.ZodLiteral<"safe">, z.ZodLiteral<"skip">]>>;
|
|
8
|
+
update: z.ZodOptional<z.ZodObject<{
|
|
9
|
+
type: z.ZodOptional<z.ZodDefault<z.ZodLiteral<"document">>>;
|
|
10
|
+
description: z.ZodOptional<z.ZodString>;
|
|
11
|
+
content: z.ZodOptional<z.ZodAny>;
|
|
12
|
+
ui: z.ZodOptional<z.ZodObject<{
|
|
13
|
+
actions: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
14
|
+
widget: z.ZodOptional<z.ZodString>;
|
|
15
|
+
enabledWhen: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
16
|
+
type: z.ZodLiteral<"button">;
|
|
17
|
+
options: z.ZodOptional<z.ZodObject<{
|
|
18
|
+
transition: z.ZodOptional<z.ZodString>;
|
|
19
|
+
position: z.ZodOptional<z.ZodNumber>;
|
|
20
|
+
label: z.ZodOptional<z.ZodString>;
|
|
21
|
+
props: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
22
|
+
}, z.core.$strip>>;
|
|
23
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
24
|
+
widget: z.ZodOptional<z.ZodString>;
|
|
25
|
+
enabledWhen: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
26
|
+
type: z.ZodLiteral<"custom">;
|
|
27
|
+
options: z.ZodOptional<z.ZodObject<{
|
|
28
|
+
transition: z.ZodOptional<z.ZodString>;
|
|
29
|
+
label: z.ZodOptional<z.ZodString>;
|
|
30
|
+
props: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
31
|
+
}, z.core.$strip>>;
|
|
32
|
+
}, z.core.$strip>], "type">>>;
|
|
33
|
+
form: z.ZodOptional<z.ZodType<any, unknown, z.core.$ZodTypeInternals<any, unknown>>>;
|
|
34
|
+
}, z.core.$strip>>;
|
|
35
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
36
|
+
meta: z.ZodOptional<z.ZodObject<{
|
|
37
|
+
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
38
|
+
mimeType: z.ZodOptional<z.ZodEnum<{
|
|
39
|
+
"text/plain": "text/plain";
|
|
40
|
+
"text/html": "text/html";
|
|
41
|
+
"text/css": "text/css";
|
|
42
|
+
"text/xml": "text/xml";
|
|
43
|
+
"text/markdown": "text/markdown";
|
|
44
|
+
"application/javascript": "application/javascript";
|
|
45
|
+
"application/typescript": "application/typescript";
|
|
46
|
+
"application/json": "application/json";
|
|
47
|
+
"application/xml": "application/xml";
|
|
48
|
+
"application/yaml": "application/yaml";
|
|
49
|
+
}>>;
|
|
50
|
+
invalidate: z.ZodOptional<z.ZodBoolean>;
|
|
51
|
+
level: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"debug">, z.ZodLiteral<"info">, z.ZodLiteral<"warning">, z.ZodLiteral<"error">]>>;
|
|
52
|
+
enableAtPlaces: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
53
|
+
hideAtPlaces: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
54
|
+
data: z.ZodOptional<z.ZodAny>;
|
|
55
|
+
}, z.core.$strip>>;
|
|
56
|
+
}, z.core.$strip>>;
|
|
57
|
+
}, z.core.$strict>;
|
|
58
|
+
export type CreateDocumentInput = z.infer<typeof CreateDocumentInputSchema>;
|
|
59
|
+
export declare class CreateDocument implements ToolInterface {
|
|
60
|
+
protected readonly logger: Logger;
|
|
61
|
+
private readonly args;
|
|
62
|
+
private readonly documentService;
|
|
63
|
+
private readonly templateExpressionEvaluatorService;
|
|
64
|
+
execute(args: CreateDocumentInput, context: RunContext, parent: WorkflowInterface | ToolInterface, metadata: WorkflowMetadataInterface): Promise<ToolResult>;
|
|
65
|
+
private mergeTemplateData;
|
|
66
|
+
private createDocumentSkeleton;
|
|
67
|
+
private validateContent;
|
|
68
|
+
private resolveMessageId;
|
|
69
|
+
private createJsonSchema;
|
|
70
|
+
private createDocumentEntity;
|
|
71
|
+
private buildResult;
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=create-document.tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-document.tool.d.ts","sourceRoot":"","sources":["../../src/tools/create-document.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,EAAqC,CAAC,EAAE,MAAM,KAAK,CAAC;AAC3D,OAAO,EAIL,UAAU,EAEV,aAAa,EACb,UAAU,EACV,iBAAiB,EACjB,yBAAyB,EAI1B,MAAM,mBAAmB,CAAC;AAc3B,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAO3B,CAAC;AAEZ,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E,qBAKa,cAAe,YAAW,aAAa;IAClD,SAAS,CAAC,QAAQ,CAAC,MAAM,SAAmC;IAG5D,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAsB;IAG3C,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAkB;IAGlD,OAAO,CAAC,QAAQ,CAAC,kCAAkC,CAAqC;IAExF,OAAO,CACL,IAAI,EAAE,mBAAmB,EACzB,OAAO,EAAE,UAAU,EACnB,MAAM,EAAE,iBAAiB,GAAG,aAAa,EACzC,QAAQ,EAAE,yBAAyB,GAClC,OAAO,CAAC,UAAU,CAAC;IA6CtB,OAAO,CAAC,iBAAiB;IAIzB,OAAO,CAAC,sBAAsB;IAW9B,OAAO,CAAC,eAAe;IA8BvB,OAAO,CAAC,gBAAgB;IAUxB,OAAO,CAAC,gBAAgB;IAQxB,OAAO,CAAC,oBAAoB;IA4B5B,OAAO,CAAC,WAAW;CAUpB"}
|
|
@@ -0,0 +1,151 @@
|
|
|
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
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var CreateDocument_1;
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.CreateDocument = exports.CreateDocumentInputSchema = void 0;
|
|
14
|
+
const common_1 = require("@nestjs/common");
|
|
15
|
+
const lodash_1 = require("lodash");
|
|
16
|
+
const node_crypto_1 = require("node:crypto");
|
|
17
|
+
const zod_1 = require("zod");
|
|
18
|
+
const common_2 = require("@loopstack/common");
|
|
19
|
+
const schemas_1 = require("@loopstack/contracts/schemas");
|
|
20
|
+
const common_3 = require("../common");
|
|
21
|
+
const common_4 = require("../common");
|
|
22
|
+
const persistence_1 = require("../persistence");
|
|
23
|
+
exports.CreateDocumentInputSchema = zod_1.z
|
|
24
|
+
.object({
|
|
25
|
+
id: zod_1.z.string().optional(),
|
|
26
|
+
document: zod_1.z.string(),
|
|
27
|
+
validate: zod_1.z.union([zod_1.z.literal('strict'), zod_1.z.literal('safe'), zod_1.z.literal('skip')]).default('strict'),
|
|
28
|
+
update: schemas_1.DocumentSchema.optional(),
|
|
29
|
+
})
|
|
30
|
+
.strict();
|
|
31
|
+
let CreateDocument = CreateDocument_1 = class CreateDocument {
|
|
32
|
+
logger = new common_1.Logger(CreateDocument_1.name);
|
|
33
|
+
args;
|
|
34
|
+
documentService;
|
|
35
|
+
templateExpressionEvaluatorService;
|
|
36
|
+
execute(args, context, parent, metadata) {
|
|
37
|
+
const document = (0, common_2.getBlockDocument)(parent, args.document);
|
|
38
|
+
if (!document) {
|
|
39
|
+
return Promise.reject(new Error(`Document "${args.document}" not found in parent context.`));
|
|
40
|
+
}
|
|
41
|
+
const config = (0, common_2.getBlockConfig)(document);
|
|
42
|
+
if (!config) {
|
|
43
|
+
throw new Error(`Block ${document.constructor.name} is missing @BlockConfig decorator`);
|
|
44
|
+
}
|
|
45
|
+
try {
|
|
46
|
+
const templateContext = { args };
|
|
47
|
+
const mergedTemplateData = this.mergeTemplateData(config, args.update);
|
|
48
|
+
const documentSkeleton = this.createDocumentSkeleton(mergedTemplateData, templateContext);
|
|
49
|
+
const validationResult = this.validateContent((0, common_2.getBlockArgsSchema)(document), mergedTemplateData.content, args.validate);
|
|
50
|
+
const messageId = this.resolveMessageId(args.id, templateContext);
|
|
51
|
+
const jsonSchema = this.createJsonSchema((0, common_2.getBlockArgsSchema)(document));
|
|
52
|
+
const documentEntity = this.createDocumentEntity(context, metadata, {
|
|
53
|
+
skeleton: documentSkeleton,
|
|
54
|
+
content: validationResult.content,
|
|
55
|
+
error: validationResult.error,
|
|
56
|
+
schema: jsonSchema,
|
|
57
|
+
messageId,
|
|
58
|
+
blockName: document.constructor.name,
|
|
59
|
+
});
|
|
60
|
+
this.logger.debug(`Created document "${messageId}".`);
|
|
61
|
+
return Promise.resolve(this.buildResult(documentEntity));
|
|
62
|
+
}
|
|
63
|
+
catch (e) {
|
|
64
|
+
throw new common_3.ConfigTraceError(e instanceof Error ? e : new Error(String(e)), document);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
mergeTemplateData(config, update) {
|
|
68
|
+
return (0, lodash_1.merge)({}, config, update ?? {});
|
|
69
|
+
}
|
|
70
|
+
createDocumentSkeleton(templateData, context) {
|
|
71
|
+
return this.templateExpressionEvaluatorService.evaluateTemplate((0, lodash_1.omit)(templateData, ['content']), context, { schema: schemas_1.DocumentSchema });
|
|
72
|
+
}
|
|
73
|
+
validateContent(schema, content, mode) {
|
|
74
|
+
if (!schema && content !== undefined) {
|
|
75
|
+
throw new Error('Document was created with content but no schema is defined.');
|
|
76
|
+
}
|
|
77
|
+
if (!schema || mode === 'skip') {
|
|
78
|
+
return { content };
|
|
79
|
+
}
|
|
80
|
+
const result = schema.safeParse(content);
|
|
81
|
+
if (!result.success) {
|
|
82
|
+
if (mode === 'strict') {
|
|
83
|
+
this.logger.error(result.error);
|
|
84
|
+
throw new common_3.SchemaValidationError('Document schema validation failed (strict mode)');
|
|
85
|
+
}
|
|
86
|
+
return {
|
|
87
|
+
content: result.data,
|
|
88
|
+
error: result.error,
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
return { content: result.data };
|
|
92
|
+
}
|
|
93
|
+
resolveMessageId(idTemplate, context) {
|
|
94
|
+
if (!idTemplate) {
|
|
95
|
+
return (0, node_crypto_1.randomUUID)();
|
|
96
|
+
}
|
|
97
|
+
return this.templateExpressionEvaluatorService.evaluateTemplate(idTemplate, context, {
|
|
98
|
+
schema: zod_1.z.string(),
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
createJsonSchema(schema) {
|
|
102
|
+
if (!schema) {
|
|
103
|
+
return undefined;
|
|
104
|
+
}
|
|
105
|
+
return (0, zod_1.toJSONSchema)(schema);
|
|
106
|
+
}
|
|
107
|
+
createDocumentEntity(context, metadata, params) {
|
|
108
|
+
const documentData = {
|
|
109
|
+
...params.skeleton,
|
|
110
|
+
content: params.content,
|
|
111
|
+
schema: params.schema,
|
|
112
|
+
messageId: params.messageId,
|
|
113
|
+
blockName: params.blockName,
|
|
114
|
+
};
|
|
115
|
+
if (params.error) {
|
|
116
|
+
documentData.error = params.error;
|
|
117
|
+
}
|
|
118
|
+
return this.documentService.create(context, metadata, documentData);
|
|
119
|
+
}
|
|
120
|
+
buildResult(documentEntity) {
|
|
121
|
+
return {
|
|
122
|
+
data: documentEntity,
|
|
123
|
+
effects: [
|
|
124
|
+
{
|
|
125
|
+
addWorkflowDocuments: [documentEntity],
|
|
126
|
+
},
|
|
127
|
+
],
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
exports.CreateDocument = CreateDocument;
|
|
132
|
+
__decorate([
|
|
133
|
+
(0, common_2.Input)({ schema: exports.CreateDocumentInputSchema }),
|
|
134
|
+
__metadata("design:type", Object)
|
|
135
|
+
], CreateDocument.prototype, "args", void 0);
|
|
136
|
+
__decorate([
|
|
137
|
+
(0, common_1.Inject)(),
|
|
138
|
+
__metadata("design:type", persistence_1.DocumentService)
|
|
139
|
+
], CreateDocument.prototype, "documentService", void 0);
|
|
140
|
+
__decorate([
|
|
141
|
+
(0, common_1.Inject)(),
|
|
142
|
+
__metadata("design:type", common_4.TemplateExpressionEvaluatorService)
|
|
143
|
+
], CreateDocument.prototype, "templateExpressionEvaluatorService", void 0);
|
|
144
|
+
exports.CreateDocument = CreateDocument = CreateDocument_1 = __decorate([
|
|
145
|
+
(0, common_2.Tool)({
|
|
146
|
+
config: {
|
|
147
|
+
description: 'Create a document.',
|
|
148
|
+
},
|
|
149
|
+
})
|
|
150
|
+
], CreateDocument);
|
|
151
|
+
//# sourceMappingURL=create-document.tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-document.tool.js","sourceRoot":"","sources":["../../src/tools/create-document.tool.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAgD;AAChD,mCAAqC;AACrC,6CAAyC;AACzC,6BAA2D;AAC3D,8CAa2B;AAC3B,0DAA8D;AAE9D,sCAAoE;AACpE,sCAA+D;AAC/D,gDAAiD;AASpC,QAAA,yBAAyB,GAAG,OAAC;KACvC,MAAM,CAAC;IACN,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACzB,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE;IACpB,QAAQ,EAAE,OAAC,CAAC,KAAK,CAAC,CAAC,OAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,OAAC,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,OAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC;IAChG,MAAM,E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AO,EAAE,MAAM,CAAC,OAAO;YAEvB,MAAM,EAAE,MAAM,CAAC,MAAa;YAC5B,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,SAAS,EAAE,MAAM,CAAC,SAAS;SAC5B,CAAC;QAEF,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;YACjB,YAAY,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;QACpC,CAAC;QAED,OAAO,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,OAAO,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAC;IACtE,CAAC;IAEO,WAAW,CAAC,cAA8B;QAChD,OAAO;YACL,IAAI,EAAE,cAAc;YACpB,OAAO,EAAE;gBACP;oBACE,oBAAoB,EAAE,CAAC,cAAc,CAAC;iBACvC;aACF;SACF,CAAC;IACJ,CAAC;CACF,CAAA;AAnKY,wCAAc;AAIR;IADhB,IAAA,cAAK,EAAC,EAAE,MAAM,EAAE,iCAAyB,EAAE,CAAC;;4CACF;AAG1B;IADhB,IAAA,eAAM,GAAE;8BACyB,6BAAe;uDAAC;AAGjC;IADhB,IAAA,eAAM,GAAE;8BAC4C,2CAAkC;0EAAC;yBAV7E,cAAc;IAL1B,IAAA,aAAI,EAAC;QACJ,MAAM,EAAE;YACN,WAAW,EAAE,oBAAoB;SAClC;KACF,CAAC;GACW,cAAc,CAmK1B"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { RunContext, ToolInterface, ToolResult } from '@loopstack/common';
|
|
2
|
+
export declare class GetSecretKeysTool implements ToolInterface {
|
|
3
|
+
private secretService;
|
|
4
|
+
execute(_args: undefined, context: RunContext): Promise<ToolResult>;
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=get-secret-keys.tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-secret-keys.tool.d.ts","sourceRoot":"","sources":["../../src/tools/get-secret-keys.tool.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAQ,aAAa,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAGhF,qBAKa,iBAAkB,YAAW,aAAa;IAC3C,OAAO,CAAC,aAAa,CAAgB;IAEzC,OAAO,CAAC,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;CAS1E"}
|
|
@@ -0,0 +1,40 @@
|
|
|
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
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.GetSecretKeysTool = void 0;
|
|
13
|
+
const common_1 = require("@nestjs/common");
|
|
14
|
+
const common_2 = require("@loopstack/common");
|
|
15
|
+
const persistence_1 = require("../persistence");
|
|
16
|
+
let GetSecretKeysTool = class GetSecretKeysTool {
|
|
17
|
+
secretService;
|
|
18
|
+
async execute(_args, context) {
|
|
19
|
+
const secrets = await this.secretService.findAllByWorkspace(context.workspaceId);
|
|
20
|
+
return {
|
|
21
|
+
data: secrets.map((s) => ({
|
|
22
|
+
key: s.key,
|
|
23
|
+
hasValue: !!s.value,
|
|
24
|
+
})),
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
exports.GetSecretKeysTool = GetSecretKeysTool;
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, common_1.Inject)(),
|
|
31
|
+
__metadata("design:type", persistence_1.SecretService)
|
|
32
|
+
], GetSecretKeysTool.prototype, "secretService", void 0);
|
|
33
|
+
exports.GetSecretKeysTool = GetSecretKeysTool = __decorate([
|
|
34
|
+
(0, common_2.Tool)({
|
|
35
|
+
config: {
|
|
36
|
+
description: 'Returns the list of secret keys for the current workspace. Does not return secret values.',
|
|
37
|
+
},
|
|
38
|
+
})
|
|
39
|
+
], GetSecretKeysTool);
|
|
40
|
+
//# sourceMappingURL=get-secret-keys.tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-secret-keys.tool.js","sourceRoot":"","sources":["../../src/tools/get-secret-keys.tool.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAwC;AACxC,8CAAgF;AAChF,gDAA+C;AAOxC,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IACV,aAAa,CAAgB;IAE/C,KAAK,CAAC,OAAO,CAAC,KAAgB,EAAE,OAAmB;QACjD,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,kBAAkB,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;QACjF,OAAO;YACL,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;gBACxB,GAAG,EAAE,CAAC,CAAC,GAAG;gBACV,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK;aACpB,CAAC,CAAC;SACJ,CAAC;IACJ,CAAC;CACF,CAAA;AAZY,8CAAiB;AACV;IAAjB,IAAA,eAAM,GAAE;8BAAwB,2BAAa;wDAAC;4BADpC,iBAAiB;IAL7B,IAAA,aAAI,EAAC;QACJ,MAAM,EAAE;YACN,WAAW,EAAE,2FAA2F;SACzG;KACF,CAAC;GACW,iBAAiB,CAY7B"}
|
package/dist/tools/index.d.ts
CHANGED
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './create-document.tool';
|
|
2
|
+
export * from './get-secret-keys.tool';
|
|
3
|
+
export * from './request-secrets.tool';
|
|
4
|
+
export * from './request-secrets-task.tool';
|
|
5
|
+
export * from './task.tool';
|
|
6
|
+
export * from './secrets-request.workflow';
|
|
2
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,cAAc
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,aAAa,CAAC;AAC5B,cAAc,4BAA4B,CAAC"}
|
package/dist/tools/index.js
CHANGED
|
@@ -14,5 +14,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./
|
|
17
|
+
__exportStar(require("./create-document.tool"), exports);
|
|
18
|
+
__exportStar(require("./get-secret-keys.tool"), exports);
|
|
19
|
+
__exportStar(require("./request-secrets.tool"), exports);
|
|
20
|
+
__exportStar(require("./request-secrets-task.tool"), exports);
|
|
21
|
+
__exportStar(require("./task.tool"), exports);
|
|
22
|
+
__exportStar(require("./secrets-request.workflow"), exports);
|
|
18
23
|
//# sourceMappingURL=index.js.map
|
package/dist/tools/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yDAAuC;AACvC,yDAAuC;AACvC,yDAAuC;AACvC,8DAA4C;AAC5C,8CAA4B;AAC5B,6DAA2C"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { RunContext, ToolInterface, ToolResult, WorkflowInterface, WorkflowMetadataInterface } from '@loopstack/common';
|
|
3
|
+
declare const RequestSecretsTaskInputSchema: z.ZodObject<{
|
|
4
|
+
variables: z.ZodArray<z.ZodObject<{
|
|
5
|
+
key: z.ZodString;
|
|
6
|
+
}, z.core.$strip>>;
|
|
7
|
+
}, z.core.$strict>;
|
|
8
|
+
type RequestSecretsTaskInput = z.infer<typeof RequestSecretsTaskInputSchema>;
|
|
9
|
+
export declare class RequestSecretsTask implements ToolInterface<RequestSecretsTaskInput> {
|
|
10
|
+
private readonly logger;
|
|
11
|
+
private task;
|
|
12
|
+
private createDocument;
|
|
13
|
+
private linkDocument;
|
|
14
|
+
args: RequestSecretsTaskInput;
|
|
15
|
+
execute(args: RequestSecretsTaskInput, ctx: RunContext, parent: WorkflowInterface | ToolInterface, metadata: WorkflowMetadataInterface): Promise<ToolResult>;
|
|
16
|
+
complete(result: Record<string, unknown>, ctx: RunContext, parent: WorkflowInterface | ToolInterface, metadata: WorkflowMetadataInterface): Promise<ToolResult>;
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=request-secrets-task.tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request-secrets-task.tool.d.ts","sourceRoot":"","sources":["../../src/tools/request-secrets-task.tool.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAIL,UAAU,EAEV,aAAa,EACb,UAAU,EAEV,iBAAiB,EACjB,yBAAyB,EAC1B,MAAM,mBAAmB,CAAC;AAK3B,QAAA,MAAM,6BAA6B;;;;kBAQxB,CAAC;AAEZ,KAAK,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAE7E,qBAUa,kBAAmB,YAAW,aAAa,CAAC,uBAAuB,CAAC;IAC/E,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAuC;IAEhD,OAAO,CAAC,IAAI,CAAO;IACnB,OAAO,CAAC,cAAc,CAAiB;IACnC,OAAO,CAAC,YAAY,CAAe;IAGrD,IAAI,EAAE,uBAAuB,CAAC;IAExB,OAAO,CACX,IAAI,EAAE,uBAAuB,EAC7B,GAAG,EAAE,UAAU,EACf,MAAM,EAAE,iBAAiB,GAAG,aAAa,EACzC,QAAQ,EAAE,yBAAyB,GAClC,OAAO,CAAC,UAAU,CAAC;IAsChB,QAAQ,CACZ,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,GAAG,EAAE,UAAU,EACf,MAAM,EAAE,iBAAiB,GAAG,aAAa,EACzC,QAAQ,EAAE,yBAAyB,GAClC,OAAO,CAAC,UAAU,CAAC;CA+BvB"}
|