@pdfbutler/migration-cli 0.0.18 → 0.0.20
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 +358 -119
- package/lib/commands/butler/pb/admincredentials.d.ts +24 -0
- package/lib/commands/butler/pb/admincredentials.js +160 -0
- package/lib/commands/butler/pb/admincredentials.js.map +1 -0
- package/lib/commands/butler/pb/adminsettings.d.ts +24 -0
- package/lib/commands/butler/pb/adminsettings.js +155 -0
- package/lib/commands/butler/pb/adminsettings.js.map +1 -0
- package/lib/commands/butler/pb/export.d.ts +11 -1
- package/lib/commands/butler/pb/export.js +169 -43
- package/lib/commands/butler/pb/export.js.map +1 -1
- package/lib/commands/butler/pb/exportpack.d.ts +27 -0
- package/lib/commands/butler/pb/exportpack.js +213 -0
- package/lib/commands/butler/pb/exportpack.js.map +1 -0
- package/lib/commands/butler/pb/import.d.ts +9 -1
- package/lib/commands/butler/pb/import.js +91 -10
- package/lib/commands/butler/pb/import.js.map +1 -1
- package/lib/commands/butler/pb/importpack.d.ts +27 -0
- package/lib/commands/butler/pb/importpack.js +226 -0
- package/lib/commands/butler/pb/importpack.js.map +1 -0
- package/messages/butler.pb.admincredentials.md +44 -0
- package/messages/butler.pb.adminsettings.md +44 -0
- package/messages/butler.pb.export.md +12 -0
- package/messages/butler.pb.exportpack.md +44 -0
- package/messages/butler.pb.import.md +8 -0
- package/messages/butler.pb.importpack.md +44 -0
- package/oclif.manifest.json +332 -5
- package/package.json +3 -3
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
4
|
+
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
|
5
|
+
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
|
6
|
+
/* eslint-disable complexity */
|
|
7
|
+
/* eslint-disable @typescript-eslint/no-misused-promises */
|
|
8
|
+
/* eslint-disable @typescript-eslint/no-unsafe-argument */
|
|
9
|
+
/* eslint-disable @typescript-eslint/restrict-template-expressions */
|
|
10
|
+
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
|
11
|
+
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
|
12
|
+
/* eslint-disable sf-plugin/no-missing-messages */
|
|
13
|
+
/* eslint-disable @typescript-eslint/prefer-for-of */
|
|
14
|
+
/* eslint-disable no-await-in-loop */
|
|
15
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
16
|
+
/* eslint-disable no-console */
|
|
17
|
+
const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
|
|
18
|
+
const core_1 = require("@salesforce/core");
|
|
19
|
+
const jsforce = require('jsforce');
|
|
20
|
+
const PATH_ADMIN = '/services/apexrest/cadmus_core/Manage/Admin';
|
|
21
|
+
const ERROR_URL = 'Could not find a match for URL';
|
|
22
|
+
const ERROR_VERSION = 'Verify that you have PDFButler version greater than v1.440.';
|
|
23
|
+
const MSG_CONNECTION_FAILED = 'Connection to Salesforce has been failed.';
|
|
24
|
+
const MSG_CREATION_CONNECTION = 'Creating Connection with the Salesforce org.';
|
|
25
|
+
const MSG_AUTHORIZATION = 'Authorization with the username: [VALUE].';
|
|
26
|
+
const MSG_NO_AUTH_PARAMS = 'No authentication parameters provided. Please provide either username or session and instance parameters.';
|
|
27
|
+
const MSG_RUN_AUTH_COMMAND = 'Run the command "sf org login web" before authenticating with the target.';
|
|
28
|
+
const MSG_CHECK_SESSION_INSTANCE = 'Check if the session is up to date and if the instance is correct.';
|
|
29
|
+
core_1.Messages.importMessagesDirectory(__dirname);
|
|
30
|
+
const messages = core_1.Messages.loadMessages('@pdfbutler/migration-cli', 'butler.pb.admincredentials');
|
|
31
|
+
class ButlerPbAdmincredentials extends sf_plugins_core_1.SfCommand {
|
|
32
|
+
static log(message, type = 'info') {
|
|
33
|
+
const prefix = type === 'info' ? '[INFO]' : '[ERROR]';
|
|
34
|
+
console.log(`${prefix} ${message}`);
|
|
35
|
+
}
|
|
36
|
+
static isBlank(value) {
|
|
37
|
+
return value?.trim() === ''
|
|
38
|
+
|| value === null
|
|
39
|
+
|| value === undefined;
|
|
40
|
+
}
|
|
41
|
+
static async authenticateWithTarget(username) {
|
|
42
|
+
try {
|
|
43
|
+
this.log(MSG_AUTHORIZATION.replace('[VALUE]', username));
|
|
44
|
+
const authInfo = await core_1.AuthInfo.create({ username });
|
|
45
|
+
this.log(MSG_CREATION_CONNECTION);
|
|
46
|
+
const connection = await core_1.Connection.create({ authInfo });
|
|
47
|
+
this.log(`Connected to ${username} (Org ID: ${authInfo.getFields().orgId})`);
|
|
48
|
+
return connection;
|
|
49
|
+
}
|
|
50
|
+
catch (error) {
|
|
51
|
+
this.log(MSG_RUN_AUTH_COMMAND, 'error');
|
|
52
|
+
throw new Error(MSG_CONNECTION_FAILED);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
static async authenticateWitsSession(session, instance) {
|
|
56
|
+
if (!this.isBlank(instance) && !this.isBlank(session)) {
|
|
57
|
+
const connection = await new jsforce.Connection({
|
|
58
|
+
instanceUrl: `${instance}`,
|
|
59
|
+
sessionId: `${session}`,
|
|
60
|
+
});
|
|
61
|
+
this.log(`Connected to ${connection.instanceUrl}`);
|
|
62
|
+
return connection;
|
|
63
|
+
}
|
|
64
|
+
else if (!this.isBlank(session) && this.isBlank(instance)) {
|
|
65
|
+
this.log('Instance URL (--instance) cannot be empty', 'error');
|
|
66
|
+
}
|
|
67
|
+
else if (this.isBlank(session) && !this.isBlank(instance)) {
|
|
68
|
+
this.log('Session Id (--session) cannot be empty', 'error');
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
this.log('Session Id and Instance URL (--session and --instance) cannot be empty', 'error');
|
|
72
|
+
}
|
|
73
|
+
this.log(MSG_CHECK_SESSION_INSTANCE, 'error');
|
|
74
|
+
throw new Error(MSG_CONNECTION_FAILED);
|
|
75
|
+
}
|
|
76
|
+
static async authenticate(username, session, instance) {
|
|
77
|
+
let connection;
|
|
78
|
+
if (this.isBlank(username) && (this.isBlank(session) || this.isBlank(instance))) {
|
|
79
|
+
throw new Error(MSG_NO_AUTH_PARAMS);
|
|
80
|
+
}
|
|
81
|
+
try {
|
|
82
|
+
if (this.isBlank(session) || this.isBlank(instance)) {
|
|
83
|
+
connection = await this.authenticateWithTarget(username);
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
connection = await this.authenticateWitsSession(session, instance);
|
|
87
|
+
}
|
|
88
|
+
return connection;
|
|
89
|
+
}
|
|
90
|
+
catch (error) {
|
|
91
|
+
throw new Error(MSG_CONNECTION_FAILED);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
async run() {
|
|
95
|
+
const { flags } = await this.parse(ButlerPbAdmincredentials);
|
|
96
|
+
const targetUsername = flags.target;
|
|
97
|
+
const session = flags.session;
|
|
98
|
+
const instance = flags.instance;
|
|
99
|
+
const data = {
|
|
100
|
+
username: flags.username,
|
|
101
|
+
password: flags.password,
|
|
102
|
+
userPassword: flags['user-password'],
|
|
103
|
+
};
|
|
104
|
+
try {
|
|
105
|
+
const connection = await ButlerPbAdmincredentials.authenticate(targetUsername, session, instance);
|
|
106
|
+
ButlerPbAdmincredentials.log(`Sending data to endpoint: ${JSON.stringify(data, null, 2)}`);
|
|
107
|
+
await connection.apex.put(PATH_ADMIN, data, { headers: { 'Content-Type': 'application/json' } });
|
|
108
|
+
ButlerPbAdmincredentials.log('Successfully imported user credentials.');
|
|
109
|
+
return { success: true };
|
|
110
|
+
}
|
|
111
|
+
catch (error) {
|
|
112
|
+
const message = error.message || error;
|
|
113
|
+
if (message.includes(ERROR_URL)) {
|
|
114
|
+
ButlerPbAdmincredentials.log(`${ERROR_URL}. ${ERROR_VERSION}`, 'error');
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
ButlerPbAdmincredentials.log(`Failed to import user credentials. Error: ${message}`, 'error');
|
|
118
|
+
}
|
|
119
|
+
return { success: false };
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
ButlerPbAdmincredentials.summary = messages.getMessage('summary');
|
|
124
|
+
ButlerPbAdmincredentials.description = messages.getMessage('description');
|
|
125
|
+
ButlerPbAdmincredentials.examples = messages.getMessages('examples');
|
|
126
|
+
ButlerPbAdmincredentials.flags = {
|
|
127
|
+
name: sf_plugins_core_1.Flags.string({
|
|
128
|
+
summary: messages.getMessage('flags.name.summary'),
|
|
129
|
+
description: messages.getMessage('flags.name.description'),
|
|
130
|
+
char: 'n',
|
|
131
|
+
required: false,
|
|
132
|
+
}),
|
|
133
|
+
target: sf_plugins_core_1.Flags.string({
|
|
134
|
+
summary: messages.getMessage('flags.target.summary'),
|
|
135
|
+
char: 't',
|
|
136
|
+
required: false,
|
|
137
|
+
}),
|
|
138
|
+
username: sf_plugins_core_1.Flags.string({
|
|
139
|
+
summary: messages.getMessage('flags.username.summary'),
|
|
140
|
+
char: 'u',
|
|
141
|
+
required: true,
|
|
142
|
+
}),
|
|
143
|
+
password: sf_plugins_core_1.Flags.string({
|
|
144
|
+
summary: messages.getMessage('flags.password.summary'),
|
|
145
|
+
char: 'p',
|
|
146
|
+
required: true,
|
|
147
|
+
}),
|
|
148
|
+
'user-password': sf_plugins_core_1.Flags.string({
|
|
149
|
+
summary: messages.getMessage('flags.user-password.summary'),
|
|
150
|
+
required: true,
|
|
151
|
+
}),
|
|
152
|
+
session: sf_plugins_core_1.Flags.string({
|
|
153
|
+
summary: messages.getMessage('flags.session.summary'),
|
|
154
|
+
}),
|
|
155
|
+
instance: sf_plugins_core_1.Flags.string({
|
|
156
|
+
summary: messages.getMessage('flags.instance.summary'),
|
|
157
|
+
}),
|
|
158
|
+
};
|
|
159
|
+
exports.default = ButlerPbAdmincredentials;
|
|
160
|
+
//# sourceMappingURL=admincredentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admincredentials.js","sourceRoot":"","sources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CAAC,UAAU,CAAC,wBAAwB,CAAC;KACvD,CAAC;CACH,CAAC;kBArCiB,wBAAwB"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
3
|
+
export type ButlerPbAdminsettingsResult = {
|
|
4
|
+
success: boolean;
|
|
5
|
+
};
|
|
6
|
+
export default class ButlerPbAdminsettings extends SfCommand<ButlerPbAdminsettingsResult> {
|
|
7
|
+
static readonly summary: string;
|
|
8
|
+
static readonly description: string;
|
|
9
|
+
static readonly examples: string[];
|
|
10
|
+
static readonly flags: {
|
|
11
|
+
url: import("@oclif/core/lib/interfaces").OptionFlag<import("url").URL, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
12
|
+
region: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
13
|
+
stage: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
14
|
+
target: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
15
|
+
session: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
16
|
+
instance: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
17
|
+
};
|
|
18
|
+
private static log;
|
|
19
|
+
private static isBlank;
|
|
20
|
+
private static authenticateWithTarget;
|
|
21
|
+
private static authenticateWitsSession;
|
|
22
|
+
private static authenticate;
|
|
23
|
+
run(): Promise<ButlerPbAdminsettingsResult>;
|
|
24
|
+
}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
4
|
+
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
|
5
|
+
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
|
6
|
+
/* eslint-disable complexity */
|
|
7
|
+
/* eslint-disable @typescript-eslint/no-misused-promises */
|
|
8
|
+
/* eslint-disable @typescript-eslint/no-unsafe-argument */
|
|
9
|
+
/* eslint-disable @typescript-eslint/restrict-template-expressions */
|
|
10
|
+
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
|
11
|
+
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
|
12
|
+
/* eslint-disable sf-plugin/no-missing-messages */
|
|
13
|
+
/* eslint-disable @typescript-eslint/prefer-for-of */
|
|
14
|
+
/* eslint-disable no-await-in-loop */
|
|
15
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
16
|
+
/* eslint-disable no-console */
|
|
17
|
+
const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
|
|
18
|
+
const core_1 = require("@salesforce/core");
|
|
19
|
+
const jsforce = require('jsforce');
|
|
20
|
+
const PATH_ADMIN = '/services/apexrest/cadmus_core/Manage/Admin';
|
|
21
|
+
const ERROR_URL = 'Could not find a match for URL';
|
|
22
|
+
const ERROR_VERSION = 'Verify that you have PDFButler version greater than v1.440.';
|
|
23
|
+
const MSG_CONNECTION_FAILED = 'Connection to Salesforce has been failed.';
|
|
24
|
+
const MSG_CREATION_CONNECTION = 'Creating Connection with the Salesforce org.';
|
|
25
|
+
const MSG_AUTHORIZATION = 'Authorization with the username: [VALUE].';
|
|
26
|
+
const MSG_NO_AUTH_PARAMS = 'No authentication parameters provided. Please provide either username or session and instance parameters.';
|
|
27
|
+
const MSG_RUN_AUTH_COMMAND = 'Run the command "sf org login web" before authenticating with the target.';
|
|
28
|
+
const MSG_CHECK_SESSION_INSTANCE = 'Check if the session is up to date and if the instance is correct.';
|
|
29
|
+
core_1.Messages.importMessagesDirectory(__dirname);
|
|
30
|
+
const messages = core_1.Messages.loadMessages('@pdfbutler/migration-cli', 'butler.pb.adminsettings');
|
|
31
|
+
class ButlerPbAdminsettings extends sf_plugins_core_1.SfCommand {
|
|
32
|
+
static log(message, type = 'info') {
|
|
33
|
+
const prefix = type === 'info' ? '[INFO]' : '[ERROR]';
|
|
34
|
+
console.log(`${prefix} ${message}`);
|
|
35
|
+
}
|
|
36
|
+
static isBlank(value) {
|
|
37
|
+
return value?.trim() === ''
|
|
38
|
+
|| value === null
|
|
39
|
+
|| value === undefined;
|
|
40
|
+
}
|
|
41
|
+
static async authenticateWithTarget(username) {
|
|
42
|
+
try {
|
|
43
|
+
this.log(MSG_AUTHORIZATION.replace('[VALUE]', username));
|
|
44
|
+
const authInfo = await core_1.AuthInfo.create({ username });
|
|
45
|
+
this.log(MSG_CREATION_CONNECTION);
|
|
46
|
+
const connection = await core_1.Connection.create({ authInfo });
|
|
47
|
+
this.log(`Connected to ${username} (Org ID: ${authInfo.getFields().orgId})`);
|
|
48
|
+
return connection;
|
|
49
|
+
}
|
|
50
|
+
catch (error) {
|
|
51
|
+
this.log(MSG_RUN_AUTH_COMMAND, 'error');
|
|
52
|
+
throw new Error(MSG_CONNECTION_FAILED);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
static async authenticateWitsSession(session, instance) {
|
|
56
|
+
if (!this.isBlank(instance) && !this.isBlank(session)) {
|
|
57
|
+
const connection = await new jsforce.Connection({
|
|
58
|
+
instanceUrl: `${instance}`,
|
|
59
|
+
sessionId: `${session}`,
|
|
60
|
+
});
|
|
61
|
+
this.log(`Connected to ${connection.instanceUrl}`);
|
|
62
|
+
return connection;
|
|
63
|
+
}
|
|
64
|
+
else if (!this.isBlank(session) && this.isBlank(instance)) {
|
|
65
|
+
this.log('Instance URL (--instance) cannot be empty', 'error');
|
|
66
|
+
}
|
|
67
|
+
else if (this.isBlank(session) && !this.isBlank(instance)) {
|
|
68
|
+
this.log('Session Id (--session) cannot be empty', 'error');
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
this.log('Session Id and Instance URL (--session and --instance) cannot be empty', 'error');
|
|
72
|
+
}
|
|
73
|
+
this.log(MSG_CHECK_SESSION_INSTANCE, 'error');
|
|
74
|
+
throw new Error(MSG_CONNECTION_FAILED);
|
|
75
|
+
}
|
|
76
|
+
static async authenticate(username, session, instance) {
|
|
77
|
+
let connection;
|
|
78
|
+
if (this.isBlank(username) && (this.isBlank(session) || this.isBlank(instance))) {
|
|
79
|
+
throw new Error(MSG_NO_AUTH_PARAMS);
|
|
80
|
+
}
|
|
81
|
+
try {
|
|
82
|
+
if (this.isBlank(session) || this.isBlank(instance)) {
|
|
83
|
+
connection = await this.authenticateWithTarget(username);
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
connection = await this.authenticateWitsSession(session, instance);
|
|
87
|
+
}
|
|
88
|
+
return connection;
|
|
89
|
+
}
|
|
90
|
+
catch (error) {
|
|
91
|
+
throw new Error(MSG_CONNECTION_FAILED);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
async run() {
|
|
95
|
+
const { flags } = await this.parse(ButlerPbAdminsettings);
|
|
96
|
+
const targetUsername = flags.target;
|
|
97
|
+
const session = flags.session;
|
|
98
|
+
const instance = flags.instance;
|
|
99
|
+
const data = {
|
|
100
|
+
url: flags.url,
|
|
101
|
+
region: flags.region,
|
|
102
|
+
stage: flags.stage,
|
|
103
|
+
};
|
|
104
|
+
try {
|
|
105
|
+
const connection = await ButlerPbAdminsettings.authenticate(targetUsername, session, instance);
|
|
106
|
+
ButlerPbAdminsettings.log(`Sending data to endpoint:\n${JSON.stringify(data, null, 2)}`);
|
|
107
|
+
await connection.apex.post(PATH_ADMIN, data, { headers: { 'Content-Type': 'application/json' } });
|
|
108
|
+
ButlerPbAdminsettings.log('Settings successfully imported.');
|
|
109
|
+
return { success: true };
|
|
110
|
+
}
|
|
111
|
+
catch (error) {
|
|
112
|
+
const message = error.message || error;
|
|
113
|
+
if (message.includes(ERROR_URL)) {
|
|
114
|
+
ButlerPbAdminsettings.log(`${ERROR_URL}. ${ERROR_VERSION}`, 'error');
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
ButlerPbAdminsettings.log(`Failed while settings import. Error: ${message}`, 'error');
|
|
118
|
+
}
|
|
119
|
+
return { success: false };
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
ButlerPbAdminsettings.summary = messages.getMessage('summary');
|
|
124
|
+
ButlerPbAdminsettings.description = messages.getMessage('description');
|
|
125
|
+
ButlerPbAdminsettings.examples = messages.getMessages('examples');
|
|
126
|
+
ButlerPbAdminsettings.flags = {
|
|
127
|
+
url: sf_plugins_core_1.Flags.url({
|
|
128
|
+
summary: messages.getMessage('flags.url.summary'),
|
|
129
|
+
char: 'u',
|
|
130
|
+
required: true,
|
|
131
|
+
}),
|
|
132
|
+
region: sf_plugins_core_1.Flags.string({
|
|
133
|
+
summary: messages.getMessage('flags.region.summary'),
|
|
134
|
+
char: 'r',
|
|
135
|
+
required: true,
|
|
136
|
+
}),
|
|
137
|
+
stage: sf_plugins_core_1.Flags.string({
|
|
138
|
+
summary: messages.getMessage('flags.stage.summary'),
|
|
139
|
+
char: 's',
|
|
140
|
+
required: true,
|
|
141
|
+
}),
|
|
142
|
+
target: sf_plugins_core_1.Flags.string({
|
|
143
|
+
summary: messages.getMessage('flags.target.summary'),
|
|
144
|
+
char: 't',
|
|
145
|
+
required: false,
|
|
146
|
+
}),
|
|
147
|
+
session: sf_plugins_core_1.Flags.string({
|
|
148
|
+
summary: messages.getMessage('flags.session.summary'),
|
|
149
|
+
}),
|
|
150
|
+
instance: sf_plugins_core_1.Flags.string({
|
|
151
|
+
summary: messages.getMessage('flags.instance.summary'),
|
|
152
|
+
}),
|
|
153
|
+
};
|
|
154
|
+
exports.default = ButlerPbAdminsettings;
|
|
155
|
+
//# sourceMappingURL=adminsettings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adminsettings.js","sourceRoot":"","sources":["../../../../src/commands/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AAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;AACzC,iCAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;AACjD,8BAAQ,GAAG,QAAQ,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;AAE5C,2BAAK,GAAG;IAC7B,GAAG,EAAE,uBAAK,CAAC,GAAG,CAAC;QACb,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,mBAAmB,CAAC;QACjD,IAAI,EAAE,GAAG;QACT,QAAQ,EAAE,IAAI;KACf,CAAC;IACF,MAAM,EAAE,uBAAK,CAAC,MAAM,CAAC;QACnB,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,sBAAsB,CAAC;QACpD,IAAI,EAAE,GAAG;QACT,QAAQ,EAAE,IAAI;KACf,CAAC;IACF,KAAK,EAAE,uBAAK,CAAC,MAAM,CAAC;QAClB,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,qBAAqB,CAAC;QACnD,IAAI,EAAE,GAAG;QACT,QAAQ,EAAE,IAAI;KACf,CAAC;IACF,MAAM,EAAE,uBAAK,CAAC,MAAM,CAAC;QACnB,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,sBAAsB,CAAC;QACpD,IAAI,EAAE,GAAG;QACT,QAAQ,EAAE,KAAK;KAChB,CAAC;IACF,OAAO,EAAE,uBAAK,CAAC,MAAM,CAAC;QACpB,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,uBAAuB,CAAC;KACtD,CAAC;IACF,QAAQ,EAAE,uBAAK,CAAC,MAAM,CAAC;QACrB,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,wBAAwB,CAAC;KACvD,CAAC;CACH,CAAC;kBAhCiB,qBAAqB"}
|
|
@@ -10,7 +10,7 @@ export default class ButlerPbExport extends SfCommand<Buffer> {
|
|
|
10
10
|
static readonly examples: string[];
|
|
11
11
|
static readonly flags: {
|
|
12
12
|
name: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
13
|
-
target: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
13
|
+
target: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
14
14
|
id: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
15
15
|
out: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
16
16
|
backend: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
@@ -20,8 +20,18 @@ export default class ButlerPbExport extends SfCommand<Buffer> {
|
|
|
20
20
|
unzip: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
21
21
|
logs: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
22
22
|
partial: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
23
|
+
session: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
24
|
+
instance: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
25
|
+
cut: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
23
26
|
};
|
|
27
|
+
private static isLogsActive;
|
|
24
28
|
private static getDocConfigIds;
|
|
29
|
+
private static isBlank;
|
|
30
|
+
private static log;
|
|
31
|
+
private static authenticateWithTarget;
|
|
32
|
+
private static authenticateWitsSession;
|
|
33
|
+
private static authenticate;
|
|
25
34
|
private static getDocConfigs;
|
|
35
|
+
private static convertBufferToUtf8;
|
|
26
36
|
run(): Promise<Buffer>;
|
|
27
37
|
}
|