@apifuse/provider-sdk 2.2.0-beta.37 → 2.2.0-beta.38
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/CHANGELOG.md +4 -0
- package/dist/declaration-validation.d.ts +2 -0
- package/dist/declaration-validation.js +29 -3
- package/dist/define.js +5 -0
- package/dist/health-scenario.d.ts +1842 -0
- package/dist/health-scenario.js +624 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/dist/provider.d.ts +3 -0
- package/dist/provider.js +1 -0
- package/dist/server/serve-implementation.d.ts +1 -1
- package/dist/server/types.d.ts +4 -4
- package/dist/types.d.ts +10 -8
- package/package.json +1 -1
- package/src/declaration-validation.ts +30 -3
- package/src/define.ts +9 -0
- package/src/health-scenario.ts +875 -0
- package/src/index.ts +74 -0
- package/src/provider.ts +75 -0
- package/src/types.ts +11 -8
package/src/index.ts
CHANGED
|
@@ -38,6 +38,80 @@ export {
|
|
|
38
38
|
type ProviderContextOf,
|
|
39
39
|
type ProviderDeclaration,
|
|
40
40
|
} from "./define.js";
|
|
41
|
+
export {
|
|
42
|
+
AssertionExpressionSchema,
|
|
43
|
+
AssertionPredicateSchema,
|
|
44
|
+
AssertStepSchema,
|
|
45
|
+
BoundedJsonPathSchema,
|
|
46
|
+
CandidateBlockSchema,
|
|
47
|
+
CandidatePolicySchema,
|
|
48
|
+
CredentialRefDeclarationSchema,
|
|
49
|
+
defineHealthScenario,
|
|
50
|
+
HealthScenarioSchema,
|
|
51
|
+
HealthStepSchema,
|
|
52
|
+
ExtractStepSchema,
|
|
53
|
+
FindFirstSchema,
|
|
54
|
+
GuardStepSchema,
|
|
55
|
+
JournalPolicySchema,
|
|
56
|
+
JsonTemplateSchema,
|
|
57
|
+
ManualTriggerPolicySchema,
|
|
58
|
+
OperandSchema,
|
|
59
|
+
OperationStepSchema,
|
|
60
|
+
QuantifierSchema,
|
|
61
|
+
ReferenceSchema,
|
|
62
|
+
RetryPolicySchema,
|
|
63
|
+
SafeRegexSchema,
|
|
64
|
+
ScopedAssertionExpressionSchema,
|
|
65
|
+
ScopedAssertionPredicateSchema,
|
|
66
|
+
ScopedItemReferenceSchema,
|
|
67
|
+
ScopedOperandSchema,
|
|
68
|
+
StepReferenceSchema,
|
|
69
|
+
RelativeDateNodeSchema,
|
|
70
|
+
ValueTypeSchema,
|
|
71
|
+
} from "./health-scenario.js";
|
|
72
|
+
export type {
|
|
73
|
+
AssertionExpression,
|
|
74
|
+
AssertionPredicate,
|
|
75
|
+
AttemptReference,
|
|
76
|
+
AssertResult,
|
|
77
|
+
AssertStep,
|
|
78
|
+
BoundedJsonPath,
|
|
79
|
+
CandidateBlock,
|
|
80
|
+
CandidatePolicy,
|
|
81
|
+
CandidateReference,
|
|
82
|
+
CredentialReference,
|
|
83
|
+
CredentialRefDeclaration,
|
|
84
|
+
EstablishedConnectionReference,
|
|
85
|
+
ExtractStep,
|
|
86
|
+
FindFirst,
|
|
87
|
+
GuardAttribution,
|
|
88
|
+
GuardReasonCode,
|
|
89
|
+
GuardResult,
|
|
90
|
+
GuardStep,
|
|
91
|
+
HealthScenario,
|
|
92
|
+
HealthStep,
|
|
93
|
+
JsonTemplate,
|
|
94
|
+
JournalPolicy,
|
|
95
|
+
ManualTriggerPolicy,
|
|
96
|
+
NonEmpty,
|
|
97
|
+
OperationResult,
|
|
98
|
+
OperationStep,
|
|
99
|
+
Operand,
|
|
100
|
+
Quantifier,
|
|
101
|
+
ReferenceNode,
|
|
102
|
+
Reference,
|
|
103
|
+
RelativeDateNode,
|
|
104
|
+
RetryPolicy,
|
|
105
|
+
SafeRegex,
|
|
106
|
+
ScopedAssertionExpression,
|
|
107
|
+
ScopedAssertionPredicate,
|
|
108
|
+
ScopedItemReference,
|
|
109
|
+
ScopedOperand,
|
|
110
|
+
StepBase,
|
|
111
|
+
StepReference,
|
|
112
|
+
ExtractResult,
|
|
113
|
+
ValueType,
|
|
114
|
+
} from "./health-scenario.js";
|
|
41
115
|
export type { DevServerOptions } from "./dev.js";
|
|
42
116
|
export { createDevServer, startDevServer } from "./dev.js";
|
|
43
117
|
export * from "./errors.js";
|
package/src/provider.ts
CHANGED
|
@@ -40,6 +40,81 @@ export type {
|
|
|
40
40
|
ProviderContextOf,
|
|
41
41
|
ProviderDeclaration,
|
|
42
42
|
} from "./define.js";
|
|
43
|
+
export type { JsonPrimitive, JsonValue } from "./contract-json.js";
|
|
44
|
+
export {
|
|
45
|
+
AssertionExpressionSchema,
|
|
46
|
+
AssertionPredicateSchema,
|
|
47
|
+
AssertStepSchema,
|
|
48
|
+
BoundedJsonPathSchema,
|
|
49
|
+
CandidateBlockSchema,
|
|
50
|
+
CandidatePolicySchema,
|
|
51
|
+
CredentialRefDeclarationSchema,
|
|
52
|
+
defineHealthScenario,
|
|
53
|
+
HealthScenarioSchema,
|
|
54
|
+
HealthStepSchema,
|
|
55
|
+
ExtractStepSchema,
|
|
56
|
+
FindFirstSchema,
|
|
57
|
+
GuardStepSchema,
|
|
58
|
+
JournalPolicySchema,
|
|
59
|
+
JsonTemplateSchema,
|
|
60
|
+
ManualTriggerPolicySchema,
|
|
61
|
+
OperandSchema,
|
|
62
|
+
OperationStepSchema,
|
|
63
|
+
QuantifierSchema,
|
|
64
|
+
ReferenceSchema,
|
|
65
|
+
RetryPolicySchema,
|
|
66
|
+
SafeRegexSchema,
|
|
67
|
+
ScopedAssertionExpressionSchema,
|
|
68
|
+
ScopedAssertionPredicateSchema,
|
|
69
|
+
ScopedItemReferenceSchema,
|
|
70
|
+
ScopedOperandSchema,
|
|
71
|
+
StepReferenceSchema,
|
|
72
|
+
RelativeDateNodeSchema,
|
|
73
|
+
ValueTypeSchema,
|
|
74
|
+
} from "./health-scenario.js";
|
|
75
|
+
export type {
|
|
76
|
+
AssertionExpression,
|
|
77
|
+
AssertionPredicate,
|
|
78
|
+
AttemptReference,
|
|
79
|
+
AssertResult,
|
|
80
|
+
AssertStep,
|
|
81
|
+
BoundedJsonPath,
|
|
82
|
+
CandidateBlock,
|
|
83
|
+
CandidatePolicy,
|
|
84
|
+
CandidateReference,
|
|
85
|
+
CredentialReference,
|
|
86
|
+
CredentialRefDeclaration,
|
|
87
|
+
EstablishedConnectionReference,
|
|
88
|
+
ExtractStep,
|
|
89
|
+
FindFirst,
|
|
90
|
+
GuardAttribution,
|
|
91
|
+
GuardReasonCode,
|
|
92
|
+
GuardResult,
|
|
93
|
+
GuardStep,
|
|
94
|
+
HealthScenario,
|
|
95
|
+
HealthStep,
|
|
96
|
+
JsonTemplate,
|
|
97
|
+
JournalPolicy,
|
|
98
|
+
ManualTriggerPolicy,
|
|
99
|
+
NonEmpty,
|
|
100
|
+
OperationResult,
|
|
101
|
+
OperationStep,
|
|
102
|
+
Operand,
|
|
103
|
+
Quantifier,
|
|
104
|
+
ReferenceNode,
|
|
105
|
+
Reference,
|
|
106
|
+
RelativeDateNode,
|
|
107
|
+
RetryPolicy,
|
|
108
|
+
SafeRegex,
|
|
109
|
+
ScopedAssertionExpression,
|
|
110
|
+
ScopedAssertionPredicate,
|
|
111
|
+
ScopedItemReference,
|
|
112
|
+
ScopedOperand,
|
|
113
|
+
StepBase,
|
|
114
|
+
StepReference,
|
|
115
|
+
ExtractResult,
|
|
116
|
+
ValueType,
|
|
117
|
+
} from "./health-scenario.js";
|
|
43
118
|
export {
|
|
44
119
|
AuthError,
|
|
45
120
|
HttpRedirectError,
|
package/src/types.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type ms from "ms";
|
|
2
|
+
import type { HealthScenario } from "./health-scenario.js";
|
|
2
3
|
import type { SerializedCookieJar } from "tough-cookie";
|
|
3
4
|
|
|
4
5
|
import type { infer as ZodInfer, ZodType } from "zod";
|
|
@@ -645,7 +646,7 @@ export interface HealthJourneyRunResult {
|
|
|
645
646
|
metadata?: Record<string, unknown>;
|
|
646
647
|
}
|
|
647
648
|
|
|
648
|
-
|
|
649
|
+
interface HealthJourneyDefinitionBase {
|
|
649
650
|
id: string;
|
|
650
651
|
title?: string;
|
|
651
652
|
description?: string;
|
|
@@ -657,15 +658,17 @@ export interface HealthJourneyDefinition {
|
|
|
657
658
|
requiredSecrets?: readonly string[];
|
|
658
659
|
manualTrigger?: HealthJourneyManualTriggerPolicy;
|
|
659
660
|
steps: readonly [HealthJourneyStep, ...HealthJourneyStep[]];
|
|
660
|
-
/**
|
|
661
|
-
* Required: a journey always declares `coversOperations`, and the health
|
|
662
|
-
* monitor reports a run-less journey as `journey_run_missing`. Declaration
|
|
663
|
-
* validation rejects a missing `run` (`health-journey-executable`), so this
|
|
664
|
-
* is typed required to fail at compile time rather than at boot.
|
|
665
|
-
*/
|
|
666
|
-
run: (ctx: HealthJourneyRunContext) => Promise<HealthJourneyRunResult | undefined>;
|
|
667
661
|
}
|
|
668
662
|
|
|
663
|
+
export type HealthJourneyDefinition = HealthJourneyDefinitionBase &
|
|
664
|
+
(
|
|
665
|
+
| {
|
|
666
|
+
run: (ctx: HealthJourneyRunContext) => Promise<HealthJourneyRunResult | undefined>;
|
|
667
|
+
scenario?: never;
|
|
668
|
+
}
|
|
669
|
+
| { scenario: HealthScenario; run?: never }
|
|
670
|
+
);
|
|
671
|
+
|
|
669
672
|
/**
|
|
670
673
|
* Health-check authoring surface owned by `@apifuse/provider-sdk`.
|
|
671
674
|
*
|