prodlysfcli 1.2.0 → 1.2.3
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 +18 -16
- package/lib/commands/prodly/checkin.d.ts +20 -0
- package/lib/commands/prodly/checkin.js +130 -0
- package/lib/commands/prodly/checkin.js.map +1 -0
- package/lib/commands/prodly/checkout.d.ts +21 -0
- package/lib/commands/prodly/checkout.js +137 -0
- package/lib/commands/prodly/checkout.js.map +1 -0
- package/lib/commands/prodly/deploy.d.ts +26 -0
- package/lib/commands/prodly/deploy.js +264 -0
- package/lib/commands/prodly/deploy.js.map +1 -0
- package/lib/commands/prodly/jobs.d.ts +15 -0
- package/lib/commands/prodly/jobs.js +33 -0
- package/lib/commands/prodly/jobs.js.map +1 -0
- package/lib/commands/prodly/manage.d.ts +24 -0
- package/lib/commands/prodly/manage.js +167 -0
- package/lib/commands/prodly/manage.js.map +1 -0
- package/lib/commands/prodly/version.d.ts +16 -0
- package/lib/commands/prodly/version.js +88 -0
- package/lib/commands/prodly/version.js.map +1 -0
- package/lib/constants/index.d.ts +5 -0
- package/lib/constants/index.js +6 -0
- package/lib/constants/index.js.map +1 -0
- package/lib/helpers/index.d.ts +6 -0
- package/lib/helpers/index.js +17 -0
- package/lib/helpers/index.js.map +1 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +2 -0
- package/lib/index.js.map +1 -0
- package/lib/services/connections.d.ts +7 -0
- package/lib/services/connections.js +109 -0
- package/lib/services/connections.js.map +1 -0
- package/lib/services/connections.types.d.ts +31 -0
- package/lib/services/connections.types.js +2 -0
- package/lib/services/connections.types.js.map +1 -0
- package/lib/services/jobs.d.ts +4 -0
- package/lib/services/jobs.js +26 -0
- package/lib/services/jobs.js.map +1 -0
- package/lib/services/jobs.types.d.ts +13 -0
- package/lib/services/jobs.types.js +2 -0
- package/lib/services/jobs.types.js.map +1 -0
- package/lib/services/manage-instances.d.ts +9 -0
- package/lib/services/manage-instances.js +116 -0
- package/lib/services/manage-instances.js.map +1 -0
- package/lib/services/manage-instances.types.d.ts +58 -0
- package/lib/services/manage-instances.types.js +2 -0
- package/lib/services/manage-instances.types.js.map +1 -0
- package/lib/services/queries.d.ts +8 -0
- package/lib/services/queries.js +54 -0
- package/lib/services/queries.js.map +1 -0
- package/lib/types/generic.d.ts +5 -0
- package/lib/types/generic.js +2 -0
- package/lib/types/generic.js.map +1 -0
- package/lib/types/prodly.d.ts +69 -0
- package/lib/types/prodly.js +2 -0
- package/lib/types/prodly.js.map +1 -0
- package/lib/types/salesforce.d.ts +14 -0
- package/lib/types/salesforce.js +2 -0
- package/lib/types/salesforce.js.map +1 -0
- package/lib/utils/index.d.ts +2 -0
- package/lib/utils/index.js +3 -0
- package/lib/utils/index.js.map +1 -0
- package/messages/prodly.checkin.md +1 -1
- package/messages/prodly.checkout.md +1 -1
- package/messages/prodly.deploy.md +2 -2
- package/messages/prodly.json +1 -0
- package/messages/prodly.manage.md +1 -1
- package/messages/prodly.version.md +3 -0
- package/npm-shrinkwrap.json +1715 -1090
- package/oclif.lock +2327 -2091
- package/oclif.manifest.json +708 -2
- package/package.json +10 -10
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Messages, SfError } from '@salesforce/core';
|
|
2
|
+
import { ORG_ID_REG_EXP } from '../constants/index.js';
|
|
3
|
+
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
4
|
+
const prodlyMessages = Messages.loadMessages('prodlysfcli', 'prodly');
|
|
5
|
+
const getDeploymentEntityId = async ({ dataEntityFlag, dataEntityType, hubConn, print, }) => {
|
|
6
|
+
const isId = ORG_ID_REG_EXP.test(dataEntityFlag);
|
|
7
|
+
if (print)
|
|
8
|
+
print('Is org ID: ' + isId);
|
|
9
|
+
let queryWhereClause = '';
|
|
10
|
+
if (isId && dataEntityType === 'PDRI__DataSet__c') {
|
|
11
|
+
queryWhereClause = `PDRI__Active__c = true AND Id = '${dataEntityFlag}' `;
|
|
12
|
+
}
|
|
13
|
+
else if (isId && dataEntityType === 'PDRI__Deployment_Plan__c') {
|
|
14
|
+
queryWhereClause = `Id = '${dataEntityFlag}'`;
|
|
15
|
+
}
|
|
16
|
+
else if (!isId && dataEntityType === 'PDRI__DataSet__c') {
|
|
17
|
+
queryWhereClause = `PDRI__Active__c = true AND Name = '${dataEntityFlag}'`;
|
|
18
|
+
}
|
|
19
|
+
else if (!isId && dataEntityType === 'PDRI__Deployment_Plan__c') {
|
|
20
|
+
queryWhereClause = `Name = '${dataEntityFlag}'`;
|
|
21
|
+
}
|
|
22
|
+
const query = `
|
|
23
|
+
SELECT
|
|
24
|
+
Id, Name
|
|
25
|
+
FROM
|
|
26
|
+
${dataEntityType}
|
|
27
|
+
WHERE
|
|
28
|
+
${queryWhereClause}
|
|
29
|
+
ORDER BY
|
|
30
|
+
lastmodifieddate DESC
|
|
31
|
+
LIMIT ${isId ? 1 : 2}`;
|
|
32
|
+
if (print)
|
|
33
|
+
print('Running query: ' + query);
|
|
34
|
+
const result = await hubConn.query(query);
|
|
35
|
+
if (!result?.records || result.records.length === 0) {
|
|
36
|
+
if (dataEntityType === 'PDRI__DataSet__c') {
|
|
37
|
+
throw new SfError(prodlyMessages.getMessage('errorNoDataSetFound', [dataEntityFlag]));
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
throw new SfError(prodlyMessages.getMessage('errorNoDeploymentPlanFound', [dataEntityFlag]));
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
if (result.records.length > 1) {
|
|
44
|
+
if (dataEntityType === 'PDRI__DataSet__c') {
|
|
45
|
+
throw new SfError(prodlyMessages.getMessage('errorMultipleDataSetsFound', [dataEntityFlag]));
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
throw new SfError(prodlyMessages.getMessage('errorMultipleDeploymentPlansFound', [dataEntityFlag]));
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return result.records[0].Id;
|
|
52
|
+
};
|
|
53
|
+
export { getDeploym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|
+
import { Connection } from '@salesforce/core';
|
|
2
|
+
export type ManagedInstances = {
|
|
3
|
+
instances: ManagedInstance[];
|
|
4
|
+
};
|
|
5
|
+
export type ManagedInstance = {
|
|
6
|
+
connectionId: string;
|
|
7
|
+
controlInstance: boolean;
|
|
8
|
+
id: string;
|
|
9
|
+
instanceName: string;
|
|
10
|
+
instanceType: string;
|
|
11
|
+
instanceUrl: string;
|
|
12
|
+
platformInstanceId: string;
|
|
13
|
+
};
|
|
14
|
+
export type ProdlyConnection = {
|
|
15
|
+
Id: string;
|
|
16
|
+
Name: string;
|
|
17
|
+
PDRI__Instance_URL__c: string;
|
|
18
|
+
PDRI__OrganizationId__c: string;
|
|
19
|
+
};
|
|
20
|
+
export type Jobs = {
|
|
21
|
+
jobs: Job[];
|
|
22
|
+
};
|
|
23
|
+
export type Job = {
|
|
24
|
+
currentStep: string;
|
|
25
|
+
error: string;
|
|
26
|
+
finished: string;
|
|
27
|
+
id: string;
|
|
28
|
+
isBlocking: boolean;
|
|
29
|
+
managedInstanceId: string;
|
|
30
|
+
metadata: string;
|
|
31
|
+
operationType: string;
|
|
32
|
+
resultData: string;
|
|
33
|
+
started: string;
|
|
34
|
+
status: string;
|
|
35
|
+
userId: string;
|
|
36
|
+
};
|
|
37
|
+
export type DeployOptions = {
|
|
38
|
+
dataSetId?: string;
|
|
39
|
+
deactivateAllEvents: boolean;
|
|
40
|
+
deploymentName?: string;
|
|
41
|
+
deploymentNotes?: string;
|
|
42
|
+
deploymentPlanId?: string;
|
|
43
|
+
destinationInstanceId: string;
|
|
44
|
+
hubConn: Connection;
|
|
45
|
+
queryFilter?: string;
|
|
46
|
+
simulation: boolean;
|
|
47
|
+
sourceInstanceId?: string;
|
|
48
|
+
};
|
|
49
|
+
export type CheckoutOptions = {
|
|
50
|
+
branchFlag: string | undefined;
|
|
51
|
+
dataSetId: string | undefined;
|
|
52
|
+
deactivateAllEvents: boolean;
|
|
53
|
+
deploymentNameFlag: string | undefined;
|
|
54
|
+
deploymentNotes: string | undefined;
|
|
55
|
+
deploymentPlanId: string | undefined;
|
|
56
|
+
filter: string | undefined;
|
|
57
|
+
hubConn: Connection;
|
|
58
|
+
mangedInstanceId: string;
|
|
59
|
+
};
|
|
60
|
+
export type CheckinOptions = {
|
|
61
|
+
branchFlag: string | undefined;
|
|
62
|
+
comment: string | undefined;
|
|
63
|
+
dataSetId: string | undefined;
|
|
64
|
+
deploymentNotes: string | undefined;
|
|
65
|
+
deploymentPlanId: string | undefined;
|
|
66
|
+
filter: string | undefined;
|
|
67
|
+
hubConn: Connection;
|
|
68
|
+
mangedInstanceId: string;
|
|
69
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prodly.js","sourceRoot":"","sources":["../../src/types/prodly.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"salesforce.js","sourceRoot":"","sources":["../../src/types/salesforce.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,MAAM,KAAK,GAAG,CAAC,EAAU,EAAiB,EAAE,CAAC,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AAE/F,OAAO,EAAE,KAAK,EAAE,CAAC"}
|
|
@@ -7,7 +7,7 @@ prodly:checkin command
|
|
|
7
7
|
- <%= config.bin %> prodly:checkin --target-org test-utxac7gbati9@example.com --target-dev-hub jsmith@acme.com
|
|
8
8
|
Save managed data to the branch associated with the managed instance identified by the target username.
|
|
9
9
|
The instance should be managed by the Prodly account associated with the provided DevHub control org.
|
|
10
|
-
- <%= config.bin %> prodly:checkin -
|
|
10
|
+
- <%= config.bin %> prodly:checkin --target-org test-utxac7gbati9@example.com
|
|
11
11
|
Save managed data to the branch associated with the managed instance identified by the target username.
|
|
12
12
|
The instance should be managed by the Prodly account associated with the default DevHub control org.
|
|
13
13
|
- <%= config.bin %> prodly:checkin -i f50616b6-57b1-4941-802f-ee0e2506f217
|
|
@@ -7,7 +7,7 @@ prodly:checkout command
|
|
|
7
7
|
- <%= config.bin %> prodly:checkout --target-org test-utxac7gbati9@example.com --target-dev-hub jsmith@acme.com
|
|
8
8
|
Deploy managed data to the managed instance identified by the target org from the associated branch.
|
|
9
9
|
The instance should be managed by the Prodly account associated with the provided DevHub control org.
|
|
10
|
-
- <%= config.bin %> prodly:checkout -
|
|
10
|
+
- <%= config.bin %> prodly:checkout --target-org test-utxac7gbati9@example.com
|
|
11
11
|
Deploy managed data to the managed instance org identified by the target username from the associated branch.
|
|
12
12
|
The instance should be managed by the Prodly account associated with the default DevHub control org.
|
|
13
13
|
- <%= config.bin %> prodly:checkout -i f50616b6-57b1-4941-802f-ee0e2506f217
|
|
@@ -4,11 +4,11 @@ prodly:deploy command
|
|
|
4
4
|
|
|
5
5
|
# examples
|
|
6
6
|
|
|
7
|
-
- <%= config.bin %> prodly:deploy -n scratchorg -
|
|
7
|
+
- <%= config.bin %> prodly:deploy -n scratchorg --target-org FixesScratchOrg -v MainDevHub
|
|
8
8
|
Command output... deploying from the dev hub, the control org, to the scratch org, auto managed with provided name.
|
|
9
9
|
- <%= config.bin %> prodly:deploy --target-org test-utxac7gbati9@example.com --target-dev-hub jsmith@acme.com
|
|
10
10
|
Command output... deploying from the dev hub, the control org, to the scratch org. Long param names.
|
|
11
|
-
- <%= config.bin %> prodly:deploy -
|
|
11
|
+
- <%= config.bin %> prodly:deploy --target-org test-utxac7gbati9@example.com -v jsmith@acme.com -d "UAT Sandbox Connection"
|
|
12
12
|
Command output... deploying from the scratch org to the UAT sandbox, using the named connection record in the dev hub, control org.
|
|
13
13
|
- <%= config.bin %> prodly:deploy --target-org test-utxac7gbati9@example.com --target-dev-hub jsmith@acme.com --source "UAT Sandbox Connection"
|
|
14
14
|
Command output... deploying to the scratch org from the UAT sandbox, using the named connection record in the dev hub, control org. Long param names.
|
package/messages/prodly.json
CHANGED
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
"simulationFlagDescription": "perform a data simulation",
|
|
20
20
|
"sourceBranchFlagSummary": "the version control branch or the base for the new branch (if provided)",
|
|
21
21
|
"sourceFlagDescription": "source managed instance ID",
|
|
22
|
+
"unlinkBranchFlagDescription": "unlink the branch from the managed instance",
|
|
22
23
|
"unmanageFlagDescription": "unmanage the specified instance",
|
|
23
24
|
"versionFlagDescription": "version the new managed instance, branch created and data deployed to the org",
|
|
24
25
|
|
|
@@ -8,5 +8,5 @@ prodly:manage command
|
|
|
8
8
|
List and print all of the managed instances for the Prodly account associated with the default DevHub control org.
|
|
9
9
|
- <%= config.bin %> prodly:manage -m --target-org test-utxac7gbati9@example.com --target-dev-hub jsmith@acme.com
|
|
10
10
|
Manage the org associated with the target username under the Prodly account associated with the provided DevHub control org.
|
|
11
|
-
- <%= config.bin %> prodly:manage -m -
|
|
11
|
+
- <%= config.bin %> prodly:manage -m --target-org test-utxac7gbati9@example.com -n dev7sbx
|
|
12
12
|
Manage and version the org associated with the target username under the Prodly account associated with the default DevHub control org.
|
|
@@ -10,3 +10,6 @@ prodly:version command
|
|
|
10
10
|
- <%= config.bin %> prodly:version -s main -b cli-branch -i f50616b6-57b1-4941-802f-ee0e2506f217
|
|
11
11
|
Add version control to the managed instance identified by the provided ID. Use the "main" branch as a base for a new branch called "cli-branch"
|
|
12
12
|
The instance should be managed by the Prodly account associated with the default DevHub control org.
|
|
13
|
+
- <%= config.bin %> prodly:version -x -i f50616b6-57b1-4941-802f-ee0e2506f217
|
|
14
|
+
Remove version control from the managed instance identified by the provided ID.
|
|
15
|
+
The instance should be managed by the Prodly account associated with the default DevHub control org.
|