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.
Files changed (71) hide show
  1. package/README.md +18 -16
  2. package/lib/commands/prodly/checkin.d.ts +20 -0
  3. package/lib/commands/prodly/checkin.js +130 -0
  4. package/lib/commands/prodly/checkin.js.map +1 -0
  5. package/lib/commands/prodly/checkout.d.ts +21 -0
  6. package/lib/commands/prodly/checkout.js +137 -0
  7. package/lib/commands/prodly/checkout.js.map +1 -0
  8. package/lib/commands/prodly/deploy.d.ts +26 -0
  9. package/lib/commands/prodly/deploy.js +264 -0
  10. package/lib/commands/prodly/deploy.js.map +1 -0
  11. package/lib/commands/prodly/jobs.d.ts +15 -0
  12. package/lib/commands/prodly/jobs.js +33 -0
  13. package/lib/commands/prodly/jobs.js.map +1 -0
  14. package/lib/commands/prodly/manage.d.ts +24 -0
  15. package/lib/commands/prodly/manage.js +167 -0
  16. package/lib/commands/prodly/manage.js.map +1 -0
  17. package/lib/commands/prodly/version.d.ts +16 -0
  18. package/lib/commands/prodly/version.js +88 -0
  19. package/lib/commands/prodly/version.js.map +1 -0
  20. package/lib/constants/index.d.ts +5 -0
  21. package/lib/constants/index.js +6 -0
  22. package/lib/constants/index.js.map +1 -0
  23. package/lib/helpers/index.d.ts +6 -0
  24. package/lib/helpers/index.js +17 -0
  25. package/lib/helpers/index.js.map +1 -0
  26. package/lib/index.d.ts +2 -0
  27. package/lib/index.js +2 -0
  28. package/lib/index.js.map +1 -0
  29. package/lib/services/connections.d.ts +7 -0
  30. package/lib/services/connections.js +109 -0
  31. package/lib/services/connections.js.map +1 -0
  32. package/lib/services/connections.types.d.ts +31 -0
  33. package/lib/services/connections.types.js +2 -0
  34. package/lib/services/connections.types.js.map +1 -0
  35. package/lib/services/jobs.d.ts +4 -0
  36. package/lib/services/jobs.js +26 -0
  37. package/lib/services/jobs.js.map +1 -0
  38. package/lib/services/jobs.types.d.ts +13 -0
  39. package/lib/services/jobs.types.js +2 -0
  40. package/lib/services/jobs.types.js.map +1 -0
  41. package/lib/services/manage-instances.d.ts +9 -0
  42. package/lib/services/manage-instances.js +116 -0
  43. package/lib/services/manage-instances.js.map +1 -0
  44. package/lib/services/manage-instances.types.d.ts +58 -0
  45. package/lib/services/manage-instances.types.js +2 -0
  46. package/lib/services/manage-instances.types.js.map +1 -0
  47. package/lib/services/queries.d.ts +8 -0
  48. package/lib/services/queries.js +54 -0
  49. package/lib/services/queries.js.map +1 -0
  50. package/lib/types/generic.d.ts +5 -0
  51. package/lib/types/generic.js +2 -0
  52. package/lib/types/generic.js.map +1 -0
  53. package/lib/types/prodly.d.ts +69 -0
  54. package/lib/types/prodly.js +2 -0
  55. package/lib/types/prodly.js.map +1 -0
  56. package/lib/types/salesforce.d.ts +14 -0
  57. package/lib/types/salesforce.js +2 -0
  58. package/lib/types/salesforce.js.map +1 -0
  59. package/lib/utils/index.d.ts +2 -0
  60. package/lib/utils/index.js +3 -0
  61. package/lib/utils/index.js.map +1 -0
  62. package/messages/prodly.checkin.md +1 -1
  63. package/messages/prodly.checkout.md +1 -1
  64. package/messages/prodly.deploy.md +2 -2
  65. package/messages/prodly.json +1 -0
  66. package/messages/prodly.manage.md +1 -1
  67. package/messages/prodly.version.md +3 -0
  68. package/npm-shrinkwrap.json +1715 -1090
  69. package/oclif.lock +2327 -2091
  70. package/oclif.manifest.json +708 -2
  71. 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 { getDeploymentEntityId };
54
+ //# sourceMappingURL=queries.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"queries.js","sourceRoot":"","sources":["../../src/services/queries.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,QAAQ,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,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,MAAM,EAAE,OAAO,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACpD,IAAI,cAAc,KAAK,kBAAkB,EAAE,CAAC;YAC1C,MAAM,IAAI,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC,qBAAqB,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;QACxF,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC,4BAA4B,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;QAC/F,CAAC;IACH,CAAC;IACD,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC9B,IAAI,cAAc,KAAK,kBAAkB,EAAE,CAAC;YAC1C,MAAM,IAAI,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC,4BAA4B,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;QAC/F,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC,mCAAmC,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;QACtG,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAC9B,CAAC,CAAC;AAEF,OAAO,EAAE,qBAAqB,EAAE,CAAC"}
@@ -0,0 +1,5 @@
1
+ type JSONValue = string | number | boolean | JSONObject;
2
+ export type JSONObject = {
3
+ [x: string]: JSONValue;
4
+ };
5
+ export {};
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=generic.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generic.js","sourceRoot":"","sources":["../../src/types/generic.ts"],"names":[],"mappings":""}
@@ -0,0 +1,69 @@
1
+ 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,2 @@
1
+ export {};
2
+ //# sourceMappingURL=prodly.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prodly.js","sourceRoot":"","sources":["../../src/types/prodly.ts"],"names":[],"mappings":""}
@@ -0,0 +1,14 @@
1
+ export type SaveResult = {
2
+ success: true;
3
+ id: string;
4
+ errors: never[];
5
+ } | {
6
+ success: false;
7
+ id?: undefined;
8
+ errors: SaveError[];
9
+ };
10
+ export type SaveError = {
11
+ errorCode: string;
12
+ message: string;
13
+ fields?: string[];
14
+ };
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=salesforce.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"salesforce.js","sourceRoot":"","sources":["../../src/types/salesforce.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ declare const delay: (ms: number) => Promise<void>;
2
+ export { delay };
@@ -0,0 +1,3 @@
1
+ const delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
2
+ export { delay };
3
+ //# sourceMappingURL=index.js.map
@@ -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 -u test-utxac7gbati9@example.com
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 -u test-utxac7gbati9@example.com
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 -u FixesScratchOrg -v MainDevHub
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 -u test-utxac7gbati9@example.com -v jsmith@acme.com -d "UAT Sandbox Connection"
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.
@@ -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 -u test-utxac7gbati9@example.com -n dev7sbx
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.