@salesforce/apex-node 8.1.29 → 8.1.30
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 +0 -1
- package/lib/src/execute/executeService.js +5 -7
- package/lib/src/execute/executeService.js.map +1 -1
- package/lib/src/execute/types.d.ts +2 -11
- package/lib/src/execute/types.js +1 -24
- package/lib/src/execute/types.js.map +1 -1
- package/lib/src/execute/utils.js +24 -43
- package/lib/src/execute/utils.js.map +1 -1
- package/lib/src/i18n/index.d.ts +0 -1
- package/lib/src/i18n/index.js +1 -4
- package/lib/src/i18n/index.js.map +1 -1
- package/lib/src/i18n/localization.d.ts +3 -2
- package/lib/src/index.d.ts +2 -1
- package/lib/src/index.js +2 -2
- package/lib/src/index.js.map +1 -1
- package/lib/src/logs/index.d.ts +1 -1
- package/lib/src/logs/index.js +1 -3
- package/lib/src/logs/index.js.map +1 -1
- package/lib/src/logs/logService.d.ts +1 -1
- package/lib/src/logs/logService.js +9 -20
- package/lib/src/logs/logService.js.map +1 -1
- package/lib/src/logs/types.d.ts +0 -3
- package/lib/src/narrowing/index.d.ts +1 -1
- package/lib/src/narrowing/index.js +1 -13
- package/lib/src/narrowing/index.js.map +1 -1
- package/lib/src/narrowing/narrowing.d.ts +2 -15
- package/lib/src/narrowing/narrowing.js +13 -109
- package/lib/src/narrowing/narrowing.js.map +1 -1
- package/lib/src/reporters/buildTapDiagnostics.d.ts +2 -0
- package/lib/src/reporters/buildTapDiagnostics.js +66 -0
- package/lib/src/reporters/buildTapDiagnostics.js.map +1 -0
- package/lib/src/reporters/coverageReporter.js +2 -6
- package/lib/src/reporters/coverageReporter.js.map +1 -1
- package/lib/src/reporters/humanReporter.d.ts +0 -1
- package/lib/src/reporters/humanReporter.js +77 -120
- package/lib/src/reporters/humanReporter.js.map +1 -1
- package/lib/src/reporters/index.d.ts +0 -1
- package/lib/src/reporters/index.js +1 -3
- package/lib/src/reporters/index.js.map +1 -1
- package/lib/src/reporters/junitFormatTransformer.d.ts +2 -1
- package/lib/src/reporters/tapFormatTransform.d.ts +2 -8
- package/lib/src/reporters/tapFormatTransform.js +2 -65
- package/lib/src/reporters/tapFormatTransform.js.map +1 -1
- package/lib/src/reporters/tapReporter.d.ts +2 -2
- package/lib/src/reporters/tapReporter.js +16 -89
- package/lib/src/reporters/tapReporter.js.map +1 -1
- package/lib/src/streaming/index.d.ts +0 -1
- package/lib/src/streaming/index.js +1 -6
- package/lib/src/streaming/index.js.map +1 -1
- package/lib/src/streaming/streamingClient.d.ts +0 -1
- package/lib/src/streaming/streamingClient.js +4 -4
- package/lib/src/streaming/streamingClient.js.map +1 -1
- package/lib/src/streaming/testResultStringifyStream.d.ts +2 -1
- package/lib/src/streaming/types.d.ts +2 -1
- package/lib/src/tests/asyncTests.js +17 -18
- package/lib/src/tests/asyncTests.js.map +1 -1
- package/lib/src/tests/codeCoverage.js +12 -17
- package/lib/src/tests/codeCoverage.js.map +1 -1
- package/lib/src/tests/diagnosticUtil.d.ts +1 -2
- package/lib/src/tests/diagnosticUtil.js +16 -40
- package/lib/src/tests/diagnosticUtil.js.map +1 -1
- package/lib/src/tests/index.d.ts +1 -1
- package/lib/src/tests/index.js.map +1 -1
- package/lib/src/tests/syncTests.js +1 -1
- package/lib/src/tests/syncTests.js.map +1 -1
- package/lib/src/tests/testService.js +1 -3
- package/lib/src/tests/testService.js.map +1 -1
- package/lib/src/tests/types.d.ts +3 -17
- package/lib/src/tests/types.js.map +1 -1
- package/lib/src/tests/utils.d.ts +0 -1
- package/lib/src/tests/utils.js +23 -26
- package/lib/src/tests/utils.js.map +1 -1
- package/lib/src/utils/authUtil.d.ts +1 -1
- package/lib/src/utils/authUtil.js +1 -3
- package/lib/src/utils/authUtil.js.map +1 -1
- package/lib/src/utils/fileSystemHandler.d.ts +1 -11
- package/lib/src/utils/fileSystemHandler.js +2 -38
- package/lib/src/utils/fileSystemHandler.js.map +1 -1
- package/lib/src/utils/index.d.ts +1 -1
- package/lib/src/utils/index.js.map +1 -1
- package/lib/src/utils/types.d.ts +2 -8
- package/package.json +4 -13
- package/lib/src/execute/index.d.ts +0 -2
- package/lib/src/execute/index.js +0 -12
- package/lib/src/execute/index.js.map +0 -1
- package/lib/src/reporters/humanFormatTransform.d.ts +0 -17
- package/lib/src/reporters/humanFormatTransform.js +0 -308
- package/lib/src/reporters/humanFormatTransform.js.map +0 -1
- package/lib/src/streaming/utils.d.ts +0 -5
- package/lib/src/streaming/utils.js +0 -36
- package/lib/src/streaming/utils.js.map +0 -1
- package/lib/src/utils/tableWritableStream.d.ts +0 -15
- package/lib/src/utils/tableWritableStream.js +0 -115
- package/lib/src/utils/tableWritableStream.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
# Salesforce Apex Library
|
|
2
2
|
|
|
3
3
|
[](https://opensource.org/licenses/BSD-3-Clause)
|
|
4
|
-
[](http://commitizen.github.io/cz-cli/)
|
|
5
4
|
|
|
6
5
|
## Introduction
|
|
7
6
|
Typescript library to support the [Salesforce Extensions for VS Code](https://github.com/forcedotcom/salesforcedx-vscode/) and the [Apex Plugin for the Salesforce CLI](https://github.com/salesforcecli/plugin-apex).
|
|
@@ -64,8 +64,7 @@ class ExecuteService {
|
|
|
64
64
|
}
|
|
65
65
|
catch (e) {
|
|
66
66
|
if (e.name === 'ERROR_HTTP_500' &&
|
|
67
|
-
e.message
|
|
68
|
-
e.message.includes('INVALID_SESSION_ID')) {
|
|
67
|
+
e.message?.includes('INVALID_SESSION_ID')) {
|
|
69
68
|
await (0, utils_1.refreshAuth)(this.connection);
|
|
70
69
|
count += 1;
|
|
71
70
|
}
|
|
@@ -123,15 +122,14 @@ class ExecuteService {
|
|
|
123
122
|
buildExecRequest(data) {
|
|
124
123
|
const body = (0, utils_2.encodeBody)(this.connection.accessToken, data);
|
|
125
124
|
const postEndpoint = `${this.connection.instanceUrl}/services/Soap/s/${this.connection.version}/${this.connection.accessToken.split('!')[0]}`;
|
|
126
|
-
const requestHeaders = {
|
|
127
|
-
'content-type': 'text/xml',
|
|
128
|
-
soapaction: types_1.action
|
|
129
|
-
};
|
|
130
125
|
return {
|
|
131
126
|
method: 'POST',
|
|
132
127
|
url: postEndpoint,
|
|
133
128
|
body,
|
|
134
|
-
headers:
|
|
129
|
+
headers: {
|
|
130
|
+
'content-type': 'text/xml',
|
|
131
|
+
soapaction: types_1.action
|
|
132
|
+
}
|
|
135
133
|
};
|
|
136
134
|
}
|
|
137
135
|
jsonFormat(soapResponse) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executeService.js","sourceRoot":"","sources":["../../../src/execute/executeService.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,2BAA8C;AAC9C,mCAQiB;AACjB,kCAA8B;AAC9B,oCAAuC;AACvC,mCAAqC;AACrC,mDAAqC;AAErC,sDAAmD;AACnD,4CAA8B;AAE9B,MAAa,cAAc;IACT,UAAU,CAAa;IAEvC,YAAY,UAAsB;QAChC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;IAGY,AAAN,KAAK,CAAC,gBAAgB,CAC3B,OAA2B;QAE3B,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QAE7C,IAAI,KAAK,GAAG,CAAC,CAAC;QACd,OAAO,KAAK,GAAG,CAAC,EAAE,CAAC;YACjB,IAAI,CAAC;gBACH,MAAM,OAAO,GAAG,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;gBAC5C,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;gBACrD,OAAO,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;YACjC,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC;gBACX,IACE,CAAC,CAAC,IAAI,KAAK,gBAAgB;oBAC3B,CAAC,CAAC,OAAO
|
|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IAAA,yBAAW,GAAE;kDAMb;AAGY;IADZ,IAAA,yBAAW,GAAE;kDA4Bb;AAsBM;IADN,IAAA,yBAAW,GAAE;gDAiCb;AAGY;IADZ,IAAA,yBAAW,GAAE;uDAKb"}
|
|
@@ -9,10 +9,6 @@ export declare const soapEnv = "soapenv:Envelope";
|
|
|
9
9
|
export declare const soapBody = "soapenv:Body";
|
|
10
10
|
export declare const soapHeader = "soapenv:Header";
|
|
11
11
|
export declare const action = "executeAnonymous";
|
|
12
|
-
export declare const soapTemplate = "<env:Envelope xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"\nxmlns:env=\"http://schemas.xmlsoap.org/soap/envelope/\"\nxmlns:cmd=\"http://soap.sforce.com/2006/08/apex\"\nxmlns:apex=\"http://soap.sforce.com/2006/08/apex\">\n <env:Header>\n <cmd:SessionHeader>\n <cmd:sessionId>%s</cmd:sessionId>\n </cmd:SessionHeader>\n %s\n </env:Header>\n <env:Body>\n <%s xmlns=\"http://soap.sforce.com/2006/08/apex\">\n %s\n </%s>\n </env:Body>\n</env:Envelope>";
|
|
13
|
-
export declare const xmlCharMap: {
|
|
14
|
-
[index: string]: string;
|
|
15
|
-
};
|
|
16
12
|
export interface SoapResponse {
|
|
17
13
|
[soapEnv]?: {
|
|
18
14
|
[soapHeader]?: {
|
|
@@ -25,15 +21,9 @@ export interface SoapResponse {
|
|
|
25
21
|
};
|
|
26
22
|
};
|
|
27
23
|
}
|
|
28
|
-
|
|
24
|
+
interface DebuggingInfo {
|
|
29
25
|
debugLog: string;
|
|
30
26
|
}
|
|
31
|
-
export interface RequestData {
|
|
32
|
-
method: string;
|
|
33
|
-
url: string;
|
|
34
|
-
body: string;
|
|
35
|
-
headers: {};
|
|
36
|
-
}
|
|
37
27
|
export type ExecuteAnonymousResponse = {
|
|
38
28
|
compiled: boolean;
|
|
39
29
|
success: boolean;
|
|
@@ -49,3 +39,4 @@ export type ExecAnonApiResponse = {
|
|
|
49
39
|
line: number;
|
|
50
40
|
success: string;
|
|
51
41
|
};
|
|
42
|
+
export {};
|
package/lib/src/execute/types.js
CHANGED
|
@@ -1,31 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.action = exports.soapHeader = exports.soapBody = exports.soapEnv = void 0;
|
|
4
4
|
exports.soapEnv = 'soapenv:Envelope';
|
|
5
5
|
exports.soapBody = 'soapenv:Body';
|
|
6
6
|
exports.soapHeader = 'soapenv:Header';
|
|
7
7
|
exports.action = 'executeAnonymous';
|
|
8
|
-
exports.soapTemplate = `<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
|
9
|
-
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
|
|
10
|
-
xmlns:cmd="http://soap.sforce.com/2006/08/apex"
|
|
11
|
-
xmlns:apex="http://soap.sforce.com/2006/08/apex">
|
|
12
|
-
<env:Header>
|
|
13
|
-
<cmd:SessionHeader>
|
|
14
|
-
<cmd:sessionId>%s</cmd:sessionId>
|
|
15
|
-
</cmd:SessionHeader>
|
|
16
|
-
%s
|
|
17
|
-
</env:Header>
|
|
18
|
-
<env:Body>
|
|
19
|
-
<%s xmlns="http://soap.sforce.com/2006/08/apex">
|
|
20
|
-
%s
|
|
21
|
-
</%s>
|
|
22
|
-
</env:Body>
|
|
23
|
-
</env:Envelope>`;
|
|
24
|
-
exports.xmlCharMap = {
|
|
25
|
-
'<': '<',
|
|
26
|
-
'>': '>',
|
|
27
|
-
'&': '&',
|
|
28
|
-
'"': '"',
|
|
29
|
-
"'": '''
|
|
30
|
-
};
|
|
31
8
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/execute/types.ts"],"names":[],"mappings":";;;AAea,QAAA,OAAO,GAAG,kBAAkB,CAAC;AAC7B,QAAA,QAAQ,GAAG,cAAc,CAAC;AAC1B,QAAA,UAAU,GAAG,gBAAgB,CAAC;AAC9B,QAAA,MAAM,GAAG,kBAAkB,CAAC
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/execute/types.ts"],"names":[],"mappings":";;;AAea,QAAA,OAAO,GAAG,kBAAkB,CAAC;AAC7B,QAAA,QAAQ,GAAG,cAAc,CAAC;AAC1B,QAAA,UAAU,GAAG,gBAAgB,CAAC;AAC9B,QAAA,MAAM,GAAG,kBAAkB,CAAC"}
|
package/lib/src/execute/utils.js
CHANGED
|
@@ -1,37 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
3
|
exports.encodeBody = encodeBody;
|
|
37
4
|
/*
|
|
@@ -41,17 +8,31 @@ exports.encodeBody = encodeBody;
|
|
|
41
8
|
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
42
9
|
*/
|
|
43
10
|
const types_1 = require("./types");
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
11
|
+
const xmlCharMap = {
|
|
12
|
+
'<': '<',
|
|
13
|
+
'>': '>',
|
|
14
|
+
'&': '&',
|
|
15
|
+
'"': '"',
|
|
16
|
+
"'": '''
|
|
17
|
+
};
|
|
18
|
+
const escapeXml = (data) => data.replace(/[<>&'\"]/g, (char) => xmlCharMap[char]);
|
|
50
19
|
function encodeBody(accessToken, data) {
|
|
51
20
|
const escapedData = escapeXml(data);
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
21
|
+
return `<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
|
22
|
+
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
|
|
23
|
+
xmlns:cmd="http://soap.sforce.com/2006/08/apex"
|
|
24
|
+
xmlns:apex="http://soap.sforce.com/2006/08/apex">
|
|
25
|
+
<env:Header>
|
|
26
|
+
<cmd:SessionHeader>
|
|
27
|
+
<cmd:sessionId>${accessToken}</cmd:sessionId>
|
|
28
|
+
</cmd:SessionHeader>
|
|
29
|
+
<apex:DebuggingHeader><apex:debugLevel>DEBUGONLY</apex:debugLevel></apex:DebuggingHeader>
|
|
30
|
+
</env:Header>
|
|
31
|
+
<env:Body>
|
|
32
|
+
<${types_1.action} xmlns="http://soap.sforce.com/2006/08/apex">
|
|
33
|
+
<apexcode>${escapedData}</apexcode>
|
|
34
|
+
</${types_1.action}>
|
|
35
|
+
</env:Body>
|
|
36
|
+
</env:Envelope>`;
|
|
56
37
|
}
|
|
57
38
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/execute/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/execute/utils.ts"],"names":[],"mappings":";;AAmBA,gCAmBC;AAtCD;;;;;GAKG;AACH,mCAAiC;AAEjC,MAAM,UAAU,GAA8B;IAC5C,GAAG,EAAE,MAAM;IACX,GAAG,EAAE,MAAM;IACX,GAAG,EAAE,OAAO;IACZ,GAAG,EAAE,QAAQ;IACb,GAAG,EAAE,QAAQ;CACd,CAAC;AAEF,MAAM,SAAS,GAAG,CAAC,IAAY,EAAU,EAAE,CACzC,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;AAEhE,SAAgB,UAAU,CAAC,WAAmB,EAAE,IAAY;IAC1D,MAAM,WAAW,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;IAEpC,OAAO;;;;;;6BAMoB,WAAW;;;;;WAK7B,cAAM;wBACO,WAAW;YACvB,cAAM;;gBAEF,CAAC;AACjB,CAAC"}
|
package/lib/src/i18n/index.d.ts
CHANGED
package/lib/src/i18n/index.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.
|
|
9
|
+
exports.nls = void 0;
|
|
10
10
|
const i18n_1 = require("./i18n");
|
|
11
11
|
const localization_1 = require("./localization");
|
|
12
12
|
function loadMessageBundle() {
|
|
@@ -19,7 +19,4 @@ function loadMessageBundle() {
|
|
|
19
19
|
return undefined;
|
|
20
20
|
}
|
|
21
21
|
exports.nls = new localization_1.Localization(loadMessageBundle());
|
|
22
|
-
var localization_2 = require("./localization");
|
|
23
|
-
Object.defineProperty(exports, "Localization", { enumerable: true, get: function () { return localization_2.Localization; } });
|
|
24
|
-
Object.defineProperty(exports, "Message", { enumerable: true, get: function () { return localization_2.Message; } });
|
|
25
22
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/i18n/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,iCAAkC;AAClC,iDAAuD;AAEvD,SAAS,iBAAiB;IACxB,IAAI,CAAC;QACH,OAAO,IAAI,sBAAO,CAAC,eAAQ,CAAC,CAAC;IAC/B,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,OAAO,CAAC,KAAK,CAAC,qCAAqC,CAAC,CAAC;IACvD,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAEY,QAAA,GAAG,GAAG,IAAI,2BAAY,CAAC,iBAAiB,EAAE,CAAC,CAAC
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/i18n/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,iCAAkC;AAClC,iDAAuD;AAEvD,SAAS,iBAAiB;IACxB,IAAI,CAAC;QACH,OAAO,IAAI,sBAAO,CAAC,eAAQ,CAAC,CAAC;IAC/B,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,OAAO,CAAC,KAAK,CAAC,qCAAqC,CAAC,CAAC;IACvD,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAEY,QAAA,GAAG,GAAG,IAAI,2BAAY,CAAC,iBAAiB,EAAE,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
interface LocalizationProvider {
|
|
2
2
|
localize(label: string, args?: string | string[]): string;
|
|
3
3
|
}
|
|
4
4
|
export declare class Localization implements LocalizationProvider {
|
|
@@ -6,7 +6,7 @@ export declare class Localization implements LocalizationProvider {
|
|
|
6
6
|
constructor(delegate: Message);
|
|
7
7
|
localize(label: string, args?: string | string[]): string;
|
|
8
8
|
}
|
|
9
|
-
|
|
9
|
+
type MessageBundle = {
|
|
10
10
|
readonly [index: string]: string;
|
|
11
11
|
};
|
|
12
12
|
export declare class Message implements LocalizationProvider {
|
|
@@ -15,3 +15,4 @@ export declare class Message implements LocalizationProvider {
|
|
|
15
15
|
localize(label: string, args?: string | string[]): string;
|
|
16
16
|
private getLabel;
|
|
17
17
|
}
|
|
18
|
+
export {};
|
package/lib/src/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { CancellationToken, CancellationTokenSource, Progress } from './common';
|
|
2
|
-
export {
|
|
2
|
+
export { ExecuteAnonymousResponse, ApexExecuteOptions } from './execute/types';
|
|
3
|
+
export { ExecuteService } from './execute/executeService';
|
|
3
4
|
export { LogService, ApexLogGetOptions, LogRecord, LogResult } from './logs';
|
|
4
5
|
export { JUnitReporter, JUnitFormatTransformer, TapReporter, TapFormatTransformer, HumanReporter, CoverageReporterOptions, CoverageReporter, CoverageReportFormats, DefaultReportOptions, DefaultWatermarks } from './reporters';
|
|
5
6
|
export { ApexCodeCoverageAggregate, ApexCodeCoverageAggregateRecord, ApexTestProgressValue, ApexTestResultData, ApexTestResultOutcome, ApexTestRunResultStatus, ApexTestSetupData, AsyncTestArrayConfiguration, AsyncTestConfiguration, CodeCoverageResult, OutputDirConfig, ResultFormat, SyncTestConfiguration, TestItem, TestLevel, TestResult, TestService, TestRunIdResult } from './tests';
|
package/lib/src/index.js
CHANGED
|
@@ -9,8 +9,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
9
9
|
exports.Table = exports.TestService = exports.TestLevel = exports.ResultFormat = exports.ApexTestRunResultStatus = exports.ApexTestResultOutcome = exports.DefaultWatermarks = exports.DefaultReportOptions = exports.CoverageReporter = exports.HumanReporter = exports.TapFormatTransformer = exports.TapReporter = exports.JUnitFormatTransformer = exports.JUnitReporter = exports.LogService = exports.ExecuteService = exports.CancellationTokenSource = void 0;
|
|
10
10
|
var common_1 = require("./common");
|
|
11
11
|
Object.defineProperty(exports, "CancellationTokenSource", { enumerable: true, get: function () { return common_1.CancellationTokenSource; } });
|
|
12
|
-
var
|
|
13
|
-
Object.defineProperty(exports, "ExecuteService", { enumerable: true, get: function () { return
|
|
12
|
+
var executeService_1 = require("./execute/executeService");
|
|
13
|
+
Object.defineProperty(exports, "ExecuteService", { enumerable: true, get: function () { return executeService_1.ExecuteService; } });
|
|
14
14
|
var logs_1 = require("./logs");
|
|
15
15
|
Object.defineProperty(exports, "LogService", { enumerable: true, get: function () { return logs_1.LogService; } });
|
|
16
16
|
var reporters_1 = require("./reporters");
|
package/lib/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,mCAAgF;AAApD,iHAAA,uBAAuB,OAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,mCAAgF;AAApD,iHAAA,uBAAuB,OAAA;AAEnD,2DAA0D;AAAjD,gHAAA,cAAc,OAAA;AACvB,+BAA6E;AAApE,kGAAA,UAAU,OAAA;AACnB,yCAWqB;AAVnB,0GAAA,aAAa,OAAA;AACb,mHAAA,sBAAsB,OAAA;AACtB,wGAAA,WAAW,OAAA;AACX,iHAAA,oBAAoB,OAAA;AACpB,0GAAA,aAAa,OAAA;AAEb,6GAAA,gBAAgB,OAAA;AAEhB,iHAAA,oBAAoB,OAAA;AACpB,8GAAA,iBAAiB,OAAA;AAEnB,iCAmBiB;AAdf,8GAAA,qBAAqB,OAAA;AACrB,gHAAA,uBAAuB,OAAA;AAMvB,qGAAA,YAAY,OAAA;AAGZ,kGAAA,SAAS,OAAA;AAET,oGAAA,WAAW,OAAA;AAGb,iCAAqD;AAAvB,8FAAA,KAAK,OAAA"}
|
package/lib/src/logs/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { LogService } from './logService';
|
|
2
2
|
export { ApexLogGetOptions, LogRecord, LogResult } from './types';
|
|
3
|
-
export { DEFAULT_DEBUG_LEVEL_NAME, LOG_TYPE,
|
|
3
|
+
export { DEFAULT_DEBUG_LEVEL_NAME, LOG_TYPE, LOG_TIMER_LENGTH_MINUTES } from './constants';
|
package/lib/src/logs/index.js
CHANGED
|
@@ -6,13 +6,11 @@
|
|
|
6
6
|
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.
|
|
9
|
+
exports.LOG_TIMER_LENGTH_MINUTES = exports.LOG_TYPE = exports.DEFAULT_DEBUG_LEVEL_NAME = exports.LogService = void 0;
|
|
10
10
|
var logService_1 = require("./logService");
|
|
11
11
|
Object.defineProperty(exports, "LogService", { enumerable: true, get: function () { return logService_1.LogService; } });
|
|
12
12
|
var constants_1 = require("./constants");
|
|
13
13
|
Object.defineProperty(exports, "DEFAULT_DEBUG_LEVEL_NAME", { enumerable: true, get: function () { return constants_1.DEFAULT_DEBUG_LEVEL_NAME; } });
|
|
14
14
|
Object.defineProperty(exports, "LOG_TYPE", { enumerable: true, get: function () { return constants_1.LOG_TYPE; } });
|
|
15
|
-
Object.defineProperty(exports, "MAX_NUM_LOGS", { enumerable: true, get: function () { return constants_1.MAX_NUM_LOGS; } });
|
|
16
15
|
Object.defineProperty(exports, "LOG_TIMER_LENGTH_MINUTES", { enumerable: true, get: function () { return constants_1.LOG_TIMER_LENGTH_MINUTES; } });
|
|
17
|
-
Object.defineProperty(exports, "LISTENER_ABORTED_ERROR_NAME", { enumerable: true, get: function () { return constants_1.LISTENER_ABORTED_ERROR_NAME; } });
|
|
18
16
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/logs/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,2CAA0C;AAAjC,wGAAA,UAAU,OAAA;AAEnB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/logs/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,2CAA0C;AAAjC,wGAAA,UAAU,OAAA;AAEnB,yCAIqB;AAHnB,qHAAA,wBAAwB,OAAA;AACxB,qGAAA,QAAQ,OAAA;AACR,qHAAA,wBAAwB,OAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Connection, Org, StreamingClient } from '@salesforce/core';
|
|
2
|
-
import { AnyJson } from '@salesforce/ts-types';
|
|
2
|
+
import type { AnyJson } from '@salesforce/ts-types';
|
|
3
3
|
import { ApexLogGetOptions, LogRecord, LogResult } from './types';
|
|
4
4
|
type StreamingLogMessage = {
|
|
5
5
|
errorName?: string;
|
|
@@ -74,34 +74,23 @@ class LogService {
|
|
|
74
74
|
}
|
|
75
75
|
// TODO: readableStream cannot be used until updates are made in jsforce and sfdx-core
|
|
76
76
|
async getLogs(options) {
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
const logRecord = await this.toolingRequest(url);
|
|
77
|
+
const logs = (await Promise.all((await this.getLogIds(options)).map(async (id) => ({
|
|
78
|
+
...(await this.getLogById(id)),
|
|
79
|
+
logId: id
|
|
80
|
+
})))).map(({ log, logId }) => {
|
|
82
81
|
if (options.outputDir) {
|
|
83
|
-
const logPath = path.join(options.outputDir, `${
|
|
84
|
-
|
|
85
|
-
|
|
82
|
+
const logPath = path.join(options.outputDir, `${logId}.log`);
|
|
83
|
+
(0, utils_1.createFile)(logPath, log);
|
|
84
|
+
return { log, logPath };
|
|
86
85
|
}
|
|
87
|
-
return String(logRecord);
|
|
88
|
-
});
|
|
89
|
-
const logs = await Promise.all(connectionRequests);
|
|
90
|
-
if (logPaths.length > 0) {
|
|
91
|
-
const logMap = [];
|
|
92
|
-
for (let i = 0; i < logs.length; i++) {
|
|
93
|
-
logMap.push({ log: logs[i], logPath: logPaths[i] });
|
|
94
|
-
}
|
|
95
|
-
return logMap;
|
|
96
|
-
}
|
|
97
|
-
return logs.map((log) => {
|
|
98
86
|
return { log };
|
|
99
87
|
});
|
|
88
|
+
return logs;
|
|
100
89
|
}
|
|
101
90
|
async getLogById(logId) {
|
|
102
91
|
const baseUrl = this.connection.tooling._baseUrl();
|
|
103
92
|
const url = `${baseUrl}/sobjects/ApexLog/${logId}/Body`;
|
|
104
|
-
const response = await this.
|
|
93
|
+
const response = await this.toolingRequest(url);
|
|
105
94
|
return { log: response.toString() || '' };
|
|
106
95
|
}
|
|
107
96
|
async getLogRecords(numberOfLogs) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logService.js","sourceRoot":"","sources":["../../../src/logs/logService.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;GAKG;AACH,2CAM0B;AAC1B,yCAA2C;AAE3C,2CAKqB;AAErB,2CAA6B;AAC7B,kCAA8B;AAC9B,oCAAsC;AACtC,oDAAiD;AACjD,sDAAmD;AAOnD,MAAa,UAAU;IACL,UAAU,CAAa;IAC/B,MAAM,CAAS;IACf,SAAS,CAAyB;IAE1C,YAAY,UAAsB;QAChC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;IAGY,AAAN,KAAK,CAAC,SAAS,CAAC,OAA0B;QAC/C,IACE,C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M,KAAK,CAAC,gBAAgB,CAAC,mBAA2B;QACvD,MAAM,KAAK,GAAG,IAAI,uBAAU,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC9C,MAAM,KAAK,CAAC,gBAAgB,CAAC,mBAAmB,CAAC,CAAC;IACpD,CAAC;IAGY,AAAN,KAAK,CAAC,cAAc,CAAC,GAAW;QACrC,MAAM,GAAG,GAAG,CAAC,MAAM,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAY,CAAC;QACpE,OAAO,GAAG,CAAC;IACb,CAAC;CACF;AAzID,gCAyIC;AA/Hc;IADZ,IAAA,yBAAW,GAAE;2CAgBb;AAIY;IADZ,IAAA,yBAAW,GAAE;yCAmBb;AAGY;IADZ,IAAA,yBAAW,GAAE;4CAMb;AAGY;IADZ,IAAA,yBAAW,GAAE;+CAmBb;AAGY;IADZ,IAAA,yBAAW,GAAE;sCAYb;AAGY;IADZ,IAAA,yBAAW,GAAE;uDAUb;AAGY;IADZ,IAAA,yBAAW,GAAE;6CAQb;AAGO;IADP,IAAA,yBAAW,GAAE;mDAWb;AAQY;IADZ,IAAA,yBAAW,GAAE;gDAIb"}
|
package/lib/src/logs/types.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { isEmpty, isTestResult, isValidTestRunID, isValidApexClassID } from './narrowing';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isValidApexClassID = exports.isValidTestRunID = exports.
|
|
3
|
+
exports.isValidApexClassID = exports.isValidTestRunID = exports.isTestResult = exports.isEmpty = void 0;
|
|
4
4
|
/*
|
|
5
5
|
* Copyright (c) 2021, salesforce.com, inc.
|
|
6
6
|
* All rights reserved.
|
|
@@ -8,20 +8,8 @@ exports.isValidApexClassID = exports.isValidTestRunID = exports.isNotQuotable =
|
|
|
8
8
|
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
9
9
|
*/
|
|
10
10
|
var narrowing_1 = require("./narrowing");
|
|
11
|
-
Object.defineProperty(exports, "isObject", { enumerable: true, get: function () { return narrowing_1.isObject; } });
|
|
12
|
-
Object.defineProperty(exports, "isPrimitive", { enumerable: true, get: function () { return narrowing_1.isPrimitive; } });
|
|
13
|
-
Object.defineProperty(exports, "isArray", { enumerable: true, get: function () { return narrowing_1.isArray; } });
|
|
14
|
-
Object.defineProperty(exports, "isNull", { enumerable: true, get: function () { return narrowing_1.isNull; } });
|
|
15
|
-
Object.defineProperty(exports, "isBoolean", { enumerable: true, get: function () { return narrowing_1.isBoolean; } });
|
|
16
11
|
Object.defineProperty(exports, "isEmpty", { enumerable: true, get: function () { return narrowing_1.isEmpty; } });
|
|
17
|
-
Object.defineProperty(exports, "isRow", { enumerable: true, get: function () { return narrowing_1.isRow; } });
|
|
18
|
-
Object.defineProperty(exports, "isColumn", { enumerable: true, get: function () { return narrowing_1.isColumn; } });
|
|
19
|
-
Object.defineProperty(exports, "isNumber", { enumerable: true, get: function () { return narrowing_1.isNumber; } });
|
|
20
|
-
Object.defineProperty(exports, "isString", { enumerable: true, get: function () { return narrowing_1.isString; } });
|
|
21
|
-
Object.defineProperty(exports, "isTableConfig", { enumerable: true, get: function () { return narrowing_1.isTableConfig; } });
|
|
22
|
-
Object.defineProperty(exports, "isTitle", { enumerable: true, get: function () { return narrowing_1.isTitle; } });
|
|
23
12
|
Object.defineProperty(exports, "isTestResult", { enumerable: true, get: function () { return narrowing_1.isTestResult; } });
|
|
24
|
-
Object.defineProperty(exports, "isNotQuotable", { enumerable: true, get: function () { return narrowing_1.isNotQuotable; } });
|
|
25
13
|
Object.defineProperty(exports, "isValidTestRunID", { enumerable: true, get: function () { return narrowing_1.isValidTestRunID; } });
|
|
26
14
|
Object.defineProperty(exports, "isValidApexClassID", { enumerable: true, get: function () { return narrowing_1.isValidApexClassID; } });
|
|
27
15
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/narrowing/index.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/narrowing/index.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,yCAKqB;AAJnB,oGAAA,OAAO,OAAA;AACP,yGAAA,YAAY,OAAA;AACZ,6GAAA,gBAAgB,OAAA;AAChB,+GAAA,kBAAkB,OAAA"}
|
|
@@ -1,18 +1,5 @@
|
|
|
1
|
-
import { Column, Row, TableConfig, Title } from '../utils';
|
|
2
1
|
import { TestResult, TestRunIdResult } from '../tests';
|
|
3
|
-
import * as tsTypes from '@salesforce/ts-types';
|
|
4
2
|
export declare const isTestResult: (result: TestResult | TestRunIdResult) => result is TestResult;
|
|
5
|
-
export declare const isString: typeof tsTypes.isString, isBoolean: typeof tsTypes.isBoolean;
|
|
6
|
-
export declare const isNumber: (value: unknown) => value is number;
|
|
7
|
-
export declare const isObject: (value: unknown) => value is object;
|
|
8
|
-
export declare const isArray: (value: unknown) => value is unknown[];
|
|
9
|
-
export declare const isNull: (value: unknown) => value is null;
|
|
10
|
-
export declare const isPrimitive: (value: unknown) => boolean;
|
|
11
|
-
export declare const isRow: (obj: unknown) => obj is Row;
|
|
12
|
-
export declare const isColumn: (obj: unknown) => obj is Column;
|
|
13
|
-
export declare const isTitle: (obj: unknown) => obj is Title;
|
|
14
|
-
export declare const isTableConfig: (obj: unknown) => obj is TableConfig;
|
|
15
3
|
export declare const isEmpty: (value: string | number) => boolean;
|
|
16
|
-
export declare const
|
|
17
|
-
export declare
|
|
18
|
-
export declare function isValidApexClassID(apexClassId: string): boolean;
|
|
4
|
+
export declare const isValidTestRunID: (testRunId: string) => boolean;
|
|
5
|
+
export declare const isValidApexClassID: (apexClassId: string) => boolean;
|
|
@@ -1,115 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.
|
|
37
|
-
exports.isValidTestRunID = isValidTestRunID;
|
|
38
|
-
exports.isValidApexClassID = isValidApexClassID;
|
|
3
|
+
exports.isValidApexClassID = exports.isValidTestRunID = exports.isEmpty = exports.isTestResult = void 0;
|
|
39
4
|
const constants_1 = require("../tests/constants");
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
};
|
|
5
|
+
const isTestResult = (result) => 'summary' in result &&
|
|
6
|
+
'tests' in result &&
|
|
7
|
+
result.summary !== undefined &&
|
|
8
|
+
result.tests !== undefined;
|
|
45
9
|
exports.isTestResult = isTestResult;
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
};
|
|
50
|
-
exports.isNumber = isNumber;
|
|
51
|
-
const isObject = (value) => {
|
|
52
|
-
return value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
53
|
-
};
|
|
54
|
-
exports.isObject = isObject;
|
|
55
|
-
const isArray = (value) => {
|
|
56
|
-
return Array.isArray(value);
|
|
57
|
-
};
|
|
58
|
-
exports.isArray = isArray;
|
|
59
|
-
const isNull = (value) => {
|
|
60
|
-
return value === null;
|
|
61
|
-
};
|
|
62
|
-
exports.isNull = isNull;
|
|
63
|
-
const isPrimitive = (value) => {
|
|
64
|
-
return ((0, exports.isString)(value) || (0, exports.isNumber)(value) || (0, exports.isBoolean)(value) || (0, exports.isNull)(value));
|
|
65
|
-
};
|
|
66
|
-
exports.isPrimitive = isPrimitive;
|
|
67
|
-
const isRow = (obj) => {
|
|
68
|
-
if (typeof obj !== 'object' || obj === null) {
|
|
69
|
-
return false;
|
|
70
|
-
}
|
|
71
|
-
for (const key in obj) {
|
|
72
|
-
if (typeof key !== 'string' || typeof Reflect.get(obj, key) === 'string') {
|
|
73
|
-
return false;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
return true;
|
|
77
|
-
};
|
|
78
|
-
exports.isRow = isRow;
|
|
79
|
-
const isColumn = (obj) => {
|
|
80
|
-
return (typeof obj === 'object' &&
|
|
81
|
-
obj !== null &&
|
|
82
|
-
typeof Reflect.get(obj, 'key') === 'string' &&
|
|
83
|
-
typeof Reflect.get(obj, 'label') === 'string');
|
|
84
|
-
};
|
|
85
|
-
exports.isColumn = isColumn;
|
|
86
|
-
const isTitle = (obj) => {
|
|
87
|
-
return (typeof obj === 'object' &&
|
|
88
|
-
obj !== null &&
|
|
89
|
-
typeof Reflect.get(obj, 'title') === 'string');
|
|
90
|
-
};
|
|
91
|
-
exports.isTitle = isTitle;
|
|
92
|
-
const isTableConfig = (obj) => {
|
|
93
|
-
return ((0, exports.isObject)(obj) &&
|
|
94
|
-
Reflect.has(obj, 'title') &&
|
|
95
|
-
(0, exports.isArray)(Reflect.get(obj, 'columns')) &&
|
|
96
|
-
Reflect.get(obj, 'columns').length > 0);
|
|
97
|
-
};
|
|
98
|
-
exports.isTableConfig = isTableConfig;
|
|
99
|
-
const isEmpty = (value) => {
|
|
100
|
-
return (value === null ||
|
|
101
|
-
value === undefined ||
|
|
102
|
-
(typeof value === 'string' && value.length === 0));
|
|
103
|
-
};
|
|
10
|
+
const isEmpty = (value) => value === null ||
|
|
11
|
+
value === undefined ||
|
|
12
|
+
(typeof value === 'string' && value.length === 0);
|
|
104
13
|
exports.isEmpty = isEmpty;
|
|
105
|
-
const
|
|
106
|
-
exports.
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
}
|
|
111
|
-
function isValidApexClassID(apexClassId) {
|
|
112
|
-
return ((apexClassId.length === 15 || apexClassId.length === 18) &&
|
|
113
|
-
apexClassId.startsWith(constants_1.CLASS_ID_PREFIX));
|
|
114
|
-
}
|
|
14
|
+
const isValidTestRunID = (testRunId) => isValidSalesforceId && testRunId.startsWith(constants_1.TEST_RUN_ID_PREFIX);
|
|
15
|
+
exports.isValidTestRunID = isValidTestRunID;
|
|
16
|
+
const isValidApexClassID = (apexClassId) => isValidSalesforceId(apexClassId) && apexClassId.startsWith(constants_1.CLASS_ID_PREFIX);
|
|
17
|
+
exports.isValidApexClassID = isValidApexClassID;
|
|
18
|
+
const isValidSalesforceId = (id) => id.length === 15 || id.length === 18;
|
|
115
19
|
//# sourceMappingURL=narrowing.js.map
|