sfdx-jayree 4.4.38 → 4.5.1
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 +26 -0
- package/README.md +67 -52
- package/lib/commands/jayree/flowtestcoverage.js +2 -1
- package/lib/commands/jayree/flowtestcoverage.js.map +1 -1
- package/lib/commands/jayree/org/configure/country.d.ts +1 -2
- package/lib/commands/jayree/org/configure/country.js +19 -27
- package/lib/commands/jayree/org/configure/country.js.map +1 -1
- package/lib/commands/jayree/org/configure/index.js +16 -8
- package/lib/commands/jayree/org/configure/index.js.map +1 -1
- package/lib/commands/jayree/org/configure/state.js +23 -30
- package/lib/commands/jayree/org/configure/state.js.map +1 -1
- package/lib/commands/jayree/org/settings.js +3 -2
- package/lib/commands/jayree/org/settings.js.map +1 -1
- package/lib/commands/jayree/org/streaming.js +2 -1
- package/lib/commands/jayree/org/streaming.js.map +1 -1
- package/lib/commands/jayree/source/fix.js +2 -1
- package/lib/commands/jayree/source/fix.js.map +1 -1
- package/lib/commands/jayree/version.js +2 -1
- package/lib/commands/jayree/version.js.map +1 -1
- package/lib/hooks/changelog.d.ts +1 -1
- package/lib/hooks/changelog.js +8 -77
- package/lib/hooks/changelog.js.map +1 -1
- package/lib/hooks/postretrieve.js +3 -3
- package/lib/hooks/postretrieve.js.map +1 -1
- package/lib/hooks/prerun.js +3 -3
- package/lib/hooks/prerun.js.map +1 -1
- package/lib/utils/puppeteer/configuretasks.d.ts +1 -0
- package/lib/utils/puppeteer/configuretasks.js +18 -17
- package/lib/utils/puppeteer/configuretasks.js.map +1 -1
- package/lib/utils/puppeteer/statetasks.d.ts +26 -6
- package/lib/utils/puppeteer/statetasks.js +33 -61
- package/lib/utils/puppeteer/statetasks.js.map +1 -1
- package/lib/utils/renderer.d.ts +32 -163
- package/lib/utils/renderer.js +288 -302
- package/lib/utils/renderer.js.map +1 -1
- package/lib/utils/souceUtils.js +4 -4
- package/lib/utils/souceUtils.js.map +1 -1
- package/oclif.manifest.json +1 -220
- package/package.json +20 -34
- package/lib/commands/jayree/source/tracking/list.d.ts +0 -13
- package/lib/commands/jayree/source/tracking/list.js +0 -150
- package/lib/commands/jayree/source/tracking/list.js.map +0 -1
- package/lib/commands/jayree/source/tracking/store/get.d.ts +0 -10
- package/lib/commands/jayree/source/tracking/store/get.js +0 -58
- package/lib/commands/jayree/source/tracking/store/get.js.map +0 -1
- package/lib/commands/jayree/source/tracking/store/set.d.ts +0 -13
- package/lib/commands/jayree/source/tracking/store/set.js +0 -74
- package/lib/commands/jayree/source/tracking/store/set.js.map +0 -1
|
@@ -1,150 +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
|
-
/* eslint-disable no-console */
|
|
8
|
-
import { dirname, join } from 'node:path';
|
|
9
|
-
import { fileURLToPath } from 'node:url';
|
|
10
|
-
import { flags, SfdxCommand } from '@salesforce/command';
|
|
11
|
-
import { Messages } from '@salesforce/core';
|
|
12
|
-
import fs from 'fs-extra';
|
|
13
|
-
import chalk from 'chalk';
|
|
14
|
-
import { getCurrentStateFolderFilePath } from '../../../../utils/stateFolderHandler.js';
|
|
15
|
-
// eslint-disable-next-line no-underscore-dangle
|
|
16
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
17
|
-
// eslint-disable-next-line no-underscore-dangle
|
|
18
|
-
const __dirname = dirname(__filename);
|
|
19
|
-
Messages.importMessagesDirectory(__dirname);
|
|
20
|
-
const messages = Messages.loadMessages('sfdx-jayree', 'scratchorgtrackinglist');
|
|
21
|
-
export default class SourceTrackingList extends SfdxCommand {
|
|
22
|
-
async run() {
|
|
23
|
-
const conn = this.org.getConnection();
|
|
24
|
-
const { records: [{ maxCounter, maxNum }], } = await conn.tooling.query('SELECT MAX(RevisionCounter) maxCounter,MAX(RevisionNum) maxNum from SourceMember');
|
|
25
|
-
const maxRev = maxCounter >= maxNum ? maxCounter : maxNum;
|
|
26
|
-
const maxrevpath = await getCurrentStateFolderFilePath(this.project.getPath(), join('orgs', this.org.getOrgId(), 'maxRevision.json'), false);
|
|
27
|
-
let maxrevfile;
|
|
28
|
-
try {
|
|
29
|
-
const json = await fs.readJSON(maxrevpath);
|
|
30
|
-
if (Object.keys(json.sourceMembers).length > 0) {
|
|
31
|
-
maxrevfile = Math.max(0, ...Object.keys(json.sourceMembers).map((key) => json.sourceMembers[key].lastRetrievedFromServer));
|
|
32
|
-
if (maxrevfile === 0) {
|
|
33
|
-
maxrevfile = Math.min(...Object.keys(json.sourceMembers).map((key) => json.sourceMembers[key].serverRevisionCounter));
|
|
34
|
-
if (maxrevfile !== 0) {
|
|
35
|
-
maxrevfile = maxrevfile - 1;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
40
|
-
// support resetting local source tracking with sourceMembers={}
|
|
41
|
-
maxrevfile = json.serverMaxRevisionCounter;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
catch {
|
|
45
|
-
maxrevfile = 0;
|
|
46
|
-
}
|
|
47
|
-
let storedServerMaxRevisionCounter;
|
|
48
|
-
try {
|
|
49
|
-
const { serverMaxRevisionCounter } = await fs.readJSON(await getCurrentStateFolderFilePath(this.project.getPath(), join('orgs', this.org.getOrgId(), 'jayreeStoredMaxRevision.json'), true), { throws: false });
|
|
50
|
-
storedServerMaxRevisionCounter = serverMaxRevisionCounter;
|
|
51
|
-
// eslint-disable-next-line no-empty
|
|
52
|
-
}
|
|
53
|
-
catch { }
|
|
54
|
-
const { records } = await conn.tooling.query(`SELECT RevisionCounter,RevisionNum,Id,MemberType,MemberName,IsNameObsolete from SourceMember where RevisionCounter >= ${this.flags.revision > 0
|
|
55
|
-
? this.flags.revision
|
|
56
|
-
: storedServerMaxRevisionCounter
|
|
57
|
-
? storedServerMaxRevisionCounter
|
|
58
|
-
: 0}`);
|
|
59
|
-
let sourceMemberResults = records.map((SourceMember) => {
|
|
60
|
-
const RevisionCounter = SourceMember.RevisionCounter >= SourceMember.RevisionNum
|
|
61
|
-
? SourceMember.RevisionCounter
|
|
62
|
-
: SourceMember.RevisionNum;
|
|
63
|
-
return {
|
|
64
|
-
...SourceMember,
|
|
65
|
-
RevisionCounter,
|
|
66
|
-
RevisionCounterString: `${RevisionCounter}${RevisionCounter === maxRev ? ' [remote]' : ''}${RevisionCounter === maxrevfile ? ' [local]' : ''}${RevisionCounter === storedServerMaxRevisionCounter ? ' [stored]' : ''}`,
|
|
67
|
-
};
|
|
68
|
-
});
|
|
69
|
-
if (!sourceMemberResults.find((SourceMember) => SourceMember.RevisionCounter === maxrevfile)) {
|
|
70
|
-
sourceMemberResults.push({
|
|
71
|
-
RevisionCounter: maxrevfile,
|
|
72
|
-
RevisionCounterString: `${maxrevfile} [local]${maxrevfile === storedServerMaxRevisionCounter ? ' [stored]' : ''}`,
|
|
73
|
-
Id: 'unknown',
|
|
74
|
-
MemberType: 'unknown',
|
|
75
|
-
IsNameObsolete: 'unknown',
|
|
76
|
-
MemberName: 'unknown',
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
if (storedServerMaxRevisionCounter) {
|
|
80
|
-
if (!sourceMemberResults.find((SourceMember) => SourceMember.RevisionCounter === storedServerMaxRevisionCounter)) {
|
|
81
|
-
sourceMemberResults.push({
|
|
82
|
-
RevisionCounter: storedServerMaxRevisionCounter,
|
|
83
|
-
RevisionCounterString: `${storedServerMaxRevisionCounter} [stored]`,
|
|
84
|
-
Id: 'unknown',
|
|
85
|
-
MemberType: 'unknown',
|
|
86
|
-
IsNameObsolete: 'unknown',
|
|
87
|
-
MemberName: 'unknown',
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
sourceMemberResults = sourceMemberResults.sort((a, b) => {
|
|
92
|
-
const x = a.RevisionCounter;
|
|
93
|
-
const y = b.RevisionCounter;
|
|
94
|
-
return x < y ? -1 : x > y ? 1 : 0;
|
|
95
|
-
});
|
|
96
|
-
this.ux.styledHeader(chalk.blue(`SourceMember revision counter numbers list for: ${this.org.getUsername()}/${this.org.getOrgId()}`));
|
|
97
|
-
this.ux.table(sourceMemberResults, {
|
|
98
|
-
REVISIONCOUNTER: {
|
|
99
|
-
header: 'REVISIONCOUNTER',
|
|
100
|
-
get: (row) => row.RevisionCounterString,
|
|
101
|
-
},
|
|
102
|
-
ID: {
|
|
103
|
-
header: 'ID',
|
|
104
|
-
get: (row) => row.Id,
|
|
105
|
-
},
|
|
106
|
-
'FULL NAME': {
|
|
107
|
-
header: 'FULL NAME',
|
|
108
|
-
get: (row) => row.MemberName,
|
|
109
|
-
},
|
|
110
|
-
TYPE: {
|
|
111
|
-
header: 'TYPE',
|
|
112
|
-
get: (row) => row.MemberType,
|
|
113
|
-
},
|
|
114
|
-
OBSOLETE: {
|
|
115
|
-
header: 'OBSOLETE',
|
|
116
|
-
get: (row) => row.IsNameObsolete.toString(),
|
|
117
|
-
},
|
|
118
|
-
});
|
|
119
|
-
sourceMemberResults.forEach((sourceMember) => {
|
|
120
|
-
delete sourceMember.RevisionNum;
|
|
121
|
-
delete sourceMember.RevisionCounterString;
|
|
122
|
-
});
|
|
123
|
-
const maxRevision = { remote: maxRev, local: maxrevfile };
|
|
124
|
-
if (storedServerMaxRevisionCounter) {
|
|
125
|
-
maxRevision['stored'] = storedServerMaxRevisionCounter;
|
|
126
|
-
}
|
|
127
|
-
return {
|
|
128
|
-
maxRevision,
|
|
129
|
-
sourceMemberResults,
|
|
130
|
-
username: this.org.getUsername(),
|
|
131
|
-
};
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
SourceTrackingList.description = messages.getMessage('commandDescription');
|
|
135
|
-
SourceTrackingList.examples = [
|
|
136
|
-
`$ sfdx jayree:source:tracking:list
|
|
137
|
-
$ sfdx jayree:source:tracking:list -u me@my.org
|
|
138
|
-
$ sfdx jayree:source:tracking:list -u me@my.org -r 101`,
|
|
139
|
-
];
|
|
140
|
-
SourceTrackingList.flagsConfig = {
|
|
141
|
-
revision: flags.integer({
|
|
142
|
-
char: 'r',
|
|
143
|
-
description: messages.getMessage('startrevision'),
|
|
144
|
-
default: 0,
|
|
145
|
-
}),
|
|
146
|
-
};
|
|
147
|
-
SourceTrackingList.requiresUsername = true;
|
|
148
|
-
SourceTrackingList.supportsDevhubUsername = false;
|
|
149
|
-
SourceTrackingList.requiresProject = true;
|
|
150
|
-
//# sourceMappingURL=list.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../../../src/commands/jayree/source/tracking/list.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,+BAA+B;AAC/B,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,6BAA6B,EAAE,MAAM,yCAAyC,CAAC;AAExF,gDAAgD;AAChD,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,gDAAgD;AAChD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAEtC,QAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAE5C,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,aAAa,EAAE,wBAAwB,CAAC,CAAC;AAEhF,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,WAAW;I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;YAClC,WAAW,CAAC,QAAQ,CAAC,GAAG,8BAA8B,CAAC;SACxD;QAED,OAAO;YACL,WAAW;YACX,mBAAmB;YACnB,QAAQ,EAAE,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE;SACjC,CAAC;IACJ,CAAC;;AA9Ka,8BAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,oBAAoB,CAAC,CAAC;AAExD,2BAAQ,GAAG;IACvB;;uDAEmD;CACpD,CAAC;AAEe,8BAAW,GAAG;IAC7B,QAAQ,EAAE,KAAK,CAAC,OAAO,CAAC;QACtB,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,eAAe,CAAC;QACjD,OAAO,EAAE,CAAC;KACX,CAAC;CACH,CAAC;AAEe,mCAAgB,GAAG,IAAI,CAAC;AACxB,yCAAsB,GAAG,KAAK,CAAC;AAC/B,kCAAe,GAAG,IAAI,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { SfdxCommand } from '@salesforce/command';
|
|
2
|
-
import { AnyJson } from '@salesforce/ts-types';
|
|
3
|
-
export default class ScratchOrgRevisionInfo extends SfdxCommand {
|
|
4
|
-
static description: string;
|
|
5
|
-
static examples: string[];
|
|
6
|
-
protected static requiresUsername: boolean;
|
|
7
|
-
protected static supportsDevhubUsername: boolean;
|
|
8
|
-
protected static requiresProject: boolean;
|
|
9
|
-
run(): Promise<AnyJson>;
|
|
10
|
-
}
|
|
@@ -1,58 +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, join } from 'node:path';
|
|
8
|
-
import { fileURLToPath } from 'node:url';
|
|
9
|
-
import { SfdxCommand } from '@salesforce/command';
|
|
10
|
-
import { Messages } from '@salesforce/core';
|
|
11
|
-
import fs from 'fs-extra';
|
|
12
|
-
import chalk from 'chalk';
|
|
13
|
-
import { getCurrentStateFolderFilePath } from '../../../../../utils/stateFolderHandler.js';
|
|
14
|
-
// eslint-disable-next-line no-underscore-dangle
|
|
15
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
16
|
-
// eslint-disable-next-line no-underscore-dangle
|
|
17
|
-
const __dirname = dirname(__filename);
|
|
18
|
-
Messages.importMessagesDirectory(__dirname);
|
|
19
|
-
const messages = Messages.loadMessages('sfdx-jayree', 'scratchorgtrackingget');
|
|
20
|
-
export default class ScratchOrgRevisionInfo extends SfdxCommand {
|
|
21
|
-
async run() {
|
|
22
|
-
const { serverMaxRevisionCounter } = await fs.readJSON(await getCurrentStateFolderFilePath(this.project.getPath(), join('orgs', this.org.getOrgId(), 'jayreeStoredMaxRevision.json'), true), { throws: false });
|
|
23
|
-
this.ux.styledHeader(chalk.blue('Get stored SourceMember revision counter number'));
|
|
24
|
-
this.ux.table([
|
|
25
|
-
{
|
|
26
|
-
username: this.org.getUsername(),
|
|
27
|
-
orgid: this.org.getOrgId(),
|
|
28
|
-
serverMaxRevisionCounter: serverMaxRevisionCounter.toString(),
|
|
29
|
-
},
|
|
30
|
-
], {
|
|
31
|
-
Username: {
|
|
32
|
-
header: 'Username',
|
|
33
|
-
get: (row) => row.username,
|
|
34
|
-
},
|
|
35
|
-
OrgId: {
|
|
36
|
-
header: 'OrgId',
|
|
37
|
-
get: (row) => row.orgid,
|
|
38
|
-
},
|
|
39
|
-
RevisionCounter: {
|
|
40
|
-
header: 'RevisionCounter',
|
|
41
|
-
get: (row) => row.serverMaxRevisionCounter,
|
|
42
|
-
},
|
|
43
|
-
});
|
|
44
|
-
return {
|
|
45
|
-
revision: serverMaxRevisionCounter,
|
|
46
|
-
username: this.org.getUsername(),
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
ScratchOrgRevisionInfo.description = messages.getMessage('commandDescription');
|
|
51
|
-
ScratchOrgRevisionInfo.examples = [
|
|
52
|
-
`$ sfdx jayree:source:tracking:store:get
|
|
53
|
-
$ sfdx jayree:source:tracking:store:get -u me@my.org`,
|
|
54
|
-
];
|
|
55
|
-
ScratchOrgRevisionInfo.requiresUsername = true;
|
|
56
|
-
ScratchOrgRevisionInfo.supportsDevhubUsername = false;
|
|
57
|
-
ScratchOrgRevisionInfo.requiresProject = true;
|
|
58
|
-
//# sourceMappingURL=get.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get.js","sourceRoot":"","sources":["../../../../../../src/commands/jayree/source/tracking/store/get.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,6BAA6B,EAAE,MAAM,4CAA4C,CAAC;AAE3F,gDAAgD;AAChD,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,gDAAgD;AAChD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAEtC,QAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAE5C,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,aAAa,EAAE,uBAAuB,CAAC,CAAC;AAE/E,MAAM,CAAC,OAAO,OAAO,sBAAuB,SAAQ,WAAW;IAYtD,KAAK,CAAC,GAAG;QACd,MAAM,EAAE,wBAAwB,EAAE,GAAG,MAAM,EAAE,CAAC,QAAQ,CACpD,MAAM,6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0,0 @@
|
|
|
1
|
-
import { flags, SfdxCommand } from '@salesforce/command';
|
|
2
|
-
import { AnyJson } from '@salesforce/ts-types';
|
|
3
|
-
export default class ScratchOrgRevisionInfo extends SfdxCommand {
|
|
4
|
-
static description: string;
|
|
5
|
-
static examples: string[];
|
|
6
|
-
protected static flagsConfig: {
|
|
7
|
-
revision: flags.Discriminated<flags.Number>;
|
|
8
|
-
};
|
|
9
|
-
protected static requiresUsername: boolean;
|
|
10
|
-
protected static supportsDevhubUsername: boolean;
|
|
11
|
-
protected static requiresProject: boolean;
|
|
12
|
-
run(): Promise<AnyJson>;
|
|
13
|
-
}
|
|
@@ -1,74 +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, join } from 'node:path';
|
|
8
|
-
import { fileURLToPath } from 'node:url';
|
|
9
|
-
import { flags, SfdxCommand } from '@salesforce/command';
|
|
10
|
-
import { Messages } from '@salesforce/core';
|
|
11
|
-
import fs from 'fs-extra';
|
|
12
|
-
import chalk from 'chalk';
|
|
13
|
-
import { getCurrentStateFolderFilePath } from '../../../../../utils/stateFolderHandler.js';
|
|
14
|
-
// eslint-disable-next-line no-underscore-dangle
|
|
15
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
16
|
-
// eslint-disable-next-line no-underscore-dangle
|
|
17
|
-
const __dirname = dirname(__filename);
|
|
18
|
-
Messages.importMessagesDirectory(__dirname);
|
|
19
|
-
const messages = Messages.loadMessages('sfdx-jayree', 'scratchorgtrackingset');
|
|
20
|
-
export default class ScratchOrgRevisionInfo extends SfdxCommand {
|
|
21
|
-
async run() {
|
|
22
|
-
const conn = this.org.getConnection();
|
|
23
|
-
const { records: [{ maxCounter, maxNum }], } = await conn.tooling.query('SELECT MAX(RevisionCounter) maxCounter,MAX(RevisionNum) maxNum from SourceMember');
|
|
24
|
-
let maxRev = maxCounter >= maxNum ? maxCounter : maxNum;
|
|
25
|
-
if (!maxRev) {
|
|
26
|
-
maxRev = 0;
|
|
27
|
-
}
|
|
28
|
-
const storedmaxrevpath = await getCurrentStateFolderFilePath(this.project.getPath(), join('orgs', this.org.getOrgId(), 'jayreeStoredMaxRevision.json'), true);
|
|
29
|
-
const newMaxRev = this.flags.revision >= 0 ? this.flags.revision : maxRev;
|
|
30
|
-
await fs.ensureFile(storedmaxrevpath);
|
|
31
|
-
await fs.writeJSON(storedmaxrevpath, { serverMaxRevisionCounter: newMaxRev });
|
|
32
|
-
this.ux.styledHeader(chalk.blue('Set stored SourceMember revision counter number'));
|
|
33
|
-
this.ux.table([
|
|
34
|
-
{
|
|
35
|
-
username: this.org.getUsername(),
|
|
36
|
-
orgid: this.org.getOrgId(),
|
|
37
|
-
serverMaxRevisionCounter: newMaxRev.toString(),
|
|
38
|
-
},
|
|
39
|
-
], {
|
|
40
|
-
Username: {
|
|
41
|
-
header: 'Username',
|
|
42
|
-
get: (row) => row.username,
|
|
43
|
-
},
|
|
44
|
-
OrgId: {
|
|
45
|
-
header: 'OrgId',
|
|
46
|
-
get: (row) => row.orgid,
|
|
47
|
-
},
|
|
48
|
-
RevisionCounter: {
|
|
49
|
-
header: 'RevisionCounter',
|
|
50
|
-
get: (row) => row.serverMaxRevisionCounter,
|
|
51
|
-
},
|
|
52
|
-
});
|
|
53
|
-
return {
|
|
54
|
-
revision: newMaxRev,
|
|
55
|
-
username: this.org.getUsername(),
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
ScratchOrgRevisionInfo.description = messages.getMessage('commandDescription');
|
|
60
|
-
ScratchOrgRevisionInfo.examples = [
|
|
61
|
-
`$ sfdx jayree:source:tracking:store:set
|
|
62
|
-
$ sfdx jayree:source:tracking:store:set -u me@my.org
|
|
63
|
-
$ sfdx jayree:source:tracking:store:set -u MyTestOrg1 -r 101`,
|
|
64
|
-
];
|
|
65
|
-
ScratchOrgRevisionInfo.flagsConfig = {
|
|
66
|
-
revision: flags.integer({
|
|
67
|
-
char: 'r',
|
|
68
|
-
description: messages.getMessage('revision'),
|
|
69
|
-
}),
|
|
70
|
-
};
|
|
71
|
-
ScratchOrgRevisionInfo.requiresUsername = true;
|
|
72
|
-
ScratchOrgRevisionInfo.supportsDevhubUsername = false;
|
|
73
|
-
ScratchOrgRevisionInfo.requiresProject = true;
|
|
74
|
-
//# sourceMappingURL=set.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"set.js","sourceRoot":"","sources":["../../../../../../src/commands/jayree/source/tracking/store/set.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,6BAA6B,EAAE,MAAM,4CAA4C,CAAC;AAE3F,gDAAgD;AAChD,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,gDAAgD;AAChD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAEtC,QAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAE5C,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,aAAa,EAAE,uBAAuB,CAAC,CAAC;AAE/E,MAAM,CAAC,OAAO,OAAO,sBAAuB,SAAQ,WAAW;IAoBtD,KAAK,CAAC,GAAG;QACd,MAAM,I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