prodlysfcli 1.1.0 → 1.2.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/README.md +40 -6
- package/messages/prodly.checkout.md +6 -6
- package/messages/prodly.json +11 -3
- package/messages/prodly.version.md +12 -0
- package/npm-shrinkwrap.json +4477 -8830
- package/oclif.lock +3206 -5092
- package/oclif.manifest.json +2 -566
- package/package.json +10 -10
- package/lib/commands/prodly/checkin.d.ts +0 -20
- package/lib/commands/prodly/checkin.js +0 -130
- package/lib/commands/prodly/checkin.js.map +0 -1
- package/lib/commands/prodly/checkout.d.ts +0 -21
- package/lib/commands/prodly/checkout.js +0 -137
- package/lib/commands/prodly/checkout.js.map +0 -1
- package/lib/commands/prodly/deploy.d.ts +0 -26
- package/lib/commands/prodly/deploy.js +0 -263
- package/lib/commands/prodly/deploy.js.map +0 -1
- package/lib/commands/prodly/jobs.d.ts +0 -15
- package/lib/commands/prodly/jobs.js +0 -33
- package/lib/commands/prodly/jobs.js.map +0 -1
- package/lib/commands/prodly/manage.d.ts +0 -24
- package/lib/commands/prodly/manage.js +0 -167
- package/lib/commands/prodly/manage.js.map +0 -1
- package/lib/constants/index.d.ts +0 -5
- package/lib/constants/index.js +0 -6
- package/lib/constants/index.js.map +0 -1
- package/lib/helpers/index.d.ts +0 -6
- package/lib/helpers/index.js +0 -17
- package/lib/helpers/index.js.map +0 -1
- package/lib/index.d.ts +0 -2
- package/lib/index.js +0 -2
- package/lib/index.js.map +0 -1
- package/lib/services/connections.d.ts +0 -7
- package/lib/services/connections.js +0 -109
- package/lib/services/connections.js.map +0 -1
- package/lib/services/connections.types.d.ts +0 -31
- package/lib/services/connections.types.js +0 -2
- package/lib/services/connections.types.js.map +0 -1
- package/lib/services/jobs.d.ts +0 -4
- package/lib/services/jobs.js +0 -26
- package/lib/services/jobs.js.map +0 -1
- package/lib/services/jobs.types.d.ts +0 -13
- package/lib/services/jobs.types.js +0 -2
- package/lib/services/jobs.types.js.map +0 -1
- package/lib/services/manage-instances.d.ts +0 -7
- package/lib/services/manage-instances.js +0 -94
- package/lib/services/manage-instances.js.map +0 -1
- package/lib/services/manage-instances.types.d.ts +0 -40
- package/lib/services/manage-instances.types.js +0 -2
- package/lib/services/manage-instances.types.js.map +0 -1
- package/lib/services/queries.d.ts +0 -8
- package/lib/services/queries.js +0 -54
- package/lib/services/queries.js.map +0 -1
- package/lib/types/generic.d.ts +0 -7
- package/lib/types/generic.js +0 -2
- package/lib/types/generic.js.map +0 -1
- package/lib/types/prodly.d.ts +0 -69
- package/lib/types/prodly.js +0 -2
- package/lib/types/prodly.js.map +0 -1
- package/lib/types/salesforce.d.ts +0 -14
- package/lib/types/salesforce.js +0 -2
- package/lib/types/salesforce.js.map +0 -1
- package/lib/utils/index.d.ts +0 -2
- package/lib/utils/index.js +0 -3
- package/lib/utils/index.js.map +0 -1
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
-
import { Job } from '../../types/prodly.js';
|
|
3
|
-
export type JobsResult = {
|
|
4
|
-
job: Job;
|
|
5
|
-
};
|
|
6
|
-
export default class ProdlyJobs extends SfCommand<JobsResult> {
|
|
7
|
-
static readonly summary: string;
|
|
8
|
-
static readonly description: string;
|
|
9
|
-
static readonly examples: string[];
|
|
10
|
-
static readonly flags: {
|
|
11
|
-
'target-dev-hub': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
12
|
-
job: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
13
|
-
};
|
|
14
|
-
run(): Promise<JobsResult>;
|
|
15
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { Messages } from '@salesforce/core';
|
|
2
|
-
import { Flags, SfCommand } from '@salesforce/sf-plugins-core';
|
|
3
|
-
import { getJob } from '../../services/jobs.js';
|
|
4
|
-
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
5
|
-
const commandMessages = Messages.loadMessages('prodlysfcli', 'prodly.jobs');
|
|
6
|
-
const prodlyMessages = Messages.loadMessages('prodlysfcli', 'prodly');
|
|
7
|
-
export default class ProdlyJobs extends SfCommand {
|
|
8
|
-
static summary = commandMessages.getMessage('summary');
|
|
9
|
-
static description = prodlyMessages.getMessage('commandDescription');
|
|
10
|
-
static examples = commandMessages.getMessages('examples');
|
|
11
|
-
static flags = {
|
|
12
|
-
'target-dev-hub': Flags.requiredHub(),
|
|
13
|
-
job: Flags.string({
|
|
14
|
-
char: 'j',
|
|
15
|
-
required: true,
|
|
16
|
-
summary: prodlyMessages.getMessage('jobIdFlagSummary'),
|
|
17
|
-
}),
|
|
18
|
-
};
|
|
19
|
-
async run() {
|
|
20
|
-
const { flags } = await this.parse(ProdlyJobs);
|
|
21
|
-
const jobId = flags.job;
|
|
22
|
-
const hubOrg = flags['target-dev-hub'];
|
|
23
|
-
const hubConn = hubOrg.getConnection();
|
|
24
|
-
this.log(`Getting job with Id "${jobId}"`);
|
|
25
|
-
const job = await getJob({ hubConn, jobId });
|
|
26
|
-
if (!job) {
|
|
27
|
-
throw new Error(prodlyMessages.getMessage('errorJobNotFound'));
|
|
28
|
-
}
|
|
29
|
-
this.log(`Job Status: ${job.status}`);
|
|
30
|
-
return { job };
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
//# sourceMappingURL=jobs.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"jobs.js","sourceRoot":"","sources":["../../../src/commands/prodly/jobs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAGhD,QAAQ,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,CAAC,UAAU,CAAC,kBAAkB,CAAC,CAAC,CAAC;QACjE,CAAC;QACD,IAAI,CAAC,GAAG,CAAC,eAAe,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC;QACtC,OAAO,EAAE,GAAG,EAAE,CAAC;IACjB,CAAC"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
-
import { JSONObject } from '../../types/generic.js';
|
|
3
|
-
export type ProdlyManageResult = {
|
|
4
|
-
path: string;
|
|
5
|
-
};
|
|
6
|
-
export default class ProdlyManage extends SfCommand<JSONObject> {
|
|
7
|
-
static readonly summary: string;
|
|
8
|
-
static readonly description: string;
|
|
9
|
-
static readonly examples: string[];
|
|
10
|
-
static readonly flags: {
|
|
11
|
-
'target-dev-hub': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
12
|
-
'target-org': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
13
|
-
comment: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
14
|
-
connection: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
15
|
-
instance: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
16
|
-
label: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
17
|
-
list: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
18
|
-
manage: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
19
|
-
print: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
20
|
-
unmanage: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
21
|
-
version: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
22
|
-
};
|
|
23
|
-
run(): Promise<JSONObject>;
|
|
24
|
-
}
|
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
import { Messages, SfError } from '@salesforce/core';
|
|
2
|
-
import { Flags, SfCommand } from '@salesforce/sf-plugins-core';
|
|
3
|
-
import { createConnection, queryConnection, queryConnections } from '../../services/connections.js';
|
|
4
|
-
import { getManagedInstance, getManagedInstances, manageInstanceAsync, unmanageInstance, } from '../../services/manage-instances.js';
|
|
5
|
-
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
6
|
-
const commandMessages = Messages.loadMessages('prodlysfcli', 'prodly.manage');
|
|
7
|
-
const prodlyMessages = Messages.loadMessages('prodlysfcli', 'prodly');
|
|
8
|
-
export default class ProdlyManage extends SfCommand {
|
|
9
|
-
static summary = commandMessages.getMessage('summary');
|
|
10
|
-
static description = prodlyMessages.getMessage('commandDescription');
|
|
11
|
-
static examples = commandMessages.getMessages('examples');
|
|
12
|
-
static flags = {
|
|
13
|
-
'target-dev-hub': Flags.requiredHub(),
|
|
14
|
-
'target-org': Flags.requiredOrg(),
|
|
15
|
-
comment: Flags.string({ char: 'c', summary: prodlyMessages.getMessage('commentFlagDescription') }),
|
|
16
|
-
connection: Flags.string({ char: 'n', summary: prodlyMessages.getMessage('connectionFlagDescription') }),
|
|
17
|
-
instance: Flags.string({ char: 'i', summary: prodlyMessages.getMessage('instanceFlagDescription') }),
|
|
18
|
-
label: Flags.string({ char: 'b', summary: prodlyMessages.getMessage('instanceNameFlagDescription') }),
|
|
19
|
-
list: Flags.boolean({ char: 'l', summary: prodlyMessages.getMessage('listFlagDescription') }),
|
|
20
|
-
manage: Flags.boolean({ char: 'm', summary: prodlyMessages.getMessage('manageFlagDescription') }),
|
|
21
|
-
print: Flags.boolean({ char: 'p', summary: prodlyMessages.getMessage('printFlagDescription') }),
|
|
22
|
-
unmanage: Flags.boolean({ char: 'x', summary: prodlyMessages.getMessage('unmanageFlagDescription') }),
|
|
23
|
-
version: Flags.boolean({ char: 's', summary: prodlyMessages.getMessage('versionFlagDescription') }),
|
|
24
|
-
};
|
|
25
|
-
// eslint-disable-next-line complexity
|
|
26
|
-
async run() {
|
|
27
|
-
const { flags } = await this.parse(ProdlyManage);
|
|
28
|
-
const { comment: commentFlag, connection: connectionFlag, instance: instanceFlag, label: labelFlag, list: listFlag, manage: manageFlag, print: printFlag, unmanage: unmanageFlag, version: versionFlag, } = flags;
|
|
29
|
-
this.log('List flag: ' + listFlag);
|
|
30
|
-
this.log('Print flag: ' + printFlag);
|
|
31
|
-
this.log('Manage flag: ' + manageFlag);
|
|
32
|
-
this.log('Instance flag: ' + instanceFlag);
|
|
33
|
-
this.log('Instance name flag: ' + labelFlag);
|
|
34
|
-
this.log('Unmanage flag: ' + unmanageFlag);
|
|
35
|
-
this.log('Version flag: ' + versionFlag);
|
|
36
|
-
this.log('Comment flag: ' + commentFlag);
|
|
37
|
-
this.log('Connection flag: ' + connectionFlag);
|
|
38
|
-
if (!listFlag && !manageFlag && !unmanageFlag) {
|
|
39
|
-
throw new SfError(prodlyMessages.getMessage('errorNoManageFlags', []));
|
|
40
|
-
}
|
|
41
|
-
if (listFlag && manageFlag) {
|
|
42
|
-
throw new SfError(prodlyMessages.getMessage('errorMultipleManageFlags', []));
|
|
43
|
-
}
|
|
44
|
-
if (manageFlag && !labelFlag) {
|
|
45
|
-
throw new SfError(prodlyMessages.getMessage('errorManageLabelFlag', []));
|
|
46
|
-
}
|
|
47
|
-
if (!listFlag && printFlag) {
|
|
48
|
-
throw new SfError(prodlyMessages.getMessage('errorPrintFlagNoListFlag', []));
|
|
49
|
-
}
|
|
50
|
-
if (!manageFlag && versionFlag) {
|
|
51
|
-
throw new SfError(prodlyMessages.getMessage('errorVersionFlagNoManageFlag', []));
|
|
52
|
-
}
|
|
53
|
-
const org = flags['target-org'];
|
|
54
|
-
const hubOrg = flags['target-dev-hub'];
|
|
55
|
-
const hubConn = hubOrg.getConnection();
|
|
56
|
-
const print = (message, ...args) => this.log(message, ...args);
|
|
57
|
-
if (listFlag) {
|
|
58
|
-
this.log('Listing managed instances.');
|
|
59
|
-
const managedInstances = await getManagedInstances({ hubConn, print });
|
|
60
|
-
const connectionIds = managedInstances.instances
|
|
61
|
-
.map((instance) => instance.connectionId)
|
|
62
|
-
.filter((connectionId) => connectionId !== undefined);
|
|
63
|
-
const connections = await queryConnections({ connectionIds, hubConn, print });
|
|
64
|
-
managedInstances.instances.forEach((instance) => {
|
|
65
|
-
const connection = instance.connectionId ? connections.get(instance.connectionId) : null;
|
|
66
|
-
const connectionName = connection ? connection.Name : '';
|
|
67
|
-
const instanceUrl = connection ? connection.PDRI__Instance_URL__c : '';
|
|
68
|
-
instance.instanceName = connectionName;
|
|
69
|
-
instance.instanceUrl = instanceUrl;
|
|
70
|
-
});
|
|
71
|
-
if (printFlag) {
|
|
72
|
-
this.log('Printing managed instances.\n');
|
|
73
|
-
managedInstances.instances.forEach((instance) => {
|
|
74
|
-
const connection = instance.connectionId ? connections.get(instance.connectionId) : null;
|
|
75
|
-
const connectionName = connection ? connection.Name : '';
|
|
76
|
-
const instanceUrl = connection ? connection.PDRI__Instance_URL__c : '';
|
|
77
|
-
this.log('Managed Instance');
|
|
78
|
-
this.log(`Instance ID: ${instance.id}`);
|
|
79
|
-
this.log(`Instance Name: ${connectionName}`);
|
|
80
|
-
this.log(`Control Instance: ${instance.controlInstance}`);
|
|
81
|
-
this.log(`Salesforce Org ID: ${instance.platformInstanceId}`);
|
|
82
|
-
this.log(`Connection Record ID: ${instance.connectionId}`);
|
|
83
|
-
this.log(`Instance Type ${instance.instanceType}`);
|
|
84
|
-
this.log(`Instance URL ${instanceUrl}\n`);
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
return managedInstances;
|
|
88
|
-
}
|
|
89
|
-
if (manageFlag) {
|
|
90
|
-
this.log('Managing instance.');
|
|
91
|
-
this.log('Refreshing org session auth');
|
|
92
|
-
await org.refreshAuth();
|
|
93
|
-
let connectionId = null;
|
|
94
|
-
if (connectionFlag) {
|
|
95
|
-
this.log('Connection to use for the managed instances provided: ' + connectionFlag);
|
|
96
|
-
const connection = await queryConnection({ connectionNameOrId: connectionFlag, hubConn, print });
|
|
97
|
-
connectionId = connection.Id;
|
|
98
|
-
}
|
|
99
|
-
else {
|
|
100
|
-
this.log('Creating connection.');
|
|
101
|
-
connectionId = await createConnection({ name: labelFlag, org, hubConn });
|
|
102
|
-
this.log('Created connection with record ID: ', connectionId);
|
|
103
|
-
}
|
|
104
|
-
const orgId = org.getOrgId();
|
|
105
|
-
const body = {
|
|
106
|
-
platformInstance: {
|
|
107
|
-
platformInstanceId: orgId,
|
|
108
|
-
connectionId,
|
|
109
|
-
instanceName: labelFlag,
|
|
110
|
-
},
|
|
111
|
-
};
|
|
112
|
-
if (versionFlag) {
|
|
113
|
-
if (print)
|
|
114
|
-
print('Versioning is enabled.');
|
|
115
|
-
body.options = { checkin: true, checkout: true };
|
|
116
|
-
if (commentFlag)
|
|
117
|
-
body.options.commitMessage = commentFlag;
|
|
118
|
-
}
|
|
119
|
-
else {
|
|
120
|
-
body.options = { checkin: false, checkout: false, environmentExists: false };
|
|
121
|
-
}
|
|
122
|
-
this.log(`Managing instance for org ID: ${orgId}`);
|
|
123
|
-
this.log('Manage instance body:');
|
|
124
|
-
this.log(JSON.stringify(body));
|
|
125
|
-
const jobId = await manageInstanceAsync({ body, hubConn, print });
|
|
126
|
-
this.log(`Manage Instance launched with Job ID: ${jobId}`);
|
|
127
|
-
return { jobId, message: 'Manage Instance launched' };
|
|
128
|
-
}
|
|
129
|
-
if (unmanageFlag) {
|
|
130
|
-
this.log('Unmanaging instance.');
|
|
131
|
-
let mangedInstanceId = '';
|
|
132
|
-
if (instanceFlag) {
|
|
133
|
-
// Use provided managed instance
|
|
134
|
-
this.log(`Managed instance ID provided, using instance with id ${instanceFlag}`);
|
|
135
|
-
mangedInstanceId = instanceFlag;
|
|
136
|
-
}
|
|
137
|
-
else if (connectionFlag) {
|
|
138
|
-
this.log(`Connection to use for the managed instances provided: ${connectionFlag}`);
|
|
139
|
-
const connection = await queryConnection({ connectionNameOrId: connectionFlag, hubConn, print });
|
|
140
|
-
const orgId = connection.PDRI__OrganizationId__c;
|
|
141
|
-
// Retrieve the managed instance associated with target org
|
|
142
|
-
// DevHub control org is never used as the default
|
|
143
|
-
const managedInstance = await getManagedInstance({ hubConn, orgId, print });
|
|
144
|
-
if (!managedInstance) {
|
|
145
|
-
throw new SfError(prodlyMessages.getMessage('errorManagedInstaceNotFound'));
|
|
146
|
-
}
|
|
147
|
-
mangedInstanceId = managedInstance.id;
|
|
148
|
-
}
|
|
149
|
-
else {
|
|
150
|
-
throw new SfError(prodlyMessages.getMessage('errorManagedInstaceNotProvided'));
|
|
151
|
-
}
|
|
152
|
-
const readline = await import('node:readline/promises');
|
|
153
|
-
const rl = readline.createInterface({ input: process.stdin, output: process.stdout, prompt: '>' });
|
|
154
|
-
const answer = await rl.question(prodlyMessages.getMessage('unmanageInstancePrompt'));
|
|
155
|
-
rl.close();
|
|
156
|
-
if (answer.trim() === mangedInstanceId) {
|
|
157
|
-
await unmanageInstance({ instanceId: mangedInstanceId, hubConn, print });
|
|
158
|
-
this.log(`Successfully Unmanaged Instance with Id: ${mangedInstanceId}`);
|
|
159
|
-
return { message: `Successfully Unmanaged Instance with Id: ${mangedInstanceId}` };
|
|
160
|
-
}
|
|
161
|
-
this.log(`Unmanage Instance with Id ${mangedInstanceId} aborted`);
|
|
162
|
-
return { message: `Unmanage Instance with Id ${mangedInstanceId} aborted` };
|
|
163
|
-
}
|
|
164
|
-
return {};
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
//# sourceMappingURL=manage.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3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,OAAO,EAAE,6BAA6B,gBAAgB,UAAU,EAAE,CAAC;QAC9E,CAAC;QAED,OAAO,EAAE,CAAC;IACZ,CAAC"}
|
package/lib/constants/index.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export declare const ORG_ID_REG_EXP: RegExp;
|
|
2
|
-
export declare const ORG_TYPE_PRODUCTION = "Production";
|
|
3
|
-
export declare const ORG_TYPE_SANDBOX = "Sandbox";
|
|
4
|
-
export declare const ORG_TYPE_SCRATCH_ORG = "Scratch Org";
|
|
5
|
-
export declare const JOB_STATUS_COMPLETED = "COMPLETED";
|
package/lib/constants/index.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export const ORG_ID_REG_EXP = /^([a-zA-Z0-9_-]){15,18}$/;
|
|
2
|
-
export const ORG_TYPE_PRODUCTION = 'Production';
|
|
3
|
-
export const ORG_TYPE_SANDBOX = 'Sandbox';
|
|
4
|
-
export const ORG_TYPE_SCRATCH_ORG = 'Scratch Org';
|
|
5
|
-
export const JOB_STATUS_COMPLETED = 'COMPLETED';
|
|
6
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,cAAc,GAAG,0BAA0B,CAAC;AAEzD,MAAM,CAAC,MAAM,mBAAmB,GAAG,YAAY,CAAC;AAChD,MAAM,CAAC,MAAM,gBAAgB,GAAG,SAAS,CAAC;AAC1C,MAAM,CAAC,MAAM,oBAAoB,GAAG,aAAa,CAAC;AAElD,MAAM,CAAC,MAAM,oBAAoB,GAAG,WAAW,CAAC"}
|
package/lib/helpers/index.d.ts
DELETED
package/lib/helpers/index.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
const constructQueryFilter = (filterFlag) => {
|
|
2
|
-
if (typeof filterFlag === 'string') {
|
|
3
|
-
if (filterFlag.length === 0) {
|
|
4
|
-
return {
|
|
5
|
-
filter: null,
|
|
6
|
-
limit: null,
|
|
7
|
-
orderBy: null,
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
|
-
else {
|
|
11
|
-
return { filter: filterFlag };
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
return {};
|
|
15
|
-
};
|
|
16
|
-
export { constructQueryFilter };
|
|
17
|
-
//# sourceMappingURL=index.js.map
|
package/lib/helpers/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,MAAM,oBAAoB,GAAG,CAC3B,UAA8B,EAC4B,EAAE;IAC5D,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE,CAAC;QACnC,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC5B,OAAO;gBACL,MAAM,EAAE,IAAI;gBACZ,KAAK,EAAE,IAAI;gBACX,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC;QAChC,CAAC;IACH,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC,CAAC;AAEF,OAAO,EAAE,oBAAoB,EAAE,CAAC"}
|
package/lib/index.d.ts
DELETED
package/lib/index.js
DELETED
package/lib/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,eAAe,EAAE,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { CreateConnectionFn, GetConnectionIdFn, QueryConnectionFn, QueryConnectionsFn, UpdateConnectionFn } from './connections.types.js';
|
|
2
|
-
declare const createConnection: CreateConnectionFn;
|
|
3
|
-
declare const getConnectionId: GetConnectionIdFn;
|
|
4
|
-
declare const queryConnection: QueryConnectionFn;
|
|
5
|
-
declare const queryConnections: QueryConnectionsFn;
|
|
6
|
-
declare const updateConnection: UpdateConnectionFn;
|
|
7
|
-
export { createConnection, getConnectionId, queryConnection, queryConnections, updateConnection };
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
/* eslint-disable camelcase */
|
|
2
|
-
import { Messages, SfError } from '@salesforce/core';
|
|
3
|
-
import { ORG_ID_REG_EXP, ORG_TYPE_PRODUCTION, ORG_TYPE_SANDBOX, ORG_TYPE_SCRATCH_ORG } from '../constants/index.js';
|
|
4
|
-
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
5
|
-
const prodlyMessages = Messages.loadMessages('prodlysfcli', 'prodly');
|
|
6
|
-
const createConnection = async ({ hubConn, name, org }) => {
|
|
7
|
-
const trailSlashRegex = /\/$/;
|
|
8
|
-
let type = '';
|
|
9
|
-
if (await org.determineIfScratch())
|
|
10
|
-
type = ORG_TYPE_SCRATCH_ORG;
|
|
11
|
-
else if (await org.determineIfSandbox())
|
|
12
|
-
type = ORG_TYPE_SANDBOX;
|
|
13
|
-
else
|
|
14
|
-
type = ORG_TYPE_PRODUCTION;
|
|
15
|
-
const connection = {
|
|
16
|
-
Name: name ? name : `${org.getUsername()} ${org.getOrgId()}`,
|
|
17
|
-
PDRI__Access_Token__c: org.getConnection().getConnectionOptions().accessToken,
|
|
18
|
-
PDRI__Active__c: true,
|
|
19
|
-
PDRI__Instance_URL__c: org.getConnection().getConnectionOptions().instanceUrl?.replace(trailSlashRegex, ''),
|
|
20
|
-
PDRI__Org_Type__c: type,
|
|
21
|
-
PDRI__OrganizationId__c: org.getOrgId(),
|
|
22
|
-
PDRI__User_Id__c: org.getConnection().getConnectionOptions().userId,
|
|
23
|
-
PDRI__Username__c: org.getUsername(),
|
|
24
|
-
};
|
|
25
|
-
const retrievedConnection = await hubConn.create('PDRI__Connection__c', connection);
|
|
26
|
-
return retrievedConnection.id;
|
|
27
|
-
};
|
|
28
|
-
const getConnectionId = async ({ hubConn, orgId, print }) => {
|
|
29
|
-
if (print)
|
|
30
|
-
print(`Retrieving the connection record ID for org ${orgId}.`);
|
|
31
|
-
const query = `
|
|
32
|
-
SELECT
|
|
33
|
-
Id
|
|
34
|
-
FROM
|
|
35
|
-
PDRI__Connection__c
|
|
36
|
-
WHERE
|
|
37
|
-
PDRI__OrganizationId__c = '${orgId}' AND PDRI__Active__c = true
|
|
38
|
-
ORDER BY
|
|
39
|
-
CreatedDate DESC
|
|
40
|
-
LIMIT 1`;
|
|
41
|
-
if (print)
|
|
42
|
-
print('Running query: ' + query);
|
|
43
|
-
// Query the org
|
|
44
|
-
const result = await hubConn.query(query);
|
|
45
|
-
if (print)
|
|
46
|
-
print('Query result: ', result);
|
|
47
|
-
if (!result?.records || result.records.length === 0) {
|
|
48
|
-
return null;
|
|
49
|
-
}
|
|
50
|
-
if (print)
|
|
51
|
-
print('Connection record: ' + result.records[0].Id);
|
|
52
|
-
return result.records[0].Id;
|
|
53
|
-
};
|
|
54
|
-
const queryConnection = async ({ connectionNameOrId, hubConn, print }) => {
|
|
55
|
-
if (print)
|
|
56
|
-
print('Querying connection: ' + connectionNameOrId);
|
|
57
|
-
const isId = ORG_ID_REG_EXP.test(connectionNameOrId);
|
|
58
|
-
const query = `
|
|
59
|
-
SELECT
|
|
60
|
-
Id, Name, PDRI__OrganizationId__c
|
|
61
|
-
FROM
|
|
62
|
-
PDRI__Connection__c
|
|
63
|
-
WHERE
|
|
64
|
-
PDRI__Active__c = true AND ${isId ? 'Id' : 'Name'} = '${connectionNameOrId}'
|
|
65
|
-
ORDER BY
|
|
66
|
-
lastmodifieddate DESC
|
|
67
|
-
LIMIT 1`;
|
|
68
|
-
if (print)
|
|
69
|
-
print(`Running source query:${query}`);
|
|
70
|
-
const result = await hubConn.query(query);
|
|
71
|
-
if (!result?.records || result.records.length === 0) {
|
|
72
|
-
throw new SfError(prodlyMessages.getMessage('errorNoConnectionFound', [connectionNameOrId]));
|
|
73
|
-
}
|
|
74
|
-
return result.records[0];
|
|
75
|
-
};
|
|
76
|
-
const queryConnections = async ({ connectionIds, hubConn, print }) => {
|
|
77
|
-
if (print)
|
|
78
|
-
print('Querying connections');
|
|
79
|
-
if (connectionIds.length === 0) {
|
|
80
|
-
return new Map();
|
|
81
|
-
}
|
|
82
|
-
const query = `
|
|
83
|
-
SELECT
|
|
84
|
-
Id, Name, PDRI__Instance_URL__c
|
|
85
|
-
FROM
|
|
86
|
-
PDRI__Connection__c
|
|
87
|
-
WHERE
|
|
88
|
-
Id IN (${connectionIds.map((connectionId) => `'${connectionId}'`).join(',')})`;
|
|
89
|
-
if (print)
|
|
90
|
-
print('Running source query: ' + query);
|
|
91
|
-
const result = await hubConn.query(query);
|
|
92
|
-
if (!result.records || result.records.length === 0) {
|
|
93
|
-
throw new SfError(prodlyMessages.getMessage('errorNoConnectionFound', connectionIds));
|
|
94
|
-
}
|
|
95
|
-
const connections = new Map();
|
|
96
|
-
result.records.forEach((connection) => {
|
|
97
|
-
connections.set(connection.Id, connection);
|
|
98
|
-
});
|
|
99
|
-
return connections;
|
|
100
|
-
};
|
|
101
|
-
const updateConnection = async ({ connectionId, hubConn, org }) => {
|
|
102
|
-
const connection = {
|
|
103
|
-
Id: connectionId,
|
|
104
|
-
PDRI__Access_Token__c: org.getConnection()?.getConnectionOptions()?.accessToken,
|
|
105
|
-
};
|
|
106
|
-
return hubConn.update('PDRI__Connection__c', connection);
|
|
107
|
-
};
|
|
108
|
-
export { createConnection, getConnectionId, queryConnection, queryConnections, updateConnection };
|
|
109
|
-
//# sourceMappingURL=connections.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"connections.js","sourceRoot":"","sources":["../../src/services/connections.ts"],"names":[],"mappings":"AAAA,8BAA8B;AAC9B,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAUp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,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,EAAE,UAAU,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;IAEH,OAAO,WAAW,CAAC;AACrB,CAAC,CAAC;AAEF,MAAM,gBAAgB,GAAuB,KAAK,EAAE,EAAE,YAAY,EAAE,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE;IACpF,MAAM,UAAU,GAAG;QACjB,EAAE,EAAE,YAAY;QAChB,qBAAqB,EAAE,GAAG,CAAC,aAAa,EAAE,EAAE,oBAAoB,EAAE,EAAE,WAAW;KAChF,CAAC;IAEF,OAAO,OAAO,CAAC,MAAM,CAAC,qBAAqB,EAAE,UAAU,CAAC,CAAC;AAC3D,CAAC,CAAC;AAEF,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,eAAe,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { Connection, Org } from '@salesforce/core';
|
|
2
|
-
import { ProdlyConnection } from '../types/prodly.js';
|
|
3
|
-
import { SaveResult } from '../types/salesforce.js';
|
|
4
|
-
type printFn = (message?: string | undefined, ...args: unknown[]) => void;
|
|
5
|
-
export type CreateConnectionFn = ({ hubConn, name, org, print, }: {
|
|
6
|
-
hubConn: Connection;
|
|
7
|
-
name: string | undefined;
|
|
8
|
-
org: Org;
|
|
9
|
-
print?: printFn;
|
|
10
|
-
}) => Promise<string | undefined>;
|
|
11
|
-
export type GetConnectionIdFn = ({ hubConn, orgId, print, }: {
|
|
12
|
-
hubConn: Connection;
|
|
13
|
-
orgId: string;
|
|
14
|
-
print?: printFn;
|
|
15
|
-
}) => Promise<string | null | undefined>;
|
|
16
|
-
export type QueryConnectionFn = ({ connectionNameOrId, hubConn, print, }: {
|
|
17
|
-
connectionNameOrId: string;
|
|
18
|
-
hubConn: Connection;
|
|
19
|
-
print?: printFn;
|
|
20
|
-
}) => Promise<ProdlyConnection>;
|
|
21
|
-
export type QueryConnectionsFn = ({ connectionIds, hubConn, print, }: {
|
|
22
|
-
connectionIds: string[];
|
|
23
|
-
hubConn: Connection;
|
|
24
|
-
print?: printFn;
|
|
25
|
-
}) => Promise<Map<string, ProdlyConnection>>;
|
|
26
|
-
export type UpdateConnectionFn = ({ connectionId, hubConn, org, }: {
|
|
27
|
-
connectionId: string;
|
|
28
|
-
hubConn: Connection;
|
|
29
|
-
org: Org;
|
|
30
|
-
}) => Promise<SaveResult>;
|
|
31
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"connections.types.js","sourceRoot":"","sources":["../../src/services/connections.types.ts"],"names":[],"mappings":""}
|
package/lib/services/jobs.d.ts
DELETED
package/lib/services/jobs.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { JOB_STATUS_COMPLETED } from '../constants/index.js';
|
|
2
|
-
const BASE_PATH = '/services/apexrest/PDRI/v1/jobs';
|
|
3
|
-
const getJob = async ({ hubConn, jobId }) => {
|
|
4
|
-
const path = `${BASE_PATH}/${jobId}`;
|
|
5
|
-
const res = await hubConn.request(`${hubConn.instanceUrl}${path}`);
|
|
6
|
-
const jobsWrapper = JSON.parse(res);
|
|
7
|
-
return jobsWrapper.jobs[0];
|
|
8
|
-
};
|
|
9
|
-
const jobCompletion = async ({ hubConn, jobId, print }) => {
|
|
10
|
-
const path = `${BASE_PATH}/${jobId}`;
|
|
11
|
-
const res = await hubConn.request(`${hubConn.instanceUrl}${path}`);
|
|
12
|
-
if (print)
|
|
13
|
-
print(`Job status result ${JSON.stringify(res)}.`);
|
|
14
|
-
const jobsWrapper = JSON.parse(res);
|
|
15
|
-
const job = jobsWrapper.jobs[0];
|
|
16
|
-
if (print)
|
|
17
|
-
print(`Job status job ${JSON.stringify(job)}.`);
|
|
18
|
-
if (job.status === JOB_STATUS_COMPLETED) {
|
|
19
|
-
return job;
|
|
20
|
-
}
|
|
21
|
-
else {
|
|
22
|
-
return undefined;
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
export { getJob, jobCompletion };
|
|
26
|
-
//# sourceMappingURL=jobs.js.map
|
package/lib/services/jobs.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"jobs.js","sourceRoot":"","sources":["../../src/services/jobs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAI7D,MAAM,SAAS,GAAG,iCAAiC,CAAC;AAEpD,MAAM,MAAM,GAAa,KAAK,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE;IACpD,MAAM,IAAI,GAAG,GAAG,SAAS,IAAI,KAAK,EAAE,CAAC;IACrC,MAAM,GAAG,GAAW,MAAM,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,WAAW,GAAG,IAAI,EAAE,CAAC,CAAC;IAC3E,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAS,CAAC;IAC5C,OAAO,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAC7B,CAAC,CAAC;AAEF,MAAM,aAAa,GAAoB,KAAK,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE;IACzE,MAAM,IAAI,GAAG,GAAG,SAAS,IAAI,KAAK,EAAE,CAAC;IAErC,MAAM,GAAG,GAAW,MAAM,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,WAAW,GAAG,IAAI,EAAE,CAAC,CAAC;IAC3E,IAAI,KAAK;QAAE,KAAK,CAAC,qBAAqB,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC9D,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAS,CAAC;IAC5C,MAAM,GAAG,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAEhC,IAAI,KAAK;QAAE,KAAK,CAAC,kBAAkB,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAE3D,IAAI,GAAG,CAAC,MAAM,KAAK,oBAAoB,EAAE,CAAC;QACxC,OAAO,GAAG,CAAC;IACb,CAAC;SAAM,CAAC;QACN,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC,CAAC;AAEF,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Connection } from '@salesforce/core';
|
|
2
|
-
import { Job } from '../types/prodly.js';
|
|
3
|
-
type printFn = (message: string) => void;
|
|
4
|
-
export type GetJobFn = ({ hubConn, jobId }: {
|
|
5
|
-
hubConn: Connection;
|
|
6
|
-
jobId: string;
|
|
7
|
-
}) => Promise<Job | undefined>;
|
|
8
|
-
export type JobCompletionFn = ({ hubConn, jobId, print, }: {
|
|
9
|
-
hubConn: Connection;
|
|
10
|
-
jobId: string;
|
|
11
|
-
print?: printFn;
|
|
12
|
-
}) => Promise<Job | undefined>;
|
|
13
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"jobs.types.js","sourceRoot":"","sources":["../../src/services/jobs.types.ts"],"names":[],"mappings":""}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { GetManagedInstanceFn, GetManagedInstancesFn, ManageInstanceAsyncFn, ManageInstanceFn, UnmanageInstanceFn } from './manage-instances.types.js';
|
|
2
|
-
declare const getManagedInstances: GetManagedInstancesFn;
|
|
3
|
-
declare const getManagedInstance: GetManagedInstanceFn;
|
|
4
|
-
declare const manageInstance: ManageInstanceFn;
|
|
5
|
-
declare const manageInstanceAsync: ManageInstanceAsyncFn;
|
|
6
|
-
declare const unmanageInstance: UnmanageInstanceFn;
|
|
7
|
-
export { getManagedInstance, getManagedInstances, manageInstance, manageInstanceAsync, unmanageInstance };
|