@graph-compose/core 1.0.0

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.
Files changed (155) hide show
  1. package/README.md +323 -0
  2. package/dist/index.d.ts +6 -0
  3. package/dist/index.d.ts.map +1 -0
  4. package/dist/index.js +24 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/tsconfig.tsbuildinfo +1 -0
  7. package/dist/types/behaviors/conditions.d.ts +54 -0
  8. package/dist/types/behaviors/conditions.d.ts.map +1 -0
  9. package/dist/types/behaviors/conditions.js +103 -0
  10. package/dist/types/behaviors/conditions.js.map +1 -0
  11. package/dist/types/behaviors/index.d.ts +3 -0
  12. package/dist/types/behaviors/index.d.ts.map +1 -0
  13. package/dist/types/behaviors/index.js +19 -0
  14. package/dist/types/behaviors/index.js.map +1 -0
  15. package/dist/types/behaviors/notifications.d.ts +157 -0
  16. package/dist/types/behaviors/notifications.d.ts.map +1 -0
  17. package/dist/types/behaviors/notifications.js +89 -0
  18. package/dist/types/behaviors/notifications.js.map +1 -0
  19. package/dist/types/config/activity.d.ts +58 -0
  20. package/dist/types/config/activity.d.ts.map +1 -0
  21. package/dist/types/config/activity.js +53 -0
  22. package/dist/types/config/activity.js.map +1 -0
  23. package/dist/types/config/http.d.ts +20 -0
  24. package/dist/types/config/http.d.ts.map +1 -0
  25. package/dist/types/config/http.js +66 -0
  26. package/dist/types/config/http.js.map +1 -0
  27. package/dist/types/config/index.d.ts +5 -0
  28. package/dist/types/config/index.d.ts.map +1 -0
  29. package/dist/types/config/index.js +21 -0
  30. package/dist/types/config/index.js.map +1 -0
  31. package/dist/types/config/protocols.d.ts +3 -0
  32. package/dist/types/config/protocols.d.ts.map +1 -0
  33. package/dist/types/config/protocols.js +14 -0
  34. package/dist/types/config/protocols.js.map +1 -0
  35. package/dist/types/config/workflow.d.ts +10 -0
  36. package/dist/types/config/workflow.d.ts.map +1 -0
  37. package/dist/types/config/workflow.js +12 -0
  38. package/dist/types/config/workflow.js.map +1 -0
  39. package/dist/types/context/index.d.ts +4 -0
  40. package/dist/types/context/index.d.ts.map +1 -0
  41. package/dist/types/context/index.js +8 -0
  42. package/dist/types/context/index.js.map +1 -0
  43. package/dist/types/contracts/agents.d.ts +87 -0
  44. package/dist/types/contracts/agents.d.ts.map +1 -0
  45. package/dist/types/contracts/agents.js +94 -0
  46. package/dist/types/contracts/agents.js.map +1 -0
  47. package/dist/types/contracts/index.d.ts +3 -0
  48. package/dist/types/contracts/index.d.ts.map +1 -0
  49. package/dist/types/contracts/index.js +19 -0
  50. package/dist/types/contracts/index.js.map +1 -0
  51. package/dist/types/contracts/tools.d.ts +72 -0
  52. package/dist/types/contracts/tools.d.ts.map +1 -0
  53. package/dist/types/contracts/tools.js +101 -0
  54. package/dist/types/contracts/tools.js.map +1 -0
  55. package/dist/types/index.d.ts +10 -0
  56. package/dist/types/index.d.ts.map +1 -0
  57. package/dist/types/index.js +26 -0
  58. package/dist/types/index.js.map +1 -0
  59. package/dist/types/nodes/agents.d.ts +149 -0
  60. package/dist/types/nodes/agents.d.ts.map +1 -0
  61. package/dist/types/nodes/agents.js +48 -0
  62. package/dist/types/nodes/agents.js.map +1 -0
  63. package/dist/types/nodes/common/base-node-schema.d.ts +109 -0
  64. package/dist/types/nodes/common/base-node-schema.d.ts.map +1 -0
  65. package/dist/types/nodes/common/base-node-schema.js +55 -0
  66. package/dist/types/nodes/common/base-node-schema.js.map +1 -0
  67. package/dist/types/nodes/common/index.d.ts +2 -0
  68. package/dist/types/nodes/common/index.d.ts.map +1 -0
  69. package/dist/types/nodes/common/index.js +18 -0
  70. package/dist/types/nodes/common/index.js.map +1 -0
  71. package/dist/types/nodes/destination.d.ts +148 -0
  72. package/dist/types/nodes/destination.d.ts.map +1 -0
  73. package/dist/types/nodes/destination.js +30 -0
  74. package/dist/types/nodes/destination.js.map +1 -0
  75. package/dist/types/nodes/error-boundary.d.ts +126 -0
  76. package/dist/types/nodes/error-boundary.d.ts.map +1 -0
  77. package/dist/types/nodes/error-boundary.js +24 -0
  78. package/dist/types/nodes/error-boundary.js.map +1 -0
  79. package/dist/types/nodes/http.d.ts +194 -0
  80. package/dist/types/nodes/http.d.ts.map +1 -0
  81. package/dist/types/nodes/http.js +28 -0
  82. package/dist/types/nodes/http.js.map +1 -0
  83. package/dist/types/nodes/index.d.ts +734 -0
  84. package/dist/types/nodes/index.d.ts.map +1 -0
  85. package/dist/types/nodes/index.js +48 -0
  86. package/dist/types/nodes/index.js.map +1 -0
  87. package/dist/types/nodes/iterator.d.ts +126 -0
  88. package/dist/types/nodes/iterator.d.ts.map +1 -0
  89. package/dist/types/nodes/iterator.js +21 -0
  90. package/dist/types/nodes/iterator.js.map +1 -0
  91. package/dist/types/nodes/tools.d.ts +1321 -0
  92. package/dist/types/nodes/tools.d.ts.map +1 -0
  93. package/dist/types/nodes/tools.js +65 -0
  94. package/dist/types/nodes/tools.js.map +1 -0
  95. package/dist/types/primitives/index.d.ts +2 -0
  96. package/dist/types/primitives/index.d.ts.map +1 -0
  97. package/dist/types/primitives/index.js +18 -0
  98. package/dist/types/primitives/index.js.map +1 -0
  99. package/dist/types/primitives/shared.d.ts +21 -0
  100. package/dist/types/primitives/shared.d.ts.map +1 -0
  101. package/dist/types/primitives/shared.js +113 -0
  102. package/dist/types/primitives/shared.js.map +1 -0
  103. package/dist/types/results/agent.d.ts +156 -0
  104. package/dist/types/results/agent.d.ts.map +1 -0
  105. package/dist/types/results/agent.js +54 -0
  106. package/dist/types/results/agent.js.map +1 -0
  107. package/dist/types/results/base.d.ts +4 -0
  108. package/dist/types/results/base.d.ts.map +1 -0
  109. package/dist/types/results/base.js +12 -0
  110. package/dist/types/results/base.js.map +1 -0
  111. package/dist/types/results/index.d.ts +7 -0
  112. package/dist/types/results/index.d.ts.map +1 -0
  113. package/dist/types/results/index.js +23 -0
  114. package/dist/types/results/index.js.map +1 -0
  115. package/dist/types/results/node.d.ts +38 -0
  116. package/dist/types/results/node.d.ts.map +1 -0
  117. package/dist/types/results/node.js +26 -0
  118. package/dist/types/results/node.js.map +1 -0
  119. package/dist/types/results/shared.d.ts +36 -0
  120. package/dist/types/results/shared.d.ts.map +1 -0
  121. package/dist/types/results/shared.js +31 -0
  122. package/dist/types/results/shared.js.map +1 -0
  123. package/dist/types/results/source.d.ts +53 -0
  124. package/dist/types/results/source.d.ts.map +1 -0
  125. package/dist/types/results/source.js +64 -0
  126. package/dist/types/results/source.js.map +1 -0
  127. package/dist/types/results/tool.d.ts +170 -0
  128. package/dist/types/results/tool.d.ts.map +1 -0
  129. package/dist/types/results/tool.js +110 -0
  130. package/dist/types/results/tool.js.map +1 -0
  131. package/dist/types/state/index.d.ts +2 -0
  132. package/dist/types/state/index.d.ts.map +1 -0
  133. package/dist/types/state/index.js +18 -0
  134. package/dist/types/state/index.js.map +1 -0
  135. package/dist/types/state/workflow-state.d.ts +63 -0
  136. package/dist/types/state/workflow-state.d.ts.map +1 -0
  137. package/dist/types/state/workflow-state.js +52 -0
  138. package/dist/types/state/workflow-state.js.map +1 -0
  139. package/dist/types/validation/schema.d.ts +14 -0
  140. package/dist/types/validation/schema.d.ts.map +1 -0
  141. package/dist/types/validation/schema.js +37 -0
  142. package/dist/types/validation/schema.js.map +1 -0
  143. package/dist/types/workflow.d.ts +2179 -0
  144. package/dist/types/workflow.d.ts.map +1 -0
  145. package/dist/types/workflow.js +132 -0
  146. package/dist/types/workflow.js.map +1 -0
  147. package/dist/utils/index.d.ts +2 -0
  148. package/dist/utils/index.d.ts.map +1 -0
  149. package/dist/utils/index.js +18 -0
  150. package/dist/utils/index.js.map +1 -0
  151. package/dist/utils/template/index.d.ts +39 -0
  152. package/dist/utils/template/index.d.ts.map +1 -0
  153. package/dist/utils/template/index.js +151 -0
  154. package/dist/utils/template/index.js.map +1 -0
  155. package/package.json +73 -0
