checkly 8.16.0 → 8.17.1-prerelease-14d5b2d

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 (45) hide show
  1. package/dist/ai-context/context.js +4 -4
  2. package/dist/ai-context/skills-command/references/configure-ssl-monitors.md +4 -4
  3. package/dist/constructs/grpc-assertion-codegen.js +60 -4
  4. package/dist/constructs/grpc-assertion-codegen.js.map +1 -1
  5. package/dist/constructs/grpc-assertion-validation.js +16 -0
  6. package/dist/constructs/grpc-assertion-validation.js.map +1 -1
  7. package/dist/constructs/grpc-assertion.d.ts +37 -2
  8. package/dist/constructs/grpc-assertion.js +42 -3
  9. package/dist/constructs/grpc-assertion.js.map +1 -1
  10. package/dist/constructs/grpc-request-codegen.js +0 -3
  11. package/dist/constructs/grpc-request-codegen.js.map +1 -1
  12. package/dist/constructs/grpc-request.d.ts +0 -6
  13. package/dist/constructs/internal/assertion-codegen.d.ts +11 -2
  14. package/dist/constructs/internal/assertion-codegen.js +14 -17
  15. package/dist/constructs/internal/assertion-codegen.js.map +1 -1
  16. package/dist/constructs/internal/assertion-grammar.d.ts +35 -0
  17. package/dist/constructs/internal/assertion-grammar.js +75 -0
  18. package/dist/constructs/internal/assertion-grammar.js.map +1 -0
  19. package/dist/constructs/internal/assertion.js +2 -2
  20. package/dist/constructs/internal/assertion.js.map +1 -1
  21. package/dist/constructs/ssl-assertion-codegen.d.ts +2 -0
  22. package/dist/constructs/ssl-assertion-codegen.js +65 -27
  23. package/dist/constructs/ssl-assertion-codegen.js.map +1 -1
  24. package/dist/constructs/ssl-assertion-grammar.d.ts +123 -0
  25. package/dist/constructs/ssl-assertion-grammar.js +90 -0
  26. package/dist/constructs/ssl-assertion-grammar.js.map +1 -0
  27. package/dist/constructs/ssl-assertion-validation.d.ts +6 -6
  28. package/dist/constructs/ssl-assertion-validation.js +97 -28
  29. package/dist/constructs/ssl-assertion-validation.js.map +1 -1
  30. package/dist/constructs/ssl-assertion.d.ts +59 -114
  31. package/dist/constructs/ssl-assertion.js +59 -176
  32. package/dist/constructs/ssl-assertion.js.map +1 -1
  33. package/dist/constructs/traceroute-assertion-grammar.d.ts +33 -0
  34. package/dist/constructs/traceroute-assertion-grammar.js +33 -0
  35. package/dist/constructs/traceroute-assertion-grammar.js.map +1 -0
  36. package/dist/constructs/traceroute-assertion-validation.js +21 -27
  37. package/dist/constructs/traceroute-assertion-validation.js.map +1 -1
  38. package/dist/constructs/traceroute-assertion.d.ts +6 -25
  39. package/dist/constructs/traceroute-assertion.js +5 -51
  40. package/dist/constructs/traceroute-assertion.js.map +1 -1
  41. package/dist/reporters/abstract-list.d.ts +2 -0
  42. package/dist/reporters/abstract-list.js +29 -11
  43. package/dist/reporters/abstract-list.js.map +1 -1
  44. package/oclif.manifest.json +206 -206
  45. package/package.json +7 -7
@@ -273,10 +273,10 @@ new SslMonitor('example-com-ssl', {
273
273
  alertDaysBeforeExpiry: 30,
274
274
  },
275
275
  assertions: [
276
- SslAssertionBuilder.certExpiresInDays().greaterThan(30),
277
- SslAssertionBuilder.chainTrusted().equals(true),
278
- SslAssertionBuilder.hostnameVerified().equals(true),
279
- SslAssertionBuilder.tlsVersion().equals('TLS1.3'),
276
+ SslAssertionBuilder.certificate('daysUntilExpiry').greaterThan(30),
277
+ SslAssertionBuilder.connection('chainTrusted').equals(true),
278
+ SslAssertionBuilder.connection('hostnameVerified').equals(true),
279
+ SslAssertionBuilder.connection('tlsVersion').equals('TLS1.3'),
280
280
  ],
281
281
  },
