@herd-labs/sdk 0.3.1 → 0.5.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 (99) hide show
  1. package/dist/index.d.ts +17 -17
  2. package/dist/index.js +17 -17
  3. package/dist/src/config.d.ts +11 -11
  4. package/dist/src/config.js +9 -12
  5. package/dist/src/errors.d.ts +35 -44
  6. package/dist/src/errors.js +19 -16
  7. package/dist/src/live/ActionsServiceLive.d.ts +3 -3
  8. package/dist/src/live/ActionsServiceLive.js +14 -14
  9. package/dist/src/live/AdaptersServiceLive.d.ts +3 -3
  10. package/dist/src/live/AdaptersServiceLive.js +8 -8
  11. package/dist/src/live/AgentSafesServiceLive.d.ts +3 -3
  12. package/dist/src/live/AgentSafesServiceLive.js +5 -5
  13. package/dist/src/live/AgentWalletsServiceLive.d.ts +3 -3
  14. package/dist/src/live/AgentWalletsServiceLive.js +4 -4
  15. package/dist/src/live/AgentWorkflowsServiceLive.d.ts +3 -3
  16. package/dist/src/live/AgentWorkflowsServiceLive.js +14 -14
  17. package/dist/src/live/AuthServiceLive.d.ts +3 -3
  18. package/dist/src/live/AuthServiceLive.js +7 -7
  19. package/dist/src/live/BookmarksServiceLive.d.ts +3 -3
  20. package/dist/src/live/BookmarksServiceLive.js +20 -20
  21. package/dist/src/live/CodeBlocksServiceLive.d.ts +3 -3
  22. package/dist/src/live/CodeBlocksServiceLive.js +11 -11
  23. package/dist/src/live/CollectionsServiceLive.d.ts +3 -3
  24. package/dist/src/live/CollectionsServiceLive.js +6 -6
  25. package/dist/src/live/ContractsServiceLive.d.ts +3 -3
  26. package/dist/src/live/ContractsServiceLive.js +10 -10
  27. package/dist/src/live/DocsServiceLive.d.ts +3 -3
  28. package/dist/src/live/DocsServiceLive.js +4 -4
  29. package/dist/src/live/GroupsServiceLive.d.ts +3 -3
  30. package/dist/src/live/GroupsServiceLive.js +9 -9
  31. package/dist/src/live/HalServiceLive.d.ts +3 -3
  32. package/dist/src/live/HalServiceLive.js +12 -12
  33. package/dist/src/live/TransactionsServiceLive.d.ts +3 -3
  34. package/dist/src/live/TransactionsServiceLive.js +18 -18
  35. package/dist/src/live/WalletsServiceLive.d.ts +3 -3
  36. package/dist/src/live/WalletsServiceLive.js +18 -18
  37. package/dist/src/live/http.d.ts +6 -6
  38. package/dist/src/live/http.js +15 -15
  39. package/dist/src/schemas/actions.d.ts +179 -339
  40. package/dist/src/schemas/actions.js +80 -76
  41. package/dist/src/schemas/adapters.d.ts +7 -17
  42. package/dist/src/schemas/adapters.js +5 -5
  43. package/dist/src/schemas/agent-wallets.d.ts +98 -222
  44. package/dist/src/schemas/agent-wallets.js +52 -52
  45. package/dist/src/schemas/agent-workflows.d.ts +104 -104
  46. package/dist/src/schemas/agent-workflows.js +53 -49
  47. package/dist/src/schemas/auth.d.ts +35 -64
  48. package/dist/src/schemas/auth.js +16 -16
  49. package/dist/src/schemas/bookmarks.d.ts +98 -216
  50. package/dist/src/schemas/bookmarks.js +55 -51
  51. package/dist/src/schemas/codeblocks.d.ts +149 -308
  52. package/dist/src/schemas/codeblocks.js +72 -67
  53. package/dist/src/schemas/collections.d.ts +120 -232
  54. package/dist/src/schemas/collections.js +48 -44
  55. package/dist/src/schemas/common.d.ts +13 -29
  56. package/dist/src/schemas/common.js +8 -8
  57. package/dist/src/schemas/contracts.d.ts +256 -447
  58. package/dist/src/schemas/contracts.js +92 -103
  59. package/dist/src/schemas/docs.d.ts +12 -29
  60. package/dist/src/schemas/docs.js +9 -9
  61. package/dist/src/schemas/groups.d.ts +74 -74
  62. package/dist/src/schemas/groups.js +32 -32
  63. package/dist/src/schemas/hal.d.ts +109 -217
  64. package/dist/src/schemas/hal.js +44 -42
  65. package/dist/src/schemas/transactions.d.ts +648 -926
  66. package/dist/src/schemas/transactions.js +158 -162
  67. package/dist/src/schemas/wallets.d.ts +577 -731
  68. package/dist/src/schemas/wallets.js +206 -145
  69. package/dist/src/services/ActionsService.d.ts +3 -3
  70. package/dist/src/services/ActionsService.js +2 -2
  71. package/dist/src/services/AdaptersService.d.ts +1 -1
  72. package/dist/src/services/AdaptersService.js +2 -2
  73. package/dist/src/services/AgentSafesService.d.ts +5 -5
  74. package/dist/src/services/AgentSafesService.js +2 -2
  75. package/dist/src/services/AgentWalletsService.d.ts +3 -3
  76. package/dist/src/services/AgentWalletsService.js +2 -2
  77. package/dist/src/services/AgentWorkflowsService.d.ts +11 -11
  78. package/dist/src/services/AgentWorkflowsService.js +6 -2
  79. package/dist/src/services/AuthService.d.ts +5 -5
  80. package/dist/src/services/AuthService.js +2 -2
  81. package/dist/src/services/BookmarksService.d.ts +3 -3
  82. package/dist/src/services/BookmarksService.js +2 -2
  83. package/dist/src/services/CodeBlocksService.d.ts +1 -1
  84. package/dist/src/services/CodeBlocksService.js +2 -2
  85. package/dist/src/services/CollectionsService.d.ts +1 -1
  86. package/dist/src/services/CollectionsService.js +2 -2
  87. package/dist/src/services/ContractsService.d.ts +6 -6
  88. package/dist/src/services/ContractsService.js +2 -2
  89. package/dist/src/services/DocsService.d.ts +2 -2
  90. package/dist/src/services/DocsService.js +2 -2
  91. package/dist/src/services/GroupsService.d.ts +13 -13
  92. package/dist/src/services/GroupsService.js +4 -2
  93. package/dist/src/services/HalService.d.ts +1 -1
  94. package/dist/src/services/HalService.js +2 -2
  95. package/dist/src/services/TransactionsService.d.ts +5 -5
  96. package/dist/src/services/TransactionsService.js +2 -2
  97. package/dist/src/services/WalletsService.d.ts +5 -5
  98. package/dist/src/services/WalletsService.js +2 -2
  99. package/package.json +13 -18
