checkly 0.0.0-pr.1045.fa8b13c → 0.0.0-pr.1045.ff280ee

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 (156) hide show
  1. package/dist/commands/import/plan.d.ts +6 -0
  2. package/dist/commands/import/plan.js +440 -42
  3. package/dist/commands/import/plan.js.map +1 -1
  4. package/dist/constructs/alert-channel-codegen.d.ts +1 -0
  5. package/dist/constructs/alert-channel-codegen.js +17 -5
  6. package/dist/constructs/alert-channel-codegen.js.map +1 -1
  7. package/dist/constructs/alert-channel-subscription-codegen.d.ts +1 -0
  8. package/dist/constructs/alert-channel-subscription-codegen.js +3 -0
  9. package/dist/constructs/alert-channel-subscription-codegen.js.map +1 -1
  10. package/dist/constructs/alert-channel.d.ts +17 -3
  11. package/dist/constructs/alert-channel.js +9 -3
  12. package/dist/constructs/alert-channel.js.map +1 -1
  13. package/dist/constructs/api-check-codegen.d.ts +3 -7
  14. package/dist/constructs/api-check-codegen.js +33 -28
  15. package/dist/constructs/api-check-codegen.js.map +1 -1
  16. package/dist/constructs/browser-check-codegen.d.ts +1 -0
  17. package/dist/constructs/browser-check-codegen.js +9 -0
  18. package/dist/constructs/browser-check-codegen.js.map +1 -1
  19. package/dist/constructs/check-codegen.d.ts +1 -0
  20. package/dist/constructs/check-codegen.js +25 -6
  21. package/dist/constructs/check-codegen.js.map +1 -1
  22. package/dist/constructs/check-group-codegen.d.ts +3 -0
  23. package/dist/constructs/check-group-codegen.js +24 -6
  24. package/dist/constructs/check-group-codegen.js.map +1 -1
  25. package/dist/constructs/check-group.d.ts +19 -6
  26. package/dist/constructs/check-group.js +34 -1
  27. package/dist/constructs/check-group.js.map +1 -1
  28. package/dist/constructs/check.d.ts +8 -8
  29. package/dist/constructs/check.js.map +1 -1
  30. package/dist/constructs/construct-codegen.d.ts +1 -0
  31. package/dist/constructs/construct-codegen.js +7 -0
  32. package/dist/constructs/construct-codegen.js.map +1 -1
  33. package/dist/constructs/dashboard-codegen.d.ts +1 -0
  34. package/dist/constructs/dashboard-codegen.js +6 -0
  35. package/dist/constructs/dashboard-codegen.js.map +1 -1
  36. package/dist/constructs/email-alert-channel-codegen.d.ts +1 -0
  37. package/dist/constructs/email-alert-channel-codegen.js +3 -0
  38. package/dist/constructs/email-alert-channel-codegen.js.map +1 -1
  39. package/dist/constructs/heartbeat-check-codegen.d.ts +1 -0
  40. package/dist/constructs/heartbeat-check-codegen.js +3 -0
  41. package/dist/constructs/heartbeat-check-codegen.js.map +1 -1
  42. package/dist/constructs/incidentio-alert-channel-codegen.d.ts +2 -0
  43. package/dist/constructs/incidentio-alert-channel-codegen.js +33 -0
  44. package/dist/constructs/incidentio-alert-channel-codegen.js.map +1 -1
  45. package/dist/constructs/incidentio-alert-channel.d.ts +6 -0
  46. package/dist/constructs/incidentio-alert-channel.js +17 -16
  47. package/dist/constructs/incidentio-alert-channel.js.map +1 -1
  48. package/dist/constructs/internal/codegen/codegen.d.ts +1 -0
  49. package/dist/constructs/internal/codegen/codegen.js.map +1 -1
  50. package/dist/constructs/internal/codegen/context.d.ts +6 -1
  51. package/dist/constructs/internal/codegen/context.js +34 -1
  52. package/dist/constructs/internal/codegen/context.js.map +1 -1
  53. package/dist/constructs/internal/codegen/index.d.ts +2 -0
  54. package/dist/constructs/internal/codegen/index.js +5 -1
  55. package/dist/constructs/internal/codegen/index.js.map +1 -1
  56. package/dist/constructs/internal/codegen/safety.d.ts +2 -0
  57. package/dist/constructs/internal/codegen/safety.js +7 -0
  58. package/dist/constructs/internal/codegen/safety.js.map +1 -0
  59. package/dist/constructs/internal/codegen/snippet.d.ts +12 -0
  60. package/dist/constructs/internal/codegen/snippet.js +48 -0
  61. package/dist/constructs/internal/codegen/snippet.js.map +1 -0
  62. package/dist/constructs/maintenance-window-codegen.d.ts +1 -0
  63. package/dist/constructs/maintenance-window-codegen.js +3 -0
  64. package/dist/constructs/maintenance-window-codegen.js.map +1 -1
  65. package/dist/constructs/msteams-alert-channel-codegen.d.ts +2 -0
  66. package/dist/constructs/msteams-alert-channel-codegen.js +39 -0
  67. package/dist/constructs/msteams-alert-channel-codegen.js.map +1 -1
  68. package/dist/constructs/msteams-alert-channel.d.ts +6 -0
  69. package/dist/constructs/msteams-alert-channel.js +14 -13
  70. package/dist/constructs/msteams-alert-channel.js.map +1 -1
  71. package/dist/constructs/multi-step-check-codegen.d.ts +1 -0
  72. package/dist/constructs/multi-step-check-codegen.js +3 -0
  73. package/dist/constructs/multi-step-check-codegen.js.map +1 -1
  74. package/dist/constructs/opsgenie-alert-channel-codegen.d.ts +1 -0
  75. package/dist/constructs/opsgenie-alert-channel-codegen.js +3 -0
  76. package/dist/constructs/opsgenie-alert-channel-codegen.js.map +1 -1
  77. package/dist/constructs/pagerduty-alert-channel-codegen.d.ts +1 -0
  78. package/dist/constructs/pagerduty-alert-channel-codegen.js +9 -0
  79. package/dist/constructs/pagerduty-alert-channel-codegen.js.map +1 -1
  80. package/dist/constructs/phone-call-alert-channel-codegen.d.ts +1 -0
  81. package/dist/constructs/phone-call-alert-channel-codegen.js +6 -0
  82. package/dist/constructs/phone-call-alert-channel-codegen.js.map +1 -1
  83. package/dist/constructs/private-location-check-assignment-codegen.d.ts +1 -0
  84. package/dist/constructs/private-location-check-assignment-codegen.js +3 -0
  85. package/dist/constructs/private-location-check-assignment-codegen.js.map +1 -1
  86. package/dist/constructs/private-location-codegen.d.ts +1 -0
  87. package/dist/constructs/private-location-codegen.js +3 -0
  88. package/dist/constructs/private-location-codegen.js.map +1 -1
  89. package/dist/constructs/private-location-group-assignment-codegen.d.ts +1 -0
  90. package/dist/constructs/private-location-group-assignment-codegen.js +3 -0
  91. package/dist/constructs/private-location-group-assignment-codegen.js.map +1 -1
  92. package/dist/constructs/private-location.d.ts +7 -3
  93. package/dist/constructs/private-location.js +9 -3
  94. package/dist/constructs/private-location.js.map +1 -1
  95. package/dist/constructs/project.js +8 -1
  96. package/dist/constructs/project.js.map +1 -1
  97. package/dist/constructs/slack-alert-channel-codegen.d.ts +1 -0
  98. package/dist/constructs/slack-alert-channel-codegen.js +6 -0
  99. package/dist/constructs/slack-alert-channel-codegen.js.map +1 -1
  100. package/dist/constructs/sms-alert-channel-codegen.d.ts +1 -0
  101. package/dist/constructs/sms-alert-channel-codegen.js +6 -0
  102. package/dist/constructs/sms-alert-channel-codegen.js.map +1 -1
  103. package/dist/constructs/status-page-codegen.d.ts +1 -0
  104. package/dist/constructs/status-page-codegen.js +4 -1
  105. package/dist/constructs/status-page-codegen.js.map +1 -1
  106. package/dist/constructs/status-page-service-codegen.d.ts +1 -0
  107. package/dist/constructs/status-page-service-codegen.js +3 -0
  108. package/dist/constructs/status-page-service-codegen.js.map +1 -1
  109. package/dist/constructs/tcp-check-codegen.d.ts +1 -0
  110. package/dist/constructs/tcp-check-codegen.js +3 -0
  111. package/dist/constructs/tcp-check-codegen.js.map +1 -1
  112. package/dist/constructs/telegram-alert-channel-codegen.d.ts +2 -0
  113. package/dist/constructs/telegram-alert-channel-codegen.js +47 -13
  114. package/dist/constructs/telegram-alert-channel-codegen.js.map +1 -1
  115. package/dist/constructs/telegram-alert-channel.d.ts +6 -0
  116. package/dist/constructs/telegram-alert-channel.js +8 -4
  117. package/dist/constructs/telegram-alert-channel.js.map +1 -1
  118. package/dist/constructs/webhook-alert-channel-codegen.d.ts +2 -1
  119. package/dist/constructs/webhook-alert-channel-codegen.js +58 -12
  120. package/dist/constructs/webhook-alert-channel-codegen.js.map +1 -1
  121. package/dist/rest/projects.d.ts +21 -2
  122. package/dist/rest/projects.js +53 -11
  123. package/dist/rest/projects.js.map +1 -1
  124. package/dist/services/check-parser/parser.js +7 -0
  125. package/dist/services/check-parser/parser.js.map +1 -1
  126. package/dist/sourcegen/array.d.ts +1 -0
  127. package/dist/sourcegen/array.js +3 -0
  128. package/dist/sourcegen/array.js.map +1 -1
  129. package/dist/sourcegen/case.d.ts +1 -1
  130. package/dist/sourcegen/case.js +2 -0
  131. package/dist/sourcegen/case.js.map +1 -1
  132. package/dist/sourcegen/comment.d.ts +32 -0
  133. package/dist/sourcegen/comment.js +124 -0
  134. package/dist/sourcegen/comment.js.map +1 -0
  135. package/dist/sourcegen/decl.d.ts +13 -0
  136. package/dist/sourcegen/decl.js +33 -1
  137. package/dist/sourcegen/decl.js.map +1 -1
  138. package/dist/sourcegen/declbuilder.d.ts +3 -0
  139. package/dist/sourcegen/declbuilder.js +8 -0
  140. package/dist/sourcegen/declbuilder.js.map +1 -1
  141. package/dist/sourcegen/index.d.ts +1 -0
  142. package/dist/sourcegen/index.js +10 -1
  143. package/dist/sourcegen/index.js.map +1 -1
  144. package/dist/sourcegen/object.d.ts +1 -0
  145. package/dist/sourcegen/object.js +3 -0
  146. package/dist/sourcegen/object.js.map +1 -1
  147. package/dist/sourcegen/objectbuilder.d.ts +1 -1
  148. package/dist/sourcegen/output.d.ts +4 -1
  149. package/dist/sourcegen/output.js +4 -1
  150. package/dist/sourcegen/output.js.map +1 -1
  151. package/dist/sourcegen/program.d.ts +5 -1
  152. package/dist/sourcegen/program.js +12 -0
  153. package/dist/sourcegen/program.js.map +1 -1
  154. package/dist/tsconfig.tsbuildinfo +1 -1
  155. package/oclif.manifest.json +20 -6
  156. package/package.json +1 -1
