arvo-core 1.1.22 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/ArvoOrchestrationSubject/index.d.ts +13 -0
- package/dist/ArvoOrchestrationSubject/index.js +14 -1
- package/dist/ArvoOrchestrationSubject/schema.d.ts +3 -0
- package/dist/ArvoOrchestrationSubject/schema.js +4 -0
- package/dist/ArvoOrchestrationSubject/type.d.ts +6 -0
- package/package.json +1 -1
@@ -16,6 +16,7 @@ export default class ArvoOrchestrationSubject {
|
|
16
16
|
* @param param.orchestator - Name identifier of the orchestrator
|
17
17
|
* @param param.version - Version of the orchestrator. If null, defaults to {@link WildCardMachineVersion}
|
18
18
|
* @param param.initiator - Identifier of the entity initiating the orchestration
|
19
|
+
* @param param.meta - Optional metadata key-value pairs for additional orchestration context
|
19
20
|
* @returns A base64 encoded string containing the compressed orchestration subject data
|
20
21
|
* @throws Error if the provided parameters result in invalid subject content
|
21
22
|
*
|
@@ -26,12 +27,24 @@ export default class ArvoOrchestrationSubject {
|
|
26
27
|
* version: "1.0.0",
|
27
28
|
* initiator: "systemA"
|
28
29
|
* });
|
30
|
+
*
|
31
|
+
* // With metadata
|
32
|
+
* const subjectWithMeta = ArvoOrchestrationSubject.new({
|
33
|
+
* orchestator: "com.company.mainProcess",
|
34
|
+
* version: "1.0.0",
|
35
|
+
* initiator: "com.company.systemA",
|
36
|
+
* meta: {
|
37
|
+
* priority: "high",
|
38
|
+
* environment: "production"
|
39
|
+
* }
|
40
|
+
* });
|
29
41
|
* ```
|
30
42
|
*/
|
31
43
|
static new(param: {
|
32
44
|
orchestator: string;
|
33
45
|
version: ArvoOrchestratorVersion | null;
|
34
46
|
initiator: string;
|
47
|
+
meta?: Record<string, string>;
|
35
48
|
}): string;
|
36
49
|
/**
|
37
50
|
* Creates an Arvo orchestration subject from detailed content parameters.
|
@@ -41,6 +41,7 @@ var ArvoOrchestrationSubject = /** @class */ (function () {
|
|
41
41
|
* @param param.orchestator - Name identifier of the orchestrator
|
42
42
|
* @param param.version - Version of the orchestrator. If null, defaults to {@link WildCardMachineVersion}
|
43
43
|
* @param param.initiator - Identifier of the entity initiating the orchestration
|
44
|
+
* @param param.meta - Optional metadata key-value pairs for additional orchestration context
|
44
45
|
* @returns A base64 encoded string containing the compressed orchestration subject data
|
45
46
|
* @throws Error if the provided parameters result in invalid subject content
|
46
47
|
*
|
@@ -51,10 +52,21 @@ var ArvoOrchestrationSubject = /** @class */ (function () {
|
|
51
52
|
* version: "1.0.0",
|
52
53
|
* initiator: "systemA"
|
53
54
|
* });
|
55
|
+
*
|
56
|
+
* // With metadata
|
57
|
+
* const subjectWithMeta = ArvoOrchestrationSubject.new({
|
58
|
+
* orchestator: "com.company.mainProcess",
|
59
|
+
* version: "1.0.0",
|
60
|
+
* initiator: "com.company.systemA",
|
61
|
+
* meta: {
|
62
|
+
* priority: "high",
|
63
|
+
* environment: "production"
|
64
|
+
* }
|
65
|
+
* });
|
54
66
|
* ```
|
55
67
|
*/
|
56
68
|
ArvoOrchestrationSubject.new = function (param) {
|
57
|
-
var _a;
|
69
|
+
var _a, _b;
|
58
70
|
return ArvoOrchestrationSubject.create({
|
59
71
|
orchestrator: {
|
60
72
|
name: param.orchestator,
|
@@ -64,6 +76,7 @@ var ArvoOrchestrationSubject = /** @class */ (function () {
|
|
64
76
|
id: (0, uuid_1.v4)(),
|
65
77
|
initiator: param.initiator,
|
66
78
|
},
|
79
|
+
meta: (_b = param.meta) !== null && _b !== void 0 ? _b : {}
|
67
80
|
});
|
68
81
|
};
|
69
82
|
/**
|
@@ -21,6 +21,7 @@ export declare const ArvoOrchestrationSubjectContentSchema: z.ZodObject<{
|
|
21
21
|
id: string;
|
22
22
|
initiator: string;
|
23
23
|
}>;
|
24
|
+
meta: z.ZodRecord<z.ZodString, z.ZodString>;
|
24
25
|
}, "strip", z.ZodTypeAny, {
|
25
26
|
orchestrator: {
|
26
27
|
name: string;
|
@@ -30,6 +31,7 @@ export declare const ArvoOrchestrationSubjectContentSchema: z.ZodObject<{
|
|
30
31
|
id: string;
|
31
32
|
initiator: string;
|
32
33
|
};
|
34
|
+
meta: Record<string, string>;
|
33
35
|
}, {
|
34
36
|
orchestrator: {
|
35
37
|
name: string;
|
@@ -39,4 +41,5 @@ export declare const ArvoOrchestrationSubjectContentSchema: z.ZodObject<{
|
|
39
41
|
id: string;
|
40
42
|
initiator: string;
|
41
43
|
};
|
44
|
+
meta: Record<string, string>;
|
42
45
|
}>;
|
@@ -2,6 +2,7 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.ArvoOrchestrationSubjectContentSchema = exports.ArvoOrchestratorVersionSchema = void 0;
|
4
4
|
var zod_1 = require("zod");
|
5
|
+
var utils_1 = require("../utils");
|
5
6
|
// Zod schema for ArvoOchestratorVersion
|
6
7
|
exports.ArvoOrchestratorVersionSchema = zod_1.z
|
7
8
|
.string()
|
@@ -35,5 +36,8 @@ exports.ArvoOrchestrationSubjectContentSchema = zod_1.z
|
|
35
36
|
.describe('Entity or process that initiated the execution'),
|
36
37
|
})
|
37
38
|
.describe('Details about the current execution'),
|
39
|
+
meta: zod_1.z
|
40
|
+
.record(zod_1.z.string(), zod_1.z.string())
|
41
|
+
.describe((0, utils_1.cleanString)("\n Additional metadata for the orchestration process. Store essential key-value pairs \n that provide context or configuration details necessary for the orchestration. \n Use selectively to maintain clarity and avoid storing unnecessary information. \n "))
|
38
42
|
})
|
39
43
|
.describe('Context information for Arvo orchestration');
|
@@ -62,4 +62,10 @@ export type ArvoOrchestrationSubjectContent = {
|
|
62
62
|
*/
|
63
63
|
initiator: string;
|
64
64
|
};
|
65
|
+
/**
|
66
|
+
* Additional metadata for the orchestration process. Store essential key-value pairs
|
67
|
+
* that provide context or configuration details necessary for the orchestration.
|
68
|
+
* Use selectively to maintain clarity and avoid storing unnecessary information.
|
69
|
+
*/
|
70
|
+
meta: Record<string, string>;
|
65
71
|
};
|