@sectester/repeater 0.27.0 → 0.28.0

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 (79) hide show
  1. package/README.md +3 -3
  2. package/package.json +7 -4
  3. package/src/api/DefaultRepeatersManager.js.map +1 -1
  4. package/src/api/ExecuteRequestEventHandler.js +1 -1
  5. package/src/api/ExecuteRequestEventHandler.js.map +1 -1
  6. package/src/api/commands/index.d.ts +0 -1
  7. package/src/api/commands/index.js +1 -4
  8. package/src/api/commands/index.js.map +1 -1
  9. package/src/api/index.d.ts +0 -3
  10. package/src/api/index.js +0 -7
  11. package/src/api/index.js.map +1 -1
  12. package/src/index.d.ts +1 -1
  13. package/src/index.js +1 -2
  14. package/src/index.js.map +1 -1
  15. package/src/lib/DefaultRepeaterCommands.d.ts +7 -0
  16. package/src/lib/DefaultRepeaterCommands.js +26 -0
  17. package/src/lib/DefaultRepeaterCommands.js.map +1 -0
  18. package/src/lib/DefaultRepeaterServer.d.ts +57 -0
  19. package/src/lib/DefaultRepeaterServer.js +218 -0
  20. package/src/lib/DefaultRepeaterServer.js.map +1 -0
  21. package/src/lib/Repeater.d.ts +18 -15
  22. package/src/lib/Repeater.js +90 -62
  23. package/src/lib/Repeater.js.map +1 -1
  24. package/src/lib/RepeaterCommands.d.ts +5 -0
  25. package/src/lib/RepeaterCommands.js +5 -0
  26. package/src/lib/RepeaterCommands.js.map +1 -0
  27. package/src/lib/RepeaterFactory.d.ts +3 -4
  28. package/src/lib/RepeaterFactory.js +18 -35
  29. package/src/lib/RepeaterFactory.js.map +1 -1
  30. package/src/lib/RepeaterServer.d.ts +92 -0
  31. package/src/lib/RepeaterServer.js +15 -0
  32. package/src/lib/RepeaterServer.js.map +1 -0
  33. package/src/lib/index.d.ts +8 -5
  34. package/src/lib/index.js +9 -7
  35. package/src/lib/index.js.map +1 -1
  36. package/src/models/Protocol.d.ts +1 -2
  37. package/src/models/Protocol.js +0 -1
  38. package/src/models/Protocol.js.map +1 -1
  39. package/src/register.js +18 -4
  40. package/src/register.js.map +1 -1
  41. package/src/request-runner/Request.d.ts +13 -9
  42. package/src/request-runner/Request.js +9 -19
  43. package/src/request-runner/Request.js.map +1 -1
  44. package/src/request-runner/Response.d.ts +5 -3
  45. package/src/request-runner/Response.js +2 -1
  46. package/src/request-runner/Response.js.map +1 -1
  47. package/src/request-runner/protocols/HttpRequestRunner.d.ts +9 -7
  48. package/src/request-runner/protocols/HttpRequestRunner.js +100 -88
  49. package/src/request-runner/protocols/HttpRequestRunner.js.map +1 -1
  50. package/src/request-runner/protocols/index.d.ts +0 -1
  51. package/src/request-runner/protocols/index.js +0 -1
  52. package/src/request-runner/protocols/index.js.map +1 -1
  53. package/src/utils/DefaultProxyFactory.d.ts +20 -0
  54. package/src/utils/DefaultProxyFactory.js +66 -0
  55. package/src/utils/DefaultProxyFactory.js.map +1 -0
  56. package/src/utils/NormalizeZlibDeflateTransformStream.d.ts +8 -0
  57. package/src/utils/NormalizeZlibDeflateTransformStream.js +25 -0
  58. package/src/utils/NormalizeZlibDeflateTransformStream.js.map +1 -0
  59. package/src/utils/PatchedHttpsProxyAgent.d.ts +14 -0
  60. package/src/utils/PatchedHttpsProxyAgent.js +17 -0
  61. package/src/utils/PatchedHttpsProxyAgent.js.map +1 -0
  62. package/src/utils/ProxyFactory.d.ts +19 -0
  63. package/src/utils/ProxyFactory.js +5 -0
  64. package/src/utils/ProxyFactory.js.map +1 -0
  65. package/src/utils/index.d.ts +3 -0
  66. package/src/utils/index.js +7 -0
  67. package/src/utils/index.js.map +1 -0
  68. package/src/api/commands/RegisterRepeaterCommand.d.ts +0 -22
  69. package/src/api/commands/RegisterRepeaterCommand.js +0 -18
  70. package/src/api/commands/RegisterRepeaterCommand.js.map +0 -1
  71. package/src/api/events/RepeaterStatusEvent.d.ts +0 -10
  72. package/src/api/events/RepeaterStatusEvent.js +0 -11
  73. package/src/api/events/RepeaterStatusEvent.js.map +0 -1
  74. package/src/api/events/index.d.ts +0 -1
  75. package/src/api/events/index.js +0 -5
  76. package/src/api/events/index.js.map +0 -1
  77. package/src/request-runner/protocols/WsRequestRunner.d.ts +0 -24
  78. package/src/request-runner/protocols/WsRequestRunner.js +0 -149
  79. package/src/request-runner/protocols/WsRequestRunner.js.map +0 -1
