@elastic/synthetics 1.0.0-beta.4 → 1.0.0-beta.40

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 (220) hide show
  1. package/README.md +4 -3
  2. package/dist/cli.js +137 -160
  3. package/dist/cli.js.map +1 -1
  4. package/dist/common_types.d.ts +159 -31
  5. package/dist/common_types.d.ts.map +1 -1
  6. package/dist/config.d.ts +3 -5
  7. package/dist/config.d.ts.map +1 -1
  8. package/dist/config.js +7 -6
  9. package/dist/config.js.map +1 -1
  10. package/dist/core/browser-service.d.ts +1 -1
  11. package/dist/core/browser-service.d.ts.map +1 -1
  12. package/dist/core/browser-service.js +7 -6
  13. package/dist/core/browser-service.js.map +1 -1
  14. package/dist/core/expect.d.ts +25 -25
  15. package/dist/core/expect.d.ts.map +1 -1
  16. package/dist/core/expect.js.map +1 -1
  17. package/dist/core/gatherer.d.ts +4 -8
  18. package/dist/core/gatherer.d.ts.map +1 -1
  19. package/dist/core/gatherer.js +50 -15
  20. package/dist/core/gatherer.js.map +1 -1
  21. package/dist/core/index.d.ts +5 -1
  22. package/dist/core/index.d.ts.map +1 -1
  23. package/dist/core/index.js +23 -11
  24. package/dist/core/index.js.map +1 -1
  25. package/dist/core/logger.d.ts +0 -1
  26. package/dist/core/logger.d.ts.map +1 -1
  27. package/dist/core/logger.js +3 -16
  28. package/dist/core/logger.js.map +1 -1
  29. package/dist/core/runner.d.ts +12 -63
  30. package/dist/core/runner.d.ts.map +1 -1
  31. package/dist/core/runner.js +156 -90
  32. package/dist/core/runner.js.map +1 -1
  33. package/dist/core/transform.d.ts +37 -0
  34. package/dist/core/transform.d.ts.map +1 -0
  35. package/dist/core/transform.js +148 -0
  36. package/dist/core/transform.js.map +1 -0
  37. package/dist/dsl/index.js +5 -1
  38. package/dist/dsl/index.js.map +1 -1
  39. package/dist/dsl/journey.d.ts +9 -4
  40. package/dist/dsl/journey.d.ts.map +1 -1
  41. package/dist/dsl/journey.js +37 -9
  42. package/dist/dsl/journey.js.map +1 -1
  43. package/dist/dsl/monitor.d.ts +83 -0
  44. package/dist/dsl/monitor.d.ts.map +1 -0
  45. package/dist/dsl/monitor.js +108 -0
  46. package/dist/dsl/monitor.js.map +1 -0
  47. package/dist/dsl/step.d.ts +3 -2
  48. package/dist/dsl/step.d.ts.map +1 -1
  49. package/dist/dsl/step.js +6 -1
  50. package/dist/dsl/step.js.map +1 -1
  51. package/dist/formatter/javascript.d.ts +98 -0
  52. package/dist/formatter/javascript.d.ts.map +1 -0
  53. package/dist/formatter/javascript.js +298 -0
  54. package/dist/formatter/javascript.js.map +1 -0
  55. package/dist/generator/index.d.ts +24 -0
  56. package/dist/generator/index.d.ts.map +1 -0
  57. package/dist/generator/index.js +241 -0
  58. package/dist/generator/index.js.map +1 -0
  59. package/dist/{reporters/reporter.js → generator/utils.d.ts} +5 -3
  60. package/dist/generator/utils.d.ts.map +1 -0
  61. package/dist/generator/utils.js +84 -0
  62. package/dist/generator/utils.js.map +1 -0
  63. package/dist/helpers.d.ts +28 -3
  64. package/dist/helpers.d.ts.map +1 -1
  65. package/dist/helpers.js +152 -20
  66. package/dist/helpers.js.map +1 -1
  67. package/dist/index.d.ts +6 -7
  68. package/dist/index.d.ts.map +1 -1
  69. package/dist/index.js +5 -26
  70. package/dist/index.js.map +1 -1
  71. package/dist/loader.d.ts +34 -0
  72. package/dist/loader.d.ts.map +1 -0
  73. package/dist/loader.js +149 -0
  74. package/dist/loader.js.map +1 -0
  75. package/dist/locations/index.d.ts +45 -0
  76. package/dist/locations/index.d.ts.map +1 -0
  77. package/dist/locations/index.js +83 -0
  78. package/dist/locations/index.js.map +1 -0
  79. package/dist/{reporters/reporter.d.ts → locations/public-locations.d.ts} +12 -8
  80. package/dist/locations/public-locations.d.ts.map +1 -0
  81. package/dist/locations/public-locations.js +41 -0
  82. package/dist/locations/public-locations.js.map +1 -0
  83. package/dist/options.d.ts +41 -0
  84. package/dist/options.d.ts.map +1 -0
  85. package/dist/options.js +198 -0
  86. package/dist/options.js.map +1 -0
  87. package/dist/plugins/browser-console.d.ts +5 -4
  88. package/dist/plugins/browser-console.d.ts.map +1 -1
  89. package/dist/plugins/browser-console.js +44 -24
  90. package/dist/plugins/browser-console.js.map +1 -1
  91. package/dist/plugins/index.js +5 -1
  92. package/dist/plugins/index.js.map +1 -1
  93. package/dist/plugins/network.d.ts +20 -33
  94. package/dist/plugins/network.d.ts.map +1 -1
  95. package/dist/plugins/network.js +177 -216
  96. package/dist/plugins/network.js.map +1 -1
  97. package/dist/plugins/performance.d.ts +4 -19
  98. package/dist/plugins/performance.d.ts.map +1 -1
  99. package/dist/plugins/performance.js +6 -5
  100. package/dist/plugins/performance.js.map +1 -1
  101. package/dist/plugins/plugin-manager.d.ts +9 -5
  102. package/dist/plugins/plugin-manager.d.ts.map +1 -1
  103. package/dist/plugins/plugin-manager.js +46 -30
  104. package/dist/plugins/plugin-manager.js.map +1 -1
  105. package/dist/plugins/tracing.d.ts +6 -6
  106. package/dist/plugins/tracing.d.ts.map +1 -1
  107. package/dist/plugins/tracing.js +10 -7
  108. package/dist/plugins/tracing.js.map +1 -1
  109. package/dist/push/bundler.d.ts +35 -0
  110. package/dist/push/bundler.d.ts.map +1 -0
  111. package/dist/push/bundler.js +131 -0
  112. package/dist/push/bundler.js.map +1 -0
  113. package/dist/push/index.d.ts +9 -0
  114. package/dist/push/index.d.ts.map +1 -0
  115. package/dist/push/index.js +227 -0
  116. package/dist/push/index.js.map +1 -0
  117. package/dist/push/kibana_api.d.ts +56 -0
  118. package/dist/push/kibana_api.d.ts.map +1 -0
  119. package/dist/push/kibana_api.js +135 -0
  120. package/dist/push/kibana_api.js.map +1 -0
  121. package/dist/push/monitor.d.ts +51 -0
  122. package/dist/push/monitor.d.ts.map +1 -0
  123. package/dist/push/monitor.js +244 -0
  124. package/dist/push/monitor.js.map +1 -0
  125. package/dist/{parse_args.d.ts → push/plugin.d.ts} +9 -6
  126. package/dist/push/plugin.d.ts.map +1 -0
  127. package/dist/push/plugin.js +66 -0
  128. package/dist/push/plugin.js.map +1 -0
  129. package/dist/push/request.d.ts +45 -0
  130. package/dist/push/request.d.ts.map +1 -0
  131. package/dist/push/request.js +109 -0
  132. package/dist/push/request.js.map +1 -0
  133. package/dist/push/utils.d.ts +31 -0
  134. package/dist/push/utils.d.ts.map +1 -0
  135. package/dist/push/utils.js +64 -0
  136. package/dist/push/utils.js.map +1 -0
  137. package/dist/reporters/base.d.ts +14 -6
  138. package/dist/reporters/base.d.ts.map +1 -1
  139. package/dist/reporters/base.js +58 -50
  140. package/dist/reporters/base.js.map +1 -1
  141. package/dist/reporters/index.d.ts +18 -8
  142. package/dist/reporters/index.d.ts.map +1 -1
  143. package/dist/reporters/index.js.map +1 -1
  144. package/dist/reporters/json.d.ts +18 -62
  145. package/dist/reporters/json.d.ts.map +1 -1
  146. package/dist/reporters/json.js +149 -179
  147. package/dist/reporters/json.js.map +1 -1
  148. package/dist/reporters/junit.d.ts +7 -1
  149. package/dist/reporters/junit.d.ts.map +1 -1
  150. package/dist/reporters/junit.js +90 -95
  151. package/dist/reporters/junit.js.map +1 -1
  152. package/dist/sdk/lh-trace-processor.d.ts +35 -9
  153. package/dist/sdk/lh-trace-processor.d.ts.map +1 -1
  154. package/dist/sdk/lh-trace-processor.js +114 -53
  155. package/dist/sdk/lh-trace-processor.js.map +1 -1
  156. package/dist/sdk/trace-metrics.d.ts +4 -4
  157. package/dist/sdk/trace-metrics.d.ts.map +1 -1
  158. package/dist/sdk/trace-metrics.js +3 -4
  159. package/dist/sdk/trace-metrics.js.map +1 -1
  160. package/dist/sdk/trace-processor.d.ts +11 -3
  161. package/dist/sdk/trace-processor.d.ts.map +1 -1
  162. package/dist/sdk/trace-processor.js +17 -9
  163. package/dist/sdk/trace-processor.js.map +1 -1
  164. package/package.json +39 -24
  165. package/src/cli.ts +219 -151
  166. package/src/common_types.ts +192 -31
  167. package/src/config.ts +3 -6
  168. package/src/core/expect.ts +58 -24
  169. package/src/core/gatherer.ts +59 -24
  170. package/src/core/index.ts +36 -15
  171. package/src/core/logger.ts +1 -12
  172. package/src/core/runner.ts +151 -136
  173. package/src/core/transform.ts +160 -0
  174. package/src/dsl/journey.ts +39 -6
  175. package/src/dsl/monitor.ts +140 -0
  176. package/src/dsl/step.ts +9 -2
  177. package/src/formatter/javascript.ts +367 -0
  178. package/src/generator/index.ts +308 -0
  179. package/src/generator/utils.ts +84 -0
  180. package/src/helpers.ts +159 -13
  181. package/src/index.ts +22 -22
  182. package/src/loader.ts +167 -0
  183. package/src/locations/index.ts +95 -0
  184. package/src/{reporters/reporter.ts → locations/public-locations.ts} +12 -9
  185. package/src/options.ts +227 -0
  186. package/src/plugins/browser-console.ts +30 -8
  187. package/src/plugins/network.ts +208 -267
  188. package/src/plugins/performance.ts +6 -22
  189. package/src/plugins/plugin-manager.ts +49 -31
  190. package/src/plugins/tracing.ts +8 -9
  191. package/src/push/bundler.ts +112 -0
  192. package/src/push/index.ts +282 -0
  193. package/src/push/kibana_api.ts +191 -0
  194. package/src/push/monitor.ts +276 -0
  195. package/src/push/plugin.ts +66 -0
  196. package/src/push/request.ts +141 -0
  197. package/src/push/utils.ts +77 -0
  198. package/src/reporters/base.ts +63 -52
  199. package/src/reporters/index.ts +26 -3
  200. package/src/reporters/json.ts +188 -202
  201. package/src/reporters/junit.ts +98 -93
  202. package/src/sdk/lh-trace-processor.ts +132 -68
  203. package/src/sdk/trace-metrics.ts +8 -4
  204. package/src/sdk/trace-processor.ts +28 -13
  205. package/templates/.github/workflows/run-synthetics.yml +27 -0
  206. package/templates/README.md +21 -0
  207. package/templates/journeys/advanced-example-helpers.ts +54 -0
  208. package/templates/journeys/advanced-example.journey.ts +43 -0
  209. package/templates/journeys/example.journey.ts +18 -0
  210. package/templates/lightweight/heartbeat.yml +7 -0
  211. package/templates/synthetics.config.ts +35 -0
  212. package/CHANGELOG.md +0 -131
  213. package/NOTICE.txt +0 -221
  214. package/dist/parse_args.d.ts.map +0 -1
  215. package/dist/parse_args.js +0 -95
  216. package/dist/parse_args.js.map +0 -1
  217. package/dist/reporters/reporter.d.ts.map +0 -1
  218. package/dist/reporters/reporter.js.map +0 -1
  219. package/dist/tsconfig.tsbuildinfo +0 -1888
  220. package/src/parse_args.ts +0 -135