@@ -6,8 +6,14 @@ export default class ImportPlanCommand extends AuthCommand {
6
6
  static flags: {
7
7
  config: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
8
8
  root: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
9
+ preview: import("@oclif/core/interfaces").BooleanFlag<boolean>;
9
10
  'debug-import-plan': import("@oclif/core/interfaces").BooleanFlag<boolean>;
10
11
  'debug-import-plan-output-file': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
11
12
  };
13
+ static args: {
14
+ resource: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
15
+ };
16
+ static strict: boolean;
17
+ static hiddenAliases: string[];
12
18
  run(): Promise<void>;
13
19
  }
@@ -32,17 +32,71 @@ const prompts_1 = __importDefault(require("prompts"));
32
32
  const chalk_1 = __importDefault(require("chalk"));
33
33
  const axios_1 = require("axios");
34
34
  const log_symbols_1 = __importDefault(require("log-symbols"));
35
+ const uuid_1 = require("uuid");
35
36
  const api = __importStar(require("../../rest/api"));
36
37
  const authCommand_1 = require("../authCommand");
37
38
  const common_messages_1 = __importDefault(require("../../messages/common-messages"));
38
39
  const util_1 = require("../../services/util");
39
40
  const checkly_config_loader_1 = require("../../services/checkly-config-loader");