@@ -1,317 +1,158 @@
1
1
  import { Schema } from "effect";
2
2
 
3
3
  //#region src/schemas/codeblocks.d.ts
4
- declare const CodeBlockCode_base: Schema.Class<CodeBlockCode, {
5
- id: typeof Schema.String;
6
- name: typeof Schema.String;
7
- intent: typeof Schema.String;
8
- code: typeof Schema.String;
9
- arguments: Schema.optional<typeof Schema.Unknown>;
10
- valTownFileUrl: typeof Schema.String;
11
- publishedAt: Schema.NullOr<typeof Schema.String>;
12
- }, Schema.Struct.Encoded<{
13
- id: typeof Schema.String;
14
- name: typeof Schema.String;
15
- intent: typeof Schema.String;
16
- code: typeof Schema.String;
17
- arguments: Schema.optional<typeof Schema.Unknown>;
18
- valTownFileUrl: typeof Schema.String;
19
- publishedAt: Schema.NullOr<typeof Schema.String>;
20
- }>, never, {
21
- readonly id: string;
22
- } & {
23
- readonly name: string;
24
- } & {
25
- readonly intent: string;
26
- } & {
27
- readonly publishedAt: string | null;
28
- } & {
29
- readonly code: string;
30
- } & {
31
- readonly valTownFileUrl: string;
32
- } & {
33
- readonly arguments?: unknown;
34
- }, {}, {}>;
35
- declare class CodeBlockCode extends CodeBlockCode_base {}
36
- declare const CodeBlockVersion_base: Schema.Class<CodeBlockVersion, {
37
- id: typeof Schema.String;
38
- name: typeof Schema.String;
39
- intent: typeof Schema.String;
40
- publishedAt: Schema.NullOr<typeof Schema.String>;
41
- }, Schema.Struct.Encoded<{
42
- id: typeof Schema.String;
43
- name: typeof Schema.String;
44
- intent: typeof Schema.String;
45
- publishedAt: Schema.NullOr<typeof Schema.String>;
46
- }>, never, {
47
- readonly id: string;
48
- } & {
49
- readonly name: string;
50
- } & {
51
- readonly intent: string;
52
- } & {
53
- readonly publishedAt: string | null;
54
- }, {}, {}>;
55
- declare class CodeBlockVersion extends CodeBlockVersion_base {}
56
- declare const CodeBlockDefinition_base: Schema.Class<CodeBlockDefinition, {
57
- id: typeof Schema.String;
58
- name: typeof Schema.String;
59
- intent: typeof Schema.String;
60
- latestCode: Schema.NullOr<typeof CodeBlockCode>;
61
- allVersions: Schema.optional<Schema.Array$<typeof CodeBlockVersion>>;
62
- actionId: Schema.optional<Schema.NullOr<typeof Schema.String>>;
63
- }, Schema.Struct.Encoded<{
64
- id: typeof Schema.String;
65
- name: typeof Schema.String;
66
- intent: typeof Schema.String;
67
- latestCode: Schema.NullOr<typeof CodeBlockCode>;
68
- allVersions: Schema.optional<Schema.Array$<typeof CodeBlockVersion>>;
69
- actionId: Schema.optional<Schema.NullOr<typeof Schema.String>>;
70
- }>, never, {
71
- readonly id: string;
72
- } & {
73
- readonly name: string;
74
- } & {
75
- readonly intent: string;
76
- } & {
77
- readonly actionId?: string | null | undefined;
78
- } & {
79
- readonly latestCode: CodeBlockCode | null;
80
- } & {
81
- readonly allVersions?: readonly CodeBlockVersion[] | undefined;
82
- }, {}, {}>;
83
- declare class CodeBlockDefinition extends CodeBlockDefinition_base {}
84
- declare const CodeBlocksSearchParams_base: Schema.Class<CodeBlocksSearchParams, {
85
- scope: Schema.Literal<["user", "public"]>;
86
- limit: typeof Schema.Number;
87
- cursor: Schema.optional<typeof Schema.String>;
88
- filters: Schema.optional<Schema.Struct<{
89
- name: Schema.optional<typeof Schema.String>;
4
+ declare const CodeBlockCodeSchema: Schema.Struct<{
5
+ readonly arguments: Schema.optional<Schema.Unknown>;
6
+ readonly code: Schema.String;
7
+ readonly id: Schema.String;
8
+ readonly intent: Schema.String;
9
+ readonly name: Schema.String;
10
+ readonly publishedAt: Schema.NullOr<Schema.String>;
11
+ readonly valTownFileUrl: Schema.String;
12
+ }>;
13
+ type CodeBlockCode = typeof CodeBlockCodeSchema.Type;
14
+ declare const CodeBlockVersionSchema: Schema.Struct<{
15
+ readonly id: Schema.String;
16
+ readonly intent: Schema.String;
17
+ readonly name: Schema.String;
18
+ readonly publishedAt: Schema.NullOr<Schema.String>;
19
+ }>;
20
+ type CodeBlockVersion = typeof CodeBlockVersionSchema.Type;
21
+ declare const CodeBlockDefinitionSchema: Schema.Struct<{
22
+ readonly actionId: Schema.optional<Schema.NullOr<Schema.String>>;
23
+ readonly allVersions: Schema.optional<Schema.$Array<Schema.Struct<{
24
+ readonly id: Schema.String;
25
+ readonly intent: Schema.String;
26
+ readonly name: Schema.String;
27
+ readonly publishedAt: Schema.NullOr<Schema.String>;
28
+ }>>>;
29
+ readonly id: Schema.String;
30
+ readonly intent: Schema.String;
31
+ readonly latestCode: Schema.NullOr<Schema.Struct<{
32
+ readonly arguments: Schema.optional<Schema.Unknown>;
33
+ readonly code: Schema.String;
34
+ readonly id: Schema.String;
35
+ readonly intent: Schema.String;
36
+ readonly name: Schema.String;
37
+ readonly publishedAt: Schema.NullOr<Schema.String>;
38
+ readonly valTownFileUrl: Schema.String;
90
39
  }>>;
91
- }, Schema.Struct.Encoded<{
92
- scope: Schema.Literal<["user", "public"]>;
93
- limit: typeof Schema.Number;
94
- cursor: Schema.optional<typeof Schema.String>;
95
- filters: Schema.optional<Schema.Struct<{
96
- name: Schema.optional<typeof Schema.String>;
40
+ readonly name: Schema.String;
41
+ }>;
42
+ type CodeBlockDefinition = typeof CodeBlockDefinitionSchema.Type;
43
+ declare const CodeBlocksSearchParamsSchema: Schema.Struct<{
44
+ readonly cursor: Schema.optional<Schema.String>;
45
+ readonly filters: Schema.optional<Schema.Struct<{
46
+ readonly name: Schema.optional<Schema.String>;
97
47
  }>>;
98
- }>, never, {
99
- readonly scope: "user" | "public";
100
- } & {
101
- readonly limit: number;
102
- } & {
103
- readonly filters?: {
104
- readonly name?: string | undefined;
105
- } | undefined;
106
- } & {
107
- readonly cursor?: string | undefined;
108
- }, {}, {}>;
109
- declare class CodeBlocksSearchParams extends CodeBlocksSearchParams_base {}
110
- declare const CodeBlocksSearchResponse_base: Schema.Class<CodeBlocksSearchResponse, {
111
- items: Schema.Array$<typeof CodeBlockDefinition>;
112
- nextCursor: Schema.optional<Schema.NullOr<typeof Schema.String>>;
113
- }, Schema.Struct.Encoded<{
114
- items: Schema.Array$<typeof CodeBlockDefinition>;
115
- nextCursor: Schema.optional<Schema.NullOr<typeof Schema.String>>;
116
- }>, never, {
117
- readonly items: readonly CodeBlockDefinition[];
118
- } & {
119
- readonly nextCursor?: string | null | undefined;
120
- }, {}, {}>;
121
- declare class CodeBlocksSearchResponse extends CodeBlocksSearchResponse_base {}
122
- declare const CreateCodeBlockResponse_base: Schema.Class<CreateCodeBlockResponse, {
123
- id: typeof Schema.String;
124
- name: typeof Schema.String;
125
- intent: typeof Schema.String;
126
- code: Schema.Struct<{
127
- id: typeof Schema.String;
128
- name: typeof Schema.String;
129
- valTownFileUrl: typeof Schema.String;
130
- }>;
131
- }, Schema.Struct.Encoded<{
132
- id: typeof Schema.String;
133
- name: typeof Schema.String;
134
- intent: typeof Schema.String;
135
- code: Schema.Struct<{
136
- id: typeof Schema.String;
137
- name: typeof Schema.String;
138
- valTownFileUrl: typeof Schema.String;
139
- }>;
140
- }>, never, {
141
- readonly id: string;
142
- } & {
143
- readonly name: string;
144
- } & {
145
- readonly intent: string;
146
- } & {
147
- readonly code: {
148
- readonly id: string;
149
- readonly name: string;
150
- readonly valTownFileUrl: string;
151
- };
152
- }, {}, {}>;
153
- declare class CreateCodeBlockResponse extends CreateCodeBlockResponse_base {}
154
- declare const PublishCodeBlockResponse_base: Schema.Class<PublishCodeBlockResponse, {
155
- id: typeof Schema.String;
156
- publishedAt: typeof Schema.String;
157
- }, Schema.Struct.Encoded<{
158
- id: typeof Schema.String;
159
- publishedAt: typeof Schema.String;
160
- }>, never, {
161
- readonly id: string;
162
- } & {
163
- readonly publishedAt: string;
164
- }, {}, {}>;
165
- declare class PublishCodeBlockResponse extends PublishCodeBlockResponse_base {}
166
- declare const CodeBlockLogEntry_base: Schema.Class<CodeBlockLogEntry, {
167
- level: typeof Schema.String;
168
- message: typeof Schema.String;
169
- time: typeof Schema.String;
170
- }, Schema.Struct.Encoded<{
171
- level: typeof Schema.String;
172
- message: typeof Schema.String;
173
- time: typeof Schema.String;
174
- }>, never, {
175
- readonly message: string;
176
- } & {
177
- readonly level: string;
178
- } & {
179
- readonly time: string;
180
- }, {}, {}>;
181
- declare class CodeBlockLogEntry extends CodeBlockLogEntry_base {}
182
- declare const CodeBlockExecuteResponse_base: Schema.Class<CodeBlockExecuteResponse, {
183
- response: typeof Schema.Unknown;
184
- error: Schema.optional<Schema.Struct<{
185
- status: Schema.optional<typeof Schema.Number>;
186
- message: typeof Schema.String;
187
- body: Schema.optional<typeof Schema.Unknown>;
48
+ readonly limit: Schema.Number;
49
+ readonly scope: Schema.Literals<readonly ["user", "public"]>;
50
+ }>;
51
+ type CodeBlocksSearchParams = typeof CodeBlocksSearchParamsSchema.Type;
52
+ declare const CodeBlocksSearchResponseSchema: Schema.Struct<{
53
+ readonly items: Schema.$Array<Schema.Struct<{
54
+ readonly actionId: Schema.optional<Schema.NullOr<Schema.String>>;
55
+ readonly allVersions: Schema.optional<Schema.$Array<Schema.Struct<{
56
+ readonly id: Schema.String;
57
+ readonly intent: Schema.String;
58
+ readonly name: Schema.String;
59
+ readonly publishedAt: Schema.NullOr<Schema.String>;
60
+ }>>>;
61
+ readonly id: Schema.String;
62
+ readonly intent: Schema.String;
63
+ readonly latestCode: Schema.NullOr<Schema.Struct<{
64
+ readonly arguments: Schema.optional<Schema.Unknown>;
65
+ readonly code: Schema.String;
66
+ readonly id: Schema.String;
67
+ readonly intent: Schema.String;
68
+ readonly name: Schema.String;
69
+ readonly publishedAt: Schema.NullOr<Schema.String>;
70
+ readonly valTownFileUrl: Schema.String;
71
+ }>>;
72
+ readonly name: Schema.String;
188
73
  }>>;
189
- logs: Schema.optionalWith<Schema.Array$<typeof CodeBlockLogEntry>, {
190
- default: () => never[];
74
+ readonly nextCursor: Schema.optional<Schema.NullOr<Schema.String>>;
75
+ }>;
76
+ type CodeBlocksSearchResponse = typeof CodeBlocksSearchResponseSchema.Type;
77
+ declare const CreateCodeBlockResponseSchema: Schema.Struct<{
78
+ readonly code: Schema.Struct<{
79
+ readonly id: Schema.String;
80
+ readonly name: Schema.String;
81
+ readonly valTownFileUrl: Schema.String;
191
82
  }>;
192
- }, Schema.Struct.Encoded<{
193
- response: typeof Schema.Unknown;
194
- error: Schema.optional<Schema.Struct<{
195
- status: Schema.optional<typeof Schema.Number>;
196
- message: typeof Schema.String;
197
- body: Schema.optional<typeof Schema.Unknown>;
83
+ readonly id: Schema.String;
84
+ readonly intent: Schema.String;
85
+ readonly name: Schema.String;
86
+ }>;
87
+ type CreateCodeBlockResponse = typeof CreateCodeBlockResponseSchema.Type;
88
+ declare const PublishCodeBlockResponseSchema: Schema.Struct<{
89
+ readonly id: Schema.String;
90
+ readonly publishedAt: Schema.String;
91
+ }>;
92
+ type PublishCodeBlockResponse = typeof PublishCodeBlockResponseSchema.Type;
93
+ declare const CodeBlockLogEntrySchema: Schema.Struct<{
94
+ readonly level: Schema.String;
95
+ readonly message: Schema.String;
96
+ readonly time: Schema.String;
97
+ }>;
98
+ type CodeBlockLogEntry = typeof CodeBlockLogEntrySchema.Type;
99
+ declare const CodeBlockExecuteResponseSchema: Schema.Struct<{
100
+ readonly error: Schema.optional<Schema.Struct<{
101
+ readonly status: Schema.optional<Schema.Number>;
102
+ readonly message: Schema.String;
103
+ readonly body: Schema.optional<Schema.Unknown>;
198
104
  }>>;
199
- logs: Schema.optionalWith<Schema.Array$<typeof CodeBlockLogEntry>, {
200
- default: () => never[];
201
- }>;
202
- }>, never, {
203
- readonly response: unknown;
204
- } & {
205
- readonly error?: {
206
- readonly message: string;
207
- readonly body?: unknown;
208
- readonly status?: number | undefined;
209
- } | undefined;
210
- } & {
211
- readonly logs?: readonly CodeBlockLogEntry[];
212
- }, {}, {}>;
213
- declare class CodeBlockExecuteResponse extends CodeBlockExecuteResponse_base {}
214
- declare const CreateCodeBlockParams_base: Schema.Class<CreateCodeBlockParams, {
215
- name: typeof Schema.String;
216
- code: typeof Schema.String;
217
- intent: Schema.optional<typeof Schema.String>;
218
- }, Schema.Struct.Encoded<{
219
- name: typeof Schema.String;
220
- code: typeof Schema.String;
221
- intent: Schema.optional<typeof Schema.String>;
222
- }>, never, {
223
- readonly name: string;
224
- } & {
225
- readonly intent?: string | undefined;
226
- } & {
227
- readonly code: string;
228
- }, {}, {}>;
229
- declare class CreateCodeBlockParams extends CreateCodeBlockParams_base {}
230
- declare const CreateCodeVersionParams_base: Schema.Class<CreateCodeVersionParams, {
231
- name: typeof Schema.String;
232
- code: typeof Schema.String;
233
- intent: Schema.optional<typeof Schema.String>;
234
- }, Schema.Struct.Encoded<{
235
- name: typeof Schema.String;
236
- code: typeof Schema.String;
237
- intent: Schema.optional<typeof Schema.String>;
238
- }>, never, {
239
- readonly name: string;
240
- } & {
241
- readonly intent?: string | undefined;
242
- } & {
243
- readonly code: string;
244
- }, {}, {}>;
245
- declare class CreateCodeVersionParams extends CreateCodeVersionParams_base {}
246
- declare const CreateCodeVersionResponse_base: Schema.Class<CreateCodeVersionResponse, {
247
- id: typeof Schema.String;
248
- name: typeof Schema.String;
249
- intent: typeof Schema.String;
250
- code: typeof Schema.String;
251
- valTownFileUrl: typeof Schema.String;
252
- publishedAt: Schema.NullOr<typeof Schema.String>;
253
- }, Schema.Struct.Encoded<{
254
- id: typeof Schema.String;
255
- name: typeof Schema.String;
256
- intent: typeof Schema.String;
257
- code: typeof Schema.String;
258
- valTownFileUrl: typeof Schema.String;
259
- publishedAt: Schema.NullOr<typeof Schema.String>;
260
- }>, never, {
261
- readonly id: string;
262
- } & {
263
- readonly name: string;
264
- } & {
265
- readonly intent: string;
266
- } & {
267
- readonly publishedAt: string | null;
268
- } & {
269
- readonly code: string;
270
- } & {
271
- readonly valTownFileUrl: string;
272
- }, {}, {}>;
273
- declare class CreateCodeVersionResponse extends CreateCodeVersionResponse_base {}
274
- declare const UpdateCodeBlockMetadataParams_base: Schema.Class<UpdateCodeBlockMetadataParams, {
275
- name: Schema.optional<typeof Schema.String>;
276
- intent: Schema.optional<typeof Schema.String>;
277
- }, Schema.Struct.Encoded<{
278
- name: Schema.optional<typeof Schema.String>;
279
- intent: Schema.optional<typeof Schema.String>;
280
- }>, never, {
281
- readonly name?: string | undefined;
282
- } & {
283
- readonly intent?: string | undefined;
284
- }, {}, {}>;
285
- declare class UpdateCodeBlockMetadataParams extends UpdateCodeBlockMetadataParams_base {}
286
- declare const UpdateCodeParams_base: Schema.Class<UpdateCodeParams, {
287
- code: typeof Schema.String;
288
- }, Schema.Struct.Encoded<{
289
- code: typeof Schema.String;
290
- }>, never, {
291
- readonly code: string;
292
- }, {}, {}>;
293
- declare class UpdateCodeParams extends UpdateCodeParams_base {}
294
- declare const PublishCodeParams_base: Schema.Class<PublishCodeParams, {
295
- intent: Schema.optional<typeof Schema.String>;
296
- }, Schema.Struct.Encoded<{
297
- intent: Schema.optional<typeof Schema.String>;
298
- }>, never, {
299
- readonly intent?: string | undefined;
300
- }, {}, {}>;
301
- declare class PublishCodeParams extends PublishCodeParams_base {}
302
- declare const ExecuteCodeBlockParams_base: Schema.Class<ExecuteCodeBlockParams, {
303
- arguments: Schema.Record$<typeof Schema.String, typeof Schema.Unknown>;
304
- test: Schema.optional<typeof Schema.Boolean>;
305
- }, Schema.Struct.Encoded<{
306
- arguments: Schema.Record$<typeof Schema.String, typeof Schema.Unknown>;
307
- test: Schema.optional<typeof Schema.Boolean>;
308
- }>, never, {
309
- readonly arguments: {
310
- readonly [x: string]: unknown;
311
- };
312
- } & {
313
- readonly test?: boolean | undefined;
314
- }, {}, {}>;
315
- declare class ExecuteCodeBlockParams extends ExecuteCodeBlockParams_base {}
105
+ readonly logs: Schema.withDecodingDefaultType<Schema.$Array<Schema.Struct<{
106
+ readonly level: Schema.String;
107
+ readonly message: Schema.String;
108
+ readonly time: Schema.String;
109
+ }>>, never>;
110
+ readonly response: Schema.Unknown;
111
+ }>;
112
+ type CodeBlockExecuteResponse = typeof CodeBlockExecuteResponseSchema.Type;
113
+ declare const CreateCodeBlockParamsSchema: Schema.Struct<{
114
+ readonly code: Schema.String;
115
+ readonly intent: Schema.optional<Schema.String>;
116
+ readonly name: Schema.String;
117
+ }>;
118
+ type CreateCodeBlockParams = typeof CreateCodeBlockParamsSchema.Type;
119
+ declare const CreateCodeVersionParamsSchema: Schema.Struct<{
120
+ readonly code: Schema.String;
121
+ readonly intent: Schema.optional<Schema.String>;
122
+ readonly name: Schema.String;
123
+ }>;
124
+ type CreateCodeVersionParams = typeof CreateCodeVersionParamsSchema.Type;
125
+ declare const CreateCodeVersionResponseSchema: Schema.Struct<{
126
+ readonly code: Schema.String;
127
+ readonly id: Schema.String;
128
+ readonly intent: Schema.String;
129
+ readonly name: Schema.String;
130
+ readonly publishedAt: Schema.NullOr<Schema.String>;
131
+ readonly valTownFileUrl: Schema.String;
132
+ }>;
133
+ type CreateCodeVersionResponse = typeof CreateCodeVersionResponseSchema.Type;
134
+ declare const UpdateCodeBlockMetadataParamsSchema: Schema.Struct<{
135
+ readonly intent: Schema.optional<Schema.String>;
136
+ readonly name: Schema.optional<Schema.String>;
137
+ }>;
138
+ type UpdateCodeBlockMetadataParams = typeof UpdateCodeBlockMetadataParamsSchema.Type;
139
+ declare const UpdateCodeParamsSchema: Schema.Struct<{
140
+ readonly code: Schema.String;
141
+ }>;
142
+ type UpdateCodeParams = typeof UpdateCodeParamsSchema.Type;
143
+ declare const PublishCodeParamsSchema: Schema.Struct<{
144
+ readonly intent: Schema.optional<Schema.String>;
145
+ }>;
146
+ type PublishCodeParams = typeof PublishCodeParamsSchema.Type;
147
+ declare const ExecuteCodeBlockParamsSchema: Schema.Union<readonly [Schema.Struct<{
148
+ readonly test: Schema.withDecodingDefaultType<Schema.Literal<true>, never>;
149
+ readonly includeLogs: Schema.optional<Schema.Boolean>;
150
+ readonly arguments: Schema.$Record<Schema.String, Schema.Unknown>;
151
+ }>, Schema.Struct<{
152
+ readonly test: Schema.Literal<false>;
153
+ readonly includeLogs: Schema.optional<Schema.Literal<false>>;
154
+ readonly arguments: Schema.$Record<Schema.String, Schema.Unknown>;
155
+ }>]>;
156
+ type ExecuteCodeBlockParams = typeof ExecuteCodeBlockParamsSchema.Type;
316
157
  //#endregion
317
- export { CodeBlockCode, CodeBlockDefinition, CodeBlockExecuteResponse, CodeBlockLogEntry, CodeBlockVersion, CodeBlocksSearchParams, CodeBlocksSearchResponse, CreateCodeBlockParams, CreateCodeBlockResponse, CreateCodeVersionParams, CreateCodeVersionResponse, ExecuteCodeBlockParams, PublishCodeBlockResponse, PublishCodeParams, UpdateCodeBlockMetadataParams, UpdateCodeParams };
158
+ export { CodeBlockCode, CodeBlockCodeSchema, CodeBlockDefinition, CodeBlockDefinitionSchema, CodeBlockExecuteResponse, CodeBlockExecuteResponseSchema, CodeBlockLogEntry, CodeBlockLogEntrySchema, CodeBlockVersion, CodeBlockVersionSchema, CodeBlocksSearchParams, CodeBlocksSearchParamsSchema, CodeBlocksSearchResponse, CodeBlocksSearchResponseSchema, CreateCodeBlockParams, CreateCodeBlockParamsSchema, CreateCodeBlockResponse, CreateCodeBlockResponseSchema, CreateCodeVersionParams, CreateCodeVersionParamsSchema, CreateCodeVersionResponse, CreateCodeVersionResponseSchema, ExecuteCodeBlockParams, ExecuteCodeBlockParamsSchema, PublishCodeBlockResponse, PublishCodeBlockResponseSchema, PublishCodeParams, PublishCodeParamsSchema, UpdateCodeBlockMetadataParams, UpdateCodeBlockMetadataParamsSchema, UpdateCodeParams, UpdateCodeParamsSchema };
@@ -1,98 +1,103 @@
1
- import { Schema } from "effect";
1
+ import { Effect, Schema } from "effect";
2
2
 
3
3
  //#region src/schemas/codeblocks.ts
4
- var CodeBlockCode = class extends Schema.Class("CodeBlockCode")({
5
- id: Schema.String,
6
- name: Schema.String,
7
- intent: Schema.String,
8
- code: Schema.String,
4
+ const CodeBlockCodeSchema = Schema.Struct({
9
5
  arguments: Schema.optional(Schema.Unknown),
10
- valTownFileUrl: Schema.String,
11
- publishedAt: Schema.NullOr(Schema.String)
12
- }) {};
13
- var CodeBlockVersion = class extends Schema.Class("CodeBlockVersion")({
6
+ code: Schema.String,
14
7
  id: Schema.String,
8
+ intent: Schema.String,
15
9
  name: Schema.String,
10
+ publishedAt: Schema.NullOr(Schema.String),
11
+ valTownFileUrl: Schema.String
12
+ });
13
+ const CodeBlockVersionSchema = Schema.Struct({
14
+ id: Schema.String,
16
15
  intent: Schema.String,
16
+ name: Schema.String,
17
17
  publishedAt: Schema.NullOr(Schema.String)
18
- }) {};
19
- var CodeBlockDefinition = class extends Schema.Class("CodeBlockDefinition")({
18
+ });
19
+ const CodeBlockDefinitionSchema = Schema.Struct({
20
+ actionId: Schema.optional(Schema.NullOr(Schema.String)),
21
+ allVersions: Schema.optional(Schema.Array(CodeBlockVersionSchema)),
20
22
  id: Schema.String,
21
- name: Schema.String,
22
23
  intent: Schema.String,
23
- latestCode: Schema.NullOr(CodeBlockCode),
24
- allVersions: Schema.optional(Schema.Array(CodeBlockVersion)),
25
- actionId: Schema.optional(Schema.NullOr(Schema.String))
26
- }) {};
27
- var CodeBlocksSearchParams = class extends Schema.Class("CodeBlocksSearchParams")({
28
- scope: Schema.Literal("user", "public"),
29
- limit: Schema.Number,
24
+ latestCode: Schema.NullOr(CodeBlockCodeSchema),
25
+ name: Schema.String
26
+ });
27
+ const CodeBlocksSearchParamsSchema = Schema.Struct({
30
28
  cursor: Schema.optional(Schema.String),
31
- filters: Schema.optional(Schema.Struct({ name: Schema.optional(Schema.String) }))
32
- }) {};
33
- var CodeBlocksSearchResponse = class extends Schema.Class("CodeBlocksSearchResponse")({
34
- items: Schema.Array(CodeBlockDefinition),
29
+ filters: Schema.optional(Schema.Struct({ name: Schema.optional(Schema.String) })),
30
+ limit: Schema.Number,
31
+ scope: Schema.Literals(["user", "public"])
32
+ });
33
+ const CodeBlocksSearchResponseSchema = Schema.Struct({
34
+ items: Schema.Array(CodeBlockDefinitionSchema),
35
35
  nextCursor: Schema.optional(Schema.NullOr(Schema.String))
36
- }) {};
37
- var CreateCodeBlockResponse = class extends Schema.Class("CreateCodeBlockResponse")({
38
- id: Schema.String,
39
- name: Schema.String,
40
- intent: Schema.String,
36
+ });
37
+ const CreateCodeBlockResponseSchema = Schema.Struct({
41
38
  code: Schema.Struct({
42
39
  id: Schema.String,
43
40
  name: Schema.String,
44
41
  valTownFileUrl: Schema.String
45
- })
46
- }) {};
47
- var PublishCodeBlockResponse = class extends Schema.Class("PublishCodeBlockResponse")({
42
+ }),
43
+ id: Schema.String,
44
+ intent: Schema.String,
45
+ name: Schema.String
46
+ });
47
+ const PublishCodeBlockResponseSchema = Schema.Struct({
48
48
  id: Schema.String,
49
49
  publishedAt: Schema.String
50
- }) {};
51
- var CodeBlockLogEntry = class extends Schema.Class("CodeBlockLogEntry")({
50
+ });
51
+ const CodeBlockLogEntrySchema = Schema.Struct({
52
52
  level: Schema.String,
53
53
  message: Schema.String,
54
54
  time: Schema.String
55
- }) {};
56
- var CodeBlockExecuteResponse = class extends Schema.Class("CodeBlockExecuteResponse")({
57
- response: Schema.Unknown,
55
+ });
56
+ const CodeBlockExecuteResponseSchema = Schema.Struct({
58
57
  error: Schema.optional(Schema.Struct({
59
58
  status: Schema.optional(Schema.Number),
60
59
  message: Schema.String,
61
60
  body: Schema.optional(Schema.Unknown)
62
61
  })),
63
- logs: Schema.optionalWith(Schema.Array(CodeBlockLogEntry), { default: () => [] })
64
- }) {};
65
- var CreateCodeBlockParams = class extends Schema.Class("CreateCodeBlockParams")({
66
- name: Schema.String,
62
+ logs: Schema.Array(CodeBlockLogEntrySchema).pipe(Schema.withDecodingDefaultType(Effect.succeed([]))),
63
+ response: Schema.Unknown
64
+ });
65
+ const CreateCodeBlockParamsSchema = Schema.Struct({
67
66
  code: Schema.String,
68
- intent: Schema.optional(Schema.String)
69
- }) {};
70
- var CreateCodeVersionParams = class extends Schema.Class("CreateCodeVersionParams")({
71
- name: Schema.String,
67
+ intent: Schema.optional(Schema.String),
68
+ name: Schema.String
69
+ });
70
+ const CreateCodeVersionParamsSchema = Schema.Struct({
71
+ code: Schema.String,
72
+ intent: Schema.optional(Schema.String),
73
+ name: Schema.String
74
+ });
75
+ const CreateCodeVersionResponseSchema = Schema.Struct({
72
76
  code: Schema.String,
73
- intent: Schema.optional(Schema.String)
74
- }) {};
75
- var CreateCodeVersionResponse = class extends Schema.Class("CreateCodeVersionResponse")({
76
77
  id: Schema.String,
77
- name: Schema.String,
78
78
  intent: Schema.String,
79
- code: Schema.String,
80
- valTownFileUrl: Schema.String,
81
- publishedAt: Schema.NullOr(Schema.String)
82
- }) {};
83
- var UpdateCodeBlockMetadataParams = class extends Schema.Class("UpdateCodeBlockMetadataParams")({
84
- name: Schema.optional(Schema.String),
85
- intent: Schema.optional(Schema.String)
86
- }) {};
87
- var UpdateCodeParams = class extends Schema.Class("UpdateCodeParams")({ code: Schema.String }) {};
88
- var PublishCodeParams = class extends Schema.Class("PublishCodeParams")({ intent: Schema.optional(Schema.String) }) {};
89
- var ExecuteCodeBlockParams = class extends Schema.Class("ExecuteCodeBlockParams")({
90
- arguments: Schema.Record({
91
- key: Schema.String,
92
- value: Schema.Unknown
93
- }),
94
- test: Schema.optional(Schema.Boolean)
95
- }) {};
79
+ name: Schema.String,
80
+ publishedAt: Schema.NullOr(Schema.String),
81
+ valTownFileUrl: Schema.String
82
+ });
83
+ const UpdateCodeBlockMetadataParamsSchema = Schema.Struct({
84
+ intent: Schema.optional(Schema.String),
85
+ name: Schema.optional(Schema.String)
86
+ });
87
+ const UpdateCodeParamsSchema = Schema.Struct({ code: Schema.String });
88
+ const PublishCodeParamsSchema = Schema.Struct({ intent: Schema.optional(Schema.String) });
89
+ const executionArgumentsFields = { arguments: Schema.Record(Schema.String, Schema.Unknown) };
90
+ const TestExecution = Schema.Struct({
91
+ ...executionArgumentsFields,
92
+ test: Schema.Literal(true).pipe(Schema.withDecodingDefaultType(Effect.succeed(true))),
93
+ includeLogs: Schema.optional(Schema.Boolean)
94
+ });
95
+ const ProductionExecution = Schema.Struct({
96
+ ...executionArgumentsFields,
97
+ test: Schema.Literal(false),
98
+ includeLogs: Schema.optional(Schema.Literal(false))
99
+ });
100
+ const ExecuteCodeBlockParamsSchema = Schema.Union([TestExecution, ProductionExecution]);
96
101
 
97
102
  //#endregion
98
- export { CodeBlockCode, CodeBlockDefinition, CodeBlockExecuteResponse, CodeBlockLogEntry, CodeBlockVersion, CodeBlocksSearchParams, CodeBlocksSearchResponse, CreateCodeBlockParams, CreateCodeBlockResponse, CreateCodeVersionParams, CreateCodeVersionResponse, ExecuteCodeBlockParams, PublishCodeBlockResponse, PublishCodeParams, UpdateCodeBlockMetadataParams, UpdateCodeParams };
103
+ export { CodeBlockCodeSchema, CodeBlockDefinitionSchema, CodeBlockExecuteResponseSchema, CodeBlockLogEntrySchema, CodeBlockVersionSchema, CodeBlocksSearchParamsSchema, CodeBlocksSearchResponseSchema, CreateCodeBlockParamsSchema, CreateCodeBlockResponseSchema, CreateCodeVersionParamsSchema, CreateCodeVersionResponseSchema, ExecuteCodeBlockParamsSchema, PublishCodeBlockResponseSchema, PublishCodeParamsSchema, UpdateCodeBlockMetadataParamsSchema, UpdateCodeParamsSchema };