sfdx-jayree 4.5.1 → 4.6.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/CHANGELOG.md +8 -0
- package/README.md +71 -198
- package/lib/commands/jayree/flowtestcoverage.d.ts +8 -7
- package/lib/commands/jayree/flowtestcoverage.js +24 -15
- package/lib/commands/jayree/flowtestcoverage.js.map +1 -1
- package/lib/commands/jayree/org/settings.d.ts +9 -10
- package/lib/commands/jayree/org/settings.js +30 -26
- package/lib/commands/jayree/org/settings.js.map +1 -1
- package/lib/commands/jayree/org/streaming.d.ts +8 -9
- package/lib/commands/jayree/org/streaming.js +14 -14
- package/lib/commands/jayree/org/streaming.js.map +1 -1
- package/lib/commands/jayree/source/fix.d.ts +8 -9
- package/lib/commands/jayree/source/fix.js +12 -11
- package/lib/commands/jayree/source/fix.js.map +1 -1
- package/lib/commands/jayree/version.d.ts +3 -3
- package/lib/commands/jayree/version.js +4 -3
- package/lib/commands/jayree/version.js.map +1 -1
- package/lib/utils/config.js +0 -25
- package/lib/utils/config.js.map +1 -1
- package/lib/utils/stateFolderHandler.js +1 -2
- package/lib/utils/stateFolderHandler.js.map +1 -1
- package/oclif.manifest.json +76 -510
- package/package.json +86 -39
- package/config/countrystate.json +0 -93
- package/lib/commands/jayree/org/configure/country.d.ts +0 -11
- package/lib/commands/jayree/org/configure/country.js +0 -137
- package/lib/commands/jayree/org/configure/country.js.map +0 -1
- package/lib/commands/jayree/org/configure/index.d.ts +0 -15
- package/lib/commands/jayree/org/configure/index.js +0 -135
- package/lib/commands/jayree/org/configure/index.js.map +0 -1
- package/lib/commands/jayree/org/configure/state.d.ts +0 -16
- package/lib/commands/jayree/org/configure/state.js +0 -239
- package/lib/commands/jayree/org/configure/state.js.map +0 -1
- package/lib/jayreeSfdxCommand.d.ts +0 -4
- package/lib/jayreeSfdxCommand.js +0 -15
- package/lib/jayreeSfdxCommand.js.map +0 -1
- package/lib/utils/puppeteer/configuretasks.d.ts +0 -14
- package/lib/utils/puppeteer/configuretasks.js +0 -270
- package/lib/utils/puppeteer/configuretasks.js.map +0 -1
- package/lib/utils/puppeteer/statetasks.d.ts +0 -51
- package/lib/utils/puppeteer/statetasks.js +0 -385
- package/lib/utils/puppeteer/statetasks.js.map +0 -1
- package/lib/utils/renderer.d.ts +0 -45
- package/lib/utils/renderer.js +0 -461
- package/lib/utils/renderer.js.map +0 -1
- package/messages/configure.json +0 -5
- package/messages/createstatecountry.json +0 -9
- package/messages/scratchorgtrackingget.json +0 -3
- package/messages/scratchorgtrackinglist.json +0 -4
- package/messages/scratchorgtrackingset.json +0 -4
|
@@ -1,239 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2021, jayree
|
|
3
|
-
* All rights reserved.
|
|
4
|
-
* Licensed under the BSD 3-Clause license.
|
|
5
|
-
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
6
|
-
*/
|
|
7
|
-
import { dirname } from 'node:path';
|
|
8
|
-
import { fileURLToPath } from 'node:url';
|
|
9
|
-
import { flags, SfdxCommand } from '@salesforce/command';
|
|
10
|
-
import { Messages } from '@salesforce/core';
|
|
11
|
-
import { ListrLogger, Listr, PRESET_TIMER } from 'listr2';
|
|
12
|
-
import kit from '@salesforce/kit';
|
|
13
|
-
import Debug from 'debug';
|
|
14
|
-
import { MyDefaultRenderer } from '../../../../utils/renderer.js';
|
|
15
|
-
import { PuppeteerStateTasks } from '../../../../utils/puppeteer/statetasks.js';
|
|
16
|
-
// eslint-disable-next-line no-underscore-dangle
|
|
17
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
18
|
-
// eslint-disable-next-line no-underscore-dangle
|
|
19
|
-
const __dirname = dirname(__filename);
|
|
20
|
-
Messages.importMessagesDirectory(__dirname);
|
|
21
|
-
const messages = Messages.loadMessages('sfdx-jayree', 'createstatecountry');
|
|
22
|
-
const logger = new ListrLogger({ useIcons: false });
|
|
23
|
-
const debug = Debug('jayree:x:y');
|
|
24
|
-
class ImportState extends SfdxCommand {
|
|
25
|
-
async run() {
|
|
26
|
-
await this.org.refreshAuth();
|
|
27
|
-
const isContentTypeJSON = kit.env.getString('SFDX_CONTENT_TYPE', '').toUpperCase() === 'JSON';
|
|
28
|
-
this.isOutputEnabled = !(process.argv.find((arg) => arg === '--json') || isContentTypeJSON);
|
|
29
|
-
const taskRunner = new PuppeteerStateTasks({
|
|
30
|
-
accessToken: this.org.getConnection().accessToken,
|
|
31
|
-
instanceUrl: this.org.getConnection().instanceUrl,
|
|
32
|
-
});
|
|
33
|
-
const mainTasks = new Listr([
|
|
34
|
-
{
|
|
35
|
-
title: 'Get ISO 3166 Data',
|
|
36
|
-
task: async (ctx, task) => {
|
|
37
|
-
ctx.CountryCode = await taskRunner.validateParameterCountryCode(this.flags.countrycode);
|
|
38
|
-
ctx.category = taskRunner.validateParameterCategory(this.flags.category);
|
|
39
|
-
ctx.language = taskRunner.validateParameterLanguage(this.flags.language);
|
|
40
|
-
debug(ctx);
|
|
41
|
-
return task.newListr([
|
|
42
|
-
{
|
|
43
|
-
title: 'Country Code: ',
|
|
44
|
-
enabled: () => this.isOutputEnabled && process.stdout.isTTY,
|
|
45
|
-
skip: () => !!ctx.CountryCode.selected,
|
|
46
|
-
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
47
|
-
task: async (ctx, task) => {
|
|
48
|
-
if (ctx.CountryCode.selected === undefined) {
|
|
49
|
-
ctx.CountryCode.selected = await task.prompt({
|
|
50
|
-
type: 'AutoComplete',
|
|
51
|
-
message: 'Select Country',
|
|
52
|
-
choices: ctx.CountryCode.values,
|
|
53
|
-
});
|
|
54
|
-
ctx.CountryCode = await taskRunner.validateParameterCountryCode(ctx.CountryCode.selected);
|
|
55
|
-
ctx.category = taskRunner.validateParameterCategory(ctx.category.selected);
|
|
56
|
-
ctx.language = taskRunner.validateParameterLanguage(ctx.language.selected);
|
|
57
|
-
}
|
|
58
|
-
debug(ctx);
|
|
59
|
-
task.title = task.title + ctx.CountryCode.selected;
|
|
60
|
-
},
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
title: 'Category: ',
|
|
64
|
-
enabled: () => this.isOutputEnabled && process.stdout.isTTY,
|
|
65
|
-
skip: () => !!ctx.category.selected,
|
|
66
|
-
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
67
|
-
task: async (ctx, task) => {
|
|
68
|
-
if (ctx.category.selected === undefined) {
|
|
69
|
-
ctx.category.selected = await task.prompt({
|
|
70
|
-
type: 'Select',
|
|
71
|
-
message: 'Select Category',
|
|
72
|
-
choices: ctx.category.values,
|
|
73
|
-
});
|
|
74
|
-
ctx.category = taskRunner.validateParameterCategory(ctx.category.selected);
|
|
75
|
-
ctx.language = taskRunner.validateParameterLanguage(ctx.language.selected);
|
|
76
|
-
}
|
|
77
|
-
debug(ctx);
|
|
78
|
-
task.title = task.title + ctx.category.selected;
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
title: 'Language: ',
|
|
83
|
-
enabled: () => this.isOutputEnabled && process.stdout.isTTY,
|
|
84
|
-
skip: () => !!ctx.language.selected,
|
|
85
|
-
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
86
|
-
task: async (ctx, task) => {
|
|
87
|
-
if (ctx.language.selected === undefined) {
|
|
88
|
-
ctx.language.selected = await task.prompt({
|
|
89
|
-
type: 'Select',
|
|
90
|
-
message: 'Select Language',
|
|
91
|
-
choices: ctx.language.values,
|
|
92
|
-
});
|
|
93
|
-
ctx.language = taskRunner.validateParameterLanguage(ctx.language.selected);
|
|
94
|
-
}
|
|
95
|
-
debug(ctx);
|
|
96
|
-
task.title = task.title + ctx.language.selected;
|
|
97
|
-
},
|
|
98
|
-
},
|
|
99
|
-
]);
|
|
100
|
-
},
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
task: (ctx) => {
|
|
104
|
-
try {
|
|
105
|
-
ctx.data = taskRunner.validateData();
|
|
106
|
-
ctx.result = [];
|
|
107
|
-
}
|
|
108
|
-
catch (error) {
|
|
109
|
-
ctx.error = error.message;
|
|
110
|
-
throw error;
|
|
111
|
-
}
|
|
112
|
-
},
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
title: 'Set Country Integration Value: ',
|
|
116
|
-
enabled: (ctx) => (ctx.data ? true : false),
|
|
117
|
-
task: async (ctx, task) => {
|
|
118
|
-
task.title = task.title + ctx.CountryCode.selected;
|
|
119
|
-
if (!(await taskRunner.setCountryIntegrationValue())) {
|
|
120
|
-
task.skip();
|
|
121
|
-
}
|
|
122
|
-
},
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
title: 'Deactivate/Hide States',
|
|
126
|
-
enabled: (ctx) => (ctx.data?.deactivate ? ctx.data.deactivate.length > 0 : false),
|
|
127
|
-
task: (ctx, task) => task.newListr(() => {
|
|
128
|
-
const deactivateTasks = [];
|
|
129
|
-
ctx.data.deactivate.forEach((el) => {
|
|
130
|
-
deactivateTasks.push({
|
|
131
|
-
title: el.toString(),
|
|
132
|
-
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
133
|
-
skip: (ctx) => !ctx.data.deactivate.includes(el),
|
|
134
|
-
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
135
|
-
task: async (ctx, task) => {
|
|
136
|
-
const sTask = taskRunner.getNextDeactivate();
|
|
137
|
-
if (!(await sTask.executeDeactivate())) {
|
|
138
|
-
task.skip();
|
|
139
|
-
ctx.result.push({ '3166-2 code': el, status: 'skipped (deactivated)' });
|
|
140
|
-
}
|
|
141
|
-
else {
|
|
142
|
-
ctx.result.push({ '3166-2 code': el, status: 'updated (deactivated)' });
|
|
143
|
-
}
|
|
144
|
-
},
|
|
145
|
-
options: { persistentOutput: true },
|
|
146
|
-
});
|
|
147
|
-
});
|
|
148
|
-
return deactivateTasks;
|
|
149
|
-
}, { concurrent: this.flags.concurrent, exitOnError: false }),
|
|
150
|
-
},
|
|
151
|
-
{
|
|
152
|
-
title: 'Add States',
|
|
153
|
-
enabled: (ctx) => (ctx.data?.add ? ctx.data.add.length > 0 : false),
|
|
154
|
-
task: (ctx, task) => task.newListr(() => {
|
|
155
|
-
const addTasks = [];
|
|
156
|
-
ctx.data.add.forEach((el) => {
|
|
157
|
-
addTasks.push({
|
|
158
|
-
title: `${el['Subdivision name']} (${el['3166-2 code']})`,
|
|
159
|
-
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
160
|
-
skip: (ctx) => !ctx.data.add.includes(el),
|
|
161
|
-
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
162
|
-
task: async (ctx, task) => {
|
|
163
|
-
const sTask = taskRunner.getNextAdd();
|
|
164
|
-
const result = await sTask.executeAdd();
|
|
165
|
-
ctx.result.push({ ...el, status: result });
|
|
166
|
-
if (result === 'skipped') {
|
|
167
|
-
task.skip();
|
|
168
|
-
}
|
|
169
|
-
},
|
|
170
|
-
options: { persistentOutput: true },
|
|
171
|
-
});
|
|
172
|
-
});
|
|
173
|
-
return addTasks;
|
|
174
|
-
}, { concurrent: this.flags.concurrent, exitOnError: false }),
|
|
175
|
-
},
|
|
176
|
-
], {
|
|
177
|
-
renderer: MyDefaultRenderer,
|
|
178
|
-
rendererOptions: {
|
|
179
|
-
timer: {
|
|
180
|
-
...PRESET_TIMER,
|
|
181
|
-
condition: (duration) => duration > 250,
|
|
182
|
-
},
|
|
183
|
-
collapseErrors: false,
|
|
184
|
-
collapseSubtasks: false,
|
|
185
|
-
maxSubTasks: this.flags.concurrent >= 10 ? this.flags.concurrent : 10,
|
|
186
|
-
},
|
|
187
|
-
silentRendererCondition: !this.isOutputEnabled,
|
|
188
|
-
fallbackRendererCondition: debug.enabled,
|
|
189
|
-
exitOnError: true,
|
|
190
|
-
});
|
|
191
|
-
try {
|
|
192
|
-
await taskRunner.open();
|
|
193
|
-
const context = await mainTasks.run();
|
|
194
|
-
if (context.error) {
|
|
195
|
-
throw new Error(context.error);
|
|
196
|
-
}
|
|
197
|
-
context.result = context.result?.sort((a, b) => a['3166-2 code'] < b['3166-2 code'] ? -1 : a['3166-2 code'] > b['3166-2 code'] ? 1 : 0);
|
|
198
|
-
if (debug.enabled) {
|
|
199
|
-
if (this.isOutputEnabled) {
|
|
200
|
-
logger.toStderr(`Context: ${JSON.stringify(context, null, 2)}`);
|
|
201
|
-
}
|
|
202
|
-
return context;
|
|
203
|
-
}
|
|
204
|
-
return context.result;
|
|
205
|
-
}
|
|
206
|
-
catch (e) {
|
|
207
|
-
if (debug.enabled) {
|
|
208
|
-
if (this.isOutputEnabled) {
|
|
209
|
-
logger.toStderr(e);
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
throw e;
|
|
213
|
-
}
|
|
214
|
-
finally {
|
|
215
|
-
await taskRunner.close();
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
ImportState.description = messages.getMessage('commandStateDescription');
|
|
220
|
-
ImportState.flagsConfig = {
|
|
221
|
-
countrycode: flags.string({
|
|
222
|
-
description: messages.getMessage('countrycodeFlagDescription'),
|
|
223
|
-
}),
|
|
224
|
-
category: flags.string({
|
|
225
|
-
description: messages.getMessage('categoryFlagDescription'),
|
|
226
|
-
}),
|
|
227
|
-
language: flags.string({
|
|
228
|
-
description: messages.getMessage('languageFlagDescription'),
|
|
229
|
-
}),
|
|
230
|
-
concurrent: flags.integer({
|
|
231
|
-
description: 'ccc',
|
|
232
|
-
default: 1,
|
|
233
|
-
}),
|
|
234
|
-
};
|
|
235
|
-
ImportState.requiresUsername = true;
|
|
236
|
-
ImportState.supportsDevhubUsername = false;
|
|
237
|
-
ImportState.requiresProject = false;
|
|
238
|
-
export default ImportState;
|
|
239
|
-
//# sourceMappingURL=state.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../../../../src/commands/jayree/org/configure/state.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,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;QACxB,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,4BAA4B,CAAC;KAC/D,CAAC;IACF,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC;QACrB,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,yBAAyB,CAAC;KAC5D,CAAC;IACF,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC;QACrB,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,yBAAyB,CAAC;KAC5D,CAAC;IACF,UAAU,EAAE,KAAK,CAAC,OAAO,CAAC;QACxB,WAAW,EAAE,KAAK;QAClB,OAAO,EAAE,CAAC;KACX,CAAC;CACH,CAAC;AAEe,4BAAgB,GAAG,IAAI,CAAC;AACxB,kCAAsB,GAAG,KAAK,CAAC;AAC/B,2BAAe,GAAG,KAAK,CAAC;eArBtB,WAAW"}
|
package/lib/jayreeSfdxCommand.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2021, jayree
|
|
3
|
-
* All rights reserved.
|
|
4
|
-
* Licensed under the BSD 3-Clause license.
|
|
5
|
-
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
6
|
-
*/
|
|
7
|
-
import { SfdxCommand } from '@salesforce/command';
|
|
8
|
-
export class JayreeSfdxCommand extends SfdxCommand {
|
|
9
|
-
warnIfRunByAlias(aliases, id) {
|
|
10
|
-
if (aliases.some((r) => process.argv.includes(r))) {
|
|
11
|
-
this.ux.warn(`You are using a deprecated alias of the command: ${id}`);
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=jayreeSfdxCommand.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"jayreeSfdxCommand.js","sourceRoot":"","sources":["../src/jayreeSfdxCommand.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAElD,MAAM,OAAgB,iBAAkB,SAAQ,WAAW;IAClD,gBAAgB,CAAC,OAAiB,EAAE,EAAU;QACnD,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE;YACjD,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,oDAAoD,EAAE,EAAE,CAAC,CAAC;SACxE;IACH,CAAC;CACF"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export declare class PuppeteerConfigureTasks {
|
|
2
|
-
currenTask: any;
|
|
3
|
-
private tasks;
|
|
4
|
-
private nextTaskIndex;
|
|
5
|
-
private browser;
|
|
6
|
-
private context;
|
|
7
|
-
private auth;
|
|
8
|
-
constructor(auth: any, tasks: string[]);
|
|
9
|
-
private static subExec;
|
|
10
|
-
getNext(): this;
|
|
11
|
-
close(): Promise<void>;
|
|
12
|
-
open(): Promise<void>;
|
|
13
|
-
execute(listrTask: any): Promise<boolean>;
|
|
14
|
-
}
|
|
@@ -1,270 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2021, jayree
|
|
3
|
-
* All rights reserved.
|
|
4
|
-
* Licensed under the BSD 3-Clause license.
|
|
5
|
-
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
6
|
-
*/
|
|
7
|
-
import playwright from 'playwright-chromium';
|
|
8
|
-
import chalk from 'chalk';
|
|
9
|
-
import Debug from 'debug';
|
|
10
|
-
import config from '../config.js';
|
|
11
|
-
const debug = Debug('jayree:org:configure');
|
|
12
|
-
export class PuppeteerConfigureTasks {
|
|
13
|
-
constructor(auth, tasks) {
|
|
14
|
-
this.nextTaskIndex = -1;
|
|
15
|
-
this.tasks = tasks;
|
|
16
|
-
this.auth = auth;
|
|
17
|
-
}
|
|
18
|
-
// eslint-disable-next-line complexity
|
|
19
|
-
static async subExec(page, task) {
|
|
20
|
-
for await (const call of task.evaluate) {
|
|
21
|
-
if (call.action === 'click') {
|
|
22
|
-
try {
|
|
23
|
-
if (typeof call.waitFor === 'string') {
|
|
24
|
-
if (call.waitFor === 'Navigation') {
|
|
25
|
-
// Nothing to do
|
|
26
|
-
}
|
|
27
|
-
else if (call.waitFor !== '') {
|
|
28
|
-
const value = await page.evaluate((c) => {
|
|
29
|
-
const element = document.querySelector(c.waitFor);
|
|
30
|
-
return Boolean(element && (element.offsetWidth || element.offsetHeight || element.getClientRects().length));
|
|
31
|
-
}, call);
|
|
32
|
-
if (value === true) {
|
|
33
|
-
debug(`checked already ${call.type.checkbox.checked}`);
|
|
34
|
-
return false;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
if (typeof call.waitFor === 'object') {
|
|
39
|
-
if (typeof call.waitFor.querySelector === 'string') {
|
|
40
|
-
let value;
|
|
41
|
-
if (typeof call.waitFor.property !== 'undefined') {
|
|
42
|
-
value = await page.evaluate((c) => {
|
|
43
|
-
// eslint-disable-next-line no-underscore-dangle
|
|
44
|
-
let value_ = document.querySelector(c.waitFor.querySelector);
|
|
45
|
-
if (value_ !== null) {
|
|
46
|
-
value_ = value_[c.waitFor.property].trim();
|
|
47
|
-
return value_.includes(c.waitFor.value);
|
|
48
|
-
}
|
|
49
|
-
return false;
|
|
50
|
-
}, call);
|
|
51
|
-
}
|
|
52
|
-
if (value === true) {
|
|
53
|
-
debug('already done');
|
|
54
|
-
return false;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
if (typeof call.type === 'object' && call.type.checkbox) {
|
|
59
|
-
const state = await page.evaluate((c) => ({
|
|
60
|
-
checked: document.querySelector(c.querySelector).checked,
|
|
61
|
-
disabled: document.querySelector(c.querySelector).disabled,
|
|
62
|
-
}), call);
|
|
63
|
-
debug(state);
|
|
64
|
-
if (state.checked === call.type.checkbox.checked) {
|
|
65
|
-
debug(`checked already ${call.type.checkbox.checked}`);
|
|
66
|
-
return false;
|
|
67
|
-
}
|
|
68
|
-
else if (state.disabled) {
|
|
69
|
-
throw new Error('checkbox disabled');
|
|
70
|
-
}
|
|
71
|
-
else {
|
|
72
|
-
await page.evaluate((c) => {
|
|
73
|
-
document.querySelector(c.querySelector).click();
|
|
74
|
-
}, call);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
if (typeof call.type === 'object' && call.type.list) {
|
|
78
|
-
await page.waitForSelector('table', {
|
|
79
|
-
timeout: 300000,
|
|
80
|
-
state: 'visible',
|
|
81
|
-
});
|
|
82
|
-
debug({
|
|
83
|
-
[call.querySelectorAll]: await page.evaluate((c) => {
|
|
84
|
-
const elements = document.querySelectorAll(c.querySelectorAll);
|
|
85
|
-
const ret = [];
|
|
86
|
-
elements.forEach((element) => {
|
|
87
|
-
ret.push(element.textContent.trim());
|
|
88
|
-
});
|
|
89
|
-
return ret;
|
|
90
|
-
}, call),
|
|
91
|
-
});
|
|
92
|
-
const found = await page.evaluate((c) => {
|
|
93
|
-
const elements = document.querySelectorAll(c.querySelectorAll);
|
|
94
|
-
let ret = '';
|
|
95
|
-
elements.forEach((element) => {
|
|
96
|
-
if (element.textContent.trim() === c.type.list.selection) {
|
|
97
|
-
element.click();
|
|
98
|
-
ret = element.textContent.trim();
|
|
99
|
-
}
|
|
100
|
-
});
|
|
101
|
-
return ret;
|
|
102
|
-
}, call);
|
|
103
|
-
if (found !== call.type.list.selection) {
|
|
104
|
-
debug(`value ${call.type.list.selection} not found`);
|
|
105
|
-
return false;
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
if (typeof call.type === 'string' && call.type === 'button') {
|
|
109
|
-
if (await page.$(call.querySelector)) {
|
|
110
|
-
await page.evaluate((c) => {
|
|
111
|
-
document.querySelector(c.querySelector).click();
|
|
112
|
-
}, call);
|
|
113
|
-
}
|
|
114
|
-
else {
|
|
115
|
-
debug('button not found');
|
|
116
|
-
return false;
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
if (typeof call.type === 'string' && call.type === 'lightningbutton') {
|
|
120
|
-
const myCanvas = await page.$(call.querySelector);
|
|
121
|
-
if (myCanvas) {
|
|
122
|
-
const myCanvasBox = await myCanvas.boundingBox();
|
|
123
|
-
await page.mouse.click(myCanvasBox.x + myCanvasBox.width / 2, myCanvasBox.y + myCanvasBox.height / 2);
|
|
124
|
-
}
|
|
125
|
-
else {
|
|
126
|
-
debug('button not found');
|
|
127
|
-
return false;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
catch (error) {
|
|
132
|
-
throw new Error(error.message);
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
if (call.action === 'type') {
|
|
136
|
-
if (typeof call.value === 'string') {
|
|
137
|
-
const value = await page.evaluate((c) => {
|
|
138
|
-
const element = document.querySelector(c.querySelector);
|
|
139
|
-
return element.value;
|
|
140
|
-
}, call);
|
|
141
|
-
if (value === call.value) {
|
|
142
|
-
debug(`value already ${call.value}`);
|
|
143
|
-
return false;
|
|
144
|
-
}
|
|
145
|
-
else {
|
|
146
|
-
await page.evaluate((c) => {
|
|
147
|
-
const element = document.querySelector(c.querySelector);
|
|
148
|
-
element.value = c.value;
|
|
149
|
-
}, call);
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
if (typeof call.waitFor === 'string') {
|
|
154
|
-
if (call.waitFor === 'Navigation') {
|
|
155
|
-
await page.waitForNavigation({
|
|
156
|
-
waitUntil: 'networkidle',
|
|
157
|
-
timeout: 300000,
|
|
158
|
-
});
|
|
159
|
-
}
|
|
160
|
-
else if (call.waitFor !== '') {
|
|
161
|
-
await page.waitForSelector(call.waitFor, {
|
|
162
|
-
state: 'visible',
|
|
163
|
-
timeout: 300000,
|
|
164
|
-
});
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
if (Array.isArray(call.waitFor)) {
|
|
168
|
-
if (call.waitFor[0] === 'not') {
|
|
169
|
-
/* eslint no-constant-condition: ["error", { "checkLoops": false }] */
|
|
170
|
-
while (true) {
|
|
171
|
-
try {
|
|
172
|
-
// eslint-disable-next-line no-await-in-loop
|
|
173
|
-
await page.waitForSelector(call.waitFor[1], { state: 'hidden' });
|
|
174
|
-
break;
|
|
175
|
-
}
|
|
176
|
-
catch (e) {
|
|
177
|
-
debug(e.message);
|
|
178
|
-
// eslint-disable-next-line no-await-in-loop
|
|
179
|
-
await page.reload({
|
|
180
|
-
waitUntil: 'networkidle',
|
|
181
|
-
});
|
|
182
|
-
continue;
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
else {
|
|
187
|
-
await page.waitForSelector(call.waitFor[1], {
|
|
188
|
-
state: 'visible',
|
|
189
|
-
timeout: 300000,
|
|
190
|
-
});
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
if (typeof call.waitFor === 'object') {
|
|
194
|
-
if (typeof call.waitFor.querySelector === 'string') {
|
|
195
|
-
if (typeof call.waitFor.property !== 'undefined') {
|
|
196
|
-
await page.waitForFunction((c) => {
|
|
197
|
-
let value = document.querySelector(c.waitFor.querySelector);
|
|
198
|
-
if (value !== null) {
|
|
199
|
-
value = value[c.waitFor.property].trim();
|
|
200
|
-
return value.includes(c.waitFor.value);
|
|
201
|
-
}
|
|
202
|
-
return false;
|
|
203
|
-
}, call, {
|
|
204
|
-
timeout: 300000,
|
|
205
|
-
});
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
return true;
|
|
211
|
-
}
|
|
212
|
-
getNext() {
|
|
213
|
-
this.nextTaskIndex = this.nextTaskIndex + 1;
|
|
214
|
-
this.currenTask = this.tasks[this.nextTaskIndex];
|
|
215
|
-
return this;
|
|
216
|
-
}
|
|
217
|
-
async close() {
|
|
218
|
-
if (this.browser) {
|
|
219
|
-
await this.browser.close();
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
async open() {
|
|
223
|
-
if (!this.browser) {
|
|
224
|
-
this.browser = await playwright['chromium'].launch(config().puppeteer);
|
|
225
|
-
this.context = await this.browser.newContext();
|
|
226
|
-
const login = await this.context.newPage();
|
|
227
|
-
await login.goto(`${this.auth.instanceUrl}/secur/frontdoor.jsp?sid=${this.auth.accessToken}`, {
|
|
228
|
-
waitUntil: 'networkidle',
|
|
229
|
-
timeout: 300000,
|
|
230
|
-
});
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
async execute(listrTask) {
|
|
234
|
-
const task = this.currenTask;
|
|
235
|
-
if (!this.browser) {
|
|
236
|
-
await this.open();
|
|
237
|
-
}
|
|
238
|
-
if (!task.tasks) {
|
|
239
|
-
task.tasks = [{ evaluate: task.evaluate }];
|
|
240
|
-
}
|
|
241
|
-
let retValue = false;
|
|
242
|
-
for await (const subTask of task.tasks) {
|
|
243
|
-
const page = await this.context.newPage();
|
|
244
|
-
await page.goto(this.auth.instanceUrl + task.url, {
|
|
245
|
-
waitUntil: 'networkidle',
|
|
246
|
-
timeout: 300000,
|
|
247
|
-
});
|
|
248
|
-
if (task.iframe) {
|
|
249
|
-
await page.waitForSelector('iframe', { timeout: 300000, state: 'visible' });
|
|
250
|
-
await page.goto(page.frames()[task.iframe].url(), {
|
|
251
|
-
waitUntil: 'networkidle',
|
|
252
|
-
timeout: 300000,
|
|
253
|
-
});
|
|
254
|
-
}
|
|
255
|
-
if ((await PuppeteerConfigureTasks.subExec(page, subTask)) === true) {
|
|
256
|
-
retValue = true;
|
|
257
|
-
if (subTask.title) {
|
|
258
|
-
listrTask.output = `${subTask.title}`;
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
else if (subTask.title) {
|
|
262
|
-
listrTask.output = `${subTask.title} ${chalk.dim('[SKIPPED]')}`;
|
|
263
|
-
}
|
|
264
|
-
debug({ retValue });
|
|
265
|
-
}
|
|
266
|
-
debug({ retValue });
|
|
267
|
-
return retValue;
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
//# sourceMapping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AI,CAAC,eAAe,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;gBAC5E,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE;oBAChD,SAAS,EAAE,aAAa;oBACxB,OAAO,EAAE,MAAM;iBAChB,CAAC,CAAC;aACJ;YACD,IAAI,CAAC,MAAM,uBAAuB,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,KAAK,IAAI,EAAE;gBACnE,QAAQ,GAAG,IAAI,CAAC;gBAChB,IAAI,OAAO,CAAC,KAAK,EAAE;oBACjB,SAAS,CAAC,MAAM,GAAG,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;iBACvC;aACF;iBAAM,IAAI,OAAO,CAAC,KAAK,EAAE;gBACxB,SAAS,CAAC,MAAM,GAAG,GAAG,OAAO,CAAC,KAAK,IAAI,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC;aACjE;YACD,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC;SACrB;QACD,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC;QACpB,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF"}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
export declare class PuppeteerStateTasks {
|
|
2
|
-
currentAddTask: any;
|
|
3
|
-
currentDeactivateTask: any;
|
|
4
|
-
private addTasks;
|
|
5
|
-
private deactivateTasks;
|
|
6
|
-
private nextAddTaskIndex;
|
|
7
|
-
private nextDeactivateTaskIndex;
|
|
8
|
-
private browser;
|
|
9
|
-
private context;
|
|
10
|
-
private auth;
|
|
11
|
-
private countrycode;
|
|
12
|
-
private countries;
|
|
13
|
-
private language;
|
|
14
|
-
private category;
|
|
15
|
-
private ISOData;
|
|
16
|
-
constructor(auth: any);
|
|
17
|
-
private static setHTMLInputElementValue;
|
|
18
|
-
private static setHTMLInputElementChecked;
|
|
19
|
-
validateParameterCountryCode(countrycode: string): Promise<{
|
|
20
|
-
selected: any;
|
|
21
|
-
values: any;
|
|
22
|
-
}>;
|
|
23
|
-
validateParameterCategory(category: string): {
|
|
24
|
-
selected: any;
|
|
25
|
-
values: any;
|
|
26
|
-
};
|
|
27
|
-
validateParameterLanguage(language: string): {
|
|
28
|
-
selected: any;
|
|
29
|
-
values: any;
|
|
30
|
-
};
|
|
31
|
-
validateParameter(countrycode: string, category: string, language: string): Promise<{
|
|
32
|
-
countrycode: string;
|
|
33
|
-
category: string;
|
|
34
|
-
language: string;
|
|
35
|
-
}>;
|
|
36
|
-
validateData(): {
|
|
37
|
-
add: any;
|
|
38
|
-
deactivate: any;
|
|
39
|
-
};
|
|
40
|
-
getData(countrycode: string, category: string, language: string): Promise<{
|
|
41
|
-
add: any[];
|
|
42
|
-
deactivate: any[];
|
|
43
|
-
}>;
|
|
44
|
-
setCountryIntegrationValue(): Promise<boolean>;
|
|
45
|
-
executeAdd(): Promise<string>;
|
|
46
|
-
executeDeactivate(): Promise<boolean>;
|
|
47
|
-
getNextAdd(): this;
|
|
48
|
-
getNextDeactivate(): this;
|
|
49
|
-
close(): Promise<void>;
|
|
50
|
-
open(): Promise<void>;
|
|
51
|
-
}
|