n8n-nodes-ovhcloud 0.0.5 → 0.0.7
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 +63 -16
- package/dist/nodes/OvhCloud/OvhCloud.node.d.ts +1 -5
- package/dist/nodes/OvhCloud/OvhCloud.node.js +28 -12
- package/dist/nodes/OvhCloud/OvhCloud.node.js.map +1 -1
- package/dist/nodes/OvhCloud/resources/email.d.ts +6 -0
- package/dist/nodes/OvhCloud/resources/email.js +84 -0
- package/dist/nodes/OvhCloud/resources/email.js.map +1 -0
- package/dist/nodes/OvhCloud/resources/me.js +338 -0
- package/dist/nodes/OvhCloud/resources/me.js.map +1 -0
- package/dist/nodes/OvhCloud/resources/services.d.ts +6 -0
- package/dist/nodes/OvhCloud/resources/services.js +283 -0
- package/dist/nodes/OvhCloud/resources/services.js.map +1 -0
- package/dist/nodes/OvhCloud/resources/vps.d.ts +6 -0
- package/dist/nodes/OvhCloud/resources/vps.js +483 -0
- package/dist/nodes/OvhCloud/resources/vps.js.map +1 -0
- package/dist/nodes/OvhCloud/shared/OvhCloudApiClient.d.ts +12 -0
- package/dist/nodes/OvhCloud/shared/OvhCloudApiClient.js +44 -0
- package/dist/nodes/OvhCloud/shared/OvhCloudApiClient.js.map +1 -0
- package/dist/package.json +19 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +19 -2
- package/dist/nodes/OvhCloud/listSearch/getServices.d.ts +0 -2
- package/dist/nodes/OvhCloud/listSearch/getServices.js +0 -30
- package/dist/nodes/OvhCloud/listSearch/getServices.js.map +0 -1
- package/dist/nodes/OvhCloud/resources/domain/get.d.ts +0 -0
- package/dist/nodes/OvhCloud/resources/domain/get.js +0 -2
- package/dist/nodes/OvhCloud/resources/domain/get.js.map +0 -1
- package/dist/nodes/OvhCloud/resources/domain/index.d.ts +0 -4
- package/dist/nodes/OvhCloud/resources/domain/index.js +0 -42
- package/dist/nodes/OvhCloud/resources/domain/index.js.map +0 -1
- package/dist/nodes/OvhCloud/resources/domain/list.d.ts +0 -0
- package/dist/nodes/OvhCloud/resources/domain/list.js +0 -2
- package/dist/nodes/OvhCloud/resources/domain/list.js.map +0 -1
- package/dist/nodes/OvhCloud/resources/me/bill/index.d.ts +0 -3
- package/dist/nodes/OvhCloud/resources/me/bill/index.js +0 -34
- package/dist/nodes/OvhCloud/resources/me/bill/index.js.map +0 -1
- package/dist/nodes/OvhCloud/resources/me/bill/list.d.ts +0 -3
- package/dist/nodes/OvhCloud/resources/me/bill/list.js +0 -88
- package/dist/nodes/OvhCloud/resources/me/bill/list.js.map +0 -1
- package/dist/nodes/OvhCloud/resources/me/debtAccount/get.d.ts +0 -3
- package/dist/nodes/OvhCloud/resources/me/debtAccount/get.js +0 -19
- package/dist/nodes/OvhCloud/resources/me/debtAccount/get.js.map +0 -1
- package/dist/nodes/OvhCloud/resources/me/debtAccount/index.d.ts +0 -3
- package/dist/nodes/OvhCloud/resources/me/debtAccount/index.js +0 -34
- package/dist/nodes/OvhCloud/resources/me/debtAccount/index.js.map +0 -1
- package/dist/nodes/OvhCloud/resources/me/index.js +0 -63
- package/dist/nodes/OvhCloud/resources/me/index.js.map +0 -1
- package/dist/nodes/OvhCloud/resources/me/me.d.ts +0 -4
- package/dist/nodes/OvhCloud/resources/me/me.js +0 -47
- package/dist/nodes/OvhCloud/resources/me/me.js.map +0 -1
- package/dist/nodes/OvhCloud/resources/me/order/get.d.ts +0 -3
- package/dist/nodes/OvhCloud/resources/me/order/get.js +0 -55
- package/dist/nodes/OvhCloud/resources/me/order/get.js.map +0 -1
- package/dist/nodes/OvhCloud/resources/me/order/index.d.ts +0 -3
- package/dist/nodes/OvhCloud/resources/me/order/index.js +0 -34
- package/dist/nodes/OvhCloud/resources/me/order/index.js.map +0 -1
- package/dist/nodes/OvhCloud/resources/services/get.d.ts +0 -7
- package/dist/nodes/OvhCloud/resources/services/get.js +0 -92
- package/dist/nodes/OvhCloud/resources/services/get.js.map +0 -1
- package/dist/nodes/OvhCloud/resources/services/index.d.ts +0 -6
- package/dist/nodes/OvhCloud/resources/services/index.js +0 -50
- package/dist/nodes/OvhCloud/resources/services/index.js.map +0 -1
- package/dist/nodes/OvhCloud/resources/services/list.d.ts +0 -4
- package/dist/nodes/OvhCloud/resources/services/list.js +0 -89
- package/dist/nodes/OvhCloud/resources/services/list.js.map +0 -1
- /package/dist/nodes/OvhCloud/resources/{me/index.d.ts → me.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -18,8 +18,10 @@ Nœud communautaire n8n pour interagir avec les APIs OVHcloud.
|
|
|
18
18
|
|
|
19
19
|
## Fonctionnalités
|
|
20
20
|
|
|
21
|
-
- Ressource **Services** : lister les services
|
|
21
|
+
- Ressource **Services** : lister les services, récupérer un service par ID, obtenir les formulaires, options et upgrades disponibles
|
|
22
22
|
- Ressource **Me** : informations du compte, factures, dette, commandes
|
|
23
|
+
- Ressource **Email** : lister les domaines email, obtenir les détails d'un domaine email
|
|
24
|
+
- Ressource **VPS** : lister les VPS, obtenir les détails d'un VPS, lister les datacenters, créer des snapshots, gérer les disques
|
|
23
25
|
- Authentification OVH via signature (`Application Key`, `Application Secret`, `Consumer Key`)
|
|
24
26
|
- Support multi-endpoints : OVH Europe/Canada/USA, SoYouStart, Kimsufi
|
|
25
27
|
|
|
@@ -66,6 +68,21 @@ GET /me/order
|
|
|
66
68
|
GET /me/order/*
|
|
67
69
|
GET /services
|
|
68
70
|
GET /services/*
|
|
71
|
+
GET /email/domain
|
|
72
|
+
GET /email/domain/*
|
|
73
|
+
GET /vps
|
|
74
|
+
GET /vps/*
|
|
75
|
+
GET /vps/*/snapshot
|
|
76
|
+
POST /vps/*/snapshot
|
|
77
|
+
GET /vps/*/disks
|
|
78
|
+
GET /vps/*/disks/*
|
|
79
|
+
GET /dedicated/ceph/*
|
|
80
|
+
GET /dedicated/cluster/*
|
|
81
|
+
GET /dedicated/housing/*
|
|
82
|
+
GET /dedicated/server/*
|
|
83
|
+
GET /domain/*
|
|
84
|
+
GET /email/pro/*
|
|
85
|
+
GET /hosting/web/*
|
|
69
86
|
```
|
|
70
87
|
|
|
71
88
|
## Opérations disponibles
|
|
@@ -77,28 +94,53 @@ GET /services/*
|
|
|
77
94
|
- Filtre par nom de service (`resourceName`)
|
|
78
95
|
- Filtre par route (`routes`, liste séparée par virgules)
|
|
79
96
|
- **Get Service**
|
|
80
|
-
- Sélection du type de service (Dedicated Server, Domain, Email,
|
|
97
|
+
- Sélection du type de service (Dedicated Ceph, Dedicated Cluster, Dedicated Housing, Dedicated Server, Domain, Email, Email Pro, Hosting)
|
|
81
98
|
- Sélection du service depuis une liste dynamique
|
|
99
|
+
- **Get Service Forms**
|
|
100
|
+
- Récupère les formulaires disponibles pour un service spécifique
|
|
101
|
+
- **Get Service Options**
|
|
102
|
+
- Récupère les options disponibles pour un service spécifique
|
|
103
|
+
- **Get Service Upgrades**
|
|
104
|
+
- Liste les offres vers lesquelles un service peut être converti
|
|
82
105
|
|
|
83
106
|
### Resource: Me
|
|
84
107
|
|
|
85
108
|
- **Sub-resource Me**
|
|
86
|
-
- **Get My Info** (`GET /me`)
|
|
109
|
+
- **Get My Info** (`GET /me`) : informations du compte authentifié
|
|
87
110
|
- **Sub-resource Bills**
|
|
88
|
-
- **List Bills**
|
|
89
|
-
-
|
|
111
|
+
- **List Bills** : liste toutes les factures avec détails
|
|
112
|
+
- **Get Bill** : récupère une facture spécifique par ID
|
|
113
|
+
- Filtres disponibles : catégorie (autorenew, earlyrenewal, purchase, purchase-cloud, purchase-servers, purchase-telecom, purchase-web), `orderId`
|
|
90
114
|
- **Sub-resource Debt Account**
|
|
91
|
-
- **Get Debt Account** (`GET /me/debtAccount`)
|
|
115
|
+
- **Get Debt Account** (`GET /me/debtAccount`) : informations sur le compte de dette
|
|
92
116
|
- **Sub-resource Orders**
|
|
93
|
-
- **
|
|
117
|
+
- **List Orders** : liste toutes les commandes
|
|
118
|
+
- **Get Order** : récupère une commande spécifique par ID
|
|
94
119
|
- Filtres disponibles : `date.from`, `date.to`
|
|
95
120
|
|
|
96
|
-
### Resource:
|
|
121
|
+
### Resource: Email
|
|
97
122
|
|
|
98
123
|
- **List Domains**
|
|
124
|
+
- Liste tous les domaines email disponibles
|
|
99
125
|
- **Get Domain**
|
|
100
|
-
|
|
101
|
-
|
|
126
|
+
- Récupère les détails d'un domaine email spécifique
|
|
127
|
+
- Sélection du domaine depuis une liste dynamique ou saisie manuelle
|
|
128
|
+
|
|
129
|
+
### Resource: VPS
|
|
130
|
+
|
|
131
|
+
- **List VPS**
|
|
132
|
+
- Liste tous les VPS disponibles
|
|
133
|
+
- **List Datacenters**
|
|
134
|
+
- Liste tous les datacenters disponibles pour l'utilisateur authentifié
|
|
135
|
+
- **Get VPS Details**
|
|
136
|
+
- Récupère les détails d'un VPS spécifique
|
|
137
|
+
- Sous-ressources disponibles : Automated Backup, Available Upgrade, Backup FTP, Datacenter, Disks, Distribution, IP Country Available, IPs, Models, Option, Secondary DNS Domains, Service Infos, Snapshot, Status, VPS
|
|
138
|
+
- **Disks Operations** :
|
|
139
|
+
- List Disks : liste tous les disques d'un VPS
|
|
140
|
+
- Get Disk : récupère les détails d'un disque spécifique
|
|
141
|
+
- **Create VPS Snapshot**
|
|
142
|
+
- Crée un snapshot d'un VPS
|
|
143
|
+
- Description personnalisable du snapshot
|
|
102
144
|
|
|
103
145
|
## Compatibilité
|
|
104
146
|
|
|
@@ -133,16 +175,21 @@ npm run release
|
|
|
133
175
|
```text
|
|
134
176
|
.
|
|
135
177
|
├── credentials/
|
|
136
|
-
│
|
|
178
|
+
│ ├── OvhCloudApi.credentials.ts
|
|
179
|
+
│ └── OvhCloudApi.credentials.js
|
|
137
180
|
├── nodes/
|
|
138
181
|
│ └── OvhCloud/
|
|
139
182
|
│ ├── OvhCloud.node.ts
|
|
140
|
-
│ ├──
|
|
141
|
-
│
|
|
142
|
-
│
|
|
143
|
-
│
|
|
144
|
-
│
|
|
183
|
+
│ ├── resources/
|
|
184
|
+
│ │ ├── email.ts
|
|
185
|
+
│ │ ├── me.ts
|
|
186
|
+
│ │ ├── services.ts
|
|
187
|
+
│ │ └── vps.ts
|
|
188
|
+
│ └── shared/
|
|
189
|
+
│ └── OvhCloudApiClient.ts
|
|
145
190
|
├── icons/
|
|
191
|
+
│ ├── ovh.svg
|
|
192
|
+
│ └── ovh_vertical.svg
|
|
146
193
|
└── dist/
|
|
147
194
|
```
|
|
148
195
|
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import { IExecuteFunctions, type INodeExecutionData, type INodeType, type INodeTypeDescription } from 'n8n-workflow';
|
|
2
2
|
export declare class OvhCloud implements INodeType {
|
|
3
3
|
description: INodeTypeDescription;
|
|
4
|
-
methods:
|
|
5
|
-
listSearch: {
|
|
6
|
-
getServices: typeof import("./listSearch/getServices").getServices;
|
|
7
|
-
};
|
|
8
|
-
};
|
|
4
|
+
methods: INodeType['methods'];
|
|
9
5
|
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|
|
10
6
|
}
|
|
@@ -3,9 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.OvhCloud = void 0;
|
|
4
4
|
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
5
|
const OvhCloudApi_credentials_1 = require("../../credentials/OvhCloudApi.credentials");
|
|
6
|
-
const domain_1 = require("./resources/domain");
|
|
7
6
|
const me_1 = require("./resources/me");
|
|
8
7
|
const services_1 = require("./resources/services");
|
|
8
|
+
const email_1 = require("./resources/email");
|
|
9
|
+
const vps_1 = require("./resources/vps");
|
|
9
10
|
class OvhCloud {
|
|
10
11
|
constructor() {
|
|
11
12
|
this.description = {
|
|
@@ -35,10 +36,6 @@ class OvhCloud {
|
|
|
35
36
|
type: 'options',
|
|
36
37
|
noDataExpression: true,
|
|
37
38
|
options: [
|
|
38
|
-
{
|
|
39
|
-
name: 'Domain',
|
|
40
|
-
value: 'domain',
|
|
41
|
-
},
|
|
42
39
|
{
|
|
43
40
|
name: 'Service',
|
|
44
41
|
value: 'services',
|
|
@@ -47,33 +44,52 @@ class OvhCloud {
|
|
|
47
44
|
name: 'Me',
|
|
48
45
|
value: 'me',
|
|
49
46
|
},
|
|
47
|
+
{
|
|
48
|
+
name: 'Email',
|
|
49
|
+
value: 'email',
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
name: 'VPS',
|
|
53
|
+
value: 'vps',
|
|
54
|
+
}
|
|
50
55
|
],
|
|
51
56
|
default: 'services',
|
|
52
57
|
},
|
|
53
|
-
...(0, domain_1.description)({ show: { resource: ['domain'] } }),
|
|
54
58
|
...(0, me_1.description)({ show: { resource: ['me'] } }),
|
|
55
59
|
...(0, services_1.description)({ show: { resource: ['services'] } }),
|
|
60
|
+
...(0, email_1.description)({ show: { resource: ['email'] } }),
|
|
61
|
+
...(0, vps_1.description)({ show: { resource: ['vps'] } }),
|
|
56
62
|
],
|
|
57
63
|
};
|
|
58
64
|
this.methods = {
|
|
59
65
|
listSearch: {
|
|
60
|
-
...domain_1.methodsListSearch,
|
|
61
66
|
...me_1.methodsListSearch,
|
|
62
67
|
...services_1.methodsListSearch,
|
|
68
|
+
...email_1.methodsListSearch,
|
|
69
|
+
...vps_1.methodsListSearch,
|
|
63
70
|
},
|
|
64
71
|
};
|
|
65
72
|
}
|
|
66
73
|
async execute() {
|
|
67
74
|
const resource = this.getNodeParameter('resource', 0);
|
|
75
|
+
let responseData;
|
|
68
76
|
switch (resource) {
|
|
69
|
-
case 'domain':
|
|
70
|
-
return [this.helpers.returnJsonArray(await domain_1.execute.call(this))];
|
|
71
77
|
case 'me':
|
|
72
|
-
|
|
78
|
+
responseData = await me_1.execute.call(this);
|
|
79
|
+
break;
|
|
73
80
|
case 'services':
|
|
74
|
-
|
|
81
|
+
responseData = await services_1.execute.call(this);
|
|
82
|
+
break;
|
|
83
|
+
case 'email':
|
|
84
|
+
responseData = await email_1.execute.call(this);
|
|
85
|
+
break;
|
|
86
|
+
case 'vps':
|
|
87
|
+
responseData = await vps_1.execute.call(this);
|
|
88
|
+
break;
|
|
89
|
+
default:
|
|
90
|
+
throw new n8n_workflow_1.NodeApiError(this.getNode(), { message: `The resource "${resource}" cannot be executed directly. Please select an operation to execute.` });
|
|
75
91
|
}
|
|
76
|
-
|
|
92
|
+
return [this.helpers.returnJsonArray(responseData)];
|
|
77
93
|
}
|
|
78
94
|
}
|
|
79
95
|
exports.OvhCloud = OvhCloud;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OvhCloud.node.js","sourceRoot":"","sources":["../../../nodes/OvhCloud/OvhCloud.node.ts"],"names":[],"mappings":";;;AAAA,+CAOsB;AACtB,uFAAkF;AAClF
|
|
1
|
+
{"version":3,"file":"OvhCloud.node.js","sourceRoot":"","sources":["../../../nodes/OvhCloud/OvhCloud.node.ts"],"names":[],"mappings":";;;AAAA,+CAOsB;AACtB,uFAAkF;AAClF,uCAIwB;AACxB,mDAI8B;AAC9B,6CAI2B;AAC3B,yCAIyB;AAEzB,MAAa,QAAQ;IAArB;QACI,gBAAW,GAAyB;YAChC,WAAW,EAAE,WAAW;YACxB,IAAI,EAAE,UAAU;YAChB,IAAI,EAAE,mCAAmC;YACzC,KAAK,EAAE,CAAC,OAAO,CAAC;YAChB,OAAO,EAAE,CAAC;YACV,QAAQ,EAAE,8DAA8D;YACxE,WAAW,EAAE,2BAA2B;YACxC,QAAQ,EAAE;gBACN,IAAI,EAAE,WAAW;aACpB;YACD,YAAY,EAAE,IAAI;YAClB,MAAM,EAAE,CAAC,kCAAmB,CAAC,IAAI,CAAC;YAClC,OAAO,EAAE,CAAC,kCAAmB,CAAC,IAAI,CAAC;YACnC,WAAW,EAAE;gBACT;oBACI,IAAI,EAAE,+CAAqB;oBAC3B,QAAQ,EAAE,IAAI;iBACjB;aACJ;YACD,UAAU,EAAE;gBAER;oBACI,WAAW,EAAE,UAAU;oBACvB,IAAI,EAAE,UAAU;oBAChB,IAAI,EAAE,SAAS;oBACf,gBAAgB,EAAE,IAAI;o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IAAI,CAAC,CAAC;gBAChD,MAAM;YACV,KAAK,OAAO;gBACR,YAAY,GAAG,MAAM,eAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBAC7C,MAAM;YACV,KAAK,KAAK;gBACN,YAAY,GAAG,MAAM,aAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBAC3C,MAAM;YACV;gBACI,MAAM,IAAI,2BAAY,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,iBAAiB,QAAQ,uEAAuE,EAAE,CAAC,CAAC;QAC9J,CAAC;QAED,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC,CAAC;IACxD,CAAC;CACJ;AAzFD,4BAyFC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { IDisplayOptions, IExecuteFunctions, ILoadOptionsFunctions, INodeExecutionData, INodeListSearchResult, INodeProperties } from "n8n-workflow";
|
|
2
|
+
export declare function description(displayOptions: IDisplayOptions): INodeProperties[];
|
|
3
|
+
export declare const methodsListSearch: {
|
|
4
|
+
getEmailDomains: (this: ILoadOptionsFunctions) => Promise<INodeListSearchResult>;
|
|
5
|
+
};
|
|
6
|
+
export declare function execute(this: IExecuteFunctions): Promise<INodeExecutionData[]>;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.methodsListSearch = void 0;
|
|
4
|
+
exports.description = description;
|
|
5
|
+
exports.execute = execute;
|
|
6
|
+
const OvhCloudApiClient_1 = require("../shared/OvhCloudApiClient");
|
|
7
|
+
function description(displayOptions) {
|
|
8
|
+
return [
|
|
9
|
+
{
|
|
10
|
+
displayName: 'Operation',
|
|
11
|
+
name: 'operation',
|
|
12
|
+
type: 'options',
|
|
13
|
+
noDataExpression: true,
|
|
14
|
+
options: [
|
|
15
|
+
{
|
|
16
|
+
name: 'List Domains',
|
|
17
|
+
value: 'list',
|
|
18
|
+
action: 'List all email domains',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: 'Get Domain',
|
|
22
|
+
value: 'get',
|
|
23
|
+
action: 'Get details of a email domain',
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
default: 'list',
|
|
27
|
+
displayOptions,
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
displayName: 'Domain Name',
|
|
31
|
+
name: 'domainName',
|
|
32
|
+
type: 'resourceLocator',
|
|
33
|
+
default: {
|
|
34
|
+
mode: 'list',
|
|
35
|
+
value: '',
|
|
36
|
+
},
|
|
37
|
+
required: true,
|
|
38
|
+
modes: [
|
|
39
|
+
{
|
|
40
|
+
displayName: 'By ID',
|
|
41
|
+
name: 'id',
|
|
42
|
+
type: 'string',
|
|
43
|
+
placeholder: 'Enter the domain name',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
displayName: 'From List',
|
|
47
|
+
name: 'list',
|
|
48
|
+
type: 'list',
|
|
49
|
+
placeholder: 'Select from the list',
|
|
50
|
+
typeOptions: {
|
|
51
|
+
searchListMethod: 'getEmailDomains',
|
|
52
|
+
searchable: true,
|
|
53
|
+
},
|
|
54
|
+
}
|
|
55
|
+
],
|
|
56
|
+
displayOptions: {
|
|
57
|
+
show: {
|
|
58
|
+
...displayOptions.show,
|
|
59
|
+
operation: ['get'],
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
];
|
|
64
|
+
}
|
|
65
|
+
exports.methodsListSearch = {
|
|
66
|
+
getEmailDomains: async function () {
|
|
67
|
+
const client = new OvhCloudApiClient_1.OvhCloudApiClient(this);
|
|
68
|
+
const results = await client.httpGet('/email/domain');
|
|
69
|
+
return { results: results.map((domain) => ({ name: domain, value: domain })) };
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
async function execute() {
|
|
73
|
+
const client = new OvhCloudApiClient_1.OvhCloudApiClient(this);
|
|
74
|
+
const operation = this.getNodeParameter('operation', 0, { extractValue: true });
|
|
75
|
+
const { value: domainName } = this.getNodeParameter('domainName', 0, { extractValue: true });
|
|
76
|
+
switch (operation) {
|
|
77
|
+
case 'list':
|
|
78
|
+
return await client.httpGet('/email/domain');
|
|
79
|
+
case 'get':
|
|
80
|
+
return await client.httpGet(`/email/domain/${domainName}`);
|
|
81
|
+
}
|
|
82
|
+
throw new Error(`The operation "${operation}" is not supported!`);
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=email.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"email.js","sourceRoot":"","sources":["../../../../nodes/OvhCloud/resources/email.ts"],"names":[],"mappings":";;;AAIA,kCAyDC;AAUD,0BAaC;AAnFD,mEAAgE;AAGhE,SAAgB,WAAW,CAAC,cAA+B;IACvD,OAAO;QACH;YACI,WAAW,EAAE,WAAW;YACxB,IAAI,EAAE,WAAW;YACjB,IAAI,EAAE,SAAS;YACf,gBAAgB,EAAE,IAAI;YACtB,OAAO,EAAE;gBACL;oBACI,IAAI,EAAE,cAAc;oBACpB,KAAK,EAAE,MAAM;oBACb,MAAM,EAAE,wBAAwB;iBACnC;gBACD;oBACI,IAAI,EAAE,YAAY;oBAClB,KAAK,EAAE,KAAK;oBACZ,MAAM,EAAE,+BAA+B;iBAC1C;aACJ;YACD,OAAO,EAAE,MAAM;YACf,cAAc;SACjB;QACD;YACI,WAAW,EAAE,aAAa;YAC1B,IAAI,EAAE,YAAY;YAClB,IAAI,EAAE,iBAAiB;YACvB,OAAO,EAAE;gBACL,IAAI,EAAE,MAAM;gBACZ,KAAK,EAAE,EAAE;aACZ;YACD,QAAQ,EAAE,IAAI;YACd,KAAK,EAAE;gBACH;oBACI,WAAW,EAAE,OAAO;oBACpB,IAAI,EAAE,IAAI;oBACV,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,uBAAuB;iBACvC;gBACD;oBACI,WAAW,EAAE,WAAW;oBACxB,IAAI,EAAE,M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CAAC;IAED,MAAM,IAAI,KAAK,CAAC,kBAAkB,SAAS,qBAAqB,CAAC,CAAC;AACtE,CAAC"}
|
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.methodsListSearch = void 0;
|
|
4
|
+
exports.description = description;
|
|
5
|
+
exports.execute = execute;
|
|
6
|
+
const OvhCloudApiClient_1 = require("../shared/OvhCloudApiClient");
|
|
7
|
+
function description(displayOptions) {
|
|
8
|
+
return [
|
|
9
|
+
{
|
|
10
|
+
displayName: 'Sub-Resource',
|
|
11
|
+
name: 'subResource',
|
|
12
|
+
type: 'options',
|
|
13
|
+
noDataExpression: true,
|
|
14
|
+
displayOptions,
|
|
15
|
+
options: [
|
|
16
|
+
{
|
|
17
|
+
name: 'Me',
|
|
18
|
+
value: 'me',
|
|
19
|
+
action: 'Operations about the authenticated user',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
name: 'Bills',
|
|
23
|
+
value: 'bills',
|
|
24
|
+
action: 'Operations about bills',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: 'Debt Account',
|
|
28
|
+
value: 'debtAccount',
|
|
29
|
+
action: 'Operations about debt account',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
name: 'Orders',
|
|
33
|
+
value: 'orders',
|
|
34
|
+
action: 'Operations about orders',
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
default: 'me',
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
displayName: 'Operation',
|
|
41
|
+
name: 'meOperation',
|
|
42
|
+
type: 'options',
|
|
43
|
+
noDataExpression: true,
|
|
44
|
+
options: [
|
|
45
|
+
{
|
|
46
|
+
name: 'Get My Info',
|
|
47
|
+
value: 'get',
|
|
48
|
+
action: 'Get information about the authenticated user',
|
|
49
|
+
},
|
|
50
|
+
],
|
|
51
|
+
default: 'get',
|
|
52
|
+
displayOptions: {
|
|
53
|
+
show: {
|
|
54
|
+
...displayOptions.show,
|
|
55
|
+
subResource: ['me'],
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
displayName: 'Bill Operation',
|
|
61
|
+
name: 'billOperation',
|
|
62
|
+
type: 'options',
|
|
63
|
+
noDataExpression: true,
|
|
64
|
+
options: [
|
|
65
|
+
{
|
|
66
|
+
name: 'List Bills',
|
|
67
|
+
value: 'list',
|
|
68
|
+
action: 'List bills',
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
name: 'Get Bill',
|
|
72
|
+
value: 'get',
|
|
73
|
+
action: 'Get a specific bill',
|
|
74
|
+
},
|
|
75
|
+
],
|
|
76
|
+
default: 'list',
|
|
77
|
+
displayOptions: {
|
|
78
|
+
show: {
|
|
79
|
+
...displayOptions.show,
|
|
80
|
+
subResource: ['bills'],
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
displayName: "Category",
|
|
86
|
+
name: "billCategory",
|
|
87
|
+
description: "Filter bills by category",
|
|
88
|
+
type: "options",
|
|
89
|
+
options: [
|
|
90
|
+
{ name: "All", value: "" },
|
|
91
|
+
{ name: 'Autorenew', value: "autorenew" },
|
|
92
|
+
{ name: "Earlyrenewal", value: "earlyrenewal" },
|
|
93
|
+
{ name: "Purchase", value: "purchase" },
|
|
94
|
+
{ name: "Purchase Cloud", value: "purchase-cloud" },
|
|
95
|
+
{ name: "Purchase Servers", value: "purchase-servers" },
|
|
96
|
+
{ name: "Purchase Telecom", value: "purchase-telecom" },
|
|
97
|
+
{ name: "Purchase Web", value: "purchase-web" },
|
|
98
|
+
],
|
|
99
|
+
default: "",
|
|
100
|
+
displayOptions: {
|
|
101
|
+
show: {
|
|
102
|
+
...displayOptions.show,
|
|
103
|
+
subResource: ['bills'],
|
|
104
|
+
billOperation: ['list'],
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
displayName: "Order ID",
|
|
110
|
+
name: "billOrderId",
|
|
111
|
+
type: "number",
|
|
112
|
+
default: 0,
|
|
113
|
+
description: "Filter bills related to this order ID",
|
|
114
|
+
displayOptions: {
|
|
115
|
+
show: {
|
|
116
|
+
...displayOptions.show,
|
|
117
|
+
subResource: ['bills'],
|
|
118
|
+
billOperation: ['list'],
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
displayName: "Bill ID",
|
|
124
|
+
name: "billId",
|
|
125
|
+
type: "string",
|
|
126
|
+
default: "",
|
|
127
|
+
required: true,
|
|
128
|
+
description: "Filter bills related to this bill ID",
|
|
129
|
+
displayOptions: {
|
|
130
|
+
show: {
|
|
131
|
+
...displayOptions.show,
|
|
132
|
+
subResource: ['bills'],
|
|
133
|
+
billOperation: ['get'],
|
|
134
|
+
},
|
|
135
|
+
},
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
displayName: 'Debt Account Operation',
|
|
139
|
+
name: 'debtAccountOperation',
|
|
140
|
+
type: 'options',
|
|
141
|
+
noDataExpression: true,
|
|
142
|
+
options: [
|
|
143
|
+
{
|
|
144
|
+
name: 'Get Debt Account',
|
|
145
|
+
value: 'get',
|
|
146
|
+
action: 'Get information about the debt account of the authenticated user',
|
|
147
|
+
},
|
|
148
|
+
],
|
|
149
|
+
default: 'get',
|
|
150
|
+
displayOptions: {
|
|
151
|
+
show: {
|
|
152
|
+
...displayOptions.show,
|
|
153
|
+
subResource: ['debtAccount'],
|
|
154
|
+
},
|
|
155
|
+
},
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
displayName: 'Order Operation',
|
|
159
|
+
name: 'orderOperation',
|
|
160
|
+
type: 'options',
|
|
161
|
+
noDataExpression: true,
|
|
162
|
+
options: [
|
|
163
|
+
{
|
|
164
|
+
name: 'List Orders',
|
|
165
|
+
value: 'list',
|
|
166
|
+
action: 'List all orders',
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
name: 'Get Order',
|
|
170
|
+
value: 'get',
|
|
171
|
+
action: 'Get a specific order by ID',
|
|
172
|
+
},
|
|
173
|
+
],
|
|
174
|
+
default: 'get',
|
|
175
|
+
displayOptions: {
|
|
176
|
+
show: {
|
|
177
|
+
...displayOptions.show,
|
|
178
|
+
subResource: ['orders'],
|
|
179
|
+
},
|
|
180
|
+
},
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
displayName: "Order ID",
|
|
184
|
+
name: "orderId",
|
|
185
|
+
type: "string",
|
|
186
|
+
default: "",
|
|
187
|
+
required: true,
|
|
188
|
+
description: "Filter orders related to this order ID",
|
|
189
|
+
displayOptions: {
|
|
190
|
+
show: {
|
|
191
|
+
...displayOptions.show,
|
|
192
|
+
subResource: ['orders'],
|
|
193
|
+
orderOperation: ['get'],
|
|
194
|
+
},
|
|
195
|
+
},
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
displayName: "Date From",
|
|
199
|
+
name: "dateFrom",
|
|
200
|
+
type: "dateTime",
|
|
201
|
+
default: null,
|
|
202
|
+
description: "Filter from this date (inclusive)",
|
|
203
|
+
displayOptions: {
|
|
204
|
+
show: {
|
|
205
|
+
...displayOptions.show,
|
|
206
|
+
subResource: ['bills', 'orders'],
|
|
207
|
+
billOperation: ['list'],
|
|
208
|
+
orderOperation: ['list'],
|
|
209
|
+
},
|
|
210
|
+
},
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
displayName: "Date To",
|
|
214
|
+
name: "dateTo",
|
|
215
|
+
type: "dateTime",
|
|
216
|
+
default: null,
|
|
217
|
+
description: "Filter up to this date (inclusive)",
|
|
218
|
+
displayOptions: {
|
|
219
|
+
show: {
|
|
220
|
+
...displayOptions.show,
|
|
221
|
+
subResource: ['bills', 'orders'],
|
|
222
|
+
billOperation: ['list'],
|
|
223
|
+
orderOperation: ['list'],
|
|
224
|
+
},
|
|
225
|
+
},
|
|
226
|
+
},
|
|
227
|
+
];
|
|
228
|
+
}
|
|
229
|
+
exports.methodsListSearch = {};
|
|
230
|
+
async function execute() {
|
|
231
|
+
const subResource = this.getNodeParameter('subResource', 0);
|
|
232
|
+
switch (subResource) {
|
|
233
|
+
case 'me':
|
|
234
|
+
return executeMe.call(this);
|
|
235
|
+
case 'bills':
|
|
236
|
+
return executeBill.call(this);
|
|
237
|
+
case 'debtAccount':
|
|
238
|
+
return executeDebtAccount.call(this);
|
|
239
|
+
case 'orders':
|
|
240
|
+
return executeOrder.call(this);
|
|
241
|
+
}
|
|
242
|
+
throw new Error(`Unsupported operation "${subResource}" for resource "me"`);
|
|
243
|
+
}
|
|
244
|
+
async function executeMe() {
|
|
245
|
+
const client = new OvhCloudApiClient_1.OvhCloudApiClient(this);
|
|
246
|
+
const operation = this.getNodeParameter('meOperation', 0, { extractValue: true });
|
|
247
|
+
switch (operation) {
|
|
248
|
+
case 'get':
|
|
249
|
+
return await client.httpGet(`/me`);
|
|
250
|
+
}
|
|
251
|
+
throw new Error('The resource "me" cannot be executed directly. Please select an operation to execute.');
|
|
252
|
+
}
|
|
253
|
+
async function executeBill() {
|
|
254
|
+
const operation = this.getNodeParameter('billOperation', 0, { extractValue: true });
|
|
255
|
+
const billId = this.getNodeParameter('billId', 0, { extractValue: true });
|
|
256
|
+
switch (operation) {
|
|
257
|
+
case 'list':
|
|
258
|
+
return executeBillList.call(this);
|
|
259
|
+
case 'get':
|
|
260
|
+
return [await executeBillGet.call(this, billId)];
|
|
261
|
+
}
|
|
262
|
+
throw new Error('The resource "bill" cannot be executed directly. Please select an operation to execute.');
|
|
263
|
+
}
|
|
264
|
+
async function executeBillList() {
|
|
265
|
+
const client = new OvhCloudApiClient_1.OvhCloudApiClient(this);
|
|
266
|
+
let qs = {};
|
|
267
|
+
const category = this.getNodeParameter('billCategory', 0, { extractValue: true });
|
|
268
|
+
if ((category === null || category === void 0 ? void 0 : category.length) > 0) {
|
|
269
|
+
qs = Object.assign(qs, { category });
|
|
270
|
+
}
|
|
271
|
+
const dateFrom = this.getNodeParameter('dateFrom', 0, { extractValue: true });
|
|
272
|
+
if ((dateFrom === null || dateFrom === void 0 ? void 0 : dateFrom.length) > 0) {
|
|
273
|
+
qs = Object.assign(qs, { 'date.from': dateFrom });
|
|
274
|
+
}
|
|
275
|
+
const dateTo = this.getNodeParameter('dateTo', 0, { extractValue: true });
|
|
276
|
+
if ((dateTo === null || dateTo === void 0 ? void 0 : dateTo.length) > 0) {
|
|
277
|
+
qs = Object.assign(qs, { 'date.to': dateTo });
|
|
278
|
+
}
|
|
279
|
+
const orderId = this.getNodeParameter('billOrderId', 0, { extractValue: true });
|
|
280
|
+
if (orderId > 0) {
|
|
281
|
+
qs = Object.assign(qs, { orderId });
|
|
282
|
+
}
|
|
283
|
+
const billIDs = await client.httpGet(`/me/bill`, qs);
|
|
284
|
+
const bills = [];
|
|
285
|
+
for (const billID of billIDs) {
|
|
286
|
+
const bill = await executeBillGet.call(this, billID);
|
|
287
|
+
bills.push(bill);
|
|
288
|
+
}
|
|
289
|
+
return bills;
|
|
290
|
+
}
|
|
291
|
+
async function executeBillGet(billID) {
|
|
292
|
+
const client = new OvhCloudApiClient_1.OvhCloudApiClient(this);
|
|
293
|
+
return await client.httpGet(`/me/bill/${billID}`);
|
|
294
|
+
}
|
|
295
|
+
async function executeDebtAccount() {
|
|
296
|
+
const client = new OvhCloudApiClient_1.OvhCloudApiClient(this);
|
|
297
|
+
const operation = this.getNodeParameter('debtAccountOperation', 0, { extractValue: true });
|
|
298
|
+
switch (operation) {
|
|
299
|
+
case 'get':
|
|
300
|
+
return [await client.httpGet(`/me/debtAccount`)];
|
|
301
|
+
}
|
|
302
|
+
throw new Error('The resource "debtAccount" cannot be executed directly. Please select an operation to execute.');
|
|
303
|
+
}
|
|
304
|
+
async function executeOrder() {
|
|
305
|
+
const operation = this.getNodeParameter('orderOperation', 0, { extractValue: true });
|
|
306
|
+
const orderId = this.getNodeParameter('orderId', 0, { extractValue: true });
|
|
307
|
+
switch (operation) {
|
|
308
|
+
case 'list':
|
|
309
|
+
return await executeOrderList.call(this);
|
|
310
|
+
case 'get':
|
|
311
|
+
return [await executeOrderGet.call(this, orderId)];
|
|
312
|
+
}
|
|
313
|
+
throw new Error('The resource "order" cannot be executed directly. Please select an operation to execute.');
|
|
314
|
+
}
|
|
315
|
+
async function executeOrderList() {
|
|
316
|
+
const client = new OvhCloudApiClient_1.OvhCloudApiClient(this);
|
|
317
|
+
let qs = {};
|
|
318
|
+
const dateFrom = this.getNodeParameter('dateFrom', 0, { extractValue: true });
|
|
319
|
+
if ((dateFrom === null || dateFrom === void 0 ? void 0 : dateFrom.length) > 0) {
|
|
320
|
+
qs = Object.assign(qs, { 'date.from': dateFrom });
|
|
321
|
+
}
|
|
322
|
+
const dateTo = this.getNodeParameter('dateTo', 0, { extractValue: true });
|
|
323
|
+
if ((dateTo === null || dateTo === void 0 ? void 0 : dateTo.length) > 0) {
|
|
324
|
+
qs = Object.assign(qs, { 'date.to': dateTo });
|
|
325
|
+
}
|
|
326
|
+
const orderIds = await client.httpGet(`/me/order`, qs);
|
|
327
|
+
const orders = [];
|
|
328
|
+
for (const orderId of orderIds) {
|
|
329
|
+
const order = await executeOrderGet.call(this, orderId);
|
|
330
|
+
orders.push(order);
|
|
331
|
+
}
|
|
332
|
+
return orders;
|
|
333
|
+
}
|
|
334
|
+
async function executeOrderGet(orderId) {
|
|
335
|
+
const client = new OvhCloudApiClient_1.OvhCloudApiClient(this);
|
|
336
|
+
return await client.httpGet(`/me/order/${orderId}`);
|
|
337
|
+
}
|
|
338
|
+
//# sourceMappingURL=me.js.map
|