@@ -0,0 +1,14 @@
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
3
+ /// <reference types="node" />
4
+ import { HttpsProxyAgent, type HttpsProxyAgentOptions } from 'https-proxy-agent';
5
+ import { type URL } from 'node:url';
6
+ import type http from 'node:http';
7
+ import type net from 'node:net';
8
+ declare const kTlsUpgradeOptions: unique symbol;
9
+ export declare class PatchedHttpsProxyAgent<T extends string> extends HttpsProxyAgent<T> {
10
+ private readonly [kTlsUpgradeOptions]?;
11
+ constructor(proxy: T | URL, opts?: HttpsProxyAgentOptions<T>);
12
+ connect(req: http.ClientRequest, opts: Parameters<HttpsProxyAgent<T>['connect']>[1]): Promise<net.Socket>;
13
+ }
14
+ export {};
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PatchedHttpsProxyAgent = void 0;
4
+ const https_proxy_agent_1 = require("https-proxy-agent");
5
+ const kTlsUpgradeOptions = Symbol('tlsUpgradeOptions');
6
+ // ADHOC: This is a workaround for this issue: https://github.com/TooTallNate/node-https-proxy-agent/issues/89
7
+ class PatchedHttpsProxyAgent extends https_proxy_agent_1.HttpsProxyAgent {
8
+ constructor(proxy, opts) {
9
+ super(proxy, opts);
10
+ this[kTlsUpgradeOptions] = opts;
11
+ }
12
+ connect(req, opts) {
13
+ return super.connect(req, { ...this[kTlsUpgradeOptions], ...opts });
14
+ }
15
+ }
16
+ exports.PatchedHttpsProxyAgent = PatchedHttpsProxyAgent;
17
+ //# sourceMappingURL=PatchedHttpsProxyAgent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PatchedHttpsProxyAgent.js","sourceRoot":"","sources":["../../../../../packages/repeater/src/utils/PatchedHttpsProxyAgent.ts"],"names":[],"mappings":";;;AAAA,yDAG2B;AAK3B,MAAM,kBAAkB,GAAG,MAAM,CAAC,mBAAmB,CAAC,CAAC;AAEvD,8GAA8G;AAC9G,MAAa,sBAEX,SAAQ,mCAAkB;IAG1B,YAAY,KAAc,EAAE,IAAgC;QAC1D,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QACnB,IAAI,CAAC,kBAAkB,CAAC,GAAG,IAAI,CAAC;IAClC,CAAC;IAEe,OAAO,CACrB,GAAuB,EACvB,IAAkD;QAElD,OAAO,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,GAAG,IAAI,CAAC,kBAAkB,CAAC,EAAE,GAAG,IAAI,EAAE,CAAC,CAAC;IACtE,CAAC;CACF;AAhBD,wDAgBC"}
@@ -0,0 +1,19 @@
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
3
+ import https from 'node:https';
4
+ import http from 'node:http';
5
+ export interface ProxyOptions {
6
+ proxyUrl: string;
7
+ rejectUnauthorized?: boolean;
8
+ }
9
+ export interface TargetProxyOptions extends ProxyOptions {
10
+ targetUrl: string;
11
+ }
12
+ export interface ProxyFactory {
13
+ createProxy(options: ProxyOptions): {
14
+ httpsAgent: https.Agent;
15
+ httpAgent: http.Agent;
16
+ };
17
+ createProxyForClient(options: TargetProxyOptions): https.Agent | http.Agent;
18
+ }
19
+ export declare const ProxyFactory: unique symbol;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ProxyFactory = void 0;
4
+ exports.ProxyFactory = Symbol('ProxyFactory');
5
+ //# sourceMappingURL=ProxyFactory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProxyFactory.js","sourceRoot":"","sources":["../../../../../packages/repeater/src/utils/ProxyFactory.ts"],"names":[],"mappings":";;;AAqBa,QAAA,YAAY,GAAkB,MAAM,CAAC,cAAc,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './ProxyFactory';
2
+ export * from './NormalizeZlibDeflateTransformStream';
3
+ export * from './DefaultProxyFactory';
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./ProxyFactory"), exports);
5
+ tslib_1.__exportStar(require("./NormalizeZlibDeflateTransformStream"), exports);
6
+ tslib_1.__exportStar(require("./DefaultProxyFactory"), exports);
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/repeater/src/utils/index.ts"],"names":[],"mappings":";;;AAAA,yDAA+B;AAC/B,gFAAsD;AACtD,gEAAsC"}
@@ -1,22 +0,0 @@
1
- import { Command } from '@sectester/core';
2
- export interface RegisterRepeaterCommandPayload {
3
- version: string;
4
- repeaterId: string;
5
- }
6
- export declare type RegisterRepeaterResult = {
7
- version: string;
8
- script: string | Record<string, string>;
9
- } | {
10
- error: RepeaterRegisteringError;
11
- };
12
- export declare enum RepeaterRegisteringError {
13
- NOT_ACTIVE = "not_active",
14
- BUSY = "busy",
15
- REQUIRES_TO_BE_UPDATED = "requires_to_be_updated",
16
- NOT_FOUND = "not_found"
17
- }
18
- export declare class RegisterRepeaterCommand extends Command<RegisterRepeaterCommandPayload, {
19
- payload: RegisterRepeaterResult;
20
- }> {
21
- constructor(payload: RegisterRepeaterCommandPayload);
22
- }
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RegisterRepeaterCommand = exports.RepeaterRegisteringError = void 0;
4
- const core_1 = require("@sectester/core");
5
- var RepeaterRegisteringError;
6
- (function (RepeaterRegisteringError) {
7
- RepeaterRegisteringError["NOT_ACTIVE"] = "not_active";
8
- RepeaterRegisteringError["BUSY"] = "busy";
9
- RepeaterRegisteringError["REQUIRES_TO_BE_UPDATED"] = "requires_to_be_updated";
10
- RepeaterRegisteringError["NOT_FOUND"] = "not_found";
11
- })(RepeaterRegisteringError = exports.RepeaterRegisteringError || (exports.RepeaterRegisteringError = {}));
12
- class RegisterRepeaterCommand extends core_1.Command {
13
- constructor(payload) {
14
- super(payload, { type: 'RepeaterRegistering' });
15
- }
16
- }
17
- exports.RegisterRepeaterCommand = RegisterRepeaterCommand;
18
- //# sourceMappingURL=RegisterRepeaterCommand.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RegisterRepeaterCommand.js","sourceRoot":"","sources":["../../../../../../packages/repeater/src/api/commands/RegisterRepeaterCommand.ts"],"names":[],"mappings":";;;AAAA,0CAA0C;AAc1C,IAAY,wBAKX;AALD,WAAY,wBAAwB;IAClC,qDAAyB,CAAA;IACzB,yCAAa,CAAA;IACb,6EAAiD,CAAA;IACjD,mDAAuB,CAAA;AACzB,CAAC,EALW,wBAAwB,GAAxB,gCAAwB,KAAxB,gCAAwB,QAKnC;AAED,MAAa,uBAAwB,SAAQ,cAG5C;IACC,YAAY,OAAuC;QACjD,KAAK,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE,qBAAqB,EAAE,CAAC,CAAC;IAClD,CAAC;CACF;AAPD,0DAOC"}
@@ -1,10 +0,0 @@
1
- import { RepeaterStatus } from '../../lib';
2
- import { Event } from '@sectester/core';
3
- interface RepeaterStatusEventPayload {
4
- repeaterId: string;
5
- status: RepeaterStatus;
6
- }
7
- export declare class RepeaterStatusEvent extends Event<RepeaterStatusEventPayload> {
8
- constructor(payload: RepeaterStatusEventPayload);
9
- }
10
- export {};
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RepeaterStatusEvent = void 0;
4
- const core_1 = require("@sectester/core");
5
- class RepeaterStatusEvent extends core_1.Event {
6
- constructor(payload) {
7
- super(payload, 'RepeaterStatusUpdated');
8
- }
9
- }
10
- exports.RepeaterStatusEvent = RepeaterStatusEvent;
11
- //# sourceMappingURL=RepeaterStatusEvent.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RepeaterStatusEvent.js","sourceRoot":"","sources":["../../../../../../packages/repeater/src/api/events/RepeaterStatusEvent.ts"],"names":[],"mappings":";;;AACA,0CAAwC;AAOxC,MAAa,mBAAoB,SAAQ,YAAiC;IACxE,YAAY,OAAmC;QAC7C,KAAK,CAAC,OAAO,EAAE,uBAAuB,CAAC,CAAC;IAC1C,CAAC;CACF;AAJD,kDAIC"}
@@ -1 +0,0 @@
1
- export * from './RepeaterStatusEvent';
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./RepeaterStatusEvent"), exports);
5
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/repeater/src/api/events/index.ts"],"names":[],"mappings":";;;AAAA,gEAAsC"}
@@ -1,24 +0,0 @@
1
- import { Request } from '../Request';
2
- import { RequestRunner } from '../RequestRunner';
3
- import { RequestRunnerOptions } from '../RequestRunnerOptions';
4
- import { Response } from '../Response';
5
- import { Protocol } from '../../models';
6
- import { Logger } from '@sectester/core';
7
- export declare class WsRequestRunner implements RequestRunner {
8
- private readonly options;
9
- private readonly logger;
10
- static readonly FORBIDDEN_HEADERS: ReadonlySet<string>;
11
- private readonly agent?;
12
- constructor(options: RequestRunnerOptions, logger: Logger);
13
- get protocol(): Protocol;
14
- run(options: Request): Promise<Response>;
15
- private createWebSocketClient;
16
- private sendMessage;
17
- private createWsResponse;
18
- private handleRequestError;
19
- private setTimeout;
20
- private consume;
21
- private waitForResponse;
22
- private connect;
23
- private normalizeHeaders;
24
- }
@@ -1,149 +0,0 @@
1
- "use strict";
2
- var WsRequestRunner_1;
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.WsRequestRunner = void 0;
5
- const tslib_1 = require("tslib");
6
- const RequestRunnerOptions_1 = require("../RequestRunnerOptions");
7
- const Response_1 = require("../Response");
8
- const models_1 = require("../../models");
9
- const core_1 = require("@sectester/core");
10
- const ws_1 = tslib_1.__importDefault(require("ws"));
11
- const tsyringe_1 = require("tsyringe");
12
- const socks_proxy_agent_1 = require("socks-proxy-agent");
13
- const events_1 = require("events");
14
- const url_1 = require("url");
15
- const util_1 = require("util");
16
- let WsRequestRunner = WsRequestRunner_1 = class WsRequestRunner {
17
- constructor(options, logger) {
18
- this.options = options;
19
- this.logger = logger;
20
- this.agent = this.options.proxyUrl
21
- ? new socks_proxy_agent_1.SocksProxyAgent({
22
- ...(0, url_1.parse)(this.options.proxyUrl)
23
- })
24
- : undefined;
25
- }
26
- get protocol() {
27
- return models_1.Protocol.WS;
28
- }
29
- async run(options) {
30
- let timeout;
31
- let client;
32
- try {
33
- this.logger.debug('Executing WS request with following params: %j', options);
34
- client = this.createWebSocketClient(options);
35
- const connectRes = await this.connect(client);
36
- timeout = this.setTimeout(client);
37
- const msg = await this.sendMessage(client, options);
38
- return this.createWsResponse(msg, connectRes);
39
- }
40
- catch (err) {
41
- return this.handleRequestError(err, options);
42
- }
43
- finally {
44
- if (timeout) {
45
- clearTimeout(timeout);
46
- }
47
- if ((client === null || client === void 0 ? void 0 : client.readyState) === ws_1.default.OPEN) {
48
- client.close(1000);
49
- }
50
- }
51
- }
52
- createWebSocketClient(options) {
53
- var _a;
54
- return new ws_1.default(options.url, {
55
- agent: this.agent,
56
- rejectUnauthorized: false,
57
- handshakeTimeout: this.options.timeout,
58
- headers: this.normalizeHeaders((_a = options.headers) !== null && _a !== void 0 ? _a : {})
59
- });
60
- }
61
- async sendMessage(client, options) {
62
- // @ts-expect-error TS infers a wrong type here
63
- await (0, util_1.promisify)(client.send.bind(client))(options.body);
64
- const message = await this.consume(client, options.correlationIdRegex);
65
- return message;
66
- }
67
- createWsResponse(msg, connectRes) {
68
- var _a;
69
- return new Response_1.Response({
70
- protocol: this.protocol,
71
- statusCode: (_a = msg === null || msg === void 0 ? void 0 : msg.code) !== null && _a !== void 0 ? _a : connectRes.statusCode,
72
- headers: connectRes.headers,
73
- body: msg === null || msg === void 0 ? void 0 : msg.body
74
- });
75
- }
76
- handleRequestError(err, options) {
77
- var _a, _b;
78
- const message = (_a = err.info) !== null && _a !== void 0 ? _a : err.message;
79
- const errorCode = (_b = err.code) !== null && _b !== void 0 ? _b : err.syscall;
80
- this.logger.error('Error executing request: %s', options.url);
81
- this.logger.error('Cause: %s', message);
82
- return new Response_1.Response({
83
- message,
84
- errorCode,
85
- protocol: this.protocol
86
- });
87
- }
88
- setTimeout(client) {
89
- const timeout = setTimeout(() => client.emit('error', Object.assign(new Error('Waiting frame has timed out'), {
90
- code: 'ETIMEDOUT'
91
- })), this.options.timeout);
92
- timeout.unref();
93
- return timeout;
94
- }
95
- async consume(client, matcher) {
96
- const result = (await Promise.race([
97
- this.waitForResponse(client, matcher),
98
- (0, events_1.once)(client, 'close')
99
- ]));
100
- let msg;
101
- if (result.length) {
102
- const [data, reason] = result;
103
- const body = typeof data === 'string' ? data : reason;
104
- const code = typeof data === 'number' ? data : undefined;
105
- msg = {
106
- body,
107
- code
108
- };
109
- }
110
- return msg;
111
- }
112
- waitForResponse(client, matcher) {
113
- return new Promise(resolve => {
114
- client.on('message', (data) => {
115
- const dataString = String(data);
116
- !matcher || matcher.test(dataString)
117
- ? resolve([dataString])
118
- : undefined;
119
- });
120
- });
121
- }
122
- async connect(client) {
123
- const opening = (0, events_1.once)(client, 'open');
124
- const upgrading = (0, events_1.once)(client, 'upgrade');
125
- await opening;
126
- const [res] = await upgrading;
127
- return res;
128
- }
129
- normalizeHeaders(headers) {
130
- return Object.entries(headers).reduce((result, [key, value]) => {
131
- const headerName = key.trim().toLowerCase();
132
- if (!WsRequestRunner_1.FORBIDDEN_HEADERS.has(headerName)) {
133
- result[key] = value;
134
- }
135
- return result;
136
- }, {});
137
- }
138
- };
139
- WsRequestRunner.FORBIDDEN_HEADERS = new Set([
140
- 'sec-websocket-version',
141
- 'sec-websocket-key'
142
- ]);
143
- WsRequestRunner = WsRequestRunner_1 = tslib_1.__decorate([
144
- (0, tsyringe_1.injectable)(),
145
- tslib_1.__param(0, (0, tsyringe_1.inject)(RequestRunnerOptions_1.RequestRunnerOptions)),
146
- tslib_1.__metadata("design:paramtypes", [Object, core_1.Logger])
147
- ], WsRequestRunner);
148
- exports.WsRequestRunner = WsRequestRunner;
149
- //# sourceMappingURL=WsRequestRunner.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"WsRequestRunner.js","sourceRoot":"","sources":["../../../../../../packages/repeater/src/request-runner/protocols/WsRequestRunner.ts"],"names":[],"mappings":";;;;;AAEA,kEAA+D;AAC/D,0CAAuC;AACvC,yCAAwC;AACxC,0CAAyC;AACzC,oDAA2B;AAC3B,uCAA8C;AAC9C,yDAAoD;AACpD,mCAA8B;AAE9B,6BAA4B;AAC5B,+BAAiC;AAQjC,IAAa,eAAe,uBAA5B,MAAa,eAAe;IAQ1B,YAEmB,OAA6B,EAC7B,MAAc;QADd,YAAO,GAAP,OAAO,CAAsB;QAC7B,WAAM,GAAN,MAAM,CAAQ;QAE/B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ;YAChC,CAAC,CAAC,IAAI,mCAAe,CAAC;gBAClB,GAAG,IAAA,WAAK,EAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC;aAChC,CAAC;YACJ,CAAC,CAAC,SAAS,CAAC;IAChB,CAAC;IAED,IAAI,QAAQ;QACV,OAAO,iBAAQ,CAAC,EAAE,CAAC;IACrB,CAAC;IAEM,KAAK,CAAC,GAAG,CAAC,OAAgB;QAC/B,IAAI,OAAmC,CAAC;QACxC,IAAI,MAA6B,CAAC;QAElC,IAAI;YACF,IAAI,CAAC,MAAM,CAAC,KAAK,CACf,gDAAgD,EAChD,OAAO,CACR,CAAC;YAEF,MAAM,GAAG,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,CAAC;YAC7C,MAAM,UAAU,GAAoB,MAA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