alert-message-plugin-flow-requests 1.0.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/dist/bundle.js +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/jest.config.cjs +11 -0
- package/package.json +39 -0
- package/src/index.ts +42 -0
- package/tests/index.spec.ts +5 -0
- package/tsconfig.json +46 -0
- package/webpack.config.cjs +24 -0
package/dist/bundle.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.AlertMessage=t():e.AlertMessage=t()}(self,()=>(()=>{"use strict";var __webpack_modules__={191(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.LinkedList=t.Node=void 0;class s{value;next;constructor(e,t){this.value=e,this.next=t}}t.Node=s;class o{head;tail;constructor(){this.head=null,this.tail=null}add(e){if(!this.head)return this.head=new s(e,null),void(this.tail=null);if(!this.head.next){const t=new s(e,null);return this.head.next=t,void(this.tail=t)}const t=this.tail,o=new s(e,null);t&&(t.next=o),this.tail=o}show(){if(!this.head)return null;let e=this.head;for(;null!=e;)e=e.value instanceof o?e.value.head:e.next}}t.LinkedList=o},638(__unused_webpack_module,exports){Object.defineProperty(exports,"__esModule",{value:!0}),exports.NodeBase=void 0;class NodeBase{state;constructor(e){this.state=e}parseExpression(expression){const regex=/{{(.*?)}}/g,matches=expression.match(regex);return matches&&matches.forEach(match=>{const key=match.replace("{{","").replace("}}","");let value=eval(key);"object"==typeof value&&(value=JSON.stringify(value)),expression=expression.replace(match,value)}),expression}getConfig(){throw new Error("Method not implemented")}execute(e){throw new Error("Method not implemented")}}exports.NodeBase=NodeBase},882(e,t,s){Object.defineProperty(t,"__esModule",{value:!0}),t.Node=t.LinkedList=t.NodeBase=void 0;const o=s(638);Object.defineProperty(t,"NodeBase",{enumerable:!0,get:function(){return o.NodeBase}});const r=s(191);Object.defineProperty(t,"LinkedList",{enumerable:!0,get:function(){return r.LinkedList}}),Object.defineProperty(t,"Node",{enumerable:!0,get:function(){return r.Node}})}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var s=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e](s,s.exports,__webpack_require__),s.exports}var __webpack_exports__={};return(()=>{var e=__webpack_exports__;Object.defineProperty(e,"__esModule",{value:!0});const t=__webpack_require__(882);class s extends t.NodeBase{constructor(e){super(e)}getConfig(){return{name:"AlertMessage",type:"AlertMessage",description:"Show alert message when execute the node",properties:[{label:"Message",name:"message",type:"text",required:!0,default:null}]}}async execute(e){const t=e.settings;return"undefined"!=typeof window?alert(t.message):console.log(t.message),{ok:!0}}}e.default=s})(),__webpack_exports__})());
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { NodeBase, NodeConfig, NodeInput, NodeReturn } from "core-package-mini-n8n";
|
|
2
|
+
declare class AlertMessageNode extends NodeBase {
|
|
3
|
+
constructor(state: any);
|
|
4
|
+
getConfig(): NodeConfig;
|
|
5
|
+
execute(node: NodeInput): Promise<NodeReturn>;
|
|
6
|
+
}
|
|
7
|
+
export default AlertMessageNode;
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,UAAU,EACV,SAAS,EACT,UAAU,EACX,MAAM,uBAAuB,CAAC;AAE/B,cAAM,gBAAiB,SAAQ,QAAQ;gBACzB,KAAK,EAAE,GAAG;IAItB,SAAS,IAAI,UAAU;IAiBjB,OAAO,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC;CAUpD;AAED,eAAe,gBAAgB,CAAC"}
|
package/jest.config.cjs
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "alert-message-plugin-flow-requests",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "Alert message plugin to Flow requests",
|
|
5
|
+
"main": "dist/bundle.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"build": "webpack",
|
|
10
|
+
"prepublish": "pnpm run build",
|
|
11
|
+
"preinstall": "pnpm run build",
|
|
12
|
+
"start": "tsx src/index.ts",
|
|
13
|
+
"test": "jest ./tests/*.spec.ts"
|
|
14
|
+
},
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"axios": "^1.13.2",
|
|
17
|
+
"core-package-mini-n8n": "^1.1.5",
|
|
18
|
+
"ts-loader": "^9.5.4"
|
|
19
|
+
},
|
|
20
|
+
"devDependencies": {
|
|
21
|
+
"@jest/globals": "^30.2.0",
|
|
22
|
+
"@types/jest": "^30.0.0",
|
|
23
|
+
"@types/nodemailer": "^7.0.4",
|
|
24
|
+
"esbuild": "^0.27.2",
|
|
25
|
+
"jest": "^30.2.0",
|
|
26
|
+
"ts-jest": "^29.4.5",
|
|
27
|
+
"ts-node": "^10.9.2",
|
|
28
|
+
"tsx": "^4.20.6",
|
|
29
|
+
"typescript": "^5.9.3",
|
|
30
|
+
"webpack": "^5.104.1",
|
|
31
|
+
"webpack-cli": "^6.0.1"
|
|
32
|
+
},
|
|
33
|
+
"directories": {
|
|
34
|
+
"test": "tests"
|
|
35
|
+
},
|
|
36
|
+
"keywords": [],
|
|
37
|
+
"author": "",
|
|
38
|
+
"license": "ISC"
|
|
39
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import {
|
|
2
|
+
NodeBase,
|
|
3
|
+
NodeConfig,
|
|
4
|
+
NodeInput,
|
|
5
|
+
NodeReturn,
|
|
6
|
+
} from "core-package-mini-n8n";
|
|
7
|
+
|
|
8
|
+
class AlertMessageNode extends NodeBase {
|
|
9
|
+
constructor(state: any) {
|
|
10
|
+
super(state);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
getConfig(): NodeConfig {
|
|
14
|
+
return {
|
|
15
|
+
name: "AlertMessage", // Name e type needs to be the same
|
|
16
|
+
type: "AlertMessage", // Name e type needs to be the same
|
|
17
|
+
description: "Show alert message when execute the node",
|
|
18
|
+
properties: [
|
|
19
|
+
{
|
|
20
|
+
label: "Message",
|
|
21
|
+
name: "message",
|
|
22
|
+
type: "text",
|
|
23
|
+
required: true,
|
|
24
|
+
default: null,
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
async execute(node: NodeInput): Promise<NodeReturn> {
|
|
31
|
+
const setting = node.settings;
|
|
32
|
+
|
|
33
|
+
if (typeof window !== "undefined") {
|
|
34
|
+
alert(setting.message);
|
|
35
|
+
} else {
|
|
36
|
+
console.log(setting.message);
|
|
37
|
+
}
|
|
38
|
+
return { ok: true };
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export default AlertMessageNode;
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
// Visit https://aka.ms/tsconfig to read more about this file
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
// File Layout
|
|
5
|
+
"rootDir": "./src",
|
|
6
|
+
"outDir": "./dist",
|
|
7
|
+
|
|
8
|
+
// Environment Settings
|
|
9
|
+
// See also https://aka.ms/tsconfig/module
|
|
10
|
+
"module": "commonjs",
|
|
11
|
+
"target": "esnext",
|
|
12
|
+
"types": [],
|
|
13
|
+
// For nodejs:
|
|
14
|
+
// "lib": ["esnext"],
|
|
15
|
+
// "types": ["node"],
|
|
16
|
+
// and npm install -D @types/node
|
|
17
|
+
|
|
18
|
+
// Other Outputs
|
|
19
|
+
"sourceMap": true,
|
|
20
|
+
"declaration": true,
|
|
21
|
+
"declarationMap": true,
|
|
22
|
+
|
|
23
|
+
// Stricter Typechecking Options
|
|
24
|
+
"noUncheckedIndexedAccess": true,
|
|
25
|
+
"exactOptionalPropertyTypes": true,
|
|
26
|
+
|
|
27
|
+
// Style Options
|
|
28
|
+
// "noImplicitReturns": true,
|
|
29
|
+
// "noImplicitOverride": true,
|
|
30
|
+
// "noUnusedLocals": true,
|
|
31
|
+
// "noUnusedParameters": true,
|
|
32
|
+
// "noFallthroughCasesInSwitch": true,
|
|
33
|
+
// "noPropertyAccessFromIndexSignature": true,
|
|
34
|
+
|
|
35
|
+
// Recommended Options
|
|
36
|
+
"strict": true,
|
|
37
|
+
"jsx": "react-jsx",
|
|
38
|
+
"verbatimModuleSyntax": false,
|
|
39
|
+
"isolatedModules": true,
|
|
40
|
+
"noUncheckedSideEffectImports": true,
|
|
41
|
+
"moduleDetection": "force",
|
|
42
|
+
"skipLibCheck": true
|
|
43
|
+
},
|
|
44
|
+
"include": ["src/**/*"],
|
|
45
|
+
"exclude": ["node_modules", "dist", "tests/**/*"]
|
|
46
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const path = require("path");
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
entry: "./src/index.ts", // Your main entry file
|
|
5
|
+
mode: "production", // Use 'development' for dev, 'production' for final output
|
|
6
|
+
module: {
|
|
7
|
+
rules: [
|
|
8
|
+
{
|
|
9
|
+
test: /\.ts$/,
|
|
10
|
+
use: "ts-loader",
|
|
11
|
+
exclude: /node_modules/,
|
|
12
|
+
},
|
|
13
|
+
],
|
|
14
|
+
},
|
|
15
|
+
resolve: {
|
|
16
|
+
extensions: [".ts", ".js"],
|
|
17
|
+
},
|
|
18
|
+
output: {
|
|
19
|
+
filename: "bundle.js",
|
|
20
|
+
path: path.resolve(__dirname, "dist"),
|
|
21
|
+
library: "AlertMessage",
|
|
22
|
+
libraryTarget: "umd",
|
|
23
|
+
},
|
|
24
|
+
};
|