@griffin-app/griffin-ts 0.1.2 → 0.1.4
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.d.ts +1 -1
- package/dist/builder.d.ts.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.d.ts +1 -1
- package/dist/frequency.d.ts.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.d.ts +18 -18
- package/dist/index.d.ts.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.d.ts +3 -3
- package/dist/sequential-builder.d.ts.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 +1 -1
- package/src/builder.ts +1 -1
- package/src/example-sequential.ts +1 -1
- package/src/example.ts +1 -1
- package/src/frequency.ts +1 -1
- package/src/index.ts +18 -18
- package/src/sequential-builder.ts +4 -4
- package/tsconfig.json +2 -2
- package/dist/target.d.ts +0 -33
- package/dist/target.d.ts.map +0 -1
- package/dist/target.js +0 -53
- package/dist/target.js.map +0 -1
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,CA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pB,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,UAAU,GAAG,GAAG,CAAC,OAAkC,CAAC;IAC1D,OAAO,CACL,OAAO,UAAU,CAAC,QAAQ,KAAK,QAAQ;QACvC,OAAO,UAAU,CAAC,GAAG,KAAK,QAAQ,CACnC,CAAC;AACJ,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type EndpointConfig, type WaitDuration } from "./builder";
|
|
2
|
-
import { Frequency, TestPlanV1 } from "./schema";
|
|
3
|
-
import { type SerializedAssertion, type StateProxy } from "./assertions";
|
|
1
|
+
import { type EndpointConfig, type WaitDuration } from "./builder.js";
|
|
2
|
+
import { Frequency, TestPlanV1 } from "./schema.js";
|
|
3
|
+
import { type SerializedAssertion, type StateProxy } from "./assertions.js";
|
|
4
4
|
type RawPlan = Omit<TestPlanV1, "id" | "environment">;
|
|
5
5
|
/**
|
|
6
6
|
* Callback type for building assertions with type-safe state access
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sequential-builder.d.ts","sourceRoot":"","sources":["../src/sequential-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,cAAc,EACnB,KAAK,YAAY,EAClB,MAAM,
|
|
1
|
+
{"version":3,"file":"sequential-builder.d.ts","sourceRoot":"","sources":["../src/sequential-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,cAAc,EACnB,KAAK,YAAY,EAClB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAiC,SAAS,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACnF,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,UAAU,EAChB,MAAM,iBAAiB,CAAC;AAEzB,KAAK,OAAO,GAAG,IAAI,CAAC,UAAU,EAAE,IAAI,GAAG,aAAa,CAAC,CAAC;AAEtD;;GAEG;AACH,MAAM,MAAM,iBAAiB,CAAC,SAAS,SAAS,MAAM,IAAI,CACxD,KAAK,EAAE,UAAU,CAAC,SAAS,CAAC,KACzB,mBAAmB,EAAE,CAAC;AAE3B;;;;;;GAMG;AACH,MAAM,WAAW,qBAAqB,CAAC,SAAS,SAAS,MAAM,GAAG,KAAK;IACrE;;;;;;;;;;;;;;;;OAgBG;IACH,OAAO,CAAC,IAAI,SAAS,MAAM,EACzB,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,cAAc,GACrB,qBAAqB,CAAC,SAAS,GAAG,IAAI,CAAC,CAAC;IAE3C;;;;;;;;;;;;;OAaG;IACH,IAAI,CAAC,IAAI,SAAS,MAAM,EACtB,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,YAAY,GACrB,qBAAqB,CAAC,SAAS,GAAG,IAAI,CAAC,CAAC;IAE3C;;;;;;;;;;;;;;;;;OAiBG;IACH,MAAM,CACJ,QAAQ,EAAE,iBAAiB,CAAC,SAAS,CAAC,GACrC,qBAAqB,CAAC,SAAS,CAAC,CAAC;IAEpC;;;;;OAKG;IACH,KAAK,IAAI,OAAO,CAAC;CAClB;AAqGD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB,GAAG,qBAAqB,CAExB"}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const constants_1 = require("./constants");
|
|
6
|
-
const schema_1 = require("./schema");
|
|
7
|
-
const assertions_1 = require("./assertions");
|
|
1
|
+
import { Endpoint, Wait, Assertion, } from "./builder.js";
|
|
2
|
+
import { START, END } from "./constants.js";
|
|
3
|
+
import { TEST_PLAN_VERSION } from "./schema.js";
|
|
4
|
+
import { createStateProxy, } from "./assertions.js";
|
|
8
5
|
/**
|
|
9
6
|
* Internal implementation class for SequentialTestBuilder.
|
|
10
7
|
*/
|
|
@@ -23,22 +20,22 @@ class SequentialTestBuilderImpl {
|
|
|
23
20
|
return `step_${this.nodeCounter++}`;
|
|
24
21
|
}
|
|
25
22
|
request(name, config) {
|
|
26
|
-
const node =
|
|
23
|
+
const node = Endpoint(config);
|
|
27
24
|
this.nodes.push({ ...node, id: name });
|
|
28
25
|
this.nodeNames.push(name);
|
|
29
26
|
return this;
|
|
30
27
|
}
|
|
31
28
|
wait(name, duration) {
|
|
32
|
-
const node =
|
|
29
|
+
const node = Wait(duration);
|
|
33
30
|
this.nodes.push({ ...node, id: name });
|
|
34
31
|
this.nodeNames.push(name);
|
|
35
32
|
return this;
|
|
36
33
|
}
|
|
37
34
|
assert(callback) {
|
|
38
|
-
const stateProxy =
|
|
35
|
+
const stateProxy = createStateProxy(this.nodeNames);
|
|
39
36
|
const serializedAssertions = callback(stateProxy);
|
|
40
37
|
const nodeName = this.generateNodeName();
|
|
41
|
-
const node =
|
|
38
|
+
const node = Assertion(serializedAssertions);
|
|
42
39
|
this.nodes.push({ ...node, id: nodeName });
|
|
43
40
|
this.nodeNames.push(nodeName);
|
|
44
41
|
return this;
|
|
@@ -52,13 +49,13 @@ class SequentialTestBuilderImpl {
|
|
|
52
49
|
name,
|
|
53
50
|
frequency,
|
|
54
51
|
locations,
|
|
55
|
-
version:
|
|
52
|
+
version: TEST_PLAN_VERSION,
|
|
56
53
|
nodes: [],
|
|
57
|
-
edges: [{ from:
|
|
54
|
+
edges: [{ from: START, to: END }],
|
|
58
55
|
};
|
|
59
56
|
}
|
|
60
57
|
// Connect START to first node
|
|
61
|
-
edges.push({ from:
|
|
58
|
+
edges.push({ from: START, to: this.nodes[0].id });
|
|
62
59
|
// Connect consecutive nodes
|
|
63
60
|
for (let i = 0; i < this.nodes.length - 1; i++) {
|
|
64
61
|
edges.push({
|
|
@@ -67,10 +64,10 @@ class SequentialTestBuilderImpl {
|
|
|
67
64
|
});
|
|
68
65
|
}
|
|
69
66
|
// Connect last node to END
|
|
70
|
-
edges.push({ from: this.nodes[this.nodes.length - 1].id, to:
|
|
67
|
+
edges.push({ from: this.nodes[this.nodes.length - 1].id, to: END });
|
|
71
68
|
return {
|
|
72
69
|
name,
|
|
73
|
-
version:
|
|
70
|
+
version: TEST_PLAN_VERSION,
|
|
74
71
|
frequency,
|
|
75
72
|
locations,
|
|
76
73
|
nodes: this.nodes,
|
|
@@ -122,7 +119,7 @@ class SequentialTestBuilderImpl {
|
|
|
122
119
|
* .build();
|
|
123
120
|
* ```
|
|
124
121
|
*/
|
|
125
|
-
function createTestBuilder(config) {
|
|
122
|
+
export function createTestBuilder(config) {
|
|
126
123
|
return new SequentialTestBuilderImpl(config);
|
|
127
124
|
}
|
|
128
125
|
//# sourceMappingURL=sequential-builder.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sequential-builder.js","sourceRoot":"","sources":["../src/sequential-builder.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sequential-builder.js","sourceRoot":"","sources":["../src/sequential-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,IAAI,EACJ,SAAS,GAGV,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAqC,MAAM,aAAa,CAAC;AACnF,OAAO,EACL,gBAAgB,GAGjB,MAAM,iBAAiB,CAAC;AA2FzB;;GAEG;AACH,MAAM,yBAAyB;IAQnB;IALF,KAAK,GAAW,EAAE,CAAC;IACnB,SAAS,GAAa,EAAE,CAAC;IACzB,WAAW,GAAG,CAAC,CAAC;IAExB,YACU,MAIP;QAJO,WAAM,GAAN,MAAM,CAIb;IACA,CAAC;IAEJ;;OAEG;IACK,gBAAgB;QACtB,OAAO,QAAQ,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;IACtC,CAAC;IAED,OAAO,CACL,IAAU,EACV,MAAs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/shared.js
CHANGED
|
@@ -1,25 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.TUnionOneOf = void 0;
|
|
4
|
-
exports.Ref = Ref;
|
|
5
|
-
exports.UnionOneOf = UnionOneOf;
|
|
6
|
-
const typebox_1 = require("typebox");
|
|
7
|
-
function Ref(t, options = {}) {
|
|
1
|
+
import { Unsafe, Type, } from "typebox";
|
|
2
|
+
export function Ref(t, options = {}) {
|
|
8
3
|
const id = t.$id;
|
|
9
4
|
if (!id) {
|
|
10
5
|
throw new Error("missing ID on schema");
|
|
11
6
|
}
|
|
12
|
-
return
|
|
7
|
+
return Unsafe({ ...t, $ref: id, $id: undefined, ...options });
|
|
13
8
|
}
|
|
14
|
-
class TUnionOneOf extends
|
|
9
|
+
export class TUnionOneOf extends Type.Base {
|
|
15
10
|
oneOf;
|
|
16
11
|
constructor(oneOf) {
|
|
17
12
|
super();
|
|
18
13
|
this.oneOf = oneOf;
|
|
19
14
|
}
|
|
20
15
|
}
|
|
21
|
-
|
|
22
|
-
function UnionOneOf(oneOf) {
|
|
16
|
+
export function UnionOneOf(oneOf) {
|
|
23
17
|
return new TUnionOneOf(oneOf);
|
|
24
18
|
}
|
|
25
19
|
//export interface TUnionOneOf<Types extends TSchema[] = TSchema[]> extends TSchema {
|
package/dist/shared.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../src/shared.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../src/shared.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,MAAM,EACN,IAAI,GACL,MAAM,SAAS,CAAC;AAIjB,MAAM,UAAU,GAAG,CACjB,CAAI,EACJ,UAA0B,EAAE;IAE5B,MAAM,EAAE,GAAI,CAAmD,CAAC,GAAG,CAAC;IACpE,IAAI,CAAC,EAAE,EAAE,CAAC;QACR,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;IAC1C,CAAC;IACD,OAAO,MAAM,CAAY,EAAE,GAAG,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;AAC3E,CAAC;AAED,MAAM,OAAO,WAAiD,SAAQ,IAAI,CAAC,IAE1E;IACQ,KAAK,CAAQ;IACpB,YAAY,KAAY;QACtB,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;CACF;AACD,MAAM,UAAU,UAAU,CAAC,KAAgB;IACzC,OAAO,IAAI,WAAW,CAAC,KAAK,CAAC,CAAC;AAChC,CAAC;AAED,qFAAqF;AACrF,yBAAyB;AACzB,8DAA8D;AAC9D,gBAAgB;AAChB,GAAG;AACH,EAAE;AACF,wGAAwG;AACxG,+EAA+E;AAC/E,EAAE;AACF,mFAAmF;AACnF,GAAG"}
|
package/dist/type-exports.js
CHANGED
package/dist/type-exports.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type-exports.js","sourceRoot":"","sources":["../src/type-exports.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"type-exports.js","sourceRoot":"","sources":["../src/type-exports.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
package/dist/variable.js
CHANGED
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* Variable reference utilities for griffin DSL.
|
|
4
3
|
*
|
|
5
4
|
* Variables are resolved at evaluation time (when the CLI imports test files)
|
|
6
5
|
* by reading from variables.yaml. The resolved values are baked into the plan.
|
|
7
6
|
*/
|
|
8
|
-
|
|
9
|
-
exports.variable = variable;
|
|
10
|
-
exports.isVariableRef = isVariableRef;
|
|
11
|
-
function variable(key, template) {
|
|
7
|
+
export function variable(key, template) {
|
|
12
8
|
if (!key || typeof key !== "string") {
|
|
13
9
|
throw new Error(`Variable key must be a non-empty string. Got: ${key}`);
|
|
14
10
|
}
|
|
@@ -38,7 +34,7 @@ function variable(key, template) {
|
|
|
38
34
|
/**
|
|
39
35
|
* Type guard to check if a value is a variable reference.
|
|
40
36
|
*/
|
|
41
|
-
function isVariableRef(value) {
|
|
37
|
+
export function isVariableRef(value) {
|
|
42
38
|
if (typeof value !== "object" || value === null) {
|
|
43
39
|
return false;
|
|
44
40
|
}
|
package/dist/variable.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"variable.js","sourceRoot":"","sources":["../src/variable.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"variable.js","sourceRoot":"","sources":["../src/variable.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAwDH,MAAM,UAAU,QAAQ,CAAC,GAAW,EAAE,QAAiB;IACrD,IAAI,CAAC,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;QACpC,MAAM,IAAI,KAAK,CAAC,iDAAiD,GAAG,EAAE,CAAC,CAAC;IAC1E,CAAC;IAED,IAAI,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;QACtB,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;IACrE,CAAC;IAED,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC3B,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE,CAAC;YACjC,MAAM,IAAI,KAAK,CACb,4CAA4C,OAAO,QAAQ,EAAE,CAC9D,CAAC;QACJ,CAAC;QAED,IAAI,QAAQ,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;YAC3B,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAC;QAC1E,CAAC;QAED,mDAAmD;QACnD,MAAM,WAAW,GAAG,MAAM,GAAG,GAAG,CAAC;QACjC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC;YACpC,MAAM,IAAI,KAAK,CACb,qCAAqC,GAAG,uBAAuB,QAAQ,EAAE,CAC1E,CAAC;QACJ,CAAC;IACH,CAAC;IAED,OAAO;QACL,SAAS,EAAE;YACT,GAAG,EAAE,GAAG,CAAC,IAAI,EAAE;YACf,GAAG,CAAC,QAAQ,IAAI,EAAE,QAAQ,EAAE,CAAC;SAC9B;KACF,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,KAAc;IAC1C,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QAChD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,GAAG,GAAG,KAAgC,CAAC;IAC7C,IACE,CAAC,CAAC,WAAW,IAAI,GAAG,CAAC;QACrB,OAAO,GAAG,CAAC,SAAS,KAAK,QAAQ;QACjC,GAAG,CAAC,SAAS,KAAK,IAAI,EACtB,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,OAAO,GAAG,GAAG,CAAC,SAAoC,CAAC;IACzD,OAAO,CACL,OAAO,OAAO,CAAC,GAAG,KAAK,QAAQ;QAC/B,CAAC,OAAO,CAAC,QAAQ,KAAK,SAAS,IAAI,OAAO,OAAO,CAAC,QAAQ,KAAK,QAAQ,CAAC,CACzE,CAAC;AACJ,CAAC"}
|
package/dist/wait.js
CHANGED
package/dist/wait.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wait.js","sourceRoot":"","sources":["../src/wait.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"wait.js","sourceRoot":"","sources":["../src/wait.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,OAAO,EAAE,CAAC,KAAa,EAAE,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAChD,OAAO,EAAE,CAAC,KAAa,EAAE,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;CACjD,CAAC"}
|
package/package.json
CHANGED
package/src/builder.ts
CHANGED
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
TEST_PLAN_VERSION,
|
|
13
13
|
JSONAssertion,
|
|
14
14
|
} from "./schema.js";
|
|
15
|
-
import { type START as StartType, type END as EndType } from "./constants";
|
|
15
|
+
import { type START as StartType, type END as EndType } from "./constants.js";
|
|
16
16
|
|
|
17
17
|
type RawPlan = Omit<TestPlanV1, "id" | "environment">;
|
|
18
18
|
|
package/src/example.ts
CHANGED
package/src/frequency.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -9,45 +9,45 @@
|
|
|
9
9
|
// DSL Builders
|
|
10
10
|
// ============================================================================
|
|
11
11
|
|
|
12
|
-
export { createGraphBuilder } from "./builder";
|
|
13
|
-
export type { TestBuilder } from "./builder";
|
|
12
|
+
export { createGraphBuilder } from "./builder.js";
|
|
13
|
+
export type { TestBuilder } from "./builder.js";
|
|
14
14
|
|
|
15
|
-
export { createTestBuilder } from "./sequential-builder";
|
|
15
|
+
export { createTestBuilder } from "./sequential-builder.js";
|
|
16
16
|
export type {
|
|
17
17
|
SequentialTestBuilder,
|
|
18
18
|
AssertionCallback,
|
|
19
|
-
} from "./sequential-builder";
|
|
19
|
+
} from "./sequential-builder.js";
|
|
20
20
|
|
|
21
21
|
// ============================================================================
|
|
22
22
|
// DSL Node Factories
|
|
23
23
|
// ============================================================================
|
|
24
24
|
|
|
25
|
-
export { Endpoint, Wait, Assertion } from "./builder";
|
|
25
|
+
export { Endpoint, Wait, Assertion } from "./builder.js";
|
|
26
26
|
export type {
|
|
27
27
|
EndpointConfig,
|
|
28
28
|
WaitDuration as WaitDurationType,
|
|
29
|
-
} from "./builder";
|
|
29
|
+
} from "./builder.js";
|
|
30
30
|
|
|
31
31
|
// ============================================================================
|
|
32
32
|
// DSL Helpers
|
|
33
33
|
// ============================================================================
|
|
34
34
|
|
|
35
|
-
export { Frequency } from "./frequency";
|
|
36
|
-
export { WaitDuration } from "./wait";
|
|
37
|
-
export { variable, isVariableRef } from "./variable";
|
|
38
|
-
export type { VariableRef } from "./variable";
|
|
39
|
-
export { secret, isSecretRef } from "./secrets";
|
|
40
|
-
export type { SecretRefData, SecretOptions } from "./secrets";
|
|
35
|
+
export { Frequency } from "./frequency.js";
|
|
36
|
+
export { WaitDuration } from "./wait.js";
|
|
37
|
+
export { variable, isVariableRef } from "./variable.js";
|
|
38
|
+
export type { VariableRef } from "./variable.js";
|
|
39
|
+
export { secret, isSecretRef } from "./secrets.js";
|
|
40
|
+
export type { SecretRefData, SecretOptions } from "./secrets.js";
|
|
41
41
|
|
|
42
42
|
// ============================================================================
|
|
43
43
|
// DSL Constants
|
|
44
44
|
// ============================================================================
|
|
45
45
|
|
|
46
|
-
export { START, END } from "./constants";
|
|
47
|
-
export type { START as StartType, END as EndType } from "./constants";
|
|
46
|
+
export { START, END } from "./constants.js";
|
|
47
|
+
export type { START as StartType, END as EndType } from "./constants.js";
|
|
48
48
|
|
|
49
|
-
export { GET, POST, PUT, DELETE, PATCH } from "./http-methods";
|
|
50
|
-
export { Json, Xml, Text } from "./response-formats";
|
|
49
|
+
export { GET, POST, PUT, DELETE, PATCH } from "./http-methods.js";
|
|
50
|
+
export { Json, Xml, Text } from "./response-formats.js";
|
|
51
51
|
|
|
52
52
|
// ============================================================================
|
|
53
53
|
// Assertion DSL
|
|
@@ -59,7 +59,7 @@ export {
|
|
|
59
59
|
UnaryPredicate,
|
|
60
60
|
BinaryPredicateOperator,
|
|
61
61
|
createStateProxy,
|
|
62
|
-
} from "./assertions";
|
|
62
|
+
} from "./assertions.js";
|
|
63
63
|
|
|
64
64
|
export type {
|
|
65
65
|
SerializedAssertion,
|
|
@@ -68,4 +68,4 @@ export type {
|
|
|
68
68
|
StateProxy,
|
|
69
69
|
NodeResultProxy,
|
|
70
70
|
NestedProxy,
|
|
71
|
-
} from "./assertions";
|
|
71
|
+
} from "./assertions.js";
|
|
@@ -4,14 +4,14 @@ import {
|
|
|
4
4
|
Assertion,
|
|
5
5
|
type EndpointConfig,
|
|
6
6
|
type WaitDuration,
|
|
7
|
-
} from "./builder";
|
|
8
|
-
import { START, END } from "./constants";
|
|
9
|
-
import { TEST_PLAN_VERSION, Edge, Node, Frequency, TestPlanV1 } from "./schema";
|
|
7
|
+
} from "./builder.js";
|
|
8
|
+
import { START, END } from "./constants.js";
|
|
9
|
+
import { TEST_PLAN_VERSION, Edge, Node, Frequency, TestPlanV1 } from "./schema.js";
|
|
10
10
|
import {
|
|
11
11
|
createStateProxy,
|
|
12
12
|
type SerializedAssertion,
|
|
13
13
|
type StateProxy,
|
|
14
|
-
} from "./assertions";
|
|
14
|
+
} from "./assertions.js";
|
|
15
15
|
|
|
16
16
|
type RawPlan = Omit<TestPlanV1, "id" | "environment">;
|
|
17
17
|
|
package/tsconfig.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
3
|
"target": "ES2022",
|
|
4
|
-
"module": "
|
|
4
|
+
"module": "ESNext",
|
|
5
5
|
"lib": ["ES2022"],
|
|
6
6
|
"outDir": "./dist",
|
|
7
7
|
"rootDir": "./src",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"skipLibCheck": true,
|
|
14
14
|
"forceConsistentCasingInFileNames": true,
|
|
15
15
|
"resolveJsonModule": true,
|
|
16
|
-
"moduleResolution": "
|
|
16
|
+
"moduleResolution": "bundler"
|
|
17
17
|
},
|
|
18
18
|
"include": ["src/**/*"],
|
|
19
19
|
"exclude": ["node_modules", "dist"]
|
package/dist/target.d.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Target reference utilities for griffin DSL.
|
|
3
|
-
*
|
|
4
|
-
* Targets are resolved at runtime by the runner based on the execution environment.
|
|
5
|
-
* This allows the same test to run against different environments (staging, production, etc.)
|
|
6
|
-
* without changing the test code.
|
|
7
|
-
*/
|
|
8
|
-
import { TargetRef } from "./schema.js";
|
|
9
|
-
/**
|
|
10
|
-
* Create a target reference for endpoint base URLs.
|
|
11
|
-
*
|
|
12
|
-
* The runner will resolve this to the appropriate base URL based on the
|
|
13
|
-
* execution environment (passed as a per-run parameter).
|
|
14
|
-
*
|
|
15
|
-
* @param key - The target identifier (e.g., "billing-service", "api-gateway")
|
|
16
|
-
* @returns A target reference object
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* ```typescript
|
|
20
|
-
* builder.addNode("billing", Endpoint({
|
|
21
|
-
* method: GET,
|
|
22
|
-
* path: "/invoices",
|
|
23
|
-
* base: target("billing-service"),
|
|
24
|
-
* response_format: JSON
|
|
25
|
-
* }));
|
|
26
|
-
* ```
|
|
27
|
-
*/
|
|
28
|
-
export declare function target(key: string): TargetRef;
|
|
29
|
-
/**
|
|
30
|
-
* Type guard to check if a value is a target reference.
|
|
31
|
-
*/
|
|
32
|
-
export declare function isTargetRef(value: unknown): value is TargetRef;
|
|
33
|
-
//# sourceMappingURL=target.d.ts.map
|
package/dist/target.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"target.d.ts","sourceRoot":"","sources":["../src/target.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAa7C;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,SAAS,CAO9D"}
|
package/dist/target.js
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Target reference utilities for griffin DSL.
|
|
4
|
-
*
|
|
5
|
-
* Targets are resolved at runtime by the runner based on the execution environment.
|
|
6
|
-
* This allows the same test to run against different environments (staging, production, etc.)
|
|
7
|
-
* without changing the test code.
|
|
8
|
-
*/
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.target = target;
|
|
11
|
-
exports.isTargetRef = isTargetRef;
|
|
12
|
-
/**
|
|
13
|
-
* Create a target reference for endpoint base URLs.
|
|
14
|
-
*
|
|
15
|
-
* The runner will resolve this to the appropriate base URL based on the
|
|
16
|
-
* execution environment (passed as a per-run parameter).
|
|
17
|
-
*
|
|
18
|
-
* @param key - The target identifier (e.g., "billing-service", "api-gateway")
|
|
19
|
-
* @returns A target reference object
|
|
20
|
-
*
|
|
21
|
-
* @example
|
|
22
|
-
* ```typescript
|
|
23
|
-
* builder.addNode("billing", Endpoint({
|
|
24
|
-
* method: GET,
|
|
25
|
-
* path: "/invoices",
|
|
26
|
-
* base: target("billing-service"),
|
|
27
|
-
* response_format: JSON
|
|
28
|
-
* }));
|
|
29
|
-
* ```
|
|
30
|
-
*/
|
|
31
|
-
function target(key) {
|
|
32
|
-
if (!key || typeof key !== "string") {
|
|
33
|
-
throw new Error(`Target key must be a non-empty string. Got: ${key}`);
|
|
34
|
-
}
|
|
35
|
-
if (key.trim() === "") {
|
|
36
|
-
throw new Error("Target key cannot be empty or whitespace only");
|
|
37
|
-
}
|
|
38
|
-
return {
|
|
39
|
-
type: "target",
|
|
40
|
-
key: key.trim(),
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Type guard to check if a value is a target reference.
|
|
45
|
-
*/
|
|
46
|
-
function isTargetRef(value) {
|
|
47
|
-
if (typeof value !== "object" || value === null) {
|
|
48
|
-
return false;
|
|
49
|
-
}
|
|
50
|
-
const obj = value;
|
|
51
|
-
return obj.type === "target" && typeof obj.key === "string";
|
|
52
|
-
}
|
|
53
|
-
//# sourceMappingURL=target.js.map
|
package/dist/target.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"target.js","sourceRoot":"","sources":["../src/target.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAuBH,wBAaC;AAKD,kCAOC;AA5CD;;;;;;;;;;;;;;;;;;GAkBG;AACH,SAAgB,MAAM,CAAC,GAAW;IAChC,IAAI,CAAC,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;QACpC,MAAM,IAAI,KAAK,CAAC,+CAA+C,GAAG,EAAE,CAAC,CAAC;IACxE,CAAC;IAED,IAAI,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;QACtB,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC;IACnE,CAAC;IAED,OAAO;QACL,IAAI,EAAE,QAAQ;QACd,GAAG,EAAE,GAAG,CAAC,IAAI,EAAE;KAChB,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAgB,WAAW,CAAC,KAAc;IACxC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QAChD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,GAAG,GAAG,KAAgC,CAAC;IAC7C,OAAO,GAAG,CAAC,IAAI,KAAK,QAAQ,IAAI,OAAO,GAAG,CAAC,GAAG,KAAK,QAAQ,CAAC;AAC9D,CAAC"}
|