record-replay-req-res-scenario 21.0.16 → 21.0.17

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 (43) hide show
  1. package/browser/package.json +1 -1
  2. package/browser-prod/package.json +1 -1
  3. package/lib/build-info._auto-generated_.d.ts +1 -1
  4. package/lib/build-info._auto-generated_.js +1 -1
  5. package/lib/package.json +1 -1
  6. package/lib-prod/build-info._auto-generated_.js +14 -0
  7. package/lib-prod/env/env.angular-node-app.js +130 -0
  8. package/lib-prod/env/env.docs-webapp.js +130 -0
  9. package/lib-prod/env/env.electron-app.js +130 -0
  10. package/lib-prod/env/env.mobile-app.js +130 -0
  11. package/lib-prod/env/env.npm-lib-and-cli-tool.js +130 -0
  12. package/lib-prod/env/env.vscode-plugin.js +130 -0
  13. package/lib-prod/env/index.js +6 -0
  14. package/lib-prod/index._auto-generated_.js +0 -0
  15. package/lib-prod/index.js +5 -0
  16. package/lib-prod/migrations/index.js +1 -0
  17. package/lib-prod/migrations/migrations_index._auto-generated_.js +0 -0
  18. package/lib-prod/package.json +1 -1
  19. package/lib-prod/record-replay-req-res-scenario.js +0 -0
  20. package/lib-prod/scenario.backend.js +0 -0
  21. package/lib-prod/start.backend.js +0 -0
  22. package/lib-prod/tape.backend.js +0 -0
  23. package/package.json +1 -1
  24. package/websql/package.json +1 -1
  25. package/websql-prod/package.json +1 -1
  26. package/lib-prod/build-info._auto-generated_.ts +0 -27
  27. package/lib-prod/env/env.angular-node-app.ts +0 -66
  28. package/lib-prod/env/env.docs-webapp.ts +0 -66
  29. package/lib-prod/env/env.electron-app.ts +0 -66
  30. package/lib-prod/env/env.mobile-app.ts +0 -66
  31. package/lib-prod/env/env.npm-lib-and-cli-tool.ts +0 -66
  32. package/lib-prod/env/env.vscode-plugin.ts +0 -66
  33. package/lib-prod/env/index.ts +0 -6
  34. package/lib-prod/index._auto-generated_.ts +0 -5
  35. package/lib-prod/index.ts +0 -10
  36. package/lib-prod/lib-info.md +0 -8
  37. package/lib-prod/migrations/index.ts +0 -2
  38. package/lib-prod/migrations/migrations-info.md +0 -6
  39. package/lib-prod/migrations/migrations_index._auto-generated_.ts +0 -5
  40. package/lib-prod/record-replay-req-res-scenario.ts +0 -419
  41. package/lib-prod/scenario.backend.ts +0 -262
  42. package/lib-prod/start.backend.ts +0 -20
  43. package/lib-prod/tape.backend.ts +0 -34