@@ -0,0 +1,56 @@
1
+ /**
2
+ * MIT License
3
+ *
4
+ * Copyright (c) 2020-present, Elastic NV
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in
14
+ * all copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
+ * THE SOFTWARE.
23
+ *
24
+ */
25
+ import { PushOptions } from '../common_types';
26
+ import { MonitorHashID, MonitorSchema } from './monitor';
27
+ import { APIMonitorError } from './request';
28
+ export declare const CHUNK_SIZE = 100;
29
+ export declare type PutResponse = {
30
+ createdMonitors: string[];
31
+ updatedMonitors: string[];
32
+ failedMonitors: APIMonitorError[];
33
+ };
34
+ export declare function bulkPutMonitors(options: PushOptions, schemas: MonitorSchema[]): Promise<PutResponse>;
35
+ export declare type GetResponse = {
36
+ total: number;
37
+ monitors: MonitorHashID[];
38
+ after_key?: string;
39
+ };
40
+ export declare function bulkGetMonitors(options: PushOptions): Promise<GetResponse>;
41
+ export declare type DeleteResponse = {
42
+ deleted_monitors: string[];
43
+ };
44
+ export declare function bulkDeleteMonitors(options: PushOptions, monitorIDs: string[]): Promise<DeleteResponse>;
45
+ export declare function getVersion(options: PushOptions): Promise<number>;
46
+ export declare type LegacyAPISchema = {
47
+ project: string;
48
+ keep_stale: boolean;
49
+ monitors: MonitorSchema[];
50
+ };
51
+ export declare function createMonitorsLegacy({ schemas, keepStale, options, }: {
52
+ schemas: MonitorSchema[];
53
+ keepStale: boolean;
54
+ options: PushOptions;
55
+ }): Promise<void>;
56
+ //# sourceMappingURL=kibana_api.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kibana_api.d.ts","sourceRoot":"","sources":["../../src/push/kibana_api.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AACzD,OAAO,EAML,eAAe,EAChB,MAAM,WAAW,CAAC;AAInB,eAAO,MAAM,UAAU,MAAM,CAAC;AAE9B,oBAAY,WAAW,GAAG;IACxB,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,cAAc,EAAE,eAAe,EAAE,CAAC;CACnC,CAAC;AAEF,wBAAsB,eAAe,CACnC,OAAO,EAAE,WAAW,EACpB,OAAO,EAAE,aAAa,EAAE,wBAazB;AAED,oBAAY,WAAW,GAAG;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,wBAAsB,eAAe,CACnC,OAAO,EAAE,WAAW,GACnB,OAAO,CAAC,WAAW,CAAC,CAkBtB;AAmBD,oBAAY,cAAc,GAAG;IAC3B,gBAAgB,EAAE,MAAM,EAAE,CAAC;CAC5B,CAAC;AAEF,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,WAAW,EACpB,UAAU,EAAE,MAAM,EAAE,2BAQrB;AAQD,wBAAsB,UAAU,CAAC,OAAO,EAAE,WAAW,mBAOpD;AAED,oBAAY,eAAe,GAAG;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,aAAa,EAAE,CAAC;CAC3B,CAAC;AAEF,wBAAsB,oBAAoB,CAAC,EACzC,OAAO,EACP,SAAS,EACT,OAAO,GACR,EAAE;IACD,OAAO,EAAE,aAAa,EAAE,CAAC;IACzB,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,WAAW,CAAC;CACtB,iBAoCA"}
@@ -0,0 +1,135 @@
1
+ "use strict";
2
+ /**
3
+ * MIT License
4
+ *
5
+ * Copyright (c) 2020-present, Elastic NV
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in
15
+ * all copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ * THE SOFTWARE.
24
+ *
25
+ */
26
+ Object.defineProperty(exports, "__esModule", { value: true });
27
+ exports.createMonitorsLegacy = exports.getVersion = exports.bulkDeleteMonitors = exports.bulkGetMonitors = exports.bulkPutMonitors = exports.CHUNK_SIZE = void 0;
28
+ const helpers_1 = require("../helpers");
29
+ const request_1 = require("./request");
30
+ const utils_1 = require("./utils");
31
+ // Default chunk size for bulk put / delete
32
+ exports.CHUNK_SIZE = 100;
33
+ async function bulkPutMonitors(options, schemas) {
34
+ const resp = await (0, request_1.sendReqAndHandleError)({
35
+ url: (0, utils_1.generateURL)(options, 'bulk_update') + '/_bulk_update',
36
+ method: 'PUT',
37
+ auth: options.auth,
38
+ body: JSON.stringify({ monitors: schemas }),
39
+ });
40
+ const { failedMonitors } = resp;
41
+ if (failedMonitors && failedMonitors.length > 0) {
42
+ throw (0, request_1.formatFailedMonitors)(failedMonitors);
43
+ }
44
+ return resp;
45
+ }
46
+ exports.bulkPutMonitors = bulkPutMonitors;
47
+ async function bulkGetMonitors(options) {
48
+ const allMonitors = [];
49
+ const resp = await fetchMonitors(options);
50
+ allMonitors.push(...resp.monitors);
51
+ let afterKey = resp.afterKey;
52
+ const total = resp.total;
53
+ while (allMonitors.length < total) {
54
+ const resp = await fetchMonitors(options, afterKey);
55
+ allMonitors.push(...resp.monitors);
56
+ afterKey = resp.afterKey;
57
+ }
58
+ return {
59
+ total,
60
+ monitors: allMonitors,
61
+ };
62
+ }
63
+ exports.bulkGetMonitors = bulkGetMonitors;
64
+ const fetchMonitors = async (options, afterKey) => {
65
+ let url = (0, utils_1.generateURL)(options, 'bulk_get');
66
+ if (afterKey) {
67
+ url += `?search_after=${afterKey}`;
68
+ }
69
+ const resp = await (0, request_1.sendReqAndHandleError)({
70
+ url,
71
+ method: 'GET',
72
+ auth: options.auth,
73
+ });
74
+ return {
75
+ afterKey: resp.after_key,
76
+ total: resp.total,
77
+ monitors: resp.monitors,
78
+ };
79
+ };
80
+ async function bulkDeleteMonitors(options, monitorIDs) {
81
+ return await (0, request_1.sendReqAndHandleError)({
82
+ url: (0, utils_1.generateURL)(options, 'bulk_delete') + '/_bulk_delete',
83
+ method: 'DELETE',
84
+ auth: options.auth,
85
+ body: JSON.stringify({ monitors: monitorIDs }),
86
+ });
87
+ }
88
+ exports.bulkDeleteMonitors = bulkDeleteMonitors;
89
+ async function getVersion(options) {
90
+ const data = await (0, request_1.sendReqAndHandleError)({
91
+ url: (0, utils_1.generateURL)(options, 'status'),
92
+ method: 'GET',
93
+ auth: options.auth,
94
+ });
95
+ return data.version.number;
96
+ }
97
+ exports.getVersion = getVersion;
98
+ async function createMonitorsLegacy({ schemas, keepStale, options, }) {
99
+ const schema = {
100
+ project: options.id,
101
+ keep_stale: keepStale,
102
+ monitors: schemas,
103
+ };
104
+ const url = (0, utils_1.generateURL)(options, 'legacy');
105
+ const { body, statusCode } = await (0, request_1.sendRequest)({
106
+ url,
107
+ method: 'PUT',
108
+ auth: options.auth,
109
+ body: JSON.stringify(schema),
110
+ });
111
+ const resBody = await (0, request_1.handleError)(statusCode, url, body);
112
+ const allchunks = [];
113
+ for await (const data of resBody) {
114
+ allchunks.push(Buffer.from(data));
115
+ }
116
+ const chunks = (0, helpers_1.safeNDJSONParse)(Buffer.concat(allchunks).toString('utf-8'));
117
+ // Its kind of hacky for now where Kibana streams the response by
118
+ // writing the data as NDJSON events (data can be interleaved), we
119
+ // distinguish the final data by checking if the event was a progress vs complete event
120
+ for (const chunk of chunks) {
121
+ if (typeof chunk === 'string') {
122
+ // Ignore the progress from Kibana as we chunk the requests
123
+ continue;
124
+ }
125
+ const { failedMonitors, failedStaleMonitors } = chunk;
126
+ if (failedMonitors && failedMonitors.length > 0) {
127
+ throw (0, request_1.formatFailedMonitors)(failedMonitors);
128
+ }
129
+ if (failedStaleMonitors.length > 0) {
130
+ throw (0, request_1.formatStaleMonitors)(failedStaleMonitors);
131
+ }
132
+ }
133
+ }
134
+ exports.createMonitorsLegacy = createMonitorsLegacy;
135
+ //# sourceMappingURL=kibana_api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kibana_api.js","sourceRoot":"","sources":["../../src/push/kibana_api.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;;;AAGH,wCAA6C;AAE7C,uCAOmB;AACnB,mCAAsC;AAEtC,2CAA2C;AAC9B,QAAA,UAAU,GAAG,GAAG,CAAC;AAQvB,KAAK,UAAU,eAAe,CACnC,OAAoB,EACpB,OAAwB;IAExB,MAAM,IAAI,GAAG,MAAM,IAAA,+BAAqB,EAAc;QACpD,GAAG,EAAE,IAAA,mBAAW,EAAC,OAAO,EAAE,aAAa,CAAC,GAAG,eAAe;QAC1D,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC;KAC5C,CAAC,CAAC;IACH,MAAM,EAAE,cAAc,EAAE,GAAG,IAAI,CAAC;IAChC,IAAI,cAAc,IAAI,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE;QAC/C,MAAM,IAAA,8BAAoB,EAAC,cAAc,CAAC,CAAC;KAC5C;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAfD,0CAeC;AAQM,KAAK,UAAU,eAAe,CACnC,OAAoB;IAEpB,MAAM,WAAW,GAAoB,EAAE,CAAC;IAExC,MAAM,IAAI,GAAG,MAAM,aAAa,CAAC,OAAO,CAAC,CAAC;IAC1C,WAAW,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC;IACnC,IAAI,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;IAC7B,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;IAEzB,OAAO,WAAW,CAAC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EAAE;YAC7B,2DAA2D;YAC3D,SAAS;SACV;QACD,MAAM,EAAE,cAAc,EAAE,mBAAmB,EAAE,GAAG,KAAK,CAAC;QACtD,IAAI,cAAc,IAAI,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE;YAC/C,MAAM,IAAA,8BAAoB,EAAC,cAAc,CAAC,CAAC;SAC5C;QACD,IAAI,mBAAmB,CAAC,MAAM,GAAG,CAAC,EAAE;YAClC,MAAM,IAAA,6BAAmB,EAAC,mBAAmB,CAAC,CAAC;SAChD;KACF;AACH,CAAC;AA5CD,oDA4CC"}
@@ -0,0 +1,51 @@
1
+ /**
2
+ * MIT License
3
+ *
4
+ * Copyright (c) 2020-present, Elastic NV
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in
14
+ * all copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
+ * THE SOFTWARE.
23
+ *
24
+ */
25
+ import { Monitor, MonitorConfig } from '../dsl/monitor';
26
+ import { PushOptions } from '../common_types';
27
+ export declare type MonitorSchema = Omit<MonitorConfig, 'locations'> & {
28
+ locations: string[];
29
+ content?: string;
30
+ filter?: Monitor['filter'];
31
+ hash?: string;
32
+ };
33
+ export declare type MonitorHashID = {
34
+ journey_id?: string;
35
+ hash?: string;
36
+ };
37
+ declare class RemoteDiffResult {
38
+ newIDs: Set<string>;
39
+ changedIDs: Set<string>;
40
+ removedIDs: Set<string>;
41
+ unchangedIDs: Set<string>;
42
+ }
43
+ export declare function diffMonitors(local: MonitorHashID[], remote: MonitorHashID[]): RemoteDiffResult;
44
+ export declare function getLocalMonitors(monitors: Monitor[]): MonitorHashID[];
45
+ export declare function buildMonitorSchema(monitors: Monitor[], isV2: boolean): Promise<MonitorSchema[]>;
46
+ export declare function createLightweightMonitors(workDir: string, options: PushOptions): Promise<Monitor[]>;
47
+ export declare function buildMonitorFromYaml(config: MonitorConfig, options: PushOptions): Monitor;
48
+ export declare function parseSchedule(schedule: string): 1 | 3 | 5 | 10 | 15 | 30 | 60;
49
+ export declare function nearestSchedule(schedule: number): 1 | 3 | 5 | 10 | 15 | 30 | 60;
50
+ export {};
51
+ //# sourceMappingURL=monitor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"monitor.d.ts","sourceRoot":"","sources":["../../src/push/monitor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AASH,OAAO,EAAqB,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,oBAAY,aAAa,GAAG,IAAI,CAAC,aAAa,EAAE,WAAW,CAAC,GAAG;IAC7D,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAIF,oBAAY,aAAa,GAAG;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAOF,cAAM,gBAAgB;IAEpB,MAAM,cAAqB;IAE3B,UAAU,cAAqB;IAE/B,UAAU,cAAqB;IAE/B,YAAY,cAAqB;CAClC;AAED,wBAAgB,YAAY,CAC1B,KAAK,EAAE,aAAa,EAAE,EACtB,MAAM,EAAE,aAAa,EAAE,GACtB,gBAAgB,CAiClB;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,OAAO,EAAE,mBASnD;AAED,wBAAsB,kBAAkB,CAAC,QAAQ,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,4BA6B1E;AAED,wBAAsB,yBAAyB,CAC7C,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,WAAW,sBAuDrB;AAGD,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE,WAAW,WAmBrB;AAED,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,iCA4B7C;AAID,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,iCAe/C"}
@@ -0,0 +1,244 @@
1
+ "use strict";
2
+ /**
3
+ * MIT License
4
+ *
5
+ * Copyright (c) 2020-present, Elastic NV
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in
15
+ * all copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ * THE SOFTWARE.
24
+ *
25
+ */
26
+ Object.defineProperty(exports, "__esModule", { value: true });
27
+ exports.nearestSchedule = exports.parseSchedule = exports.buildMonitorFromYaml = exports.createLightweightMonitors = exports.buildMonitorSchema = exports.getLocalMonitors = exports.diffMonitors = void 0;
28
+ const promises_1 = require("fs/promises");
29
+ const path_1 = require("path");
30
+ const yaml_1 = require("yaml");
31
+ const colors_1 = require("kleur/colors");
32
+ const bundler_1 = require("./bundler");
33
+ const helpers_1 = require("../helpers");
34
+ const public_locations_1 = require("../locations/public-locations");
35
+ const monitor_1 = require("../dsl/monitor");
36
+ function translateLocation(locations) {
37
+ if (!locations)
38
+ return [];
39
+ return locations.map(loc => public_locations_1.LocationsMap[loc] || loc).filter(Boolean);
40
+ }
41
+ class RemoteDiffResult {
42
+ // The set of monitor IDs that have been added
43
+ newIDs = new Set();
44
+ // Monitor IDs that are different locally than remotely
45
+ changedIDs = new Set();
46
+ // Monitor IDs that are no longer present locally
47
+ removedIDs = new Set();
48
+ // Monitor IDs that are identical on the remote server
49
+ unchangedIDs = new Set();
50
+ }
51
+ function diffMonitors(local, remote) {
52
+ const result = new RemoteDiffResult();
53
+ const localMonitorsIDToHash = new Map();
54
+ for (const hashID of local) {
55
+ localMonitorsIDToHash.set(hashID.journey_id, hashID.hash);
56
+ }
57
+ const remoteMonitorsIDToHash = new Map();
58
+ for (const hashID of remote) {
59
+ remoteMonitorsIDToHash.set(hashID.journey_id, hashID.hash);
60
+ }
61
+ // Compare local to remote
62
+ for (const [localID, localHash] of localMonitorsIDToHash) {
63
+ // Hash is reset to '' when a monitor is edited on the UI
64
+ if (!remoteMonitorsIDToHash.has(localID)) {
65
+ result.newIDs.add(localID);
66
+ }
67
+ else {
68
+ const remoteHash = remoteMonitorsIDToHash.get(localID);
69
+ if (remoteHash != localHash) {
70
+ result.changedIDs.add(localID);
71
+ }
72
+ else if (remoteHash === localHash) {
73
+ result.unchangedIDs.add(localID);
74
+ }
75
+ }
76
+ // We no longer need to process this ID, removing it here
77
+ // reduces the numbers considered in the next phase
78
+ remoteMonitorsIDToHash.delete(localID);
79
+ }
80
+ for (const [id] of remoteMonitorsIDToHash) {
81
+ result.removedIDs.add(id);
82
+ }
83
+ return result;
84
+ }
85
+ exports.diffMonitors = diffMonitors;
86
+ function getLocalMonitors(monitors) {
87
+ const data = [];
88
+ for (const monitor of monitors) {
89
+ data.push({
90
+ journey_id: monitor.config.id,
91
+ hash: monitor.hash(),
92
+ });
93
+ }
94
+ return data;
95
+ }
96
+ exports.getLocalMonitors = getLocalMonitors;
97
+ async function buildMonitorSchema(monitors, isV2) {
98
+ /**
99
+ * Set up the bundle artifacts path which can be used to
100
+ * create the bundles required for uploading journeys
101
+ */
102
+ const bundlePath = (0, path_1.join)(helpers_1.SYNTHETICS_PATH, 'bundles');
103
+ await (0, promises_1.mkdir)(bundlePath, { recursive: true });
104
+ const bundler = new bundler_1.Bundler();
105
+ const schemas = [];
106
+ for (const monitor of monitors) {
107
+ const { source, config, filter, type } = monitor;
108
+ const schema = {
109
+ ...config,
110
+ locations: translateLocation(config.locations),
111
+ };
112
+ if (isV2) {
113
+ schema.hash = monitor.hash();
114
+ }
115
+ if (type === 'browser') {
116
+ const outPath = (0, path_1.join)(bundlePath, config.name + '.zip');
117
+ const content = await bundler.build(source.file, outPath);
118
+ Object.assign(schema, { content, filter });
119
+ }
120
+ schemas.push(schema);
121
+ }
122
+ await (0, promises_1.rm)(bundlePath, { recursive: true });
123
+ return schemas;
124
+ }
125
+ exports.buildMonitorSchema = buildMonitorSchema;
126
+ async function createLightweightMonitors(workDir, options) {
127
+ const lwFiles = new Set();
128
+ await (0, helpers_1.totalist)(workDir, (rel, abs) => {
129
+ if (/.(yml|yaml)$/.test(rel)) {
130
+ lwFiles.add(abs);
131
+ }
132
+ });
133
+ let warnOnce = false;
134
+ const monitors = [];
135
+ for (const file of lwFiles.values()) {
136
+ const content = await (0, promises_1.readFile)(file, 'utf-8');
137
+ const lineCounter = new yaml_1.LineCounter();
138
+ const parsedDoc = (0, yaml_1.parseDocument)(content, {
139
+ lineCounter,
140
+ keepSourceTokens: true,
141
+ });
142
+ // Skip other yml files that are not relevant
143
+ const monitorSeq = parsedDoc.get('heartbeat.monitors');
144
+ if (!monitorSeq) {
145
+ continue;
146
+ }
147
+ // Warn users about schedule that are less than 60 seconds
148
+ if (!warnOnce) {
149
+ (0, helpers_1.warn)('If you are using lightweight monitors with less than 1 minute resolution, these will be saved to the nearest supported frequency');
150
+ warnOnce = true;
151
+ }
152
+ for (const monNode of monitorSeq.items) {
153
+ // Skip browser monitors and disabled monitors from pushing
154
+ if (monNode.get('type') === 'browser' ||
155
+ monNode.get('enabled') === false) {
156
+ continue;
157
+ }
158
+ const config = monNode.toJSON();
159
+ const { line, col } = lineCounter.linePos(monNode.srcToken.offset);
160
+ try {
161
+ const mon = buildMonitorFromYaml(config, options);
162
+ mon.setSource({ file, line, column: col });
163
+ monitors.push(mon);
164
+ }
165
+ catch (e) {
166
+ let outer = (0, colors_1.bold)(`Aborted: ${e}\n`);
167
+ outer += (0, helpers_1.indent)(`* ${config.id || config.name} - ${file}:${line}:${col}\n`);
168
+ throw (0, colors_1.red)(outer);
169
+ }
170
+ }
171
+ }
172
+ return monitors;
173
+ }
174
+ exports.createLightweightMonitors = createLightweightMonitors;
175
+ const REQUIRED_MONITOR_FIELDS = ['id', 'name'];
176
+ function buildMonitorFromYaml(config, options) {
177
+ // Validate required fields
178
+ for (const field of REQUIRED_MONITOR_FIELDS) {
179
+ if (!config[field]) {
180
+ throw `Monitor ${field} is required`;
181
+ }
182
+ }
183
+ const schedule = config.schedule && parseSchedule(String(config.schedule));
184
+ const privateLocations = config['private_locations'] || options.privateLocations;
185
+ delete config['private_locations'];
186
+ return new monitor_1.Monitor({
187
+ locations: options.locations,
188
+ ...config,
189
+ privateLocations,
190
+ schedule: schedule || options.schedule,
191
+ });
192
+ }
193
+ exports.buildMonitorFromYaml = buildMonitorFromYaml;
194
+ function parseSchedule(schedule) {
195
+ const EVERY_SYNTAX = '@every';
196
+ if (!(schedule + '').startsWith(EVERY_SYNTAX)) {
197
+ throw `Monitor schedule format(${schedule}) not supported: use '@every' syntax instead`;
198
+ }
199
+ const duration = schedule.substring(EVERY_SYNTAX.length + 1);
200
+ // split between non-digit (\D) and a digit (\d)
201
+ const durations = duration.split(/(?<=\D)(?=\d)/g);
202
+ let minutes = 0;
203
+ for (const dur of durations) {
204
+ // split between a digit and non-digit
205
+ const [value, format] = dur.split(/(?<=\d)(?=\D)/g);
206
+ // Calculate based on the duration symbol
207
+ const scheduleValue = parseInt(value, 10);
208
+ switch (format) {
209
+ case 's':
210
+ minutes += Math.ceil(scheduleValue / 60);
211
+ break;
212
+ case 'm':
213
+ minutes += scheduleValue;
214
+ break;
215
+ case 'h':
216
+ minutes += scheduleValue * 60;
217
+ break;
218
+ }
219
+ }
220
+ return nearestSchedule(minutes);
221
+ }
222
+ exports.parseSchedule = parseSchedule;
223
+ // Find the nearest schedule that is supported by the platform
224
+ // from the parsed schedule value
225
+ function nearestSchedule(schedule) {
226
+ let start = 0;
227
+ let end = monitor_1.ALLOWED_SCHEDULES.length - 1;
228
+ while (start <= end) {
229
+ const mid = Math.floor((start + end) / 2);
230
+ const midValue = monitor_1.ALLOWED_SCHEDULES[mid];
231
+ if (midValue === schedule) {
232
+ return midValue;
233
+ }
234
+ else if (midValue < schedule) {
235
+ start = mid + 1;
236
+ }
237
+ else {
238
+ end = mid - 1;
239
+ }
240
+ }
241
+ return monitor_1.ALLOWED_SCHEDULES[end];
242
+ }
243
+ exports.nearestSchedule = nearestSchedule;
244
+ //# sourceMappingURL=monitor.js.map
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GAAG,CAAC,CAAC;QACxC,IAAI,QAAQ,KAAK,QAAQ,EAAE;YACzB,OAAO,QAAQ,CAAC;SACjB;aAAM,IAAI,QAAQ,GAAG,QAAQ,EAAE;YAC9B,KAAK,GAAG,GAAG,GAAG,CAAC,CAAC;SACjB;aAAM;YACL,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC;SACf;KACF;IACD,OAAO,2BAAiB,CAAC,GAAG,CAAC,CAAC;AAChC,CAAC;AAfD,0CAeC"}
@@ -22,9 +22,12 @@
22
22
  * THE SOFTWARE.
