@skmtc/core 0.58.2 → 0.58.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/esm/context/BuiltOnRead.d.ts +37 -0
- package/esm/context/BuiltOnRead.js +199 -0
- package/esm/context/CoreContext.js +11 -5
- package/esm/context/GenerateContext.d.ts +3 -3
- package/esm/context/GenerateContext.js +13 -6
- package/esm/context/ParseContext.js +116 -11
- package/esm/context/Subject.d.ts +29 -2
- package/esm/context/Subject.js +67 -6
- package/esm/context/generateTypes.d.ts +2 -2
- package/esm/dsl/model/ModelDriver.js +2 -2
- package/esm/dsl/operation/gql/GqlOperationDriver.js +2 -2
- package/esm/dsl/operation/oas/OasOperationDriver.js +2 -2
- package/esm/dsl/webhook/WebhookDriver.js +2 -2
- package/esm/helpers/getPath.d.ts +6 -0
- package/esm/helpers/getPath.js +6 -0
- package/esm/helpers/isDeepEqual.d.ts +17 -0
- package/esm/helpers/isDeepEqual.js +93 -0
- package/esm/helpers/parseModuleName.d.ts +8 -8
- package/esm/helpers/parseModuleName.js +8 -8
- package/esm/helpers/toVariantList.d.ts +1 -1
- package/esm/oas/document/Document.d.ts +5 -1
- package/esm/oas/document/Document.js +10 -1
- package/esm/oas/document/documentSource.d.ts +37 -0
- package/esm/oas/document/documentSource.js +27 -0
- package/esm/oas/schema/siblings.js +6 -4
- package/esm/parse/v3-0/operation/toOperationsV3.d.ts +14 -0
- package/esm/parse/v3-0/operation/toOperationsV3.js +68 -67
- package/esm/parse/v3-1/operation/toOperationsV3.d.ts +14 -0
- package/esm/parse/v3-1/operation/toOperationsV3.js +68 -67
- package/esm/parse/v3-2/operation/toOperationsV3.d.ts +14 -0
- package/esm/parse/v3-2/operation/toOperationsV3.js +69 -68
- package/package.json +1 -4
- package/script/context/BuiltOnRead.d.ts +37 -0
- package/script/context/BuiltOnRead.js +203 -0
- package/script/context/CoreContext.js +11 -5
- package/script/context/GenerateContext.d.ts +3 -3
- package/script/context/GenerateContext.js +13 -6
- package/script/context/ParseContext.js +116 -11
- package/script/context/Subject.d.ts +29 -2
- package/script/context/Subject.js +67 -6
- package/script/context/generateTypes.d.ts +2 -2
- package/script/dsl/model/ModelDriver.js +2 -5
- package/script/dsl/operation/gql/GqlOperationDriver.js +2 -5
- package/script/dsl/operation/oas/OasOperationDriver.js +2 -2
- package/script/dsl/webhook/WebhookDriver.js +2 -5
- package/script/helpers/getPath.d.ts +6 -0
- package/script/helpers/getPath.js +10 -0
- package/script/helpers/isDeepEqual.d.ts +17 -0
- package/script/helpers/isDeepEqual.js +97 -0
- package/script/helpers/parseModuleName.d.ts +8 -8
- package/script/helpers/parseModuleName.js +8 -8
- package/script/helpers/toVariantList.d.ts +1 -1
- package/script/oas/document/Document.d.ts +5 -1
- package/script/oas/document/Document.js +10 -1
- package/script/oas/document/documentSource.d.ts +37 -0
- package/script/oas/document/documentSource.js +36 -0
- package/script/oas/schema/siblings.js +6 -7
- package/script/parse/v3-0/operation/toOperationsV3.d.ts +14 -0
- package/script/parse/v3-0/operation/toOperationsV3.js +71 -69
- package/script/parse/v3-1/operation/toOperationsV3.d.ts +14 -0
- package/script/parse/v3-1/operation/toOperationsV3.js +71 -69
- package/script/parse/v3-2/operation/toOperationsV3.d.ts +14 -0
- package/script/parse/v3-2/operation/toOperationsV3.js +72 -70
|
@@ -49,74 +49,75 @@ export const toOperationV3 = ({ operation, operationInfo, stackTrail, context })
|
|
|
49
49
|
}, context));
|
|
50
50
|
};
|
|
51
51
|
export const toOperationsV3 = ({ paths, stackTrail, context }) => {
|
|
52
|
-
return Object.entries(paths).flatMap(([path, pathItem]) => {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
52
|
+
return Object.entries(paths).flatMap(([path, pathItem]) => stackTrail.trace(path, pathStack => pathItem ? toPathOperationsV3({ path, pathItem, stackTrail: pathStack, context }) : []));
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* The operations of the path item at `path`. They share one parsed path
|
|
56
|
+
* item. With `method`, only the operation at that method is parsed.
|
|
57
|
+
*/
|
|
58
|
+
export const toPathOperationsV3 = ({ path, pathItem, stackTrail: pathStack, context, method: only }) => {
|
|
59
|
+
const cleaned = Object.entries(pathItem).reduce(({ rest, methodObject }, [key, operation]) => {
|
|
60
|
+
const method = toPathItemMethod(key);
|
|
61
|
+
if (method) {
|
|
62
|
+
const { [method]: _deleted, ...remaining } = rest;
|
|
63
|
+
return {
|
|
64
|
+
rest: remaining,
|
|
65
|
+
methodObject: {
|
|
66
|
+
...methodObject,
|
|
67
|
+
[method]: operation
|
|
68
68
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
const normalized = error instanceof Error ? error : new Error(String(error));
|
|
107
|
-
context.logIssueNoKey({
|
|
108
|
-
parent: operation,
|
|
109
|
-
level: 'error',
|
|
110
|
-
message: normalized.message,
|
|
111
|
-
cause: normalized,
|
|
112
|
-
stackTrail: st,
|
|
113
|
-
type: 'INVALID_OPERATION'
|
|
114
|
-
});
|
|
115
|
-
return undefined;
|
|
116
|
-
}
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
return { rest, methodObject };
|
|
72
|
+
}, {
|
|
73
|
+
rest: pathItem,
|
|
74
|
+
methodObject: {}
|
|
75
|
+
});
|
|
76
|
+
const pathItemResult = !isEmpty(cleaned.rest)
|
|
77
|
+
? toPathItemV3({ pathItem: cleaned.rest, stackTrail: pathStack, context })
|
|
78
|
+
: undefined;
|
|
79
|
+
const pathItemObject = pathItemResult?.pathItem;
|
|
80
|
+
const brokenParameters = pathItemResult?.brokenParameters ?? [];
|
|
81
|
+
return Object.entries(cleaned.methodObject)
|
|
82
|
+
.filter(([method]) => only === undefined || method === only)
|
|
83
|
+
.map(([method, operation]) => {
|
|
84
|
+
// Use `pathStack` (the trail with `path` already pushed),
|
|
85
|
+
// not the outer `stackTrail` — otherwise downstream traces
|
|
86
|
+
// record paths:<method>:... and lose the actual path
|
|
87
|
+
// segment, which breaks `OasDocument.removeItem` and the
|
|
88
|
+
// dependency-ref invalidation it backs.
|
|
89
|
+
return pathStack.trace(method, st => {
|
|
90
|
+
if (!operation) {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
if (isDroppedByPathParameter({ brokenParameters, operation, stackTrail: st, context })) {
|
|
94
|
+
return undefined;
|
|
95
|
+
}
|
|
96
|
+
try {
|
|
97
|
+
return toOperationV3({
|
|
98
|
+
operation,
|
|
99
|
+
operationInfo: {
|
|
100
|
+
method: method,
|
|
101
|
+
path,
|
|
102
|
+
pathItem: pathItemObject
|
|
103
|
+
},
|
|
104
|
+
stackTrail: st,
|
|
105
|
+
context
|
|
117
106
|
});
|
|
118
|
-
}
|
|
119
|
-
|
|
107
|
+
}
|
|
108
|
+
catch (error) {
|
|
109
|
+
const normalized = error instanceof Error ? error : new Error(String(error));
|
|
110
|
+
context.logIssueNoKey({
|
|
111
|
+
parent: operation,
|
|
112
|
+
level: 'error',
|
|
113
|
+
message: normalized.message,
|
|
114
|
+
cause: normalized,
|
|
115
|
+
stackTrail: st,
|
|
116
|
+
type: 'INVALID_OPERATION'
|
|
117
|
+
});
|
|
118
|
+
return undefined;
|
|
119
|
+
}
|
|
120
120
|
});
|
|
121
|
-
})
|
|
121
|
+
})
|
|
122
|
+
.filter((item) => Boolean(item));
|
|
122
123
|
};
|
|
@@ -22,4 +22,18 @@ export type ToOperationsV3Args = {
|
|
|
22
22
|
context: ParseContextType;
|
|
23
23
|
};
|
|
24
24
|
export declare const toOperationsV3: ({ paths, stackTrail, context }: ToOperationsV3Args) => OasOperation[];
|
|
25
|
+
export type ToPathOperationsV3Args = {
|
|
26
|
+
path: string;
|
|
27
|
+
pathItem: OpenAPIV3.PathItemObject;
|
|
28
|
+
/** The trail of the path item, with `path` already pushed. */
|
|
29
|
+
stackTrail: StackTrail;
|
|
30
|
+
context: ParseContextType;
|
|
31
|
+
/** Parses only the operation at this method. */
|
|
32
|
+
method?: Method;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* The operations of the path item at `path`. They share one parsed path
|
|
36
|
+
* item. With `method`, only the operation at that method is parsed.
|
|
37
|
+
*/
|
|
38
|
+
export declare const toPathOperationsV3: ({ path, pathItem, stackTrail: pathStack, context, method: only }: ToPathOperationsV3Args) => OasOperation[];
|
|
25
39
|
export {};
|
|
@@ -52,74 +52,75 @@ export const toOperationsV3 = ({ paths, stackTrail, context }) => {
|
|
|
52
52
|
if (!paths) {
|
|
53
53
|
return [];
|
|
54
54
|
}
|
|
55
|
-
return Object.entries(paths).flatMap(([path, pathItem]) => {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
55
|
+
return Object.entries(paths).flatMap(([path, pathItem]) => stackTrail.trace(path, pathStack => pathItem ? toPathOperationsV3({ path, pathItem, stackTrail: pathStack, context }) : []));
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* The operations of the path item at `path`. They share one parsed path
|
|
59
|
+
* item. With `method`, only the operation at that method is parsed.
|
|
60
|
+
*/
|
|
61
|
+
export const toPathOperationsV3 = ({ path, pathItem, stackTrail: pathStack, context, method: only }) => {
|
|
62
|
+
const cleaned = Object.entries(pathItem).reduce(({ rest, methodObject }, [key, operation]) => {
|
|
63
|
+
const method = toPathItemMethod(key);
|
|
64
|
+
if (method) {
|
|
65
|
+
const { [method]: _deleted, ...remaining } = rest;
|
|
66
|
+
return {
|
|
67
|
+
rest: remaining,
|
|
68
|
+
methodObject: {
|
|
69
|
+
...methodObject,
|
|
70
|
+
[method]: operation
|
|
71
71
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
const normalized = error instanceof Error ? error : new Error(String(error));
|
|
110
|
-
context.logIssueNoKey({
|
|
111
|
-
parent: operation,
|
|
112
|
-
level: 'error',
|
|
113
|
-
message: normalized.message,
|
|
114
|
-
cause: normalized,
|
|
115
|
-
stackTrail: st,
|
|
116
|
-
type: 'INVALID_OPERATION'
|
|
117
|
-
});
|
|
118
|
-
return undefined;
|
|
119
|
-
}
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
return { rest, methodObject };
|
|
75
|
+
}, {
|
|
76
|
+
rest: pathItem,
|
|
77
|
+
methodObject: {}
|
|
78
|
+
});
|
|
79
|
+
const pathItemResult = !isEmpty(cleaned.rest)
|
|
80
|
+
? toPathItemV3({ pathItem: cleaned.rest, stackTrail: pathStack, context })
|
|
81
|
+
: undefined;
|
|
82
|
+
const pathItemObject = pathItemResult?.pathItem;
|
|
83
|
+
const brokenParameters = pathItemResult?.brokenParameters ?? [];
|
|
84
|
+
return Object.entries(cleaned.methodObject)
|
|
85
|
+
.filter(([method]) => only === undefined || method === only)
|
|
86
|
+
.map(([method, operation]) => {
|
|
87
|
+
// Use `pathStack` (the trail with `path` already pushed),
|
|
88
|
+
// not the outer `stackTrail` — otherwise downstream traces
|
|
89
|
+
// record paths:<method>:... and lose the actual path
|
|
90
|
+
// segment, which breaks `OasDocument.removeItem` and the
|
|
91
|
+
// dependency-ref invalidation it backs.
|
|
92
|
+
return pathStack.trace(method, st => {
|
|
93
|
+
if (!operation) {
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
if (isDroppedByPathParameter({ brokenParameters, operation, stackTrail: st, context })) {
|
|
97
|
+
return undefined;
|
|
98
|
+
}
|
|
99
|
+
try {
|
|
100
|
+
return toOperationV3({
|
|
101
|
+
operation,
|
|
102
|
+
operationInfo: {
|
|
103
|
+
method: method,
|
|
104
|
+
path,
|
|
105
|
+
pathItem: pathItemObject
|
|
106
|
+
},
|
|
107
|
+
stackTrail: st,
|
|
108
|
+
context
|
|
120
109
|
});
|
|
121
|
-
}
|
|
122
|
-
|
|
110
|
+
}
|
|
111
|
+
catch (error) {
|
|
112
|
+
const normalized = error instanceof Error ? error : new Error(String(error));
|
|
113
|
+
context.logIssueNoKey({
|
|
114
|
+
parent: operation,
|
|
115
|
+
level: 'error',
|
|
116
|
+
message: normalized.message,
|
|
117
|
+
cause: normalized,
|
|
118
|
+
stackTrail: st,
|
|
119
|
+
type: 'INVALID_OPERATION'
|
|
120
|
+
});
|
|
121
|
+
return undefined;
|
|
122
|
+
}
|
|
123
123
|
});
|
|
124
|
-
})
|
|
124
|
+
})
|
|
125
|
+
.filter((item) => Boolean(item));
|
|
125
126
|
};
|
|
@@ -22,4 +22,18 @@ export type ToOperationsV3Args = {
|
|
|
22
22
|
context: ParseContextType;
|
|
23
23
|
};
|
|
24
24
|
export declare const toOperationsV3: ({ paths, stackTrail, context }: ToOperationsV3Args) => OasOperation[];
|
|
25
|
+
export type ToPathOperationsV3Args = {
|
|
26
|
+
path: string;
|
|
27
|
+
pathItem: OpenAPIV3.PathItemObject;
|
|
28
|
+
/** The trail of the path item, with `path` already pushed. */
|
|
29
|
+
stackTrail: StackTrail;
|
|
30
|
+
context: ParseContextType;
|
|
31
|
+
/** Parses only the operation at this method. */
|
|
32
|
+
method?: Method;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* The operations of the path item at `path`. They share one parsed path
|
|
36
|
+
* item. With `method`, only the operation at that method is parsed.
|
|
37
|
+
*/
|
|
38
|
+
export declare const toPathOperationsV3: ({ path, pathItem, stackTrail: pathStack, context, method: only }: ToPathOperationsV3Args) => OasOperation[];
|
|
25
39
|
export {};
|
|
@@ -55,75 +55,76 @@ export const toOperationsV3 = ({ paths, stackTrail, context }) => {
|
|
|
55
55
|
if (!paths) {
|
|
56
56
|
return [];
|
|
57
57
|
}
|
|
58
|
-
return Object.entries(paths).flatMap(([path, pathItem]) => {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
58
|
+
return Object.entries(paths).flatMap(([path, pathItem]) => stackTrail.trace(path, pathStack => pathItem ? toPathOperationsV3({ path, pathItem, stackTrail: pathStack, context }) : []));
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* The operations of the path item at `path`. They share one parsed path
|
|
62
|
+
* item. With `method`, only the operation at that method is parsed.
|
|
63
|
+
*/
|
|
64
|
+
export const toPathOperationsV3 = ({ path, pathItem, stackTrail: pathStack, context, method: only }) => {
|
|
65
|
+
const fixedFields = dropAdditionalOperationsV3({ pathItem, stackTrail: pathStack, context });
|
|
66
|
+
const cleaned = Object.entries(fixedFields).reduce(({ rest, methodObject }, [key, operation]) => {
|
|
67
|
+
const method = toPathItemMethod(key);
|
|
68
|
+
if (method) {
|
|
69
|
+
const { [method]: _deleted, ...remaining } = rest;
|
|
70
|
+
return {
|
|
71
|
+
rest: remaining,
|
|
72
|
+
methodObject: {
|
|
73
|
+
...methodObject,
|
|
74
|
+
[method]: operation
|
|
75
75
|
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
const normalized = error instanceof Error ? error : new Error(String(error));
|
|
114
|
-
context.logIssueNoKey({
|
|
115
|
-
parent: operation,
|
|
116
|
-
level: 'error',
|
|
117
|
-
message: normalized.message,
|
|
118
|
-
cause: normalized,
|
|
119
|
-
stackTrail: st,
|
|
120
|
-
type: 'INVALID_OPERATION'
|
|
121
|
-
});
|
|
122
|
-
return undefined;
|
|
123
|
-
}
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
return { rest, methodObject };
|
|
79
|
+
}, {
|
|
80
|
+
rest: fixedFields,
|
|
81
|
+
methodObject: {}
|
|
82
|
+
});
|
|
83
|
+
const pathItemResult = !isEmpty(cleaned.rest)
|
|
84
|
+
? toPathItemV3({ pathItem: cleaned.rest, stackTrail: pathStack, context })
|
|
85
|
+
: undefined;
|
|
86
|
+
const pathItemObject = pathItemResult?.pathItem;
|
|
87
|
+
const brokenParameters = pathItemResult?.brokenParameters ?? [];
|
|
88
|
+
return Object.entries(cleaned.methodObject)
|
|
89
|
+
.filter(([method]) => only === undefined || method === only)
|
|
90
|
+
.map(([method, operation]) => {
|
|
91
|
+
// Use `pathStack` (the trail with `path` already pushed),
|
|
92
|
+
// not the outer `stackTrail` — otherwise downstream traces
|
|
93
|
+
// record paths:<method>:... and lose the actual path
|
|
94
|
+
// segment, which breaks `OasDocument.removeItem` and the
|
|
95
|
+
// dependency-ref invalidation it backs.
|
|
96
|
+
return pathStack.trace(method, st => {
|
|
97
|
+
if (!operation) {
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
if (isDroppedByPathParameter({ brokenParameters, operation, stackTrail: st, context })) {
|
|
101
|
+
return undefined;
|
|
102
|
+
}
|
|
103
|
+
try {
|
|
104
|
+
return toOperationV3({
|
|
105
|
+
operation,
|
|
106
|
+
operationInfo: {
|
|
107
|
+
method: method,
|
|
108
|
+
path,
|
|
109
|
+
pathItem: pathItemObject
|
|
110
|
+
},
|
|
111
|
+
stackTrail: st,
|
|
112
|
+
context
|
|
124
113
|
});
|
|
125
|
-
}
|
|
126
|
-
|
|
114
|
+
}
|
|
115
|
+
catch (error) {
|
|
116
|
+
const normalized = error instanceof Error ? error : new Error(String(error));
|
|
117
|
+
context.logIssueNoKey({
|
|
118
|
+
parent: operation,
|
|
119
|
+
level: 'error',
|
|
120
|
+
message: normalized.message,
|
|
121
|
+
cause: normalized,
|
|
122
|
+
stackTrail: st,
|
|
123
|
+
type: 'INVALID_OPERATION'
|
|
124
|
+
});
|
|
125
|
+
return undefined;
|
|
126
|
+
}
|
|
127
127
|
});
|
|
128
|
-
})
|
|
128
|
+
})
|
|
129
|
+
.filter((item) => Boolean(item));
|
|
129
130
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skmtc/core",
|
|
3
|
-
"version": "0.58.
|
|
3
|
+
"version": "0.58.4",
|
|
4
4
|
"description": "Skmtc is a declarative code generation framework",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"openapi",
|
|
@@ -213,9 +213,7 @@
|
|
|
213
213
|
},
|
|
214
214
|
"rootDir": "./",
|
|
215
215
|
"dependencies": {
|
|
216
|
-
"@types/lodash-es": "4.17.12",
|
|
217
216
|
"graphql": "^16.9.0",
|
|
218
|
-
"lodash-es": "4.17.21",
|
|
219
217
|
"openapi-types": "^12.1.3",
|
|
220
218
|
"tiny-invariant": "1.3.3",
|
|
221
219
|
"valibot": "1.5.0",
|
|
@@ -223,7 +221,6 @@
|
|
|
223
221
|
},
|
|
224
222
|
"devDependencies": {
|
|
225
223
|
"@types/node": "^20.9.0",
|
|
226
|
-
"@types/lodash-es": "4.17.12",
|
|
227
224
|
"openapi-types": "12.1.3",
|
|
228
225
|
"valibot": "1.1.0"
|
|
229
226
|
},
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* In a run with `onArtifact`, the operations and the component schemas that
|
|
3
|
+
* pass 1 parsed are let go once the file plan is built. Each is built again
|
|
4
|
+
* from the input document when a generator reads it, and let go after the
|
|
5
|
+
* last subject that can read it. Internal: `mod.ts` does not list this file.
|
|
6
|
+
*/
|
|
7
|
+
import type { OasDocument } from '../oas/document/Document.js';
|
|
8
|
+
import type { Reach } from '../parse/Reach.js';
|
|
9
|
+
import type { PlannedSubject } from './Subject.js';
|
|
10
|
+
type BuiltOnReadArgs = {
|
|
11
|
+
document: OasDocument;
|
|
12
|
+
/** The subjects of the run, in the order their steps run. */
|
|
13
|
+
subjects: PlannedSubject[];
|
|
14
|
+
reach: Reach;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* The run's operations and component schemas, built when read. `start` and
|
|
18
|
+
* `finish` go round each step, as `FilePlan.finish` does.
|
|
19
|
+
*/
|
|
20
|
+
export declare class BuiltOnRead {
|
|
21
|
+
#private;
|
|
22
|
+
private constructor();
|
|
23
|
+
/**
|
|
24
|
+
* Lets the parsed operations and component schemas of `document` go, or
|
|
25
|
+
* returns `undefined` when its parse context builds nothing again (a run
|
|
26
|
+
* without `onArtifact`). Call it once the file plan is built.
|
|
27
|
+
*/
|
|
28
|
+
static start({ document, subjects, reach }: BuiltOnReadArgs): BuiltOnRead | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* `subject`'s step starts. The first read of its operation in the step
|
|
31
|
+
* builds it, and every generator of the step gets that object.
|
|
32
|
+
*/
|
|
33
|
+
start(subject: PlannedSubject): void;
|
|
34
|
+
/** `subject`'s step has run: its operation goes, and each schema no subject left reaches. */
|
|
35
|
+
finish(subject: PlannedSubject): void;
|
|
36
|
+
}
|
|
37
|
+
export {};
|