@nocobase/plugin-workflow-sql 1.0.0-alpha.1 → 1.0.0-alpha.11

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.
@@ -1,3 +1,11 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
1
9
  import { Instruction, WorkflowVariableRawTextArea } from '@nocobase/plugin-workflow/client';
2
10
  import React from 'react';
3
11
  export default class extends Instruction {
@@ -1,3 +1,11 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
1
9
  import { Plugin } from '@nocobase/client';
2
10
  export default class extends Plugin {
3
11
  afterAdd(): Promise<void>;
@@ -1,3 +1,12 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
1
10
  (function(e,o){typeof exports=="object"&&typeof module!="undefined"?o(exports,require("@nocobase/client"),require("react/jsx-runtime"),require("@nocobase/plugin-workflow/client"),require("react-i18next")):typeof define=="function"&&define.amd?define(["exports","@nocobase/client","react/jsx-runtime","@nocobase/plugin-workflow/client","react-i18next"],o):(e=typeof globalThis!="undefined"?globalThis:e||self,o(e["@nocobase/plugin-workflow-sql"]={},e["@nocobase/client"],e.jsxRuntime,e["@nocobase/plugin-workflow"],e["react-i18next"]))})(this,function(e,o,t,a,l){"use strict";var m=Object.defineProperty;var x=(e,o,t)=>o in e?m(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t;var r=(e,o,t)=>(x(e,typeof o!="symbol"?o+"":o,t),t);var d=(e,o,t)=>new Promise((a,l)=>{var s=n=>{try{i(t.next(n))}catch(c){l(c)}},p=n=>{try{i(t.throw(n))}catch(c){l(c)}},i=n=>n.done?a(n.value):Promise.resolve(n.value).then(s,p);i((t=t.apply(e,o)).next())});const s="@nocobase/plugin-workflow-sql";class p extends a.Instruction{constructor(){super(...arguments);r(this,"title",`{{t("SQL action", { ns: "${s}" })}}`);r(this,"type","sql");r(this,"group","collection");r(this,"description",`{{t("Execute a SQL statement in database.", { ns: "${s}" })}}`);r(this,"fieldset",{dataSource:{type:"string",required:!0,title:'{{t("Data source")}}',description:`{{t("Select a data source to execute SQL.", { ns: "${s}" })}}`,"x-decorator":"FormItem","x-component":"DataSourceSelect","x-component-props":{className:"auto-width",filter(u){return u.options.isDBInstance||u.key===o.DEFAULT_DATA_SOURCE_KEY}},default:"main"},sql:{type:"string",required:!0,title:"SQL",description:"{{sqlDescription()}}","x-decorator":"FormItem","x-component":"WorkflowVariableRawTextArea","x-component-props":{rows:20,className:o.css`
2
11
  font-size: 80%;
3
12
  font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
@@ -1,10 +1,19 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
1
10
  module.exports = {
2
- "@nocobase/client": "1.0.0-alpha.1",
3
- "@nocobase/plugin-workflow": "1.0.0-alpha.1",
11
+ "@nocobase/client": "1.0.0-alpha.11",
12
+ "@nocobase/plugin-workflow": "1.0.0-alpha.11",
4
13
  "react": "18.2.0",
5
14
  "react-i18next": "11.18.6",
6
- "@nocobase/server": "1.0.0-alpha.1",
7
- "@nocobase/plugin-workflow-test": "1.0.0-alpha.1",
8
- "@nocobase/test": "1.0.0-alpha.1",
9
- "@nocobase/utils": "1.0.0-alpha.1"
15
+ "@nocobase/server": "1.0.0-alpha.11",
16
+ "@nocobase/plugin-workflow-test": "1.0.0-alpha.11",
17
+ "@nocobase/test": "1.0.0-alpha.11",
18
+ "@nocobase/utils": "1.0.0-alpha.11"
10
19
  };
package/dist/index.d.ts CHANGED
@@ -1,2 +1,10 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
1
9
  export * from './server';
2
10
  export { default } from './server';
package/dist/index.js CHANGED
@@ -1,3 +1,12 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
1
10
  var __create = Object.create;
2
11
  var __defProp = Object.defineProperty;
3
12
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -1,3 +1,11 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
1
9
  export declare const NAMESPACE = "@nocobase/plugin-workflow-sql";
2
10
  export declare function useLang(key: string, options?: {}): string;
3
11
  export declare function usePluginTranslation(options: any): import("react-i18next").UseTranslationResponse<"@nocobase/plugin-workflow-sql", undefined>;
@@ -1,3 +1,12 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
1
10
  var __defProp = Object.defineProperty;
2
11
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
12
  var __getOwnPropNames = Object.getOwnPropertyNames;
@@ -1,3 +1,11 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
1
9
  import { Plugin } from '@nocobase/server';
2
10
  export default class extends Plugin {
3
11
  load(): Promise<void>;
@@ -1,3 +1,12 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
1
10
  var __create = Object.create;
2
11
  var __defProp = Object.defineProperty;
3
12
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -1,3 +1,11 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
1
9
  import { Processor, Instruction, FlowNodeModel } from '@nocobase/plugin-workflow';
2
10
  export default class extends Instruction {
3
11
  run(node: FlowNodeModel, input: any, processor: Processor): Promise<{
@@ -1,3 +1,12 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
1
10
  var __defProp = Object.defineProperty;
2
11
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
12
  var __getOwnPropNames = Object.getOwnPropertyNames;
@@ -1 +1,9 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
1
9
  export { default } from './Plugin';
@@ -1,3 +1,12 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
1
10
  var __create = Object.create;
2
11
  var __defProp = Object.defineProperty;
3
12
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "displayName.zh-CN": "工作流:SQL 节点",
5
5
  "description": "Execute SQL statements in workflow.",
6
6
  "description.zh-CN": "可用于在工作流中对数据库执行任意 SQL 语句。",
7
- "version": "1.0.0-alpha.1",
7
+ "version": "1.0.0-alpha.11",
8
8
  "license": "AGPL-3.0",
9
9
  "main": "./dist/server/index.js",
10
10
  "homepage": "https://docs.nocobase.com/handbook/workflow-sql",
@@ -21,7 +21,7 @@
21
21
  "@nocobase/server": "1.x",
22
22
  "@nocobase/test": "1.x"
23
23
  },
24
- "gitHead": "c73b6d2032a6151fdfeebeb0ec923d766578c53c",
24
+ "gitHead": "00ffb260456e5a22701fd16c87112a92708d9dc1",
25
25
  "keywords": [
26
26
  "Workflow"
27
27
  ]
@@ -1,68 +0,0 @@
1
- import { DEFAULT_DATA_SOURCE_KEY, css } from '@nocobase/client';
2
-
3
- import { Instruction, WorkflowVariableRawTextArea, defaultFieldNames } from '@nocobase/plugin-workflow/client';
4
-
5
- import React from 'react';
6
- import { Trans } from 'react-i18next';
7
- import { NAMESPACE } from '../locale';
8
-
9
- export default class extends Instruction {
10
- title = `{{t("SQL action", { ns: "${NAMESPACE}" })}}`;
11
- type = 'sql';
12
- group = 'collection';
13
- description = `{{t("Execute a SQL statement in database.", { ns: "${NAMESPACE}" })}}`;
14
- fieldset = {
15
- dataSource: {
16
- type: 'string',
17
- required: true,
18
- title: `{{t("Data source")}}`,
19
- description: `{{t("Select a data source to execute SQL.", { ns: "${NAMESPACE}" })}}`,
20
- 'x-decorator': 'FormItem',
21
- 'x-component': 'DataSourceSelect',
22
- 'x-component-props': {
23
- className: 'auto-width',
24
- filter(item) {
25
- return item.options.isDBInstance || item.key === DEFAULT_DATA_SOURCE_KEY;
26
- },
27
- },
28
- default: 'main',
29
- },
30
- sql: {
31
- type: 'string',
32
- required: true,
33
- title: 'SQL',
34
- description: '{{sqlDescription()}}',
35
- 'x-decorator': 'FormItem',
36
- 'x-component': 'WorkflowVariableRawTextArea',
37
- 'x-component-props': {
38
- rows: 20,
39
- className: css`
40
- font-size: 80%;
41
- font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
42
- `,
43
- },
44
- },
45
- };
46
- scope = {
47
- sqlDescription() {
48
- return (
49
- <Trans ns={NAMESPACE}>
50
- {'SQL query result could be used through '}
51
- <a href="https://docs-cn.nocobase.com/handbook/workflow-json-query" target="_blank" rel="noreferrer">
52
- {'JSON query node'}
53
- </a>
54
- {' (Commercial plugin).'}
55
- </Trans>
56
- );
57
- },
58
- };
59
- components = {
60
- WorkflowVariableRawTextArea,
61
- };
62
- useVariables({ key, title }, { types, fieldNames = defaultFieldNames }) {
63
- return {
64
- [fieldNames.value]: key,
65
- [fieldNames.label]: title,
66
- };
67
- }
68
- }