Skip to content

Commit 8ae52ff

Browse files
committed
feat: new test scenario
1 parent f8d36bc commit 8ae52ff

1 file changed

Lines changed: 177 additions & 23 deletions

File tree

test/schema/schema.test.ts

Lines changed: 177 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -76,41 +76,195 @@ describe("Schema", () => {
7676
it('2', () => {
7777

7878
const flow: Flow = {
79-
nodes: {
80-
nodes: [
79+
"__typename": "Flow",
80+
"id": "gid://sagittarius/Flow/1",
81+
"createdAt": "2026-06-19T15:34:11Z",
82+
"name": "Test_v1",
83+
"signature": "<T>(input_schema: TYPE<T>, httpURL: HTTP_URL, httpMethod: HTTP_METHOD): REST_ADAPTER_INPUT<T>",
84+
"nodes": {
85+
"__typename": "NodeFunctionConnection",
86+
"nodes": [
8187
{
82-
id: "gid://sagittarius/NodeFunction/1",
83-
functionDefinition: {identifier: "std::list::at"},
84-
parameters: {
85-
nodes: [
86-
{value: null},
87-
{value: {__typename: "LiteralValue", value: 0}}
88-
]
89-
},
90-
nextNodeId: "gid://sagittarius/NodeFunction/2"
91-
},
92-
{
93-
id: "gid://sagittarius/NodeFunction/2",
94-
functionDefinition: {identifier: "std::number::add"},
95-
parameters: {
96-
nodes: [
88+
"__typename": "NodeFunction",
89+
"id": "gid://sagittarius/NodeFunction/1",
90+
"nextNodeId": null,
91+
"createdAt": "2026-06-19T15:36:19Z",
92+
"updatedAt": "2026-06-19T15:36:19Z",
93+
"parameters": {
94+
"__typename": "NodeParameterConnection",
95+
"count": 8,
96+
"nodes": [
9797
{
98-
value: {
99-
__typename: "ReferenceValue",
100-
nodeFunctionId: "gid://sagittarius/NodeFunction/1"
98+
"__typename": "NodeParameter",
99+
"id": "gid://sagittarius/NodeParameter/1",
100+
"updatedAt": "2026-06-19T15:36:19Z",
101+
"createdAt": "2026-06-19T15:36:19Z",
102+
"parameterDefinition": {
103+
"__typename": "ParameterDefinition",
104+
"id": "gid://sagittarius/ParameterDefinition/19",
105+
"identifier": "http_method",
106+
"createdAt": "2026-06-19T15:33:17Z",
107+
"updatedAt": "2026-06-19T15:33:17Z"
108+
},
109+
"value": {
110+
"__typename": "LiteralValue",
111+
"value": "GET"
101112
}
102113
},
103114
{
104-
value: null
115+
"__typename": "NodeParameter",
116+
"id": "gid://sagittarius/NodeParameter/2",
117+
"updatedAt": "2026-06-19T15:36:19Z",
118+
"createdAt": "2026-06-19T15:36:19Z",
119+
"parameterDefinition": {
120+
"__typename": "ParameterDefinition",
121+
"id": "gid://sagittarius/ParameterDefinition/20",
122+
"identifier": "url",
123+
"createdAt": "2026-06-19T15:33:17Z",
124+
"updatedAt": "2026-06-19T15:33:17Z"
125+
},
126+
"value": {
127+
"__typename": "LiteralValue",
128+
"value": "/test"
129+
}
130+
},
131+
{
132+
"__typename": "NodeParameter",
133+
"id": "gid://sagittarius/NodeParameter/3",
134+
"updatedAt": "2026-06-19T15:36:19Z",
135+
"createdAt": "2026-06-19T15:36:19Z",
136+
"parameterDefinition": {
137+
"__typename": "ParameterDefinition",
138+
"id": "gid://sagittarius/ParameterDefinition/21",
139+
"identifier": "http_auth",
140+
"createdAt": "2026-06-19T15:33:17Z",
141+
"updatedAt": "2026-06-19T15:33:17Z"
142+
},
143+
"value": null
144+
},
145+
{
146+
"__typename": "NodeParameter",
147+
"id": "gid://sagittarius/NodeParameter/4",
148+
"updatedAt": "2026-06-19T15:37:56Z",
149+
"createdAt": "2026-06-19T15:36:19Z",
150+
"parameterDefinition": {
151+
"__typename": "ParameterDefinition",
152+
"id": "gid://sagittarius/ParameterDefinition/22",
153+
"identifier": "http_auth_value",
154+
"createdAt": "2026-06-19T15:33:17Z",
155+
"updatedAt": "2026-06-19T15:33:17Z"
156+
},
157+
"value": null
158+
},
159+
{
160+
"__typename": "NodeParameter",
161+
"id": "gid://sagittarius/NodeParameter/5",
162+
"updatedAt": "2026-06-19T15:36:19Z",
163+
"createdAt": "2026-06-19T15:36:19Z",
164+
"parameterDefinition": {
165+
"__typename": "ParameterDefinition",
166+
"id": "gid://sagittarius/ParameterDefinition/23",
167+
"identifier": "http_auth_place",
168+
"createdAt": "2026-06-19T15:33:17Z",
169+
"updatedAt": "2026-06-19T15:33:17Z"
170+
},
171+
"value": null
172+
},
173+
{
174+
"__typename": "NodeParameter",
175+
"id": "gid://sagittarius/NodeParameter/6",
176+
"updatedAt": "2026-06-19T15:36:19Z",
177+
"createdAt": "2026-06-19T15:36:19Z",
178+
"parameterDefinition": {
179+
"__typename": "ParameterDefinition",
180+
"id": "gid://sagittarius/ParameterDefinition/24",
181+
"identifier": "http_schema",
182+
"createdAt": "2026-06-19T15:33:17Z",
183+
"updatedAt": "2026-06-19T15:33:17Z"
184+
},
185+
"value": null
186+
},
187+
{
188+
"__typename": "NodeParameter",
189+
"id": "gid://sagittarius/NodeParameter/7",
190+
"updatedAt": "2026-06-19T15:39:03Z",
191+
"createdAt": "2026-06-19T15:36:19Z",
192+
"parameterDefinition": {
193+
"__typename": "ParameterDefinition",
194+
"id": "gid://sagittarius/ParameterDefinition/25",
195+
"identifier": "payload",
196+
"createdAt": "2026-06-19T15:33:17Z",
197+
"updatedAt": "2026-06-19T15:33:17Z"
198+
},
199+
"value": null
200+
},
201+
{
202+
"__typename": "NodeParameter",
203+
"id": "gid://sagittarius/NodeParameter/8",
204+
"updatedAt": "2026-06-19T15:49:12Z",
205+
"createdAt": "2026-06-19T15:36:19Z",
206+
"parameterDefinition": {
207+
"__typename": "ParameterDefinition",
208+
"id": "gid://sagittarius/ParameterDefinition/26",
209+
"identifier": "headers",
210+
"createdAt": "2026-06-19T15:33:17Z",
211+
"updatedAt": "2026-06-19T15:33:17Z"
212+
},
213+
"value": null
105214
}
106-
]
215+
],
216+
"pageInfo": {
217+
"endCursor": "OA",
218+
"hasNextPage": false,
219+
"__typename": "PageInfo"
220+
}
221+
},
222+
"functionDefinition": {
223+
"__typename": "FunctionDefinition",
224+
"id": "gid://sagittarius/FunctionDefinition/13",
225+
"identifier": "http::request::send"
107226
}
108227
}
109228
]
229+
},
230+
"project": {
231+
"__typename": "NamespaceProject",
232+
"id": "gid://sagittarius/NamespaceProject/1"
233+
},
234+
"settings": {
235+
"__typename": "FlowSettingConnection",
236+
"count": 0,
237+
"nodes": [],
238+
"pageInfo": {
239+
"endCursor": null,
240+
"hasNextPage": false,
241+
"__typename": "PageInfo"
242+
}
243+
},
244+
"startingNodeId": "gid://sagittarius/NodeFunction/1",
245+
"type": {
246+
"id": "gid://sagittarius/FlowType/2",
247+
"__typename": "FlowType"
248+
},
249+
"executionResults": {
250+
"__typename": "ExecutionResultConnection",
251+
"count": 0,
252+
"nodes": [],
253+
"pageInfo": {
254+
"endCursor": null,
255+
"hasNextPage": false,
256+
"__typename": "PageInfo"
257+
}
258+
},
259+
"disabledReason": null,
260+
"updatedAt": "2026-06-19T15:49:14Z",
261+
"userAbilities": {
262+
"deleteFlow": true,
263+
"__typename": "FlowUserAbilities"
110264
}
111265
};
112266

113-
const result = getSignatureSchema(flow, DATA_TYPES, FUNCTION_SIGNATURES, "gid://sagittarius/NodeFunction/2");
267+
const result = getSignatureSchema(flow, DATA_TYPES, FUNCTION_SIGNATURES, "gid://sagittarius/NodeFunction/1");
114268

115269
//console.dir(result, {depth: null})
116270

0 commit comments

Comments
 (0)