@@ -0,0 +1,194 @@
1
+ import { z } from "zod";
2
+ export declare const HttpNodeSchema: z.ZodObject<{
3
+ id: z.ZodString;
4
+ iterationContext: z.ZodOptional<z.ZodObject<{
5
+ originalNodeId: z.ZodString;
6
+ iteratorNodeId: z.ZodString;
7
+ index: z.ZodNumber;
8
+ }, "strip", z.ZodTypeAny, {
9
+ originalNodeId: string;
10
+ iteratorNodeId: string;
11
+ index: number;
12
+ }, {
13
+ originalNodeId: string;
14
+ iteratorNodeId: string;
15
+ index: number;
16
+ }>>;
17
+ activityConfig: z.ZodOptional<z.ZodObject<{
18
+ retryPolicy: z.ZodOptional<z.ZodObject<{
19
+ backoffCoefficient: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
20
+ initialInterval: z.ZodOptional<z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>>;
21
+ maximumAttempts: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
22
+ maximumInterval: z.ZodOptional<z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>>;
23
+ }, "strip", z.ZodTypeAny, {
24
+ backoffCoefficient?: number | undefined;
25
+ initialInterval?: string | undefined;
26
+ maximumAttempts?: number | undefined;
27
+ maximumInterval?: string | undefined;
28
+ }, {
29
+ backoffCoefficient?: number | undefined;
30
+ initialInterval?: string | undefined;
31
+ maximumAttempts?: number | undefined;
32
+ maximumInterval?: string | undefined;
33
+ }>>;
34
+ startToCloseTimeout: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
35
+ scheduleToCloseTimeout: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
36
+ }, "strip", z.ZodTypeAny, {
37
+ retryPolicy?: {
38
+ backoffCoefficient?: number | undefined;
39
+ initialInterval?: string | undefined;
40
+ maximumAttempts?: number | undefined;
41
+ maximumInterval?: string | undefined;
42
+ } | undefined;
43
+ startToCloseTimeout?: string | undefined;
44
+ scheduleToCloseTimeout?: string | undefined;
45
+ }, {
46
+ retryPolicy?: {
47
+ backoffCoefficient?: number | undefined;
48
+ initialInterval?: string | undefined;
49
+ maximumAttempts?: number | undefined;
50
+ maximumInterval?: string | undefined;
51
+ } | undefined;
52
+ startToCloseTimeout?: string | undefined;
53
+ scheduleToCloseTimeout?: string | undefined;
54
+ }>>;
55
+ } & {
56
+ type: z.ZodLiteral<"http">;
57
+ dependencies: z.ZodArray<z.ZodString, "many">;
58
+ http: z.ZodObject<{
59
+ method: z.ZodEnum<["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"]>;
60
+ url: z.ZodEffects<z.ZodString, string, string>;
61
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodUnion<[z.ZodRecord<z.ZodString, z.ZodAny>, z.ZodEffects<z.ZodString, string, string>]>]>>>;
62
+ body: z.ZodOptional<z.ZodUnion<[z.ZodRecord<z.ZodString, z.ZodAny>, z.ZodEffects<z.ZodString, string, string>]>>;
63
+ }, "strip", z.ZodTypeAny, {
64
+ url: string;
65
+ method: "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "HEAD" | "OPTIONS";
66
+ headers?: Record<string, string | Record<string, any>> | undefined;
67
+ body?: string | Record<string, any> | undefined;
68
+ }, {
69
+ url: string;
70
+ method: "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "HEAD" | "OPTIONS";
71
+ headers?: Record<string, string | Record<string, any>> | undefined;
72
+ body?: string | Record<string, any> | undefined;
73
+ }>;
74
+ validation: z.ZodOptional<z.ZodObject<{
75
+ input: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
76
+ output: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
77
+ }, "strip", z.ZodTypeAny, {
78
+ input?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
79
+ output?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
80
+ }, {
81
+ input?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
82
+ output?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
83
+ }>>;
84
+ conditions: z.ZodOptional<z.ZodObject<{
85
+ continueTo: z.ZodEffects<z.ZodOptional<z.ZodArray<z.ZodObject<{
86
+ to: z.ZodString;
87
+ when: z.ZodEffects<z.ZodString, string, string>;
88
+ }, "strip", z.ZodTypeAny, {
89
+ to: string;
90
+ when: string;
91
+ }, {
92
+ to: string;
93
+ when: string;
94
+ }>, "many">>, {
95
+ to: string;
96
+ when: string;
97
+ }[] | undefined, {
98
+ to: string;
99
+ when: string;
100
+ }[] | undefined>;
101
+ terminateWhen: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
102
+ pollUntil: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
103
+ }, "strip", z.ZodTypeAny, {
104
+ continueTo?: {
105
+ to: string;
106
+ when: string;
107
+ }[] | undefined;
108
+ terminateWhen?: string[] | undefined;
109
+ pollUntil?: string[] | undefined;
110
+ }, {
111
+ continueTo?: {
112
+ to: string;
113
+ when: string;
114
+ }[] | undefined;
115
+ terminateWhen?: string[] | undefined;
116
+ pollUntil?: string[] | undefined;
117
+ }>>;
118
+ }, "strip", z.ZodTypeAny, {
119
+ type: "http";
120
+ id: string;
121
+ http: {
122
+ url: string;
123
+ method: "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "HEAD" | "OPTIONS";
124
+ headers?: Record<string, string | Record<string, any>> | undefined;
125
+ body?: string | Record<string, any> | undefined;
126
+ };
127
+ dependencies: string[];
128
+ validation?: {
129
+ input?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
130
+ output?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
131
+ } | undefined;
132
+ iterationContext?: {
133
+ originalNodeId: string;
134
+ iteratorNodeId: string;
135
+ index: number;
136
+ } | undefined;
137
+ activityConfig?: {
138
+ retryPolicy?: {
139
+ backoffCoefficient?: number | undefined;
140
+ initialInterval?: string | undefined;
141
+ maximumAttempts?: number | undefined;
142
+ maximumInterval?: string | undefined;
143
+ } | undefined;
144
+ startToCloseTimeout?: string | undefined;
145
+ scheduleToCloseTimeout?: string | undefined;
146
+ } | undefined;
147
+ conditions?: {
148
+ continueTo?: {
149
+ to: string;
150
+ when: string;
151
+ }[] | undefined;
152
+ terminateWhen?: string[] | undefined;
153
+ pollUntil?: string[] | undefined;
154
+ } | undefined;
155
+ }, {
156
+ type: "http";
157
+ id: string;
158
+ http: {
159
+ url: string;
160
+ method: "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "HEAD" | "OPTIONS";
161
+ headers?: Record<string, string | Record<string, any>> | undefined;
162
+ body?: string | Record<string, any> | undefined;
163
+ };
164
+ dependencies: string[];
165
+ validation?: {
166
+ input?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
167
+ output?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
168
+ } | undefined;
169
+ iterationContext?: {
170
+ originalNodeId: string;
171
+ iteratorNodeId: string;
172
+ index: number;
173
+ } | undefined;
174
+ activityConfig?: {
175
+ retryPolicy?: {
176
+ backoffCoefficient?: number | undefined;
177
+ initialInterval?: string | undefined;
178
+ maximumAttempts?: number | undefined;
179
+ maximumInterval?: string | undefined;
180
+ } | undefined;
181
+ startToCloseTimeout?: string | undefined;
182
+ scheduleToCloseTimeout?: string | undefined;
183
+ } | undefined;
184
+ conditions?: {
185
+ continueTo?: {
186
+ to: string;
187
+ when: string;
188
+ }[] | undefined;
189
+ terminateWhen?: string[] | undefined;
190
+ pollUntil?: string[] | undefined;
191
+ } | undefined;
192
+ }>;
193
+ export type HttpNode = z.infer<typeof HttpNodeSchema>;
194
+ //# sourceMappingURL=http.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../../src/types/nodes/http.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkBzB,CAAC;AACH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC"}
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HttpNodeSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const behaviors_1 = require("../behaviors");
6
+ const http_1 = require("../config/http");
7
+ const schema_1 = require("../validation/schema");
8
+ const base_node_schema_1 = require("./common/base-node-schema");
9
+ // HTTP Node Schema extends both base schemas
10
+ exports.HttpNodeSchema = base_node_schema_1.BaseNodeSchema.extend({
11
+ type: zod_1.z.literal("http").openapi({
12
+ description: "Specifies the node type as \`http\`. Other available types include \`error_boundary\`, \`agent\`, \`source_iterator\`, and \`destination\`.",
13
+ example: "http",
14
+ }),
15
+ dependencies: zod_1.z.array(zod_1.z.string()).openapi({
16
+ description: "IDs of nodes that must complete before this node can execute",
17
+ example: ["auth_token", "user_id"],
18
+ }),
19
+ http: http_1.HTTPConfigSchema,
20
+ validation: schema_1.ValidationSchema.optional(),
21
+ conditions: behaviors_1.NodeConditionsSchema.optional(),
22
+ }).openapi({
23
+ ref: "HttpNode",
24
+ title: "HttpNode",
25
+ description: "A node that makes HTTP requests",
26
+ "x-tags": ["Nodes"],
27
+ });
28
+ //# sourceMappingURL=http.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http.js","sourceRoot":"","sources":["../../../src/types/nodes/http.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,4CAAoD;AACpD,yCAAkD;AAClD,iDAAwD;AACxD,gEAA2D;AAE3D,6CAA6C;AAChC,QAAA,cAAc,GAAG,iCAAc,CAAC,MAAM,CAAC;IAClD,IAAI,EAAE,OAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC;QAC9B,WAAW,EACT,6IAA6I;QAC/I,OAAO,EAAE,MAAM;KAChB,CAAC;IACF,YAAY,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC;QACxC,WAAW,EAAE,8DAA8D;QAC3E,OAAO,EAAE,CAAC,YAAY,EAAE,SAAS,CAAC;KACnC,CAAC;IACF,IAAI,EAAE,uBAAgB;IACtB,UAAU,EAAE,yBAAgB,CAAC,QAAQ,EAAE;IACvC,UAAU,EAAE,gCAAoB,CAAC,QAAQ,EAAE;CAC5C,CAAC,CAAC,OAAO,CAAC;IACT,GAAG,EAAE,UAAU;IACf,KAAK,EAAE,UAAU;IACjB,WAAW,EAAE,iCAAiC;IAC9C,QAAQ,EAAE,CAAC,OAAO,CAAC;CACpB,CAAC,CAAC"}