41
+ const projects_1 = require("../../rest/projects");
40
42
  const sourcegen_1 = require("../../sourcegen");
41
43
  const construct_codegen_1 = require("../../constructs/construct-codegen");
42
44
  const codegen_1 = require("../../constructs/internal/codegen");
45
+ const snippet_1 = require("../../constructs/internal/codegen/snippet");
43
46
  class ImportPlanCommand extends authCommand_1.AuthCommand {
44
47
  static hidden = false;
45
- static description = 'Begin the import process by creating a plan.';
48
+ static description = `\
49
+ Import existing resources from your Checkly account to your project.
50
+
51
+ By default, all resources that can be imported will be imported. However,
52
+ you may fine-tune the process by including or excluding any combination of
53
+ resources.
54
+
55
+ The import process consists of three steps:
56
+
57
+ 1. Creating a plan, which generates the appropriate code for your resources
58
+ 2. Applying the plan, which links your resources to the generated code
59
+ 3. Committing the plan, which finalizes the import session
60
+
61
+ CREATING A PLAN
62
+
63
+ Creating a plan carries no risk as no concrete links to your Checkly resources
64
+ are made at this point. However, if you accidentally deploy the generated code
65
+ before applying the plan, you will end up with duplicate resources and will not
66
+ be able to complete the import session without first deleting the duplicates.
67
+
68
+ For the curious, you may also preview the generated code with the '--preview'
69
+ option. No plan will be created, allowing you to leisurely inspect the
70
+ generated code. However keep in mind that you will need to create a plan to
71
+ actually import any resources, at which point the code will be generated
72
+ again.
73
+
74
+ You may cancel any plan you've created without affecting any of the underlying
75
+ resources.
76
+
77
+ APPLYING A PLAN
78
+
79
+ Applying a plan links your existing resources to the generated code. You should
80
+ carefully review the generated code to make sure that it contains the resources
81
+ you expect before applying a plan. After a plan has been applied, any
82
+ deployments of those resources will irreversibly modify the underlying Checkly
83
+ resources. However, as a fail safe against concurrent use, any deployments not
84
+ including the imported resources will not delete the underlying resources (or
85
+ the links to the resources). This means that there is no need to block
86
+ deployments while working on an import session.
87
+
88
+ Even after you've applied a plan, you may still cancel it, which will unlink
89
+ the underlying resources from your project once more. However, keep in mind
90
+ that any changes to the resources that you've already deployed cannot be
91
+ undone.
92
+
93
+ COMMITTING A PLAN
94
+
95
+ Finally, committing a plan removes all fail safes and permanently links the
96
+ imported resources to your project. Any resources you remove from your code
97
+ will result in the underlying resources also getting irrevocably deleted on
98
+ the next deploy. You should only commit your plan once you are sure that all
99
+ future deployments include the imported resources.`;
46
100
  static flags = {
47
101
  config: core_1.Flags.string({
48
102
  char: 'c',
@@ -50,7 +104,11 @@ class ImportPlanCommand extends authCommand_1.AuthCommand {
50
104
  }),
51
105
  root: core_1.Flags.string({
52
106
  description: 'The root folder in which to write generated code files.',
53
- default: '.',
107
+ default: '__checks__',
108
+ }),
109
+ preview: core_1.Flags.boolean({
110
+ description: 'Preview generated code without creating an actual import plan.',
111
+ default: false,
54
112
  }),
55
113
  'debug-import-plan': core_1.Flags.boolean({
56
114
  description: 'Output the import plan to a file.',
@@ -63,43 +121,60 @@ class ImportPlanCommand extends authCommand_1.AuthCommand {
63
121
  hidden: true,
64
122
  }),
65
123
  };
124
+ static args = {
125
+ resource: core_1.Args.string({
126
+ name: 'resource',
127
+ required: false,
128
+ description: 'A specific resource to import.',
129
+ }),
130
+ };
131
+ static strict = false;
132
+ static hiddenAliases = [
133
+ 'import',
134
+ ];
66
135
  async run() {
67
- const { flags } = await this.parse(ImportPlanCommand);
68
- const { config: configFilename, root: rootDirectory, 'debug-import-plan': debugImportPlan, 'debug-import-plan-output-file': debugImportPlanOutputFile, } = flags;
136
+ const { flags, argv } = await this.parse(ImportPlanCommand);
137
+ const { config: configFilename, root: rootDirectory, 'debug-import-plan': debugImportPlan, 'debug-import-plan-output-file': debugImportPlanOutputFile, preview, } = flags;
138
+ const filters = argv.map(value => {
139
+ return parseFilter(value);
140
+ });
69
141
  const { configDirectory, configFilenames } = (0, util_1.splitConfigFilePath)(configFilename);
70
142
  const { config: checklyConfig, } = await (0, checkly_config_loader_1.loadChecklyConfig)(configDirectory, configFilenames);
143
+ await this.#initializeProject(checklyConfig);
71
144
  const { logicalId, } = checklyConfig;
72
- const { data: existingPlans } = await api.projects.findImportPlans(logicalId, {
73
- onlyUncommitted: true,
74
- });
75
- if (existingPlans.length !== 0) {
76
- await this.#handleExistingPlans(existingPlans);
77
- }
78
- if (this.fancy) {
79
- core_1.ux.action.start('Creating a new plan', undefined, { stdout: true });
80
- }
81
- let plan;
82
- try {
83
- const { data } = await api.projects.createImportPlan(logicalId);
84
- plan = data;
85
- if (this.fancy) {
86
- core_1.ux.action.stop('✅ ');
145
+ if (!preview) {
146
+ const { data: existingPlans } = await api.projects.findImportPlans(logicalId, {
147
+ onlyUncommitted: true,
148
+ });
149
+ if (existingPlans.length !== 0) {
150
+ await this.#handleExistingPlans(existingPlans);
87
151
  }
88
152
  }
89
- catch (err) {
90
- if (this.fancy) {
91
- core_1.ux.action.stop('❌');
92
- }
93
- if ((0, axios_1.isAxiosError)(err)) {
94
- if (err.response?.status === 404) {
95
- const message = err.response?.data.message;
96
- if (message) {
97
- this.log(chalk_1.default.red(message));
98
- return;
99
- }
100
- }
101
- }
102
- throw err;
153
+ const program = new sourcegen_1.Program({
154
+ rootDirectory,
155
+ constructFileSuffix: '.check',
156
+ constructHeaders: preview ? [previewComment()] : undefined,
157
+ specFileSuffix: '.spec',
158
+ language: 'typescript',
159
+ });
160
+ // If the user provided no filter, ask interactively.
161
+ if (filters.length === 0) {
162
+ filters.push(...await this.#interactiveFilter(logicalId, program));
163
+ }
164
+ // Inject the default filter.
165
+ //
166
+ // By default all resource will be included, unless the user has specified
167
+ // an inclusive filter by themselves, in which case the default filter
168
+ // excludes all resources.
169
+ filters.unshift({
170
+ type: filters.some(({ type }) => type === 'include') ? 'exclude' : 'include',
171
+ });
172
+ const plan = await this.#createImportPlan(logicalId, {
173
+ preview,
174
+ filters,
175
+ });
176
+ if (!plan) {
177
+ return;
103
178
  }
104
179
  if (debugImportPlan) {
105
180
  const output = JSON.stringify(plan, null, 2);
@@ -108,12 +183,6 @@ class ImportPlanCommand extends authCommand_1.AuthCommand {
108
183
  return;
109
184
  }
110
185
  try {
111
- const program = new sourcegen_1.Program({
112
- rootDirectory,
113
- constructFileSuffix: '.check',
114
- specFileSuffix: '.spec',
115
- language: 'typescript',
116
- });
117
186
  this.#generateCode(plan, program);
118
187
  if (this.fancy) {
119
188
  core_1.ux.action.start('Writing files', undefined, { stdout: true });
@@ -148,6 +217,124 @@ class ImportPlanCommand extends authCommand_1.AuthCommand {
148
217
  throw err;
149
218
  }
150
219
  }
220
+ async #createImportPlan(logicalId, options) {
221
+ if (this.fancy) {
222
+ core_1.ux.action.start('Creating a new plan', undefined, { stdout: true });
223
+ }
224
+ try {
225
+ const { data } = await api.projects.createImportPlan(logicalId, options);
226
+ if (this.fancy) {
227
+ core_1.ux.action.stop('✅ ');
228
+ }
229
+ return data;
230
+ }
231
+ catch (err) {
232
+ if (this.fancy) {
233
+ core_1.ux.action.stop('❌');
234
+ }
235
+ if ((0, axios_1.isAxiosError)(err)) {
236
+ if (err.response?.status === 404) {
237
+ const message = err.response?.data.message;
238
+ if (message) {
239
+ this.log(chalk_1.default.red(message));
240
+ return;
241
+ }
242
+ }
243
+ }
244
+ throw err;
245
+ }
246
+ }
247
+ async #interactiveFilter(logicalId, program) {
248
+ const choices = [{
249
+ title: `I want to import everything in one go`,
250
+ value: 'all',
251
+ }, {
252
+ title: `Let me choose resources manually`,
253
+ value: 'choose',
254
+ description: 'You will be presented with options.'
255
+ }, {
256
+ title: 'Cancel and exit',
257
+ value: 'exit',
258
+ description: 'No changes will be made.',
259
+ }];
260
+ const { action } = await (0, prompts_1.default)({
261
+ name: 'action',
262
+ type: 'select',
263
+ message: 'You are about to import resources from your Checkly account. Which resources would you like to import?',
264
+ choices,
265
+ });
266
+ switch (action) {
267
+ case 'all':
268
+ return [];
269
+ case 'choose': {
270
+ const codegen = new construct_codegen_1.ConstructCodegen(program);
271
+ const choices = await (async () => {
272
+ if (this.fancy) {
273
+ core_1.ux.action.start('Fetching available resources', undefined, { stdout: true });
274
+ }
275
+ try {
276
+ const { data } = await api.projects.createImportPlan(logicalId, {
277
+ preview: true,
278
+ filters: [{
279
+ type: 'include',
280
+ }],
281
+ });
282
+ if (this.fancy) {
283
+ core_1.ux.action.stop('✅ ');
284
+ }
285
+ return (data.changes?.resources ?? []).flatMap(resource => {
286
+ if (!isFilterable(resource.type)) {
287
+ return [];
288
+ }
289
+ return [{
290
+ title: codegen.describe(resource),
291
+ value: `${resource.type}:${resource.physicalId}`,
292
+ description: `${resource.type}:${resource.physicalId}`,
293
+ }];
294
+ });
295
+ }
296
+ catch (err) {
297
+ if (this.fancy) {
298
+ core_1.ux.action.stop('❌');
299
+ }
300
+ if ((0, axios_1.isAxiosError)(err)) {
301
+ if (err.response?.status === 404) {
302
+ return [];
303
+ }
304
+ }
305
+ throw err;
306
+ }
307
+ })();
308
+ choices.sort((a, b) => {
309
+ return a.title.localeCompare(b.title);
310
+ });
311
+ const { resources } = await (0, prompts_1.default)({
312
+ name: 'resources',
313
+ type: 'autocompleteMultiselect',
314
+ message: 'Please select the resources you would like to import',
315
+ choices,
316
+ hint: ' - Space to select. Return to submit',
317
+ instructions: false,
318
+ });
319
+ if (resources === undefined) {
320
+ this.log('Exiting without making any changes.');
321
+ this.exit(0);
322
+ }
323
+ if (resources.length === 0) {
324
+ this.log(chalk_1.default.red('You did not choose any resources.'));
325
+ this.log('Exiting without making any changes.');
326
+ this.exit(0);
327
+ }
328
+ return resources.map(parseFilter);
329
+ }
330
+ case 'exit':
331
+ // falls through
332
+ default: {
333
+ this.log('Exiting without making any changes.');
334
+ this.exit(0);
335
+ }
336
+ }
337
+ }
151
338
  #generateCode(plan, program) {
152
339
  if (this.fancy) {
153
340
  core_1.ux.action.start('Generating Checkly constructs for imported resources', undefined, { stdout: true });
@@ -156,8 +343,66 @@ class ImportPlanCommand extends authCommand_1.AuthCommand {
156
343
  const codegen = new construct_codegen_1.ConstructCodegen(program);
157
344
  const context = new codegen_1.Context();
158
345
  if (plan.changes) {
159
- (0, construct_codegen_1.sortResources)(plan.changes.resources);
160
- for (const resource of plan.changes.resources) {
346
+ const { resources, auxiliary } = plan.changes;
347
+ if (auxiliary) {
348
+ const globalSnippetFiles = new Set();
349
+ for (const resource of auxiliary) {
350
+ try {
351
+ switch (resource.type) {
352
+ case 'snippet': {
353
+ const snippet = resource.payload;
354
+ if (!(0, snippet_1.isSnippet)(snippet)) {
355
+ throw new Error(`Invalid auxiliary snippet`);
356
+ }
357
+ const snippetFilePath = context.filePath('snippets', snippet.name, {
358
+ unique: false,
359
+ contentKey: `snippet::${snippet.id}`,
360
+ case: (0, snippet_1.isSafeSnippetFilename)(snippet.name) ? 'identity' : 'kebab-case',
361
+ });
362
+ const snippetFile = program.staticSupportFile(snippetFilePath.fullPath, snippet.script);
363
+ globalSnippetFiles.add(snippetFile);
364
+ context.registerAuxiliarySnippetFile(snippet.id, snippetFile);
365
+ break;
366
+ }
367
+ default:
368
+ throw new Error(`Unable to process unsupported auxiliary resource type '${resource.type}'.`);
369
+ }
370
+ }
371
+ catch (cause) {
372
+ throw new Error(`Failed to process auxiliary resource '${resource.type}:${resource.physicalId}': ${cause}`, { cause });
373
+ }
374
+ }
375
+ // Due to questionable historical design choices, snippets may
376
+ // reference other snippets in two ways:
377
+ //
378
+ // 1. From the same folder (i.e. `require('./other-snippet')`) if
379
+ // the requiring snippet is NOT the main entrypoint, but has
380
+ // itself been required by another snippet or script.
381
+ // 2. From the magic './snippets' folder using
382
+ // `require('./snippets/other-snippet')` irrespective of whether
383
+ // the requiring snippet is the main entrypoint or not (works in
384
+ // either case).
385
+ //
386
+ // To emulate this functionality with a proper file structure, we
387
+ // need to check if any global snippets are using the second method,
388
+ // and create appropriate aliases in the beatifully named
389
+ // './snippets/snippets/' folder so that the paths can resolve
390
+ // without modification.
391
+ for (const globalSnippetFile of globalSnippetFiles) {
392
+ const content = globalSnippetFile.content.toString();
393
+ const snippetFiles = context.findScriptSnippetFiles(content);
394
+ for (const snippetFile of snippetFiles) {
395
+ const localSnippetFile = program.generatedSupportFile(`snippets/snippets/${snippetFile.basename}`);
396
+ localSnippetFile.header((0, sourcegen_1.docComment)(`This file has been generated to help resolve cross-snippet imports.\n` +
397
+ `\n` +
398
+ `We recommend rewriting your imports to not reference this file, after which\n` +
399
+ `you may remove it.`));
400
+ localSnippetFile.plainImport(localSnippetFile.relativePath(snippetFile));
401
+ }
402
+ }
403
+ }
404
+ (0, construct_codegen_1.sortResources)(resources);
405
+ for (const resource of resources) {
161
406
  try {
162
407
  codegen.prepare(resource.logicalId, resource, context);
163
408
  }
@@ -165,7 +410,7 @@ class ImportPlanCommand extends authCommand_1.AuthCommand {
165
410
  throw new Error(`Failed to prepare resource '${resource.type}:${resource.logicalId}': ${cause}`, { cause });
166
411
  }
167
412
  }
168
- for (const resource of plan.changes.resources) {
413
+ for (const resource of resources) {
169
414
  try {
170
415
  codegen.gencode(resource.logicalId, resource, context);
171
416
  }
@@ -185,6 +430,87 @@ class ImportPlanCommand extends authCommand_1.AuthCommand {
185
430
  throw err;
186
431
  }
187
432
  }
433
+ async #initializeProject(config) {
434
+ const { logicalId, projectName, repoUrl, } = config;
435
+ if (this.fancy) {
436
+ core_1.ux.action.start('Checking project status', undefined, { stdout: true });
437
+ }
438
+ try {
439
+ await api.projects.get(logicalId);
440
+ if (this.fancy) {
441
+ core_1.ux.action.stop('✅ ');
442
+ }
443
+ // The project has already been initialized, not need to do anything.
444
+ return;
445
+ }
446
+ catch (err) {
447
+ if (err instanceof projects_1.ProjectNotFoundError) {
448
+ if (this.fancy) {
449
+ core_1.ux.action.stop('❌ Uninitialized project');
450
+ }
451
+ // The project does not exist yet and we must create (initialize) it.
452
+ }
453
+ else {
454
+ if (this.fancy) {
455
+ core_1.ux.action.stop('❌');
456
+ }
457
+ throw err;
458
+ }
459
+ }
460
+ const choices = [{
461
+ title: `Yes, I want to start a new project with the imported resources`,
462
+ value: 'init',
463
+ }, {
464
+ title: `No, I intended to import resources into an existing project`,
465
+ value: 'mistake',
466
+ description: 'Exit and verify your configuration.',
467
+ }, {
468
+ title: 'No, I want to cancel and exit',
469
+ value: 'exit',
470
+ description: 'No changes will be made.',
471
+ }];
472
+ const { action } = await (0, prompts_1.default)({
473
+ name: 'action',
474
+ type: 'select',
475
+ message: 'Your project has not been initialized yet. Initialize now?',
476
+ choices,
477
+ });
478
+ switch (action) {
479
+ case 'init': {
480
+ try {
481
+ if (this.fancy) {
482
+ core_1.ux.action.start('Initializing project', undefined, { stdout: true });
483
+ }
484
+ await api.projects.create({
485
+ name: projectName,
486
+ logicalId,
487
+ repoUrl,
488
+ });
489
+ if (this.fancy) {
490
+ core_1.ux.action.stop('✅ ');
491
+ }
492
+ }
493
+ catch (err) {
494
+ if (this.fancy) {
495
+ core_1.ux.action.stop('❌');
496
+ }
497
+ throw err;
498
+ }
499
+ break;
500
+ }
501
+ case 'mistake':
502
+ this.log(chalk_1.default.red('Please verify your configuration and try again.'));
503
+ this.log('Exiting without making any changes.');
504
+ this.exit(0);
505
+ break;
506
+ case 'exit':
507
+ // falls through
508
+ default: {
509
+ this.log('Exiting without making any changes.');
510
+ this.exit(0);
511
+ }
512
+ }
513
+ }
188
514
  async #handleExistingPlans(plans) {
189
515
  const choices = [{
190
516
  title: 'I want to exit and rethink',
@@ -274,4 +600,76 @@ class ImportPlanCommand extends authCommand_1.AuthCommand {
274
600
  }
275
601
  }
276
602
  exports.default = ImportPlanCommand;
603
+ function previewComment() {
604
+ return (0, sourcegen_1.docComment)('This Checkly construct file has been generated for preview purposes only.' +
605
+ '\n\n' +
606
+ 'Deploying this file will create duplicate resources.');
607
+ }
608
+ class InvalidResourceIdentifierError extends Error {
609
+ }
610
+ function parseFilter(spec) {
611
+ const filter = {
612
+ type: 'include'
613
+ };
614
+ if (spec.startsWith('!')) {
615
+ filter.type = 'exclude';
616
+ spec = spec.slice(1);
617
+ }
618
+ const [type, physicalId] = spec.split(':', 2);
619
+ const parseId = importables[type];
620
+ if (parseId === undefined) {
621
+ throw new Error(`Invalid resource specifier '${spec}': Unsupported resource type '${type}'`);
622
+ }
623
+ try {
624
+ filter.resource = {
625
+ type,
626
+ physicalId: parseId(physicalId),
627
+ };
628
+ }
629
+ catch (err) {
630
+ if (err instanceof InvalidResourceIdentifierError) {
631
+ throw new Error(`Invalid resource specifier '${spec}': ${err.message}`);
632
+ }
633
+ throw err;
634
+ }
635
+ return filter;
636
+ }
637
+ function integerPhysicalId(value) {
638
+ if (value === undefined) {
639
+ return;
640
+ }
641
+ if (value === '' || value === '*') {
642
+ return;
643
+ }
644
+ const numberValue = parseInt(value, 10);
645
+ if (Number.isNaN(numberValue)) {
646
+ throw new InvalidResourceIdentifierError(`Resource identifier '${value}' must be a valid integer`);
647
+ }
648
+ return numberValue;
649
+ }
650
+ function uuidPhysicalId(value) {
651
+ if (value === undefined) {
652
+ return;
653
+ }
654
+ if (value === '' || value === '*') {
655
+ return;
656
+ }
657
+ if (!(0, uuid_1.validate)(value)) {
658
+ throw new InvalidResourceIdentifierError(`Resource identifier '${value}' must be a valid UUID`);
659
+ }
660
+ return value;
661
+ }
662
+ const importables = {
663
+ 'alert-channel': integerPhysicalId,
664
+ 'check-group': integerPhysicalId,
665
+ 'check': uuidPhysicalId,
666
+ 'dashboard': integerPhysicalId,
667
+ 'maintenance-window': integerPhysicalId,
668
+ 'private-location': uuidPhysicalId,
669
+ 'status-page-service': uuidPhysicalId,
670
+ 'status-page': uuidPhysicalId,
671
+ };
672
+ function isFilterable(type) {
673
+ return importables[type] !== undefined;
674
+ }
277
675
  //# sourceMappingURL=plan.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"plan.js","sourceRoot":"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K,KAAK,GAAG,EAAE,CAAC;QAClC,OAAM;IACR,CAAC;IAED,MAAM,WAAW,GAAG,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,CAAA;IACvC,IAAI,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE,CAAC;QAC9B,MAAM,IAAI,8BAA8B,CAAC,wBAAwB,KAAK,2BAA2B,CAAC,CAAA;IACpG,CAAC;IAED,OAAO,WAAW,CAAA;AACpB,CAAC;AAED,SAAS,cAAc,CAAE,KAAyB;IAChD,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,OAAM;IACR,CAAC;IAED,IAAI,KAAK,KAAK,EAAE,IAAI,KAAK,KAAK,GAAG,EAAE,CAAC;QAClC,OAAM;IACR,CAAC;IAED,IAAI,CAAC,IAAA,eAAY,EAAC,KAAK,CAAC,EAAE,CAAC;QACzB,MAAM,IAAI,8BAA8B,CAAC,wBAAwB,KAAK,wBAAwB,CAAC,CAAA;IACjG,CAAC;IAED,OAAO,KAAK,CAAA;AACd,CAAC;AAED,MAAM,WAAW,GAAG;IAClB,eAAe,EAAE,iBAAiB;IAClC,aAAa,EAAE,iBAAiB;IAChC,OAAO,EAAE,cAAc;IACvB,WAAW,EAAE,iBAAiB;IAC9B,oBAAoB,EAAE,iBAAiB;IACvC,kBAAkB,EAAE,cAAc;IAClC,qBAAqB,EAAE,cAAc;IACrC,aAAa,EAAE,cAAc;CAC9B,CAAA;AAED,SAAS,YAAY,CAAE,IAAY;IACjC,OAAO,WAAW,CAAC,IAAgC,CAAC,KAAK,SAAS,CAAA;AACpE,CAAC"}
@@ -29,6 +29,7 @@ export declare class AlertChannelCodegen extends Codegen<AlertChannelResource> {
29
29
  webhookCodegen: WebhookAlertChannelCodegen;
30
30
  codegensByType: Record<AlertChannelType, Codegen<any>>;
31
31
  constructor(program: Program);
32
+ describe(resource: AlertChannelResource): string;
32
33
  prepare(logicalId: string, resource: AlertChannelResource, context: Context): void;
33
34
  gencode(logicalId: string, resource: AlertChannelResource, context: Context): void;
34
35
  }