checkly 8.14.1 → 8.15.0-prerelease-cdf176f
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.
- package/dist/ai-context/context.d.ts +18 -0
- package/dist/ai-context/context.js +89 -0
- package/dist/ai-context/context.js.map +1 -1
- package/dist/ai-context/skills-command/references/configure-grpc-monitors.md +37 -0
- package/dist/ai-context/skills-command/references/configure-playwright-checks.md +5 -5
- package/dist/ai-context/skills-command/references/configure-ssl-monitors.md +39 -0
- package/dist/ai-context/skills-command/references/configure-traceroute-monitors.md +36 -0
- package/dist/ai-context/skills-command/references/configure.md +9 -0
- package/dist/commands/checks/stats.js +1 -0
- package/dist/commands/checks/stats.js.map +1 -1
- package/dist/commands/deploy.js +25 -16
- package/dist/commands/deploy.js.map +1 -1
- package/dist/constants.d.ts +4 -1
- package/dist/constants.js +3 -0
- package/dist/constants.js.map +1 -1
- package/dist/constructs/api-assertion-codegen.js +2 -2
- package/dist/constructs/api-assertion-codegen.js.map +1 -1
- package/dist/constructs/api-assertion.d.ts +3 -3
- package/dist/constructs/check-codegen.d.ts +6 -0
- package/dist/constructs/check-codegen.js +24 -0
- package/dist/constructs/check-codegen.js.map +1 -1
- package/dist/constructs/dns-assertion-codegen.js +2 -2
- package/dist/constructs/dns-assertion-codegen.js.map +1 -1
- package/dist/constructs/dns-assertion.d.ts +3 -3
- package/dist/constructs/dns-request.d.ts +2 -2
- package/dist/constructs/grpc-assertion-codegen.d.ts +3 -0
- package/dist/constructs/grpc-assertion-codegen.js +33 -0
- package/dist/constructs/grpc-assertion-codegen.js.map +1 -0
- package/dist/constructs/grpc-assertion-validation.d.ts +13 -0
- package/dist/constructs/grpc-assertion-validation.js +53 -0
- package/dist/constructs/grpc-assertion-validation.js.map +1 -0
- package/dist/constructs/grpc-assertion.d.ts +61 -0
- package/dist/constructs/grpc-assertion.js +71 -0
- package/dist/constructs/grpc-assertion.js.map +1 -0
- package/dist/constructs/grpc-monitor-codegen.d.ts +13 -0
- package/dist/constructs/grpc-monitor-codegen.js +34 -0
- package/dist/constructs/grpc-monitor-codegen.js.map +1 -0
- package/dist/constructs/grpc-monitor.d.ts +83 -0
- package/dist/constructs/grpc-monitor.js +56 -0
- package/dist/constructs/grpc-monitor.js.map +1 -0
- package/dist/constructs/grpc-request-codegen.d.ts +4 -0
- package/dist/constructs/grpc-request-codegen.js +68 -0
- package/dist/constructs/grpc-request-codegen.js.map +1 -0
- package/dist/constructs/grpc-request.d.ts +137 -0
- package/dist/constructs/grpc-request.js +2 -0
- package/dist/constructs/grpc-request.js.map +1 -0
- package/dist/constructs/icmp-assertion-codegen.js +2 -2
- package/dist/constructs/icmp-assertion-codegen.js.map +1 -1
- package/dist/constructs/icmp-assertion.d.ts +1 -1
- package/dist/constructs/icmp-request.d.ts +2 -2
- package/dist/constructs/index.d.ts +9 -0
- package/dist/constructs/index.js +9 -0
- package/dist/constructs/index.js.map +1 -1
- package/dist/constructs/internal/assertion-codegen.d.ts +11 -0
- package/dist/constructs/internal/assertion-codegen.js +39 -0
- package/dist/constructs/internal/assertion-codegen.js.map +1 -1
- package/dist/constructs/internal/assertion-validation.d.ts +3 -0
- package/dist/constructs/internal/assertion-validation.js +17 -0
- package/dist/constructs/internal/assertion-validation.js.map +1 -0
- package/dist/constructs/internal/assertion.d.ts +17 -11
- package/dist/constructs/internal/assertion.js +39 -38
- package/dist/constructs/internal/assertion.js.map +1 -1
- package/dist/constructs/internal/common-diagnostics.d.ts +1 -0
- package/dist/constructs/internal/common-diagnostics.js +14 -0
- package/dist/constructs/internal/common-diagnostics.js.map +1 -1
- package/dist/constructs/ssl-assertion-codegen.d.ts +3 -0
- package/dist/constructs/ssl-assertion-codegen.js +36 -0
- package/dist/constructs/ssl-assertion-codegen.js.map +1 -0
- package/dist/constructs/ssl-assertion-validation.d.ts +13 -0
- package/dist/constructs/ssl-assertion-validation.js +49 -0
- package/dist/constructs/ssl-assertion-validation.js.map +1 -0
- package/dist/constructs/ssl-assertion.d.ts +197 -0
- package/dist/constructs/ssl-assertion.js +267 -0
- package/dist/constructs/ssl-assertion.js.map +1 -0
- package/dist/constructs/ssl-monitor-codegen.d.ts +36 -0
- package/dist/constructs/ssl-monitor-codegen.js +51 -0
- package/dist/constructs/ssl-monitor-codegen.js.map +1 -0
- package/dist/constructs/ssl-monitor.d.ts +89 -0
- package/dist/constructs/ssl-monitor.js +73 -0
- package/dist/constructs/ssl-monitor.js.map +1 -0
- package/dist/constructs/ssl-request-codegen.d.ts +4 -0
- package/dist/constructs/ssl-request-codegen.js +48 -0
- package/dist/constructs/ssl-request-codegen.js.map +1 -0
- package/dist/constructs/ssl-request.d.ts +143 -0
- package/dist/constructs/ssl-request.js +2 -0
- package/dist/constructs/ssl-request.js.map +1 -0
- package/dist/constructs/tcp-monitor-codegen.js +2 -2
- package/dist/constructs/tcp-monitor-codegen.js.map +1 -1
- package/dist/constructs/tcp-monitor.d.ts +1 -1
- package/dist/constructs/traceroute-assertion-codegen.d.ts +3 -0
- package/dist/constructs/traceroute-assertion-codegen.js +17 -0
- package/dist/constructs/traceroute-assertion-codegen.js.map +1 -0
- package/dist/constructs/traceroute-assertion-validation.d.ts +11 -0
- package/dist/constructs/traceroute-assertion-validation.js +77 -0
- package/dist/constructs/traceroute-assertion-validation.js.map +1 -0
- package/dist/constructs/traceroute-assertion.d.ts +67 -0
- package/dist/constructs/traceroute-assertion.js +96 -0
- package/dist/constructs/traceroute-assertion.js.map +1 -0
- package/dist/constructs/traceroute-monitor-codegen.d.ts +13 -0
- package/dist/constructs/traceroute-monitor-codegen.js +34 -0
- package/dist/constructs/traceroute-monitor-codegen.js.map +1 -0
- package/dist/constructs/traceroute-monitor.d.ts +83 -0
- package/dist/constructs/traceroute-monitor.js +54 -0
- package/dist/constructs/traceroute-monitor.js.map +1 -0
- package/dist/constructs/traceroute-request-codegen.d.ts +4 -0
- package/dist/constructs/traceroute-request-codegen.js +41 -0
- package/dist/constructs/traceroute-request-codegen.js.map +1 -0
- package/dist/constructs/traceroute-request.d.ts +81 -0
- package/dist/constructs/traceroute-request.js +2 -0
- package/dist/constructs/traceroute-request.js.map +1 -0
- package/dist/constructs/url-assertion-codegen.js +2 -2
- package/dist/constructs/url-assertion-codegen.js.map +1 -1
- package/dist/formatters/assertion-line.d.ts +27 -0
- package/dist/formatters/assertion-line.js +126 -0
- package/dist/formatters/assertion-line.js.map +1 -0
- package/dist/formatters/batch-stats.js +20 -1
- package/dist/formatters/batch-stats.js.map +1 -1
- package/dist/formatters/check-result-detail.js +604 -1
- package/dist/formatters/check-result-detail.js.map +1 -1
- package/dist/helpers/cli-mode.d.ts +2 -2
- package/dist/helpers/cli-mode.js +103 -11
- package/dist/helpers/cli-mode.js.map +1 -1
- package/dist/reporters/json.d.ts +1 -0
- package/dist/reporters/json.js +58 -0
- package/dist/reporters/json.js.map +1 -1
- package/dist/reporters/util.js +192 -89
- package/dist/reporters/util.js.map +1 -1
- package/dist/rest/analytics.js +6 -0
- package/dist/rest/analytics.js.map +1 -1
- package/dist/rest/batch-analytics.d.ts +1 -0
- package/dist/rest/batch-analytics.js.map +1 -1
- package/dist/rest/check-results.d.ts +75 -1
- package/dist/rest/check-results.js.map +1 -1
- package/dist/rest/projects.d.ts +1 -1
- package/dist/services/check-parser/bundler.d.ts +6 -0
- package/dist/services/check-parser/bundler.js +8 -0
- package/dist/services/check-parser/bundler.js.map +1 -1
- package/dist/services/check-parser/cache-hash.d.ts +24 -2
- package/dist/services/check-parser/cache-hash.js +45 -3
- package/dist/services/check-parser/cache-hash.js.map +1 -1
- package/dist/services/check-parser/package-files/resolver.d.ts +6 -1
- package/dist/services/check-parser/package-files/resolver.js +19 -0
- package/dist/services/check-parser/package-files/resolver.js.map +1 -1
- package/dist/services/util.d.ts +4 -0
- package/dist/services/util.js +4 -0
- package/dist/services/util.js.map +1 -1
- package/oclif.manifest.json +214 -208
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grpc-monitor.js","sour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EAAE,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC;YAC3E,qBAAqB,CAAC,WAAW,EAAE,SAAS,EAAE,KAAK,CAAC,CAAA;QACtD,CAAC;IACH,CAAC;IAED,UAAU;QACR,OAAO;YACL,GAAG,KAAK,CAAC,UAAU,EAAE;YACrB,SAAS,EAAE,MAAM;YACjB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,oBAAoB,EAAE,IAAI,CAAC,oBAAoB;YAC/C,eAAe,EAAE,IAAI,CAAC,eAAe;SACtC,CAAA;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { GeneratedFile, Program, Value } from '../sourcegen/index.js';
|
|
2
|
+
import { GrpcRequest } from './grpc-request.js';
|
|
3
|
+
import { Context } from './internal/codegen/index.js';
|
|
4
|
+
export declare function valueForGrpcRequest(program: Program, genfile: GeneratedFile, context: Context, request: GrpcRequest): Value;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { object } from '../sourcegen/index.js';
|
|
2
|
+
import { valueForGrpcAssertion } from './grpc-assertion-codegen.js';
|
|
3
|
+
export function valueForGrpcRequest(program, genfile, context, request) {
|
|
4
|
+
return object(builder => {
|
|
5
|
+
builder.string('url', request.url);
|
|
6
|
+
builder.number('port', request.port);
|
|
7
|
+
if (request.ipFamily && request.ipFamily !== 'IPv4') {
|
|
8
|
+
builder.string('ipFamily', request.ipFamily);
|
|
9
|
+
}
|
|
10
|
+
if (request.skipSSL) {
|
|
11
|
+
builder.boolean('skipSSL', request.skipSSL);
|
|
12
|
+
}
|
|
13
|
+
if (request.timeout !== undefined) {
|
|
14
|
+
builder.number('timeout', request.timeout);
|
|
15
|
+
}
|
|
16
|
+
const config = request.grpcConfig;
|
|
17
|
+
builder.object('grpcConfig', builder => {
|
|
18
|
+
if (config.mode) {
|
|
19
|
+
builder.string('mode', config.mode);
|
|
20
|
+
}
|
|
21
|
+
if (config.tls !== undefined) {
|
|
22
|
+
builder.boolean('tls', config.tls);
|
|
23
|
+
}
|
|
24
|
+
if (config.storeResponseBody !== undefined) {
|
|
25
|
+
builder.boolean('storeResponseBody', config.storeResponseBody);
|
|
26
|
+
}
|
|
27
|
+
if (config.serviceDefinition) {
|
|
28
|
+
builder.string('serviceDefinition', config.serviceDefinition);
|
|
29
|
+
}
|
|
30
|
+
if (config.method) {
|
|
31
|
+
builder.string('method', config.method);
|
|
32
|
+
}
|
|
33
|
+
if (config.protoContent) {
|
|
34
|
+
builder.string('protoContent', config.protoContent);
|
|
35
|
+
}
|
|
36
|
+
if (config.message) {
|
|
37
|
+
builder.string('message', config.message);
|
|
38
|
+
}
|
|
39
|
+
if (config.service) {
|
|
40
|
+
builder.string('service', config.service);
|
|
41
|
+
}
|
|
42
|
+
if (config.metadata) {
|
|
43
|
+
const metadata = config.metadata;
|
|
44
|
+
if (metadata.length > 0) {
|
|
45
|
+
builder.array('metadata', builder => {
|
|
46
|
+
for (const entry of metadata) {
|
|
47
|
+
builder.object(builder => {
|
|
48
|
+
builder.string('key', entry.key);
|
|
49
|
+
builder.string('value', entry.value);
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
if (request.assertions) {
|
|
57
|
+
const assertions = request.assertions;
|
|
58
|
+
if (assertions.length > 0) {
|
|
59
|
+
builder.array('assertions', builder => {
|
|
60
|
+
for (const assertion of assertions) {
|
|
61
|
+
builder.value(valueForGrpcAssertion(genfile, assertion));
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=grpc-request-codegen.js.map
|
|
@@ -0,0 +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,CA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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"}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { GrpcAssertion } from './grpc-assertion.js';
|
|
2
|
+
import { IPFamily } from './ip.js';
|
|
3
|
+
/**
|
|
4
|
+
* The gRPC monitoring mode.
|
|
5
|
+
*
|
|
6
|
+
* - `BEHAVIOR` invokes a unary method (requires `method`).
|
|
7
|
+
* - `HEALTH` queries the standard gRPC health-check service (allows `service`).
|
|
8
|
+
*/
|
|
9
|
+
export type GrpcMode = 'BEHAVIOR' | 'HEALTH';
|
|
10
|
+
/**
|
|
11
|
+
* How the service definition is resolved in `BEHAVIOR` mode.
|
|
12
|
+
*
|
|
13
|
+
* - `REFLECTION` uses server reflection.
|
|
14
|
+
* - `PROTO_FILE` uses the inline `protoContent`.
|
|
15
|
+
*/
|
|
16
|
+
export type GrpcServiceDefinition = 'REFLECTION' | 'PROTO_FILE';
|
|
17
|
+
/**
|
|
18
|
+
* A single gRPC metadata (request header) key/value pair.
|
|
19
|
+
*/
|
|
20
|
+
export interface GrpcMetadata {
|
|
21
|
+
/**
|
|
22
|
+
* The gRPC metadata (header) key.
|
|
23
|
+
*/
|
|
24
|
+
key: string;
|
|
25
|
+
/**
|
|
26
|
+
* The gRPC metadata (header) value.
|
|
27
|
+
*/
|
|
28
|
+
value: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* gRPC-specific configuration nested inside a gRPC monitor's request.
|
|
32
|
+
*/
|
|
33
|
+
export interface GrpcConfig {
|
|
34
|
+
/**
|
|
35
|
+
* The gRPC monitoring mode. `BEHAVIOR` invokes a unary method (requires
|
|
36
|
+
* `method`); `HEALTH` queries the standard gRPC health-check service (allows
|
|
37
|
+
* `service`).
|
|
38
|
+
*
|
|
39
|
+
* @defaultValue "BEHAVIOR"
|
|
40
|
+
*/
|
|
41
|
+
mode?: GrpcMode;
|
|
42
|
+
/**
|
|
43
|
+
* Whether to use a TLS-encrypted connection to the gRPC server.
|
|
44
|
+
*
|
|
45
|
+
* @defaultValue true
|
|
46
|
+
*/
|
|
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
|
+
/**
|
|
55
|
+
* gRPC metadata (request headers) sent with the call.
|
|
56
|
+
*/
|
|
57
|
+
metadata?: Array<GrpcMetadata>;
|
|
58
|
+
/**
|
|
59
|
+
* How the service definition is resolved in `BEHAVIOR` mode: `REFLECTION`
|
|
60
|
+
* uses server reflection; `PROTO_FILE` uses the inline `protoContent`.
|
|
61
|
+
* Forbidden in `HEALTH` mode.
|
|
62
|
+
*
|
|
63
|
+
* @defaultValue "REFLECTION"
|
|
64
|
+
*/
|
|
65
|
+
serviceDefinition?: GrpcServiceDefinition;
|
|
66
|
+
/**
|
|
67
|
+
* The fully-qualified gRPC method to invoke in `BEHAVIOR` mode (e.g.
|
|
68
|
+
* `package.Service/Method`). Required in `BEHAVIOR` mode; forbidden in
|
|
69
|
+
* `HEALTH` mode.
|
|
70
|
+
*
|
|
71
|
+
* @example "/grpc.health.v1.Health/Check"
|
|
72
|
+
*/
|
|
73
|
+
method?: string;
|
|
74
|
+
/**
|
|
75
|
+
* The inline `.proto` file source used when `serviceDefinition` is
|
|
76
|
+
* `PROTO_FILE` in `BEHAVIOR` mode.
|
|
77
|
+
*/
|
|
78
|
+
protoContent?: string;
|
|
79
|
+
/**
|
|
80
|
+
* The JSON request message sent as the gRPC call payload in `BEHAVIOR` mode.
|
|
81
|
+
*/
|
|
82
|
+
message?: string;
|
|
83
|
+
/**
|
|
84
|
+
* The service name to query in `HEALTH` mode. An empty value queries overall
|
|
85
|
+
* server health. Forbidden in `BEHAVIOR` mode.
|
|
86
|
+
*/
|
|
87
|
+
service?: string;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Configuration for gRPC requests.
|
|
91
|
+
* Defines the connection parameters and validation rules.
|
|
92
|
+
*/
|
|
93
|
+
export interface GrpcRequest {
|
|
94
|
+
/**
|
|
95
|
+
* The host to connect to. Do not include a scheme or a port in this value.
|
|
96
|
+
*
|
|
97
|
+
* @example "grpc.example.com"
|
|
98
|
+
*/
|
|
99
|
+
url: string;
|
|
100
|
+
/**
|
|
101
|
+
* The port number to connect to.
|
|
102
|
+
*
|
|
103
|
+
* @minimum 1
|
|
104
|
+
* @maximum 65535
|
|
105
|
+
* @example 50051
|
|
106
|
+
*/
|
|
107
|
+
port: number;
|
|
108
|
+
/**
|
|
109
|
+
* The IP family to use when executing the gRPC check.
|
|
110
|
+
*
|
|
111
|
+
* @defaultValue "IPv4"
|
|
112
|
+
*/
|
|
113
|
+
ipFamily?: IPFamily;
|
|
114
|
+
/**
|
|
115
|
+
* Whether to skip SSL certificate validation when `tls` is enabled.
|
|
116
|
+
*
|
|
117
|
+
* @defaultValue false
|
|
118
|
+
*/
|
|
119
|
+
skipSSL?: boolean;
|
|
120
|
+
/**
|
|
121
|
+
* The number of seconds to wait for the gRPC call to complete before timing
|
|
122
|
+
* out.
|
|
123
|
+
*
|
|
124
|
+
* @minimum 1
|
|
125
|
+
* @maximum 180
|
|
126
|
+
* @defaultValue 60
|
|
127
|
+
*/
|
|
128
|
+
timeout?: number;
|
|
129
|
+
/**
|
|
130
|
+
* The gRPC-specific configuration for the call.
|
|
131
|
+
*/
|
|
132
|
+
grpcConfig: GrpcConfig;
|
|
133
|
+
/**
|
|
134
|
+
* Assertions to validate the gRPC response.
|
|
135
|
+
*/
|
|
136
|
+
assertions?: Array<GrpcAssertion>;
|
|
137
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grpc-request.js","sourceRoot":"","sources":["../../src/constructs/grpc-request.ts"],"names":[],"mappings":""}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { valueForGeneralAssertion, valueForNumericAssertion } from './internal/assertion-codegen.js';
|
|
1
|
+
import { unsupportedAssertionSource, valueForGeneralAssertion, valueForNumericAssertion } from './internal/assertion-codegen.js';
|
|
2
2
|
export function valueForIcmpAssertion(genfile, assertion) {
|
|
3
3
|
genfile.namedImport('IcmpAssertionBuilder', 'checkly/constructs');
|
|
4
4
|
switch (assertion.source) {
|
|
@@ -12,7 +12,7 @@ export function valueForIcmpAssertion(genfile, assertion) {
|
|
|
12
12
|
hasRegex: false,
|
|
13
13
|
});
|
|
14
14
|
default:
|
|
15
|
-
|
|
15
|
+
return unsupportedAssertionSource(assertion.source, 'ICMP');
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
//# sourceMappingURL=icmp-assertion-codegen.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icmp-assertion-codegen.js","sourceRoot":"","sources":["../../src/constructs/icmp-assertion-codegen.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAA;
|
|
1
|
+
{"version":3,"file":"icmp-assertion-codegen.js","sourceRoot":"","sources":["../../src/constructs/icmp-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,WAAW,CAAC,sBAAsB,EAAE,oBAAoB,CAAC,CAAA;IAEjE,QAAQ,SAAS,CAAC,MAAM,EAAE,CAAC;QACzB,KAAK,SAAS;YACZ,OAAO,wBAAwB,CAAC,sBAAsB,EAAE,SAAS,EAAE,SAAS,EAAE;gBAC5E,WAAW,EAAE,IAAI;aAClB,CAAC,CAAA;QACJ,KAAK,eAAe;YAClB,OAAO,wBAAwB,CAAC,sBAAsB,EAAE,cAAc,EAAE,SAAS,EAAE;gBACjF,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"}
|
|
@@ -51,6 +51,6 @@ export declare class IcmpAssertionBuilder {
|
|
|
51
51
|
* @param property Optional JSONPath to specific property (e.g., '$.packetLoss')
|
|
52
52
|
* @returns A general assertion builder for the JSON formatted response.
|
|
53
53
|
*/
|
|
54
|
-
static jsonResponse(property?: string): GeneralAssertionBuilder<IcmpAssertionSource>;
|
|
54
|
+
static jsonResponse(property?: string): GeneralAssertionBuilder<IcmpAssertionSource, string | number | boolean>;
|
|
55
55
|
}
|
|
56
56
|
export {};
|
|
@@ -17,7 +17,7 @@ export interface IcmpRequest {
|
|
|
17
17
|
*
|
|
18
18
|
* @example "IPv4"
|
|
19
19
|
* @example "IPv6"
|
|
20
|
-
* @
|
|
20
|
+
* @defaultValue "IPv4"
|
|
21
21
|
*/
|
|
22
22
|
ipFamily?: IPFamily;
|
|
23
23
|
/**
|
|
@@ -27,7 +27,7 @@ export interface IcmpRequest {
|
|
|
27
27
|
* @minimum 1
|
|
28
28
|
* @maximum 50
|
|
29
29
|
* @example 10
|
|
30
|
-
* @
|
|
30
|
+
* @defaultValue 10
|
|
31
31
|
*/
|
|
32
32
|
pingCount?: number;
|
|
33
33
|
/**
|
|
@@ -51,4 +51,13 @@ export * from './dns-request.js';
|
|
|
51
51
|
export * from './icmp-monitor.js';
|
|
52
52
|
export * from './icmp-assertion.js';
|
|
53
53
|
export * from './icmp-request.js';
|
|
54
|
+
export * from './grpc-monitor.js';
|
|
55
|
+
export * from './grpc-assertion.js';
|
|
56
|
+
export * from './grpc-request.js';
|
|
57
|
+
export * from './ssl-monitor.js';
|
|
58
|
+
export * from './ssl-assertion.js';
|
|
59
|
+
export * from './ssl-request.js';
|
|
60
|
+
export * from './traceroute-monitor.js';
|
|
61
|
+
export * from './traceroute-assertion.js';
|
|
62
|
+
export * from './traceroute-request.js';
|
|
54
63
|
export * from './agentic-check.js';
|
package/dist/constructs/index.js
CHANGED
|
@@ -51,5 +51,14 @@ export * from './dns-request.js';
|
|
|
51
51
|
export * from './icmp-monitor.js';
|
|
52
52
|
export * from './icmp-assertion.js';
|
|
53
53
|
export * from './icmp-request.js';
|
|
54
|
+
export * from './grpc-monitor.js';
|
|
55
|
+
export * from './grpc-assertion.js';
|
|
56
|
+
export * from './grpc-request.js';
|
|
57
|
+
export * from './ssl-monitor.js';
|
|
58
|
+
export * from './ssl-assertion.js';
|
|
59
|
+
export * from './ssl-request.js';
|
|
60
|
+
export * from './traceroute-monitor.js';
|
|
61
|
+
export * from './traceroute-assertion.js';
|
|
62
|
+
export * from './traceroute-request.js';
|
|
54
63
|
export * from './agentic-check.js';
|
|
55
64
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/constructs/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,cAAc,CAAA;AAC5B,cAAc,wBAAwB,CAAA;AACtC,cAAc,0BAA0B,CAAA;AACxC,cAAc,0BAA0B,CAAA;AACxC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,8BAA8B,CAAA;AAC5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AAA;AAChC,cAAc,oBAAoB,CAAA;AAClC,cAAc,kBAAkB,CAAA;AAChC,cAAc,SAAS,CAAA;AACvB,cAAc,kBAAkB,CAAA;AAChC,cAAc,oBAAoB,CAAA;AAClC,cAAc,kBAAkB,CAAA;AAChC,cAAc,mBAAmB,CAAA;AACjC,cAAc,qBAAqB,CAAA;AACnC,cAAc,mBAAmB,CAAA;AACjC,cAAc,mBAAmB,CAAA;AACjC,cAAc,qBAAqB,CAAA;AACnC,cAAc,mBAAmB,CAAA;AACjC,cAAc,kBAAkB,CAAA;AAChC,cAAc,oBAAoB,CAAA;AAClC,cAAc,kBAAkB,CAAA;AAChC,cAAc,yBAAyB,CAAA;AACvC,cAAc,2BAA2B,CAAA;AACzC,cAAc,yBAAyB,CAAA;AACvC,cAAc,oBAAoB,CAAA"}
|
|
@@ -1,11 +1,22 @@
|
|
|
1
1
|
import { Value } from '../../sourcegen/index.js';
|
|
2
2
|
import { Assertion } from './assertion.js';
|
|
3
|
+
/**
|
|
4
|
+
* Rejects an assertion source that has no codegen case.
|
|
5
|
+
*
|
|
6
|
+
* The `never` parameter makes an unhandled source a compile-time error: adding a
|
|
7
|
+
* member to a monitor's assertion source union without adding the matching codegen
|
|
8
|
+
* case fails to typecheck. The runtime throw remains because wire data may carry a
|
|
9
|
+
* source this version of the CLI does not know about.
|
|
10
|
+
*/
|
|
11
|
+
export declare function unsupportedAssertionSource(source: never, kind?: string): never;
|
|
3
12
|
export interface ValueForNumericAssertionOptions {
|
|
4
13
|
hasProperty?: boolean;
|
|
5
14
|
}
|
|
6
15
|
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;
|
|
7
17
|
export interface ValueForGeneralAssertionOptions {
|
|
8
18
|
hasProperty?: boolean;
|
|
9
19
|
hasRegex?: boolean;
|
|
20
|
+
hasMatches?: boolean;
|
|
10
21
|
}
|
|
11
22
|
export declare function valueForGeneralAssertion<Source extends string>(klass: string, method: string, assertion: Assertion<Source>, options?: ValueForGeneralAssertionOptions): Value;
|
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
import { expr, ident } from '../../sourcegen/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* Rejects an assertion source that has no codegen case.
|
|
4
|
+
*
|
|
5
|
+
* The `never` parameter makes an unhandled source a compile-time error: adding a
|
|
6
|
+
* member to a monitor's assertion source union without adding the matching codegen
|
|
7
|
+
* case fails to typecheck. The runtime throw remains because wire data may carry a
|
|
8
|
+
* source this version of the CLI does not know about.
|
|
9
|
+
*/
|
|
10
|
+
export function unsupportedAssertionSource(source, kind) {
|
|
11
|
+
const prefix = kind === undefined ? 'Unsupported' : `Unsupported ${kind}`;
|
|
12
|
+
throw new Error(`${prefix} assertion source ${String(source)}`);
|
|
13
|
+
}
|
|
2
14
|
export function valueForNumericAssertion(klass, method, assertion, options) {
|
|
3
15
|
return expr(ident(klass), builder => {
|
|
4
16
|
builder.member(ident(method));
|
|
@@ -38,6 +50,24 @@ export function valueForNumericAssertion(klass, method, assertion, options) {
|
|
|
38
50
|
}
|
|
39
51
|
});
|
|
40
52
|
}
|
|
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) {
|
|
56
|
+
return expr(ident(klass), builder => {
|
|
57
|
+
builder.member(ident(method));
|
|
58
|
+
builder.call(() => { });
|
|
59
|
+
switch (assertion.comparison) {
|
|
60
|
+
case 'EQUALS':
|
|
61
|
+
builder.member(ident('equals'));
|
|
62
|
+
builder.call(builder => {
|
|
63
|
+
builder.boolean(assertion.target === 'true');
|
|
64
|
+
});
|
|
65
|
+
break;
|
|
66
|
+
default:
|
|
67
|
+
throw new Error(`Unsupported comparison ${assertion.comparison} for assertion source ${assertion.source}`);
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
}
|
|
41
71
|
export function valueForGeneralAssertion(klass, method, assertion, options) {
|
|
42
72
|
return expr(ident(klass), builder => {
|
|
43
73
|
builder.member(ident(method));
|
|
@@ -136,6 +166,15 @@ export function valueForGeneralAssertion(klass, method, assertion, options) {
|
|
|
136
166
|
builder.empty();
|
|
137
167
|
});
|
|
138
168
|
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;
|
|
139
178
|
default:
|
|
140
179
|
throw new Error(`Unsupported comparison ${assertion.comparison} for assertion source ${assertion.source}`);
|
|
141
180
|
}
|
|
@@ -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;
|
|
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;;;;;;;GAOG;AACH,MAAM,UAAU,0BAA0B,CAAE,MAAa,EAAE,IAAa;IACtE,MAAM,MAAM,GAAG,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,eAAe,IAAI,EAAE,CAAA;IACzE,MAAM,IAAI,KAAK,CAAC,GAAG,MAAM,qBAAqB,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;AACjE,CAAC;AAMD,MAAM,UAAU,wBAAwB,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AC,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"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { InvalidPropertyValueDiagnostic } from '../construct-diagnostics.js';
|
|
2
|
+
// Shared helpers for the per-monitor assertion validators. Assertion fields are
|
|
3
|
+
// declared as plain strings, so an assertion written as an object literal bypasses
|
|
4
|
+
// the builder and is type-legal; these helpers report the source/property/comparison
|
|
5
|
+
// pairings the deploy schema would reject with a 400.
|
|
6
|
+
// Formats the keys of a lookup record as a quoted, comma-separated list for an
|
|
7
|
+
// "Expected one of ..." message.
|
|
8
|
+
export function quotedKeys(values) {
|
|
9
|
+
return Object.keys(values).map(value => `"${value}"`).join(', ');
|
|
10
|
+
}
|
|
11
|
+
// Reports an invalid assertion as a fatal diagnostic. The property path is the array
|
|
12
|
+
// field itself; the offending element index and detail go in the message, following
|
|
13
|
+
// the convention in agentic-check.ts.
|
|
14
|
+
export function addAssertionDiagnostic(diagnostics, message) {
|
|
15
|
+
diagnostics.add(new InvalidPropertyValueDiagnostic('request.assertions', new Error(message)));
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=assertion-validation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assertion-validation.js","sourceRoot":"","sources":["../../../src/constructs/internal/assertion-validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE,MAAM,6BAA6B,CAAA;AAG5E,gFAAgF;AAChF,mFAAmF;AACnF,qFAAqF;AACrF,sDAAsD;AAEtD,+EAA+E;AAC/E,iCAAiC;AACjC,MAAM,UAAU,UAAU,CAAE,MAA+B;IACzD,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,KAAK,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAClE,CAAC;AAED,qFAAqF;AACrF,oFAAoF;AACpF,sCAAsC;AACtC,MAAM,UAAU,sBAAsB,CAAE,WAAwB,EAAE,OAAe;IAC/E,WAAW,CAAC,GAAG,CAAC,IAAI,8BAA8B,CAAC,oBAAoB,EAAE,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;AAC/F,CAAC"}
|
|
@@ -5,6 +5,7 @@ export interface Assertion<Source extends string> {
|
|
|
5
5
|
target: string;
|
|
6
6
|
regex: string | null;
|
|
7
7
|
}
|
|
8
|
+
export declare function toAssertion<Source extends string, Comparison extends string, Target extends string | number | boolean = string>(source: Source, comparison: Comparison, target?: Target, property?: string, regex?: string | null): Assertion<Source>;
|
|
8
9
|
export declare class NumericAssertionBuilder<Source extends string, Property extends string = string> {
|
|
9
10
|
source: Source;
|
|
10
11
|
property?: Property;
|
|
@@ -13,28 +14,33 @@ export declare class NumericAssertionBuilder<Source extends string, Property ext
|
|
|
13
14
|
notEquals(target: number): Assertion<Source>;
|
|
14
15
|
lessThan(target: number): Assertion<Source>;
|
|
15
16
|
greaterThan(target: number): Assertion<Source>;
|
|
16
|
-
/** @private */
|
|
17
|
-
private _toAssertion;
|
|
18
17
|
}
|
|
19
|
-
|
|
18
|
+
/**
|
|
19
|
+
* General assertion builder supporting string / number / boolean targets.
|
|
20
|
+
*
|
|
21
|
+
* The optional `TargetType` parameter narrows the value-comparison methods
|
|
22
|
+
* (`equals`, `notEquals`, `lessThan`, `greaterThan`)
|
|
23
|
+
* to a specific set of values — e.g. `TlsVersionValue` for TLS version
|
|
24
|
+
* assertions. When omitted it defaults to `string | number | boolean`,
|
|
25
|
+
* preserving full backward compatibility.
|
|
26
|
+
*/
|
|
27
|
+
export declare class GeneralAssertionBuilder<Source extends string, TargetType extends string | number | boolean = string | number | boolean> {
|
|
20
28
|
source: Source;
|
|
21
29
|
property?: string;
|
|
22
30
|
regex?: string;
|
|
23
31
|
constructor(source: Source, property?: string, regex?: string);
|
|
24
|
-
equals(target:
|
|
25
|
-
notEquals(target:
|
|
32
|
+
equals(target: TargetType): Assertion<Source>;
|
|
33
|
+
notEquals(target: TargetType): Assertion<Source>;
|
|
26
34
|
hasKey(target: string): Assertion<Source>;
|
|
27
35
|
notHasKey(target: string): Assertion<Source>;
|
|
28
|
-
hasValue(target:
|
|
29
|
-
notHasValue(target:
|
|
36
|
+
hasValue(target: TargetType): Assertion<Source>;
|
|
37
|
+
notHasValue(target: TargetType): Assertion<Source>;
|
|
30
38
|
isEmpty(): Assertion<Source>;
|
|
31
39
|
notEmpty(): Assertion<Source>;
|
|
32
|
-
lessThan(target:
|
|
33
|
-
greaterThan(target:
|
|
40
|
+
lessThan(target: TargetType): Assertion<Source>;
|
|
41
|
+
greaterThan(target: TargetType): Assertion<Source>;
|
|
34
42
|
contains(target: string): Assertion<Source>;
|
|
35
43
|
notContains(target: string): Assertion<Source>;
|
|
36
44
|
isNull(): Assertion<Source>;
|
|
37
45
|
isNotNull(): Assertion<Source>;
|
|
38
|
-
/** @private */
|
|
39
|
-
private _toAssertion;
|
|
40
46
|
}
|
|
@@ -1,3 +1,15 @@
|
|
|
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.
|
|
4
|
+
export function toAssertion(source, comparison, target, property, regex) {
|
|
5
|
+
return {
|
|
6
|
+
source,
|
|
7
|
+
comparison,
|
|
8
|
+
property: property ?? '',
|
|
9
|
+
target: target?.toString() ?? '',
|
|
10
|
+
regex: regex ?? null,
|
|
11
|
+
};
|
|
12
|
+
}
|
|
1
13
|
export class NumericAssertionBuilder {
|
|
2
14
|
source;
|
|
3
15
|
property;
|
|
@@ -6,28 +18,27 @@ export class NumericAssertionBuilder {
|
|
|
6
18
|
this.property = property;
|
|
7
19
|
}
|
|
8
20
|
equals(target) {
|
|
9
|
-
return this.
|
|
21
|
+
return toAssertion(this.source, 'EQUALS', target, this.property);
|
|
10
22
|
}
|
|
11
23
|
notEquals(target) {
|
|
12
|
-
return this.
|
|
24
|
+
return toAssertion(this.source, 'NOT_EQUALS', target, this.property);
|
|
13
25
|
}
|
|
14
26
|
lessThan(target) {
|
|
15
|
-
return this.
|
|
27
|
+
return toAssertion(this.source, 'LESS_THAN', target, this.property);
|
|
16
28
|
}
|
|
17
29
|
greaterThan(target) {
|
|
18
|
-
return this.
|
|
19
|
-
}
|
|
20
|
-
/** @private */
|
|
21
|
-
_toAssertion(comparison, target) {
|
|
22
|
-
return {
|
|
23
|
-
source: this.source,
|
|
24
|
-
comparison,
|
|
25
|
-
property: this.property ?? '',
|
|
26
|
-
target: target.toString(),
|
|
27
|
-
regex: null,
|
|
28
|
-
};
|
|
30
|
+
return toAssertion(this.source, 'GREATER_THAN', target, this.property);
|
|
29
31
|
}
|
|
30
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
* General assertion builder supporting string / number / boolean targets.
|
|
35
|
+
*
|
|
36
|
+
* The optional `TargetType` parameter narrows the value-comparison methods
|
|
37
|
+
* (`equals`, `notEquals`, `lessThan`, `greaterThan`)
|
|
38
|
+
* to a specific set of values — e.g. `TlsVersionValue` for TLS version
|
|
39
|
+
* assertions. When omitted it defaults to `string | number | boolean`,
|
|
40
|
+
* preserving full backward compatibility.
|
|
41
|
+
*/
|
|
31
42
|
export class GeneralAssertionBuilder {
|
|
32
43
|
source;
|
|
33
44
|
property;
|
|
@@ -38,56 +49,46 @@ export class GeneralAssertionBuilder {
|
|
|
38
49
|
this.regex = regex;
|
|
39
50
|
}
|
|
40
51
|
equals(target) {
|
|
41
|
-
return this.
|
|
52
|
+
return toAssertion(this.source, 'EQUALS', target, this.property, this.regex);
|
|
42
53
|
}
|
|
43
54
|
notEquals(target) {
|
|
44
|
-
return this.
|
|
55
|
+
return toAssertion(this.source, 'NOT_EQUALS', target, this.property, this.regex);
|
|
45
56
|
}
|
|
46
57
|
hasKey(target) {
|
|
47
|
-
return this.
|
|
58
|
+
return toAssertion(this.source, 'HAS_KEY', target, this.property, this.regex);
|
|
48
59
|
}
|
|
49
60
|
notHasKey(target) {
|
|
50
|
-
return this.
|
|
61
|
+
return toAssertion(this.source, 'NOT_HAS_KEY', target, this.property, this.regex);
|
|
51
62
|
}
|
|
52
63
|
hasValue(target) {
|
|
53
|
-
return this.
|
|
64
|
+
return toAssertion(this.source, 'HAS_VALUE', target, this.property, this.regex);
|
|
54
65
|
}
|
|
55
66
|
notHasValue(target) {
|
|
56
|
-
return this.
|
|
67
|
+
return toAssertion(this.source, 'NOT_HAS_VALUE', target, this.property, this.regex);
|
|
57
68
|
}
|
|
58
69
|
isEmpty() {
|
|
59
|
-
return this.
|
|
70
|
+
return toAssertion(this.source, 'IS_EMPTY', undefined, this.property, this.regex);
|
|
60
71
|
}
|
|
61
72
|
notEmpty() {
|
|
62
|
-
return this.
|
|
73
|
+
return toAssertion(this.source, 'NOT_EMPTY', undefined, this.property, this.regex);
|
|
63
74
|
}
|
|
64
75
|
lessThan(target) {
|
|
65
|
-
return this.
|
|
76
|
+
return toAssertion(this.source, 'LESS_THAN', target, this.property, this.regex);
|
|
66
77
|
}
|
|
67
78
|
greaterThan(target) {
|
|
68
|
-
return this.
|
|
79
|
+
return toAssertion(this.source, 'GREATER_THAN', target, this.property, this.regex);
|
|
69
80
|
}
|
|
70
81
|
contains(target) {
|
|
71
|
-
return this.
|
|
82
|
+
return toAssertion(this.source, 'CONTAINS', target, this.property, this.regex);
|
|
72
83
|
}
|
|
73
84
|
notContains(target) {
|
|
74
|
-
return this.
|
|
85
|
+
return toAssertion(this.source, 'NOT_CONTAINS', target, this.property, this.regex);
|
|
75
86
|
}
|
|
76
87
|
isNull() {
|
|
77
|
-
return this.
|
|
88
|
+
return toAssertion(this.source, 'IS_NULL', undefined, this.property, this.regex);
|
|
78
89
|
}
|
|
79
90
|
isNotNull() {
|
|
80
|
-
return this.
|
|
81
|
-
}
|
|
82
|
-
/** @private */
|
|
83
|
-
_toAssertion(comparison, target) {
|
|
84
|
-
return {
|
|
85
|
-
source: this.source,
|
|
86
|
-
comparison,
|
|
87
|
-
property: this.property ?? '',
|
|
88
|
-
target: target?.toString() ?? '',
|
|
89
|
-
regex: this.regex ?? null,
|
|
90
|
-
};
|
|
91
|
+
return toAssertion(this.source, 'NOT_NULL', undefined, this.property, this.regex);
|
|
91
92
|
}
|
|
92
93
|
}
|
|
93
94
|
//# sourceMappingURL=assertion.js.map
|