@magnetcustomer/n8n-nodes-magnetcustomer 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/LICENSE.md +19 -0
- package/README.md +25 -0
- package/dist/credentials/MagnetCustomerApi.credentials.js +29 -0
- package/dist/credentials/MagnetCustomerApi.credentials.js.map +1 -0
- package/dist/credentials/MagnetCustomerOAuth2Api.credentials.js +53 -0
- package/dist/credentials/MagnetCustomerOAuth2Api.credentials.js.map +1 -0
- package/dist/nodes/MagnetCustomer/GenericFunctions.js +204 -0
- package/dist/nodes/MagnetCustomer/GenericFunctions.js.map +1 -0
- package/dist/nodes/MagnetCustomer/MagnetCustomer.node.js +4258 -0
- package/dist/nodes/MagnetCustomer/MagnetCustomer.node.js.map +1 -0
- package/dist/nodes/MagnetCustomer/MagnetCustomer.node.json +18 -0
- package/dist/nodes/MagnetCustomer/MagnetCustomerTrigger.node.js +326 -0
- package/dist/nodes/MagnetCustomer/MagnetCustomerTrigger.node.js.map +1 -0
- package/dist/nodes/MagnetCustomer/MagnetCustomerTrigger.node.json +18 -0
- package/dist/nodes/MagnetCustomer/magnetcustomer.svg +4 -0
- package/dist/nodes/MagnetCustomer/utils.js +93 -0
- package/dist/nodes/MagnetCustomer/utils.js.map +1 -0
- package/dist/package.json +77 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +77 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Copyright 2022 n8n
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
4
|
+
this software and associated documentation files (the "Software"), to deal in
|
|
5
|
+
the Software without restriction, including without limitation the rights to
|
|
6
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
7
|
+
of the Software, and to permit persons to whom the Software is furnished to do
|
|
8
|
+
so, subject to the following conditions:
|
|
9
|
+
|
|
10
|
+
The above copyright notice and this permission notice shall be included in all
|
|
11
|
+
copies or substantial portions of the Software.
|
|
12
|
+
|
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
19
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<div>
|
|
2
|
+
|
|
3
|
+
[](https://t.me/codechatBR)
|
|
4
|
+
[](https://chat.whatsapp.com/HyO8X8K0bAo0bfaeW8bhY5)
|
|
5
|
+

|
|
6
|
+

|
|
7
|
+
[](https://community.n8n.io/)
|
|
8
|
+

|
|
9
|
+

|
|
10
|
+

|
|
11
|
+
|
|
12
|
+
</div>
|
|
13
|
+
|
|
14
|
+
<div><img src="./assets/cover.png" alt="Magnet Customer"></div>
|
|
15
|
+
|
|
16
|
+
# n8n-nodes-magnetcustomer
|
|
17
|
+
|
|
18
|
+
This is a [N8n](https://community.n8n.io) community node. It allows you to use [Magnet Customer API](https://developers.magnetcustomer.com) api to communicate with CRM Magnet Customer in your workflow.
|
|
19
|
+
|
|
20
|
+
# Compatibility
|
|
21
|
+
|
|
22
|
+
Tested on n8n version 1.62.0
|
|
23
|
+
|
|
24
|
+
# License
|
|
25
|
+
[MIT](./LICENSE.md)
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MagnetCustomerApi = void 0;
|
|
4
|
+
class MagnetCustomerApi {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.name = 'magnetCustomerApi';
|
|
7
|
+
this.displayName = 'MagnetCustomer API';
|
|
8
|
+
this.documentationUrl = 'https://developers.magnetcustomer.com';
|
|
9
|
+
this.properties = [
|
|
10
|
+
{
|
|
11
|
+
displayName: 'API Token',
|
|
12
|
+
name: 'apiToken',
|
|
13
|
+
type: 'string',
|
|
14
|
+
typeOptions: { password: true },
|
|
15
|
+
default: '',
|
|
16
|
+
},
|
|
17
|
+
];
|
|
18
|
+
this.authenticate = {
|
|
19
|
+
type: 'generic',
|
|
20
|
+
properties: {
|
|
21
|
+
headers: {
|
|
22
|
+
Authorization: 'Bearer ={{$credentials.apiToken}}',
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.MagnetCustomerApi = MagnetCustomerApi;
|
|
29
|
+
//# sourceMappingURL=MagnetCustomerApi.credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MagnetCustomerApi.credentials.js","sourceRoot":"","sources":["../../credentials/MagnetCustomerApi.credentials.ts"],"names":[],"mappings":";;;AAEA,MAAa,iBAAiB;IAA9B;QACC,SAAI,GAAG,mBAAmB,CAAC;QAE3B,gBAAW,GAAG,oBAAoB,CAAC;QAEnC,qBAAgB,GAAG,uCAAuC,CAAC;QAE3D,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,WAAW;gBACxB,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;gBAC/B,OAAO,EAAE,EAAE;aACX;SACD,CAAC;QAEF,iBAAY,GAAyB;YACpC,IAAI,EAAE,SAAS;YACf,UAAU,EAAE;gBACX,OAAO,EAAE;oBACR,aAAa,EAAE,mCAAmC;iBAClD;aACD;SACD,CAAC;IACH,CAAC;CAAA;AAzBD,8CAyBC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MagnetCustomerOAuth2Api = void 0;
|
|
4
|
+
class MagnetCustomerOAuth2Api {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.name = 'magnetCustomerOAuth2Api';
|
|
7
|
+
this.extends = ['oAuth2Api'];
|
|
8
|
+
this.displayName = 'MagnetCustomer OAuth2 API';
|
|
9
|
+
this.documentationUrl = 'https://developers.magnetcustomer.com';
|
|
10
|
+
this.properties = [
|
|
11
|
+
{
|
|
12
|
+
displayName: 'Grant Type',
|
|
13
|
+
name: 'grantType',
|
|
14
|
+
type: 'hidden',
|
|
15
|
+
default: 'authorizationCode',
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
displayName: 'Authorization URL',
|
|
19
|
+
name: 'authUrl',
|
|
20
|
+
type: 'hidden',
|
|
21
|
+
default: 'https://oauth.magnetcustomer.com/oauth/authorize',
|
|
22
|
+
required: true,
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
displayName: 'Access Token URL',
|
|
26
|
+
name: 'accessTokenUrl',
|
|
27
|
+
type: 'hidden',
|
|
28
|
+
default: 'https://oauth.magnetCustomer.com/oauth/token',
|
|
29
|
+
required: true,
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
displayName: 'Scope',
|
|
33
|
+
name: 'scope',
|
|
34
|
+
type: 'hidden',
|
|
35
|
+
default: '',
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
displayName: 'Auth URI Query Parameters',
|
|
39
|
+
name: 'authQueryParameters',
|
|
40
|
+
type: 'hidden',
|
|
41
|
+
default: '',
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
displayName: 'Authentication',
|
|
45
|
+
name: 'authentication',
|
|
46
|
+
type: 'hidden',
|
|
47
|
+
default: 'header',
|
|
48
|
+
},
|
|
49
|
+
];
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.MagnetCustomerOAuth2Api = MagnetCustomerOAuth2Api;
|
|
53
|
+
//# sourceMappingURL=MagnetCustomerOAuth2Api.credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MagnetCustomerOAuth2Api.credentials.js","sourceRoot":"","sources":["../../credentials/MagnetCustomerOAuth2Api.credentials.ts"],"names":[],"mappings":";;;AAEA,MAAa,uBAAuB;IAApC;QACC,SAAI,GAAG,yBAAyB,CAAC;QAEjC,YAAO,GAAG,CAAC,WAAW,CAAC,CAAC;QAExB,gBAAW,GAAG,2BAA2B,CAAC;QAE1C,qBAAgB,GAAG,uCAAuC,CAAC;QAE3D,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,YAAY;gBACzB,IAAI,EAAE,WAAW;gBACjB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,mBAAmB;aAC5B;YACD;gBACC,WAAW,EAAE,mBAAmB;gBAChC,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,kDAAkD;gBAC3D,QAAQ,EAAE,IAAI;aACd;YACD;gBACC,WAAW,EAAE,kBAAkB;gBAC/B,IAAI,EAAE,gBAAgB;gBACtB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,8CAA8C;gBACvD,QAAQ,EAAE,IAAI;aACd;YACD;gBACC,WAAW,EAAE,OAAO;gBACpB,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;aACX;YACD;gBACC,WAAW,EAAE,2BAA2B;gBACxC,IAAI,EAAE,qBAAqB;gBAC3B,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;aACX;YACD;gBACC,WAAW,EAAE,gBAAgB;gBAC7B,IAAI,EAAE,gBAAgB;gBACtB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,QAAQ;aACjB;SACD,CAAC;IACH,CAAC;CAAA;AAjDD,0DAiDC"}
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.sortOptionParameters = exports.magnetCustomerResolveCustomProperties = exports.magnetCustomerEncodeCustomProperties = exports.magnetCustomerGetCustomProperties = exports.magnetCustomerApiRequestAllItems = exports.magnetCustomerApiRequest = void 0;
|
|
13
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
14
|
+
function magnetCustomerApiRequest(method, endpoint, body, query = {}, formData, downloadFile) {
|
|
15
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
16
|
+
const authenticationMethod = this.getNodeParameter('authentication', 0);
|
|
17
|
+
const options = {
|
|
18
|
+
headers: {
|
|
19
|
+
Accept: 'application/json',
|
|
20
|
+
},
|
|
21
|
+
method,
|
|
22
|
+
qs: query,
|
|
23
|
+
uri: `https://api.magnetCustomer.com/v1${endpoint}`,
|
|
24
|
+
};
|
|
25
|
+
if (downloadFile === true) {
|
|
26
|
+
options.encoding = null;
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
options.json = true;
|
|
30
|
+
}
|
|
31
|
+
if (Object.keys(body).length !== 0) {
|
|
32
|
+
options.body = body;
|
|
33
|
+
}
|
|
34
|
+
if (formData !== undefined && Object.keys(formData).length !== 0) {
|
|
35
|
+
options.formData = formData;
|
|
36
|
+
}
|
|
37
|
+
if (query === undefined) {
|
|
38
|
+
query = {};
|
|
39
|
+
}
|
|
40
|
+
try {
|
|
41
|
+
const credentialType = authenticationMethod === 'apiToken' ? 'magnetCustomerApi' : 'magnetCustomerOAuth2Api';
|
|
42
|
+
const responseData = yield this.helpers.requestWithAuthentication.call(this, credentialType, options);
|
|
43
|
+
if (downloadFile === true) {
|
|
44
|
+
return {
|
|
45
|
+
data: responseData,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
if (responseData.success === false) {
|
|
49
|
+
throw new n8n_workflow_1.NodeApiError(this.getNode(), responseData);
|
|
50
|
+
}
|
|
51
|
+
return {
|
|
52
|
+
additionalData: responseData.additional_data,
|
|
53
|
+
data: responseData.data === null ? [] : responseData.data,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
catch (error) {
|
|
57
|
+
throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
exports.magnetCustomerApiRequest = magnetCustomerApiRequest;
|
|
62
|
+
function magnetCustomerApiRequestAllItems(method, endpoint, body, query) {
|
|
63
|
+
var _a, _b;
|
|
64
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
65
|
+
if (query === undefined) {
|
|
66
|
+
query = {};
|
|
67
|
+
}
|
|
68
|
+
query.limit = 100;
|
|
69
|
+
query.start = 0;
|
|
70
|
+
const returnData = [];
|
|
71
|
+
let responseData;
|
|
72
|
+
do {
|
|
73
|
+
responseData = yield magnetCustomerApiRequest.call(this, method, endpoint, body, query);
|
|
74
|
+
if (responseData.data.items) {
|
|
75
|
+
returnData.push.apply(returnData, responseData.data.items);
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
returnData.push.apply(returnData, responseData.data);
|
|
79
|
+
}
|
|
80
|
+
query.start = responseData.additionalData.pagination.next_start;
|
|
81
|
+
} while (((_b = (_a = responseData.additionalData) === null || _a === void 0 ? void 0 : _a.pagination) === null || _b === void 0 ? void 0 : _b.more_items_in_collection) === true);
|
|
82
|
+
return {
|
|
83
|
+
data: returnData,
|
|
84
|
+
};
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
exports.magnetCustomerApiRequestAllItems = magnetCustomerApiRequestAllItems;
|
|
88
|
+
function magnetCustomerGetCustomProperties(resource) {
|
|
89
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
90
|
+
const endpoints = {
|
|
91
|
+
activity: '/activityFields',
|
|
92
|
+
deal: '/dealFields',
|
|
93
|
+
organization: '/organizationFields',
|
|
94
|
+
person: '/personFields',
|
|
95
|
+
product: '/productFields',
|
|
96
|
+
};
|
|
97
|
+
if (endpoints[resource] === undefined) {
|
|
98
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The resource "${resource}" is not supported for resolving custom values!`);
|
|
99
|
+
}
|
|
100
|
+
const requestMethod = 'GET';
|
|
101
|
+
const body = {};
|
|
102
|
+
const qs = {};
|
|
103
|
+
const responseData = yield magnetCustomerApiRequest.call(this, requestMethod, endpoints[resource], body, qs);
|
|
104
|
+
const customProperties = {};
|
|
105
|
+
for (const customPropertyData of responseData.data) {
|
|
106
|
+
customProperties[customPropertyData.key] = customPropertyData;
|
|
107
|
+
}
|
|
108
|
+
return customProperties;
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
exports.magnetCustomerGetCustomProperties = magnetCustomerGetCustomProperties;
|
|
112
|
+
function magnetCustomerEncodeCustomProperties(customProperties, item) {
|
|
113
|
+
let customPropertyData;
|
|
114
|
+
for (const key of Object.keys(item)) {
|
|
115
|
+
customPropertyData = Object.values(customProperties).find((propertyData) => propertyData.name === key);
|
|
116
|
+
if (customPropertyData !== undefined) {
|
|
117
|
+
if (item[key] !== null &&
|
|
118
|
+
item[key] !== undefined &&
|
|
119
|
+
customPropertyData.options !== undefined &&
|
|
120
|
+
Array.isArray(customPropertyData.options)) {
|
|
121
|
+
const propertyOption = customPropertyData.options.find((option) => option.label.toString() === item[key].toString());
|
|
122
|
+
if (propertyOption !== undefined) {
|
|
123
|
+
item[customPropertyData.key] = propertyOption.id;
|
|
124
|
+
delete item[key];
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
item[customPropertyData.key] = item[key];
|
|
129
|
+
delete item[key];
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
exports.magnetCustomerEncodeCustomProperties = magnetCustomerEncodeCustomProperties;
|
|
135
|
+
function magnetCustomerResolveCustomProperties(customProperties, item) {
|
|
136
|
+
let customPropertyData;
|
|
137
|
+
const json = item.json;
|
|
138
|
+
for (const [key, value] of Object.entries(json)) {
|
|
139
|
+
if (customProperties[key] !== undefined) {
|
|
140
|
+
customPropertyData = customProperties[key];
|
|
141
|
+
if (value === null) {
|
|
142
|
+
json[customPropertyData.name] = value;
|
|
143
|
+
delete json[key];
|
|
144
|
+
continue;
|
|
145
|
+
}
|
|
146
|
+
if ([
|
|
147
|
+
'date',
|
|
148
|
+
'address',
|
|
149
|
+
'double',
|
|
150
|
+
'monetary',
|
|
151
|
+
'org',
|
|
152
|
+
'people',
|
|
153
|
+
'phone',
|
|
154
|
+
'text',
|
|
155
|
+
'time',
|
|
156
|
+
'user',
|
|
157
|
+
'varchar',
|
|
158
|
+
'varchar_auto',
|
|
159
|
+
'int',
|
|
160
|
+
'time',
|
|
161
|
+
'timerange',
|
|
162
|
+
].includes(customPropertyData.field_type)) {
|
|
163
|
+
json[customPropertyData.name] = value;
|
|
164
|
+
delete json[key];
|
|
165
|
+
}
|
|
166
|
+
else if (['enum', 'visible_to'].includes(customPropertyData.field_type) &&
|
|
167
|
+
customPropertyData.options) {
|
|
168
|
+
const propertyOption = customPropertyData.options.find((option) => option.id.toString() === (value === null || value === void 0 ? void 0 : value.toString()));
|
|
169
|
+
if (propertyOption !== undefined) {
|
|
170
|
+
json[customPropertyData.name] = propertyOption.label;
|
|
171
|
+
delete json[key];
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
else if (['set'].includes(customPropertyData.field_type) &&
|
|
175
|
+
customPropertyData.options &&
|
|
176
|
+
typeof value === 'string') {
|
|
177
|
+
const selectedIds = value.split(',');
|
|
178
|
+
const selectedLabels = customPropertyData.options
|
|
179
|
+
.filter((option) => selectedIds.includes(option.id.toString()))
|
|
180
|
+
.map((option) => option.label);
|
|
181
|
+
json[customPropertyData.name] = selectedLabels;
|
|
182
|
+
delete json[key];
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
item.json = json;
|
|
187
|
+
}
|
|
188
|
+
exports.magnetCustomerResolveCustomProperties = magnetCustomerResolveCustomProperties;
|
|
189
|
+
function sortOptionParameters(optionParameters) {
|
|
190
|
+
optionParameters.sort((a, b) => {
|
|
191
|
+
const aName = a.name.toLowerCase();
|
|
192
|
+
const bName = b.name.toLowerCase();
|
|
193
|
+
if (aName < bName) {
|
|
194
|
+
return -1;
|
|
195
|
+
}
|
|
196
|
+
if (aName > bName) {
|
|
197
|
+
return 1;
|
|
198
|
+
}
|
|
199
|
+
return 0;
|
|
200
|
+
});
|
|
201
|
+
return optionParameters;
|
|
202
|
+
}
|
|
203
|
+
exports.sortOptionParameters = sortOptionParameters;
|
|
204
|
+
//# sourceMappingURL=GenericFunctions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GenericFunctions.js","sourceRoot":"","sources":["../../../nodes/MagnetCustomer/GenericFunctions.ts"],"names":[],"mappings":";;;;;;;;;;;;AAUA,+CAAgE;AAoBhE,SAAsB,wBAAwB,CAE7C,MAA2B,EAC3B,QAAgB,EAChB,IAAiB,EACjB,QAAqB,EAAE,EACvB,QAAsB,EACtB,YAAsB;;QAEtB,MAAM,oBAAoB,GAAG,IAAI,CAAC,gBAAgB,CAAC,gBAAgB,EAAE,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