@@ -1,66 +0,0 @@
1
- // THIS FILE IS GENERATED - DO NOT MODIFY
2
- export const ENV_NPM_LIB_AND_CLI_TOOL_WEBSITE_DOMAIN = 'record-replay-req-res-scenario.example.domain.com';
3
- export const ENV_NPM_LIB_AND_CLI_TOOL_WEBSITE_TITLE = 'Record Replay Req Res Scenario';
4
- export const ENV_NPM_LIB_AND_CLI_TOOL_RELEASE_TARGET_ARTIFACT = 'npm-lib-and-cli-tool';
5
- export const ENV_NPM_LIB_AND_CLI_TOOL_RELEASE_ENV_NAME = '__';
6
- export const ENV_NPM_LIB_AND_CLI_TOOL_CONTAINER_ONLY = undefined;
7
- export const ENV_NPM_LIB_AND_CLI_TOOL_CONTAINER_END = undefined;
8
- export const ENV_NPM_LIB_AND_CLI_TOOL_CONTAINER_START = undefined;
9
- export const ENV_NPM_LIB_AND_CLI_TOOL_CONTAINER_SKIP_RELEASED = undefined;
10
- export const ENV_NPM_LIB_AND_CLI_TOOL_CONTAINER_SKIP = undefined;
11
- export const ENV_NPM_LIB_AND_CLI_TOOL_INIT_BRANDING = undefined;
12
- export const ENV_NPM_LIB_AND_CLI_TOOL_INIT_STRUCT = undefined;
13
- export const ENV_NPM_LIB_AND_CLI_TOOL_BUILD_PWA_DISABLE_SERVICE_WORKER = undefined;
14
- export const ENV_NPM_LIB_AND_CLI_TOOL_BUILD_PWA_NAME = undefined;
15
- export const ENV_NPM_LIB_AND_CLI_TOOL_BUILD_PWA_SHORT_NAME = undefined;
16
- export const ENV_NPM_LIB_AND_CLI_TOOL_BUILD_PWA_START_URL = undefined;
17
- export const ENV_NPM_LIB_AND_CLI_TOOL_BUILD_ELECTRON_SHOW_DEV_TOOLS = undefined;
18
- export const ENV_NPM_LIB_AND_CLI_TOOL_BUILD_SSR = undefined;
19
- export const ENV_NPM_LIB_AND_CLI_TOOL_BUILD_WEBSQL = undefined;
20
- export const ENV_NPM_LIB_AND_CLI_TOOL_BUILD_PROD = undefined;
21
- export const ENV_NPM_LIB_AND_CLI_TOOL_BUILD_OVERRIDE_OUTPUT_PATH = undefined;
22
- export const ENV_NPM_LIB_AND_CLI_TOOL_BUILD_BASE_HREF = undefined;
23
- export const ENV_NPM_LIB_AND_CLI_TOOL_BUILD_WATCH = undefined;
24
- export const ENV_NPM_LIB_AND_CLI_TOOL_BUILD_GEN_ONLY_CLIENT_CODE = undefined;
25
- export const ENV_NPM_LIB_AND_CLI_TOOL_LOADING_PRE_ANGULAR_BOOTSTRAP_LOADER = undefined;
26
- export const ENV_NPM_LIB_AND_CLI_TOOL_LOADING_PRE_ANGULAR_BOOTSTRAP_BACKGROUND = undefined;
27
- export const ENV_NPM_LIB_AND_CLI_TOOL_RELEASE_CLI_MINIFY = undefined;
28
- export const ENV_NPM_LIB_AND_CLI_TOOL_RELEASE_CLI_INCLUDE_NODE_MODULES = undefined;
29
- export const ENV_NPM_LIB_AND_CLI_TOOL_RELEASE_CLI_UGLIFY = undefined;
30
- export const ENV_NPM_LIB_AND_CLI_TOOL_RELEASE_CLI_OBSCURE = undefined;
31
- export const ENV_NPM_LIB_AND_CLI_TOOL_RELEASE_CLI_COMPRESS = undefined;
32
- export const ENV_NPM_LIB_AND_CLI_TOOL_RELEASE_NODE_BACKEND_APP_MINIFY = undefined;
33
- export const ENV_NPM_LIB_AND_CLI_TOOL_RELEASE_LIB_REMOVE_DTS = undefined;
34
- export const ENV_NPM_LIB_AND_CLI_TOOL_RELEASE_LIB_OBSCURE_FILE_BY_FILE = undefined;
35
- export const ENV_NPM_LIB_AND_CLI_TOOL_RELEASE_LIB_UGLIFY_FILE_BY_FILE = undefined;
36
- export const ENV_NPM_LIB_AND_CLI_TOOL_RELEASE_LIB_INCLUDE_SOURCE_MAPS = undefined;
37
- export const ENV_NPM_LIB_AND_CLI_TOOL_RELEASE_LIB_COMPRESS = undefined;
38
- export const ENV_NPM_LIB_AND_CLI_TOOL_RELEASE_LIB_DO_NOT_INCLUDE_LIB_FILES = undefined;
39
- export const ENV_NPM_LIB_AND_CLI_TOOL_RELEASE_RESOLVED_NEW_VERSION = undefined;
40
- export const ENV_NPM_LIB_AND_CLI_TOOL_RELEASE_RELEASE_VERSION_BUMP_TYPE = undefined;
41
- export const ENV_NPM_LIB_AND_CLI_TOOL_RELEASE_ENV_NUMBER = undefined;
42
- export const ENV_NPM_LIB_AND_CLI_TOOL_RELEASE_INSTALL_LOCALLY = undefined;
43
- export const ENV_NPM_LIB_AND_CLI_TOOL_RELEASE_REMOVE_RELEASE_OUTPUT_AFTER_LOCAL_INSTALL = undefined;
44
- export const ENV_NPM_LIB_AND_CLI_TOOL_RELEASE_RELEASE_TYPE = undefined;
45
- export const ENV_NPM_LIB_AND_CLI_TOOL_RELEASE_AUTO_RELEASE_USING_CONFIG = undefined;
46
- export const ENV_NPM_LIB_AND_CLI_TOOL_RELEASE_AUTO_RELEASE_TASK_NAME = undefined;
47
- export const ENV_NPM_LIB_AND_CLI_TOOL_RELEASE_TAON_INSTANCE_IP = undefined;
48
- export const ENV_NPM_LIB_AND_CLI_TOOL_RELEASE_SKIP_NPM_PUBLISH = undefined;
49
- export const ENV_NPM_LIB_AND_CLI_TOOL_RELEASE_SKIP_DEPLOY = undefined;
50
- export const ENV_NPM_LIB_AND_CLI_TOOL_RELEASE_SKIP_TAG_GIT_PUSH = undefined;
51
- export const ENV_NPM_LIB_AND_CLI_TOOL_RELEASE_SKIP_RELEASE_QUESTION = undefined;
52
- export const ENV_NPM_LIB_AND_CLI_TOOL_RELEASE_SKIP_RESOLVING_GIT_CHANGES = undefined;
53
- export const ENV_NPM_LIB_AND_CLI_TOOL_RELEASE_SKIP_CODE_CUTTING = undefined;
54
- export const ENV_NPM_LIB_AND_CLI_TOOL_RELEASE_SKIP_BUILDING_ARTIFACTS = undefined;
55
- export const ENV_NPM_LIB_AND_CLI_TOOL_COPY_TO_MANAGER_BEFORE_COPY_HOOK = undefined;
56
- export const ENV_NPM_LIB_AND_CLI_TOOL_COPY_TO_MANAGER_COPY_TO_LOCATIONS = undefined;
57
- export const ENV_NPM_LIB_AND_CLI_TOOL_COPY_TO_MANAGER_COPY_TO_PROJECTS = undefined;
58
- export const ENV_NPM_LIB_AND_CLI_TOOL_COPY_TO_MANAGER_SKIP = undefined;
59
- export const ENV_NPM_LIB_AND_CLI_TOOL_WEBSITE_USE_DOMAIN = undefined;
60
- export const ENV_NPM_LIB_AND_CLI_TOOL_PURPOSE = undefined;
61
- export const ENV_NPM_LIB_AND_CLI_TOOL_RECURSIVE_ACTION = undefined;
62
- export const ENV_NPM_LIB_AND_CLI_TOOL_IS_CI_PROCESS = undefined;
63
- export const ENV_NPM_LIB_AND_CLI_TOOL_DOCKER_ADDITIONAL_CONTAINER = undefined;
64
- export const ENV_NPM_LIB_AND_CLI_TOOL_DOCKER_SKIP_START_IN_ORDER = undefined;
65
- export const ENV_NPM_LIB_AND_CLI_TOOL_DOCKER_SKIP_USING_MYSQL_DB = undefined;
66
- // THIS FILE IS GENERATED - DO NOT MODIFY
@@ -1,66 +0,0 @@
1
- // THIS FILE IS GENERATED - DO NOT MODIFY
2
- export const ENV_VSCODE_PLUGIN_WEBSITE_DOMAIN = 'record-replay-req-res-scenario.example.domain.com';
3
- export const ENV_VSCODE_PLUGIN_WEBSITE_TITLE = 'Record Replay Req Res Scenario';
4
- export const ENV_VSCODE_PLUGIN_RELEASE_TARGET_ARTIFACT = 'vscode-plugin';
5
- export const ENV_VSCODE_PLUGIN_RELEASE_ENV_NAME = '__';
6
- export const ENV_VSCODE_PLUGIN_CONTAINER_ONLY = undefined;
7
- export const ENV_VSCODE_PLUGIN_CONTAINER_END = undefined;
8
- export const ENV_VSCODE_PLUGIN_CONTAINER_START = undefined;
9
- export const ENV_VSCODE_PLUGIN_CONTAINER_SKIP_RELEASED = undefined;
10
- export const ENV_VSCODE_PLUGIN_CONTAINER_SKIP = undefined;
11
- export const ENV_VSCODE_PLUGIN_INIT_BRANDING = undefined;
12
- export const ENV_VSCODE_PLUGIN_INIT_STRUCT = undefined;
13
- export const ENV_VSCODE_PLUGIN_BUILD_PWA_DISABLE_SERVICE_WORKER = undefined;
14
- export const ENV_VSCODE_PLUGIN_BUILD_PWA_NAME = undefined;
15
- export const ENV_VSCODE_PLUGIN_BUILD_PWA_SHORT_NAME = undefined;
16
- export const ENV_VSCODE_PLUGIN_BUILD_PWA_START_URL = undefined;
17
- export const ENV_VSCODE_PLUGIN_BUILD_ELECTRON_SHOW_DEV_TOOLS = undefined;
18
- export const ENV_VSCODE_PLUGIN_BUILD_SSR = undefined;
19
- export const ENV_VSCODE_PLUGIN_BUILD_WEBSQL = undefined;
20
- export const ENV_VSCODE_PLUGIN_BUILD_PROD = undefined;
21
- export const ENV_VSCODE_PLUGIN_BUILD_OVERRIDE_OUTPUT_PATH = undefined;
22
- export const ENV_VSCODE_PLUGIN_BUILD_BASE_HREF = undefined;
23
- export const ENV_VSCODE_PLUGIN_BUILD_WATCH = undefined;
24
- export const ENV_VSCODE_PLUGIN_BUILD_GEN_ONLY_CLIENT_CODE = undefined;
25
- export const ENV_VSCODE_PLUGIN_LOADING_PRE_ANGULAR_BOOTSTRAP_LOADER = undefined;
26
- export const ENV_VSCODE_PLUGIN_LOADING_PRE_ANGULAR_BOOTSTRAP_BACKGROUND = undefined;
27
- export const ENV_VSCODE_PLUGIN_RELEASE_CLI_MINIFY = undefined;
28
- export const ENV_VSCODE_PLUGIN_RELEASE_CLI_INCLUDE_NODE_MODULES = undefined;
29
- export const ENV_VSCODE_PLUGIN_RELEASE_CLI_UGLIFY = undefined;
30
- export const ENV_VSCODE_PLUGIN_RELEASE_CLI_OBSCURE = undefined;
31
- export const ENV_VSCODE_PLUGIN_RELEASE_CLI_COMPRESS = undefined;
32
- export const ENV_VSCODE_PLUGIN_RELEASE_NODE_BACKEND_APP_MINIFY = undefined;
33
- export const ENV_VSCODE_PLUGIN_RELEASE_LIB_REMOVE_DTS = undefined;
34
- export const ENV_VSCODE_PLUGIN_RELEASE_LIB_OBSCURE_FILE_BY_FILE = undefined;
35
- export const ENV_VSCODE_PLUGIN_RELEASE_LIB_UGLIFY_FILE_BY_FILE = undefined;
36
- export const ENV_VSCODE_PLUGIN_RELEASE_LIB_INCLUDE_SOURCE_MAPS = undefined;
37
- export const ENV_VSCODE_PLUGIN_RELEASE_LIB_COMPRESS = undefined;
38
- export const ENV_VSCODE_PLUGIN_RELEASE_LIB_DO_NOT_INCLUDE_LIB_FILES = undefined;
39
- export const ENV_VSCODE_PLUGIN_RELEASE_RESOLVED_NEW_VERSION = undefined;
40
- export const ENV_VSCODE_PLUGIN_RELEASE_RELEASE_VERSION_BUMP_TYPE = undefined;
41
- export const ENV_VSCODE_PLUGIN_RELEASE_ENV_NUMBER = undefined;
42
- export const ENV_VSCODE_PLUGIN_RELEASE_INSTALL_LOCALLY = undefined;
43
- export const ENV_VSCODE_PLUGIN_RELEASE_REMOVE_RELEASE_OUTPUT_AFTER_LOCAL_INSTALL = undefined;
44
- export const ENV_VSCODE_PLUGIN_RELEASE_RELEASE_TYPE = undefined;
45
- export const ENV_VSCODE_PLUGIN_RELEASE_AUTO_RELEASE_USING_CONFIG = undefined;
46
- export const ENV_VSCODE_PLUGIN_RELEASE_AUTO_RELEASE_TASK_NAME = undefined;
47
- export const ENV_VSCODE_PLUGIN_RELEASE_TAON_INSTANCE_IP = undefined;
48
- export const ENV_VSCODE_PLUGIN_RELEASE_SKIP_NPM_PUBLISH = undefined;
49
- export const ENV_VSCODE_PLUGIN_RELEASE_SKIP_DEPLOY = undefined;
50
- export const ENV_VSCODE_PLUGIN_RELEASE_SKIP_TAG_GIT_PUSH = undefined;
51
- export const ENV_VSCODE_PLUGIN_RELEASE_SKIP_RELEASE_QUESTION = undefined;
52
- export const ENV_VSCODE_PLUGIN_RELEASE_SKIP_RESOLVING_GIT_CHANGES = undefined;
53
- export const ENV_VSCODE_PLUGIN_RELEASE_SKIP_CODE_CUTTING = undefined;
54
- export const ENV_VSCODE_PLUGIN_RELEASE_SKIP_BUILDING_ARTIFACTS = undefined;
55
- export const ENV_VSCODE_PLUGIN_COPY_TO_MANAGER_BEFORE_COPY_HOOK = undefined;
56
- export const ENV_VSCODE_PLUGIN_COPY_TO_MANAGER_COPY_TO_LOCATIONS = undefined;
57
- export const ENV_VSCODE_PLUGIN_COPY_TO_MANAGER_COPY_TO_PROJECTS = undefined;
58
- export const ENV_VSCODE_PLUGIN_COPY_TO_MANAGER_SKIP = undefined;
59
- export const ENV_VSCODE_PLUGIN_WEBSITE_USE_DOMAIN = undefined;
60
- export const ENV_VSCODE_PLUGIN_PURPOSE = undefined;
61
- export const ENV_VSCODE_PLUGIN_RECURSIVE_ACTION = undefined;
62
- export const ENV_VSCODE_PLUGIN_IS_CI_PROCESS = undefined;
63
- export const ENV_VSCODE_PLUGIN_DOCKER_ADDITIONAL_CONTAINER = undefined;
64
- export const ENV_VSCODE_PLUGIN_DOCKER_SKIP_START_IN_ORDER = undefined;
65
- export const ENV_VSCODE_PLUGIN_DOCKER_SKIP_USING_MYSQL_DB = undefined;
66
- // THIS FILE IS GENERATED - DO NOT MODIFY
@@ -1,6 +0,0 @@
1
- export * from './env.angular-node-app';
2
- export * from './env.docs-webapp';
3
- export * from './env.electron-app';
4
- export * from './env.mobile-app';
5
- export * from './env.npm-lib-and-cli-tool';
6
- export * from './env.vscode-plugin';
@@ -1,5 +0,0 @@
1
- // @ts-nocheck
2
- // This file is auto-generated during init process. Do not modify.
3
- // This is only placeholder.
4
- // Use property "shouldGenerateAutogenIndexFile: true"
5
- // in taon.jsonc to enable ts exports auto generation.
package/lib-prod/index.ts DELETED
@@ -1,10 +0,0 @@
1
- // //#region @backend
2
- // export * from './scenario.backend';
3
- // export * from './tape.backend';
4
- // //#endregion
5
- // export { RecordReplayReqResScenario, RecorderConfigMeta, ReplayConfigMeta } from './record-replay-req-res-scenario';
6
-
7
-
8
- export function asdaaaaa() {
9
-
10
- }
@@ -1,8 +0,0 @@
1
- THIS FILE IS GENERATED - DO NOT MODIFY
2
-
3
- This folder is an entry point for npm Angular/NodeJS library
4
-
5
- DON'T USE STUFF FROM PARENT FOLDER app.* FILES HERE (except src/migrations/** files).
6
-
7
- THIS FILE IS GENERATED - DO NOT MODIFY
8
-
@@ -1,2 +0,0 @@
1
- //@ts-nocheck
2
- export * from './migrations_index._auto-generated_';
@@ -1,6 +0,0 @@
1
- THIS FILE IS GENERATED - DO NOT MODIFY
2
-
3
- This folder is only for storing migration files with auto-generated names.
4
-
5
- THIS FILE IS GENERATED - DO NOT MODIFY
6
-
@@ -1,5 +0,0 @@
1
- // THIS FILE IS GENERATED - DO NOT MODIFY
2
-
3
- // THIS FILE IS GENERATED - DO NOT MODIFY
4
-
5
- // THIS FILE IS GENERATED - DO NOT MODIFY
@@ -1,419 +0,0 @@
1
- // //#region imports
2
- // //#region @backend
3
- // import * as _ from 'lodash';
4
- // import * as path from 'path';
5
- // import { Helpers, BaseProject as Project } from 'tnp-helpers';
6
- // import { URL } from 'url';
7
- // import { config } from 'tnp-core';
8
- // import * as moment from 'moment';
9
- // import { talkback, Options, RecordMode } from 'ng-talkback';
10
- // import * as glob from 'glob';
11
- // import { Scenario, ScenarioParam, ScenarioParams, ScenarioParamsReturn } from './scenario.backend';
12
- // import chalk from 'chalk';
13
- // import * as inquirer from 'inquirer';
14
- // // import { Models } from 'tnp-models';
15
- // //#endregion
16
- // //#endregion
17
-
18
- // //#region models
19
- // export type RecordData = { host: number | string | URL; talkbackProxyPort?: number | string; }
20
-
21
- // export type RecorderConfigMeta = {
22
- // [recordHostName: string]: RecordData;
23
- // } & { scenarioName: string; }
24
-
25
- // export type ReplayConfigMeta = {
26
- // [recordHostName: string]: { talkbackProxyPort?: number | string; }
27
- // } & { scenarioPath: string; }
28
-
29
- // type ArgsOptReplayRecordArgType = { port: string | string[]; hostName: string | string[]; };
30
-
31
- // interface RecordArgType {
32
- // record: {
33
- // /**
34
- // * url with host to record
35
- // */
36
- // url: URL;
37
- // /**
38
- // * Identifier of what was the name or id of server.
39
- // * this metadata is usefull to replay back multiple servers
40
- // * on different talkback ports
41
- // */
42
- // name: string;
43
- // };
44
- // /**
45
- // * talkback port for localhost proxy
46
- // */
47
- // talkbackProxyPort: number;
48
- // }
49
-
50
- // //#endregion
51
-
52
- // export class RecordReplayReqResScenario {
53
- // //#region @backend
54
-
55
- // //#region consts
56
- // /**
57
- // * by pinging to http://localhost:5544/path/to/something
58
- // * you are actually recording request from
59
- // * by pinging to http://< host for recording >/path/to/something
60
- // */
61
- // readonly DEFAULT_TALKBACK_PROXY_SERVER_PORT = 5544;
62
- // //#endregion
63
-
64
- // //#region singleton
65
- // private static _instances = {};
66
-
67
- // private constructor(
68
- // protected readonly cwd = process.cwd()
69
- // ) {
70
- // const pathToScenarios = path.join(cwd, config.folder.scenarios);
71
- // const pathToScenariosTemp = path.join(cwd, config.folder.tmpScenarios);
72
- // if (!Helpers.exists(pathToScenarios)) {
73
- // Helpers.createSymLink(pathToScenariosTemp, pathToScenarios,
74
- // { continueWhenExistedFolderDoesntExists: true })
75
- // }
76
- // }
77
- // public static Instance(cwd = process.cwd()) {
78
- // if (!RecordReplayReqResScenario._instances[cwd]) {
79
- // RecordReplayReqResScenario._instances[cwd] = new RecordReplayReqResScenario(cwd);
80
- // }
81
- // return RecordReplayReqResScenario._instances[cwd] as RecordReplayReqResScenario;
82
- // }
83
- // //#endregion
84
-
85
- // //#region resolve recoard args
86
- // private resolveArgsRecord(serverHostOrPort: string | string[] | RecorderConfigMeta)
87
- // : { args: RecordArgType[]; scenarioName: string; } {
88
-
89
- // const results = [] as RecordArgType[];
90
- // const configMeta = ((_.isObject(serverHostOrPort) && !_.isArray(serverHostOrPort))
91
- // ? serverHostOrPort : void 0) as RecorderConfigMeta;
92
- // let scenarioName = '' as string;
93
- // let talkbackPorts = [this.DEFAULT_TALKBACK_PROXY_SERVER_PORT];
94
-
95
- // if (configMeta) {
96
- // //#region by config
97
- // scenarioName = configMeta.scenarioName;
98
- // _.keys(configMeta)
99
- // .filter(key => _.isObject(configMeta[key]))
100
- // .forEach((name, i) => {
101
- // const url = Helpers.urlParse(configMeta[name].host);
102
- // results.push({
103
- // record: {
104
- // name,
105
- // url
106
- // },
107
- // talkbackProxyPort: Number(configMeta[name].talkbackProxyPort) + i
108
- // })
109
- // })
110
- // //#endregion
111
- // } else {
112
- // //#region by command line argument
113
- // const { commandString, resolved } = Helpers.cliTool.argsFromBegin<URL>(
114
- // serverHostOrPort as string,
115
- // a => Helpers.urlParse(a)
116
- // );
117
- // scenarioName = commandString;
118
- // let options = Helpers.cliTool.argsFrom<{ port: string; hostName: string; }>(scenarioName);
119
- // scenarioName = Helpers.cliTool.cleanCommand(scenarioName, options);
120
- // if (_.isArray(options.port)) {
121
- // talkbackPorts = options.port;
122
- // } else if (!isNaN(Number(options.port))) {
123
- // talkbackPorts = [Number(options.port)];
124
- // }
125
- // const hostName = _.isString(options.hostName) ? [options.hostName]
126
- // : (_.isArray(options.hostName) ? options.hostName : [])
127
-
128
- // if (talkbackPorts.length === 0) {
129
- // Helpers.error(`[rec-scenario-rep-rec] Incorrect configuration of ports:
130
- // recordHosts = ${resolved.map(c => Helpers.urlParse(c)).join(', ')}
131
- // talkback ports = ${talkbackPorts.join(', ')}
132
-
133
- // `, false, true);
134
- // }
135
- // if (talkbackPorts.length < resolved.length) {
136
- // const lastN = talkbackPorts[talkbackPorts.length - 1];
137
- // _.times((resolved.length - talkbackPorts.length), (i) => talkbackPorts.push(lastN + (i + 1)));
138
- // }
139
-
140
- // resolved.forEach((recordHost, i) => {
141
- // results.push({
142
- // record: {
143
- // name: hostName[i] ? hostName[i] : '',
144
- // url: recordHost
145
- // },
146
- // talkbackProxyPort: talkbackPorts[i]
147
- // })
148
- // });
149
- // //#endregion
150
- // }
151
-
152
- // return { args: results, scenarioName };
153
- // }
154
- // //#endregion
155
-
156
- // //#region command from config
157
- // public recordAsWorker(config: RecorderConfigMeta, cwd: string = process.cwd()) {
158
- // const hosts = Object
159
- // .keys(config)
160
- // .filter(hostName => _.isObject(config[hostName]))
161
- // .map(hostName => {
162
- // const v = config[hostName] as RecordData;
163
- // return (v.host as URL).origin;
164
- // });
165
- // const portName = Object
166
- // .keys(config)
167
- // .filter(hostName => _.isObject(config[hostName]))
168
- // .map(hostName => {
169
- // const v = config[hostName] as RecordData;
170
- // return `--port ${v.talkbackProxyPort} --hostName ${hostName}`
171
- // })
172
- // let command = `record-replay-req-res-scenario record ${hosts.join(' ')} '${config.scenarioName}' ${portName.join(' ')}`;
173
- // Helpers.run(command, { cwd }).async();
174
- // }
175
- // //#endregion
176
-
177
- // //#region record
178
- // /**
179
- // * rest-scenario-rep-rec record http://localhost:4444 Recording localhost data
180
- // * rest-scenario-rep-rec record http://192.168.10.22:4444 Test scenario
181
- // * rest-scenario-rep-rec record 4444 local setup test
182
- // * rest-scenario-rep-rec record 4444 5555 http://192.168.12.3 "my super scenario"
183
- // * rest-scenario-rep-rec record 4444 5555 http://192.168.12.3 192.158.32.3 'my super scenario --port 6767'
184
- // * <port or host for record > <scenario name > < talkbback server ports for proxy >
185
- // * rest-scenario-rep-rec record 4444 5555 http://my.api.com 'my super scenario --port 6767 --port 7777 --port 8888'
186
- // * ins.record( { portOrHost: http://192.129.23.12; name: 'localApiProxy' }, 'super scenario')
187
- // */
188
- // async record(serverHostOrPort: string | string[] | RecorderConfigMeta, debug = false) {
189
- // return new Promise((resolve, reject) => {
190
- // const currentDate = new Date();
191
- // let { args, scenarioName } = this.resolveArgsRecord(serverHostOrPort);
192
-
193
- // //#region prepare main scenario folder
194
- // let description = scenarioName;
195
- // if (!_.isString(scenarioName) || scenarioName.trim() === '') {
196
- // scenarioName = `new-scenario-${_.kebabCase(moment(currentDate).format('MMMM Do YYYY, h:mm:ss a'))}`;;
197
- // description = _.startCase(scenarioName);
198
- // }
199
- // const scenarioNameKebabKase = _.kebabCase(scenarioName);
200
- // const scenariosFolder = path.join(this.cwd, config.folder.tmpScenarios);
201
- // const scenarioKebabPath = path.join(scenariosFolder, scenarioNameKebabKase);
202
- // const packageJsonFroScenario = path.join(scenarioKebabPath, config.file.package_json);
203
-
204
- // if (!Helpers.exists(scenariosFolder)) {
205
- // Helpers.mkdirp(scenariosFolder);
206
- // }
207
- // Helpers.removeFolderIfExists(scenarioKebabPath);
208
- // //#endregion
209
-
210
- // //#region write package.json
211
- // Helpers.writeFile(packageJsonFroScenario, {
212
- // name: scenarioNameKebabKase,
213
- // description,
214
- // version: '0.0.0',
215
- // creationDate: currentDate.toDateString(),
216
- // scripts: {
217
- // start: 'firedev serve',
218
- // },
219
- // tnp: {
220
- // type: 'scenario',
221
- // } as any,
222
- // } as Partial<Models.npm.IPackageJSON>);
223
- // //#endregion
224
-
225
- // args.forEach(recData => {
226
- // Helpers.log(`RECORD FROM: ${recData.record.url.href}`)
227
-
228
- // const scenarioPath = path.join(
229
- // this.cwd,
230
- // config.folder.tmpScenarios,
231
- // scenarioNameKebabKase,
232
- // `${(_.kebabCase(recData.record.url.href)).toString()}__${_.camelCase(recData.record.name)}`
233
- // );
234
-
235
- // Helpers.remove(scenarioPath);
236
-
237
- // const talkbackHost = recData.record.url.origin;
238
- // debug && Helpers.info(`Talkback host: ${talkbackHost}`)
239
- // const server = talkback({
240
- // host: talkbackHost,
241
- // record: RecordMode.NEW,
242
- // port: recData.talkbackProxyPort,
243
- // path: scenarioPath,
244
- // silent: true,
245
- // // debug: true
246
- // } as Options);
247
- // server.start(() => {
248
- // Helpers.info(`"Talkback Started" on port ${recData.talkbackProxyPort} `
249
- // + `( click for test ${chalk.bold(recData.record?.name ? recData.record.name : '')} `
250
- // + `http://localhost:${recData.talkbackProxyPort}/ng-talkback-test ) => proxy to ${recData.record.url.href}`);
251
- // resolve(void 0);
252
- // });
253
- // })
254
- // });
255
- // }
256
- // //#endregion
257
-
258
- // //#region all scenaroios
259
- // public get allScenarios() {
260
- // return glob.sync(`${path.join(this.cwd, config.folder.tmpScenarios)}/*`)
261
- // .filter(f => !!Project.ins.From(f))
262
- // .map(f => Scenario.From(f))
263
- // .filter(f => !!f)
264
- // }
265
- // //#endregion
266
-
267
- // //#region select scenario
268
- // async selectScenario(goBackButtonOnList?: boolean): Promise<Scenario> {
269
- // const mainMessage = `Select scenario from list:`;
270
- // const choices = Scenario.allCurrent.map(c => {
271
- // return { name: `"${c.description}"`, value: c }
272
- // });
273
- // if (goBackButtonOnList) {
274
- // choices.push({ name: '<= Go back', value: void 0 });
275
- // }
276
-
277
- // const res = await inquirer.prompt({
278
- // type: 'list',
279
- // name: 'value',
280
- // message: mainMessage,
281
- // choices
282
- // } as any) as any;
283
- // return res.value;
284
- // }
285
- // //#endregion
286
-
287
- // //#region resolve replay args
288
- // private async resolveReplayData(
289
- // nameOrPathOrDescription: string | string[] | ReplayConfigMeta,
290
- // showListIfNotMatch = false,
291
- // goBackButtonOnList = false,
292
- // ) {
293
- // const returnValue = { scenarios: [] as Scenario[], params: void 0 as ScenarioParamsReturn }
294
- // if (_.isObject(nameOrPathOrDescription) && !_.isArray(nameOrPathOrDescription)) {
295
- // //#region config
296
- // const configMeta = nameOrPathOrDescription as ReplayConfigMeta;
297
- // const scenario = Scenario.From(configMeta.scenarioPath)
298
- // if (!scenario) {
299
- // Helpers.error(`[rest-scenario...] Scenario not found in "${configMeta.scenarioPath}"`
300
- // , false, true)
301
- // }
302
- // returnValue.scenarios = [scenario];
303
- // returnValue.params = _.pickBy(configMeta, _.isObject) as ScenarioParamsReturn;
304
- // //#endregion
305
- // } else {
306
- // //#region from command line
307
-
308
- // nameOrPathOrDescription = (_.isArray(nameOrPathOrDescription)
309
- // ? nameOrPathOrDescription.join(' ') : nameOrPathOrDescription) as string;
310
-
311
- // const options = Helpers.cliTool.argsFrom<ArgsOptReplayRecordArgType>(nameOrPathOrDescription);
312
- // nameOrPathOrDescription = Helpers.cliTool.cleanCommand(nameOrPathOrDescription, options);
313
-
314
- // const { resolved, commandString } = Helpers.cliTool
315
- // .argsFromBegin<Scenario>(nameOrPathOrDescription, possiblePathToScenario => {
316
- // const scenarioFromPath = (
317
- // path.isAbsolute(possiblePathToScenario || '') &&
318
- // Helpers.exists(possiblePathToScenario))
319
- // ? possiblePathToScenario
320
- // : path.join(
321
- // this.cwd,
322
- // config.folder.tmpScenarios,
323
- // (possiblePathToScenario || '').trim());
324
- // return Scenario.From(scenarioFromPath);
325
- // });
326
- // nameOrPathOrDescription = commandString;
327
- // let scenarios = resolved;
328
-
329
- // if (scenarios.length === 0 && commandString.trim() !== '') {
330
- // const list = this.allScenarios;
331
- // const { matches, results } = Helpers
332
- // .arrays
333
- // .fuzzy<Scenario>(nameOrPathOrDescription, list, (m) => m.description);
334
- // scenarios = scenarios.concat(results);
335
- // }
336
-
337
- // const hostName = _.isString(options.hostName) ? [options.hostName]
338
- // : (_.isArray(options.hostName) ? options.hostName : []);
339
-
340
- // const portsOrUrlsForReplayServer = (_.isString(options.port) ? [Helpers.urlParse(options.port)]
341
- // : (_.isArray(options.port) ? options.port.map(p => Helpers.urlParse(p))
342
- // : [Helpers.urlParse(this.DEFAULT_TALKBACK_PROXY_SERVER_PORT)])).filter(u => u instanceof URL);
343
-
344
- // if (portsOrUrlsForReplayServer.length === 0) {
345
- // Helpers.error(`Please provide correct number or ports and hostnames
346
- // host names = ${hostName.map(c => Helpers.urlParse(c)).join(', ')}
347
- // talkback ports = ${portsOrUrlsForReplayServer.join(', ')}
348
- // `, false, true);
349
- // }
350
-
351
- // let params = portsOrUrlsForReplayServer;
352
-
353
- // if (hostName.length > 0) {
354
- // if (hostName.length > portsOrUrlsForReplayServer.length) {
355
- // const maxPort = _.maxBy(portsOrUrlsForReplayServer, p => Number(p.port));
356
- // _.times(hostName.length - portsOrUrlsForReplayServer.length, n => {
357
- // portsOrUrlsForReplayServer.push(Helpers.urlParse(Number(maxPort.port) + (n + 1)))
358
- // });
359
- // }
360
- // params = hostName.reduce((prev, name, i) => {
361
- // return _.merge(prev, { [name]: portsOrUrlsForReplayServer[i] })
362
- // }, {}) as any;
363
- // }
364
-
365
- // returnValue.params = params as any;
366
- // returnValue.scenarios = scenarios;
367
- // //#endregion
368
- // }
369
-
370
- // //#region select menu scenraios
371
- // if (returnValue.scenarios.length === 0) {
372
- // if (showListIfNotMatch) {
373
- // const selectedScenario = await this.selectScenario(goBackButtonOnList);
374
- // returnValue.scenarios.push(selectedScenario);
375
- // }
376
- // }
377
- // //#endregion
378
-
379
- // return returnValue;
380
- // }
381
- // //#endregion
382
-
383
- // //#region replay
384
- // public async resolveScenariosData(
385
- // nameOrPathOrDescription: string | string[] | ReplayConfigMeta,
386
- // showListIfNotMatch = false,
387
- // goBackButtonOnList = false,
388
- // ) {
389
-
390
- // const { scenarios, params } = await this.resolveReplayData(
391
- // nameOrPathOrDescription,
392
- // showListIfNotMatch,
393
- // goBackButtonOnList,
394
- // );
395
-
396
- // if (scenarios.length === 0) {
397
- // Helpers.error(`[record - replay - req - res - scenario]`
398
- // + `Not able to find scenario by name or path "${nameOrPathOrDescription}"`, false, true);
399
- // }
400
-
401
- // // const tmpScenarioInfo = (s: Scenario) => {
402
- // // const paramsTmpls = _.isArray(params) ? params.map(p => ` replay on ${p}`).join(',')
403
- // // : _.keys(params).reduce((a, b) => {
404
- // // return `${a}\n\t${chalk.bold(b)}:${params[b].href}`
405
- // // }, '')
406
- // // return `> ${chalk.bold(s.basename)} "${s.description}"` +
407
- // // paramsTmpls;
408
- // // };
409
-
410
- // // Helpers.info(`
411
- // // (${chalk.bold(scenarios.length.toString())}) scenario(s) to replay: `
412
- // // + `${scenarios.map(s => tmpScenarioInfo(s)).join('\n')}`
413
- // // );
414
- // return { scenario: _.first(scenarios), scenarios, params };
415
- // }
416
- // //#endregion
417
-
418
- // //#endregion
419
- // }