@owox/connectors 0.16.0-next-20251229144653 → 0.16.0-next-20251231152525
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/index.cjs +24 -11
- package/dist/index.js +24 -11
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1257,6 +1257,14 @@ var FormatUtils = {
|
|
|
1257
1257
|
(acc[key] = acc[key] || []).push(value.trim());
|
|
1258
1258
|
return acc;
|
|
1259
1259
|
}, {});
|
|
1260
|
+
},
|
|
1261
|
+
/**
|
|
1262
|
+
* Parse account IDs from a comma/semicolon separated string
|
|
1263
|
+
* @param {string} accountIdsString - Comma/semicolon separated list of account IDs
|
|
1264
|
+
* @return {Array<string>} Array of trimmed account IDs (non-empty strings)
|
|
1265
|
+
*/
|
|
1266
|
+
parseAccountIds: function(accountIdsString) {
|
|
1267
|
+
return String(accountIdsString).split(/[,;]\s*/).filter((id) => id.trim().length > 0);
|
|
1260
1268
|
}
|
|
1261
1269
|
};
|
|
1262
1270
|
var FileUtils = class FileUtils2 {
|
|
@@ -13283,11 +13291,11 @@ API Response: ${JSON.stringify(statusResult, null, 2)}`);
|
|
|
13283
13291
|
const response = await HttpUtils3.fetch(url);
|
|
13284
13292
|
const blob = await response.getBlob();
|
|
13285
13293
|
const files = FileUtils3.unzip(blob);
|
|
13286
|
-
|
|
13294
|
+
let allRows = [];
|
|
13287
13295
|
files.forEach((file) => {
|
|
13288
13296
|
const csvText = file.getDataAsString();
|
|
13289
13297
|
const rows = FileUtils3.parseCsv(csvText);
|
|
13290
|
-
allRows.
|
|
13298
|
+
allRows = allRows.concat(rows);
|
|
13291
13299
|
});
|
|
13292
13300
|
return allRows;
|
|
13293
13301
|
},
|
|
@@ -14346,11 +14354,11 @@ API Response: ${JSON.stringify(statusResult, null, 2)}`);
|
|
|
14346
14354
|
description: "Your Microsoft Ads API Refresh Token",
|
|
14347
14355
|
attributes: [CONFIG_ATTRIBUTES2.SECRET]
|
|
14348
14356
|
},
|
|
14349
|
-
|
|
14357
|
+
AccountIDs: {
|
|
14350
14358
|
isRequired: true,
|
|
14351
14359
|
requiredType: "string",
|
|
14352
|
-
label: "Account ID",
|
|
14353
|
-
description: "Your Microsoft Ads Account
|
|
14360
|
+
label: "Account ID(s)",
|
|
14361
|
+
description: "Your Microsoft Ads Account IDs (comma separated)"
|
|
14354
14362
|
},
|
|
14355
14363
|
CustomerID: {
|
|
14356
14364
|
isRequired: true,
|
|
@@ -14810,13 +14818,18 @@ API Response: ${JSON.stringify(statusResult, null, 2)}`);
|
|
|
14810
14818
|
* Processes all nodes defined in the fields configuration
|
|
14811
14819
|
*/
|
|
14812
14820
|
async startImportProcess() {
|
|
14821
|
+
const accountIds = FormatUtils.parseAccountIds(this.config.AccountIDs.value);
|
|
14813
14822
|
const fields = MicrosoftAdsHelper.parseFields(this.config.Fields.value);
|
|
14814
|
-
for (const
|
|
14815
|
-
|
|
14816
|
-
|
|
14817
|
-
|
|
14818
|
-
|
|
14819
|
-
|
|
14823
|
+
for (const rawAccountId of accountIds) {
|
|
14824
|
+
const accountId = rawAccountId.trim();
|
|
14825
|
+
this.config.logMessage(`Starting import process for Account ID: ${accountId}`);
|
|
14826
|
+
for (const nodeName in fields) {
|
|
14827
|
+
await this.processNode({
|
|
14828
|
+
nodeName,
|
|
14829
|
+
accountId,
|
|
14830
|
+
fields: fields[nodeName] || []
|
|
14831
|
+
});
|
|
14832
|
+
}
|
|
14820
14833
|
}
|
|
14821
14834
|
}
|
|
14822
14835
|
/**
|
package/dist/index.js
CHANGED
|
@@ -1255,6 +1255,14 @@ var FormatUtils = {
|
|
|
1255
1255
|
(acc[key] = acc[key] || []).push(value.trim());
|
|
1256
1256
|
return acc;
|
|
1257
1257
|
}, {});
|
|
1258
|
+
},
|
|
1259
|
+
/**
|
|
1260
|
+
* Parse account IDs from a comma/semicolon separated string
|
|
1261
|
+
* @param {string} accountIdsString - Comma/semicolon separated list of account IDs
|
|
1262
|
+
* @return {Array<string>} Array of trimmed account IDs (non-empty strings)
|
|
1263
|
+
*/
|
|
1264
|
+
parseAccountIds: function(accountIdsString) {
|
|
1265
|
+
return String(accountIdsString).split(/[,;]\s*/).filter((id) => id.trim().length > 0);
|
|
1258
1266
|
}
|
|
1259
1267
|
};
|
|
1260
1268
|
var FileUtils = class FileUtils2 {
|
|
@@ -13281,11 +13289,11 @@ API Response: ${JSON.stringify(statusResult, null, 2)}`);
|
|
|
13281
13289
|
const response = await HttpUtils3.fetch(url);
|
|
13282
13290
|
const blob = await response.getBlob();
|
|
13283
13291
|
const files = FileUtils3.unzip(blob);
|
|
13284
|
-
|
|
13292
|
+
let allRows = [];
|
|
13285
13293
|
files.forEach((file) => {
|
|
13286
13294
|
const csvText = file.getDataAsString();
|
|
13287
13295
|
const rows = FileUtils3.parseCsv(csvText);
|
|
13288
|
-
allRows.
|
|
13296
|
+
allRows = allRows.concat(rows);
|
|
13289
13297
|
});
|
|
13290
13298
|
return allRows;
|
|
13291
13299
|
},
|
|
@@ -14344,11 +14352,11 @@ API Response: ${JSON.stringify(statusResult, null, 2)}`);
|
|
|
14344
14352
|
description: "Your Microsoft Ads API Refresh Token",
|
|
14345
14353
|
attributes: [CONFIG_ATTRIBUTES2.SECRET]
|
|
14346
14354
|
},
|
|
14347
|
-
|
|
14355
|
+
AccountIDs: {
|
|
14348
14356
|
isRequired: true,
|
|
14349
14357
|
requiredType: "string",
|
|
14350
|
-
label: "Account ID",
|
|
14351
|
-
description: "Your Microsoft Ads Account
|
|
14358
|
+
label: "Account ID(s)",
|
|
14359
|
+
description: "Your Microsoft Ads Account IDs (comma separated)"
|
|
14352
14360
|
},
|
|
14353
14361
|
CustomerID: {
|
|
14354
14362
|
isRequired: true,
|
|
@@ -14808,13 +14816,18 @@ API Response: ${JSON.stringify(statusResult, null, 2)}`);
|
|
|
14808
14816
|
* Processes all nodes defined in the fields configuration
|
|
14809
14817
|
*/
|
|
14810
14818
|
async startImportProcess() {
|
|
14819
|
+
const accountIds = FormatUtils.parseAccountIds(this.config.AccountIDs.value);
|
|
14811
14820
|
const fields = MicrosoftAdsHelper.parseFields(this.config.Fields.value);
|
|
14812
|
-
for (const
|
|
14813
|
-
|
|
14814
|
-
|
|
14815
|
-
|
|
14816
|
-
|
|
14817
|
-
|
|
14821
|
+
for (const rawAccountId of accountIds) {
|
|
14822
|
+
const accountId = rawAccountId.trim();
|
|
14823
|
+
this.config.logMessage(`Starting import process for Account ID: ${accountId}`);
|
|
14824
|
+
for (const nodeName in fields) {
|
|
14825
|
+
await this.processNode({
|
|
14826
|
+
nodeName,
|
|
14827
|
+
accountId,
|
|
14828
|
+
fields: fields[nodeName] || []
|
|
14829
|
+
});
|
|
14830
|
+
}
|
|
14818
14831
|
}
|
|
14819
14832
|
}
|
|
14820
14833
|
/**
|