@probo/n8n-nodes-probo 0.130.3 → 0.131.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/dist/nodes/Probo/actions/organization/getAll.operation.js +1 -1
- package/dist/nodes/Probo/actions/vendor/createContact.operation.d.ts +3 -0
- package/dist/nodes/Probo/actions/vendor/createContact.operation.js +113 -0
- package/dist/nodes/Probo/actions/vendor/createContact.operation.js.map +1 -0
- package/dist/nodes/Probo/actions/vendor/deleteContact.operation.d.ts +3 -0
- package/dist/nodes/Probo/actions/vendor/deleteContact.operation.js +37 -0
- package/dist/nodes/Probo/actions/vendor/deleteContact.operation.js.map +1 -0
- package/dist/nodes/Probo/actions/vendor/getAllContacts.operation.d.ts +3 -0
- package/dist/nodes/Probo/actions/vendor/getAllContacts.operation.js +121 -0
- package/dist/nodes/Probo/actions/vendor/getAllContacts.operation.js.map +1 -0
- package/dist/nodes/Probo/actions/vendor/getContact.operation.d.ts +3 -0
- package/dist/nodes/Probo/actions/vendor/getContact.operation.js +75 -0
- package/dist/nodes/Probo/actions/vendor/getContact.operation.js.map +1 -0
- package/dist/nodes/Probo/actions/vendor/index.d.ts +6 -1
- package/dist/nodes/Probo/actions/vendor/index.js +46 -1
- package/dist/nodes/Probo/actions/vendor/index.js.map +1 -1
- package/dist/nodes/Probo/actions/vendor/updateContact.operation.d.ts +3 -0
- package/dist/nodes/Probo/actions/vendor/updateContact.operation.js +99 -0
- package/dist/nodes/Probo/actions/vendor/updateContact.operation.js.map +1 -0
- package/dist/package.json +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.description = void 0;
|
|
4
|
+
exports.execute = execute;
|
|
5
|
+
const GenericFunctions_1 = require("../../GenericFunctions");
|
|
6
|
+
exports.description = [
|
|
7
|
+
{
|
|
8
|
+
displayName: 'Vendor ID',
|
|
9
|
+
name: 'vendorId',
|
|
10
|
+
type: 'string',
|
|
11
|
+
displayOptions: {
|
|
12
|
+
show: {
|
|
13
|
+
resource: ['vendor'],
|
|
14
|
+
operation: ['createContact'],
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
default: '',
|
|
18
|
+
description: 'The ID of the vendor',
|
|
19
|
+
required: true,
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
displayName: 'Full Name',
|
|
23
|
+
name: 'fullName',
|
|
24
|
+
type: 'string',
|
|
25
|
+
displayOptions: {
|
|
26
|
+
show: {
|
|
27
|
+
resource: ['vendor'],
|
|
28
|
+
operation: ['createContact'],
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
default: '',
|
|
32
|
+
description: 'The full name of the contact',
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
displayName: 'Email',
|
|
36
|
+
name: 'email',
|
|
37
|
+
type: 'string',
|
|
38
|
+
placeholder: 'name@email.com',
|
|
39
|
+
displayOptions: {
|
|
40
|
+
show: {
|
|
41
|
+
resource: ['vendor'],
|
|
42
|
+
operation: ['createContact'],
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
default: '',
|
|
46
|
+
description: 'The email address of the contact',
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
displayName: 'Phone',
|
|
50
|
+
name: 'phone',
|
|
51
|
+
type: 'string',
|
|
52
|
+
displayOptions: {
|
|
53
|
+
show: {
|
|
54
|
+
resource: ['vendor'],
|
|
55
|
+
operation: ['createContact'],
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
default: '',
|
|
59
|
+
description: 'The phone number of the contact',
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
displayName: 'Role',
|
|
63
|
+
name: 'role',
|
|
64
|
+
type: 'string',
|
|
65
|
+
displayOptions: {
|
|
66
|
+
show: {
|
|
67
|
+
resource: ['vendor'],
|
|
68
|
+
operation: ['createContact'],
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
default: '',
|
|
72
|
+
description: 'The role of the contact',
|
|
73
|
+
},
|
|
74
|
+
];
|
|
75
|
+
async function execute(itemIndex) {
|
|
76
|
+
const vendorId = this.getNodeParameter('vendorId', itemIndex);
|
|
77
|
+
const fullName = this.getNodeParameter('fullName', itemIndex, '');
|
|
78
|
+
const email = this.getNodeParameter('email', itemIndex, '');
|
|
79
|
+
const phone = this.getNodeParameter('phone', itemIndex, '');
|
|
80
|
+
const role = this.getNodeParameter('role', itemIndex, '');
|
|
81
|
+
const query = `
|
|
82
|
+
mutation CreateVendorContact($input: CreateVendorContactInput!) {
|
|
83
|
+
createVendorContact(input: $input) {
|
|
84
|
+
vendorContactEdge {
|
|
85
|
+
node {
|
|
86
|
+
id
|
|
87
|
+
fullName
|
|
88
|
+
email
|
|
89
|
+
phone
|
|
90
|
+
role
|
|
91
|
+
createdAt
|
|
92
|
+
updatedAt
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
`;
|
|
98
|
+
const input = { vendorId };
|
|
99
|
+
if (fullName)
|
|
100
|
+
input.fullName = fullName;
|
|
101
|
+
if (email)
|
|
102
|
+
input.email = email;
|
|
103
|
+
if (phone)
|
|
104
|
+
input.phone = phone;
|
|
105
|
+
if (role)
|
|
106
|
+
input.role = role;
|
|
107
|
+
const responseData = await GenericFunctions_1.proboApiRequest.call(this, query, { input });
|
|
108
|
+
return {
|
|
109
|
+
json: responseData,
|
|
110
|
+
pairedItem: { item: itemIndex },
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=createContact.operation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createContact.operation.js","sourceRoot":"","sources":["../../../../../nodes/Probo/actions/vendor/createContact.operation.ts"],"names":[],"mappings":";;;AAyEA,0BAwCC;AAhHD,6DAAyD;AAE5C,QAAA,WAA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
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.description = void 0;
|
|
4
|
+
exports.execute = execute;
|
|
5
|
+
const GenericFunctions_1 = require("../../GenericFunctions");
|
|
6
|
+
exports.description = [
|
|
7
|
+
{
|
|
8
|
+
displayName: 'Vendor Contact ID',
|
|
9
|
+
name: 'vendorContactId',
|
|
10
|
+
type: 'string',
|
|
11
|
+
displayOptions: {
|
|
12
|
+
show: {
|
|
13
|
+
resource: ['vendor'],
|
|
14
|
+
operation: ['deleteContact'],
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
default: '',
|
|
18
|
+
description: 'The ID of the vendor contact to delete',
|
|
19
|
+
required: true,
|
|
20
|
+
},
|
|
21
|
+
];
|
|
22
|
+
async function execute(itemIndex) {
|
|
23
|
+
const vendorContactId = this.getNodeParameter('vendorContactId', itemIndex);
|
|
24
|
+
const query = `
|
|
25
|
+
mutation DeleteVendorContact($input: DeleteVendorContactInput!) {
|
|
26
|
+
deleteVendorContact(input: $input) {
|
|
27
|
+
deletedVendorContactId
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
`;
|
|
31
|
+
const responseData = await GenericFunctions_1.proboApiRequest.call(this, query, { input: { vendorContactId } });
|
|
32
|
+
return {
|
|
33
|
+
json: responseData,
|
|
34
|
+
pairedItem: { item: itemIndex },
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=deleteContact.operation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deleteContact.operation.js","sourceRoot":"","sources":["../../../../../nodes/Probo/actions/vendor/deleteContact.operation.ts"],"names":[],"mappings":";;;AAoBA,0BAoBC;AAvCD,6DAAyD;AAE5C,QAAA,WAAW,GAAsB;IAC7C;QACC,WAAW,EAAE,mBAAmB;QAChC,IAAI,EAAE,iBAAiB;QACvB,IAAI,EAAE,QAAQ;QACd,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,QAAQ,EAAE,CAAC,QAAQ,CAAC;gBACpB,SAAS,EAAE,CAAC,eAAe,CAAC;aAC5B;SACD;QACD,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,wCAAwC;QACrD,QAAQ,EAAE,IAAI;KACd;CACD,CAAC;AAEK,KAAK,UAAU,OAAO,CAE5B,SAAiB;IAEjB,MAAM,eAAe,GAAG,IAAI,CAAC,gBAAgB,CAAC,iBAAiB,EAAE,SAAS,CAAW,CAAC;IAEtF,MAAM,KAAK,GAAG;;;;;;EAMb,CAAC;IAEF,MAAM,YAAY,GAAG,MAAM,kCAAe,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,eAAe,EAAE,EAAE,CAAC,CAAC;IAE7F,OAAO;QACN,IAAI,EAAE,YAAY;QAClB,UAAU,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;KAC/B,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.description = void 0;
|
|
4
|
+
exports.execute = execute;
|
|
5
|
+
const GenericFunctions_1 = require("../../GenericFunctions");
|
|
6
|
+
exports.description = [
|
|
7
|
+
{
|
|
8
|
+
displayName: 'Vendor ID',
|
|
9
|
+
name: 'vendorId',
|
|
10
|
+
type: 'string',
|
|
11
|
+
displayOptions: {
|
|
12
|
+
show: {
|
|
13
|
+
resource: ['vendor'],
|
|
14
|
+
operation: ['getAllContacts'],
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
default: '',
|
|
18
|
+
description: 'The ID of the vendor',
|
|
19
|
+
required: true,
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
displayName: 'Return All',
|
|
23
|
+
name: 'returnAll',
|
|
24
|
+
type: 'boolean',
|
|
25
|
+
displayOptions: {
|
|
26
|
+
show: {
|
|
27
|
+
resource: ['vendor'],
|
|
28
|
+
operation: ['getAllContacts'],
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
default: false,
|
|
32
|
+
description: 'Whether to return all results or only up to a given limit',
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
displayName: 'Limit',
|
|
36
|
+
name: 'limit',
|
|
37
|
+
type: 'number',
|
|
38
|
+
displayOptions: {
|
|
39
|
+
show: {
|
|
40
|
+
resource: ['vendor'],
|
|
41
|
+
operation: ['getAllContacts'],
|
|
42
|
+
returnAll: [false],
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
typeOptions: {
|
|
46
|
+
minValue: 1,
|
|
47
|
+
},
|
|
48
|
+
default: 50,
|
|
49
|
+
description: 'Max number of results to return',
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
displayName: 'Options',
|
|
53
|
+
name: 'options',
|
|
54
|
+
type: 'collection',
|
|
55
|
+
placeholder: 'Add Option',
|
|
56
|
+
default: {},
|
|
57
|
+
displayOptions: {
|
|
58
|
+
show: {
|
|
59
|
+
resource: ['vendor'],
|
|
60
|
+
operation: ['getAllContacts'],
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
options: [
|
|
64
|
+
{
|
|
65
|
+
displayName: 'Include Vendor',
|
|
66
|
+
name: 'includeVendor',
|
|
67
|
+
type: 'boolean',
|
|
68
|
+
default: false,
|
|
69
|
+
description: 'Whether to include vendor in the response',
|
|
70
|
+
},
|
|
71
|
+
],
|
|
72
|
+
},
|
|
73
|
+
];
|
|
74
|
+
async function execute(itemIndex) {
|
|
75
|
+
const vendorId = this.getNodeParameter('vendorId', itemIndex);
|
|
76
|
+
const returnAll = this.getNodeParameter('returnAll', itemIndex);
|
|
77
|
+
const limit = this.getNodeParameter('limit', itemIndex, 50);
|
|
78
|
+
const options = this.getNodeParameter('options', itemIndex, {});
|
|
79
|
+
const vendorFragment = options.includeVendor
|
|
80
|
+
? `vendor {
|
|
81
|
+
id
|
|
82
|
+
name
|
|
83
|
+
}`
|
|
84
|
+
: '';
|
|
85
|
+
const query = `
|
|
86
|
+
query GetVendorContacts($vendorId: ID!, $first: Int, $after: CursorKey) {
|
|
87
|
+
node(id: $vendorId) {
|
|
88
|
+
... on Vendor {
|
|
89
|
+
contacts(first: $first, after: $after) {
|
|
90
|
+
edges {
|
|
91
|
+
node {
|
|
92
|
+
id
|
|
93
|
+
fullName
|
|
94
|
+
email
|
|
95
|
+
phone
|
|
96
|
+
role
|
|
97
|
+
${vendorFragment}
|
|
98
|
+
createdAt
|
|
99
|
+
updatedAt
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
pageInfo {
|
|
103
|
+
hasNextPage
|
|
104
|
+
endCursor
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
`;
|
|
111
|
+
const vendorContacts = await GenericFunctions_1.proboApiRequestAllItems.call(this, query, { vendorId }, (response) => {
|
|
112
|
+
const data = response === null || response === void 0 ? void 0 : response.data;
|
|
113
|
+
const node = data === null || data === void 0 ? void 0 : data.node;
|
|
114
|
+
return node === null || node === void 0 ? void 0 : node.contacts;
|
|
115
|
+
}, returnAll, limit);
|
|
116
|
+
return {
|
|
117
|
+
json: { vendorContacts },
|
|
118
|
+
pairedItem: { item: itemIndex },
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
//# sourceMappingURL=getAllContacts.operation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getAllContacts.operation.js","sourceRoot":"","sources":["../../../../../nodes/Probo/actions/vendor/getAllContacts.operation.ts"],"names":[],"mappings":";;;AAwEA,0BA8DC;AArID,6DAAiE;AAEpD,QAAA,WAAW,GAAsB;IAC7C;QACC,WAAW,EAAE,WAAW;QACxB,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,QAAQ;QACd,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,QAAQ,EAAE,CAAC,QAAQ,CAAC;gBACpB,SAAS,EAAE,CAAC,gBAAgB,CA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IACxE,MAAM,SAAS,GAAG,IAAI,CAAC,gBAAgB,CAAC,WAAW,EAAE,SAAS,CAAY,CAAC;IAC3E,MAAM,KAAK,GAAG,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,SAAS,EAAE,EAAE,CAAW,CAAC;IACtE,MAAM,OAAO,GAAG,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,SAAS,EAAE,EAAE,CAE7D,CAAC;IAEF,MAAM,cAAc,GAAG,OAAO,CAAC,aAAa;QAC3C,CAAC,CAAC;;;IAGA;QACF,CAAC,CAAC,EAAE,CAAC;IAEN,MAAM,KAAK,GAAG;;;;;;;;;;;;UAYL,cAAc;;;;;;;;;;;;;EAatB,CAAC;IAEF,MAAM,cAAc,GAAG,MAAM,0CAAuB,CAAC,IAAI,CACxD,IAAI,EACJ,KAAK,EACL,EAAE,QAAQ,EAAE,EACZ,CAAC,QAAQ,EAAE,EAAE;QACZ,MAAM,IAAI,GAAG,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,IAA+B,CAAC;QACvD,MAAM,IAAI,GAAG,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,IAA+B,CAAC;QACnD,OAAO,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,QAAmC,CAAC;IAClD,CAAC,EACD,SAAS,EACT,KAAK,CACL,CAAC;IAEF,OAAO;QACN,IAAI,EAAE,EAAE,cAAc,EAAE;QACxB,UAAU,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;KAC/B,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.description = void 0;
|
|
4
|
+
exports.execute = execute;
|
|
5
|
+
const GenericFunctions_1 = require("../../GenericFunctions");
|
|
6
|
+
exports.description = [
|
|
7
|
+
{
|
|
8
|
+
displayName: 'Vendor Contact ID',
|
|
9
|
+
name: 'vendorContactId',
|
|
10
|
+
type: 'string',
|
|
11
|
+
displayOptions: {
|
|
12
|
+
show: {
|
|
13
|
+
resource: ['vendor'],
|
|
14
|
+
operation: ['getContact'],
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
default: '',
|
|
18
|
+
description: 'The ID of the vendor contact',
|
|
19
|
+
required: true,
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
displayName: 'Options',
|
|
23
|
+
name: 'options',
|
|
24
|
+
type: 'collection',
|
|
25
|
+
placeholder: 'Add Option',
|
|
26
|
+
default: {},
|
|
27
|
+
displayOptions: {
|
|
28
|
+
show: {
|
|
29
|
+
resource: ['vendor'],
|
|
30
|
+
operation: ['getContact'],
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
options: [
|
|
34
|
+
{
|
|
35
|
+
displayName: 'Include Vendor',
|
|
36
|
+
name: 'includeVendor',
|
|
37
|
+
type: 'boolean',
|
|
38
|
+
default: false,
|
|
39
|
+
description: 'Whether to include vendor in the response',
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
},
|
|
43
|
+
];
|
|
44
|
+
async function execute(itemIndex) {
|
|
45
|
+
const vendorContactId = this.getNodeParameter('vendorContactId', itemIndex);
|
|
46
|
+
const options = this.getNodeParameter('options', itemIndex, {});
|
|
47
|
+
const vendorFragment = options.includeVendor
|
|
48
|
+
? `vendor {
|
|
49
|
+
id
|
|
50
|
+
name
|
|
51
|
+
}`
|
|
52
|
+
: '';
|
|
53
|
+
const query = `
|
|
54
|
+
query GetVendorContact($vendorContactId: ID!) {
|
|
55
|
+
node(id: $vendorContactId) {
|
|
56
|
+
... on VendorContact {
|
|
57
|
+
id
|
|
58
|
+
fullName
|
|
59
|
+
email
|
|
60
|
+
phone
|
|
61
|
+
role
|
|
62
|
+
${vendorFragment}
|
|
63
|
+
createdAt
|
|
64
|
+
updatedAt
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
`;
|
|
69
|
+
const responseData = await GenericFunctions_1.proboApiRequest.call(this, query, { vendorContactId });
|
|
70
|
+
return {
|
|
71
|
+
json: responseData,
|
|
72
|
+
pairedItem: { item: itemIndex },
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=getContact.operation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getContact.operation.js","sourceRoot":"","sources":["../../../../../nodes/Probo/actions/vendor/getContact.operation.ts"],"names":[],"mappings":";;;AA0CA,0BAuCC;AAhFD,6DAAyD;AAE5C,QAAA,WAAW,GAAsB;IAC7C;QACC,WAAW,EAAE,mBAAmB;QAChC,IAAI,EAAE,iBAAiB;QACvB,IAAI,EAAE,QAAQ;QACd,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,QAAQ,EAAE,CAAC,QAAQ,CAAC;gBACpB,SAAS,EAAE,CAAC,YAAY,CAAC;aACzB;SACD;QACD,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,8BAA8B;QAC3C,QAAQ,EAAE,IAAI;KACd;IACD;QACC,WAAW,EAAE,SAAS;QACtB,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,YAAY;QAClB,WAAW,EAAE,YAAY;QACzB,OAAO,EAAE,EAAE;QACX,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,QAAQ,EAAE,CAAC,QAAQ,CAAC;gBACpB,SAAS,EAAE,CAAC,YAAY,CAAC;aACzB;SACD;QACD,OAAO,EAAE;YACR;gBACC,WAAW,EAAE,gBAAgB;gBAC7B,IAAI,EAAE,eAAe;gBACrB,IAAI,EAAE,SAAS;gBACf,OAAO,EAAE,KAAK;gBACd,WAAW,EAAE,2CAA2C;aACxD;SACD;KACD;CACD,CAAC;AAEK,KAAK,UAAU,OAAO,CAE5B,SAAiB;IAEjB,MAAM,eAAe,GAAG,IAAI,CAAC,gBAAgB,CAAC,iBAAiB,EAAE,SAAS,CAAW,CAAC;IACtF,MAAM,OAAO,GAAG,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,SAAS,EAAE,EAAE,CAE7D,CAAC;IAEF,MAAM,cAAc,GAAG,OAAO,CAAC,aAAa;QAC3C,CAAC,CAAC;;;IAGA;QACF,CAAC,CAAC,EAAE,CAAC;IAEN,MAAM,KAAK,GAAG;;;;;;;;;OASR,cAAc;;;;;;EAMnB,CAAC;IAEF,MAAM,YAAY,GAAG,MAAM,kCAAe,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,eAAe,EAAE,CAAC,CAAC;IAElF,OAAO;QACN,IAAI,EAAE,YAAY;QAClB,UAAU,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;KAC/B,CAAC;AACH,CAAC"}
|
|
@@ -4,6 +4,11 @@ import * as updateOp from './update.operation';
|
|
|
4
4
|
import * as deleteOp from './delete.operation';
|
|
5
5
|
import * as getOp from './get.operation';
|
|
6
6
|
import * as getAllOp from './getAll.operation';
|
|
7
|
+
import * as createContactOp from './createContact.operation';
|
|
8
|
+
import * as updateContactOp from './updateContact.operation';
|
|
9
|
+
import * as deleteContactOp from './deleteContact.operation';
|
|
10
|
+
import * as getContactOp from './getContact.operation';
|
|
11
|
+
import * as getAllContactsOp from './getAllContacts.operation';
|
|
7
12
|
import * as createServiceOp from './createService.operation';
|
|
8
13
|
import * as updateServiceOp from './updateService.operation';
|
|
9
14
|
import * as deleteServiceOp from './deleteService.operation';
|
|
@@ -13,4 +18,4 @@ import * as createRiskAssessmentOp from './createRiskAssessment.operation';
|
|
|
13
18
|
import * as getRiskAssessmentOp from './getRiskAssessment.operation';
|
|
14
19
|
import * as getAllRiskAssessmentsOp from './getAllRiskAssessments.operation';
|
|
15
20
|
export declare const description: INodeProperties[];
|
|
16
|
-
export { createOp as create, updateOp as update, deleteOp as delete, getOp as get, getAllOp as getAll, createServiceOp as createService, updateServiceOp as updateService, deleteServiceOp as deleteService, getServiceOp as getService, getAllServicesOp as getAllServices, createRiskAssessmentOp as createRiskAssessment, getRiskAssessmentOp as getRiskAssessment, getAllRiskAssessmentsOp as getAllRiskAssessments, };
|
|
21
|
+
export { createOp as create, updateOp as update, deleteOp as delete, getOp as get, getAllOp as getAll, createContactOp as createContact, updateContactOp as updateContact, deleteContactOp as deleteContact, getContactOp as getContact, getAllContactsOp as getAllContacts, createServiceOp as createService, updateServiceOp as updateService, deleteServiceOp as deleteService, getServiceOp as getService, getAllServicesOp as getAllServices, createRiskAssessmentOp as createRiskAssessment, getRiskAssessmentOp as getRiskAssessment, getAllRiskAssessmentsOp as getAllRiskAssessments, };
|
|
@@ -33,7 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.getAllRiskAssessments = exports.getRiskAssessment = exports.createRiskAssessment = exports.getAllServices = exports.getService = exports.deleteService = exports.updateService = exports.createService = exports.getAll = exports.get = exports.delete = exports.update = exports.create = exports.description = void 0;
|
|
36
|
+
exports.getAllRiskAssessments = exports.getRiskAssessment = exports.createRiskAssessment = exports.getAllServices = exports.getService = exports.deleteService = exports.updateService = exports.createService = exports.getAllContacts = exports.getContact = exports.deleteContact = exports.updateContact = exports.createContact = exports.getAll = exports.get = exports.delete = exports.update = exports.create = exports.description = void 0;
|
|
37
37
|
const createOp = __importStar(require("./create.operation"));
|
|
38
38
|
exports.create = createOp;
|
|
39
39
|
const updateOp = __importStar(require("./update.operation"));
|
|
@@ -44,6 +44,16 @@ const getOp = __importStar(require("./get.operation"));
|
|
|
44
44
|
exports.get = getOp;
|
|
45
45
|
const getAllOp = __importStar(require("./getAll.operation"));
|
|
46
46
|
exports.getAll = getAllOp;
|
|
47
|
+
const createContactOp = __importStar(require("./createContact.operation"));
|
|
48
|
+
exports.createContact = createContactOp;
|
|
49
|
+
const updateContactOp = __importStar(require("./updateContact.operation"));
|
|
50
|
+
exports.updateContact = updateContactOp;
|
|
51
|
+
const deleteContactOp = __importStar(require("./deleteContact.operation"));
|
|
52
|
+
exports.deleteContact = deleteContactOp;
|
|
53
|
+
const getContactOp = __importStar(require("./getContact.operation"));
|
|
54
|
+
exports.getContact = getContactOp;
|
|
55
|
+
const getAllContactsOp = __importStar(require("./getAllContacts.operation"));
|
|
56
|
+
exports.getAllContacts = getAllContactsOp;
|
|
47
57
|
const createServiceOp = __importStar(require("./createService.operation"));
|
|
48
58
|
exports.createService = createServiceOp;
|
|
49
59
|
const updateServiceOp = __importStar(require("./updateService.operation"));
|
|
@@ -78,6 +88,12 @@ exports.description = [
|
|
|
78
88
|
description: 'Create a new vendor',
|
|
79
89
|
action: 'Create a vendor',
|
|
80
90
|
},
|
|
91
|
+
{
|
|
92
|
+
name: 'Create Contact',
|
|
93
|
+
value: 'createContact',
|
|
94
|
+
description: 'Create a new vendor contact',
|
|
95
|
+
action: 'Create a vendor contact',
|
|
96
|
+
},
|
|
81
97
|
{
|
|
82
98
|
name: 'Create Risk Assessment',
|
|
83
99
|
value: 'createRiskAssessment',
|
|
@@ -96,6 +112,12 @@ exports.description = [
|
|
|
96
112
|
description: 'Delete a vendor',
|
|
97
113
|
action: 'Delete a vendor',
|
|
98
114
|
},
|
|
115
|
+
{
|
|
116
|
+
name: 'Delete Contact',
|
|
117
|
+
value: 'deleteContact',
|
|
118
|
+
description: 'Delete a vendor contact',
|
|
119
|
+
action: 'Delete a vendor contact',
|
|
120
|
+
},
|
|
99
121
|
{
|
|
100
122
|
name: 'Delete Service',
|
|
101
123
|
value: 'deleteService',
|
|
@@ -108,12 +130,24 @@ exports.description = [
|
|
|
108
130
|
description: 'Get a vendor',
|
|
109
131
|
action: 'Get a vendor',
|
|
110
132
|
},
|
|
133
|
+
{
|
|
134
|
+
name: 'Get Contact',
|
|
135
|
+
value: 'getContact',
|
|
136
|
+
description: 'Get a vendor contact',
|
|
137
|
+
action: 'Get a vendor contact',
|
|
138
|
+
},
|
|
111
139
|
{
|
|
112
140
|
name: 'Get Many',
|
|
113
141
|
value: 'getAll',
|
|
114
142
|
description: 'Get many vendors',
|
|
115
143
|
action: 'Get many vendors',
|
|
116
144
|
},
|
|
145
|
+
{
|
|
146
|
+
name: 'Get Many Contacts',
|
|
147
|
+
value: 'getAllContacts',
|
|
148
|
+
description: 'Get many vendor contacts',
|
|
149
|
+
action: 'Get many vendor contacts',
|
|
150
|
+
},
|
|
117
151
|
{
|
|
118
152
|
name: 'Get Many Risk Assessments',
|
|
119
153
|
value: 'getAllRiskAssessments',
|
|
@@ -144,6 +178,12 @@ exports.description = [
|
|
|
144
178
|
description: 'Update an existing vendor',
|
|
145
179
|
action: 'Update a vendor',
|
|
146
180
|
},
|
|
181
|
+
{
|
|
182
|
+
name: 'Update Contact',
|
|
183
|
+
value: 'updateContact',
|
|
184
|
+
description: 'Update an existing vendor contact',
|
|
185
|
+
action: 'Update a vendor contact',
|
|
186
|
+
},
|
|
147
187
|
{
|
|
148
188
|
name: 'Update Service',
|
|
149
189
|
value: 'updateService',
|
|
@@ -158,6 +198,11 @@ exports.description = [
|
|
|
158
198
|
...deleteOp.description,
|
|
159
199
|
...getOp.description,
|
|
160
200
|
...getAllOp.description,
|
|
201
|
+
...createContactOp.description,
|
|
202
|
+
...updateContactOp.description,
|
|
203
|
+
...deleteContactOp.description,
|
|
204
|
+
...getContactOp.description,
|
|
205
|
+
...getAllContactsOp.description,
|
|
161
206
|
...createServiceOp.description,
|
|
162
207
|
...updateServiceOp.description,
|
|
163
208
|
...deleteServiceOp.description,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../nodes/Probo/actions/vendor/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,6DAA+C;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../nodes/Probo/actions/vendor/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,6DAA+C;AAmKlC,0BAAM;AAlKnB,6DA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a;gBACnB,KAAK,EAAE,YAAY;gBACnB,WAAW,EAAE,sBAAsB;gBACnC,MAAM,EAAE,sBAAsB;aAC9B;YACD;gBACC,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,QAAQ;gBACf,WAAW,EAAE,2BAA2B;gBACxC,MAAM,EAAE,iBAAiB;aACzB;YACD;gBACC,IAAI,EAAE,gBAAgB;gBACtB,KAAK,EAAE,eAAe;gBACtB,WAAW,EAAE,mCAAmC;gBAChD,MAAM,EAAE,yBAAyB;aACjC;YACD;gBACC,IAAI,EAAE,gBAAgB;gBACtB,KAAK,EAAE,eAAe;gBACtB,WAAW,EAAE,mCAAmC;gBAChD,MAAM,EAAE,yBAAyB;aACjC;SACD;QACD,OAAO,EAAE,QAAQ;KACjB;IACD,GAAG,QAAQ,CAAC,WAAW;IACvB,GAAG,QAAQ,CAAC,WAAW;IACvB,GAAG,QAAQ,CAAC,WAAW;IACvB,GAAG,KAAK,CAAC,WAAW;IACpB,GAAG,QAAQ,CAAC,WAAW;IACvB,GAAG,eAAe,CAAC,WAAW;IAC9B,GAAG,eAAe,CAAC,WAAW;IAC9B,GAAG,eAAe,CAAC,WAAW;IAC9B,GAAG,YAAY,CAAC,WAAW;IAC3B,GAAG,gBAAgB,CAAC,WAAW;IAC/B,GAAG,eAAe,CAAC,WAAW;IAC9B,GAAG,eAAe,CAAC,WAAW;IAC9B,GAAG,eAAe,CAAC,WAAW;IAC9B,GAAG,YAAY,CAAC,WAAW;IAC3B,GAAG,gBAAgB,CAAC,WAAW;IAC/B,GAAG,sBAAsB,CAAC,WAAW;IACrC,GAAG,mBAAmB,CAAC,WAAW;IAClC,GAAG,uBAAuB,CAAC,WAAW;CACtC,CAAC"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.description = void 0;
|
|
4
|
+
exports.execute = execute;
|
|
5
|
+
const GenericFunctions_1 = require("../../GenericFunctions");
|
|
6
|
+
exports.description = [
|
|
7
|
+
{
|
|
8
|
+
displayName: 'Vendor Contact ID',
|
|
9
|
+
name: 'vendorContactId',
|
|
10
|
+
type: 'string',
|
|
11
|
+
displayOptions: {
|
|
12
|
+
show: {
|
|
13
|
+
resource: ['vendor'],
|
|
14
|
+
operation: ['updateContact'],
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
default: '',
|
|
18
|
+
description: 'The ID of the vendor contact to update',
|
|
19
|
+
required: true,
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
displayName: 'Additional Fields',
|
|
23
|
+
name: 'additionalFields',
|
|
24
|
+
type: 'collection',
|
|
25
|
+
placeholder: 'Add Field',
|
|
26
|
+
default: {},
|
|
27
|
+
displayOptions: {
|
|
28
|
+
show: {
|
|
29
|
+
resource: ['vendor'],
|
|
30
|
+
operation: ['updateContact'],
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
options: [
|
|
34
|
+
{
|
|
35
|
+
displayName: 'Email',
|
|
36
|
+
name: 'email',
|
|
37
|
+
type: 'string',
|
|
38
|
+
placeholder: 'name@email.com',
|
|
39
|
+
default: '',
|
|
40
|
+
description: 'The email address of the contact',
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
displayName: 'Full Name',
|
|
44
|
+
name: 'fullName',
|
|
45
|
+
type: 'string',
|
|
46
|
+
default: '',
|
|
47
|
+
description: 'The full name of the contact',
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
displayName: 'Phone',
|
|
51
|
+
name: 'phone',
|
|
52
|
+
type: 'string',
|
|
53
|
+
default: '',
|
|
54
|
+
description: 'The phone number of the contact',
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
displayName: 'Role',
|
|
58
|
+
name: 'role',
|
|
59
|
+
type: 'string',
|
|
60
|
+
default: '',
|
|
61
|
+
description: 'The role of the contact',
|
|
62
|
+
},
|
|
63
|
+
],
|
|
64
|
+
},
|
|
65
|
+
];
|
|
66
|
+
async function execute(itemIndex) {
|
|
67
|
+
const vendorContactId = this.getNodeParameter('vendorContactId', itemIndex);
|
|
68
|
+
const additionalFields = this.getNodeParameter('additionalFields', itemIndex, {});
|
|
69
|
+
const query = `
|
|
70
|
+
mutation UpdateVendorContact($input: UpdateVendorContactInput!) {
|
|
71
|
+
updateVendorContact(input: $input) {
|
|
72
|
+
vendorContact {
|
|
73
|
+
id
|
|
74
|
+
fullName
|
|
75
|
+
email
|
|
76
|
+
phone
|
|
77
|
+
role
|
|
78
|
+
createdAt
|
|
79
|
+
updatedAt
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
`;
|
|
84
|
+
const input = { id: vendorContactId };
|
|
85
|
+
if (additionalFields.fullName !== undefined)
|
|
86
|
+
input.fullName = additionalFields.fullName === '' ? null : additionalFields.fullName;
|
|
87
|
+
if (additionalFields.email !== undefined)
|
|
88
|
+
input.email = additionalFields.email === '' ? null : additionalFields.email;
|
|
89
|
+
if (additionalFields.phone !== undefined)
|
|
90
|
+
input.phone = additionalFields.phone === '' ? null : additionalFields.phone;
|
|
91
|
+
if (additionalFields.role !== undefined)
|
|
92
|
+
input.role = additionalFields.role === '' ? null : additionalFields.role;
|
|
93
|
+
const responseData = await GenericFunctions_1.proboApiRequest.call(this, query, { input });
|
|
94
|
+
return {
|
|
95
|
+
json: responseData,
|
|
96
|
+
pairedItem: { item: itemIndex },
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=updateContact.operation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"updateContact.operation.js","sourceRoot":"","sources":["../../../../../nodes/Probo/actions/vendor/updateContact.operation.ts"],"names":[],"mappings":";;;AAgEA,0BAwCC;AAvGD,6DAAyD;AAE5C,QAAA,WAAW,GAAsB;IAC7C;QACC,WAAW,EAAE,mBAAmB;QAChC,IAAI,EAAE,iBAAiB;QACvB,IAAI,EAAE,QAAQ;QACd,cA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