checkly 8.17.0-prerelease-b6e0d74 → 8.17.1

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.
@@ -1,4 +1,63 @@
1
+ import { expr, ident, object } from '../sourcegen/index.js';
1
2
  import { unsupportedAssertionSource, valueForGeneralAssertion, valueForNumericAssertion } from './internal/assertion-codegen.js';
3
+ import { grpcHealthStatusTargetByLabel } from './grpc-assertion.js';
4
+ // Reverse of grpcHealthStatusTargetByLabel: numeric wire target -> friendly label.
5
+ // Derived from the shared map so the label↔number mapping lives in one place.
6
+ const grpcHealthStatusLabelByTarget = Object.fromEntries(Object.entries(grpcHealthStatusTargetByLabel).map(([label, target]) => [target, label]));
7
+ function isGrpcHealthStatusLabel(value) {
8
+ return Object.hasOwn(grpcHealthStatusTargetByLabel, value);
9
+ }
10
+ // Resolves a stored target to the label the builder's (narrowed) `equals`/`notEquals`
11
+ // parameter type accepts — either the label for a known number, or the target itself
12
+ // when it is already a valid label (a legacy/hand-written check may store one).
13
+ // Returns undefined for anything else (out-of-range number, empty, garbage), since a
14
+ // builder call for those would not compile against the narrowed builder type.
15
+ function grpcHealthStatusLabelForTarget(target) {
16
+ return grpcHealthStatusLabelByTarget[target] ?? (isGrpcHealthStatusLabel(target) ? target : undefined);
17
+ }
18
+ // Emits `GrpcAssertionBuilder.healthCheckStatus().equals('SERVING')`, reverse-mapping
19
+ // the numeric wire target back to its label. When the stored target maps to neither
20
+ // a known number nor a valid label (out-of-range, empty, or otherwise unmappable), a
21
+ // builder call would not type-check against the narrowed builder parameter type, so
22
+ // the raw `Assertion` object-literal shape is emitted instead — which the `Assertion`
23
+ // type accepts as a plain string and faithfully round-trips the stored value.
24
+ function valueForGrpcHealthCheckStatusAssertion(assertion) {
25
+ const label = grpcHealthStatusLabelForTarget(assertion.target);
26
+ if (label === undefined) {
27
+ return object(builder => {
28
+ builder.string('source', assertion.source);
29
+ builder.string('comparison', assertion.comparison);
30
+ builder.string('target', assertion.target);
31
+ builder.string('property', assertion.property);
32
+ if (assertion.regex === null) {
33
+ builder.null('regex');
34
+ }
35
+ else {
36
+ builder.string('regex', assertion.regex);
37
+ }
38
+ });
39
+ }
40
+ return expr(ident('GrpcAssertionBuilder'), builder => {
41
+ builder.member(ident('healthCheckStatus'));
42
+ builder.call(() => { });
43
+ switch (assertion.comparison) {
44
+ case 'EQUALS':
45
+ builder.member(ident('equals'));
46
+ builder.call(builder => {
47
+ builder.string(label);
48
+ });
49
+ break;
50
+ case 'NOT_EQUALS':
51
+ builder.member(ident('notEquals'));
52
+ builder.call(builder => {
53
+ builder.string(label);
54
+ });
55
+ break;
56
+ default:
57
+ throw new Error(`Unsupported comparison ${assertion.comparison} for assertion source ${assertion.source}`);
58
+ }
59
+ });
60
+ }
2
61
  export function valueForGrpcAssertion(genfile, assertion) {
3
62
  genfile.namedImport('GrpcAssertionBuilder', 'checkly/constructs');
4
63
  switch (assertion.source) {
@@ -7,10 +66,7 @@ export function valueForGrpcAssertion(genfile, assertion) {
7
66
  case 'GRPC_STATUS_CODE':
8
67
  return valueForNumericAssertion('GrpcAssertionBuilder', 'statusCode', assertion);
9
68
  case 'GRPC_HEALTHCHECK_STATUS':
10
- return valueForGeneralAssertion('GrpcAssertionBuilder', 'healthCheckStatus', assertion, {
11
- hasProperty: false,
12
- hasRegex: false,
13
- });
69
+ return valueForGrpcHealthCheckStatusAssertion(assertion);
14
70
  case 'GRPC_RESPONSE':
15
71
  return valueForGeneralAssertion('GrpcAssertionBuilder', 'responseMessage', assertion, {
16
72
  hasProperty: true,
@@ -1 +1 @@
1
- {"version":3,"file":"grpc-assertion-codegen.js","sourceRoot":"","sources":["../../src/constructs/grpc-assertion-codegen.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,0BAA0B,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAA;AAGhI,MAAM,UAAU,qBAAqB,CAAE,OAAsB,EAAE,SAAwB;IACrF,OAAO,CAAC,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;IAEjE,QAAQ,SAAS,CAAC,MAAM,EAAE,CAAC;QACzB,KAAK,eAAe;YAClB,OAAO,wBAAwB,CAAC,sBAAsB,EAAE,cAAc,EAAE,SAAS,CAAC,CAAA;QACpF,KAAK,kBAAkB;YACrB,OAAO,wBAAwB,CAAC,sBAAsB,EAAE,YAAY,EAAE,SAAS,CAAC,CAAA;QAClF,KAAK,yBAAyB;YAC5B,OAAO,sCAAsC,CAAC,SAAS,CAAC,CAAA;QAC1D,KAAK,eAAe;YAClB,OAAO,wBAAwB,CAAC,sBAAsB,EAAE,iBAAiB,EAAE,SAAS,EAAE;gBACpF,WAAW,EAAE,IAAI;gBACjB,QAAQ,EAAE,KAAK;aAChB,CAAC,CAAA;QACJ,KAAK,WAAW;YACd,OAAO,wBAAwB,CAAC,sBAAsB,EAAE,UAAU,EAAE,SAAS,EAAE;gBAC7E,WAAW,EAAE,IAAI;gBACjB,QAAQ,EAAE,KAAK;aAChB,CAAC,CAAA;QACJ,KAAK,eAAe;YAClB,OAAO,wBAAwB,CAAC,sBAAsB,EAAE,kBAAkB,EAAE,SAAS,EAAE;gBACrF,WAAW,EAAE,IAAI;gBACjB,QAAQ,EAAE,KAAK;aAChB,CAAC,CAAA;QACJ;YACE,OAAO,0BAA0B,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC/D,CAAC;AACH,CAAC"}
@@ -1,4 +1,10 @@
1
+ import { grpcHealthStatusTargetByLabel } from './grpc-assertion.js';
1
2
  import { addAssertionDiagnostic, quotedKeys } from './internal/assertion-validation.js';
3
+ // The gRPC runner evaluates health-check status numerically (it parses `target`
4
+ // with `Atoi`), so the only valid wire targets are the numeric serving-status
5
+ // values. A label like "SERVING" — or garbage — sent as a raw target can never
6
+ // pass. The GrpcAssertionBuilder emits these numbers; object-literal users bypass it.
7
+ const grpcHealthStatusTargets = Object.fromEntries(Object.values(grpcHealthStatusTargetByLabel).map(target => [target, true]));
2
8
  // Keyed by the source union so a member added to GrpcAssertion['source'] without a
3
9
  // matching entry here is a compile-time error.
4
10
  const assertionSources = {
@@ -49,5 +55,15 @@ export function validateGrpcAssertion(diagnostics, assertion, index) {
49
55
  + `${assertion.comparison === '' ? '(none)' : `"${assertion.comparison}"`}. `
50
56
  + `Expected one of ${quotedKeys(assertionComparisons)}.`);
51
57
  }
58
+ // The runner evaluates health-check status numerically, so a non-numeric target
59
+ // (e.g. the label "SERVING", written directly on an object literal) can never
60
+ // pass. Use GrpcAssertionBuilder.healthCheckStatus() to emit the numeric value.
61
+ if (assertion.source === 'GRPC_HEALTHCHECK_STATUS'
62
+ && !Object.hasOwn(grpcHealthStatusTargets, assertion.target)) {
63
+ addAssertionDiagnostic(diagnostics, `The assertion at "${location}" has an invalid health-check status target `
64
+ + `${assertion.target === '' ? '(none)' : `"${assertion.target}"`}. `
65
+ + `Expected a numeric serving-status value: one of ${quotedKeys(grpcHealthStatusTargets)}. `
66
+ + `Use GrpcAssertionBuilder.healthCheckStatus().equals('SERVING') to emit it from a label.`);
67
+ }
52
68
  }
53
69
  //# sourceMappingURL=grpc-assertion-validation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"grpc-assertion-validation.js","sourceRoot":"","sources":["../../src/constructs/grpc-assertion-validation.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAA;AAEvF,mFAAmF;AACnF,+CAA+C;AAC/C,MAAM,gBAAgB,GAA0C;IAC9D,aAAa,EAAE,IAAI;IACnB,aAAa,EAAE,IAAI;IACnB,SAAS,EAAE,IAAI;IACf,aAAa,EAAE,IAAI;IACnB,uBAAuB,EAAE,IAAI;IAC7B,gBAAgB,EAAE,IAAI;CACvB,CAAA;AAED,kFAAkF;AAClF,0EAA0E;AAC1E,6EAA6E;AAC7E,MAAM,oBAAoB,GAAyB;IACjD,MAAM,EAAE,IAAI;IACZ,UAAU,EAAE,IAAI;IAChB,OAAO,EAAE,IAAI;IACb,WAAW,EAAE,IAAI;IACjB,SAAS,EAAE,IAAI;IACf,aAAa,EAAE,IAAI;IACnB,QAAQ,EAAE,IAAI;IACd,SAAS,EAAE,IAAI;IACf,YAAY,EAAE,IAAI;IAClB,SAAS,EAAE,IAAI;IACf,QAAQ,EAAE,IAAI;IACd,YAAY,EAAE,IAAI;IAClB,OAAO,EAAE,IAAI;IACb,QAAQ,EAAE,IAAI;CACf,CAAA;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,qBAAqB,CACnC,WAAwB,EACxB,SAAwB,EACxB,KAAa;IAEb,MAAM,QAAQ,GAAG,sBAAsB,KAAK,GAAG,CAAA;IAE/C,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,gBAAgB,EAAE,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC;QACvD,sBAAsB,CAAC,WAAW,EAChC,qBAAqB,QAAQ,4BAA4B,SAAS,CAAC,MAAM,KAAK;cAC5E,mBAAmB,UAAU,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAA;IACzD,CAAC;IAED,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,oBAAoB,EAAE,SAAS,CAAC,UAAU,CAAC,EAAE,CAAC;QAC/D,sBAAsB,CAAC,WAAW,EAChC,qBAAqB,QAAQ,kCAAkC;cAC7D,GAAG,SAAS,CAAC,UAAU,KAAK,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,SAAS,CAAC,UAAU,GAAG,IAAI;cAC3E,mBAAmB,UAAU,CAAC,oBAAoB,CAAC,GAAG,CAAC,CAAA;IAC7D,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"grpc-assertion-validation.js","sourceRoot":"","sources":["../../src/constructs/grpc-assertion-validation.ts"],"names":[],"mappings":"AACA,OAAO,EAAiB,6BAA6B,EAAE,MAAM,qBAAqB,CAAA;AAClF,OAAO,EAAE,sBAAsB,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAA;AAEvF,gFAAgF;AAChF,8EAA8E;AA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AAI,CAAC,MAAM,CAAC,MAAM,CAAC,oBAAoB,EAAE,SAAS,CAAC,UAAU,CAAC,EAAE,CAAC;QAC/D,sBAAsB,CAAC,WAAW,EAChC,qBAAqB,QAAQ,kCAAkC;cAC7D,GAAG,SAAS,CAAC,UAAU,KAAK,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,SAAS,CAAC,UAAU,GAAG,IAAI;cAC3E,mBAAmB,UAAU,CAAC,oBAAoB,CAAC,GAAG,CAAC,CAAA;IAC7D,CAAC;IAED,gFAAgF;IAChF,8EAA8E;IAC9E,gFAAgF;IAChF,IAAI,SAAS,CAAC,MAAM,KAAK,yBAAyB;WAC7C,CAAC,MAAM,CAAC,MAAM,CAAC,uBAAuB,EAAE,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC;QAC/D,sBAAsB,CAAC,WAAW,EAChC,qBAAqB,QAAQ,8CAA8C;cACzE,GAAG,SAAS,CAAC,MAAM,KAAK,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,SAAS,CAAC,MAAM,GAAG,IAAI;cACnE,mDAAmD,UAAU,CAAC,uBAAuB,CAAC,IAAI;cAC1F,yFAAyF,CAAC,CAAA;IAChG,CAAC;AACH,CAAC"}
@@ -1,6 +1,38 @@
1
1
  import { Assertion as CoreAssertion, NumericAssertionBuilder, GeneralAssertionBuilder } from './internal/assertion.js';
2
2
  type GrpcAssertionSource = 'RESPONSE_TIME' | 'GRPC_STATUS_CODE' | 'GRPC_HEALTHCHECK_STATUS' | 'GRPC_RESPONSE' | 'TEXT_BODY' | 'GRPC_METADATA';
3
3
  export type GrpcAssertion = CoreAssertion<GrpcAssertionSource>;
4
+ /**
5
+ * Health-check serving-status labels for use with
6
+ * {@link GrpcAssertionBuilder.healthCheckStatus}. These are the labels of the
7
+ * `grpc.health.v1.HealthCheckResponse.ServingStatus` enum.
8
+ *
9
+ * @example
10
+ * ```typescript
11
+ * GrpcAssertionBuilder.healthCheckStatus().equals('SERVING')
12
+ * ```
13
+ */
14
+ export type GrpcHealthStatus = 'UNKNOWN' | 'SERVING' | 'NOT_SERVING' | 'SERVICE_UNKNOWN';
15
+ /**
16
+ * Maps each {@link GrpcHealthStatus} label to the numeric wire target the gRPC
17
+ * runner evaluates health-check status against (it parses `target` with `Atoi`).
18
+ * These are the `grpc.health.v1.HealthCheckResponse.ServingStatus` enum values:
19
+ * 0 = UNKNOWN, 1 = SERVING, 2 = NOT_SERVING, 3 = SERVICE_UNKNOWN.
20
+ *
21
+ * This is the single source of truth for the label↔number mapping — the codegen
22
+ * reverse-maps through it rather than duplicating the literals.
23
+ */
24
+ export declare const grpcHealthStatusTargetByLabel: Record<GrpcHealthStatus, string>;
25
+ type GrpcHealthStatusTarget = GrpcHealthStatus | 0 | 1 | 2 | 3;
26
+ /**
27
+ * Assertion builder for the gRPC health-check serving status. The runner evaluates
28
+ * the status numerically, so `.equals()`/`.notEquals()` accept a friendly label
29
+ * (or the raw enum number) and emit the numeric wire target. Only EQUALS and
30
+ * NOT_EQUALS are supported — the runner rejects other comparisons for this source.
31
+ */
32
+ declare class HealthCheckStatusAssertionBuilder {
33
+ equals(target: GrpcHealthStatusTarget): GrpcAssertion;
34
+ notEquals(target: GrpcHealthStatusTarget): GrpcAssertion;
35
+ }
4
36
  /**
5
37
  * Builder class for creating gRPC monitor assertions.
6
38
  * Provides methods to create assertions for gRPC call responses.
@@ -36,9 +68,12 @@ export declare class GrpcAssertionBuilder {
36
68
  static statusCode(): NumericAssertionBuilder<GrpcAssertionSource, string>;
37
69
  /**
38
70
  * Creates an assertion builder for the gRPC health-check status (HEALTH mode).
39
- * @returns A general assertion builder for the health-check status.
71
+ * `.equals()`/`.notEquals()` accept a friendly {@link GrpcHealthStatus} label
72
+ * (e.g. `'SERVING'`) — or the raw enum number `0`–`3` — and emit the numeric
73
+ * serving-status value the runner evaluates.
74
+ * @returns An assertion builder for the health-check status.
40
75
  */
41
- static healthCheckStatus(): GeneralAssertionBuilder<GrpcAssertionSource, string | number | boolean>;
76
+ static healthCheckStatus(): HealthCheckStatusAssertionBuilder;
42
77
  /**
43
78
  * Creates an assertion builder for the gRPC response message (BEHAVIOR mode).
44
79
  * @param property Optional JSON path to a specific property (e.g., '$.status').
@@ -1,4 +1,40 @@
1
- import { NumericAssertionBuilder, GeneralAssertionBuilder } from './internal/assertion.js';
1
+ import { NumericAssertionBuilder, GeneralAssertionBuilder, toAssertion } from './internal/assertion.js';
2
+ /**
3
+ * Maps each {@link GrpcHealthStatus} label to the numeric wire target the gRPC
4
+ * runner evaluates health-check status against (it parses `target` with `Atoi`).
5
+ * These are the `grpc.health.v1.HealthCheckResponse.ServingStatus` enum values:
6
+ * 0 = UNKNOWN, 1 = SERVING, 2 = NOT_SERVING, 3 = SERVICE_UNKNOWN.
7
+ *
8
+ * This is the single source of truth for the label↔number mapping — the codegen
9
+ * reverse-maps through it rather than duplicating the literals.
10
+ */
11
+ export const grpcHealthStatusTargetByLabel = {
12
+ UNKNOWN: '0',
13
+ SERVING: '1',
14
+ NOT_SERVING: '2',
15
+ SERVICE_UNKNOWN: '3',
16
+ };
17
+ function grpcHealthStatusWireTarget(target) {
18
+ // Types keep TS callers to a known label or number, but a JS caller can bypass
19
+ // them with an invalid string (e.g. lowercase 'serving'). Falling back to the
20
+ // raw value — mirroring the webapp's `?? assertion.target` — preserves it so it
21
+ // still surfaces (rather than as an empty string) in the validation diagnostic.
22
+ return typeof target === 'number' ? target.toString() : grpcHealthStatusTargetByLabel[target] ?? String(target);
23
+ }
24
+ /**
25
+ * Assertion builder for the gRPC health-check serving status. The runner evaluates
26
+ * the status numerically, so `.equals()`/`.notEquals()` accept a friendly label
27
+ * (or the raw enum number) and emit the numeric wire target. Only EQUALS and
28
+ * NOT_EQUALS are supported — the runner rejects other comparisons for this source.
29
+ */
30
+ class HealthCheckStatusAssertionBuilder {
31
+ equals(target) {
32
+ return toAssertion('GRPC_HEALTHCHECK_STATUS', 'EQUALS', grpcHealthStatusWireTarget(target));
33
+ }
34
+ notEquals(target) {
35
+ return toAssertion('GRPC_HEALTHCHECK_STATUS', 'NOT_EQUALS', grpcHealthStatusWireTarget(target));
36
+ }
37
+ }
2
38
  /**
3
39
  * Builder class for creating gRPC monitor assertions.
4
40
  * Provides methods to create assertions for gRPC call responses.
@@ -38,10 +74,13 @@ export class GrpcAssertionBuilder {
38
74
  }
39
75
  /**
40
76
  * Creates an assertion builder for the gRPC health-check status (HEALTH mode).
41
- * @returns A general assertion builder for the health-check status.
77
+ * `.equals()`/`.notEquals()` accept a friendly {@link GrpcHealthStatus} label
78
+ * (e.g. `'SERVING'`) — or the raw enum number `0`–`3` — and emit the numeric
79
+ * serving-status value the runner evaluates.
80
+ * @returns An assertion builder for the health-check status.
42
81
  */
43
82
  static healthCheckStatus() {
44
- return new GeneralAssertionBuilder('GRPC_HEALTHCHECK_STATUS');
83
+ return new HealthCheckStatusAssertionBuilder();
45
84
  }
46
85
  /**
47
86
  * Creates an assertion builder for the gRPC response message (BEHAVIOR mode).
@@ -1 +1 @@
1
- {"version":3,"file":"grpc-assertion.js","sourceRoot":"","sources":["../../src/constructs/grpc-assertion.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8B,uBAAuB,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAA;AAYtH;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,OAAO,oBAAoB;IAC/B;;;OAGG;IACH,MAAM,CAAC,YAAY;QACjB,OAAO,IAAI,uBAAuB,CAAsB,eAAe,CAAC,CAAA;IAC1E,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,UAAU;QACf,OAAO,IAAI,uBAAuB,CAAsB,kBAAkB,CAAC,CAAA;IAC7E,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,iBAAiB;QACtB,OAAO,IAAI,uBAAuB,CAAsB,yBAAyB,CAAC,CAAA;IACpF,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,eAAe,CAAE,QAAiB;QACvC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AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,OAAO,oBAAoB;IAC/B;;;OAGG;IACH,MAAM,CAAC,YAAY;QACjB,OAAO,IAAI,uBAAuB,CAAsB,eAAe,CAAC,CAAA;IAC1E,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,UAAU;QACf,OAAO,IAAI,uBAAuB,CAAsB,kBAAkB,CAAC,CAAA;IAC7E,CAAC;IAED;;;;;;OAMG;IACH,MAAM,CAAC,iBAAiB;QACtB,OAAO,IAAI,iCAAiC,EAAE,CAAA;IAChD,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,eAAe,CAAE,QAAiB;QACvC,OAAO,IAAI,uBAAuB,CAAsB,eAAe,EAAE,QAAQ,CAAC,CAAA;IACpF,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,QAAQ,CAAE,QAAiB;QAChC,OAAO,IAAI,uBAAuB,CAAsB,WAAW,EAAE,QAAQ,CAAC,CAAA;IAChF,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,gBAAgB,CAAE,QAAiB;QACxC,OAAO,IAAI,uBAAuB,CAAsB,eAAe,EAAE,QAAQ,CAAC,CAAA;IACpF,CAAC;CACF"}
@@ -21,9 +21,6 @@ export function valueForGrpcRequest(program, genfile, context, request) {
21
21
  if (config.tls !== undefined) {
22
22
  builder.boolean('tls', config.tls);
23
23
  }
24
- if (config.storeResponseBody !== undefined) {
25
- builder.boolean('storeResponseBody', config.storeResponseBody);
26
- }
27
24
  if (config.serviceDefinition) {
28
25
  builder.string('serviceDefinition', config.serviceDefinition);
29
26
  }
@@ -1 +1 @@
1
- {"version":3,"file":"grpc-request-codegen.js","sourceRoot":"","sources":["../../src/constructs/grpc-request-codegen.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,MAAM,EAAkB,MAAM,uBAAuB,CAAA;AAC7E,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAA;AAInE,MAAM,UAAU,mBAAmB,CACjC,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CAAC,UAAU,EAAE,OAAO,CAAC,EAAE;wBAClC,KAAK,MAAM,KAAK,IAAI,QAAQ,EAAE,CAAC;4BAC7B,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE;gCACvB,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAA;gCAChC,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,CAAA;4BACtC,CAAC,CAAC,CAAA;wBACJ,CAAC;oBACH,CAAC,CAAC,CAAA;gBACJ,CAAC;YACH,CAAC;QACH,CAAC,CAAC,CAAA;QAEF,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;YACvB,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAA;YACrC,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAC1B,OAAO,CAAC,KAAK,CAAC,YAAY,EAAE,OAAO,CAAC,EAAE;oBACpC,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;wBACnC,OAAO,CAAC,KAAK,CAAC,qBAAqB,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC,CAAA;oBAC1D,CAAC;gBACH,CAAC,CAAC,CAAA;YACJ,CAAC;QACH,CAAC;IACH,CAAC,CAAC,CAAA;AACJ,CAAC"}
@@ -45,12 +45,6 @@ export interface GrpcConfig {
45
45
  * @defaultValue true
46
46
  */
47
47
  tls?: boolean;
48
- /**
49
- * Whether to store the gRPC response body with the check result.
50
- *
51
- * @defaultValue true
52
- */
53
- storeResponseBody?: boolean;
54
48
  /**
55
49
  * gRPC metadata (request headers) sent with the call.
56
50
  */
@@ -2488,251 +2488,6 @@
2488
2488
  "update.js"
2489
2489
  ]
2490
2490
  },
2491
- "import:apply": {
2492
- "aliases": [],
2493
- "args": {},
2494
- "description": "Attach imported resources into your project in a pending state.",
2495
- "flags": {
2496
- "config": {
2497
- "char": "c",
2498
- "description": "The Checkly CLI configuration file. If not passed, uses the checkly.config.ts|js file in the current directory.",
2499
- "name": "config",
2500
- "hasDynamicHelp": false,
2501
- "multiple": false,
2502
- "type": "option"
2503
- },
2504
- "plan-id": {
2505
- "description": "Target a specific import plan by ID, skipping interactive plan selection.",
2506
- "name": "plan-id",
2507
- "hasDynamicHelp": false,
2508
- "multiple": false,
2509
- "type": "option"
2510
- },
2511
- "no-commit": {
2512
- "description": "Apply only. Leave the plan pending and skip the commit prompt.",
2513
- "name": "no-commit",
2514
- "allowNo": false,
2515
- "type": "boolean"
2516
- }
2517
- },
2518
- "hasDynamicHelp": false,
2519
- "hidden": false,
2520
- "hiddenAliases": [],
2521
- "id": "import:apply",
2522
- "pluginAlias": "checkly",
2523
- "pluginName": "checkly",
2524
- "pluginType": "core",
2525
- "strict": true,
2526
- "enableJsonFlag": false,
2527
- "coreCommand": false,
2528
- "readOnly": false,
2529
- "destructive": false,
2530
- "idempotent": false,
2531
- "isESM": true,
2532
- "relativePath": [
2533
- "dist",
2534
- "commands",
2535
- "import",
2536
- "apply.js"
2537
- ]
2538
- },
2539
- "import:cancel": {
2540
- "aliases": [],
2541
- "args": {},
2542
- "description": "Cancels an ongoing import plan that has not been committed yet.",
2543
- "flags": {
2544
- "config": {
2545
- "char": "c",
2546
- "description": "The Checkly CLI configuration file. If not passed, uses the checkly.config.ts|js file in the current directory.",
2547
- "name": "config",
2548
- "hasDynamicHelp": false,
2549
- "multiple": false,
2550
- "type": "option"
2551
- },
2552
- "all": {
2553
- "description": "Cancel all plans.",
2554
- "name": "all",
2555
- "allowNo": false,
2556
- "type": "boolean"
2557
- },
2558
- "plan-id": {
2559
- "description": "Target a specific import plan by ID, skipping interactive plan selection.",
2560
- "name": "plan-id",
2561
- "hasDynamicHelp": false,
2562
- "multiple": false,
2563
- "type": "option"
2564
- },
2565
- "force": {
2566
- "char": "f",
2567
- "description": "Skip confirmation prompt.",
2568
- "name": "force",
2569
- "allowNo": false,
2570
- "type": "boolean"
2571
- },
2572
- "dry-run": {
2573
- "description": "Preview what would happen without executing.",
2574
- "name": "dry-run",
2575
- "allowNo": false,
2576
- "type": "boolean"
2577
- }
2578
- },
2579
- "hasDynamicHelp": false,
2580
- "hidden": false,
2581
- "hiddenAliases": [],
2582
- "id": "import:cancel",
2583
- "pluginAlias": "checkly",
2584
- "pluginName": "checkly",
2585
- "pluginType": "core",
2586
- "strict": true,
2587
- "enableJsonFlag": false,
2588
- "coreCommand": false,
2589
- "readOnly": false,
2590
- "destructive": true,
2591
- "idempotent": true,
2592
- "isESM": true,
2593
- "relativePath": [
2594
- "dist",
2595
- "commands",
2596
- "import",
2597
- "cancel.js"
2598
- ]
2599
- },
2600
- "import:commit": {
2601
- "aliases": [],
2602
- "args": {},
2603
- "description": "Permanently commit imported resources into your project.",
2604
- "flags": {
2605
- "config": {
2606
- "char": "c",
2607
- "description": "The Checkly CLI configuration file. If not passed, uses the checkly.config.ts|js file in the current directory.",
2608
- "name": "config",
2609
- "hasDynamicHelp": false,
2610
- "multiple": false,
2611
- "type": "option"
2612
- },
2613
- "plan-id": {
2614
- "description": "Target a specific import plan by ID, skipping interactive plan selection.",
2615
- "name": "plan-id",
2616
- "hasDynamicHelp": false,
2617
- "multiple": false,
2618
- "type": "option"
2619
- },
2620
- "force": {
2621
- "char": "f",
2622
- "description": "Skip confirmation prompt.",
2623
- "name": "force",
2624
- "allowNo": false,
2625
- "type": "boolean"
2626
- },
2627
- "dry-run": {
2628
- "description": "Preview what would happen without executing.",
2629
- "name": "dry-run",
2630
- "allowNo": false,
2631
- "type": "boolean"
2632
- }
2633
- },
2634
- "hasDynamicHelp": false,
2635
- "hidden": false,
2636
- "hiddenAliases": [],
2637
- "id": "import:commit",
2638
- "pluginAlias": "checkly",
2639
- "pluginName": "checkly",
2640
- "pluginType": "core",
2641
- "strict": true,
2642
- "enableJsonFlag": false,
2643
- "coreCommand": false,
2644
- "readOnly": false,
2645
- "destructive": false,
2646
- "idempotent": false,
2647
- "isESM": true,
2648
- "relativePath": [
2649
- "dist",
2650
- "commands",
2651
- "import",
2652
- "commit.js"
2653
- ]
2654
- },
2655
- "import:plan": {
2656
- "aliases": [],
2657
- "args": {
2658
- "resource": {
2659
- "description": "A specific resource to import.",
2660
- "name": "resource",
2661
- "required": false
2662
- }
2663
- },
2664
- "description": "Import existing resources from your Checkly account to your project.\n\nBy default, all resources that can be imported will be imported. However, you\nmay fine-tune the process by including or excluding any combination of\nresources.\n\nThe import process consists of three steps:\n\n1. Creating a plan, which generates the appropriate code for your resources\n2. Applying the plan, which links your resources to the generated code\n3. Committing the plan, which finalizes the import session\n\nCREATING A PLAN\n\nCreating a plan carries no risk as no concrete links to your Checkly resources\nare made at this point. However, if you accidentally deploy the generated code\nbefore applying the plan, you will end up with duplicate resources and will\nnot be able to complete the import session without first deleting the\nduplicates.\n\nFor the curious, you may also preview the generated code with the '--preview'\noption. No plan will be created, allowing you to leisurely inspect the\ngenerated code. However keep in mind that you will need to create a plan to\nactually import any resources, at which point the code will be generated\nagain.\n\nYou may cancel any plan you've created without affecting any of the\nunderlying resources.\n\nAPPLYING A PLAN\n\nApplying a plan links your existing resources to the generated code. You\nshould carefully review the generated code to make sure that it contains the\nresources you expect before applying a plan. After a plan has been applied,\nany deployments of those resources will irreversibly modify the underlying\nCheckly resources. However, as a fail safe against concurrent use, any\ndeployments not including the imported resources will not delete the\nunderlying resources (or the links to the resources). This means that there\nis no need to block deployments while working on an import session.\n\nEven after you've applied a plan, you may still cancel it, which will unlink\nthe underlying resources from your project once more. However, keep in mind\nthat any changes to the resources that you've already deployed cannot be\nundone.\n\nCOMMITTING A PLAN\n\nFinally, committing a plan removes all fail safes and permanently links the\nimported resources to your project. Any resources you remove from your code\nwill result in the underlying resources also getting irrevocably deleted on\nthe next deploy. You should only commit your plan once you are sure that all\nfuture deployments include the imported resources.",
2665
- "flags": {
2666
- "config": {
2667
- "char": "c",
2668
- "description": "The Checkly CLI configuration file. If not passed, uses the checkly.config.ts|js file in the current directory.",
2669
- "name": "config",
2670
- "hasDynamicHelp": false,
2671
- "multiple": false,
2672
- "type": "option"
2673
- },
2674
- "root": {
2675
- "description": "The root folder in which to write generated code files.",
2676
- "name": "root",
2677
- "default": "__checks__",
2678
- "hasDynamicHelp": false,
2679
- "multiple": false,
2680
- "type": "option"
2681
- },
2682
- "preview": {
2683
- "description": "Preview generated code without creating an actual import plan.",
2684
- "name": "preview",
2685
- "allowNo": false,
2686
- "type": "boolean"
2687
- },
2688
- "debug-import-plan": {
2689
- "description": "Output the import plan to a file.",
2690
- "hidden": true,
2691
- "name": "debug-import-plan",
2692
- "allowNo": false,
2693
- "type": "boolean"
2694
- },
2695
- "debug-import-plan-input-file": {
2696
- "description": "A file to load an import plan from.",
2697
- "hidden": true,
2698
- "name": "debug-import-plan-input-file",
2699
- "hasDynamicHelp": false,
2700
- "multiple": false,
2701
- "type": "option"
2702
- },
2703
- "debug-import-plan-output-file": {
2704
- "description": "The file to output the import plan to.",
2705
- "hidden": true,
2706
- "name": "debug-import-plan-output-file",
2707
- "default": "./debug-import-plan.json",
2708
- "hasDynamicHelp": false,
2709
- "multiple": false,
2710
- "type": "option"
2711
- }
2712
- },
2713
- "hasDynamicHelp": false,
2714
- "hidden": false,
2715
- "hiddenAliases": [
2716
- "import"
2717
- ],
2718
- "id": "import:plan",
2719
- "pluginAlias": "checkly",
2720
- "pluginName": "checkly",
2721
- "pluginType": "core",
2722
- "strict": false,
2723
- "enableJsonFlag": false,
2724
- "coreCommand": false,
2725
- "readOnly": true,
2726
- "destructive": false,
2727
- "idempotent": true,
2728
- "isESM": true,
2729
- "relativePath": [
2730
- "dist",
2731
- "commands",
2732
- "import",
2733
- "plan.js"
2734
- ]
2735
- },
2736
2491
  "incidents:create": {
2737
2492
  "aliases": [],
2738
2493
  "args": {},
@@ -3464,6 +3219,251 @@
3464
3219
  "install.js"
3465
3220
  ]
3466
3221
  },
3222
+ "import:apply": {
3223
+ "aliases": [],
3224
+ "args": {},
3225
+ "description": "Attach imported resources into your project in a pending state.",
3226
+ "flags": {
3227
+ "config": {
3228
+ "char": "c",
3229
+ "description": "The Checkly CLI configuration file. If not passed, uses the checkly.config.ts|js file in the current directory.",
3230
+ "name": "config",
3231
+ "hasDynamicHelp": false,
3232
+ "multiple": false,
3233
+ "type": "option"
3234
+ },
3235
+ "plan-id": {
3236
+ "description": "Target a specific import plan by ID, skipping interactive plan selection.",
3237
+ "name": "plan-id",
3238
+ "hasDynamicHelp": false,
3239
+ "multiple": false,
3240
+ "type": "option"
3241
+ },
3242
+ "no-commit": {
3243
+ "description": "Apply only. Leave the plan pending and skip the commit prompt.",
3244
+ "name": "no-commit",
3245
+ "allowNo": false,
3246
+ "type": "boolean"
3247
+ }
3248
+ },
3249
+ "hasDynamicHelp": false,
3250
+ "hidden": false,
3251
+ "hiddenAliases": [],
3252
+ "id": "import:apply",
3253
+ "pluginAlias": "checkly",
3254
+ "pluginName": "checkly",
3255
+ "pluginType": "core",
3256
+ "strict": true,
3257
+ "enableJsonFlag": false,
3258
+ "coreCommand": false,
3259
+ "readOnly": false,
3260
+ "destructive": false,
3261
+ "idempotent": false,
3262
+ "isESM": true,
3263
+ "relativePath": [
3264
+ "dist",
3265
+ "commands",
3266
+ "import",
3267
+ "apply.js"
3268
+ ]
3269
+ },
3270
+ "import:cancel": {
3271
+ "aliases": [],
3272
+ "args": {},
3273
+ "description": "Cancels an ongoing import plan that has not been committed yet.",
3274
+ "flags": {
3275
+ "config": {
3276
+ "char": "c",
3277
+ "description": "The Checkly CLI configuration file. If not passed, uses the checkly.config.ts|js file in the current directory.",
3278
+ "name": "config",
3279
+ "hasDynamicHelp": false,
3280
+ "multiple": false,
3281
+ "type": "option"
3282
+ },
3283
+ "all": {
3284
+ "description": "Cancel all plans.",
3285
+ "name": "all",
3286
+ "allowNo": false,
3287
+ "type": "boolean"
3288
+ },
3289
+ "plan-id": {
3290
+ "description": "Target a specific import plan by ID, skipping interactive plan selection.",
3291
+ "name": "plan-id",
3292
+ "hasDynamicHelp": false,
3293
+ "multiple": false,
3294
+ "type": "option"
3295
+ },
3296
+ "force": {
3297
+ "char": "f",
3298
+ "description": "Skip confirmation prompt.",
3299
+ "name": "force",
3300
+ "allowNo": false,
3301
+ "type": "boolean"
3302
+ },
3303
+ "dry-run": {
3304
+ "description": "Preview what would happen without executing.",
3305
+ "name": "dry-run",
3306
+ "allowNo": false,
3307
+ "type": "boolean"
3308
+ }
3309
+ },
3310
+ "hasDynamicHelp": false,
3311
+ "hidden": false,
3312
+ "hiddenAliases": [],
3313
+ "id": "import:cancel",
3314
+ "pluginAlias": "checkly",
3315
+ "pluginName": "checkly",
3316
+ "pluginType": "core",
3317
+ "strict": true,
3318
+ "enableJsonFlag": false,
3319
+ "coreCommand": false,
3320
+ "readOnly": false,
3321
+ "destructive": true,
3322
+ "idempotent": true,
3323
+ "isESM": true,
3324
+ "relativePath": [
3325
+ "dist",
3326
+ "commands",
3327
+ "import",
3328
+ "cancel.js"
3329
+ ]
3330
+ },
3331
+ "import:commit": {
3332
+ "aliases": [],
3333
+ "args": {},
3334
+ "description": "Permanently commit imported resources into your project.",
3335
+ "flags": {
3336
+ "config": {
3337
+ "char": "c",
3338
+ "description": "The Checkly CLI configuration file. If not passed, uses the checkly.config.ts|js file in the current directory.",
3339
+ "name": "config",
3340
+ "hasDynamicHelp": false,
3341
+ "multiple": false,
3342
+ "type": "option"
3343
+ },
3344
+ "plan-id": {
3345
+ "description": "Target a specific import plan by ID, skipping interactive plan selection.",
3346
+ "name": "plan-id",
3347
+ "hasDynamicHelp": false,
3348
+ "multiple": false,
3349
+ "type": "option"
3350
+ },
3351
+ "force": {
3352
+ "char": "f",
3353
+ "description": "Skip confirmation prompt.",
3354
+ "name": "force",
3355
+ "allowNo": false,
3356
+ "type": "boolean"
3357
+ },
3358
+ "dry-run": {
3359
+ "description": "Preview what would happen without executing.",
3360
+ "name": "dry-run",
3361
+ "allowNo": false,
3362
+ "type": "boolean"
3363
+ }
3364
+ },
3365
+ "hasDynamicHelp": false,
3366
+ "hidden": false,
3367
+ "hiddenAliases": [],
3368
+ "id": "import:commit",
3369
+ "pluginAlias": "checkly",
3370
+ "pluginName": "checkly",
3371
+ "pluginType": "core",
3372
+ "strict": true,
3373
+ "enableJsonFlag": false,
3374
+ "coreCommand": false,
3375
+ "readOnly": false,
3376
+ "destructive": false,
3377
+ "idempotent": false,
3378
+ "isESM": true,
3379
+ "relativePath": [
3380
+ "dist",
3381
+ "commands",
3382
+ "import",
3383
+ "commit.js"
3384
+ ]
3385
+ },
3386
+ "import:plan": {
3387
+ "aliases": [],
3388
+ "args": {
3389
+ "resource": {
3390
+ "description": "A specific resource to import.",
3391
+ "name": "resource",
3392
+ "required": false
3393
+ }
3394
+ },
3395
+ "description": "Import existing resources from your Checkly account to your project.\n\nBy default, all resources that can be imported will be imported. However, you\nmay fine-tune the process by including or excluding any combination of\nresources.\n\nThe import process consists of three steps:\n\n1. Creating a plan, which generates the appropriate code for your resources\n2. Applying the plan, which links your resources to the generated code\n3. Committing the plan, which finalizes the import session\n\nCREATING A PLAN\n\nCreating a plan carries no risk as no concrete links to your Checkly resources\nare made at this point. However, if you accidentally deploy the generated code\nbefore applying the plan, you will end up with duplicate resources and will\nnot be able to complete the import session without first deleting the\nduplicates.\n\nFor the curious, you may also preview the generated code with the '--preview'\noption. No plan will be created, allowing you to leisurely inspect the\ngenerated code. However keep in mind that you will need to create a plan to\nactually import any resources, at which point the code will be generated\nagain.\n\nYou may cancel any plan you've created without affecting any of the\nunderlying resources.\n\nAPPLYING A PLAN\n\nApplying a plan links your existing resources to the generated code. You\nshould carefully review the generated code to make sure that it contains the\nresources you expect before applying a plan. After a plan has been applied,\nany deployments of those resources will irreversibly modify the underlying\nCheckly resources. However, as a fail safe against concurrent use, any\ndeployments not including the imported resources will not delete the\nunderlying resources (or the links to the resources). This means that there\nis no need to block deployments while working on an import session.\n\nEven after you've applied a plan, you may still cancel it, which will unlink\nthe underlying resources from your project once more. However, keep in mind\nthat any changes to the resources that you've already deployed cannot be\nundone.\n\nCOMMITTING A PLAN\n\nFinally, committing a plan removes all fail safes and permanently links the\nimported resources to your project. Any resources you remove from your code\nwill result in the underlying resources also getting irrevocably deleted on\nthe next deploy. You should only commit your plan once you are sure that all\nfuture deployments include the imported resources.",
3396
+ "flags": {
3397
+ "config": {
3398
+ "char": "c",
3399
+ "description": "The Checkly CLI configuration file. If not passed, uses the checkly.config.ts|js file in the current directory.",
3400
+ "name": "config",
3401
+ "hasDynamicHelp": false,
3402
+ "multiple": false,
3403
+ "type": "option"
3404
+ },
3405
+ "root": {
3406
+ "description": "The root folder in which to write generated code files.",
3407
+ "name": "root",
3408
+ "default": "__checks__",
3409
+ "hasDynamicHelp": false,
3410
+ "multiple": false,
3411
+ "type": "option"
3412
+ },
3413
+ "preview": {
3414
+ "description": "Preview generated code without creating an actual import plan.",
3415
+ "name": "preview",
3416
+ "allowNo": false,
3417
+ "type": "boolean"
3418
+ },
3419
+ "debug-import-plan": {
3420
+ "description": "Output the import plan to a file.",
3421
+ "hidden": true,
3422
+ "name": "debug-import-plan",
3423
+ "allowNo": false,
3424
+ "type": "boolean"
3425
+ },
3426
+ "debug-import-plan-input-file": {
3427
+ "description": "A file to load an import plan from.",
3428
+ "hidden": true,
3429
+ "name": "debug-import-plan-input-file",
3430
+ "hasDynamicHelp": false,
3431
+ "multiple": false,
3432
+ "type": "option"
3433
+ },
3434
+ "debug-import-plan-output-file": {
3435
+ "description": "The file to output the import plan to.",
3436
+ "hidden": true,
3437
+ "name": "debug-import-plan-output-file",
3438
+ "default": "./debug-import-plan.json",
3439
+ "hasDynamicHelp": false,
3440
+ "multiple": false,
3441
+ "type": "option"
3442
+ }
3443
+ },
3444
+ "hasDynamicHelp": false,
3445
+ "hidden": false,
3446
+ "hiddenAliases": [
3447
+ "import"
3448
+ ],
3449
+ "id": "import:plan",
3450
+ "pluginAlias": "checkly",
3451
+ "pluginName": "checkly",
3452
+ "pluginType": "core",
3453
+ "strict": false,
3454
+ "enableJsonFlag": false,
3455
+ "coreCommand": false,
3456
+ "readOnly": true,
3457
+ "destructive": false,
3458
+ "idempotent": true,
3459
+ "isESM": true,
3460
+ "relativePath": [
3461
+ "dist",
3462
+ "commands",
3463
+ "import",
3464
+ "plan.js"
3465
+ ]
3466
+ },
3467
3467
  "status-pages:get": {
3468
3468
  "aliases": [],
3469
3469
  "args": {
@@ -3782,5 +3782,5 @@
3782
3782
  ]
3783
3783
  }
3784
3784
  },
3785
- "version": "8.17.0-prerelease-b6e0d74"
3785
+ "version": "8.17.1"
3786
3786
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "checkly",
3
- "version": "8.17.0-prerelease-b6e0d74",
3
+ "version": "8.17.1",
4
4
  "type": "module",
5
5
  "description": "Checkly CLI",
6
6
  "main": "dist/index.js",