@griffin-app/griffin-ts 0.1.1 → 0.1.3
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/assertions.js +7 -13
- package/dist/assertions.js.map +1 -1
- package/dist/builder.js +10 -16
- package/dist/builder.js.map +1 -1
- package/dist/constants.js +2 -5
- package/dist/constants.js.map +1 -1
- package/dist/example-sequential.js +64 -66
- package/dist/example-sequential.js.map +1 -1
- package/dist/example.js +14 -16
- package/dist/example.js.map +1 -1
- package/dist/frequency.js +9 -13
- package/dist/frequency.js.map +1 -1
- package/dist/http-methods.js +5 -8
- package/dist/http-methods.js.map +1 -1
- package/dist/index.js +11 -40
- package/dist/index.js.map +1 -1
- package/dist/response-formats.js +3 -6
- package/dist/response-formats.js.map +1 -1
- package/dist/schema-exports.js +4 -34
- package/dist/schema-exports.js.map +1 -1
- package/dist/schema.js +137 -140
- package/dist/schema.js.map +1 -1
- package/dist/secrets.js +2 -6
- package/dist/secrets.js.map +1 -1
- package/dist/sequential-builder.js +14 -17
- package/dist/sequential-builder.js.map +1 -1
- package/dist/shared.js +5 -11
- package/dist/shared.js.map +1 -1
- package/dist/type-exports.js +1 -2
- package/dist/type-exports.js.map +1 -1
- package/dist/variable.js +2 -6
- package/dist/variable.js.map +1 -1
- package/dist/wait.js +1 -4
- package/dist/wait.js.map +1 -1
- package/package.json +2 -1
- package/tsconfig.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,62 +1,33 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* Griffin DSL - Top-level exports for building API tests.
|
|
4
3
|
*
|
|
5
4
|
* Import schema values from "griffin/schema"
|
|
6
5
|
* Import schema-derived types from "griffin/types"
|
|
7
6
|
*/
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.createStateProxy = exports.BinaryPredicateOperator = exports.UnaryPredicate = exports.AssertBuilder = exports.Assert = exports.Text = exports.Xml = exports.Json = exports.PATCH = exports.DELETE = exports.PUT = exports.POST = exports.GET = exports.END = exports.START = exports.isSecretRef = exports.secret = exports.isVariableRef = exports.variable = exports.WaitDuration = exports.Frequency = exports.Assertion = exports.Wait = exports.Endpoint = exports.createTestBuilder = exports.createGraphBuilder = void 0;
|
|
10
7
|
// ============================================================================
|
|
11
8
|
// DSL Builders
|
|
12
9
|
// ============================================================================
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
var sequential_builder_1 = require("./sequential-builder");
|
|
16
|
-
Object.defineProperty(exports, "createTestBuilder", { enumerable: true, get: function () { return sequential_builder_1.createTestBuilder; } });
|
|
10
|
+
export { createGraphBuilder } from "./builder";
|
|
11
|
+
export { createTestBuilder } from "./sequential-builder";
|
|
17
12
|
// ============================================================================
|
|
18
13
|
// DSL Node Factories
|
|
19
14
|
// ============================================================================
|
|
20
|
-
|
|
21
|
-
Object.defineProperty(exports, "Endpoint", { enumerable: true, get: function () { return builder_2.Endpoint; } });
|
|
22
|
-
Object.defineProperty(exports, "Wait", { enumerable: true, get: function () { return builder_2.Wait; } });
|
|
23
|
-
Object.defineProperty(exports, "Assertion", { enumerable: true, get: function () { return builder_2.Assertion; } });
|
|
15
|
+
export { Endpoint, Wait, Assertion } from "./builder";
|
|
24
16
|
// ============================================================================
|
|
25
17
|
// DSL Helpers
|
|
26
18
|
// ============================================================================
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
var variable_1 = require("./variable");
|
|
32
|
-
Object.defineProperty(exports, "variable", { enumerable: true, get: function () { return variable_1.variable; } });
|
|
33
|
-
Object.defineProperty(exports, "isVariableRef", { enumerable: true, get: function () { return variable_1.isVariableRef; } });
|
|
34
|
-
var secrets_1 = require("./secrets");
|
|
35
|
-
Object.defineProperty(exports, "secret", { enumerable: true, get: function () { return secrets_1.secret; } });
|
|
36
|
-
Object.defineProperty(exports, "isSecretRef", { enumerable: true, get: function () { return secrets_1.isSecretRef; } });
|
|
19
|
+
export { Frequency } from "./frequency";
|
|
20
|
+
export { WaitDuration } from "./wait";
|
|
21
|
+
export { variable, isVariableRef } from "./variable";
|
|
22
|
+
export { secret, isSecretRef } from "./secrets";
|
|
37
23
|
// ============================================================================
|
|
38
24
|
// DSL Constants
|
|
39
25
|
// ============================================================================
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
var http_methods_1 = require("./http-methods");
|
|
44
|
-
Object.defineProperty(exports, "GET", { enumerable: true, get: function () { return http_methods_1.GET; } });
|
|
45
|
-
Object.defineProperty(exports, "POST", { enumerable: true, get: function () { return http_methods_1.POST; } });
|
|
46
|
-
Object.defineProperty(exports, "PUT", { enumerable: true, get: function () { return http_methods_1.PUT; } });
|
|
47
|
-
Object.defineProperty(exports, "DELETE", { enumerable: true, get: function () { return http_methods_1.DELETE; } });
|
|
48
|
-
Object.defineProperty(exports, "PATCH", { enumerable: true, get: function () { return http_methods_1.PATCH; } });
|
|
49
|
-
var response_formats_1 = require("./response-formats");
|
|
50
|
-
Object.defineProperty(exports, "Json", { enumerable: true, get: function () { return response_formats_1.Json; } });
|
|
51
|
-
Object.defineProperty(exports, "Xml", { enumerable: true, get: function () { return response_formats_1.Xml; } });
|
|
52
|
-
Object.defineProperty(exports, "Text", { enumerable: true, get: function () { return response_formats_1.Text; } });
|
|
26
|
+
export { START, END } from "./constants";
|
|
27
|
+
export { GET, POST, PUT, DELETE, PATCH } from "./http-methods";
|
|
28
|
+
export { Json, Xml, Text } from "./response-formats";
|
|
53
29
|
// ============================================================================
|
|
54
30
|
// Assertion DSL
|
|
55
31
|
// ============================================================================
|
|
56
|
-
|
|
57
|
-
Object.defineProperty(exports, "Assert", { enumerable: true, get: function () { return assertions_1.Assert; } });
|
|
58
|
-
Object.defineProperty(exports, "AssertBuilder", { enumerable: true, get: function () { return assertions_1.AssertBuilder; } });
|
|
59
|
-
Object.defineProperty(exports, "UnaryPredicate", { enumerable: true, get: function () { return assertions_1.UnaryPredicate; } });
|
|
60
|
-
Object.defineProperty(exports, "BinaryPredicateOperator", { enumerable: true, get: function () { return assertions_1.BinaryPredicateOperator; } });
|
|
61
|
-
Object.defineProperty(exports, "createStateProxy", { enumerable: true, get: function () { return assertions_1.createStateProxy; } });
|
|
32
|
+
export { Assert, AssertBuilder, UnaryPredicate, BinaryPredicateOperator, createStateProxy, } from "./assertions";
|
|
62
33
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,+EAA+E;AAC/E,eAAe;AACf,+EAA+E;AAE/E,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAG/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAMzD,+EAA+E;AAC/E,qBAAqB;AACrB,+EAA+E;AAE/E,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAMtD,+EAA+E;AAC/E,cAAc;AACd,+EAA+E;AAE/E,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAErD,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAGhD,+EAA+E;AAC/E,gBAAgB;AAChB,+EAA+E;AAE/E,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAGzC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAC/D,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAErD,+EAA+E;AAC/E,gBAAgB;AAChB,+EAA+E;AAE/E,OAAO,EACL,MAAM,EACN,aAAa,EACb,cAAc,EACd,uBAAuB,EACvB,gBAAgB,GACjB,MAAM,cAAc,CAAC"}
|
package/dist/response-formats.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
exports.Json = "JSON";
|
|
5
|
-
exports.Xml = "XML";
|
|
6
|
-
exports.Text = "TEXT";
|
|
1
|
+
export const Json = "JSON";
|
|
2
|
+
export const Xml = "XML";
|
|
3
|
+
export const Text = "TEXT";
|
|
7
4
|
//# sourceMappingURL=response-formats.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"response-formats.js","sourceRoot":"","sources":["../src/response-formats.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"response-formats.js","sourceRoot":"","sources":["../src/response-formats.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,IAAI,GAAG,MAAe,CAAC;AACpC,MAAM,CAAC,MAAM,GAAG,GAAG,KAAc,CAAC;AAClC,MAAM,CAAC,MAAM,IAAI,GAAG,MAAe,CAAC"}
|
package/dist/schema-exports.js
CHANGED
|
@@ -1,42 +1,12 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* TypeBox schemas and enums for griffin test plans.
|
|
4
3
|
* Import from "griffin/schema" to access validation schemas.
|
|
5
4
|
*/
|
|
6
|
-
|
|
7
|
-
exports.TEST_PLAN_VERSION = exports.BinaryPredicateOperator = exports.UnaryPredicate = exports.NodeType = exports.HttpMethod = exports.ResponseFormat = exports.FrequencyUnit = exports.TestPlanV1Schema = exports.EdgeSchema = exports.NodeSchema = exports.NodeTypeSchema = exports.AssertionsSchema = exports.AssertionSchema = exports.TextAssertionSchema = exports.XMLAssertionSchema = exports.JSONAssertionSchema = exports.BinaryPredicateSchema = exports.BinaryPredicateOperatorSchema = exports.UnaryPredicateSchema = exports.TextPathSchema = exports.XMLPathSchema = exports.JSONPathSchema = exports.WaitSchema = exports.FrequencySchema = exports.EndpointSchema = exports.HttpMethodSchema = exports.ResponseFormatSchema = exports.SecretOrStringSchema = exports.SecretRefSchema = exports.SecretRefDataSchema = void 0;
|
|
8
|
-
var schema_js_1 = require("./schema.js");
|
|
5
|
+
export {
|
|
9
6
|
// Schema values
|
|
10
|
-
|
|
11
|
-
Object.defineProperty(exports, "SecretRefSchema", { enumerable: true, get: function () { return schema_js_1.SecretRefSchema; } });
|
|
12
|
-
Object.defineProperty(exports, "SecretOrStringSchema", { enumerable: true, get: function () { return schema_js_1.SecretOrStringSchema; } });
|
|
13
|
-
Object.defineProperty(exports, "ResponseFormatSchema", { enumerable: true, get: function () { return schema_js_1.ResponseFormatSchema; } });
|
|
14
|
-
Object.defineProperty(exports, "HttpMethodSchema", { enumerable: true, get: function () { return schema_js_1.HttpMethodSchema; } });
|
|
15
|
-
Object.defineProperty(exports, "EndpointSchema", { enumerable: true, get: function () { return schema_js_1.EndpointSchema; } });
|
|
16
|
-
Object.defineProperty(exports, "FrequencySchema", { enumerable: true, get: function () { return schema_js_1.FrequencySchema; } });
|
|
17
|
-
Object.defineProperty(exports, "WaitSchema", { enumerable: true, get: function () { return schema_js_1.WaitSchema; } });
|
|
18
|
-
Object.defineProperty(exports, "JSONPathSchema", { enumerable: true, get: function () { return schema_js_1.JSONPathSchema; } });
|
|
19
|
-
Object.defineProperty(exports, "XMLPathSchema", { enumerable: true, get: function () { return schema_js_1.XMLPathSchema; } });
|
|
20
|
-
Object.defineProperty(exports, "TextPathSchema", { enumerable: true, get: function () { return schema_js_1.TextPathSchema; } });
|
|
21
|
-
Object.defineProperty(exports, "UnaryPredicateSchema", { enumerable: true, get: function () { return schema_js_1.UnaryPredicateSchema; } });
|
|
22
|
-
Object.defineProperty(exports, "BinaryPredicateOperatorSchema", { enumerable: true, get: function () { return schema_js_1.BinaryPredicateOperatorSchema; } });
|
|
23
|
-
Object.defineProperty(exports, "BinaryPredicateSchema", { enumerable: true, get: function () { return schema_js_1.BinaryPredicateSchema; } });
|
|
24
|
-
Object.defineProperty(exports, "JSONAssertionSchema", { enumerable: true, get: function () { return schema_js_1.JSONAssertionSchema; } });
|
|
25
|
-
Object.defineProperty(exports, "XMLAssertionSchema", { enumerable: true, get: function () { return schema_js_1.XMLAssertionSchema; } });
|
|
26
|
-
Object.defineProperty(exports, "TextAssertionSchema", { enumerable: true, get: function () { return schema_js_1.TextAssertionSchema; } });
|
|
27
|
-
Object.defineProperty(exports, "AssertionSchema", { enumerable: true, get: function () { return schema_js_1.AssertionSchema; } });
|
|
28
|
-
Object.defineProperty(exports, "AssertionsSchema", { enumerable: true, get: function () { return schema_js_1.AssertionsSchema; } });
|
|
29
|
-
Object.defineProperty(exports, "NodeTypeSchema", { enumerable: true, get: function () { return schema_js_1.NodeTypeSchema; } });
|
|
30
|
-
Object.defineProperty(exports, "NodeSchema", { enumerable: true, get: function () { return schema_js_1.NodeSchema; } });
|
|
31
|
-
Object.defineProperty(exports, "EdgeSchema", { enumerable: true, get: function () { return schema_js_1.EdgeSchema; } });
|
|
32
|
-
Object.defineProperty(exports, "TestPlanV1Schema", { enumerable: true, get: function () { return schema_js_1.TestPlanV1Schema; } });
|
|
7
|
+
SecretRefDataSchema, SecretRefSchema, SecretOrStringSchema, ResponseFormatSchema, HttpMethodSchema, EndpointSchema, FrequencySchema, WaitSchema, JSONPathSchema, XMLPathSchema, TextPathSchema, UnaryPredicateSchema, BinaryPredicateOperatorSchema, BinaryPredicateSchema, JSONAssertionSchema, XMLAssertionSchema, TextAssertionSchema, AssertionSchema, AssertionsSchema, NodeTypeSchema, NodeSchema, EdgeSchema, TestPlanV1Schema,
|
|
33
8
|
// Enums (runtime values)
|
|
34
|
-
|
|
35
|
-
Object.defineProperty(exports, "ResponseFormat", { enumerable: true, get: function () { return schema_js_1.ResponseFormat; } });
|
|
36
|
-
Object.defineProperty(exports, "HttpMethod", { enumerable: true, get: function () { return schema_js_1.HttpMethod; } });
|
|
37
|
-
Object.defineProperty(exports, "NodeType", { enumerable: true, get: function () { return schema_js_1.NodeType; } });
|
|
38
|
-
Object.defineProperty(exports, "UnaryPredicate", { enumerable: true, get: function () { return schema_js_1.UnaryPredicate; } });
|
|
39
|
-
Object.defineProperty(exports, "BinaryPredicateOperator", { enumerable: true, get: function () { return schema_js_1.BinaryPredicateOperator; } });
|
|
9
|
+
FrequencyUnit, ResponseFormat, HttpMethod, NodeType, UnaryPredicate, BinaryPredicateOperator,
|
|
40
10
|
// Constants
|
|
41
|
-
|
|
11
|
+
TEST_PLAN_VERSION, } from "./schema.js";
|
|
42
12
|
//# sourceMappingURL=schema-exports.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-exports.js","sourceRoot":"","sources":["../src/schema-exports.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"schema-exports.js","sourceRoot":"","sources":["../src/schema-exports.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO;AACL,gBAAgB;AAChB,mBAAmB,EACnB,eAAe,EACf,oBAAoB,EACpB,oBAAoB,EACpB,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,UAAU,EACV,cAAc,EACd,aAAa,EACb,cAAc,EACd,oBAAoB,EACpB,6BAA6B,EAC7B,qBAAqB,EACrB,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,UAAU,EACV,gBAAgB;AAEhB,yBAAyB;AACzB,aAAa,EACb,cAAc,EACd,UAAU,EACV,QAAQ,EACR,cAAc,EACd,uBAAuB;AAEvB,YAAY;AACZ,iBAAiB,GAClB,MAAM,aAAa,CAAC"}
|
package/dist/schema.js
CHANGED
|
@@ -1,36 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.TestPlanV1Schema = exports.EdgeSchema = exports.NodeSchema = exports.NodeTypeSchema = exports.AssertionsSchema = exports.AssertionSchema = exports.TextAssertionSchema = exports.XMLAssertionSchema = exports.JSONAssertionSchema = exports.BinaryPredicateSchema = exports.BinaryPredicateOperatorSchema = exports.BinaryPredicateOperator = exports.UnaryPredicateSchema = exports.UnaryPredicate = exports.TextPathSchema = exports.XMLPathSchema = exports.JSONPathSchema = exports.WaitSchema = exports.FrequencySchema = exports.EndpointSchema = exports.VariableRefSchema = exports.HttpMethodSchema = exports.ResponseFormatSchema = exports.NodeType = exports.HttpMethod = exports.ResponseFormat = exports.FrequencyUnit = exports.SecretOrStringSchema = exports.SecretRefSchema = exports.SecretRefDataSchema = exports.TEST_PLAN_VERSION = void 0;
|
|
4
|
-
const typebox_1 = require("typebox");
|
|
5
|
-
exports.TEST_PLAN_VERSION = "1.0";
|
|
1
|
+
import { Type } from "typebox";
|
|
2
|
+
export const TEST_PLAN_VERSION = "1.0";
|
|
6
3
|
// Secret reference schema for values that may contain secrets
|
|
7
|
-
|
|
8
|
-
provider:
|
|
9
|
-
ref:
|
|
10
|
-
version:
|
|
11
|
-
field:
|
|
4
|
+
export const SecretRefDataSchema = Type.Object({
|
|
5
|
+
provider: Type.String(),
|
|
6
|
+
ref: Type.String(),
|
|
7
|
+
version: Type.Optional(Type.String()),
|
|
8
|
+
field: Type.Optional(Type.String()),
|
|
12
9
|
});
|
|
13
|
-
|
|
14
|
-
$secret:
|
|
10
|
+
export const SecretRefSchema = Type.Object({
|
|
11
|
+
$secret: SecretRefDataSchema,
|
|
15
12
|
});
|
|
16
13
|
// Union type for values that can be either a literal or a secret reference
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
export const SecretOrStringSchema = Type.Union([
|
|
15
|
+
Type.String(),
|
|
16
|
+
SecretRefSchema,
|
|
20
17
|
]);
|
|
21
|
-
var FrequencyUnit;
|
|
18
|
+
export var FrequencyUnit;
|
|
22
19
|
(function (FrequencyUnit) {
|
|
23
20
|
FrequencyUnit["MINUTE"] = "MINUTE";
|
|
24
21
|
FrequencyUnit["HOUR"] = "HOUR";
|
|
25
22
|
FrequencyUnit["DAY"] = "DAY";
|
|
26
|
-
})(FrequencyUnit || (
|
|
27
|
-
var ResponseFormat;
|
|
23
|
+
})(FrequencyUnit || (FrequencyUnit = {}));
|
|
24
|
+
export var ResponseFormat;
|
|
28
25
|
(function (ResponseFormat) {
|
|
29
26
|
ResponseFormat["JSON"] = "JSON";
|
|
30
27
|
ResponseFormat["XML"] = "XML";
|
|
31
28
|
ResponseFormat["TEXT"] = "TEXT";
|
|
32
|
-
})(ResponseFormat || (
|
|
33
|
-
var HttpMethod;
|
|
29
|
+
})(ResponseFormat || (ResponseFormat = {}));
|
|
30
|
+
export var HttpMethod;
|
|
34
31
|
(function (HttpMethod) {
|
|
35
32
|
HttpMethod["GET"] = "GET";
|
|
36
33
|
HttpMethod["POST"] = "POST";
|
|
@@ -41,62 +38,62 @@ var HttpMethod;
|
|
|
41
38
|
HttpMethod["OPTIONS"] = "OPTIONS";
|
|
42
39
|
HttpMethod["CONNECT"] = "CONNECT";
|
|
43
40
|
HttpMethod["TRACE"] = "TRACE";
|
|
44
|
-
})(HttpMethod || (
|
|
45
|
-
var NodeType;
|
|
41
|
+
})(HttpMethod || (HttpMethod = {}));
|
|
42
|
+
export var NodeType;
|
|
46
43
|
(function (NodeType) {
|
|
47
44
|
NodeType["ENDPOINT"] = "ENDPOINT";
|
|
48
45
|
NodeType["WAIT"] = "WAIT";
|
|
49
46
|
NodeType["ASSERTION"] = "ASSERTION";
|
|
50
|
-
})(NodeType || (
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
47
|
+
})(NodeType || (NodeType = {}));
|
|
48
|
+
export const ResponseFormatSchema = Type.Union([
|
|
49
|
+
Type.Literal(ResponseFormat.JSON),
|
|
50
|
+
Type.Literal(ResponseFormat.XML),
|
|
51
|
+
Type.Literal(ResponseFormat.TEXT),
|
|
55
52
|
], { $id: "ResponseFormat" });
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
53
|
+
export const HttpMethodSchema = Type.Union([
|
|
54
|
+
Type.Literal(HttpMethod.GET),
|
|
55
|
+
Type.Literal(HttpMethod.POST),
|
|
56
|
+
Type.Literal(HttpMethod.PUT),
|
|
57
|
+
Type.Literal(HttpMethod.DELETE),
|
|
58
|
+
Type.Literal(HttpMethod.PATCH),
|
|
59
|
+
Type.Literal(HttpMethod.HEAD),
|
|
60
|
+
Type.Literal(HttpMethod.OPTIONS),
|
|
61
|
+
Type.Literal(HttpMethod.CONNECT),
|
|
62
|
+
Type.Literal(HttpMethod.TRACE),
|
|
66
63
|
], { $id: "HttpMethod" });
|
|
67
|
-
|
|
68
|
-
$variable:
|
|
69
|
-
key:
|
|
70
|
-
template:
|
|
64
|
+
export const VariableRefSchema = Type.Object({
|
|
65
|
+
$variable: Type.Object({
|
|
66
|
+
key: Type.String(),
|
|
67
|
+
template: Type.Optional(Type.String()),
|
|
71
68
|
}),
|
|
72
69
|
});
|
|
73
|
-
|
|
74
|
-
id:
|
|
75
|
-
type:
|
|
76
|
-
method:
|
|
77
|
-
path:
|
|
78
|
-
base:
|
|
79
|
-
headers:
|
|
80
|
-
body:
|
|
81
|
-
response_format:
|
|
70
|
+
export const EndpointSchema = Type.Object({
|
|
71
|
+
id: Type.String(),
|
|
72
|
+
type: Type.Literal(NodeType.ENDPOINT),
|
|
73
|
+
method: HttpMethodSchema,
|
|
74
|
+
path: Type.Union([Type.String(), VariableRefSchema]),
|
|
75
|
+
base: Type.Union([Type.String(), VariableRefSchema]),
|
|
76
|
+
headers: Type.Optional(Type.Record(Type.String(), SecretOrStringSchema)),
|
|
77
|
+
body: Type.Optional(Type.Any()), // Body can contain nested SecretRefs
|
|
78
|
+
response_format: ResponseFormatSchema,
|
|
82
79
|
}, { $id: "Endpoint" });
|
|
83
|
-
|
|
84
|
-
every:
|
|
85
|
-
unit:
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
80
|
+
export const FrequencySchema = Type.Object({
|
|
81
|
+
every: Type.Number(),
|
|
82
|
+
unit: Type.Union([
|
|
83
|
+
Type.Literal(FrequencyUnit.MINUTE),
|
|
84
|
+
Type.Literal(FrequencyUnit.HOUR),
|
|
85
|
+
Type.Literal(FrequencyUnit.DAY),
|
|
89
86
|
]),
|
|
90
87
|
}, { $id: "Frequency" });
|
|
91
|
-
|
|
92
|
-
id:
|
|
93
|
-
type:
|
|
94
|
-
duration_ms:
|
|
88
|
+
export const WaitSchema = Type.Object({
|
|
89
|
+
id: Type.String(),
|
|
90
|
+
type: Type.Literal(NodeType.WAIT),
|
|
91
|
+
duration_ms: Type.Number(),
|
|
95
92
|
}, { $id: "Wait" });
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
var UnaryPredicate;
|
|
93
|
+
export const JSONPathSchema = Type.Array(Type.String());
|
|
94
|
+
export const XMLPathSchema = Type.Array(Type.String());
|
|
95
|
+
export const TextPathSchema = Type.String(); // Is there a regex to validate regex ????
|
|
96
|
+
export var UnaryPredicate;
|
|
100
97
|
(function (UnaryPredicate) {
|
|
101
98
|
UnaryPredicate["IS_NULL"] = "IS_NULL";
|
|
102
99
|
UnaryPredicate["IS_NOT_NULL"] = "IS_NOT_NULL";
|
|
@@ -104,16 +101,16 @@ var UnaryPredicate;
|
|
|
104
101
|
UnaryPredicate["IS_FALSE"] = "IS_FALSE";
|
|
105
102
|
UnaryPredicate["IS_EMPTY"] = "IS_EMPTY";
|
|
106
103
|
UnaryPredicate["IS_NOT_EMPTY"] = "IS_NOT_EMPTY";
|
|
107
|
-
})(UnaryPredicate || (
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
104
|
+
})(UnaryPredicate || (UnaryPredicate = {}));
|
|
105
|
+
export const UnaryPredicateSchema = Type.Union([
|
|
106
|
+
Type.Literal(UnaryPredicate.IS_NULL),
|
|
107
|
+
Type.Literal(UnaryPredicate.IS_NOT_NULL),
|
|
108
|
+
Type.Literal(UnaryPredicate.IS_TRUE),
|
|
109
|
+
Type.Literal(UnaryPredicate.IS_FALSE),
|
|
110
|
+
Type.Literal(UnaryPredicate.IS_EMPTY),
|
|
111
|
+
Type.Literal(UnaryPredicate.IS_NOT_EMPTY),
|
|
115
112
|
], { $id: "UnaryPredicate" });
|
|
116
|
-
var BinaryPredicateOperator;
|
|
113
|
+
export var BinaryPredicateOperator;
|
|
117
114
|
(function (BinaryPredicateOperator) {
|
|
118
115
|
BinaryPredicateOperator["EQUAL"] = "EQUAL";
|
|
119
116
|
BinaryPredicateOperator["NOT_EQUAL"] = "NOT_EQUAL";
|
|
@@ -127,89 +124,89 @@ var BinaryPredicateOperator;
|
|
|
127
124
|
BinaryPredicateOperator["ENDS_WITH"] = "ENDS_WITH";
|
|
128
125
|
BinaryPredicateOperator["NOT_STARTS_WITH"] = "NOT_STARTS_WITH";
|
|
129
126
|
BinaryPredicateOperator["NOT_ENDS_WITH"] = "NOT_ENDS_WITH";
|
|
130
|
-
})(BinaryPredicateOperator || (
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
127
|
+
})(BinaryPredicateOperator || (BinaryPredicateOperator = {}));
|
|
128
|
+
export const BinaryPredicateOperatorSchema = Type.Union([
|
|
129
|
+
Type.Literal(BinaryPredicateOperator.EQUAL),
|
|
130
|
+
Type.Literal(BinaryPredicateOperator.NOT_EQUAL),
|
|
131
|
+
Type.Literal(BinaryPredicateOperator.GREATER_THAN),
|
|
132
|
+
Type.Literal(BinaryPredicateOperator.LESS_THAN),
|
|
133
|
+
Type.Literal(BinaryPredicateOperator.GREATER_THAN_OR_EQUAL),
|
|
134
|
+
Type.Literal(BinaryPredicateOperator.LESS_THAN_OR_EQUAL),
|
|
135
|
+
Type.Literal(BinaryPredicateOperator.CONTAINS),
|
|
136
|
+
Type.Literal(BinaryPredicateOperator.NOT_CONTAINS),
|
|
137
|
+
Type.Literal(BinaryPredicateOperator.STARTS_WITH),
|
|
138
|
+
Type.Literal(BinaryPredicateOperator.ENDS_WITH),
|
|
139
|
+
Type.Literal(BinaryPredicateOperator.NOT_STARTS_WITH),
|
|
140
|
+
Type.Literal(BinaryPredicateOperator.NOT_ENDS_WITH),
|
|
144
141
|
], { $id: "BinaryPredicateOperator" });
|
|
145
|
-
|
|
146
|
-
expected:
|
|
147
|
-
operator:
|
|
142
|
+
export const BinaryPredicateSchema = Type.Object({
|
|
143
|
+
expected: Type.Any(),
|
|
144
|
+
operator: BinaryPredicateOperatorSchema,
|
|
148
145
|
}, { $id: "BinaryPredicate" });
|
|
149
|
-
|
|
150
|
-
nodeId:
|
|
151
|
-
accessor:
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
146
|
+
export const JSONAssertionSchema = Type.Object({
|
|
147
|
+
nodeId: Type.String(),
|
|
148
|
+
accessor: Type.Union([
|
|
149
|
+
Type.Literal("body"),
|
|
150
|
+
Type.Literal("headers"),
|
|
151
|
+
Type.Literal("status"),
|
|
155
152
|
]),
|
|
156
|
-
path:
|
|
157
|
-
predicate:
|
|
153
|
+
path: JSONPathSchema,
|
|
154
|
+
predicate: Type.Union([UnaryPredicateSchema, BinaryPredicateSchema]),
|
|
158
155
|
}, { $id: "JSONAssertion" });
|
|
159
|
-
|
|
160
|
-
path:
|
|
161
|
-
expected:
|
|
156
|
+
export const XMLAssertionSchema = Type.Object({
|
|
157
|
+
path: XMLPathSchema,
|
|
158
|
+
expected: Type.Any(),
|
|
162
159
|
});
|
|
163
|
-
|
|
164
|
-
path:
|
|
165
|
-
expected:
|
|
160
|
+
export const TextAssertionSchema = Type.Object({
|
|
161
|
+
path: TextPathSchema,
|
|
162
|
+
expected: Type.Any(),
|
|
166
163
|
});
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
assertionType:
|
|
164
|
+
export const AssertionSchema = Type.Union([
|
|
165
|
+
Type.Intersect([
|
|
166
|
+
Type.Object({
|
|
167
|
+
assertionType: Type.Literal(ResponseFormat.JSON),
|
|
171
168
|
}),
|
|
172
|
-
|
|
169
|
+
JSONAssertionSchema,
|
|
173
170
|
]),
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
assertionType:
|
|
171
|
+
Type.Intersect([
|
|
172
|
+
Type.Object({
|
|
173
|
+
assertionType: Type.Literal(ResponseFormat.XML),
|
|
177
174
|
}),
|
|
178
|
-
|
|
175
|
+
XMLAssertionSchema,
|
|
179
176
|
]),
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
assertionType:
|
|
177
|
+
Type.Intersect([
|
|
178
|
+
Type.Object({
|
|
179
|
+
assertionType: Type.Literal(ResponseFormat.TEXT),
|
|
183
180
|
}),
|
|
184
|
-
|
|
181
|
+
TextAssertionSchema,
|
|
185
182
|
]),
|
|
186
183
|
], { $id: "Assertion" });
|
|
187
|
-
|
|
188
|
-
id:
|
|
189
|
-
type:
|
|
190
|
-
assertions:
|
|
184
|
+
export const AssertionsSchema = Type.Object({
|
|
185
|
+
id: Type.String(),
|
|
186
|
+
type: Type.Literal(NodeType.ASSERTION),
|
|
187
|
+
assertions: Type.Array(AssertionSchema),
|
|
191
188
|
}, { $id: "Assertions" });
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
189
|
+
export const NodeTypeSchema = Type.Union([
|
|
190
|
+
Type.Literal(NodeType.ENDPOINT),
|
|
191
|
+
Type.Literal(NodeType.WAIT),
|
|
192
|
+
Type.Literal(NodeType.ASSERTION),
|
|
196
193
|
], { $id: "NodeType" });
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
from:
|
|
200
|
-
to:
|
|
194
|
+
export const NodeSchema = Type.Union([EndpointSchema, WaitSchema, AssertionsSchema], { $id: "Node" });
|
|
195
|
+
export const EdgeSchema = Type.Object({
|
|
196
|
+
from: Type.String(),
|
|
197
|
+
to: Type.String(),
|
|
201
198
|
}, { $id: "Edge" });
|
|
202
|
-
|
|
203
|
-
organization:
|
|
204
|
-
project:
|
|
205
|
-
locations:
|
|
206
|
-
id:
|
|
207
|
-
name:
|
|
208
|
-
version:
|
|
209
|
-
frequency:
|
|
210
|
-
environment:
|
|
211
|
-
nodes:
|
|
212
|
-
edges:
|
|
199
|
+
export const TestPlanV1Schema = Type.Object({
|
|
200
|
+
organization: Type.Optional(Type.String()), // TODO: make these required
|
|
201
|
+
project: Type.Optional(Type.String()), // TODO: make these required
|
|
202
|
+
locations: Type.Optional(Type.Array(Type.String())),
|
|
203
|
+
id: Type.Readonly(Type.String()),
|
|
204
|
+
name: Type.String(),
|
|
205
|
+
version: Type.Literal("1.0"),
|
|
206
|
+
frequency: Type.Optional(FrequencySchema),
|
|
207
|
+
environment: Type.String({ default: "default" }),
|
|
208
|
+
nodes: Type.Array(NodeSchema),
|
|
209
|
+
edges: Type.Array(EdgeSchema),
|
|
213
210
|
}, {
|
|
214
211
|
$id: "TestPlanV1",
|
|
215
212
|
});
|
package/dist/schema.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAA6B,MAAM,SAAS,CAAC;AAE1D,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,CAAC;AAEvC,8DAA8D;AAC9D,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,CAAC,MAAM,CAAC;IAC7C,QAAQ,EAAE,IAAI,CAAC,MAAM,EAAE;IACvB,GAAG,EAAE,IAAI,CAAC,MAAM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S,EAAE,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC;IACzC,WAAW,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC;IAChD,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC;IAC7B,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC;CAC9B,EACD;IACE,GAAG,EAAE,YAAY;CAClB,CACF,CAAC"}
|
package/dist/secrets.js
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* Secret reference types and utilities for griffin DSL.
|
|
4
3
|
*
|
|
5
4
|
* Secrets are referenced by provider and path, and resolved at runtime
|
|
6
5
|
* by the plan executor using configured secret providers.
|
|
7
6
|
*/
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.secret = secret;
|
|
10
|
-
exports.isSecretRef = isSecretRef;
|
|
11
7
|
/**
|
|
12
8
|
* Create a secret reference for use in endpoint headers or body.
|
|
13
9
|
*
|
|
@@ -32,7 +28,7 @@ exports.isSecretRef = isSecretRef;
|
|
|
32
28
|
* })
|
|
33
29
|
* ```
|
|
34
30
|
*/
|
|
35
|
-
function secret(path, options) {
|
|
31
|
+
export function secret(path, options) {
|
|
36
32
|
const colonIndex = path.indexOf(":");
|
|
37
33
|
if (colonIndex === -1) {
|
|
38
34
|
throw new Error(`Secret path must include provider: "provider:path" (e.g., "aws:my-secret", "env:API_KEY"). Got: "${path}"`);
|
|
@@ -57,7 +53,7 @@ function secret(path, options) {
|
|
|
57
53
|
/**
|
|
58
54
|
* Type guard to check if a value is a secret reference.
|
|
59
55
|
*/
|
|
60
|
-
function isSecretRef(value) {
|
|
56
|
+
export function isSecretRef(value) {
|
|
61
57
|
if (typeof value !== "object" || value === null) {
|
|
62
58
|
return false;
|
|
63
59
|
}
|
package/dist/secrets.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"secrets.js","sourceRoot":"","sources":["../src/secrets.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"secrets.js","sourceRoot":"","sources":["../src/secrets.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAoBH;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,UAAU,MAAM,CAAC,IAAY,EAAE,OAAuB;IAC1D,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAErC,IAAI,UAAU,KAAK,CAAC,CAAC,EAAE,CAAC;QACtB,MAAM,IAAI,KAAK,CACb,oGAAoG,IAAI,GAAG,CAC5G,CAAC;IACJ,CAAC;IAED,IAAI,UAAU,KAAK,CAAC,EAAE,CAAC;QACrB,MAAM,IAAI,KAAK,CACb,iEAAiE,IAAI,GAAG,CACzE,CAAC;IACJ,CAAC;IAED,IAAI,UAAU,KAAK,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACnC,MAAM,IAAI,KAAK,CACb,4DAA4D,IAAI,GAAG,CACpE,CAAC;IACJ,CAAC;IAED,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC;IAC3C,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC;IAEvC,OAAO;QACL,OAAO,EAAE;YACP,QAAQ;YACR,GAAG;YACH,GAAG,CAAC,OAAO,EAAE,OAAO,KAAK,SAAS,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,CAAC;YACnE,GAAG,CAAC,OAAO,EAAE,KAAK,KAAK,SAAS,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC;SAC9D;KACF,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,KAAc;IACxC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,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