282
282
  })
@@ -29,10 +29,10 @@ new SslMonitor('example-com-ssl', {
29
29
  alertDaysBeforeExpiry: 30,
30
30
  },
31
31
  assertions: [
32
- SslAssertionBuilder.certExpiresInDays().greaterThan(30),
33
- SslAssertionBuilder.chainTrusted().equals(true),
34
- SslAssertionBuilder.hostnameVerified().equals(true),
35
- SslAssertionBuilder.tlsVersion().equals('TLS1.3'),
32
+ SslAssertionBuilder.certificate('daysUntilExpiry').greaterThan(30),
33
+ SslAssertionBuilder.connection('chainTrusted').equals(true),
34
+ SslAssertionBuilder.connection('hostnameVerified').equals(true),
35
+ SslAssertionBuilder.connection('tlsVersion').equals('TLS1.3'),
36
36
  ],
37
37
  },
38
38
  })
@@ -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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,EAAE,oBAAoB,CAAC,CAAA;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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C,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;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,CAA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AC,CAAA;IACjG,CAAC;CACF;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,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;oBACxB,OAAO,CAAC,KAAK,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
  */
@@ -11,12 +11,21 @@ import { Assertion } from './assertion.js';
11
11
  export declare function unsupportedAssertionSource(source: never, kind?: string): never;
12
12
  export interface ValueForNumericAssertionOptions {
13
13
  hasProperty?: boolean;
14
+ /**
15
+ * How to read the target as a number. Defaults to `parseInt`, which takes the leading
16
+ * numeric prefix — lenient by design, since wire targets may carry units ('5%').
17
+ * Callers that have already established the target is a full number can pass `Number`
18
+ * to keep fractions and avoid truncating '30.5' to 30.
19
+ */
20
+ parse?: (target: string) => number;
14
21
  }
15
22
  export declare function valueForNumericAssertion<Source extends string>(klass: string, method: string, assertion: Assertion<Source>, options?: ValueForNumericAssertionOptions): Value;
16
- export declare function valueForBooleanAssertion<Source extends string>(klass: string, method: string, assertion: Assertion<Source>): Value;
23
+ export interface ValueForBooleanAssertionOptions {
24
+ hasProperty?: boolean;
25
+ }
26
+ export declare function valueForBooleanAssertion<Source extends string>(klass: string, method: string, assertion: Assertion<Source>, options?: ValueForBooleanAssertionOptions): Value;
17
27
  export interface ValueForGeneralAssertionOptions {
18
28
  hasProperty?: boolean;
19
29
  hasRegex?: boolean;
20
- hasMatches?: boolean;
21
30
  }
22
31
  export declare function valueForGeneralAssertion<Source extends string>(klass: string, method: string, assertion: Assertion<Source>, options?: ValueForGeneralAssertionOptions): Value;
@@ -12,6 +12,7 @@ export function unsupportedAssertionSource(source, kind) {
12
12
  throw new Error(`${prefix} assertion source ${String(source)}`);
13
13
  }
