@sixb/server 0.1.1 → 0.1.3

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 (178) hide show
  1. package/README.md +3 -3
  2. package/dist/auth/application-access.d.ts +2 -2
  3. package/dist/auth/application-access.d.ts.map +1 -1
  4. package/dist/auth/connector-callback-cookie.d.ts +12 -0
  5. package/dist/auth/connector-callback-cookie.d.ts.map +1 -0
  6. package/dist/auth/experience.d.ts +33 -0
  7. package/dist/auth/experience.d.ts.map +1 -0
  8. package/dist/auth/guard.d.ts +3 -3
  9. package/dist/auth/guard.d.ts.map +1 -1
  10. package/dist/auth/public-routes.d.ts.map +1 -1
  11. package/dist/auth/scope.d.ts +13 -27
  12. package/dist/auth/scope.d.ts.map +1 -1
  13. package/dist/auth/session-cookies.d.ts +2 -2
  14. package/dist/auth/session-cookies.d.ts.map +1 -1
  15. package/dist/connectors/http.d.ts +16 -0
  16. package/dist/connectors/http.d.ts.map +1 -0
  17. package/dist/index.d.ts +1 -0
  18. package/dist/index.d.ts.map +1 -1
  19. package/dist/index.js +3903 -2760
  20. package/dist/index.js.map +58 -50
  21. package/dist/openapi/tags.d.ts +15 -3
  22. package/dist/openapi/tags.d.ts.map +1 -1
  23. package/dist/registerRoutes.d.ts +6 -2
  24. package/dist/registerRoutes.d.ts.map +1 -1
  25. package/dist/routes/action-runs.d.ts +21 -31
  26. package/dist/routes/action-runs.d.ts.map +1 -1
  27. package/dist/routes/actions.d.ts +12 -11
  28. package/dist/routes/actions.d.ts.map +1 -1
  29. package/dist/routes/agent-api-gateway.d.ts +2 -2
  30. package/dist/routes/agent-api-gateway.d.ts.map +1 -1
  31. package/dist/routes/agents.d.ts +230 -159
  32. package/dist/routes/agents.d.ts.map +1 -1
  33. package/dist/routes/ai-accounting.d.ts +31 -0
  34. package/dist/routes/ai-accounting.d.ts.map +1 -0
  35. package/dist/routes/auth.d.ts +149 -92
  36. package/dist/routes/auth.d.ts.map +1 -1
  37. package/dist/routes/connector-connection-runs.d.ts +794 -0
  38. package/dist/routes/connector-connection-runs.d.ts.map +1 -0
  39. package/dist/routes/connector-connections.d.ts +219 -0
  40. package/dist/routes/connector-connections.d.ts.map +1 -0
  41. package/dist/routes/connectors.d.ts +10 -4
  42. package/dist/routes/connectors.d.ts.map +1 -1
  43. package/dist/routes/datasets.d.ts +16 -12
  44. package/dist/routes/datasets.d.ts.map +1 -1
  45. package/dist/routes/events.d.ts +9 -9
  46. package/dist/routes/events.d.ts.map +1 -1
  47. package/dist/routes/files.d.ts +19 -18
  48. package/dist/routes/files.d.ts.map +1 -1
  49. package/dist/routes/links.d.ts +11 -11
  50. package/dist/routes/links.d.ts.map +1 -1
  51. package/dist/routes/logs.d.ts +5 -5
  52. package/dist/routes/logs.d.ts.map +1 -1
  53. package/dist/routes/objects.d.ts +37 -37
  54. package/dist/routes/objects.d.ts.map +1 -1
  55. package/dist/routes/ontology.d.ts +50 -50
  56. package/dist/routes/ontology.d.ts.map +1 -1
  57. package/dist/routes/pipelines.d.ts +28 -38
  58. package/dist/routes/pipelines.d.ts.map +1 -1
  59. package/dist/routes/project.d.ts +2 -2
  60. package/dist/routes/project.d.ts.map +1 -1
  61. package/dist/routes/projections.d.ts +145 -85
  62. package/dist/routes/projections.d.ts.map +1 -1
  63. package/dist/routes/rules.d.ts +6 -6
  64. package/dist/routes/rules.d.ts.map +1 -1
  65. package/dist/routes/status.d.ts +2 -2
  66. package/dist/routes/status.d.ts.map +1 -1
  67. package/dist/routes/syncs.d.ts +23 -28
  68. package/dist/routes/syncs.d.ts.map +1 -1
  69. package/dist/routes/telemetry.d.ts +9 -9
  70. package/dist/routes/telemetry.d.ts.map +1 -1
  71. package/dist/routes/webhook-runs.d.ts +9 -9
  72. package/dist/routes/webhook-runs.d.ts.map +1 -1
  73. package/dist/routes/webhooks.d.ts +2 -2
  74. package/dist/routes/webhooks.d.ts.map +1 -1
  75. package/dist/routes/workflows.d.ts +177 -66
  76. package/dist/routes/workflows.d.ts.map +1 -1
  77. package/dist/routes/ws/agents.d.ts +11 -5
  78. package/dist/routes/ws/agents.d.ts.map +1 -1
  79. package/dist/routes/ws/events.d.ts +8 -8
  80. package/dist/routes/ws/events.d.ts.map +1 -1
  81. package/dist/routes/ws/log-subscription-hub.d.ts +6 -3
  82. package/dist/routes/ws/log-subscription-hub.d.ts.map +1 -1
  83. package/dist/routes/ws/logs.d.ts +10 -10
  84. package/dist/routes/ws/logs.d.ts.map +1 -1
  85. package/dist/schemas/actions.d.ts +89 -194
  86. package/dist/schemas/actions.d.ts.map +1 -1
  87. package/dist/schemas/agents.d.ts +791 -471
  88. package/dist/schemas/agents.d.ts.map +1 -1
  89. package/dist/schemas/ai-accounting.d.ts +2393 -0
  90. package/dist/schemas/ai-accounting.d.ts.map +1 -0
  91. package/dist/schemas/ai-usage.d.ts +34 -0
  92. package/dist/schemas/ai-usage.d.ts.map +1 -0
  93. package/dist/schemas/auth.d.ts +102 -102
  94. package/dist/schemas/common.d.ts +37 -0
  95. package/dist/schemas/common.d.ts.map +1 -1
  96. package/dist/schemas/connectors.d.ts +713 -2
  97. package/dist/schemas/connectors.d.ts.map +1 -1
  98. package/dist/schemas/datasets.d.ts +2 -2
  99. package/dist/schemas/event-payloads.d.ts +12 -12
  100. package/dist/schemas/events.d.ts +40 -40
  101. package/dist/schemas/links.d.ts +2 -2
  102. package/dist/schemas/logs.d.ts +22 -22
  103. package/dist/schemas/objects.d.ts +10 -10
  104. package/dist/schemas/ontology.d.ts +118 -118
  105. package/dist/schemas/pipelines.d.ts +89 -184
  106. package/dist/schemas/pipelines.d.ts.map +1 -1
  107. package/dist/schemas/projections.d.ts +1030 -563
  108. package/dist/schemas/projections.d.ts.map +1 -1
  109. package/dist/schemas/rules.d.ts +6 -6
  110. package/dist/schemas/syncs.d.ts +65 -108
  111. package/dist/schemas/syncs.d.ts.map +1 -1
  112. package/dist/schemas/webhook-runs.d.ts +41 -41
  113. package/dist/schemas/webhook-runs.d.ts.map +1 -1
  114. package/dist/schemas/workflows.d.ts +1189 -185
  115. package/dist/schemas/workflows.d.ts.map +1 -1
  116. package/dist/server.d.ts +11 -6
  117. package/dist/server.d.ts.map +1 -1
  118. package/dist/utils/http.d.ts +2 -0
  119. package/dist/utils/http.d.ts.map +1 -1
  120. package/dist/utils/ws.d.ts +4 -3
  121. package/dist/utils/ws.d.ts.map +1 -1
  122. package/package.json +5 -5
  123. package/src/auth/access-token-boundary.ts +4 -4
  124. package/src/auth/application-access.ts +8 -9
  125. package/src/auth/connector-callback-cookie.ts +95 -0
  126. package/src/auth/experience.ts +190 -0
  127. package/src/auth/guard.ts +11 -11
  128. package/src/auth/public-routes.ts +20 -0
  129. package/src/auth/scope.ts +26 -36
  130. package/src/auth/session-cookies.ts +3 -3
  131. package/src/connectors/http.ts +110 -0
  132. package/src/index.ts +1 -0
  133. package/src/openapi/tags.ts +13 -1
  134. package/src/registerRoutes.ts +36 -23
  135. package/src/routes/action-runs.ts +39 -39
  136. package/src/routes/actions.ts +7 -13
  137. package/src/routes/agent-api-gateway.ts +41 -38
  138. package/src/routes/agents.ts +90 -200
  139. package/src/routes/ai-accounting.ts +166 -0
  140. package/src/routes/auth.ts +274 -122
  141. package/src/routes/connector-connection-runs.ts +346 -0
  142. package/src/routes/connector-connections.ts +135 -0
  143. package/src/routes/connectors.ts +24 -12
  144. package/src/routes/datasets.ts +55 -54
  145. package/src/routes/events.ts +5 -5
  146. package/src/routes/files.ts +22 -30
  147. package/src/routes/links.ts +31 -35
  148. package/src/routes/logs.ts +6 -11
  149. package/src/routes/objects.ts +51 -114
  150. package/src/routes/ontology.ts +27 -38
  151. package/src/routes/pipelines.ts +28 -62
  152. package/src/routes/project.ts +3 -3
  153. package/src/routes/projections.ts +44 -42
  154. package/src/routes/rules.ts +11 -25
  155. package/src/routes/status.ts +5 -5
  156. package/src/routes/syncs.ts +19 -45
  157. package/src/routes/telemetry.ts +18 -29
  158. package/src/routes/webhook-runs.ts +5 -5
  159. package/src/routes/webhooks.ts +259 -341
  160. package/src/routes/workflows.ts +242 -248
  161. package/src/routes/ws/agents.ts +196 -66
  162. package/src/routes/ws/events.ts +11 -10
  163. package/src/routes/ws/log-subscription-hub.ts +6 -12
  164. package/src/routes/ws/logs.ts +13 -5
  165. package/src/schemas/actions.ts +58 -25
  166. package/src/schemas/agents.ts +23 -23
  167. package/src/schemas/ai-accounting.ts +182 -0
  168. package/src/schemas/ai-usage.ts +16 -0
  169. package/src/schemas/common.ts +24 -0
  170. package/src/schemas/connectors.ts +164 -0
  171. package/src/schemas/pipelines.ts +23 -15
  172. package/src/schemas/projections.ts +23 -3
  173. package/src/schemas/syncs.ts +13 -8
  174. package/src/schemas/webhook-runs.ts +10 -5
  175. package/src/schemas/workflows.ts +23 -8
  176. package/src/server.ts +75 -26
  177. package/src/utils/http.ts +34 -6
  178. package/src/utils/ws.ts +10 -5
