@redonvn/p03-erp-v1-workflow-engine-sdk 0.1.1
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/README.md +17 -0
- package/dist/index.d.mts +15 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +37 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +12 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +37 -0
package/README.md
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# @redonvn/p03-erp-v1-workflow-engine-sdk
|
|
2
|
+
|
|
3
|
+
SDK domain cho workflow engine trong Project03 ERP v1.
|
|
4
|
+
|
|
5
|
+
## Cài đặt
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @redonvn/p03-erp-v1-workflow-engine-sdk
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Sử dụng
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
import { createWorkflowRunInput } from "@redonvn/p03-erp-v1-workflow-engine-sdk";
|
|
15
|
+
|
|
16
|
+
const input = createWorkflowRunInput("invoice.approve", { invoiceId: "inv-001" }, "user-123");
|
|
17
|
+
```
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
type WorkflowRunStatus = "queued" | "running" | "succeeded" | "failed" | "cancelled";
|
|
2
|
+
interface WorkflowRunInput {
|
|
3
|
+
workflowKey: string;
|
|
4
|
+
payload?: Record<string, unknown>;
|
|
5
|
+
requestedBy?: string;
|
|
6
|
+
}
|
|
7
|
+
interface WorkflowRunResult {
|
|
8
|
+
runId: string;
|
|
9
|
+
status: WorkflowRunStatus;
|
|
10
|
+
startedAt?: string;
|
|
11
|
+
finishedAt?: string;
|
|
12
|
+
}
|
|
13
|
+
declare function createWorkflowRunInput(workflowKey: string, payload?: Record<string, unknown>, requestedBy?: string): WorkflowRunInput;
|
|
14
|
+
|
|
15
|
+
export { type WorkflowRunInput, type WorkflowRunResult, type WorkflowRunStatus, createWorkflowRunInput };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
type WorkflowRunStatus = "queued" | "running" | "succeeded" | "failed" | "cancelled";
|
|
2
|
+
interface WorkflowRunInput {
|
|
3
|
+
workflowKey: string;
|
|
4
|
+
payload?: Record<string, unknown>;
|
|
5
|
+
requestedBy?: string;
|
|
6
|
+
}
|
|
7
|
+
interface WorkflowRunResult {
|
|
8
|
+
runId: string;
|
|
9
|
+
status: WorkflowRunStatus;
|
|
10
|
+
startedAt?: string;
|
|
11
|
+
finishedAt?: string;
|
|
12
|
+
}
|
|
13
|
+
declare function createWorkflowRunInput(workflowKey: string, payload?: Record<string, unknown>, requestedBy?: string): WorkflowRunInput;
|
|
14
|
+
|
|
15
|
+
export { type WorkflowRunInput, type WorkflowRunResult, type WorkflowRunStatus, createWorkflowRunInput };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
|
+
createWorkflowRunInput: () => createWorkflowRunInput
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(index_exports);
|
|
26
|
+
function createWorkflowRunInput(workflowKey, payload, requestedBy) {
|
|
27
|
+
return {
|
|
28
|
+
workflowKey,
|
|
29
|
+
payload,
|
|
30
|
+
requestedBy
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
34
|
+
0 && (module.exports = {
|
|
35
|
+
createWorkflowRunInput
|
|
36
|
+
});
|
|
37
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export type WorkflowRunStatus = \"queued\" | \"running\" | \"succeeded\" | \"failed\" | \"cancelled\";\r\n\r\nexport interface WorkflowRunInput {\r\n workflowKey: string;\r\n payload?: Record<string, unknown>;\r\n requestedBy?: string;\r\n}\r\n\r\nexport interface WorkflowRunResult {\r\n runId: string;\r\n status: WorkflowRunStatus;\r\n startedAt?: string;\r\n finishedAt?: string;\r\n}\r\n\r\nexport function createWorkflowRunInput(\r\n workflowKey: string,\r\n payload?: Record<string, unknown>,\r\n requestedBy?: string\r\n): WorkflowRunInput {\r\n return {\r\n workflowKey,\r\n payload,\r\n requestedBy\r\n };\r\n}\r\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAeO,SAAS,uBACd,aACA,SACA,aACkB;AAClB,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":[]}
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export type WorkflowRunStatus = \"queued\" | \"running\" | \"succeeded\" | \"failed\" | \"cancelled\";\r\n\r\nexport interface WorkflowRunInput {\r\n workflowKey: string;\r\n payload?: Record<string, unknown>;\r\n requestedBy?: string;\r\n}\r\n\r\nexport interface WorkflowRunResult {\r\n runId: string;\r\n status: WorkflowRunStatus;\r\n startedAt?: string;\r\n finishedAt?: string;\r\n}\r\n\r\nexport function createWorkflowRunInput(\r\n workflowKey: string,\r\n payload?: Record<string, unknown>,\r\n requestedBy?: string\r\n): WorkflowRunInput {\r\n return {\r\n workflowKey,\r\n payload,\r\n requestedBy\r\n };\r\n}\r\n"],"mappings":";AAeO,SAAS,uBACd,aACA,SACA,aACkB;AAClB,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":[]}
|
package/package.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@redonvn/p03-erp-v1-workflow-engine-sdk",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Workflow engine SDK cho Project03 ERP v1",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"project03",
|
|
7
|
+
"erp",
|
|
8
|
+
"workflow",
|
|
9
|
+
"sdk"
|
|
10
|
+
],
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"author": "Redon",
|
|
13
|
+
"main": "dist/index.js",
|
|
14
|
+
"module": "dist/index.mjs",
|
|
15
|
+
"types": "dist/index.d.ts",
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./dist/index.d.ts",
|
|
19
|
+
"import": "./dist/index.mjs",
|
|
20
|
+
"require": "./dist/index.js"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"files": [
|
|
24
|
+
"dist"
|
|
25
|
+
],
|
|
26
|
+
"engines": {
|
|
27
|
+
"node": ">=18"
|
|
28
|
+
},
|
|
29
|
+
"publishConfig": {
|
|
30
|
+
"access": "public"
|
|
31
|
+
},
|
|
32
|
+
"scripts": {
|
|
33
|
+
"build": "tsup",
|
|
34
|
+
"clean": "tsup --clean",
|
|
35
|
+
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
36
|
+
}
|
|
37
|
+
}
|