n8n-nodes-morelogin 1.0.0
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 +65 -0
- package/credentials/moreLoginOAuth2Api.credentials.ts +43 -0
- package/dist/credentials/moreLoginOAuth2Api.credentials.d.ts +9 -0
- package/dist/credentials/moreLoginOAuth2Api.credentials.js +43 -0
- package/dist/credentials/moreLoginOAuth2Api.credentials.js.map +1 -0
- package/dist/icons/morelogin.dark.svg +23 -0
- package/dist/icons/morelogin.svg +38 -0
- package/dist/nodes/Morelogin/Morelogin.node.d.ts +5 -0
- package/dist/nodes/Morelogin/Morelogin.node.js +200 -0
- package/dist/nodes/Morelogin/Morelogin.node.js.map +1 -0
- package/dist/nodes/Morelogin/Morelogin.node.json +18 -0
- package/dist/nodes/Morelogin/resources/account/getInfo.d.ts +2 -0
- package/dist/nodes/Morelogin/resources/account/getInfo.js +20 -0
- package/dist/nodes/Morelogin/resources/account/getInfo.js.map +1 -0
- package/dist/nodes/Morelogin/resources/account/getToken.d.ts +2 -0
- package/dist/nodes/Morelogin/resources/account/getToken.js +59 -0
- package/dist/nodes/Morelogin/resources/account/getToken.js.map +1 -0
- package/dist/nodes/Morelogin/resources/account/index.d.ts +2 -0
- package/dist/nodes/Morelogin/resources/account/index.js +49 -0
- package/dist/nodes/Morelogin/resources/account/index.js.map +1 -0
- package/dist/nodes/Morelogin/resources/schedule/createOnceSchedule.d.ts +5 -0
- package/dist/nodes/Morelogin/resources/schedule/createOnceSchedule.js +54 -0
- package/dist/nodes/Morelogin/resources/schedule/createOnceSchedule.js.map +1 -0
- package/dist/nodes/Morelogin/resources/schedule/createSchedule.d.ts +5 -0
- package/dist/nodes/Morelogin/resources/schedule/createSchedule.js +115 -0
- package/dist/nodes/Morelogin/resources/schedule/createSchedule.js.map +1 -0
- package/dist/nodes/Morelogin/resources/schedule/index.d.ts +2 -0
- package/dist/nodes/Morelogin/resources/schedule/index.js +73 -0
- package/dist/nodes/Morelogin/resources/schedule/index.js.map +1 -0
- package/dist/nodes/Morelogin/resources/schedule/searchMarketTemplatePage.d.ts +5 -0
- package/dist/nodes/Morelogin/resources/schedule/searchMarketTemplatePage.js +31 -0
- package/dist/nodes/Morelogin/resources/schedule/searchMarketTemplatePage.js.map +1 -0
- package/dist/nodes/Morelogin/resources/schedule/searchPersonalTemplatePage.d.ts +5 -0
- package/dist/nodes/Morelogin/resources/schedule/searchPersonalTemplatePage.js +40 -0
- package/dist/nodes/Morelogin/resources/schedule/searchPersonalTemplatePage.js.map +1 -0
- package/dist/nodes/Morelogin/shared/descriptions.d.ts +4 -0
- package/dist/nodes/Morelogin/shared/descriptions.js +44 -0
- package/dist/nodes/Morelogin/shared/descriptions.js.map +1 -0
- package/dist/nodes/Morelogin/shared/transport.d.ts +2 -0
- package/dist/nodes/Morelogin/shared/transport.js +14 -0
- package/dist/nodes/Morelogin/shared/transport.js.map +1 -0
- package/dist/package.json +57 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/icons/morelogin.dark.svg +23 -0
- package/icons/morelogin.svg +38 -0
- package/nodes/Morelogin/Morelogin.node.json +18 -0
- package/nodes/Morelogin/Morelogin.node.ts +235 -0
- package/nodes/Morelogin/openApi.yaml +4313 -0
- package/nodes/Morelogin/resources/account/getInfo.ts +19 -0
- package/nodes/Morelogin/resources/account/getToken.ts +58 -0
- package/nodes/Morelogin/resources/account/index.ts +48 -0
- package/nodes/Morelogin/resources/schedule/createOnceSchedule.ts +54 -0
- package/nodes/Morelogin/resources/schedule/createSchedule.ts +115 -0
- package/nodes/Morelogin/resources/schedule/index.ts +73 -0
- package/nodes/Morelogin/resources/schedule/searchMarketTemplatePage.ts +31 -0
- package/nodes/Morelogin/resources/schedule/searchPersonalTemplatePage.ts +40 -0
- package/nodes/Morelogin/shared/descriptions.ts +44 -0
- package/nodes/Morelogin/shared/transport.ts +27 -0
- package/package.json +57 -0
package/README.md
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# n8n-nodes-morelogin
|
|
2
|
+
|
|
3
|
+
This is an n8n community node. It lets you use GitHub Issues in your n8n workflows.
|
|
4
|
+
|
|
5
|
+
[n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/sustainable-use-license/) workflow automation platform.
|
|
6
|
+
|
|
7
|
+
[Installation](#installation)
|
|
8
|
+
[Operations](#operations)
|
|
9
|
+
[Credentials](#credentials)
|
|
10
|
+
[Compatibility](#compatibility)
|
|
11
|
+
[Usage](#usage)
|
|
12
|
+
[Resources](#resources)
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
Follow the [installation guide](https://docs.n8n.io/integrations/community-nodes/installation/) in the n8n community nodes documentation.
|
|
17
|
+
|
|
18
|
+
## Operations
|
|
19
|
+
|
|
20
|
+
- Schedules
|
|
21
|
+
- Search market template page
|
|
22
|
+
- Search personal template page
|
|
23
|
+
- Create a schedule task211
|
|
24
|
+
|
|
25
|
+
## Credentials
|
|
26
|
+
|
|
27
|
+
To authenticate with the MoreLogin API, you need an **API Key**.
|
|
28
|
+
|
|
29
|
+
### How to get your MoreLogin API Key
|
|
30
|
+
|
|
31
|
+
1. Open moreLogin client, login to your MoreLogin dashboard account. [Download](https://www.morelogin.com/download/)
|
|
32
|
+
2. Go to **API** .
|
|
33
|
+
3. Copy API ID and API Key.
|
|
34
|
+
5. Save the key securely — it will be used in n8n credentials.
|
|
35
|
+
|
|
36
|
+
> **Security Note**: Treat your API key like a password. Never expose it in public repositories.
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
## Compatibility
|
|
40
|
+
|
|
41
|
+
Compatible with n8n@1.60.0 or later
|
|
42
|
+
|
|
43
|
+
## Usage Examples
|
|
44
|
+
|
|
45
|
+
### Example 1: Create a Once schedule
|
|
46
|
+
1. Use **"Create profile"** operation.
|
|
47
|
+
2. Set:
|
|
48
|
+
- CloudPhoneId: `1678331966138097`
|
|
49
|
+
- ScheduleName: `test`
|
|
50
|
+
- TemplateId: `1678347487160296`
|
|
51
|
+
- TemplateParameter: `{\"1\":\"reae\"}`
|
|
52
|
+
- Description: `schedule task description`
|
|
53
|
+
3. The node returns the new schedule ID
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
## Resources
|
|
57
|
+
|
|
58
|
+
- [MoreLogin Official Website](https://www.morelogin.com/)
|
|
59
|
+
- [MoreLogin API Documentation](https://guide.morelogin.com/api-reference/open-api/open-api)
|
|
60
|
+
- [n8n Community Nodes Overview](https://docs.n8n.io/integrations/#community-nodes)
|
|
61
|
+
- [Anti-Detection Browser Automation Guide (n8n Blog)](https://n8n.io/blog/)
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
> **Developers**: Found a bug or want to contribute? Visit the [GitHub repository](https://github.com/your-username/n8n-nodes-morelogin) (replace with your actual repo link).
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Icon, ICredentialType, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
|
|
3
|
+
export class moreLoginOAuth2Api implements ICredentialType {
|
|
4
|
+
name = 'moreLoginOAuth2Api';
|
|
5
|
+
|
|
6
|
+
displayName = 'MoreLogin OAuth2 API';
|
|
7
|
+
|
|
8
|
+
extends = ['oAuth2Api'];
|
|
9
|
+
|
|
10
|
+
icon: Icon = { light: 'file:../icons/morelogin.svg', dark: 'file:../icons/morelogin.dark.svg' };
|
|
11
|
+
|
|
12
|
+
documentationUrl = 'https://guide.morelogin.com/api-reference/open-api/open-api/authorization';
|
|
13
|
+
|
|
14
|
+
properties: INodeProperties[] = [
|
|
15
|
+
{
|
|
16
|
+
displayName: 'Grant Type',
|
|
17
|
+
name: 'grantType',
|
|
18
|
+
type: 'hidden',
|
|
19
|
+
default: 'clientCredentials',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
displayName: 'API ID',
|
|
23
|
+
name: 'clientId',
|
|
24
|
+
type: 'string',
|
|
25
|
+
default: '',
|
|
26
|
+
required: true,
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
displayName: 'API Key',
|
|
30
|
+
name: 'clientSecret',
|
|
31
|
+
type: 'string',
|
|
32
|
+
typeOptions: { password: true },
|
|
33
|
+
default: '',
|
|
34
|
+
required: true,
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
displayName: 'Base URL',
|
|
38
|
+
name: 'baseUrl',
|
|
39
|
+
type: 'string',
|
|
40
|
+
default: 'https://api.morelogin.com',
|
|
41
|
+
},
|
|
42
|
+
];
|
|
43
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Icon, ICredentialType, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare class moreLoginOAuth2Api implements ICredentialType {
|
|
3
|
+
name: string;
|
|
4
|
+
displayName: string;
|
|
5
|
+
extends: string[];
|
|
6
|
+
icon: Icon;
|
|
7
|
+
documentationUrl: string;
|
|
8
|
+
properties: INodeProperties[];
|
|
9
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.moreLoginOAuth2Api = void 0;
|
|
4
|
+
class moreLoginOAuth2Api {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.name = 'moreLoginOAuth2Api';
|
|
7
|
+
this.displayName = 'MoreLogin OAuth2 API';
|
|
8
|
+
this.extends = ['oAuth2Api'];
|
|
9
|
+
this.icon = { light: 'file:../icons/morelogin.svg', dark: 'file:../icons/morelogin.dark.svg' };
|
|
10
|
+
this.documentationUrl = 'https://guide.morelogin.com/api-reference/open-api/open-api/authorization';
|
|
11
|
+
this.properties = [
|
|
12
|
+
{
|
|
13
|
+
displayName: 'Grant Type',
|
|
14
|
+
name: 'grantType',
|
|
15
|
+
type: 'hidden',
|
|
16
|
+
default: 'clientCredentials',
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
displayName: 'API ID',
|
|
20
|
+
name: 'clientId',
|
|
21
|
+
type: 'string',
|
|
22
|
+
default: '',
|
|
23
|
+
required: true,
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
displayName: 'API Key',
|
|
27
|
+
name: 'clientSecret',
|
|
28
|
+
type: 'string',
|
|
29
|
+
typeOptions: { password: true },
|
|
30
|
+
default: '',
|
|
31
|
+
required: true,
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
displayName: 'Base URL',
|
|
35
|
+
name: 'baseUrl',
|
|
36
|
+
type: 'string',
|
|
37
|
+
default: 'https://api.morelogin.com',
|
|
38
|
+
},
|
|
39
|
+
];
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
exports.moreLoginOAuth2Api = moreLoginOAuth2Api;
|
|
43
|
+
//# sourceMappingURL=moreLoginOAuth2Api.credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"moreLoginOAuth2Api.credentials.js","sourceRoot":"","sources":["../../credentials/moreLoginOAuth2Api.credentials.ts"],"names":[],"mappings":";;;AAEA,MAAa,kBAAkB;IAA/B;QACC,SAAI,GAAG,oBAAoB,CAAC;QAE5B,gBAAW,GAAG,sBAAsB,CAAC;QAErC,YAAO,GAAG,CAAC,WAAW,CAAC,CAAC;QAExB,SAAI,GAAS,EAAE,KAAK,EAAE,6BAA6B,EAAE,IAAI,EAAE,kCAAkC,EAAE,CAAC;QAEhG,qBAAgB,GAAG,2EAA2E,CAAC;QAE/F,eAAU,GAAsB;YACzB;gBACI,WAAW,EAAE,YAAY;gBACzB,IAAI,EAAE,WAAW;gBACjB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,mBAAmB;aAC/B;YACP;gBACC,WAAW,EAAE,QAAQ;gBACrB,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,IAAI;aACd;YACD;gBACC,WAAW,EAAE,SAAS;gBACtB,IAAI,EAAE,cAAc;gBACpB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;gBAC/B,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,IAAI;aACd;YACD;gBACC,WAAW,EAAE,UAAU;gBACvB,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,2BAA2B;aACpC;SACD,CAAC;IACH,CAAC;CAAA;AAxCD,gDAwCC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<svg width="100" height="100" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g clip-path="url(#clip0_209_94)">
|
|
3
|
+
<path d="M88 0H12C5.37258 0 0 5.37258 0 12V88C0 94.6274 5.37258 100 12 100H88C94.6274 100 100 94.6274 100 88V12C100 5.37258 94.6274 0 88 0Z" fill="#1F2937"/>
|
|
4
|
+
<g clip-path="url(#clip1_209_94)">
|
|
5
|
+
<mask id="mask0_209_94" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="15" y="21" width="70" height="58">
|
|
6
|
+
<path d="M84.9976 21.7926H15V78.5183H84.9976V21.7926Z" fill="white"/>
|
|
7
|
+
</mask>
|
|
8
|
+
<g mask="url(#mask0_209_94)">
|
|
9
|
+
<path d="M67.4309 48.8632L52.3683 37.545L49.1224 35.1094L43.8164 31.1288L31.5816 21.7926L15 33.7227V50.3043L31.5816 38.3742L32.6376 39.168L50.7713 52.7824L84.048 77.7765L85 78.4829V62.0501L67.4333 48.8632H67.4309Z" fill="white"/>
|
|
10
|
+
<path d="M64.6488 42.8059L67.4317 40.7979V44.899L69.4917 46.444L85.0008 58.0953V34.5777L67.4317 21.9413L56.8458 29.56L52.369 32.7799L51.8115 33.1721L54.4196 35.1258L64.6464 42.8059H64.6488Z" fill="white"/>
|
|
11
|
+
<path d="M34.0976 44.9606L31.3383 46.9497V42.877H31.3359L15 54.6228V78.5183L47.5419 55.1118L34.0976 44.9606Z" fill="white"/>
|
|
12
|
+
</g>
|
|
13
|
+
</g>
|
|
14
|
+
</g>
|
|
15
|
+
<defs>
|
|
16
|
+
<clipPath id="clip0_209_94">
|
|
17
|
+
<rect width="100" height="100" fill="white"/>
|
|
18
|
+
</clipPath>
|
|
19
|
+
<clipPath id="clip1_209_94">
|
|
20
|
+
<rect width="70" height="56.7257" fill="white" transform="translate(15 21.7926)"/>
|
|
21
|
+
</clipPath>
|
|
22
|
+
</defs>
|
|
23
|
+
</svg>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<svg width="100" height="100" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g clip-path="url(#clip0_209_97)">
|
|
3
|
+
<path d="M88 0H12C5.37258 0 0 5.37258 0 12V88C0 94.6274 5.37258 100 12 100H88C94.6274 100 100 94.6274 100 88V12C100 5.37258 94.6274 0 88 0Z" fill="white"/>
|
|
4
|
+
<g clip-path="url(#clip1_209_97)">
|
|
5
|
+
<path d="M69.8002 21.498C68.6952 20.6861 67.1836 20.7142 66.1095 21.5665L50.4287 34.0095L39.2649 42.8632L28.2717 51.5857L15.4287 61.7762V63.9388V78.7429H16.3667L50.4287 51.7233L61.5925 42.8632L67.9287 37.8367L72.5858 41.2576L85.4287 50.6945V34.6845V32.9807L69.8002 21.498Z" fill="url(#paint0_linear_209_97)"/>
|
|
6
|
+
<path d="M67.9287 20.1229L50.4287 34.0095L39.2649 42.8632L28.2717 51.5857L15.4287 61.7762V63.9388V78.7429H16.3667L50.4287 51.7233L61.5925 42.8632L67.9287 37.8367L72.5858 41.2576L85.4287 50.6944V34.6845V32.9807L67.9287 20.1229Z" fill="url(#paint1_linear_209_97)"/>
|
|
7
|
+
<path d="M72.585 51.5859L85.4279 61.7764V50.6947L72.585 41.2578V51.5859Z" fill="#4242FF"/>
|
|
8
|
+
<path d="M28.2717 41.2578L15.4287 50.6947V61.7764L28.2717 51.5859V41.2578Z" fill="#4242FF"/>
|
|
9
|
+
<path d="M72.5858 51.5857L61.5925 42.8632L50.4287 34.0095L32.9287 20.1229L15.4287 32.9807V34.6845V50.6945L28.2717 41.2576L32.9287 37.8367L39.2649 42.8632L50.4287 51.7233L84.4842 78.7429L85.4287 79.49V78.7429V63.9388V61.7762L72.5858 51.5857Z" fill="url(#paint2_linear_209_97)"/>
|
|
10
|
+
</g>
|
|
11
|
+
</g>
|
|
12
|
+
<defs>
|
|
13
|
+
<linearGradient id="paint0_linear_209_97" x1="77.4133" y1="26.6763" x2="15.4741" y2="78.5023" gradientUnits="userSpaceOnUse">
|
|
14
|
+
<stop stop-color="#5B7CFD"/>
|
|
15
|
+
<stop offset="0.244355" stop-color="#5B7CFD"/>
|
|
16
|
+
<stop offset="0.439257" stop-color="#3200CA"/>
|
|
17
|
+
<stop offset="0.636418" stop-color="#5B7BFD"/>
|
|
18
|
+
<stop offset="1" stop-color="#5B7BFD"/>
|
|
19
|
+
</linearGradient>
|
|
20
|
+
<linearGradient id="paint1_linear_209_97" x1="77.4133" y1="26.6763" x2="15.4741" y2="78.5023" gradientUnits="userSpaceOnUse">
|
|
21
|
+
<stop stop-color="#5B7CFD"/>
|
|
22
|
+
<stop offset="0.244355" stop-color="#5B7CFD"/>
|
|
23
|
+
<stop offset="0.439257" stop-color="#3200CA"/>
|
|
24
|
+
<stop offset="0.636418" stop-color="#5B7BFD"/>
|
|
25
|
+
<stop offset="1" stop-color="#5B7BFD"/>
|
|
26
|
+
</linearGradient>
|
|
27
|
+
<linearGradient id="paint2_linear_209_97" x1="24.2837" y1="26.3486" x2="85.5652" y2="79.8128" gradientUnits="userSpaceOnUse">
|
|
28
|
+
<stop stop-color="#00FF97"/>
|
|
29
|
+
<stop offset="1" stop-color="#009EFD"/>
|
|
30
|
+
</linearGradient>
|
|
31
|
+
<clipPath id="clip0_209_97">
|
|
32
|
+
<rect width="100" height="100" fill="white"/>
|
|
33
|
+
</clipPath>
|
|
34
|
+
<clipPath id="clip1_209_97">
|
|
35
|
+
<rect width="70" height="59.3671" fill="white" transform="translate(15.4287 20.1229)"/>
|
|
36
|
+
</clipPath>
|
|
37
|
+
</defs>
|
|
38
|
+
</svg>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type IExecuteFunctions, type INodeType, type INodeTypeDescription, type INodeExecutionData } from 'n8n-workflow';
|
|
2
|
+
export declare class Morelogin implements INodeType {
|
|
3
|
+
description: INodeTypeDescription;
|
|
4
|
+
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|
|
5
|
+
}
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Morelogin = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const index_1 = require("./resources/schedule/index");
|
|
6
|
+
const allScheduleParams = [
|
|
7
|
+
...index_1.scheduleDescription,
|
|
8
|
+
];
|
|
9
|
+
class Morelogin {
|
|
10
|
+
constructor() {
|
|
11
|
+
this.description = {
|
|
12
|
+
displayName: 'Morelogin',
|
|
13
|
+
name: 'morelogin',
|
|
14
|
+
icon: { light: 'file:../../icons/morelogin.svg', dark: 'file:../../icons/morelogin.dark.svg' },
|
|
15
|
+
group: ['input'],
|
|
16
|
+
version: 1,
|
|
17
|
+
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
|
|
18
|
+
description: 'Interact with the Morelogin API',
|
|
19
|
+
defaults: {
|
|
20
|
+
name: 'Morelogin',
|
|
21
|
+
},
|
|
22
|
+
usableAsTool: true,
|
|
23
|
+
inputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
24
|
+
outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
25
|
+
credentials: [
|
|
26
|
+
{
|
|
27
|
+
name: 'moreLoginOAuth2Api',
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
requestDefaults: {
|
|
31
|
+
baseURL: 'https://api.morelogin.com',
|
|
32
|
+
headers: {
|
|
33
|
+
Accept: 'application/json',
|
|
34
|
+
'Content-Type': 'application/json',
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
properties: [
|
|
38
|
+
{
|
|
39
|
+
displayName: 'Resource',
|
|
40
|
+
name: 'resource',
|
|
41
|
+
type: 'options',
|
|
42
|
+
noDataExpression: true,
|
|
43
|
+
options: [
|
|
44
|
+
{
|
|
45
|
+
name: 'Account',
|
|
46
|
+
value: 'account',
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
name: 'Schedule',
|
|
50
|
+
value: 'schedule',
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
default: 'account',
|
|
54
|
+
},
|
|
55
|
+
...index_1.scheduleDescription,
|
|
56
|
+
],
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
async execute() {
|
|
60
|
+
var _a;
|
|
61
|
+
const credentials = await this.getCredentials('moreLoginOAuth2Api');
|
|
62
|
+
const clientId = credentials.clientId;
|
|
63
|
+
const clientSecret = credentials.clientSecret;
|
|
64
|
+
const nodeStaticData = this.getWorkflowStaticData('node');
|
|
65
|
+
let accessToken;
|
|
66
|
+
let tokenExpiry;
|
|
67
|
+
if (nodeStaticData.accessToken && nodeStaticData.expiresAt) {
|
|
68
|
+
accessToken = nodeStaticData.accessToken;
|
|
69
|
+
tokenExpiry = nodeStaticData.expiresAt;
|
|
70
|
+
}
|
|
71
|
+
const now = Date.now();
|
|
72
|
+
if (!accessToken || !tokenExpiry || now >= tokenExpiry) {
|
|
73
|
+
try {
|
|
74
|
+
const tokenResponse = await this.helpers.httpRequest({
|
|
75
|
+
method: 'POST',
|
|
76
|
+
url: 'https://api.morelogin.com/oauth2/token',
|
|
77
|
+
headers: {
|
|
78
|
+
'Content-Type': 'application/json',
|
|
79
|
+
},
|
|
80
|
+
body: JSON.stringify({
|
|
81
|
+
client_id: clientId,
|
|
82
|
+
client_secret: clientSecret,
|
|
83
|
+
grant_type: 'client_credentials',
|
|
84
|
+
}),
|
|
85
|
+
});
|
|
86
|
+
if (tokenResponse.code !== 0) {
|
|
87
|
+
throw new n8n_workflow_1.NodeApiError(this.getNode(), tokenResponse, {
|
|
88
|
+
message: tokenResponse.msg || 'Failed to get access token',
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
accessToken = tokenResponse.data.access_token;
|
|
92
|
+
nodeStaticData.accessToken = accessToken;
|
|
93
|
+
nodeStaticData.expiresAt = now + (tokenResponse.data.expires_in - 300) * 1000;
|
|
94
|
+
}
|
|
95
|
+
catch (error) {
|
|
96
|
+
throw new n8n_workflow_1.NodeApiError(this.getNode(), error, {
|
|
97
|
+
message: 'Error fetching access token from MoreLogin',
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
const items = this.getInputData();
|
|
102
|
+
const returnData = [];
|
|
103
|
+
for (let i = 0; i < items.length; i++) {
|
|
104
|
+
const body = {};
|
|
105
|
+
let endpoint = '';
|
|
106
|
+
try {
|
|
107
|
+
let method = 'POST';
|
|
108
|
+
const resource = this.getNodeParameter('resource', i);
|
|
109
|
+
const operation = this.getNodeParameter('operation', i);
|
|
110
|
+
const relevantParams = allScheduleParams.filter(param => {
|
|
111
|
+
var _a;
|
|
112
|
+
const show = (_a = param.displayOptions) === null || _a === void 0 ? void 0 : _a.show;
|
|
113
|
+
if (!show)
|
|
114
|
+
return false;
|
|
115
|
+
const matchesResource = !show.resource || (Array.isArray(show.resource) ? show.resource.includes(resource) : show.resource === resource);
|
|
116
|
+
const matchesOperation = !show.operation || (Array.isArray(show.operation) ? show.operation.includes(operation) : show.operation === operation);
|
|
117
|
+
return matchesResource && matchesOperation;
|
|
118
|
+
});
|
|
119
|
+
const body = {};
|
|
120
|
+
for (const param of relevantParams) {
|
|
121
|
+
if (!((_a = param.routing) === null || _a === void 0 ? void 0 : _a.send) || param.routing.send.type !== 'body')
|
|
122
|
+
continue;
|
|
123
|
+
let value = this.getNodeParameter(param.name, i);
|
|
124
|
+
if (value == null)
|
|
125
|
+
continue;
|
|
126
|
+
if (param.name === 'sort') {
|
|
127
|
+
const sort = value;
|
|
128
|
+
if (sort.sortItem) {
|
|
129
|
+
value = sort.sortItem
|
|
130
|
+
.map(item => ({
|
|
131
|
+
sortDirection: item.sortDirection,
|
|
132
|
+
sortField: item.sortField,
|
|
133
|
+
}));
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
continue;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
const key = param.routing.send.property || param.name;
|
|
140
|
+
body[key] = value;
|
|
141
|
+
}
|
|
142
|
+
if (resource === 'account') {
|
|
143
|
+
if (operation === 'getInfo') {
|
|
144
|
+
method = 'GET';
|
|
145
|
+
endpoint = '/oauth2/userinfo';
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
throw new n8n_workflow_1.NodeApiError(this.getNode(), {}, {
|
|
149
|
+
message: `Unsupported account operation: ${operation}`,
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
else if (resource === 'schedule') {
|
|
154
|
+
const opMap = {
|
|
155
|
+
searchMarketTemplateForPage: '/cloudphone/rpa/template/market/page',
|
|
156
|
+
searchPersonalTemplateForPage: '/cloudphone/rpa/template/personal/page',
|
|
157
|
+
createSchedule: '/cloudphone/rpa/task/save',
|
|
158
|
+
createOnceSchedule: '/cloudphone/rpa/onceTask/save',
|
|
159
|
+
};
|
|
160
|
+
endpoint = opMap[operation];
|
|
161
|
+
if (!endpoint) {
|
|
162
|
+
throw new n8n_workflow_1.NodeApiError(this.getNode(), {}, {
|
|
163
|
+
message: `Unsupported schedule operation: ${operation}`,
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
else {
|
|
168
|
+
throw new n8n_workflow_1.NodeApiError(this.getNode(), {}, {
|
|
169
|
+
message: `Unsupported resource: ${resource}`,
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
const response = await this.helpers.httpRequest({
|
|
173
|
+
method,
|
|
174
|
+
url: `https://api.morelogin.com${endpoint}`,
|
|
175
|
+
headers: {
|
|
176
|
+
Authorization: `Bearer ${accessToken}`,
|
|
177
|
+
'Content-Type': 'application/json',
|
|
178
|
+
},
|
|
179
|
+
body: method === 'POST' && Object.keys(body).length > 0 ? body : undefined,
|
|
180
|
+
json: true,
|
|
181
|
+
});
|
|
182
|
+
if (response.code !== 0) {
|
|
183
|
+
throw new n8n_workflow_1.NodeApiError(this.getNode(), response, {
|
|
184
|
+
message: response.msg || 'API request failed',
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
returnData.push({ json: response.data || response });
|
|
188
|
+
}
|
|
189
|
+
catch (error) {
|
|
190
|
+
throw new n8n_workflow_1.NodeApiError(this.getNode(), {}, {
|
|
191
|
+
message: `Info: ${endpoint} ${error.message}`,
|
|
192
|
+
description: JSON.stringify(body)
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
return [returnData];
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
exports.Morelogin = Morelogin;
|
|
200
|
+
//# sourceMappingURL=Morelogin.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Morelogin.node.js","sourceRoot":"","sources":["../../../nodes/Morelogin/Morelogin.node.ts"],"names":[],"mappings":";;;AAAA,+CASsB;AAEtB,sDAAiE;AAEjE,MAAM,iBAAiB,GAAsB;IAEzC,GAAG,2BAAmB;CACzB,CAAC;AAEF,MAAa,SAAS;IAAtB;QACI,gBAAW,GAAyB;YAChC,WAAW,EAAE,WAAW;YACxB,IAAI,EAAE,WAAW;YACjB,IAAI,EAAE,EAAE,KAAK,EAAE,gCAAgC,EAAE,IAAI,EAAE,qCAAqC,EAAE;YAC9F,KAAK,EAAE,CAAC,OAAO,CAAC;YAChB,OAAO,EAAE,CAAC;YACV,QAAQ,EAAE,8DAA8D;YACxE,WAAW,EAAE,iCAAiC;YAC9C,QAAQ,EAAE;gBACN,IAAI,EAAE,WAAW;aACpB;Y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AAC,IAAI,CAAC,OAAO,EAAE,EAAE,EAAE,EAAE;oBACvC,OAAO,EAAE,SAAS,QAAQ,IAAI,KAAK,CAAC,OAAO,EAAE;oBAC7C,WAAW,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;iBACpC,CAAC,CAAC;YACP,CAAC;QACL,CAAC;QAED,OAAO,CAAC,UAAU,CAAC,CAAC;IAExB,CAAC;CACJ;AAxND,8BAwNC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"node": "n8n-nodes-morelogin",
|
|
3
|
+
"nodeVersion": "1.0",
|
|
4
|
+
"codexVersion": "1.0",
|
|
5
|
+
"categories": ["Development", "Developer Tools"],
|
|
6
|
+
"resources": {
|
|
7
|
+
"credentialDocumentation": [
|
|
8
|
+
{
|
|
9
|
+
"url": "https://guide.morelogin.com/api-reference/open-api"
|
|
10
|
+
}
|
|
11
|
+
],
|
|
12
|
+
"primaryDocumentation": [
|
|
13
|
+
{
|
|
14
|
+
"url": "https://guide.morelogin.com/api-reference/open-api/open-api"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.accountGetInfoDescription = void 0;
|
|
4
|
+
const showOnlyForGetInfo = {
|
|
5
|
+
operation: ['getInfo'],
|
|
6
|
+
resource: ['account'],
|
|
7
|
+
};
|
|
8
|
+
exports.accountGetInfoDescription = [
|
|
9
|
+
{
|
|
10
|
+
displayName: 'Use Credential Authorization',
|
|
11
|
+
name: 'useCredential',
|
|
12
|
+
type: 'boolean',
|
|
13
|
+
default: true,
|
|
14
|
+
displayOptions: {
|
|
15
|
+
show: showOnlyForGetInfo,
|
|
16
|
+
},
|
|
17
|
+
description: 'Whether to use node credential Authorization header',
|
|
18
|
+
},
|
|
19
|
+
];
|
|
20
|
+
//# sourceMappingURL=getInfo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getInfo.js","sourceRoot":"","sources":["../../../../../nodes/Morelogin/resources/account/getInfo.ts"],"names":[],"mappings":";;;AAEA,MAAM,kBAAkB,GAAG;IACvB,SAAS,EAAE,CAAC,SAAS,CAAC;IACtB,QAAQ,EAAE,CAAC,SAAS,CAAC;CACxB,CAAC;AAEW,QAAA,yBAAyB,GAAsB;IACxD;QACI,WAAW,EAAE,8BAA8B;QAC3C,IAAI,EAAE,eAAe;QACrB,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,IAAI;QACb,cAAc,EAAE;YACZ,IAAI,EAAE,kBAAkB;SAC3B;QACD,WAAW,EAAE,qDAAqD;KACrE;CACJ,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.accountGetTokenDescription = void 0;
|
|
4
|
+
const showOnlyForGetToken = {
|
|
5
|
+
operation: ['getToken'],
|
|
6
|
+
resource: ['account'],
|
|
7
|
+
};
|
|
8
|
+
exports.accountGetTokenDescription = [
|
|
9
|
+
{
|
|
10
|
+
displayName: 'Client ID',
|
|
11
|
+
name: 'client_id',
|
|
12
|
+
type: 'string',
|
|
13
|
+
default: '',
|
|
14
|
+
required: true,
|
|
15
|
+
displayOptions: {
|
|
16
|
+
show: showOnlyForGetToken,
|
|
17
|
+
},
|
|
18
|
+
routing: {
|
|
19
|
+
send: {
|
|
20
|
+
type: 'body',
|
|
21
|
+
property: 'client_id',
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
displayName: 'Client Secret',
|
|
27
|
+
name: 'client_secret',
|
|
28
|
+
type: 'string',
|
|
29
|
+
default: '',
|
|
30
|
+
typeOptions: { password: true },
|
|
31
|
+
required: true,
|
|
32
|
+
displayOptions: {
|
|
33
|
+
show: showOnlyForGetToken,
|
|
34
|
+
},
|
|
35
|
+
routing: {
|
|
36
|
+
send: {
|
|
37
|
+
type: 'body',
|
|
38
|
+
property: 'client_secret',
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
displayName: 'Grant Type',
|
|
44
|
+
name: 'grant_type',
|
|
45
|
+
type: 'string',
|
|
46
|
+
default: 'client_credentials',
|
|
47
|
+
required: true,
|
|
48
|
+
displayOptions: {
|
|
49
|
+
show: showOnlyForGetToken,
|
|
50
|
+
},
|
|
51
|
+
routing: {
|
|
52
|
+
send: {
|
|
53
|
+
type: 'body',
|
|
54
|
+
property: 'grant_type',
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
];
|
|
59
|
+
//# sourceMappingURL=getToken.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getToken.js","sourceRoot":"","sources":["../../../../../nodes/Morelogin/resources/account/getToken.ts"],"names":[],"mappings":";;;AAEA,MAAM,mBAAmB,GAAG;IACxB,SAAS,EAAE,CAAC,UAAU,CAAC;IACvB,QAAQ,EAAE,CAAC,SAAS,CAAC;CACxB,CAAC;AAEW,QAAA,0BAA0B,GAAsB;IACzD;QACI,WAAW,EAAE,WAAW;QACxB,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,EAAE;QACX,QAAQ,EAAE,IAAI;QACd,cAAc,EAAE;YACZ,IAAI,EAAE,mBAAmB;SAC5B;QACD,OAAO,EAAE;YACL,IAAI,EAAE;gBACF,IAAI,EAAE,MAAM;gBACZ,QAAQ,EAAE,WAAW;aACxB;SACJ;KACJ;IACD;QACI,WAAW,EAAE,eAAe;QAC5B,IAAI,EAAE,eAAe;QACrB,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;QAC/B,QAAQ,EAAE,IAAI;QACd,cAAc,EAAE;YACZ,IAAI,EAAE,mBAAmB;SAC5B;QACD,OAAO,EAAE;YACL,IAAI,EAAE;gBACF,IAAI,EAAE,MAAM;gBACZ,QAAQ,EAAE,eAAe;aAC5B;SACJ;KACJ;IACD;QACI,WAAW,EAAE,YAAY;QACzB,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,oBAAoB;QAC7B,QAAQ,EAAE,IAAI;QACd,cAAc,EAAE;YACZ,IAAI,EAAE,mBAAmB;SAC5B;QACD,OAAO,EAAE;YACL,IAAI,EAAE;gBACF,IAAI,EAAE,MAAM;gBACZ,QAAQ,EAAE,YAAY;aACzB;SACJ;KACJ;CACJ,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.accountDescription = void 0;
|
|
4
|
+
const getToken_1 = require("./getToken");
|
|
5
|
+
const getInfo_1 = require("./getInfo");
|
|
6
|
+
const showOnlyForAccount = {
|
|
7
|
+
resource: ['account'],
|
|
8
|
+
};
|
|
9
|
+
exports.accountDescription = [
|
|
10
|
+
{
|
|
11
|
+
displayName: 'Operation',
|
|
12
|
+
name: 'operation',
|
|
13
|
+
type: 'options',
|
|
14
|
+
noDataExpression: true,
|
|
15
|
+
displayOptions: {
|
|
16
|
+
show: showOnlyForAccount,
|
|
17
|
+
},
|
|
18
|
+
options: [
|
|
19
|
+
{
|
|
20
|
+
name: 'Get Token',
|
|
21
|
+
value: 'getToken',
|
|
22
|
+
action: 'Get an access token',
|
|
23
|
+
description: 'Exchange client ID and secret for an access token',
|
|
24
|
+
routing: {
|
|
25
|
+
request: {
|
|
26
|
+
method: 'POST',
|
|
27
|
+
url: '=/oauth2/token',
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
name: 'Get User Info',
|
|
33
|
+
value: 'getInfo',
|
|
34
|
+
action: 'Get user information',
|
|
35
|
+
description: 'Return user info using a bearer token',
|
|
36
|
+
routing: {
|
|
37
|
+
request: {
|
|
38
|
+
method: 'GET',
|
|
39
|
+
url: '=/oauth2/userinfo',
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
default: 'getToken',
|
|
45
|
+
},
|
|
46
|
+
...getToken_1.accountGetTokenDescription,
|
|
47
|
+
...getInfo_1.accountGetInfoDescription,
|
|
48
|
+
];
|
|
49
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../nodes/Morelogin/resources/account/index.ts"],"names":[],"mappings":";;;AACA,yCAAwD;AACxD,uCAAsD;AAEtD,MAAM,kBAAkB,GAAG;IACvB,QAAQ,EAAE,CAAC,SAAS,CAAC;CACxB,CAAC;AAEW,QAAA,kBAAkB,GAAsB;IACjD;QACI,WAAW,EAAE,WAAW;QACxB,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,SAAS;QACf,gBAAgB,EAAE,IAAI;QACtB,cAAc,EAAE;YACZ,IAAI,EAAE,kBAAkB;SAC3B;QACD,OAAO,EAAE;YACL;gBACI,IAAI,EAAE,WAAW;gBACjB,KAAK,EAAE,UAAU;gBACjB,MAAM,EAAE,qBAAqB;gBAC7B,WAAW,EAAE,mDAAmD;gBAChE,OAAO,EAAE;oBACL,OAAO,EAAE;wBACL,MAAM,EAAE,MAAM;wBACd,GAAG,EAAE,gBAAgB;qBACxB;iBACJ;aACJ;YACD;gBACI,IAAI,EAAE,eAAe;gBACrB,KAAK,EAAE,SAAS;gBAChB,MAAM,EAAE,sBAAsB;gBAC9B,WAAW,EAAE,uCAAuC;gBACpD,OAAO,EAAE;oBACL,OAAO,EAAE;wBACL,MAAM,EAAE,KAAK;wBACb,GAAG,EAAE,mBAAmB;qBAC3B;iBACJ;aACJ;SACJ;QACD,OAAO,EAAE,UAAU;KACtB;IACD,GAAG,qCAA0B;IAC7B,GAAG,mCAAyB;CAC/B,CAAC"}
|