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 @@
|
|
|
1
|
+
{"version":3,"file":"Queue.d.ts","sourceRoot":"","sources":["../../../src/api/state-machine/Queue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,0BAA0B,CAAC;AAEtD,UAAU,KAAK;IAEX,OAAO,CAAC,KAAK,EAAG,MAAM,EAAE,KAAK,EAAG,MAAM,GAAG,SAAS,EAAE,UAAU,EAAG,MAAM,GAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACzF,QAAQ,CAAC,KAAK,EAAG,MAAM,EAAE,KAAK,EAAG,MAAM,GAAG,SAAS,EAAE,UAAU,EAAG,MAAM,EAAE,GAAG,EAAG,IAAI,GAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAEzG;AAED,UAAU,OAAQ,SAAQ,KAAK;IAE3B,WAAW,IAAK,OAAO,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC;CAEhD;AAED,QAAA,MAAM,OAAO;IACT,QAAQ,QAAS,KAAK,GAAI,KAAK,IAAI,OAAO;CAG7C,CAAC;AAEF,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Queue.js","sourceRoot":"","sources":["../../../src/api/state-machine/Queue.ts"],"names":[],"mappings":"AAeA,MAAM,OAAO,GAAG;IACZ,QAAQ,CAAC,KAAa;QAClB,OAAO,aAAa,IAAI,KAAK,CAAC;IAClC,CAAC;CACJ,CAAC;AAEF,OAAO,EAAS,OAAO,EAAE,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Action } from "../actions/Action.js";
|
|
2
|
+
import { Await } from "../actions/Await.js";
|
|
3
|
+
import { Transition } from "../transitions/Transition.js";
|
|
4
|
+
declare class State {
|
|
5
|
+
readonly id: string;
|
|
6
|
+
actions: Array<Action | Await>;
|
|
7
|
+
transitions: Array<Transition>;
|
|
8
|
+
readonly isTerminal: boolean;
|
|
9
|
+
constructor(id: string, actions?: Array<Action | Await>, transitions?: Array<Transition>, isTerminal?: boolean);
|
|
10
|
+
subscribe(action: Action | Await): void;
|
|
11
|
+
}
|
|
12
|
+
export { State };
|
|
13
|
+
//# sourceMappingURL=State.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"State.d.ts","sourceRoot":"","sources":["../../../src/api/states/State.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAC,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAC,KAAK,EAAC,MAAM,qBAAqB,CAAC;AAC1C,OAAO,EAAC,UAAU,EAAC,MAAM,8BAA8B,CAAC;AAExD,cAAM,KAAK;IAEP,QAAQ,CAAC,EAAE,EAAG,MAAM,CAAC;IACrB,OAAO,EAAG,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC,CAAC;IAChC,WAAW,EAAG,KAAK,CAAC,UAAU,CAAC,CAAC;IAChC,QAAQ,CAAC,UAAU,EAAG,OAAO,CAAC;IAE9B,YAAY,EAAE,EAAG,MAAM,EAAE,OAAO,GAAG,KAAK,CAAC,MAAM,GAAG,KAAK,CAAM,EAAE,WAAW,GAAG,KAAK,CAAC,UAAU,CAAM,EAAE,UAAU,GAAG,OAAe,EAKhI;IAED,SAAS,CAAC,MAAM,EAAG,MAAM,GAAG,KAAK,GAAI,IAAI,CAExC;CAEJ;AAED,OAAO,EAAE,KAAK,EAAE,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
class State {
|
|
2
|
+
id;
|
|
3
|
+
actions;
|
|
4
|
+
transitions;
|
|
5
|
+
isTerminal;
|
|
6
|
+
constructor(id, actions = [], transitions = [], isTerminal = false) {
|
|
7
|
+
this.id = id;
|
|
8
|
+
this.actions = actions;
|
|
9
|
+
this.transitions = transitions;
|
|
10
|
+
this.isTerminal = isTerminal;
|
|
11
|
+
}
|
|
12
|
+
subscribe(action) {
|
|
13
|
+
this.actions.push(action);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
export { State };
|
|
17
|
+
//# sourceMappingURL=State.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"State.js","sourceRoot":"","sources":["../../../src/api/states/State.ts"],"names":[],"mappings":"AAIA,MAAM,KAAK;IAEE,EAAE,CAAU;IACrB,OAAO,CAAyB;IAChC,WAAW,CAAqB;IACvB,UAAU,CAAW;IAE9B,YAAY,EAAW,EAAE,OAAO,GAA2B,EAAE,EAAE,WAAW,GAAuB,EAAE,EAAE,UAAU,GAAa,KAAK;QAC7H,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IACjC,CAAC;IAED,SAAS,CAAC,MAAuB;QAC7B,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC9B,CAAC;CAEJ;AAED,OAAO,EAAE,KAAK,EAAE,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { State } from "./State.js";
|
|
2
|
+
declare class Terminal extends State {
|
|
3
|
+
readonly outcome: Terminal.Outcome;
|
|
4
|
+
constructor(id: string, outcome: Terminal.Outcome);
|
|
5
|
+
}
|
|
6
|
+
declare namespace Terminal {
|
|
7
|
+
enum Outcome {
|
|
8
|
+
SUCCESS = "SUCCESS",
|
|
9
|
+
FAILURE = "FAILURE"
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
export { Terminal };
|
|
13
|
+
//# sourceMappingURL=Terminal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Terminal.d.ts","sourceRoot":"","sources":["../../../src/api/states/Terminal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAC,MAAM,YAAY,CAAC;AAIjC,cAAM,QAAS,SAAQ,KAAK;IAExB,QAAQ,CAAC,OAAO,EAAG,QAAQ,CAAC,OAAO,CAAC;IAEpC,YAAY,EAAE,EAAG,MAAM,EAAE,OAAO,EAAG,QAAQ,CAAC,OAAO,EAGlD;CAEJ;AAED,kBAAU,QAAQ,CAAC;IAEf,KAAY,OAAO;QACf,OAAO,YAAY;QACnB,OAAO,YAAY;KACtB;CAEJ;AAED,OAAO,EAAE,QAAQ,EAAE,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { State } from "./State.js";
|
|
2
|
+
/* An end state: a job that reaches a Terminal stops progressing and is never
|
|
3
|
+
re-enqueued. The outcome records whether the workflow succeeded or failed. */
|
|
4
|
+
class Terminal extends State {
|
|
5
|
+
outcome;
|
|
6
|
+
constructor(id, outcome) {
|
|
7
|
+
super(id, [], [], true);
|
|
8
|
+
this.outcome = outcome;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
(function (Terminal) {
|
|
12
|
+
let Outcome;
|
|
13
|
+
(function (Outcome) {
|
|
14
|
+
Outcome["SUCCESS"] = "SUCCESS";
|
|
15
|
+
Outcome["FAILURE"] = "FAILURE";
|
|
16
|
+
})(Outcome = Terminal.Outcome || (Terminal.Outcome = {}));
|
|
17
|
+
})(Terminal || (Terminal = {}));
|
|
18
|
+
export { Terminal };
|
|
19
|
+
//# sourceMappingURL=Terminal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Terminal.js","sourceRoot":"","sources":["../../../src/api/states/Terminal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAC,MAAM,YAAY,CAAC;AAEjC;gFACgF;AAChF,MAAM,QAAS,SAAQ,KAAK;IAEf,OAAO,CAAoB;IAEpC,YAAY,EAAW,EAAE,OAA0B;QAC/C,KAAK,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;QACxB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IAC3B,CAAC;CAEJ;AAED,WAAU,QAAQ;IAEd,IAAY,OAGX;IAHD,WAAY,OAAO;QACf,8BAAmB,CAAA;QACnB,8BAAmB,CAAA;IACvB,CAAC,EAHW,OAAO,GAAP,SAAA,OAAO,KAAP,SAAA,OAAO,QAGlB;AAEL,CAAC,EAPS,QAAQ,KAAR,QAAQ,QAOjB;AAED,OAAO,EAAE,QAAQ,EAAE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Transition.d.ts","sourceRoot":"","sources":["../../../src/api/transitions/Transition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,gBAAgB,CAAC;AAEnC,cAAM,UAAU;IACZ,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,OAAO,CAAC;IAEjC,YAAY,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,OAAO,EAGvD;CACJ;AAED,OAAO,EAAE,UAAU,EAAE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Transition.js","sourceRoot":"","sources":["../../../src/api/transitions/Transition.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU;IACZ,EAAE,CAAS;IACX,SAAS,CAAwB;IAEjC,YAAY,EAAU,EAAE,SAAgC;QACpD,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC/B,CAAC;CACJ;AAED,OAAO,EAAE,UAAU,EAAE,CAAA"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export * from "./api/jobs/Job.js";
|
|
2
|
+
export * from "./api/jobs/JobPersistence.js";
|
|
3
|
+
export * from "./api/jobs/JobSerialization.js";
|
|
4
|
+
export * from "./api/jobs/PropertyDefinition.js";
|
|
5
|
+
export * from "./api/states/State.js";
|
|
6
|
+
export * from "./api/states/Terminal.js";
|
|
7
|
+
export * from "./api/actions/Action.js";
|
|
8
|
+
export * from "./api/actions/Await.js";
|
|
9
|
+
export * from "./api/actions/WaitForInput.js";
|
|
10
|
+
export * from "./api/actions/AgenticAction.js";
|
|
11
|
+
export * from "./api/actors/agents/AgentMessage.js";
|
|
12
|
+
export * from "./api/actors/agents/AgentRequest.js";
|
|
13
|
+
export * from "./api/actors/agents/Agent.js";
|
|
14
|
+
export * from "./api/auditing/Auditor.js";
|
|
15
|
+
export * from "./api/auditing/NoOpAuditor.js";
|
|
16
|
+
export * from "./api/transitions/Transition.js";
|
|
17
|
+
export * from "./api/actors/Actor.js";
|
|
18
|
+
export * from "./api/actors/SystemActor.js";
|
|
19
|
+
export * from "./api/sessions/SessionResolver.js";
|
|
20
|
+
export * from "./api/documents/JsonStore.js";
|
|
21
|
+
export * from "./api/secrets/SecretStore.js";
|
|
22
|
+
export * from "./api/sql/SqlStore.js";
|
|
23
|
+
export * from "./api/documents/JsonSchema.js";
|
|
24
|
+
export * from "./api/state-machine/Queue.js";
|
|
25
|
+
export * from "./api/state-machine/Consumer.js";
|
|
26
|
+
export * from "./api/cloud/QueueMessage.js";
|
|
27
|
+
export * from "./api/cloud/WorkflowDefinition.js";
|
|
28
|
+
export * from "./api/cloud/AuditRecord.js";
|
|
29
|
+
export * from "./api/cloud/AppAware.js";
|
|
30
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,gCAAgC,CAAA;AAC9C,cAAc,kCAAkC,CAAA;AAChD,cAAc,uBAAuB,CAAA;AACrC,cAAc,0BAA0B,CAAA;AACxC,cAAc,yBAAyB,CAAA;AACvC,cAAc,wBAAwB,CAAA;AACtC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,gCAAgC,CAAA;AAC9C,cAAc,qCAAqC,CAAA;AACnD,cAAc,qCAAqC,CAAA;AACnD,cAAc,8BAA8B,CAAA;AAC5C,cAAc,2BAA2B,CAAA;AACzC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,iCAAiC,CAAA;AAC/C,cAAc,uBAAuB,CAAA;AACrC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,mCAAmC,CAAA;AACjD,cAAc,8BAA8B,CAAA;AAC5C,cAAc,8BAA8B,CAAA;AAC5C,cAAc,uBAAuB,CAAA;AACrC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,8BAA8B,CAAA;AAC5C,cAAc,iCAAiC,CAAA;AAC/C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,mCAAmC,CAAA;AACjD,cAAc,4BAA4B,CAAA;AAC1C,cAAc,yBAAyB,CAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export * from "./api/jobs/Job.js";
|
|
2
|
+
export * from "./api/jobs/JobPersistence.js";
|
|
3
|
+
export * from "./api/jobs/JobSerialization.js";
|
|
4
|
+
export * from "./api/jobs/PropertyDefinition.js";
|
|
5
|
+
export * from "./api/states/State.js";
|
|
6
|
+
export * from "./api/states/Terminal.js";
|
|
7
|
+
export * from "./api/actions/Action.js";
|
|
8
|
+
export * from "./api/actions/Await.js";
|
|
9
|
+
export * from "./api/actions/WaitForInput.js";
|
|
10
|
+
export * from "./api/actions/AgenticAction.js";
|
|
11
|
+
export * from "./api/actors/agents/AgentMessage.js";
|
|
12
|
+
export * from "./api/actors/agents/AgentRequest.js";
|
|
13
|
+
export * from "./api/actors/agents/Agent.js";
|
|
14
|
+
export * from "./api/auditing/Auditor.js";
|
|
15
|
+
export * from "./api/auditing/NoOpAuditor.js";
|
|
16
|
+
export * from "./api/transitions/Transition.js";
|
|
17
|
+
export * from "./api/actors/Actor.js";
|
|
18
|
+
export * from "./api/actors/SystemActor.js";
|
|
19
|
+
export * from "./api/sessions/SessionResolver.js";
|
|
20
|
+
export * from "./api/documents/JsonStore.js";
|
|
21
|
+
export * from "./api/secrets/SecretStore.js";
|
|
22
|
+
export * from "./api/sql/SqlStore.js";
|
|
23
|
+
export * from "./api/documents/JsonSchema.js";
|
|
24
|
+
export * from "./api/state-machine/Queue.js";
|
|
25
|
+
export * from "./api/state-machine/Consumer.js";
|
|
26
|
+
export * from "./api/cloud/QueueMessage.js";
|
|
27
|
+
export * from "./api/cloud/WorkflowDefinition.js";
|
|
28
|
+
export * from "./api/cloud/AuditRecord.js";
|
|
29
|
+
export * from "./api/cloud/AppAware.js";
|
|
30
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,gCAAgC,CAAA;AAC9C,cAAc,kCAAkC,CAAA;AAChD,cAAc,uBAAuB,CAAA;AACrC,cAAc,0BAA0B,CAAA;AACxC,cAAc,yBAAyB,CAAA;AACvC,cAAc,wBAAwB,CAAA;AACtC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,gCAAgC,CAAA;AAC9C,cAAc,qCAAqC,CAAA;AACnD,cAAc,qCAAqC,CAAA;AACnD,cAAc,8BAA8B,CAAA;AAC5C,cAAc,2BAA2B,CAAA;AACzC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,iCAAiC,CAAA;AAC/C,cAAc,uBAAuB,CAAA;AACrC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,mCAAmC,CAAA;AACjD,cAAc,8BAA8B,CAAA;AAC5C,cAAc,8BAA8B,CAAA;AAC5C,cAAc,uBAAuB,CAAA;AACrC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,8BAA8B,CAAA;AAC5C,cAAc,iCAAiC,CAAA;AAC/C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,mCAAmC,CAAA;AACjD,cAAc,4BAA4B,CAAA;AAC1C,cAAc,yBAAyB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,20 +1,29 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "anbaric-tsapi",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.22.0",
|
|
4
4
|
"description": "These are the shared libraries - types, classes, etc - that both the public state-machine and hosting services share",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "chris@anbaric.ai",
|
|
7
7
|
"type": "module",
|
|
8
|
-
"main": "
|
|
9
|
-
"types": "
|
|
8
|
+
"main": "dist/index.js",
|
|
9
|
+
"types": "dist/index.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"default": "./dist/index.js"
|
|
14
|
+
},
|
|
15
|
+
"./package.json": "./package.json"
|
|
16
|
+
},
|
|
10
17
|
"scripts": {
|
|
11
|
-
"test": "vitest run"
|
|
18
|
+
"test": "vitest run",
|
|
19
|
+
"build": "tsc -b tsconfig.build.json",
|
|
20
|
+
"prepublishOnly": "npm run build"
|
|
12
21
|
},
|
|
13
22
|
"devDependencies": {
|
|
14
23
|
"@types/node": "^26.2.0",
|
|
15
24
|
"typescript": "^7.0.2"
|
|
16
25
|
},
|
|
17
26
|
"files": [
|
|
18
|
-
"
|
|
27
|
+
"dist"
|
|
19
28
|
]
|
|
20
29
|
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import {Actor} from "../actors/Actor";
|
|
2
|
-
import {Job} from "../jobs/Job";
|
|
3
|
-
|
|
4
|
-
type CodeRun = (job : Job) => Promise<Map<string, any>>;
|
|
5
|
-
|
|
6
|
-
class Action {
|
|
7
|
-
|
|
8
|
-
readonly id : string;
|
|
9
|
-
name : string;
|
|
10
|
-
description : string;
|
|
11
|
-
actor : Actor;
|
|
12
|
-
|
|
13
|
-
constructor(name : string, actor : Actor, description : string = "", id : string = crypto.randomUUID()) {
|
|
14
|
-
this.name = name;
|
|
15
|
-
this.actor = actor;
|
|
16
|
-
this.description = description;
|
|
17
|
-
this.id = id;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
predicate = (_job : Job) => true;
|
|
21
|
-
run : CodeRun = async (_job : Job) => new Map();
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export { Action }
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import {Agent} from "../actors/agents/Agent";
|
|
2
|
-
import {AgentRequest} from "../actors/agents/AgentRequest";
|
|
3
|
-
import {Job} from "../jobs/Job";
|
|
4
|
-
import {Action} from "./Action";
|
|
5
|
-
|
|
6
|
-
/* An action whose properties are generated by an agent. run builds a request
|
|
7
|
-
from the job and hands it to the agent's client; the structured result
|
|
8
|
-
becomes the property map. Subclasses decide how the request is composed. */
|
|
9
|
-
abstract class AgenticAction extends Action {
|
|
10
|
-
|
|
11
|
-
protected agent : Agent;
|
|
12
|
-
|
|
13
|
-
constructor(name : string, agent : Agent, description : string = "", id? : string) {
|
|
14
|
-
super(name, agent, description, id);
|
|
15
|
-
this.agent = agent;
|
|
16
|
-
this.run = async (job : Job) =>
|
|
17
|
-
new Map(Object.entries(await this.agent.client.generate(this.requestFor(job))));
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
protected abstract requestFor(job : Job) : AgentRequest;
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export { AgenticAction }
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
type AwaitParty = "HUMAN" | "EXTERNAL_SYSTEM";
|
|
2
|
-
|
|
3
|
-
/* What an Await is waiting for: which kind of party (a human or an external
|
|
4
|
-
system), the input fields it expects, a URL a client can send the user to in
|
|
5
|
-
order to provide them, and any extra metadata. A pure data class - it carries
|
|
6
|
-
no behaviour. */
|
|
7
|
-
class WaitForInput {
|
|
8
|
-
|
|
9
|
-
fields : Array<string>;
|
|
10
|
-
resolveUrl : string;
|
|
11
|
-
metadataMap : Map<string, any>;
|
|
12
|
-
waitingFor? : AwaitParty;
|
|
13
|
-
|
|
14
|
-
constructor(fields : Array<string> = [], resolveUrl : string = "",
|
|
15
|
-
metadataMap : Map<string, any> = new Map(), waitingFor? : AwaitParty) {
|
|
16
|
-
this.fields = fields;
|
|
17
|
-
this.resolveUrl = resolveUrl;
|
|
18
|
-
this.metadataMap = metadataMap;
|
|
19
|
-
this.waitingFor = waitingFor;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
type SerializedWaitForInput = {
|
|
25
|
-
fields : Array<string>,
|
|
26
|
-
resolveUrl : string,
|
|
27
|
-
metadataMap : Record<string, any>,
|
|
28
|
-
waitingFor? : AwaitParty,
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
const serializeWaitForInput = (wait : WaitForInput) : SerializedWaitForInput => ({
|
|
32
|
-
fields: wait.fields,
|
|
33
|
-
resolveUrl: wait.resolveUrl,
|
|
34
|
-
metadataMap: Object.fromEntries(wait.metadataMap),
|
|
35
|
-
waitingFor: wait.waitingFor,
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
const deserializeWaitForInput = (serialized : SerializedWaitForInput) : WaitForInput =>
|
|
39
|
-
new WaitForInput(serialized.fields ?? [], serialized.resolveUrl ?? "",
|
|
40
|
-
new Map(Object.entries(serialized.metadataMap ?? {})), serialized.waitingFor);
|
|
41
|
-
|
|
42
|
-
export { WaitForInput, serializeWaitForInput, deserializeWaitForInput };
|
|
43
|
-
export type { SerializedWaitForInput, AwaitParty };
|
package/src/api/actors/Actor.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import {Actor} from "../Actor";
|
|
2
|
-
import {AgentRequest} from "./AgentRequest";
|
|
3
|
-
|
|
4
|
-
/* An agent is a light actor: identity only, used for auditing and
|
|
5
|
-
authorization like any other actor. The functional model detail lives in
|
|
6
|
-
its Client collaborator, keeping the actor itself pure data. */
|
|
7
|
-
class Agent implements Actor {
|
|
8
|
-
|
|
9
|
-
readonly type = "AGENT" as const;
|
|
10
|
-
readonly id : string;
|
|
11
|
-
readonly roles : Array<string>;
|
|
12
|
-
readonly client : Agent.Client;
|
|
13
|
-
|
|
14
|
-
constructor(id : string, roles : Array<string> | string, client : Agent.Client) {
|
|
15
|
-
this.id = id;
|
|
16
|
-
this.roles = typeof roles === "string" ? [roles] : roles;
|
|
17
|
-
this.client = client;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
namespace Agent {
|
|
23
|
-
|
|
24
|
-
export abstract class Client {
|
|
25
|
-
|
|
26
|
-
abstract generate(request : AgentRequest) : Promise<Record<string, any>>;
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export { Agent }
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import {Actor} from "../actors/Actor";
|
|
2
|
-
|
|
3
|
-
/* Records an interaction with a resource. The interaction is one or more plain
|
|
4
|
-
strings chosen by the persistence class that calls it - the auditor itself
|
|
5
|
-
defines no vocabulary. */
|
|
6
|
-
interface Auditor {
|
|
7
|
-
|
|
8
|
-
audit(appId : string | undefined, resourceType : string, resourceId : string, actor : Actor,
|
|
9
|
-
interaction : Array<string>, description : string, details : any) : Promise<void>;
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export { Auditor }
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import {Actor} from "../actors/Actor";
|
|
2
|
-
import {Auditor} from "./Auditor";
|
|
3
|
-
|
|
4
|
-
/* An auditor that records nothing. Used by the persistence instances that sit
|
|
5
|
-
behind the HTTP API, where the app-facing store on the other side has
|
|
6
|
-
already audited the interaction. */
|
|
7
|
-
class NoOpAuditor implements Auditor {
|
|
8
|
-
|
|
9
|
-
async audit(_appId : string | undefined, _resourceType : string, _resourceId : string, _actor : Actor,
|
|
10
|
-
_interaction : Array<string>, _description : string, _details : any) : Promise<void> {
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export { NoOpAuditor }
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/* A service that knows which deployed app it belongs to. The id always comes
|
|
2
|
-
from the environment (ANBARIC_APP_ID), never a constructor argument, so a
|
|
3
|
-
developer never has to supply it. Hosted services (the state machine, the
|
|
4
|
-
cloud/Postgres stores) implement this; purely local in-memory ones do not. */
|
|
5
|
-
interface AppAware {
|
|
6
|
-
getAppId() : string;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
// The current app's id from the environment, or "" when running outside a
|
|
10
|
-
// deployed app (locally). The single source for every AppAware implementation.
|
|
11
|
-
const currentAppId = () : string => process.env.ANBARIC_APP_ID ?? "";
|
|
12
|
-
|
|
13
|
-
export { currentAppId };
|
|
14
|
-
export type { AppAware };
|
|
@@ -1,14 +0,0 @@
|
|
|
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
|
-
|
|
14
|
-
export type { AuditRecord }
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import {State} from "../states/State";
|
|
2
|
-
import {PropertyDefinition} from "../jobs/PropertyDefinition";
|
|
3
|
-
import {Await} from "../actions/Await";
|
|
4
|
-
|
|
5
|
-
/* The serialisable graph of a state machine: its states, each state's actions
|
|
6
|
-
(identity only — the run/predicate bodies aren't persistable) and
|
|
7
|
-
transitions. Recorded as the details of an audit record when a state machine
|
|
8
|
-
initialises. Awaits are pause points rather than actors acting, so they are
|
|
9
|
-
not part of the graph - awaiting jobs are surfaced separately. */
|
|
10
|
-
type WorkflowDefinition = {
|
|
11
|
-
|
|
12
|
-
appId? : string,
|
|
13
|
-
workflowId : string,
|
|
14
|
-
startState : string,
|
|
15
|
-
dataSchema : Array<{ id : string, required : boolean }>,
|
|
16
|
-
states : Array<{
|
|
17
|
-
id : string,
|
|
18
|
-
isTerminal : boolean,
|
|
19
|
-
actions : Array<{ name : string, description : string, actor : { id : string, type : string, roles : Array<string> } }>,
|
|
20
|
-
transitions : Array<{ to : string }>,
|
|
21
|
-
}>,
|
|
22
|
-
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
namespace WorkflowDefinition {
|
|
26
|
-
|
|
27
|
-
export const describe = (appId : string | undefined, workflowId : string, startState : string,
|
|
28
|
-
states : Array<State>, dataSchema : Array<PropertyDefinition>) : WorkflowDefinition => ({
|
|
29
|
-
appId,
|
|
30
|
-
workflowId,
|
|
31
|
-
startState,
|
|
32
|
-
dataSchema: dataSchema.map(property => ({ id: property.id, required: property.required })),
|
|
33
|
-
states: states.map(state => ({
|
|
34
|
-
id: state.id,
|
|
35
|
-
isTerminal: state.isTerminal,
|
|
36
|
-
actions: state.actions
|
|
37
|
-
.filter((action) : action is Exclude<typeof action, Await> => ! (action instanceof Await))
|
|
38
|
-
.map(action => ({
|
|
39
|
-
name: action.name,
|
|
40
|
-
description: action.description,
|
|
41
|
-
actor: { id: action.actor.id, type: action.actor.type, roles: action.actor.roles },
|
|
42
|
-
})),
|
|
43
|
-
transitions: state.transitions.map(transition => ({ to: transition.to })),
|
|
44
|
-
})),
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export { WorkflowDefinition }
|
|
@@ -1,53 +0,0 @@
|
|
|
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
|
-
|
|
9
|
-
const jsonTypeOf = (value : any) : string => {
|
|
10
|
-
if (value === null) return "null";
|
|
11
|
-
if (Array.isArray(value)) return "array";
|
|
12
|
-
if (typeof value === "number") return Number.isInteger(value) ? "integer" : "number";
|
|
13
|
-
return typeof value;
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
const matchesType = (value : any, expected : string) : boolean => {
|
|
17
|
-
const actual = jsonTypeOf(value);
|
|
18
|
-
return expected === "number" ? actual === "number" || actual === "integer" : actual === expected;
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
const isPlainObject = (value : any) : boolean => jsonTypeOf(value) === "object";
|
|
22
|
-
|
|
23
|
-
const validateDocument = (document : any, schema : JsonSchema, path : string = "$") : Array<string> => {
|
|
24
|
-
const violations : Array<string> = [];
|
|
25
|
-
|
|
26
|
-
if (schema.type && !matchesType(document, schema.type)) {
|
|
27
|
-
violations.push(`${path} should be ${schema.type} but was ${jsonTypeOf(document)}`);
|
|
28
|
-
return violations;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
if (schema.enum && !schema.enum.some(allowed => JSON.stringify(allowed) === JSON.stringify(document))) {
|
|
32
|
-
violations.push(`${path} must be one of ${JSON.stringify(schema.enum)}`);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
if (isPlainObject(document)) {
|
|
36
|
-
for (const key of schema.required ?? []) {
|
|
37
|
-
if (!(key in document)) violations.push(`${path}.${key} is required`);
|
|
38
|
-
}
|
|
39
|
-
for (const [key, propertySchema] of Object.entries(schema.properties ?? {})) {
|
|
40
|
-
if (key in document) violations.push(...validateDocument(document[key], propertySchema, `${path}.${key}`));
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
if (Array.isArray(document) && schema.items) {
|
|
45
|
-
document.forEach((item, index) =>
|
|
46
|
-
violations.push(...validateDocument(item, schema.items!, `${path}[${index}]`)));
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
return violations;
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
export { validateDocument };
|
|
53
|
-
export type { JsonSchema };
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import {Actor} from "../actors/Actor";
|
|
2
|
-
import {Auditor} from "../auditing/Auditor";
|
|
3
|
-
import {currentAppId} from "../cloud/AppAware";
|
|
4
|
-
|
|
5
|
-
/* A schema-validated JSON document store that audits every interaction, keyed
|
|
6
|
-
by collection and id. Public methods audit then defer to ...Internal. */
|
|
7
|
-
abstract class JsonStore {
|
|
8
|
-
|
|
9
|
-
constructor(protected auditor : Auditor, protected collection : string = "documents") {
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
async create(actor : Actor, id : string, document : any) : Promise<void> {
|
|
13
|
-
await this.auditor.audit(currentAppId(), "document", `${this.collection}/${id}`, actor, [JsonStore.Interaction.CREATE], "Document created", document);
|
|
14
|
-
await this.saveInternal(id, document);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
async save(actor : Actor, changeDescription : string, id : string, document : any) : Promise<void> {
|
|
18
|
-
await this.auditor.audit(currentAppId(), "document", `${this.collection}/${id}`, actor, [JsonStore.Interaction.SAVE], changeDescription, document);
|
|
19
|
-
await this.saveInternal(id, document);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
async retrieve(id : string, actor : Actor) : Promise<any> {
|
|
23
|
-
await this.auditor.audit(currentAppId(), "document", `${this.collection}/${id}`, actor, [JsonStore.Interaction.READ], "", null);
|
|
24
|
-
return this.retrieveInternal(id);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
async delete(id : string, actor : Actor) : Promise<void> {
|
|
28
|
-
await this.auditor.audit(currentAppId(), "document", `${this.collection}/${id}`, actor, [JsonStore.Interaction.DELETE], "", null);
|
|
29
|
-
await this.deleteInternal(id);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
async list(actor : Actor, pageSize? : number, page? : number) : Promise<Array<any>> {
|
|
33
|
-
await this.auditor.audit(currentAppId(), "document", `${this.collection}/*`, actor, [JsonStore.Interaction.LIST], "", null);
|
|
34
|
-
return this.listInternal(pageSize, page);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
protected abstract saveInternal(id : string, document : any) : Promise<void>;
|
|
38
|
-
protected abstract retrieveInternal(id : string) : Promise<any>;
|
|
39
|
-
protected abstract deleteInternal(id : string) : Promise<void>;
|
|
40
|
-
protected abstract listInternal(pageSize? : number, page? : number) : Promise<Array<any>>;
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
namespace JsonStore {
|
|
45
|
-
|
|
46
|
-
export enum Interaction {
|
|
47
|
-
CREATE = "CREATE",
|
|
48
|
-
SAVE = "SAVE",
|
|
49
|
-
READ = "READ",
|
|
50
|
-
DELETE = "DELETE",
|
|
51
|
-
LIST = "LIST",
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export { JsonStore }
|