@uns-kit/temporal 0.0.7 → 0.0.8
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uns-kit/temporal",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.8",
|
|
4
4
|
"description": "Temporal.io integration plugin for UnsProxyProcess, wiring workflows into the UNS.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -22,13 +22,17 @@
|
|
|
22
22
|
"dist"
|
|
23
23
|
],
|
|
24
24
|
"exports": {
|
|
25
|
+
".": {
|
|
26
|
+
"types": "./dist/index.d.ts",
|
|
27
|
+
"import": "./dist/index.js"
|
|
28
|
+
},
|
|
25
29
|
"./*": "./dist/*"
|
|
26
30
|
},
|
|
27
31
|
"main": "dist/index.js",
|
|
28
32
|
"types": "dist/index.d.ts",
|
|
29
33
|
"dependencies": {
|
|
30
34
|
"@temporalio/client": "^1.13.0",
|
|
31
|
-
"@uns-kit/core": "0.0.
|
|
35
|
+
"@uns-kit/core": "0.0.20"
|
|
32
36
|
},
|
|
33
37
|
"scripts": {
|
|
34
38
|
"build": "tsc -p tsconfig.build.json",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/temporal-example.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Change this file according to your specifications and rename it to index.ts
|
|
3
|
-
*/
|
|
4
|
-
import UnsProxyProcess from "@uns-kit/core/uns/uns-proxy-process";
|
|
5
|
-
import unsTemporalPlugin from "./uns-temporal-plugin.js";
|
|
6
|
-
import { ConfigFile } from "@uns-kit/core/config-file";
|
|
7
|
-
import { UnsAttributeType } from "@uns-kit/core/graphql/schema";
|
|
8
|
-
import logger from "@uns-kit/core/logger";
|
|
9
|
-
/**
|
|
10
|
-
* Load the configuration from a file.
|
|
11
|
-
* On the server, this file is provided by the `uns-datahub-controller`.
|
|
12
|
-
* In the development environment, you are responsible for creating and maintaining this file and its contents.
|
|
13
|
-
*/
|
|
14
|
-
const config = await ConfigFile.loadConfig();
|
|
15
|
-
/**
|
|
16
|
-
* Connect to the temporal and register uns topic for temporal
|
|
17
|
-
*/
|
|
18
|
-
const unsProxyProcess = new UnsProxyProcess(config.infra.host, { processName: config.uns.processName });
|
|
19
|
-
unsTemporalPlugin;
|
|
20
|
-
const temporalTopic = {
|
|
21
|
-
attribute: "temporal-data",
|
|
22
|
-
topic: "sij/",
|
|
23
|
-
attributeType: UnsAttributeType.Data,
|
|
24
|
-
attributeNeedsPersistence: true,
|
|
25
|
-
dataGroup: "temporal",
|
|
26
|
-
description: "Temporal data example",
|
|
27
|
-
tags: ["temporal"],
|
|
28
|
-
};
|
|
29
|
-
const temporalProxy = await unsProxyProcess.createTemporalProxy("templateUnsTemporal", "temporal-1.sij.digital:7233", "hv");
|
|
30
|
-
await temporalProxy.initializeTemporalProxy(temporalTopic);
|
|
31
|
-
// Start temporal workflow
|
|
32
|
-
const result = await temporalProxy.startWorkflow("TransformHvSclData", { 'coil_id': "42" }, "ETL_HV_SCL_TASK_QUEUE");
|
|
33
|
-
logger.info(`Workflow result: ${JSON.stringify(result)}`);
|