anbaric-tsapi 1.21.4 → 1.22.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/api/actions/Action.d.ts +14 -0
- package/dist/api/actions/Action.d.ts.map +1 -0
- package/dist/api/actions/Action.js +16 -0
- package/dist/api/actions/Action.js.map +1 -0
- package/dist/api/actions/AgenticAction.d.ts +11 -0
- package/dist/api/actions/AgenticAction.d.ts.map +1 -0
- package/dist/api/actions/AgenticAction.js +14 -0
- package/dist/api/actions/AgenticAction.js.map +1 -0
- package/dist/api/actions/Await.d.ts +15 -0
- package/dist/api/actions/Await.d.ts.map +1 -0
- package/{src/api/actions/Await.ts → dist/api/actions/Await.js} +12 -18
- package/dist/api/actions/Await.js.map +1 -0
- package/dist/api/actions/WaitForInput.d.ts +19 -0
- package/dist/api/actions/WaitForInput.d.ts.map +1 -0
- package/dist/api/actions/WaitForInput.js +25 -0
- package/dist/api/actions/WaitForInput.js.map +1 -0
- package/dist/api/actors/Actor.d.ts +8 -0
- package/dist/api/actors/Actor.d.ts.map +1 -0
- package/dist/api/actors/Actor.js +2 -0
- package/dist/api/actors/Actor.js.map +1 -0
- package/dist/api/actors/SystemActor.d.ts +9 -0
- package/dist/api/actors/SystemActor.d.ts.map +1 -0
- package/dist/api/actors/SystemActor.js +8 -0
- package/dist/api/actors/SystemActor.js.map +1 -0
- package/dist/api/actors/agents/Agent.d.ts +16 -0
- package/dist/api/actors/agents/Agent.d.ts.map +1 -0
- package/dist/api/actors/agents/Agent.js +21 -0
- package/dist/api/actors/agents/Agent.js.map +1 -0
- package/dist/api/actors/agents/AgentMessage.d.ts +6 -0
- package/dist/api/actors/agents/AgentMessage.d.ts.map +1 -0
- package/dist/api/actors/agents/AgentMessage.js +2 -0
- package/dist/api/actors/agents/AgentMessage.js.map +1 -0
- package/dist/api/actors/agents/AgentRequest.d.ts +7 -0
- package/dist/api/actors/agents/AgentRequest.d.ts.map +1 -0
- package/dist/api/actors/agents/AgentRequest.js +2 -0
- package/dist/api/actors/agents/AgentRequest.js.map +1 -0
- package/dist/api/auditing/Auditor.d.ts +6 -0
- package/dist/api/auditing/Auditor.d.ts.map +1 -0
- package/dist/api/auditing/Auditor.js +2 -0
- package/dist/api/auditing/Auditor.js.map +1 -0
- package/dist/api/auditing/NoOpAuditor.d.ts +7 -0
- package/dist/api/auditing/NoOpAuditor.d.ts.map +1 -0
- package/dist/api/auditing/NoOpAuditor.js +9 -0
- package/dist/api/auditing/NoOpAuditor.js.map +1 -0
- package/dist/api/cloud/AppAware.d.ts +7 -0
- package/dist/api/cloud/AppAware.d.ts.map +1 -0
- package/dist/api/cloud/AppAware.js +5 -0
- package/dist/api/cloud/AppAware.js.map +1 -0
- package/dist/api/cloud/AuditRecord.d.ts +14 -0
- package/dist/api/cloud/AuditRecord.d.ts.map +1 -0
- package/dist/api/cloud/AuditRecord.js +2 -0
- package/dist/api/cloud/AuditRecord.js.map +1 -0
- package/dist/api/cloud/QueueMessage.d.ts +8 -0
- package/dist/api/cloud/QueueMessage.d.ts.map +1 -0
- package/dist/api/cloud/QueueMessage.js +2 -0
- package/dist/api/cloud/QueueMessage.js.map +1 -0
- package/dist/api/cloud/WorkflowDefinition.d.ts +32 -0
- package/dist/api/cloud/WorkflowDefinition.d.ts.map +1 -0
- package/dist/api/cloud/WorkflowDefinition.js +24 -0
- package/dist/api/cloud/WorkflowDefinition.js.map +1 -0
- package/dist/api/documents/JsonSchema.d.ts +11 -0
- package/dist/api/documents/JsonSchema.d.ts.map +1 -0
- package/dist/api/documents/JsonSchema.js +40 -0
- package/dist/api/documents/JsonSchema.js.map +1 -0
- package/dist/api/documents/JsonStore.d.ts +27 -0
- package/dist/api/documents/JsonStore.d.ts.map +1 -0
- package/dist/api/documents/JsonStore.js +43 -0
- package/dist/api/documents/JsonStore.js.map +1 -0
- package/dist/api/jobs/Job.d.ts +24 -0
- package/dist/api/jobs/Job.d.ts.map +1 -0
- package/{src/api/jobs/Job.ts → dist/api/jobs/Job.js} +19 -32
- package/dist/api/jobs/Job.js.map +1 -0
- package/dist/api/jobs/JobPersistence.d.ts +43 -0
- package/dist/api/jobs/JobPersistence.d.ts.map +1 -0
- package/dist/api/jobs/JobPersistence.js +87 -0
- package/dist/api/jobs/JobPersistence.js.map +1 -0
- package/dist/api/jobs/JobSerialization.d.ts +21 -0
- package/dist/api/jobs/JobSerialization.d.ts.map +1 -0
- package/dist/api/jobs/JobSerialization.js +22 -0
- package/dist/api/jobs/JobSerialization.js.map +1 -0
- package/dist/api/jobs/PropertyDefinition.d.ts +8 -0
- package/dist/api/jobs/PropertyDefinition.d.ts.map +1 -0
- package/dist/api/jobs/PropertyDefinition.js +10 -0
- package/dist/api/jobs/PropertyDefinition.js.map +1 -0
- package/dist/api/secrets/SecretStore.d.ts +26 -0
- package/dist/api/secrets/SecretStore.d.ts.map +1 -0
- package/dist/api/secrets/SecretStore.js +42 -0
- package/dist/api/secrets/SecretStore.js.map +1 -0
- package/dist/api/sessions/SessionResolver.d.ts +10 -0
- package/dist/api/sessions/SessionResolver.d.ts.map +1 -0
- package/dist/api/sessions/SessionResolver.js +2 -0
- package/dist/api/sessions/SessionResolver.js.map +1 -0
- package/dist/api/sql/SqlStore.d.ts +19 -0
- package/dist/api/sql/SqlStore.d.ts.map +1 -0
- package/dist/api/sql/SqlStore.js +29 -0
- package/dist/api/sql/SqlStore.js.map +1 -0
- package/dist/api/state-machine/Consumer.d.ts +6 -0
- package/dist/api/state-machine/Consumer.d.ts.map +1 -0
- package/dist/api/state-machine/Consumer.js +2 -0
- package/dist/api/state-machine/Consumer.js.map +1 -0
- package/dist/api/state-machine/Queue.d.ts +13 -0
- package/dist/api/state-machine/Queue.d.ts.map +1 -0
- package/dist/api/state-machine/Queue.js +7 -0
- package/dist/api/state-machine/Queue.js.map +1 -0
- package/dist/api/states/State.d.ts +13 -0
- package/dist/api/states/State.d.ts.map +1 -0
- package/dist/api/states/State.js +17 -0
- package/dist/api/states/State.js.map +1 -0
- package/dist/api/states/Terminal.d.ts +13 -0
- package/dist/api/states/Terminal.d.ts.map +1 -0
- package/dist/api/states/Terminal.js +19 -0
- package/dist/api/states/Terminal.js.map +1 -0
- package/dist/api/transitions/Transition.d.ts +8 -0
- package/dist/api/transitions/Transition.d.ts.map +1 -0
- package/dist/api/transitions/Transition.js +10 -0
- package/dist/api/transitions/Transition.js.map +1 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +30 -0
- package/dist/index.js.map +1 -0
- package/package.json +14 -5
- package/src/api/actions/Action.ts +0 -25
- package/src/api/actions/AgenticAction.ts +0 -24
- package/src/api/actions/WaitForInput.ts +0 -43
- package/src/api/actors/Actor.ts +0 -11
- package/src/api/actors/SystemActor.ts +0 -13
- package/src/api/actors/agents/Agent.ts +0 -32
- package/src/api/actors/agents/AgentMessage.ts +0 -8
- package/src/api/actors/agents/AgentRequest.ts +0 -10
- package/src/api/auditing/Auditor.ts +0 -13
- package/src/api/auditing/NoOpAuditor.ts +0 -15
- package/src/api/cloud/AppAware.ts +0 -14
- package/src/api/cloud/AuditRecord.ts +0 -14
- package/src/api/cloud/QueueMessage.ts +0 -8
- package/src/api/cloud/WorkflowDefinition.ts +0 -49
- package/src/api/documents/JsonSchema.ts +0 -53
- package/src/api/documents/JsonStore.ts +0 -56
- package/src/api/jobs/JobPersistence.ts +0 -141
- package/src/api/jobs/JobSerialization.ts +0 -45
- package/src/api/jobs/PropertyDefinition.ts +0 -12
- package/src/api/secrets/SecretStore.ts +0 -57
- package/src/api/sessions/SessionResolver.ts +0 -20
- package/src/api/sql/SqlStore.ts +0 -41
- package/src/api/state-machine/Consumer.ts +0 -8
- package/src/api/state-machine/Queue.ts +0 -22
- package/src/api/states/State.ts +0 -25
- package/src/api/states/Terminal.ts +0 -25
- package/src/api/transitions/Transition.ts +0 -13
- package/src/index.ts +0 -29
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Actor } from "../actors/Actor.js";
|
|
2
|
+
import { Job } from "../jobs/Job.js";
|
|
3
|
+
type CodeRun = (job: Job) => Promise<Map<string, any>>;
|
|
4
|
+
declare class Action {
|
|
5
|
+
readonly id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
description: string;
|
|
8
|
+
actor: Actor;
|
|
9
|
+
constructor(name: string, actor: Actor, description?: string, id?: string);
|
|
10
|
+
predicate: (_job: Job) => boolean;
|
|
11
|
+
run: CodeRun;
|
|
12
|
+
}
|
|
13
|
+
export { Action };
|
|
14
|
+
//# sourceMappingURL=Action.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Action.d.ts","sourceRoot":"","sources":["../../../src/api/actions/Action.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAC,MAAM,oBAAoB,CAAC;AACzC,OAAO,EAAC,GAAG,EAAC,MAAM,gBAAgB,CAAC;AAEnC,KAAK,OAAO,GAAG,CAAC,GAAG,EAAG,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC;AAExD,cAAM,MAAM;IAER,QAAQ,CAAC,EAAE,EAAG,MAAM,CAAC;IACrB,IAAI,EAAG,MAAM,CAAC;IACd,WAAW,EAAG,MAAM,CAAC;IACrB,KAAK,EAAG,KAAK,CAAC;IAEd,YAAY,IAAI,EAAG,MAAM,EAAE,KAAK,EAAG,KAAK,EAAE,WAAW,GAAG,MAAW,EAAE,EAAE,GAAG,MAA4B,EAKrG;IAED,SAAS,SAAW,GAAG,aAAU;IACjC,GAAG,EAAG,OAAO,CAAmC;CAEnD;AAED,OAAO,EAAE,MAAM,EAAE,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
class Action {
|
|
2
|
+
id;
|
|
3
|
+
name;
|
|
4
|
+
description;
|
|
5
|
+
actor;
|
|
6
|
+
constructor(name, actor, description = "", id = crypto.randomUUID()) {
|
|
7
|
+
this.name = name;
|
|
8
|
+
this.actor = actor;
|
|
9
|
+
this.description = description;
|
|
10
|
+
this.id = id;
|
|
11
|
+
}
|
|
12
|
+
predicate = (_job) => true;
|
|
13
|
+
run = async (_job) => new Map();
|
|
14
|
+
}
|
|
15
|
+
export { Action };
|
|
16
|
+
//# sourceMappingURL=Action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Action.js","sourceRoot":"","sources":["../../../src/api/actions/Action.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM;IAEC,EAAE,CAAU;IACrB,IAAI,CAAU;IACd,WAAW,CAAU;IACrB,KAAK,CAAS;IAEd,YAAY,IAAa,EAAE,KAAa,EAAE,WAAW,GAAY,EAAE,EAAE,EAAE,GAAY,MAAM,CAAC,UAAU,EAAE;QAClG,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;IACjB,CAAC;IAED,SAAS,GAAG,CAAC,IAAU,EAAE,EAAE,CAAC,IAAI,CAAC;IACjC,GAAG,GAAa,KAAK,EAAE,IAAU,EAAE,EAAE,CAAC,IAAI,GAAG,EAAE,CAAC;CAEnD;AAED,OAAO,EAAE,MAAM,EAAE,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Agent } from "../actors/agents/Agent.js";
|
|
2
|
+
import { AgentRequest } from "../actors/agents/AgentRequest.js";
|
|
3
|
+
import { Job } from "../jobs/Job.js";
|
|
4
|
+
import { Action } from "./Action.js";
|
|
5
|
+
declare abstract class AgenticAction extends Action {
|
|
6
|
+
protected agent: Agent;
|
|
7
|
+
constructor(name: string, agent: Agent, description?: string, id?: string);
|
|
8
|
+
protected abstract requestFor(job: Job): AgentRequest;
|
|
9
|
+
}
|
|
10
|
+
export { AgenticAction };
|
|
11
|
+
//# sourceMappingURL=AgenticAction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AgenticAction.d.ts","sourceRoot":"","sources":["../../../src/api/actions/AgenticAction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAC,MAAM,2BAA2B,CAAC;AAChD,OAAO,EAAC,YAAY,EAAC,MAAM,kCAAkC,CAAC;AAC9D,OAAO,EAAC,GAAG,EAAC,MAAM,gBAAgB,CAAC;AACnC,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AAKnC,uBAAe,aAAc,SAAQ,MAAM;IAEvC,SAAS,CAAC,KAAK,EAAG,KAAK,CAAC;IAExB,YAAY,IAAI,EAAG,MAAM,EAAE,KAAK,EAAG,KAAK,EAAE,WAAW,GAAG,MAAW,EAAE,EAAE,CAAC,EAAG,MAAM,EAKhF;IAED,SAAS,CAAC,QAAQ,CAAC,UAAU,CAAC,GAAG,EAAG,GAAG,GAAI,YAAY,CAAC;CAE3D;AAED,OAAO,EAAE,aAAa,EAAE,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Action } from "./Action.js";
|
|
2
|
+
/* An action whose properties are generated by an agent. run builds a request
|
|
3
|
+
from the job and hands it to the agent's client; the structured result
|
|
4
|
+
becomes the property map. Subclasses decide how the request is composed. */
|
|
5
|
+
class AgenticAction extends Action {
|
|
6
|
+
agent;
|
|
7
|
+
constructor(name, agent, description = "", id) {
|
|
8
|
+
super(name, agent, description, id);
|
|
9
|
+
this.agent = agent;
|
|
10
|
+
this.run = async (job) => new Map(Object.entries(await this.agent.client.generate(this.requestFor(job))));
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
export { AgenticAction };
|
|
14
|
+
//# sourceMappingURL=AgenticAction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AgenticAction.js","sourceRoot":"","sources":["../../../src/api/actions/AgenticAction.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AAEnC;;8EAE8E;AAC9E,MAAe,aAAc,SAAQ,MAAM;IAE7B,KAAK,CAAS;IAExB,YAAY,IAAa,EAAE,KAAa,EAAE,WAAW,GAAY,EAAE,EAAE,EAAY;QAC7E,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,EAAE,CAAC,CAAC;QACpC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,GAAG,GAAG,KAAK,EAAE,GAAS,EAAE,EAAE,CAC3B,IAAI,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IACxF,CAAC;CAIJ;AAED,OAAO,EAAE,aAAa,EAAE,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Job } from "../jobs/Job.js";
|
|
2
|
+
import { AwaitParty, WaitForInput } from "./WaitForInput.js";
|
|
3
|
+
declare class Await {
|
|
4
|
+
readonly id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
description: string;
|
|
7
|
+
waitingFor?: AwaitParty;
|
|
8
|
+
fields: Array<string>;
|
|
9
|
+
resolveUrl: string | ((job: Job) => string);
|
|
10
|
+
metadata: (job: Job) => Map<string, any>;
|
|
11
|
+
constructor(name: string, waitingFor?: AwaitParty, description?: string, id?: string);
|
|
12
|
+
waitForInput(job: Job): WaitForInput;
|
|
13
|
+
}
|
|
14
|
+
export { Await };
|
|
15
|
+
//# sourceMappingURL=Await.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Await.d.ts","sourceRoot":"","sources":["../../../src/api/actions/Await.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,gBAAgB,CAAC;AACnC,OAAO,EAAC,UAAU,EAAE,YAAY,EAAC,MAAM,mBAAmB,CAAC;AAW3D,cAAM,KAAK;IAEP,QAAQ,CAAC,EAAE,EAAG,MAAM,CAAC;IACrB,IAAI,EAAG,MAAM,CAAC;IACd,WAAW,EAAG,MAAM,CAAC;IACrB,UAAU,CAAC,EAAG,UAAU,CAAC;IACzB,MAAM,EAAG,KAAK,CAAC,MAAM,CAAC,CAAM;IAC5B,UAAU,EAAG,MAAM,GAAG,CAAC,CAAC,GAAG,EAAG,GAAG,KAAK,MAAM,CAAC,CAAM;IACnD,QAAQ,EAAG,CAAC,GAAG,EAAG,GAAG,KAAK,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,CAA6B;IAEvE,YAAY,IAAI,EAAG,MAAM,EAAE,UAAU,CAAC,EAAG,UAAU,EAAE,WAAW,GAAG,MAAW,EAAE,EAAE,GAAG,MAA4B,EAKhH;IAED,YAAY,CAAC,GAAG,EAAG,GAAG,GAAI,YAAY,CAGrC;CAEJ;AAED,OAAO,EAAE,KAAK,EAAE,CAAA"}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {AwaitParty, WaitForInput} from "./WaitForInput";
|
|
3
|
-
|
|
1
|
+
import { WaitForInput } from "./WaitForInput.js";
|
|
4
2
|
/* A pause point in a state's action list. When a job reaches an Await it runs
|
|
5
3
|
nothing: the job is parked in the "Awaiting input" status and is not
|
|
6
4
|
re-enqueued until an update to its properties arrives (a human filling in a
|
|
@@ -11,27 +9,23 @@ import {AwaitParty, WaitForInput} from "./WaitForInput";
|
|
|
11
9
|
stored against the job and audited, and cleared once a transition moves the
|
|
12
10
|
job on to another state. */
|
|
13
11
|
class Await {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
constructor(name : string, waitingFor? : AwaitParty, description : string = "", id : string = crypto.randomUUID()) {
|
|
12
|
+
id;
|
|
13
|
+
name;
|
|
14
|
+
description;
|
|
15
|
+
waitingFor;
|
|
16
|
+
fields = [];
|
|
17
|
+
resolveUrl = "";
|
|
18
|
+
metadata = (_job) => new Map();
|
|
19
|
+
constructor(name, waitingFor, description = "", id = crypto.randomUUID()) {
|
|
24
20
|
this.name = name;
|
|
25
21
|
this.waitingFor = waitingFor;
|
|
26
22
|
this.description = description;
|
|
27
23
|
this.id = id;
|
|
28
24
|
}
|
|
29
|
-
|
|
30
|
-
waitForInput(job : Job) : WaitForInput {
|
|
25
|
+
waitForInput(job) {
|
|
31
26
|
const resolveUrl = typeof this.resolveUrl === "function" ? this.resolveUrl(job) : this.resolveUrl;
|
|
32
27
|
return new WaitForInput(this.fields, resolveUrl, this.metadata(job), this.waitingFor);
|
|
33
28
|
}
|
|
34
|
-
|
|
35
29
|
}
|
|
36
|
-
|
|
37
|
-
|
|
30
|
+
export { Await };
|
|
31
|
+
//# sourceMappingURL=Await.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Await.js","sourceRoot":"","sources":["../../../src/api/actions/Await.ts"],"names":[],"mappings":"AACA,OAAO,EAAa,YAAY,EAAC,MAAM,mBAAmB,CAAC;AAE3D;;;;;;;;8BAQ8B;AAC9B,MAAM,KAAK;IAEE,EAAE,CAAU;IACrB,IAAI,CAAU;IACd,WAAW,CAAU;IACrB,UAAU,CAAe;IACzB,MAAM,GAAmB,EAAE,CAAC;IAC5B,UAAU,GAAsC,EAAE,CAAC;IACnD,QAAQ,GAAqC,CAAC,IAAU,EAAE,EAAE,CAAC,IAAI,GAAG,EAAE,CAAC;IAEvE,YAAY,IAAa,EAAE,UAAwB,EAAE,WAAW,GAAY,EAAE,EAAE,EAAE,GAAY,MAAM,CAAC,UAAU,EAAE;QAC7G,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;IACjB,CAAC;IAED,YAAY,CAAC,GAAS;QAClB,MAAM,UAAU,GAAG,OAAO,IAAI,CAAC,UAAU,KAAK,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC;QAClG,OAAO,IAAI,YAAY,CAAC,IAAI,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;IAC1F,CAAC;CAEJ;AAED,OAAO,EAAE,KAAK,EAAE,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
type AwaitParty = "HUMAN" | "EXTERNAL_SYSTEM";
|
|
2
|
+
declare class WaitForInput {
|
|
3
|
+
fields: Array<string>;
|
|
4
|
+
resolveUrl: string;
|
|
5
|
+
metadataMap: Map<string, any>;
|
|
6
|
+
waitingFor?: AwaitParty;
|
|
7
|
+
constructor(fields?: Array<string>, resolveUrl?: string, metadataMap?: Map<string, any>, waitingFor?: AwaitParty);
|
|
8
|
+
}
|
|
9
|
+
type SerializedWaitForInput = {
|
|
10
|
+
fields: Array<string>;
|
|
11
|
+
resolveUrl: string;
|
|
12
|
+
metadataMap: Record<string, any>;
|
|
13
|
+
waitingFor?: AwaitParty;
|
|
14
|
+
};
|
|
15
|
+
declare const serializeWaitForInput: (wait: WaitForInput) => SerializedWaitForInput;
|
|
16
|
+
declare const deserializeWaitForInput: (serialized: SerializedWaitForInput) => WaitForInput;
|
|
17
|
+
export { WaitForInput, serializeWaitForInput, deserializeWaitForInput };
|
|
18
|
+
export type { SerializedWaitForInput, AwaitParty };
|
|
19
|
+
//# sourceMappingURL=WaitForInput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WaitForInput.d.ts","sourceRoot":"","sources":["../../../src/api/actions/WaitForInput.ts"],"names":[],"mappings":"AAAA,KAAK,UAAU,GAAG,OAAO,GAAG,iBAAiB,CAAC;AAM9C,cAAM,YAAY;IAEd,MAAM,EAAG,KAAK,CAAC,MAAM,CAAC,CAAC;IACvB,UAAU,EAAG,MAAM,CAAC;IACpB,WAAW,EAAG,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC/B,UAAU,CAAC,EAAG,UAAU,CAAC;IAEzB,YAAY,MAAM,GAAG,KAAK,CAAC,MAAM,CAAM,EAAE,UAAU,GAAG,MAAW,EACrD,WAAW,GAAG,GAAG,CAAC,MAAM,EAAE,GAAG,CAAa,EAAE,UAAU,CAAC,EAAG,UAAU,EAK/E;CAEJ;AAED,KAAK,sBAAsB,GAAG;IAC1B,MAAM,EAAG,KAAK,CAAC,MAAM,CAAC,CAAC;IACvB,UAAU,EAAG,MAAM,CAAC;IACpB,WAAW,EAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAClC,UAAU,CAAC,EAAG,UAAU,CAAC;CAC5B,CAAC;AAEF,QAAA,MAAM,qBAAqB,SAAW,YAAY,KAAI,sBAKpD,CAAC;AAEH,QAAA,MAAM,uBAAuB,eAAiB,sBAAsB,KAAI,YAEa,CAAC;AAEtF,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,CAAC;AACxE,YAAY,EAAE,sBAAsB,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/* What an Await is waiting for: which kind of party (a human or an external
|
|
2
|
+
system), the input fields it expects, a URL a client can send the user to in
|
|
3
|
+
order to provide them, and any extra metadata. A pure data class - it carries
|
|
4
|
+
no behaviour. */
|
|
5
|
+
class WaitForInput {
|
|
6
|
+
fields;
|
|
7
|
+
resolveUrl;
|
|
8
|
+
metadataMap;
|
|
9
|
+
waitingFor;
|
|
10
|
+
constructor(fields = [], resolveUrl = "", metadataMap = new Map(), waitingFor) {
|
|
11
|
+
this.fields = fields;
|
|
12
|
+
this.resolveUrl = resolveUrl;
|
|
13
|
+
this.metadataMap = metadataMap;
|
|
14
|
+
this.waitingFor = waitingFor;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
const serializeWaitForInput = (wait) => ({
|
|
18
|
+
fields: wait.fields,
|
|
19
|
+
resolveUrl: wait.resolveUrl,
|
|
20
|
+
metadataMap: Object.fromEntries(wait.metadataMap),
|
|
21
|
+
waitingFor: wait.waitingFor,
|
|
22
|
+
});
|
|
23
|
+
const deserializeWaitForInput = (serialized) => new WaitForInput(serialized.fields ?? [], serialized.resolveUrl ?? "", new Map(Object.entries(serialized.metadataMap ?? {})), serialized.waitingFor);
|
|
24
|
+
export { WaitForInput, serializeWaitForInput, deserializeWaitForInput };
|
|
25
|
+
//# sourceMappingURL=WaitForInput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WaitForInput.js","sourceRoot":"","sources":["../../../src/api/actions/WaitForInput.ts"],"names":[],"mappings":"AAEA;;;mBAGmB;AACnB,MAAM,YAAY;IAEd,MAAM,CAAiB;IACvB,UAAU,CAAU;IACpB,WAAW,CAAoB;IAC/B,UAAU,CAAe;IAEzB,YAAY,MAAM,GAAmB,EAAE,EAAE,UAAU,GAAY,EAAE,EACrD,WAAW,GAAsB,IAAI,GAAG,EAAE,EAAE,UAAwB;QAC5E,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IACjC,CAAC;CAEJ;AASD,MAAM,qBAAqB,GAAG,CAAC,IAAmB,EAA2B,EAAE,CAAC,CAAC;IAC7E,MAAM,EAAE,IAAI,CAAC,MAAM;IACnB,UAAU,EAAE,IAAI,CAAC,UAAU;IAC3B,WAAW,EAAE,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,WAAW,CAAC;IACjD,UAAU,EAAE,IAAI,CAAC,UAAU;CAC9B,CAAC,CAAC;AAEH,MAAM,uBAAuB,GAAG,CAAC,UAAmC,EAAiB,EAAE,CACnF,IAAI,YAAY,CAAC,UAAU,CAAC,MAAM,IAAI,EAAE,EAAE,UAAU,CAAC,UAAU,IAAI,EAAE,EACjE,IAAI,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,WAAW,IAAI,EAAE,CAAC,CAAC,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC;AAEtF,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Actor.d.ts","sourceRoot":"","sources":["../../../src/api/actors/Actor.ts"],"names":[],"mappings":"AAAA,KAAK,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;AAEvD,UAAU,KAAK;IAEX,IAAI,EAAG,SAAS,CAAC;IACjB,EAAE,EAAG,MAAM,CAAC;IACZ,KAAK,EAAG,KAAK,CAAC,MAAM,CAAC,CAAC;CAEzB;AAED,YAAY,EAAE,KAAK,EAAE,SAAS,EAAE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Actor.js","sourceRoot":"","sources":["../../../src/api/actors/Actor.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SystemActor.d.ts","sourceRoot":"","sources":["../../../src/api/actors/SystemActor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAE,SAAS,EAAC,MAAM,YAAY,CAAC;AAE5C,cAAM,WAAY,YAAW,KAAK;IAE9B,IAAI,EAAG,SAAS,CAAY;IAC5B,EAAE,SAAa;IACf,KAAK,WAAe;IAEpB,MAAM,CAAC,KAAK,cAAqB;CAEpC;AAED,OAAO,EAAE,WAAW,EAAE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SystemActor.js","sourceRoot":"","sources":["../../../src/api/actors/SystemActor.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW;IAEb,IAAI,GAAe,QAAQ,CAAC;IAC5B,EAAE,GAAG,SAAS,CAAC;IACf,KAAK,GAAG,CAAC,SAAS,CAAC,CAAC;IAEpB,MAAM,CAAC,KAAK,GAAG,IAAI,WAAW,EAAE,CAAC;CAEpC;AAED,OAAO,EAAE,WAAW,EAAE,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Actor } from "../Actor.js";
|
|
2
|
+
import { AgentRequest } from "./AgentRequest.js";
|
|
3
|
+
declare class Agent implements Actor {
|
|
4
|
+
readonly type: "AGENT";
|
|
5
|
+
readonly id: string;
|
|
6
|
+
readonly roles: Array<string>;
|
|
7
|
+
readonly client: Agent.Client;
|
|
8
|
+
constructor(id: string, roles: Array<string> | string, client: Agent.Client);
|
|
9
|
+
}
|
|
10
|
+
declare namespace Agent {
|
|
11
|
+
abstract class Client {
|
|
12
|
+
abstract generate(request: AgentRequest): Promise<Record<string, any>>;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
export { Agent };
|
|
16
|
+
//# sourceMappingURL=Agent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Agent.d.ts","sourceRoot":"","sources":["../../../../src/api/actors/agents/Agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAC,MAAM,aAAa,CAAC;AAClC,OAAO,EAAC,YAAY,EAAC,MAAM,mBAAmB,CAAC;AAK/C,cAAM,KAAM,YAAW,KAAK;IAExB,QAAQ,CAAC,IAAI,EAAG,OAAO,CAAU;IACjC,QAAQ,CAAC,EAAE,EAAG,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,EAAG,KAAK,CAAC,MAAM,CAAC,CAAC;IAC/B,QAAQ,CAAC,MAAM,EAAG,KAAK,CAAC,MAAM,CAAC;IAE/B,YAAY,EAAE,EAAG,MAAM,EAAE,KAAK,EAAG,KAAK,CAAC,MAAM,CAAC,GAAG,MAAM,EAAE,MAAM,EAAG,KAAK,CAAC,MAAM,EAI7E;CAEJ;AAED,kBAAU,KAAK,CAAC;IAEZ,eAAsB,MAAM;QAExB,QAAQ,CAAC,QAAQ,CAAC,OAAO,EAAG,YAAY,GAAI,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC;KAE5E;CAEJ;AAED,OAAO,EAAE,KAAK,EAAE,CAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/* An agent is a light actor: identity only, used for auditing and
|
|
2
|
+
authorization like any other actor. The functional model detail lives in
|
|
3
|
+
its Client collaborator, keeping the actor itself pure data. */
|
|
4
|
+
class Agent {
|
|
5
|
+
type = "AGENT";
|
|
6
|
+
id;
|
|
7
|
+
roles;
|
|
8
|
+
client;
|
|
9
|
+
constructor(id, roles, client) {
|
|
10
|
+
this.id = id;
|
|
11
|
+
this.roles = typeof roles === "string" ? [roles] : roles;
|
|
12
|
+
this.client = client;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
(function (Agent) {
|
|
16
|
+
class Client {
|
|
17
|
+
}
|
|
18
|
+
Agent.Client = Client;
|
|
19
|
+
})(Agent || (Agent = {}));
|
|
20
|
+
export { Agent };
|
|
21
|
+
//# sourceMappingURL=Agent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Agent.js","sourceRoot":"","sources":["../../../../src/api/actors/agents/Agent.ts"],"names":[],"mappings":"AAGA;;kEAEkE;AAClE,MAAM,KAAK;IAEE,IAAI,GAAG,OAAgB,CAAC;IACxB,EAAE,CAAU;IACZ,KAAK,CAAiB;IACtB,MAAM,CAAgB;IAE/B,YAAY,EAAW,EAAE,KAA8B,EAAE,MAAqB;QAC1E,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,KAAK,GAAG,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;QACzD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACzB,CAAC;CAEJ;AAED,WAAU,KAAK;IAEX,MAAsB,MAAM;KAI3B;IAJqB,MAAA,MAAM,SAI3B,CAAA;AAEL,CAAC,EARS,KAAK,KAAL,KAAK,QAQd;AAED,OAAO,EAAE,KAAK,EAAE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AgentMessage.d.ts","sourceRoot":"","sources":["../../../../src/api/actors/agents/AgentMessage.ts"],"names":[],"mappings":"AAAA,KAAK,YAAY,GAAG;IAEhB,IAAI,EAAG,QAAQ,GAAG,MAAM,GAAG,WAAW,CAAC;IACvC,OAAO,EAAG,MAAM,CAAC;CAEpB,CAAC;AAEF,YAAY,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AgentMessage.js","sourceRoot":"","sources":["../../../../src/api/actors/agents/AgentMessage.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AgentRequest.d.ts","sourceRoot":"","sources":["../../../../src/api/actors/agents/AgentRequest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,mBAAmB,CAAC;AAE/C,KAAK,YAAY,GAAG;IAEhB,QAAQ,EAAG,KAAK,CAAC,YAAY,CAAC,CAAC;IAC/B,YAAY,EAAG,MAAM,CAAC;CAEzB,CAAC;AAEF,YAAY,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AgentRequest.js","sourceRoot":"","sources":["../../../../src/api/actors/agents/AgentRequest.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Actor } from "../actors/Actor.js";
|
|
2
|
+
interface Auditor {
|
|
3
|
+
audit(appId: string | undefined, resourceType: string, resourceId: string, actor: Actor, interaction: Array<string>, description: string, details: any): Promise<void>;
|
|
4
|
+
}
|
|
5
|
+
export { Auditor };
|
|
6
|
+
//# sourceMappingURL=Auditor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Auditor.d.ts","sourceRoot":"","sources":["../../../src/api/auditing/Auditor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAC,MAAM,oBAAoB,CAAC;AAKzC,UAAU,OAAO;IAEb,KAAK,CAAC,KAAK,EAAG,MAAM,GAAG,SAAS,EAAE,YAAY,EAAG,MAAM,EAAE,UAAU,EAAG,MAAM,EAAE,KAAK,EAAG,KAAK,EACrF,WAAW,EAAG,KAAK,CAAC,MAAM,CAAC,EAAE,WAAW,EAAG,MAAM,EAAE,OAAO,EAAG,GAAG,GAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAE3F;AAED,OAAO,EAAE,OAAO,EAAE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Auditor.js","sourceRoot":"","sources":["../../../src/api/auditing/Auditor.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Actor } from "../actors/Actor.js";
|
|
2
|
+
import { Auditor } from "./Auditor.js";
|
|
3
|
+
declare class NoOpAuditor implements Auditor {
|
|
4
|
+
audit(_appId: string | undefined, _resourceType: string, _resourceId: string, _actor: Actor, _interaction: Array<string>, _description: string, _details: any): Promise<void>;
|
|
5
|
+
}
|
|
6
|
+
export { NoOpAuditor };
|
|
7
|
+
//# sourceMappingURL=NoOpAuditor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NoOpAuditor.d.ts","sourceRoot":"","sources":["../../../src/api/auditing/NoOpAuditor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAC,MAAM,oBAAoB,CAAC;AACzC,OAAO,EAAC,OAAO,EAAC,MAAM,cAAc,CAAC;AAKrC,cAAM,WAAY,YAAW,OAAO;IAE1B,KAAK,CAAC,MAAM,EAAG,MAAM,GAAG,SAAS,EAAE,aAAa,EAAG,MAAM,EAAE,WAAW,EAAG,MAAM,EAAE,MAAM,EAAG,KAAK,EACzF,YAAY,EAAG,KAAK,CAAC,MAAM,CAAC,EAAE,YAAY,EAAG,MAAM,EAAE,QAAQ,EAAG,GAAG,GAAI,OAAO,CAAC,IAAI,CAAC,CAC/F;CAEJ;AAED,OAAO,EAAE,WAAW,EAAE,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/* An auditor that records nothing. Used by the persistence instances that sit
|
|
2
|
+
behind the HTTP API, where the app-facing store on the other side has
|
|
3
|
+
already audited the interaction. */
|
|
4
|
+
class NoOpAuditor {
|
|
5
|
+
async audit(_appId, _resourceType, _resourceId, _actor, _interaction, _description, _details) {
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
export { NoOpAuditor };
|
|
9
|
+
//# sourceMappingURL=NoOpAuditor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NoOpAuditor.js","sourceRoot":"","sources":["../../../src/api/auditing/NoOpAuditor.ts"],"names":[],"mappings":"AAGA;;sCAEsC;AACtC,MAAM,WAAW;IAEb,KAAK,CAAC,KAAK,CAAC,MAA2B,EAAE,aAAsB,EAAE,WAAoB,EAAE,MAAc,EACzF,YAA4B,EAAE,YAAqB,EAAE,QAAc;IAC/E,CAAC;CAEJ;AAED,OAAO,EAAE,WAAW,EAAE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppAware.d.ts","sourceRoot":"","sources":["../../../src/api/cloud/AppAware.ts"],"names":[],"mappings":"AAIA,UAAU,QAAQ;IACd,QAAQ,IAAK,MAAM,CAAC;CACvB;AAID,QAAA,MAAM,YAAY,QAAQ,MAA0C,CAAC;AAErE,OAAO,EAAE,YAAY,EAAE,CAAC;AACxB,YAAY,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// The current app's id from the environment, or "" when running outside a
|
|
2
|
+
// deployed app (locally). The single source for every AppAware implementation.
|
|
3
|
+
const currentAppId = () => process.env.ANBARIC_APP_ID ?? "";
|
|
4
|
+
export { currentAppId };
|
|
5
|
+
//# sourceMappingURL=AppAware.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppAware.js","sourceRoot":"","sources":["../../../src/api/cloud/AppAware.ts"],"names":[],"mappings":"AAQA,0EAA0E;AAC1E,+EAA+E;AAC/E,MAAM,YAAY,GAAG,GAAY,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,IAAI,EAAE,CAAC;AAErE,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
type AuditRecord = {
|
|
2
|
+
id?: string;
|
|
3
|
+
appId?: string;
|
|
4
|
+
resourceType: string;
|
|
5
|
+
resourceId: string;
|
|
6
|
+
actorId: string;
|
|
7
|
+
actorType: string;
|
|
8
|
+
interaction: Array<string>;
|
|
9
|
+
description: string;
|
|
10
|
+
details: any;
|
|
11
|
+
at?: string;
|
|
12
|
+
};
|
|
13
|
+
export type { AuditRecord };
|
|
14
|
+
//# sourceMappingURL=AuditRecord.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuditRecord.d.ts","sourceRoot":"","sources":["../../../src/api/cloud/AuditRecord.ts"],"names":[],"mappings":"AAAA,KAAK,WAAW,GAAG;IACf,EAAE,CAAC,EAAG,MAAM,CAAC;IACb,KAAK,CAAC,EAAG,MAAM,CAAC;IAChB,YAAY,EAAG,MAAM,CAAC;IACtB,UAAU,EAAG,MAAM,CAAC;IACpB,OAAO,EAAG,MAAM,CAAC;IACjB,SAAS,EAAG,MAAM,CAAC;IACnB,WAAW,EAAG,KAAK,CAAC,MAAM,CAAC,CAAC;IAC5B,WAAW,EAAG,MAAM,CAAC;IACrB,OAAO,EAAG,GAAG,CAAC;IACd,EAAE,CAAC,EAAG,MAAM,CAAC;CAChB,CAAC;AAEF,YAAY,EAAE,WAAW,EAAE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuditRecord.js","sourceRoot":"","sources":["../../../src/api/cloud/AuditRecord.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QueueMessage.d.ts","sourceRoot":"","sources":["../../../src/api/cloud/QueueMessage.ts"],"names":[],"mappings":"AAAA,KAAK,YAAY,GAAG;IAChB,KAAK,EAAG,MAAM,CAAC;IACf,KAAK,CAAC,EAAG,MAAM,CAAC;IAChB,UAAU,EAAG,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAG,MAAM,CAAC;CACtB,CAAC;AAEF,YAAY,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QueueMessage.js","sourceRoot":"","sources":["../../../src/api/cloud/QueueMessage.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { State } from "../states/State.js";
|
|
2
|
+
import { PropertyDefinition } from "../jobs/PropertyDefinition.js";
|
|
3
|
+
type WorkflowDefinition = {
|
|
4
|
+
appId?: string;
|
|
5
|
+
workflowId: string;
|
|
6
|
+
startState: string;
|
|
7
|
+
dataSchema: Array<{
|
|
8
|
+
id: string;
|
|
9
|
+
required: boolean;
|
|
10
|
+
}>;
|
|
11
|
+
states: Array<{
|
|
12
|
+
id: string;
|
|
13
|
+
isTerminal: boolean;
|
|
14
|
+
actions: Array<{
|
|
15
|
+
name: string;
|
|
16
|
+
description: string;
|
|
17
|
+
actor: {
|
|
18
|
+
id: string;
|
|
19
|
+
type: string;
|
|
20
|
+
roles: Array<string>;
|
|
21
|
+
};
|
|
22
|
+
}>;
|
|
23
|
+
transitions: Array<{
|
|
24
|
+
to: string;
|
|
25
|
+
}>;
|
|
26
|
+
}>;
|
|
27
|
+
};
|
|
28
|
+
declare namespace WorkflowDefinition {
|
|
29
|
+
const describe: (appId: string | undefined, workflowId: string, startState: string, states: Array<State>, dataSchema: Array<PropertyDefinition>) => WorkflowDefinition;
|
|
30
|
+
}
|
|
31
|
+
export { WorkflowDefinition };
|
|
32
|
+
//# sourceMappingURL=WorkflowDefinition.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkflowDefinition.d.ts","sourceRoot":"","sources":["../../../src/api/cloud/WorkflowDefinition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAC,MAAM,oBAAoB,CAAC;AACzC,OAAO,EAAC,kBAAkB,EAAC,MAAM,+BAA+B,CAAC;AAQjE,KAAK,kBAAkB,GAAG;IAEtB,KAAK,CAAC,EAAG,MAAM,CAAC;IAChB,UAAU,EAAG,MAAM,CAAC;IACpB,UAAU,EAAG,MAAM,CAAC;IACpB,UAAU,EAAG,KAAK,CAAC;QAAE,EAAE,EAAG,MAAM,CAAC;QAAC,QAAQ,EAAG,OAAO,CAAA;KAAE,CAAC,CAAC;IACxD,MAAM,EAAG,KAAK,CAAC;QACX,EAAE,EAAG,MAAM,CAAC;QACZ,UAAU,EAAG,OAAO,CAAC;QACrB,OAAO,EAAG,KAAK,CAAC;YAAE,IAAI,EAAG,MAAM,CAAC;YAAC,WAAW,EAAG,MAAM,CAAC;YAAC,KAAK,EAAG;gBAAE,EAAE,EAAG,MAAM,CAAC;gBAAC,IAAI,EAAG,MAAM,CAAC;gBAAC,KAAK,EAAG,KAAK,CAAC,MAAM,CAAC,CAAA;aAAE,CAAA;SAAE,CAAC,CAAC;QACxH,WAAW,EAAG,KAAK,CAAC;YAAE,EAAE,EAAG,MAAM,CAAA;SAAE,CAAC,CAAC;KACxC,CAAC,CAAC;CAEN,CAAC;AAEF,kBAAU,kBAAkB,CAAC;IAElB,MAAM,QAAQ,UAAY,MAAM,GAAG,SAAS,cAAe,MAAM,cAAe,MAAM,UAC3D,KAAK,CAAC,KAAK,CAAC,cAAe,KAAK,CAAC,kBAAkB,CAAC,KAAI,kBAiBxF,CAAC;CAEN;AAED,OAAO,EAAE,kBAAkB,EAAE,CAAA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Await } from "../actions/Await.js";
|
|
2
|
+
var WorkflowDefinition;
|
|
3
|
+
(function (WorkflowDefinition) {
|
|
4
|
+
WorkflowDefinition.describe = (appId, workflowId, startState, states, dataSchema) => ({
|
|
5
|
+
appId,
|
|
6
|
+
workflowId,
|
|
7
|
+
startState,
|
|
8
|
+
dataSchema: dataSchema.map(property => ({ id: property.id, required: property.required })),
|
|
9
|
+
states: states.map(state => ({
|
|
10
|
+
id: state.id,
|
|
11
|
+
isTerminal: state.isTerminal,
|
|
12
|
+
actions: state.actions
|
|
13
|
+
.filter((action) => !(action instanceof Await))
|
|
14
|
+
.map(action => ({
|
|
15
|
+
name: action.name,
|
|
16
|
+
description: action.description,
|
|
17
|
+
actor: { id: action.actor.id, type: action.actor.type, roles: action.actor.roles },
|
|
18
|
+
})),
|
|
19
|
+
transitions: state.transitions.map(transition => ({ to: transition.to })),
|
|
20
|
+
})),
|
|
21
|
+
});
|
|
22
|
+
})(WorkflowDefinition || (WorkflowDefinition = {}));
|
|
23
|
+
export { WorkflowDefinition };
|
|
24
|
+
//# sourceMappingURL=WorkflowDefinition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkflowDefinition.js","sourceRoot":"","sources":["../../../src/api/cloud/WorkflowDefinition.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,KAAK,EAAC,MAAM,qBAAqB,CAAC;AAsB1C,IAAU,kBAAkB,CAsB3B;AAtBD,WAAU,kBAAkB;IAEX,2BAAQ,GAAG,CAAC,KAA0B,EAAE,UAAmB,EAAE,UAAmB,EACpE,MAAqB,EAAE,UAAsC,EAAuB,EAAE,CAAC,CAAC;QAC7G,KAAK;QACL,UAAU;QACV,UAAU;QACV,UAAU,EAAE,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,QAAQ,CAAC,EAAE,EAAE,QAAQ,EAAE,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC1F,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;YACzB,EAAE,EAAE,KAAK,CAAC,EAAE;YACZ,UAAU,EAAE,KAAK,CAAC,UAAU;YAC5B,OAAO,EAAE,KAAK,CAAC,OAAO;iBACjB,MAAM,CAAC,CAAC,MAAM,EAA4C,EAAE,CAAC,CAAE,CAAC,MAAM,YAAY,KAAK,CAAC,CAAC;iBACzF,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;gBACZ,IAAI,EAAE,MAAM,CAAC,IAAI;gBACjB,WAAW,EAAE,MAAM,CAAC,WAAW;gBAC/B,KAAK,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE;aACrF,CAAC,CAAC;YACP,WAAW,EAAE,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,UAAU,CAAC,EAAE,EAAE,CAAC,CAAC;SAC5E,CAAC,CAAC;KACN,CAAC,CAAC;AAEP,CAAC,EAtBS,kBAAkB,KAAlB,kBAAkB,QAsB3B;AAED,OAAO,EAAE,kBAAkB,EAAE,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
type JsonSchema = {
|
|
2
|
+
type?: "object" | "array" | "string" | "number" | "integer" | "boolean" | "null";
|
|
3
|
+
properties?: Record<string, JsonSchema>;
|
|
4
|
+
required?: Array<string>;
|
|
5
|
+
items?: JsonSchema;
|
|
6
|
+
enum?: Array<any>;
|
|
7
|
+
};
|
|
8
|
+
declare const validateDocument: (document: any, schema: JsonSchema, path?: string) => Array<string>;
|
|
9
|
+
export { validateDocument };
|
|
10
|
+
export type { JsonSchema };
|
|
11
|
+
//# sourceMappingURL=JsonSchema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"JsonSchema.d.ts","sourceRoot":"","sources":["../../../src/api/documents/JsonSchema.ts"],"names":[],"mappings":"AAAA,KAAK,UAAU,GAAG;IACd,IAAI,CAAC,EAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,CAAC;IAClF,UAAU,CAAC,EAAG,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACzC,QAAQ,CAAC,EAAG,KAAK,CAAC,MAAM,CAAC,CAAC;IAC1B,KAAK,CAAC,EAAG,UAAU,CAAC;IACpB,IAAI,CAAC,EAAG,KAAK,CAAC,GAAG,CAAC,CAAC;CACtB,CAAC;AAgBF,QAAA,MAAM,gBAAgB,aAAe,GAAG,UAAW,UAAU,SAAS,MAAM,KAAU,KAAK,CAAC,MAAM,CA2BjG,CAAC;AAEF,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAC5B,YAAY,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
const jsonTypeOf = (value) => {
|
|
2
|
+
if (value === null)
|
|
3
|
+
return "null";
|
|
4
|
+
if (Array.isArray(value))
|
|
5
|
+
return "array";
|
|
6
|
+
if (typeof value === "number")
|
|
7
|
+
return Number.isInteger(value) ? "integer" : "number";
|
|
8
|
+
return typeof value;
|
|
9
|
+
};
|
|
10
|
+
const matchesType = (value, expected) => {
|
|
11
|
+
const actual = jsonTypeOf(value);
|
|
12
|
+
return expected === "number" ? actual === "number" || actual === "integer" : actual === expected;
|
|
13
|
+
};
|
|
14
|
+
const isPlainObject = (value) => jsonTypeOf(value) === "object";
|
|
15
|
+
const validateDocument = (document, schema, path = "$") => {
|
|
16
|
+
const violations = [];
|
|
17
|
+
if (schema.type && !matchesType(document, schema.type)) {
|
|
18
|
+
violations.push(`${path} should be ${schema.type} but was ${jsonTypeOf(document)}`);
|
|
19
|
+
return violations;
|
|
20
|
+
}
|
|
21
|
+
if (schema.enum && !schema.enum.some(allowed => JSON.stringify(allowed) === JSON.stringify(document))) {
|
|
22
|
+
violations.push(`${path} must be one of ${JSON.stringify(schema.enum)}`);
|
|
23
|
+
}
|
|
24
|
+
if (isPlainObject(document)) {
|
|
25
|
+
for (const key of schema.required ?? []) {
|
|
26
|
+
if (!(key in document))
|
|
27
|
+
violations.push(`${path}.${key} is required`);
|
|
28
|
+
}
|
|
29
|
+
for (const [key, propertySchema] of Object.entries(schema.properties ?? {})) {
|
|
30
|
+
if (key in document)
|
|
31
|
+
violations.push(...validateDocument(document[key], propertySchema, `${path}.${key}`));
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
if (Array.isArray(document) && schema.items) {
|
|
35
|
+
document.forEach((item, index) => violations.push(...validateDocument(item, schema.items, `${path}[${index}]`)));
|
|
36
|
+
}
|
|
37
|
+
return violations;
|
|
38
|
+
};
|
|
39
|
+
export { validateDocument };
|
|
40
|
+
//# sourceMappingURL=JsonSchema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"JsonSchema.js","sourceRoot":"","sources":["../../../src/api/documents/JsonSchema.ts"],"names":[],"mappings":"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"}
|