@@ -1,10 +1,10 @@
1
+ import type { SixbFailure } from "@sixb/core";
1
2
  import { z } from "zod";
2
- export declare const WebhookRunStatusSchema: z.ZodEnum<["running", "succeeded", "failed", "skipped"]>;
3
- export declare const WebhookDeliveryClaimResultSchema: z.ZodEnum<["claimed", "duplicate", "in_progress"]>;
3
+ export declare const WebhookRunStatusSchema: z.ZodEnum<["running", "succeeded", "failed"]>;
4
4
  export declare const WebhookRunsQuerySchema: z.ZodObject<{
5
5
  connectorId: z.ZodOptional<z.ZodString>;
6
6
  webhookId: z.ZodOptional<z.ZodString>;
7
- status: z.ZodOptional<z.ZodEnum<["running", "succeeded", "failed", "skipped"]>>;
7
+ status: z.ZodOptional<z.ZodEnum<["running", "succeeded", "failed"]>>;
8
8
  idempotencyKey: z.ZodOptional<z.ZodString>;
9
9
  startedAfter: z.ZodOptional<z.ZodString>;
10
10
  startedBefore: z.ZodOptional<z.ZodString>;
@@ -12,22 +12,22 @@ export declare const WebhookRunsQuerySchema: z.ZodObject<{
12
12
  offset: z.ZodOptional<z.ZodString>;
13
13
  order: z.ZodOptional<z.ZodEnum<["asc", "desc"]>>;
14
14
  }, "strip", z.ZodTypeAny, {
15
- status?: "running" | "succeeded" | "failed" | "skipped" | undefined;
15
+ status?: "running" | "succeeded" | "failed" | undefined;
16
+ startedAfter?: string | undefined;
17
+ startedBefore?: string | undefined;
16
18
  limit?: string | undefined;
17
19
  offset?: string | undefined;
18
20
  order?: "asc" | "desc" | undefined;
19
- startedAfter?: string | undefined;
20
- startedBefore?: string | undefined;
21
21
  connectorId?: string | undefined;
22
22
  idempotencyKey?: string | undefined;
23
23
  webhookId?: string | undefined;
24
24
  }, {
25
- status?: "running" | "succeeded" | "failed" | "skipped" | undefined;
25
+ status?: "running" | "succeeded" | "failed" | undefined;
26
+ startedAfter?: string | undefined;
27
+ startedBefore?: string | undefined;
26
28
  limit?: string | undefined;
27
29
  offset?: string | undefined;
28
30
  order?: "asc" | "desc" | undefined;
29
- startedAfter?: string | undefined;
30
- startedBefore?: string | undefined;
31
31
  connectorId?: string | undefined;
32
32
  idempotencyKey?: string | undefined;
33
33
  webhookId?: string | undefined;
@@ -35,133 +35,133 @@ export declare const WebhookRunsQuerySchema: z.ZodObject<{
35
35
  export declare const WebhookRunSchema: z.ZodObject<{
36
36
  id: z.ZodString;
37
37
  projectId: z.ZodString;
38
+ executionId: z.ZodString;
38
39
  connectorId: z.ZodString;
39
40
  webhookId: z.ZodString;
40
- status: z.ZodEnum<["running", "succeeded", "failed", "skipped"]>;
41
+ status: z.ZodEnum<["running", "succeeded", "failed"]>;
41
42
  method: z.ZodString;
42
43
  route: z.ZodString;
43
44
  startedAt: z.ZodString;
44
45
  finishedAt: z.ZodOptional<z.ZodString>;
45
- requestBodyBytes: z.ZodOptional<z.ZodNumber>;
46
+ requestBodyBytes: z.ZodNumber;
46
47
  responseStatus: z.ZodOptional<z.ZodNumber>;
47
48
  idempotencyKey: z.ZodOptional<z.ZodString>;
48
- deliveryClaimResult: z.ZodOptional<z.ZodEnum<["claimed", "duplicate", "in_progress"]>>;
49
- error: z.ZodOptional<z.ZodString>;
49
+ error: z.ZodOptional<z.ZodType<SixbFailure<"internal.unexpected" | "webhook.delivery_failed" | "webhook.delivery_rejected">, z.ZodTypeDef, SixbFailure<"internal.unexpected" | "webhook.delivery_failed" | "webhook.delivery_rejected">>>;
50
50
  }, "strip", z.ZodTypeAny, {
51
- status: "running" | "succeeded" | "failed" | "skipped";
51
+ status: "running" | "succeeded" | "failed";
52
52
  projectId: string;
53
53
  id: string;
54
54
  startedAt: string;
55
55
  method: string;
56
56
  route: string;
57
+ executionId: string;
57
58
  connectorId: string;
58
59
  webhookId: string;
59
- error?: string | undefined;
60
+ requestBodyBytes: number;
61
+ error?: SixbFailure<"internal.unexpected" | "webhook.delivery_failed" | "webhook.delivery_rejected"> | undefined;
60
62
  finishedAt?: string | undefined;
61
63
  idempotencyKey?: string | undefined;
62
- requestBodyBytes?: number | undefined;
63
64
  responseStatus?: number | undefined;
64
- deliveryClaimResult?: "claimed" | "duplicate" | "in_progress" | undefined;
65
65
  }, {
66
- status: "running" | "succeeded" | "failed" | "skipped";
66
+ status: "running" | "succeeded" | "failed";
67
67
  projectId: string;
68
68
  id: string;
69
69
  startedAt: string;
70
70
  method: string;
71
71
  route: string;
72
+ executionId: string;
72
73
  connectorId: string;
73
74
  webhookId: string;
74
- error?: string | undefined;
75
+ requestBodyBytes: number;
76
+ error?: SixbFailure<"internal.unexpected" | "webhook.delivery_failed" | "webhook.delivery_rejected"> | undefined;
75
77
  finishedAt?: string | undefined;
76
78
  idempotencyKey?: string | undefined;
77
- requestBodyBytes?: number | undefined;
78
79
  responseStatus?: number | undefined;
79
- deliveryClaimResult?: "claimed" | "duplicate" | "in_progress" | undefined;
80
80
  }>;
81
81
  export declare const WebhookRunListResponseSchema: z.ZodObject<{
82
82
  runs: z.ZodArray<z.ZodObject<{
83
83
  id: z.ZodString;
84
84
  projectId: z.ZodString;
85
+ executionId: z.ZodString;
85
86
  connectorId: z.ZodString;
86
87
  webhookId: z.ZodString;
87
- status: z.ZodEnum<["running", "succeeded", "failed", "skipped"]>;
88
+ status: z.ZodEnum<["running", "succeeded", "failed"]>;
88
89
  method: z.ZodString;
89
90
  route: z.ZodString;
90
91
  startedAt: z.ZodString;
91
92
  finishedAt: z.ZodOptional<z.ZodString>;
92
- requestBodyBytes: z.ZodOptional<z.ZodNumber>;
93
+ requestBodyBytes: z.ZodNumber;
93
94
  responseStatus: z.ZodOptional<z.ZodNumber>;
94
95
  idempotencyKey: z.ZodOptional<z.ZodString>;
95
- deliveryClaimResult: z.ZodOptional<z.ZodEnum<["claimed", "duplicate", "in_progress"]>>;
96
- error: z.ZodOptional<z.ZodString>;
96
+ error: z.ZodOptional<z.ZodType<SixbFailure<"internal.unexpected" | "webhook.delivery_failed" | "webhook.delivery_rejected">, z.ZodTypeDef, SixbFailure<"internal.unexpected" | "webhook.delivery_failed" | "webhook.delivery_rejected">>>;
97
97
  }, "strip", z.ZodTypeAny, {
98
- status: "running" | "succeeded" | "failed" | "skipped";
98
+ status: "running" | "succeeded" | "failed";
99
99
  projectId: string;
100
100
  id: string;
101
101
  startedAt: string;
102
102
  method: string;
103
103
  route: string;
104
+ executionId: string;
104
105
  connectorId: string;
105
106
  webhookId: string;
106
- error?: string | undefined;
107
+ requestBodyBytes: number;
108
+ error?: SixbFailure<"internal.unexpected" | "webhook.delivery_failed" | "webhook.delivery_rejected"> | undefined;
107
109
  finishedAt?: string | undefined;
108
110
  idempotencyKey?: string | undefined;
109
- requestBodyBytes?: number | undefined;
110
111
  responseStatus?: number | undefined;
111
- deliveryClaimResult?: "claimed" | "duplicate" | "in_progress" | undefined;
112
112
  }, {
113
- status: "running" | "succeeded" | "failed" | "skipped";
113
+ status: "running" | "succeeded" | "failed";
114
114
  projectId: string;
115
115
  id: string;
116
116
  startedAt: string;
117
117
  method: string;
118
118
  route: string;
119
+ executionId: string;
119
120
  connectorId: string;
120
121
  webhookId: string;
121
- error?: string | undefined;
122
+ requestBodyBytes: number;
123
+ error?: SixbFailure<"internal.unexpected" | "webhook.delivery_failed" | "webhook.delivery_rejected"> | undefined;
122
124
  finishedAt?: string | undefined;
123
125
  idempotencyKey?: string | undefined;
124
- requestBodyBytes?: number | undefined;
125
126
  responseStatus?: number | undefined;
126
- deliveryClaimResult?: "claimed" | "duplicate" | "in_progress" | undefined;
127
127
  }>, "many">;
128
128
  hasMore: z.ZodBoolean;
129
129
  total: z.ZodNumber;
130
130
  }, "strip", z.ZodTypeAny, {
131
131
  runs: {
132
- status: "running" | "succeeded" | "failed" | "skipped";
132
+ status: "running" | "succeeded" | "failed";
133
133
  projectId: string;
134
134
  id: string;
135
135
  startedAt: string;
136
136
  method: string;
137
137
  route: string;
138
+ executionId: string;
138
139
  connectorId: string;
139
140
  webhookId: string;
140
- error?: string | undefined;
141
+ requestBodyBytes: number;
142
+ error?: SixbFailure<"internal.unexpected" | "webhook.delivery_failed" | "webhook.delivery_rejected"> | undefined;
141
143
  finishedAt?: string | undefined;
142
144
  idempotencyKey?: string | undefined;
143
- requestBodyBytes?: number | undefined;
144
145
  responseStatus?: number | undefined;
145
- deliveryClaimResult?: "claimed" | "duplicate" | "in_progress" | undefined;
146
146
  }[];
147
147
  hasMore: boolean;
148
148
  total: number;
149
149
  }, {
150
150
  runs: {
151
- status: "running" | "succeeded" | "failed" | "skipped";
151
+ status: "running" | "succeeded" | "failed";
152
152
  projectId: string;
153
153
  id: string;
154
154
  startedAt: string;
155
155
  method: string;
156
156
  route: string;
157
+ executionId: string;
157
158
  connectorId: string;
158
159
  webhookId: string;
159
- error?: string | undefined;
160
+ requestBodyBytes: number;
161
+ error?: SixbFailure<"internal.unexpected" | "webhook.delivery_failed" | "webhook.delivery_rejected"> | undefined;
160
162
  finishedAt?: string | undefined;
161
163
  idempotencyKey?: string | undefined;
162
- requestBodyBytes?: number | undefined;
163
164
  responseStatus?: number | undefined;
164
- deliveryClaimResult?: "claimed" | "duplicate" | "in_progress" | undefined;
165
165
  }[];
166
166
  hasMore: boolean;
167
167
  total: number;
@@ -1 +1 @@
1
- {"version":3,"file":"webhook-runs.d.ts","sourceRoot":"","sources":["../../src/schemas/webhook-runs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,sBAAsB,0DAAwD,CAAA;AAE3F,eAAO,MAAM,gCAAgC,oDAAkD,CAAA;AAE/F,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUjC,CAAA;AAEF,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAe3B,CAAA;AAEF,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIvC,CAAA"}
1
+ {"version":3,"file":"webhook-runs.d.ts","sourceRoot":"","sources":["../../src/schemas/webhook-runs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAG7C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAMvB,eAAO,MAAM,sBAAsB,+CAA6C,CAAA;AAEhF,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUjC,CAAA;AAEF,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAe3B,CAAA;AAEF,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIvC,CAAA"}