14
14
  export function valueForNumericAssertion(klass, method, assertion, options) {
15
+ const parse = options?.parse ?? ((target) => parseInt(target, 10));
15
16
  return expr(ident(klass), builder => {
16
17
  builder.member(ident(method));
17
18
  builder.call(builder => {
@@ -24,25 +25,25 @@ export function valueForNumericAssertion(klass, method, assertion, options) {
24
25
  case 'EQUALS':
25
26
  builder.member(ident('equals'));
26
27
  builder.call(builder => {
27
- builder.number(parseInt(assertion.target, 10));
28
+ builder.number(parse(assertion.target));
28
29
  });
29
30
  break;
30
31
  case 'NOT_EQUALS':
31
32
  builder.member(ident('notEquals'));
32
33
  builder.call(builder => {
33
- builder.number(parseInt(assertion.target, 10));
34
+ builder.number(parse(assertion.target));
34
35
  });
35
36
  break;
36
37
  case 'LESS_THAN':
37
38
  builder.member(ident('lessThan'));
38
39
  builder.call(builder => {
39
- builder.number(parseInt(assertion.target, 10));
40
+ builder.number(parse(assertion.target));
40
41
  });
41
42
  break;
42
43
  case 'GREATER_THAN':
43
44
  builder.member(ident('greaterThan'));
44
45
  builder.call(builder => {
45
- builder.number(parseInt(assertion.target, 10));
46
+ builder.number(parse(assertion.target));
46
47
  });
47
48
  break;
48
49
  default:
@@ -50,12 +51,17 @@ export function valueForNumericAssertion(klass, method, assertion, options) {
50
51
  }
51
52
  });
52
53
  }
53
- // Emits an SSL boolean-source assertion: `Builder.method().equals(true|false)`.
54
- // The four boolean SSL sources only support EQUALS and carry no property/regex.
55
- export function valueForBooleanAssertion(klass, method, assertion) {
54
+ // Emits a boolean-target assertion: `Builder.method([property]).equals(true|false)`.
55
+ // Boolean targets only support EQUALS and carry no regex.
56
+ export function valueForBooleanAssertion(klass, method, assertion, options) {
56
57
  return expr(ident(klass), builder => {
57
58
  builder.member(ident(method));
58
- builder.call(() => { });
59
+ builder.call(builder => {
60
+ const hasProperty = options?.hasProperty ?? false;
61
+ if (hasProperty && assertion.property !== '') {
62
+ builder.string(assertion.property);
63
+ }
64
+ });
59
65
  switch (assertion.comparison) {
60
66
  case 'EQUALS':
61
67
  builder.member(ident('equals'));
@@ -166,15 +172,6 @@ export function valueForGeneralAssertion(klass, method, assertion, options) {
166
172
  builder.empty();
167
173
  });
168
174
  break;
169
- case 'MATCHES':
170
- if (!options?.hasMatches) {
171
- throw new Error(`Unsupported comparison ${assertion.comparison} for assertion source ${assertion.source}`);
172
- }
173
- builder.member(ident('matches'));
174
- builder.call(builder => {
175
- builder.string(assertion.target);
176
- });
177
- break;
178
175
  default:
179
176
  throw new Error(`Unsupported comparison ${assertion.comparison} for assertion source ${assertion.source}`);
180
177
  }
@@ -1 +1 @@
1
- {"version":3,"file":"assertion-codegen.js","sourceRoot":"","sources":["../../../src/constructs/internal/assertion-codegen.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAS,MAAM,0BAA0B,CAAA;AAG7D;;;;;;;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,EAAE;oBACrB,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAA;gBAClC,CAAC,CAAC,CAAA;gBACF,MAAK;YACP,KAAK,SAAS;gBACZ,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;gBAC/B,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE;oBACrB,OAAO,CAAC,KAAK,EAAE,CAAA;gBACjB,CAAC,CAAC,CAAA;gBACF,MAAK;YACP,KAAK,UAAU;gBACb,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAA;gBAClC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE;oBACrB,OAAO,CAAC,KAAK,EAAE,CAAA;gBACjB,CAAC,CAAC,CAAA;gBACF,MAAK;YACP,KAAK,SAAS;gBACZ,IAAI,CAAC,OAAO,EAAE,UAAU,EAAE,CAAC;oBACzB,MAAM,IAAI,KAAK,CAAC,0BAA0B,SAAS,CAAC,UAAU,yBAAyB,SAAS,CAAC,MAAM,EAAE,CAAC,CAAA;gBAC5G,CAAC;gBACD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAA;gBAChC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE;oBACrB,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAA;gBAClC,CAAC,CAAC,CAAA;gBACF,MAAK;YACP;gBACE,MAAM,IAAI,KAAK,CAAC,0BAA0B,SAAS,CAAC,UAAU,yBAAyB,SAAS,CAAC,MAAM,EAAE,CAAC,CAAA;QAC9G,CAAC;IACH,CAAC,CAAC,CAAA;AACJ,CAAC"}
1
+ {"version":3,"file":"assertion-codegen.js","sourceRoot":"","sources":["../../../src/constructs/internal/assertion-codegen.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAS,MAAM,0BAA0B,CAAA;AAG7D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AC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAA;gBACjC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE;oBACrB,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAA;gBAClC,CAAC,CAAC,CAAA;gBACF,MAAK;YACP,KAAK,cAAc;gBACjB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAA;gBACpC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE;oBACrB,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAA;gBAClC,CAAC,CAAC,CAAA;gBACF,MAAK;YACP,KAAK,SAAS;gBACZ,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;gBAC/B,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE;oBACrB,OAAO,CAAC,KAAK,EAAE,CAAA;gBACjB,CAAC,CAAC,CAAA;gBACF,MAAK;YACP,KAAK,UAAU;gBACb,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAA;gBAClC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE;oBACrB,OAAO,CAAC,KAAK,EAAE,CAAA;gBACjB,CAAC,CAAC,CAAA;gBACF,MAAK;YACP;gBACE,MAAM,IAAI,KAAK,CAAC,0BAA0B,SAAS,CAAC,UAAU,yBAAyB,SAAS,CAAC,MAAM,EAAE,CAAC,CAAA;QAC9G,CAAC;IACH,CAAC,CAAC,CAAA;AACJ,CAAC"}
@@ -0,0 +1,35 @@
1
+ import { Assertion } from './assertion.js';
2
+ export declare const operatorComparisons: {
3
+ readonly equals: "EQUALS";
4
+ readonly notEquals: "NOT_EQUALS";
5
+ readonly greaterThan: "GREATER_THAN";
6
+ readonly lessThan: "LESS_THAN";
7
+ readonly contains: "CONTAINS";
8
+ readonly notContains: "NOT_CONTAINS";
9
+ };
10
+ export type OperatorName = keyof typeof operatorComparisons;
11
+ export type TargetValueType = 'number' | 'boolean' | 'string';
12
+ declare const targetType: unique symbol;
13
+ export interface AnyTargetSpec {
14
+ readonly kind: TargetValueType;
15
+ }
16
+ export interface TargetSpec<T extends string | number | boolean> extends AnyTargetSpec {
17
+ readonly [targetType]?: T;
18
+ }
19
+ export declare function numberTarget(): TargetSpec<number>;
20
+ export declare function booleanTarget(): TargetSpec<boolean>;
21
+ export declare function stringTarget<T extends string = string>(): TargetSpec<T>;
22
+ export interface PropertyGrammar {
23
+ readonly operators: readonly OperatorName[];
24
+ readonly target: AnyTargetSpec;
25
+ }
26
+ export declare function defineGrammar<const G extends Record<string, PropertyGrammar>>(grammar: G): G;
27
+ type TargetOf<Spec> = Spec extends TargetSpec<infer T> ? T : never;
28
+ export type PropertyOperators<Source extends string, Decl extends PropertyGrammar> = Decl extends PropertyGrammar ? {
29
+ [Op in Decl['operators'][number]]: (target: TargetOf<Decl['target']>) => Assertion<Source>;
30
+ } : never;
31
+ export declare function operatorsForProperty<Source extends string, Grammar extends Record<string, PropertyGrammar>, Property extends keyof Grammar & string>(grammar: Grammar, source: Source, property: Property): PropertyOperators<Source, Grammar[Property]>;
32
+ export declare function operatorsForSource<Source extends string, Decl extends PropertyGrammar>(source: Source, decl: Decl): PropertyOperators<Source, Decl>;
33
+ export declare function comparisonsForGrammar(decl: PropertyGrammar): Record<string, true>;
34
+ export declare function valueTypeForGrammar(decl: PropertyGrammar): TargetValueType;
35
+ export {};
@@ -0,0 +1,75 @@
1
+ import { GeneralAssertionBuilder, toAssertion } from './assertion.js';
2
+ // A property-scoped assertion grammar: one declaration per property states the operators
3
+ // it exposes and the type of its target. The builder surface, the validation whitelist,
4
+ // and codegen's literal kind are all derived from it, so a property's grammar lives in one
5
+ // place instead of being restated in a builder class, a value-type table, and a whitelist.
6
+ //
7
+ // This module is monitor-agnostic; each monitor supplies its own grammar tables.
8
+ // The operator catalog: builder method name -> wire comparison. Shared by every monitor
9
+ // grammar; adding an operator is one line here plus listing it on the properties that
10
+ // accept it.
11
+ export const operatorComparisons = {
12
+ equals: 'EQUALS',
13
+ notEquals: 'NOT_EQUALS',
14
+ greaterThan: 'GREATER_THAN',
15
+ lessThan: 'LESS_THAN',
16
+ contains: 'CONTAINS',
17
+ notContains: 'NOT_CONTAINS',
18
+ };
19
+ export function numberTarget() {
20
+ return { kind: 'number' };
21
+ }
22
+ export function booleanTarget() {
23
+ return { kind: 'boolean' };
24
+ }
25
+ export function stringTarget() {
26
+ return { kind: 'string' };
27
+ }
28
+ // `const G` keeps each row's operator array a literal tuple without callers writing
29
+ // `as const`, so `keyof typeof grammar` and the per-property operator sets stay precise.
30
+ export function defineGrammar(grammar) {
31
+ return grammar;
32
+ }
33
+ // Builds the operator object for a known property by looping over its declared operators.
34
+ // The cast is the one unavoidable bridge in the design: TypeScript cannot connect a runtime
35
+ // loop to a mapped type. It is sound because the loop defines exactly the keys in
36
+ // `decl.operators`, each routed through `operatorComparisons` — the same data
37
+ // `PropertyOperators` is computed from.
38
+ function makeOperators(source, property, decl) {
39
+ const operators = {};
40
+ for (const operator of decl.operators) {
41
+ operators[operator] = target => toAssertion(source, operatorComparisons[operator], target, property);
42
+ }
43
+ return operators;
44
+ }
45
+ // Resolves the operators for a property of a grammar.
46
+ //
47
+ // The typed signature makes an unknown property a compile error, but plain JavaScript
48
+ // callers and object-literal assertions still reach this at runtime with an arbitrary
49
+ // string. Those fall back to an unconstrained builder so the call returns something usable;
50
+ // the property is then reported by the monitor's validation at deploy time rather than
51
+ // throwing here.
52
+ export function operatorsForProperty(grammar, source, property) {
53
+ if (!Object.hasOwn(grammar, property)) {
54
+ const fallback = new GeneralAssertionBuilder(source, property);
55
+ return fallback;
56
+ }
57
+ return makeOperators(source, property, grammar[property]);
58
+ }
59
+ // Resolves the operators for a source-scoped grammar — a single declaration with no
60
+ // property, for sources whose value is the source itself (e.g. traceroute HOP_COUNT). The
61
+ // property slot is emitted empty, matching the wire shape those sources carry.
62
+ export function operatorsForSource(source, decl) {
63
+ return makeOperators(source, '', decl);
64
+ }
65
+ // Runtime derivations shared by validation and codegen, so both read the same grammar the
66
+ // builder is generated from.
67
+ // The wire comparisons a property accepts, from its declared operators.
68
+ export function comparisonsForGrammar(decl) {
69
+ return Object.fromEntries(decl.operators.map(operator => [operatorComparisons[operator], true]));
70
+ }
71
+ // How a property's target is written on the wire.
72
+ export function valueTypeForGrammar(decl) {
73
+ return decl.target.kind;
74
+ }
75
+ //# sourceMappingURL=assertion-grammar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assertion-grammar.js","sourceRoot":"","sources":["../../../src/constructs/internal/assertion-grammar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,uBAAuB,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAEhF,yFAAyF;AACzF,wFAAwF;AACxF,2FAA2F;AAC3F,2FAA2F;AAC3F,EAAE;AACF,iFAAiF;AAEjF,wFAAwF;AACxF,sFAAsF;AACtF,aAAa;AACb,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,MAAM,EAAE,QAAQ;IAChB,SAAS,EAAE,YAAY;IACvB,WAAW,EAAE,cAAc;IAC3B,QAAQ,EAAE,WAAW;IACrB,QAAQ,EAAE,UAAU;IACpB,WAAW,EAAE,cAAc;CACnB,CAAA;AA2BV,MAAM,UAAU,YAAY;IAC1B,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAA;AAC3B,CAAC;AAED,MAAM,UAAU,aAAa;IAC3B,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,CAAA;AAC5B,CAAC;AAED,MAAM,UAAU,YAAY;IAC1B,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAA;AAC3B,CAAC;AAOD,oFAAoF;AACpF,yFAAyF;AACzF,MAAM,UAAU,aAAa,CAAmD,OAAU;IACxF,OAAO,OAAO,CAAA;AAChB,CAAC;AAYD,0FAA0F;AAC1F,4FAA4F;AAC5F,kFAAkF;AAClF,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,CAAC,CAAC,CAAC,CAAA;AAClG,CAAC;AAED,kDAAkD;AAClD,MAAM,UAAU,mBAAmB,CAAE,IAAqB;IACxD,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAA;AACzB,CAAC"}
@@ -1,6 +1,6 @@
1
1
  // Builds an assertion payload from its parts. `comparison` is a free type parameter
2
- // so any operator string (including SSL's `MATCHES`) is accepted without a central
3
- // union. Empty property, stringified target, and null regex are the wire defaults.
2
+ // so any operator string is accepted without a central union. Empty property,
3
+ // stringified target, and null regex are the wire defaults.
4
4
  export function toAssertion(source, comparison, target, property, regex) {
5
5
  return {
6
6
  source,
@@ -1 +1 @@
1
- {"version":3,"file":"assertion.js","sourceRoot":"","sources":["../../../src/constructs/internal/assertion.ts"],"names":[],"mappings":"AAQA,oFAAoF;AACpF,mFAAmF;AACnF,mFAAmF;AACnF,MAAM,UAAU,WAAW,CAKzB,MAAc,EACd,UAAsB,EACtB,MAAe,EACf,QAAiB,EACjB,KAAqB;IAErB,OAAO;QACL,MAAM;QACN,UAAU;QACV,QAAQ,EAAE,QAAQ,IAAI,EAAE;QACxB,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE;QAChC,KAAK,EAAE,KAAK,IAAI,IAAI;KACrB,CAAA;AACH,CAAC;AAED,MAAM,OAAO,uBAAuB;IAClC,MAAM,CAAQ;IACd,QAAQ,CAAW;IAEnB,YAAa,MAAc,EAAE,QAAmB;QAC9C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;IAC1B,CAAC;IAED,MAAM,CAAE,MAAc;QACpB,OAAO,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAA;IAClE,CAAC;IAED,SAAS,CAAE,MAAc;QACvB,OAAO,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,I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AAE,MAAM,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,CAAA;IACpF,CAAC;IAED,MAAM;QACJ,OAAO,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,CAAA;IAClF,CAAC;IAED,SAAS;QACP,OAAO,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,CAAA;IACnF,CAAC;CACF"}
@@ -1,3 +1,5 @@
1
1
  import { GeneratedFile, Value } from '../sourcegen/index.js';
2
2
  import { SslAssertion } from './ssl-assertion.js';
3
+ export declare const numericComparisons: Record<string, true>;
4
+ export declare const booleanComparisons: Record<string, true>;
3
5
  export declare function valueForSslAssertion(genfile: GeneratedFile, assertion: SslAssertion): Value;