23
23
  *
24
24
  */
25
- import { CliArgs } from './common_types';
26
- declare const command: import("commander").Command;
27
- declare const options: CliArgs;
28
- export { options };
29
- export default command;
30
- //# sourceMappingURL=parse_args.d.ts.map
25
+ import * as esbuild from 'esbuild';
26
+ /**
27
+ * Esbuild Plugin to create separate bundles for all the journeys.
28
+ * Treats journeys as the entry point and bundles all the dependencies
29
+ * including the node_modules and ignores bundling the synthetics package
30
+ * when imported externally or from source.
31
+ */
32
+ export declare function SyntheticsBundlePlugin(): esbuild.Plugin;
33
+ //# sourceMappingURL=plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/push/plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAGH,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AAenC;;;;;GAKG;AACH,wBAAgB,sBAAsB,IAAI,OAAO,CAAC,MAAM,CAkBvD"}
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+ /**
3
+ * MIT License
4
+ *
5
+ * Copyright (c) 2020-present, Elastic NV
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in
15
+ * all copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ * THE SOFTWARE.
24
+ *
25
+ */
26
+ Object.defineProperty(exports, "__esModule", { value: true });
27
+ exports.SyntheticsBundlePlugin = void 0;
28
+ const path_1 = require("path");
29
+ // Source of the package - /src, /dist, etc.
30
+ const SOURCE_DIR = (0, path_1.join)(__dirname, '..');
31
+ /**
32
+ * Avoid importing @elastic/synthetics package from source, this avoids
33
+ * bundling the synthetics package in tests or when resolved using
34
+ * absolute paths.
35
+ * ex: import {journey} from "../../"
36
+ */
37
+ const isLocalSynthetics = (resolvedPath) => {
38
+ return resolvedPath.startsWith(SOURCE_DIR);
39
+ };
40
+ /**
41
+ * Esbuild Plugin to create separate bundles for all the journeys.
42
+ * Treats journeys as the entry point and bundles all the dependencies
43
+ * including the node_modules and ignores bundling the synthetics package
44
+ * when imported externally or from source.
45
+ */
46
+ function SyntheticsBundlePlugin() {
47
+ return {
48
+ name: 'synthetics-bundle-plugin',
49
+ setup(build) {
50
+ build.onResolve({ filter: /.*?/ }, async (args) => {
51
+ // Ignore entry points as these refer to the journey files
52
+ if (args.kind === 'entry-point') {
53
+ return;
54
+ }
55
+ const resolvedPath = (0, path_1.join)(args.resolveDir, args.path);
56
+ if (isLocalSynthetics(resolvedPath)) {
57
+ return { external: true };
58
+ }
59
+ // Allow esbuild to resolve the module
60
+ return;
61
+ });
62
+ },
63
+ };
64
+ }
65
+ exports.SyntheticsBundlePlugin = SyntheticsBundlePlugin;
66
+ //# sourceMappingURL=plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../src/push/plugin.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;;;AAEH,+BAA4B;AAG5B,4CAA4C;AAC5C,MAAM,UAAU,GAAG,IAAA,WAAI,EAAC,SAAS,EAAE,IAAI,CAAC,CAAC;AAEzC;;;;;GAKG;AACH,MAAM,iBAAiB,GAAG,CAAC,YAAoB,EAAE,EAAE;IACjD,OAAO,YAAY,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;AAC7C,CAAC,CAAC;AAEF;;;;;GAKG;AACH,SAAgB,sBAAsB;IACpC,OAAO;QACL,IAAI,EAAE,0BAA0B;QAChC,KAAK,CAAC,KAAK;YACT,KAAK,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,KAAK,EAAC,IAAI,EAAC,EAAE;gBAC9C,0DAA0D;gBAC1D,IAAI,IAAI,CAAC,IAAI,KAAK,aAAa,EAAE;oBAC/B,OAAO;iBACR;gBACD,MAAM,YAAY,GAAG,IAAA,WAAI,EAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;gBACtD,IAAI,iBAAiB,CAAC,YAAY,CAAC,EAAE;oBACnC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;iBAC3B;gBACD,sCAAsC;gBACtC,OAAO;YACT,CAAC,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC;AAlBD,wDAkBC"}
@@ -0,0 +1,45 @@
1
+ /**
2
+ * MIT License
3
+ *
4
+ * Copyright (c) 2020-present, Elastic NV
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in
14
+ * all copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
+ * THE SOFTWARE.
23
+ *
24
+ */
25
+ import type { Dispatcher } from 'undici';
26
+ export declare type APIRequestOptions = {
27
+ url: string;
28
+ method: Dispatcher.HttpMethod;
29
+ auth: string;
30
+ body?: string;
31
+ };
32
+ export declare function sendRequest(options: APIRequestOptions): Promise<Dispatcher.ResponseData>;
33
+ export declare function sendReqAndHandleError<T>(options: APIRequestOptions): Promise<T>;
34
+ export declare function handleError(statusCode: number, url: string, body: Dispatcher.ResponseData['body']): Promise<Dispatcher.ResponseData['body']>;
35
+ export declare function ok(statusCode: number): boolean;
36
+ export declare type APIMonitorError = {
37
+ id?: string;
38
+ reason: string;
39
+ details: string;
40
+ };
41
+ export declare function formatNotFoundError(url: string, message: string): string;
42
+ export declare function formatAPIError(statuCode: number, error: string, message: string): string;
43
+ export declare function formatFailedMonitors(errors: APIMonitorError[]): string;
44
+ export declare function formatStaleMonitors(errors: APIMonitorError[]): string;
45
+ //# sourceMappingURL=request.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../src/push/request.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAOzC,oBAAY,iBAAiB,GAAG;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,UAAU,CAAC,UAAU,CAAC;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,wBAAsB,WAAW,CAAC,OAAO,EAAE,iBAAiB,oCAY3D;AAED,wBAAsB,qBAAqB,CAAC,CAAC,EAC3C,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,CAAC,CAAC,CAGZ;AAKD,wBAAsB,WAAW,CAC/B,UAAU,EAAE,MAAM,EAClB,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,UAAU,CAAC,YAAY,CAAC,MAAM,CAAC,GACpC,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAkB1C;AAED,wBAAgB,EAAE,CAAC,UAAU,EAAE,MAAM,WAEpC;AAED,oBAAY,eAAe,GAAG;IAC5B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,UAM/D;AAED,wBAAgB,cAAc,CAC5B,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,UAShB;AAcD,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,eAAe,EAAE,UAG7D;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,eAAe,EAAE,UAG5D"}