airbyte-faros-destination 0.9.77 → 0.9.78
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/lib/converters/xray/common.d.ts +11 -0
- package/lib/converters/xray/common.js +18 -0
- package/lib/converters/xray/common.js.map +1 -0
- package/lib/converters/xray/test_executions.d.ts +7 -0
- package/lib/converters/xray/test_executions.js +32 -0
- package/lib/converters/xray/test_executions.js.map +1 -0
- package/lib/converters/xray/test_plan_tests.d.ts +7 -0
- package/lib/converters/xray/test_plan_tests.js +26 -0
- package/lib/converters/xray/test_plan_tests.js.map +1 -0
- package/lib/converters/xray/test_plans.d.ts +7 -0
- package/lib/converters/xray/test_plans.js +31 -0
- package/lib/converters/xray/test_plans.js.map +1 -0
- package/lib/converters/xray/test_runs.d.ts +9 -0
- package/lib/converters/xray/test_runs.js +66 -0
- package/lib/converters/xray/test_runs.js.map +1 -0
- package/lib/converters/xray/tests.d.ts +8 -0
- package/lib/converters/xray/tests.js +59 -0
- package/lib/converters/xray/tests.js.map +1 -0
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/resources/source-specific-configs/spec.json +3 -0
- package/resources/source-specific-configs/xray.json +17 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AirbyteRecord } from 'faros-airbyte-cdk';
|
|
2
|
+
import { Converter } from '../converter';
|
|
3
|
+
export interface ModelEnumType {
|
|
4
|
+
category: string;
|
|
5
|
+
detail: string;
|
|
6
|
+
}
|
|
7
|
+
export declare abstract class XrayConverter extends Converter {
|
|
8
|
+
source: string;
|
|
9
|
+
taskSource: string;
|
|
10
|
+
id(record: AirbyteRecord): any;
|
|
11
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.XrayConverter = void 0;
|
|
4
|
+
const converter_1 = require("../converter");
|
|
5
|
+
class XrayConverter extends converter_1.Converter {
|
|
6
|
+
constructor() {
|
|
7
|
+
super(...arguments);
|
|
8
|
+
this.source = 'Xray';
|
|
9
|
+
this.taskSource = 'Jira';
|
|
10
|
+
}
|
|
11
|
+
// Most Xray records have a key field that can be used as the record ID.
|
|
12
|
+
id(record) {
|
|
13
|
+
var _a, _b;
|
|
14
|
+
return (_b = (_a = record === null || record === void 0 ? void 0 : record.record) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.key;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.XrayConverter = XrayConverter;
|
|
18
|
+
//# sourceMappingURL=common.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../src/converters/xray/common.ts"],"names":[],"mappings":";;;AAEA,4CAAuC;AAOvC,MAAsB,aAAc,SAAQ,qBAAS;IAArD;;QACE,WAAM,GAAG,MAAM,CAAC;QAChB,eAAU,GAAG,MAAM,CAAC;IAMtB,CAAC;IAJC,wEAAwE;IACxE,EAAE,CAAC,MAAqB;;QACtB,OAAO,MAAA,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,0CAAE,IAAI,0CAAE,GAAG,CAAC;IACnC,CAAC;CACF;AARD,sCAQC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AirbyteRecord } from 'faros-airbyte-cdk';
|
|
2
|
+
import { DestinationModel, DestinationRecord } from '../converter';
|
|
3
|
+
import { XrayConverter } from './common';
|
|
4
|
+
export declare class TestExecutions extends XrayConverter {
|
|
5
|
+
readonly destinationModels: ReadonlyArray<DestinationModel>;
|
|
6
|
+
convert(record: AirbyteRecord): Promise<ReadonlyArray<DestinationRecord>>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TestExecutions = void 0;
|
|
4
|
+
const faros_js_client_1 = require("faros-js-client");
|
|
5
|
+
const common_1 = require("./common");
|
|
6
|
+
class TestExecutions extends common_1.XrayConverter {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
this.destinationModels = [
|
|
10
|
+
'qa_TestExecution',
|
|
11
|
+
];
|
|
12
|
+
}
|
|
13
|
+
async convert(record) {
|
|
14
|
+
const execution = record.record.data;
|
|
15
|
+
return [
|
|
16
|
+
{
|
|
17
|
+
model: 'qa_TestExecution',
|
|
18
|
+
record: {
|
|
19
|
+
uid: execution.key,
|
|
20
|
+
source: this.source,
|
|
21
|
+
name: execution.summary,
|
|
22
|
+
description: faros_js_client_1.Utils.cleanAndTruncate(execution.description),
|
|
23
|
+
tags: execution.labels,
|
|
24
|
+
environments: execution.testEnvironments,
|
|
25
|
+
task: { uid: execution.key, source: this.taskSource },
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
];
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.TestExecutions = TestExecutions;
|
|
32
|
+
//# sourceMappingURL=test_executions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test_executions.js","sourceRoot":"","sources":["../../../src/converters/xray/test_executions.ts"],"names":[],"mappings":";;;AAEA,qDAAsC;AAGtC,qCAAuC;AAEvC,MAAa,cAAe,SAAQ,sBAAa;IAAjD;;QACW,sBAAiB,GAAoC;YAC5D,kBAAkB;SACnB,CAAC;IAqBJ,CAAC;IAnBC,KAAK,CAAC,OAAO,CACX,MAAqB;QAErB,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,IAAqB,CAAC;QACtD,OAAO;YACL;gBACE,KAAK,EAAE,kBAAkB;gBACzB,MAAM,EAAE;oBACN,GAAG,EAAE,SAAS,CAAC,GAAG;oBAClB,MAAM,EAAE,IAAI,CAAC,MAAM;oBACnB,IAAI,EAAE,SAAS,CAAC,OAAO;oBACvB,WAAW,EAAE,uBAAK,CAAC,gBAAgB,CAAC,SAAS,CAAC,WAAW,CAAC;oBAC1D,IAAI,EAAE,SAAS,CAAC,MAAM;oBACtB,YAAY,EAAE,SAAS,CAAC,gBAAgB;oBACxC,IAAI,EAAE,EAAC,GAAG,EAAE,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,UAAU,EAAC;iBACpD;aACF;SACF,CAAC;IACJ,CAAC;CACF;AAxBD,wCAwBC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AirbyteRecord } from 'faros-airbyte-cdk';
|
|
2
|
+
import { DestinationModel, DestinationRecord } from '../converter';
|
|
3
|
+
import { XrayConverter } from './common';
|
|
4
|
+
export declare class TestPlanTests extends XrayConverter {
|
|
5
|
+
readonly destinationModels: ReadonlyArray<DestinationModel>;
|
|
6
|
+
convert(record: AirbyteRecord): Promise<ReadonlyArray<DestinationRecord>>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TestPlanTests = void 0;
|
|
4
|
+
const common_1 = require("./common");
|
|
5
|
+
class TestPlanTests extends common_1.XrayConverter {
|
|
6
|
+
constructor() {
|
|
7
|
+
super(...arguments);
|
|
8
|
+
this.destinationModels = [
|
|
9
|
+
'qa_TestSuiteTestCaseAssociation',
|
|
10
|
+
];
|
|
11
|
+
}
|
|
12
|
+
async convert(record) {
|
|
13
|
+
const test = record.record.data;
|
|
14
|
+
return [
|
|
15
|
+
{
|
|
16
|
+
model: 'qa_TestSuiteTestCaseAssociation',
|
|
17
|
+
record: {
|
|
18
|
+
testSuite: { uid: test.planKey, source: this.source },
|
|
19
|
+
testCase: { uid: test.testKey, source: this.source },
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
];
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.TestPlanTests = TestPlanTests;
|
|
26
|
+
//# sourceMappingURL=test_plan_tests.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test_plan_tests.js","sourceRoot":"","sources":["../../../src/converters/xray/test_plan_tests.ts"],"names":[],"mappings":";;;AAIA,qCAAuC;AAEvC,MAAa,aAAc,SAAQ,sBAAa;IAAhD;;QACW,sBAAiB,GAAoC;YAC5D,iCAAiC;SAClC,CAAC;IAgBJ,CAAC;IAdC,KAAK,CAAC,OAAO,CACX,MAAqB;QAErB,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,IAAoB,CAAC;QAChD,OAAO;YACL;gBACE,KAAK,EAAE,iCAAiC;gBACxC,MAAM,EAAE;oBACN,SAAS,EAAE,EAAC,GAAG,EAAE,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAC;oBACnD,QAAQ,EAAE,EAAC,GAAG,EAAE,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAC;iBACnD;aACF;SACF,CAAC;IACJ,CAAC;CACF;AAnBD,sCAmBC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AirbyteRecord } from 'faros-airbyte-cdk';
|
|
2
|
+
import { DestinationModel, DestinationRecord } from '../converter';
|
|
3
|
+
import { XrayConverter } from './common';
|
|
4
|
+
export declare class TestPlans extends XrayConverter {
|
|
5
|
+
readonly destinationModels: ReadonlyArray<DestinationModel>;
|
|
6
|
+
convert(record: AirbyteRecord): Promise<ReadonlyArray<DestinationRecord>>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TestPlans = void 0;
|
|
4
|
+
const faros_js_client_1 = require("faros-js-client");
|
|
5
|
+
const common_1 = require("./common");
|
|
6
|
+
class TestPlans extends common_1.XrayConverter {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
this.destinationModels = [
|
|
10
|
+
'qa_TestSuite',
|
|
11
|
+
];
|
|
12
|
+
}
|
|
13
|
+
async convert(record) {
|
|
14
|
+
const plan = record.record.data;
|
|
15
|
+
return [
|
|
16
|
+
{
|
|
17
|
+
model: 'qa_TestSuite',
|
|
18
|
+
record: {
|
|
19
|
+
uid: plan.key,
|
|
20
|
+
source: this.source,
|
|
21
|
+
name: plan.summary,
|
|
22
|
+
description: faros_js_client_1.Utils.cleanAndTruncate(plan.description),
|
|
23
|
+
tags: plan.labels,
|
|
24
|
+
task: { uid: plan.key, source: this.taskSource },
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
];
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.TestPlans = TestPlans;
|
|
31
|
+
//# sourceMappingURL=test_plans.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test_plans.js","sourceRoot":"","sources":["../../../src/converters/xray/test_plans.ts"],"names":[],"mappings":";;;AAEA,qDAAsC;AAGtC,qCAAuC;AAEvC,MAAa,SAAU,SAAQ,sBAAa;IAA5C;;QACW,sBAAiB,GAAoC;YAC5D,cAAc;SACf,CAAC;IAoBJ,CAAC;IAlBC,KAAK,CAAC,OAAO,CACX,MAAqB;QAErB,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,IAAgB,CAAC;QAC5C,OAAO;YACL;gBACE,KAAK,EAAE,cAAc;gBACrB,MAAM,EAAE;oBACN,GAAG,EAAE,IAAI,CAAC,GAAG;oBACb,MAAM,EAAE,IAAI,CAAC,MAAM;oBACnB,IAAI,EAAE,IAAI,CAAC,OAAO;oBAClB,WAAW,EAAE,uBAAK,CAAC,gBAAgB,CAAC,IAAI,CAAC,WAAW,CAAC;oBACrD,IAAI,EAAE,IAAI,CAAC,MAAM;oBACjB,IAAI,EAAE,EAAC,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,UAAU,EAAC;iBAC/C;aACF;SACF,CAAC;IACJ,CAAC;CACF;AAvBD,8BAuBC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AirbyteRecord } from 'faros-airbyte-cdk';
|
|
2
|
+
import { DestinationModel, DestinationRecord } from '../converter';
|
|
3
|
+
import { XrayConverter } from './common';
|
|
4
|
+
export declare class TestRuns extends XrayConverter {
|
|
5
|
+
id(record: AirbyteRecord): string;
|
|
6
|
+
readonly destinationModels: ReadonlyArray<DestinationModel>;
|
|
7
|
+
convert(record: AirbyteRecord): Promise<ReadonlyArray<DestinationRecord>>;
|
|
8
|
+
private static getStatus;
|
|
9
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TestRuns = void 0;
|
|
4
|
+
const common_1 = require("./common");
|
|
5
|
+
class TestRuns extends common_1.XrayConverter {
|
|
6
|
+
constructor() {
|
|
7
|
+
super(...arguments);
|
|
8
|
+
this.destinationModels = [
|
|
9
|
+
'qa_TestCaseResult',
|
|
10
|
+
'tms_TaskTestCaseResultAssociation',
|
|
11
|
+
];
|
|
12
|
+
}
|
|
13
|
+
id(record) {
|
|
14
|
+
var _a, _b;
|
|
15
|
+
return (_b = (_a = record.record) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.id;
|
|
16
|
+
}
|
|
17
|
+
async convert(record) {
|
|
18
|
+
const run = record.record.data;
|
|
19
|
+
const testCase = { uid: run.test.key, source: this.source };
|
|
20
|
+
const testCaseResult = { uid: run.id, testCase };
|
|
21
|
+
const results = [];
|
|
22
|
+
results.push({
|
|
23
|
+
model: 'qa_TestCaseResult',
|
|
24
|
+
record: {
|
|
25
|
+
...testCaseResult,
|
|
26
|
+
startedAt: run.startedOn,
|
|
27
|
+
endedAt: run.finishedOn,
|
|
28
|
+
status: TestRuns.getStatus(run.status.name),
|
|
29
|
+
testExecution: { uid: run.testExecution.key, source: this.source },
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
for (const defect of run.defects) {
|
|
33
|
+
results.push({
|
|
34
|
+
model: 'tms_TaskTestCaseResultAssociation',
|
|
35
|
+
record: { testCaseResult, defect: { uid: defect, source: this.source } },
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
for (const step of run.steps) {
|
|
39
|
+
results.push({
|
|
40
|
+
model: 'qa_TestCaseStepResult',
|
|
41
|
+
record: {
|
|
42
|
+
uid: step.id,
|
|
43
|
+
status: TestRuns.getStatus(step.status.name),
|
|
44
|
+
testStep: { uid: step.id, testCase },
|
|
45
|
+
testResult: testCaseResult,
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
return results;
|
|
50
|
+
}
|
|
51
|
+
static getStatus(status) {
|
|
52
|
+
const detail = status.toUpperCase();
|
|
53
|
+
switch (detail) {
|
|
54
|
+
case 'PASSED':
|
|
55
|
+
return { category: 'Success', detail };
|
|
56
|
+
case 'FAILED':
|
|
57
|
+
return { category: 'Failure', detail };
|
|
58
|
+
case 'TODO':
|
|
59
|
+
return { category: 'Pending', detail };
|
|
60
|
+
default:
|
|
61
|
+
return { category: 'Custom', detail };
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
exports.TestRuns = TestRuns;
|
|
66
|
+
//# sourceMappingURL=test_runs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test_runs.js","sourceRoot":"","sources":["../../../src/converters/xray/test_runs.ts"],"names":[],"mappings":";;;AAIA,qCAAsD;AAEtD,MAAa,QAAS,SAAQ,sBAAa;IAA3C;;QAKW,sBAAiB,GAAoC;YAC5D,mBAAmB;YACnB,mCAAmC;SACpC,CAAC;IAwDJ,CAAC;IA/DC,EAAE,CAAC,MAAqB;;QACtB,OAAO,MAAA,MAAA,MAAM,CAAC,MAAM,0CAAE,IAAI,0CAAE,EAAE,CAAC;IACjC,CAAC;IAOD,KAAK,CAAC,OAAO,CACX,MAAqB;Q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AAC,GAAG,EAAE,IAAI,CAAC,EAAE,EAAE,QAAQ,EAAC;oBAClC,UAAU,EAAE,cAAc;iBAC3B;aACF,CAAC,CAAC;QACL,CAAC;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;IAEO,MAAM,CAAC,SAAS,CAAC,MAAc;QACrC,MAAM,MAAM,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC;QACpC,QAAQ,MAAM,EAAE,CAAC;YACf,KAAK,QAAQ;gBACX,OAAO,EAAC,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAC,CAAC;YACvC,KAAK,QAAQ;gBACX,OAAO,EAAC,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAC,CAAC;YACvC,KAAK,MAAM;gBACT,OAAO,EAAC,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAC,CAAC;YACvC;gBACE,OAAO,EAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAC,CAAC;QACxC,CAAC;IACH,CAAC;CACF;AAhED,4BAgEC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AirbyteRecord } from 'faros-airbyte-cdk';
|
|
2
|
+
import { DestinationModel, DestinationRecord } from '../converter';
|
|
3
|
+
import { XrayConverter } from './common';
|
|
4
|
+
export declare class Tests extends XrayConverter {
|
|
5
|
+
readonly destinationModels: ReadonlyArray<DestinationModel>;
|
|
6
|
+
convert(record: AirbyteRecord): Promise<ReadonlyArray<DestinationRecord>>;
|
|
7
|
+
private static getType;
|
|
8
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Tests = void 0;
|
|
4
|
+
const faros_js_client_1 = require("faros-js-client");
|
|
5
|
+
const common_1 = require("./common");
|
|
6
|
+
class Tests extends common_1.XrayConverter {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
this.destinationModels = [
|
|
10
|
+
'qa_TestCase',
|
|
11
|
+
'qa_TestCaseStep',
|
|
12
|
+
];
|
|
13
|
+
}
|
|
14
|
+
async convert(record) {
|
|
15
|
+
var _a;
|
|
16
|
+
const test = record.record.data;
|
|
17
|
+
const preconditions = test.preconditions.map((p) => {
|
|
18
|
+
return {
|
|
19
|
+
condition: p.definition,
|
|
20
|
+
description: p.key,
|
|
21
|
+
};
|
|
22
|
+
});
|
|
23
|
+
const results = [];
|
|
24
|
+
results.push({
|
|
25
|
+
model: 'qa_TestCase',
|
|
26
|
+
record: {
|
|
27
|
+
uid: test.key,
|
|
28
|
+
name: test.summary,
|
|
29
|
+
description: faros_js_client_1.Utils.cleanAndTruncate(test.description),
|
|
30
|
+
before: preconditions,
|
|
31
|
+
type: Tests.getType(test.testType),
|
|
32
|
+
tags: test.labels,
|
|
33
|
+
task: { uid: test.key, source: this.taskSource },
|
|
34
|
+
source: this.source,
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
for (const step of (_a = test.steps) !== null && _a !== void 0 ? _a : []) {
|
|
38
|
+
results.push({
|
|
39
|
+
model: 'qa_TestCaseStep',
|
|
40
|
+
record: {
|
|
41
|
+
uid: step.id,
|
|
42
|
+
name: step.action,
|
|
43
|
+
data: step.data,
|
|
44
|
+
result: step.result,
|
|
45
|
+
testCase: { uid: test.key, source: this.source },
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
return results;
|
|
50
|
+
}
|
|
51
|
+
static getType(type) {
|
|
52
|
+
if (type.name.toLowerCase() === 'manual') {
|
|
53
|
+
return { category: 'Manual', detail: type.kind };
|
|
54
|
+
}
|
|
55
|
+
return { category: 'Custom', detail: type.name };
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
exports.Tests = Tests;
|
|
59
|
+
//# sourceMappingURL=tests.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tests.js","sourceRoot":"","sources":["../../../src/converters/xray/tests.ts"],"names":[],"mappings":";;;AA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