@herd-labs/sdk 0.4.0 → 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.
- package/dist/index.d.ts +17 -17
- package/dist/index.js +17 -17
- package/dist/src/config.d.ts +4 -4
- package/dist/src/config.js +2 -2
- package/dist/src/errors.d.ts +6 -0
- package/dist/src/errors.js +7 -1
- package/dist/src/live/ActionsServiceLive.d.ts +3 -3
- package/dist/src/live/ActionsServiceLive.js +7 -7
- package/dist/src/live/AdaptersServiceLive.d.ts +3 -3
- package/dist/src/live/AdaptersServiceLive.js +4 -4
- package/dist/src/live/AgentSafesServiceLive.d.ts +3 -3
- package/dist/src/live/AgentSafesServiceLive.js +4 -4
- package/dist/src/live/AgentWalletsServiceLive.d.ts +2 -2
- package/dist/src/live/AgentWalletsServiceLive.js +3 -3
- package/dist/src/live/AgentWorkflowsServiceLive.d.ts +3 -3
- package/dist/src/live/AgentWorkflowsServiceLive.js +8 -8
- package/dist/src/live/AuthServiceLive.d.ts +3 -3
- package/dist/src/live/AuthServiceLive.js +5 -5
- package/dist/src/live/BookmarksServiceLive.d.ts +3 -3
- package/dist/src/live/BookmarksServiceLive.js +6 -6
- package/dist/src/live/CodeBlocksServiceLive.d.ts +3 -3
- package/dist/src/live/CodeBlocksServiceLive.js +7 -7
- package/dist/src/live/CollectionsServiceLive.d.ts +3 -3
- package/dist/src/live/CollectionsServiceLive.js +4 -4
- package/dist/src/live/ContractsServiceLive.d.ts +3 -3
- package/dist/src/live/ContractsServiceLive.js +6 -6
- package/dist/src/live/DocsServiceLive.d.ts +3 -3
- package/dist/src/live/DocsServiceLive.js +3 -3
- package/dist/src/live/GroupsServiceLive.d.ts +3 -3
- package/dist/src/live/GroupsServiceLive.js +7 -7
- package/dist/src/live/HalServiceLive.d.ts +3 -3
- package/dist/src/live/HalServiceLive.js +3 -3
- package/dist/src/live/TransactionsServiceLive.d.ts +3 -3
- package/dist/src/live/TransactionsServiceLive.js +4 -4
- package/dist/src/live/WalletsServiceLive.d.ts +3 -3
- package/dist/src/live/WalletsServiceLive.js +5 -5
- package/dist/src/live/http.d.ts +2 -2
- package/dist/src/live/http.js +2 -2
- package/dist/src/schemas/actions.d.ts +127 -59
- package/dist/src/schemas/actions.js +42 -42
- package/dist/src/schemas/adapters.d.ts +4 -4
- package/dist/src/schemas/adapters.js +3 -3
- package/dist/src/schemas/agent-wallets.d.ts +57 -37
- package/dist/src/schemas/agent-wallets.js +35 -35
- package/dist/src/schemas/agent-workflows.d.ts +35 -35
- package/dist/src/schemas/agent-workflows.js +19 -19
- package/dist/src/schemas/auth.d.ts +19 -19
- package/dist/src/schemas/auth.js +10 -10
- package/dist/src/schemas/bookmarks.d.ts +58 -36
- package/dist/src/schemas/bookmarks.js +34 -34
- package/dist/src/schemas/codeblocks.d.ts +89 -52
- package/dist/src/schemas/codeblocks.js +34 -34
- package/dist/src/schemas/collections.d.ts +76 -32
- package/dist/src/schemas/collections.js +23 -23
- package/dist/src/schemas/common.d.ts +8 -8
- package/dist/src/schemas/common.js +5 -5
- package/dist/src/schemas/contracts.d.ts +176 -61
- package/dist/src/schemas/contracts.js +47 -47
- package/dist/src/schemas/docs.d.ts +7 -7
- package/dist/src/schemas/docs.js +5 -5
- package/dist/src/schemas/groups.d.ts +27 -27
- package/dist/src/schemas/groups.js +16 -16
- package/dist/src/schemas/hal.d.ts +64 -18
- package/dist/src/schemas/hal.js +18 -18
- package/dist/src/schemas/transactions.d.ts +264 -56
- package/dist/src/schemas/transactions.js +50 -50
- package/dist/src/schemas/wallets.d.ts +434 -84
- package/dist/src/schemas/wallets.js +114 -69
- package/dist/src/services/ActionsService.d.ts +2 -2
- package/dist/src/services/AgentSafesService.d.ts +4 -4
- package/dist/src/services/AgentWalletsService.d.ts +2 -2
- package/dist/src/services/AgentWorkflowsService.d.ts +8 -8
- package/dist/src/services/AuthService.d.ts +3 -3
- package/dist/src/services/BookmarksService.d.ts +2 -2
- package/dist/src/services/ContractsService.d.ts +5 -5
- package/dist/src/services/GroupsService.d.ts +11 -11
- package/dist/src/services/TransactionsService.d.ts +4 -4
- package/dist/src/services/WalletsService.d.ts +4 -4
- package/package.json +2 -2
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BlockchainSchema, EvmAddressSchema } from "./common.js";
|
|
2
2
|
import { Schema } from "effect";
|
|
3
3
|
|
|
4
4
|
//#region src/schemas/bookmarks.ts
|
|
5
|
-
const
|
|
5
|
+
const BookmarkObjectTypeSchema = Schema.Literals([
|
|
6
6
|
"contract",
|
|
7
7
|
"transaction",
|
|
8
8
|
"wallet"
|
|
9
9
|
]);
|
|
10
|
-
|
|
10
|
+
const ContractBookmarkSchema = Schema.Struct({
|
|
11
11
|
blockchain: Schema.String,
|
|
12
12
|
contractAddress: Schema.String,
|
|
13
13
|
contractName: Schema.NullOr(Schema.String),
|
|
@@ -16,61 +16,61 @@ var ContractBookmark = class extends Schema.Class("ContractBookmark")({
|
|
|
16
16
|
label: Schema.NullOr(Schema.String),
|
|
17
17
|
updatedAt: Schema.String,
|
|
18
18
|
userLabel: Schema.NullOr(Schema.String)
|
|
19
|
-
})
|
|
20
|
-
|
|
19
|
+
});
|
|
20
|
+
const TransactionBookmarkSchema = Schema.Struct({
|
|
21
21
|
blockchain: Schema.String,
|
|
22
22
|
createdAt: Schema.String,
|
|
23
23
|
id: Schema.String,
|
|
24
24
|
transactionHash: Schema.String,
|
|
25
25
|
updatedAt: Schema.String,
|
|
26
26
|
userLabel: Schema.NullOr(Schema.String)
|
|
27
|
-
})
|
|
28
|
-
|
|
27
|
+
});
|
|
28
|
+
const WalletBookmarkSchema = Schema.Struct({
|
|
29
29
|
createdAt: Schema.String,
|
|
30
30
|
id: Schema.String,
|
|
31
31
|
updatedAt: Schema.String,
|
|
32
32
|
userLabel: Schema.NullOr(Schema.String),
|
|
33
33
|
walletAddress: Schema.String
|
|
34
|
-
})
|
|
35
|
-
|
|
36
|
-
contracts: Schema.Array(
|
|
37
|
-
transactions: Schema.Array(
|
|
38
|
-
wallets: Schema.Array(
|
|
39
|
-
})
|
|
40
|
-
|
|
34
|
+
});
|
|
35
|
+
const BookmarksListSchema = Schema.Struct({
|
|
36
|
+
contracts: Schema.Array(ContractBookmarkSchema),
|
|
37
|
+
transactions: Schema.Array(TransactionBookmarkSchema),
|
|
38
|
+
wallets: Schema.Array(WalletBookmarkSchema)
|
|
39
|
+
});
|
|
40
|
+
const BookmarkResponseSchema = Schema.Struct({
|
|
41
41
|
bookmark: Schema.Struct({
|
|
42
42
|
id: Schema.optional(Schema.String),
|
|
43
43
|
userLabel: Schema.optional(Schema.NullOr(Schema.String))
|
|
44
44
|
}),
|
|
45
45
|
objectType: Schema.String
|
|
46
|
-
})
|
|
47
|
-
|
|
48
|
-
address:
|
|
49
|
-
blockchain:
|
|
46
|
+
});
|
|
47
|
+
const AddContractBookmarkParamsSchema = Schema.Struct({
|
|
48
|
+
address: EvmAddressSchema,
|
|
49
|
+
blockchain: BlockchainSchema,
|
|
50
50
|
label: Schema.optional(Schema.String)
|
|
51
|
-
})
|
|
52
|
-
|
|
53
|
-
blockchain:
|
|
51
|
+
});
|
|
52
|
+
const AddTransactionBookmarkParamsSchema = Schema.Struct({
|
|
53
|
+
blockchain: BlockchainSchema,
|
|
54
54
|
label: Schema.optional(Schema.String),
|
|
55
55
|
txHash: Schema.String
|
|
56
|
-
})
|
|
57
|
-
|
|
58
|
-
address:
|
|
56
|
+
});
|
|
57
|
+
const AddWalletBookmarkParamsSchema = Schema.Struct({
|
|
58
|
+
address: EvmAddressSchema,
|
|
59
59
|
label: Schema.optional(Schema.String)
|
|
60
|
-
})
|
|
61
|
-
|
|
60
|
+
});
|
|
61
|
+
const UpdateBookmarkLabelParamsSchema = Schema.Struct({
|
|
62
62
|
address: Schema.optional(Schema.String),
|
|
63
|
-
blockchain: Schema.optional(
|
|
63
|
+
blockchain: Schema.optional(BlockchainSchema),
|
|
64
64
|
label: Schema.NullOr(Schema.String),
|
|
65
|
-
objectType:
|
|
65
|
+
objectType: BookmarkObjectTypeSchema,
|
|
66
66
|
txHash: Schema.optional(Schema.String)
|
|
67
|
-
})
|
|
68
|
-
|
|
67
|
+
});
|
|
68
|
+
const DeleteBookmarkParamsSchema = Schema.Struct({
|
|
69
69
|
address: Schema.optional(Schema.String),
|
|
70
|
-
blockchain: Schema.optional(
|
|
71
|
-
objectType:
|
|
70
|
+
blockchain: Schema.optional(BlockchainSchema),
|
|
71
|
+
objectType: BookmarkObjectTypeSchema,
|
|
72
72
|
txHash: Schema.optional(Schema.String)
|
|
73
|
-
})
|
|
73
|
+
});
|
|
74
74
|
|
|
75
75
|
//#endregion
|
|
76
|
-
export {
|
|
76
|
+
export { AddContractBookmarkParamsSchema, AddTransactionBookmarkParamsSchema, AddWalletBookmarkParamsSchema, BookmarkObjectTypeSchema, BookmarkResponseSchema, BookmarksListSchema, ContractBookmarkSchema, DeleteBookmarkParamsSchema, TransactionBookmarkSchema, UpdateBookmarkLabelParamsSchema, WalletBookmarkSchema };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
2
|
|
|
3
3
|
//#region src/schemas/codeblocks.d.ts
|
|
4
|
-
declare const
|
|
4
|
+
declare const CodeBlockCodeSchema: Schema.Struct<{
|
|
5
5
|
readonly arguments: Schema.optional<Schema.Unknown>;
|
|
6
6
|
readonly code: Schema.String;
|
|
7
7
|
readonly id: Schema.String;
|
|
@@ -9,39 +9,72 @@ declare const CodeBlockCode_base: Schema.Class<CodeBlockCode, Schema.Struct<{
|
|
|
9
9
|
readonly name: Schema.String;
|
|
10
10
|
readonly publishedAt: Schema.NullOr<Schema.String>;
|
|
11
11
|
readonly valTownFileUrl: Schema.String;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
declare const
|
|
12
|
+
}>;
|
|
13
|
+
type CodeBlockCode = typeof CodeBlockCodeSchema.Type;
|
|
14
|
+
declare const CodeBlockVersionSchema: Schema.Struct<{
|
|
15
15
|
readonly id: Schema.String;
|
|
16
16
|
readonly intent: Schema.String;
|
|
17
17
|
readonly name: Schema.String;
|
|
18
18
|
readonly publishedAt: Schema.NullOr<Schema.String>;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
declare const
|
|
19
|
+
}>;
|
|
20
|
+
type CodeBlockVersion = typeof CodeBlockVersionSchema.Type;
|
|
21
|
+
declare const CodeBlockDefinitionSchema: Schema.Struct<{
|
|
22
22
|
readonly actionId: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
23
|
-
readonly allVersions: Schema.optional<Schema.$Array<
|
|
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
|
+
}>>>;
|
|
24
29
|
readonly id: Schema.String;
|
|
25
30
|
readonly intent: Schema.String;
|
|
26
|
-
readonly latestCode: Schema.NullOr<
|
|
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;
|
|
39
|
+
}>>;
|
|
27
40
|
readonly name: Schema.String;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
declare const
|
|
41
|
+
}>;
|
|
42
|
+
type CodeBlockDefinition = typeof CodeBlockDefinitionSchema.Type;
|
|
43
|
+
declare const CodeBlocksSearchParamsSchema: Schema.Struct<{
|
|
31
44
|
readonly cursor: Schema.optional<Schema.String>;
|
|
32
45
|
readonly filters: Schema.optional<Schema.Struct<{
|
|
33
46
|
readonly name: Schema.optional<Schema.String>;
|
|
34
47
|
}>>;
|
|
35
48
|
readonly limit: Schema.Number;
|
|
36
49
|
readonly scope: Schema.Literals<readonly ["user", "public"]>;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
declare const
|
|
40
|
-
readonly items: Schema.$Array<
|
|
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;
|
|
73
|
+
}>>;
|
|
41
74
|
readonly nextCursor: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
declare const
|
|
75
|
+
}>;
|
|
76
|
+
type CodeBlocksSearchResponse = typeof CodeBlocksSearchResponseSchema.Type;
|
|
77
|
+
declare const CreateCodeBlockResponseSchema: Schema.Struct<{
|
|
45
78
|
readonly code: Schema.Struct<{
|
|
46
79
|
readonly id: Schema.String;
|
|
47
80
|
readonly name: Schema.String;
|
|
@@ -50,64 +83,68 @@ declare const CreateCodeBlockResponse_base: Schema.Class<CreateCodeBlockResponse
|
|
|
50
83
|
readonly id: Schema.String;
|
|
51
84
|
readonly intent: Schema.String;
|
|
52
85
|
readonly name: Schema.String;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
declare const
|
|
86
|
+
}>;
|
|
87
|
+
type CreateCodeBlockResponse = typeof CreateCodeBlockResponseSchema.Type;
|
|
88
|
+
declare const PublishCodeBlockResponseSchema: Schema.Struct<{
|
|
56
89
|
readonly id: Schema.String;
|
|
57
90
|
readonly publishedAt: Schema.String;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
declare const
|
|
91
|
+
}>;
|
|
92
|
+
type PublishCodeBlockResponse = typeof PublishCodeBlockResponseSchema.Type;
|
|
93
|
+
declare const CodeBlockLogEntrySchema: Schema.Struct<{
|
|
61
94
|
readonly level: Schema.String;
|
|
62
95
|
readonly message: Schema.String;
|
|
63
96
|
readonly time: Schema.String;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
declare const
|
|
97
|
+
}>;
|
|
98
|
+
type CodeBlockLogEntry = typeof CodeBlockLogEntrySchema.Type;
|
|
99
|
+
declare const CodeBlockExecuteResponseSchema: Schema.Struct<{
|
|
67
100
|
readonly error: Schema.optional<Schema.Struct<{
|
|
68
101
|
readonly status: Schema.optional<Schema.Number>;
|
|
69
102
|
readonly message: Schema.String;
|
|
70
103
|
readonly body: Schema.optional<Schema.Unknown>;
|
|
71
104
|
}>>;
|
|
72
|
-
readonly logs: Schema.withDecodingDefaultType<Schema.$Array<
|
|
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>;
|
|
73
110
|
readonly response: Schema.Unknown;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
declare const
|
|
111
|
+
}>;
|
|
112
|
+
type CodeBlockExecuteResponse = typeof CodeBlockExecuteResponseSchema.Type;
|
|
113
|
+
declare const CreateCodeBlockParamsSchema: Schema.Struct<{
|
|
77
114
|
readonly code: Schema.String;
|
|
78
115
|
readonly intent: Schema.optional<Schema.String>;
|
|
79
116
|
readonly name: Schema.String;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
declare const
|
|
117
|
+
}>;
|
|
118
|
+
type CreateCodeBlockParams = typeof CreateCodeBlockParamsSchema.Type;
|
|
119
|
+
declare const CreateCodeVersionParamsSchema: Schema.Struct<{
|
|
83
120
|
readonly code: Schema.String;
|
|
84
121
|
readonly intent: Schema.optional<Schema.String>;
|
|
85
122
|
readonly name: Schema.String;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
declare const
|
|
123
|
+
}>;
|
|
124
|
+
type CreateCodeVersionParams = typeof CreateCodeVersionParamsSchema.Type;
|
|
125
|
+
declare const CreateCodeVersionResponseSchema: Schema.Struct<{
|
|
89
126
|
readonly code: Schema.String;
|
|
90
127
|
readonly id: Schema.String;
|
|
91
128
|
readonly intent: Schema.String;
|
|
92
129
|
readonly name: Schema.String;
|
|
93
130
|
readonly publishedAt: Schema.NullOr<Schema.String>;
|
|
94
131
|
readonly valTownFileUrl: Schema.String;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
declare const
|
|
132
|
+
}>;
|
|
133
|
+
type CreateCodeVersionResponse = typeof CreateCodeVersionResponseSchema.Type;
|
|
134
|
+
declare const UpdateCodeBlockMetadataParamsSchema: Schema.Struct<{
|
|
98
135
|
readonly intent: Schema.optional<Schema.String>;
|
|
99
136
|
readonly name: Schema.optional<Schema.String>;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
declare const
|
|
137
|
+
}>;
|
|
138
|
+
type UpdateCodeBlockMetadataParams = typeof UpdateCodeBlockMetadataParamsSchema.Type;
|
|
139
|
+
declare const UpdateCodeParamsSchema: Schema.Struct<{
|
|
103
140
|
readonly code: Schema.String;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
declare const
|
|
141
|
+
}>;
|
|
142
|
+
type UpdateCodeParams = typeof UpdateCodeParamsSchema.Type;
|
|
143
|
+
declare const PublishCodeParamsSchema: Schema.Struct<{
|
|
107
144
|
readonly intent: Schema.optional<Schema.String>;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
declare const
|
|
145
|
+
}>;
|
|
146
|
+
type PublishCodeParams = typeof PublishCodeParamsSchema.Type;
|
|
147
|
+
declare const ExecuteCodeBlockParamsSchema: Schema.Union<readonly [Schema.Struct<{
|
|
111
148
|
readonly test: Schema.withDecodingDefaultType<Schema.Literal<true>, never>;
|
|
112
149
|
readonly includeLogs: Schema.optional<Schema.Boolean>;
|
|
113
150
|
readonly arguments: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
@@ -116,6 +153,6 @@ declare const ExecuteCodeBlockParams: Schema.Union<readonly [Schema.Struct<{
|
|
|
116
153
|
readonly includeLogs: Schema.optional<Schema.Literal<false>>;
|
|
117
154
|
readonly arguments: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
118
155
|
}>]>;
|
|
119
|
-
type ExecuteCodeBlockParams = typeof
|
|
156
|
+
type ExecuteCodeBlockParams = typeof ExecuteCodeBlockParamsSchema.Type;
|
|
120
157
|
//#endregion
|
|
121
|
-
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,7 +1,7 @@
|
|
|
1
1
|
import { Effect, Schema } from "effect";
|
|
2
2
|
|
|
3
3
|
//#region src/schemas/codeblocks.ts
|
|
4
|
-
|
|
4
|
+
const CodeBlockCodeSchema = Schema.Struct({
|
|
5
5
|
arguments: Schema.optional(Schema.Unknown),
|
|
6
6
|
code: Schema.String,
|
|
7
7
|
id: Schema.String,
|
|
@@ -9,32 +9,32 @@ var CodeBlockCode = class extends Schema.Class("CodeBlockCode")({
|
|
|
9
9
|
name: Schema.String,
|
|
10
10
|
publishedAt: Schema.NullOr(Schema.String),
|
|
11
11
|
valTownFileUrl: Schema.String
|
|
12
|
-
})
|
|
13
|
-
|
|
12
|
+
});
|
|
13
|
+
const CodeBlockVersionSchema = Schema.Struct({
|
|
14
14
|
id: Schema.String,
|
|
15
15
|
intent: Schema.String,
|
|
16
16
|
name: Schema.String,
|
|
17
17
|
publishedAt: Schema.NullOr(Schema.String)
|
|
18
|
-
})
|
|
19
|
-
|
|
18
|
+
});
|
|
19
|
+
const CodeBlockDefinitionSchema = Schema.Struct({
|
|
20
20
|
actionId: Schema.optional(Schema.NullOr(Schema.String)),
|
|
21
|
-
allVersions: Schema.optional(Schema.Array(
|
|
21
|
+
allVersions: Schema.optional(Schema.Array(CodeBlockVersionSchema)),
|
|
22
22
|
id: Schema.String,
|
|
23
23
|
intent: Schema.String,
|
|
24
|
-
latestCode: Schema.NullOr(
|
|
24
|
+
latestCode: Schema.NullOr(CodeBlockCodeSchema),
|
|
25
25
|
name: Schema.String
|
|
26
|
-
})
|
|
27
|
-
|
|
26
|
+
});
|
|
27
|
+
const CodeBlocksSearchParamsSchema = Schema.Struct({
|
|
28
28
|
cursor: Schema.optional(Schema.String),
|
|
29
29
|
filters: Schema.optional(Schema.Struct({ name: Schema.optional(Schema.String) })),
|
|
30
30
|
limit: Schema.Number,
|
|
31
31
|
scope: Schema.Literals(["user", "public"])
|
|
32
|
-
})
|
|
33
|
-
|
|
34
|
-
items: Schema.Array(
|
|
32
|
+
});
|
|
33
|
+
const CodeBlocksSearchResponseSchema = Schema.Struct({
|
|
34
|
+
items: Schema.Array(CodeBlockDefinitionSchema),
|
|
35
35
|
nextCursor: Schema.optional(Schema.NullOr(Schema.String))
|
|
36
|
-
})
|
|
37
|
-
|
|
36
|
+
});
|
|
37
|
+
const CreateCodeBlockResponseSchema = Schema.Struct({
|
|
38
38
|
code: Schema.Struct({
|
|
39
39
|
id: Schema.String,
|
|
40
40
|
name: Schema.String,
|
|
@@ -43,49 +43,49 @@ var CreateCodeBlockResponse = class extends Schema.Class("CreateCodeBlockRespons
|
|
|
43
43
|
id: Schema.String,
|
|
44
44
|
intent: Schema.String,
|
|
45
45
|
name: Schema.String
|
|
46
|
-
})
|
|
47
|
-
|
|
46
|
+
});
|
|
47
|
+
const PublishCodeBlockResponseSchema = Schema.Struct({
|
|
48
48
|
id: Schema.String,
|
|
49
49
|
publishedAt: Schema.String
|
|
50
|
-
})
|
|
51
|
-
|
|
50
|
+
});
|
|
51
|
+
const CodeBlockLogEntrySchema = Schema.Struct({
|
|
52
52
|
level: Schema.String,
|
|
53
53
|
message: Schema.String,
|
|
54
54
|
time: Schema.String
|
|
55
|
-
})
|
|
56
|
-
|
|
55
|
+
});
|
|
56
|
+
const CodeBlockExecuteResponseSchema = Schema.Struct({
|
|
57
57
|
error: Schema.optional(Schema.Struct({
|
|
58
58
|
status: Schema.optional(Schema.Number),
|
|
59
59
|
message: Schema.String,
|
|
60
60
|
body: Schema.optional(Schema.Unknown)
|
|
61
61
|
})),
|
|
62
|
-
logs: Schema.Array(
|
|
62
|
+
logs: Schema.Array(CodeBlockLogEntrySchema).pipe(Schema.withDecodingDefaultType(Effect.succeed([]))),
|
|
63
63
|
response: Schema.Unknown
|
|
64
|
-
})
|
|
65
|
-
|
|
64
|
+
});
|
|
65
|
+
const CreateCodeBlockParamsSchema = Schema.Struct({
|
|
66
66
|
code: Schema.String,
|
|
67
67
|
intent: Schema.optional(Schema.String),
|
|
68
68
|
name: Schema.String
|
|
69
|
-
})
|
|
70
|
-
|
|
69
|
+
});
|
|
70
|
+
const CreateCodeVersionParamsSchema = Schema.Struct({
|
|
71
71
|
code: Schema.String,
|
|
72
72
|
intent: Schema.optional(Schema.String),
|
|
73
73
|
name: Schema.String
|
|
74
|
-
})
|
|
75
|
-
|
|
74
|
+
});
|
|
75
|
+
const CreateCodeVersionResponseSchema = Schema.Struct({
|
|
76
76
|
code: Schema.String,
|
|
77
77
|
id: Schema.String,
|
|
78
78
|
intent: Schema.String,
|
|
79
79
|
name: Schema.String,
|
|
80
80
|
publishedAt: Schema.NullOr(Schema.String),
|
|
81
81
|
valTownFileUrl: Schema.String
|
|
82
|
-
})
|
|
83
|
-
|
|
82
|
+
});
|
|
83
|
+
const UpdateCodeBlockMetadataParamsSchema = Schema.Struct({
|
|
84
84
|
intent: Schema.optional(Schema.String),
|
|
85
85
|
name: Schema.optional(Schema.String)
|
|
86
|
-
})
|
|
87
|
-
|
|
88
|
-
|
|
86
|
+
});
|
|
87
|
+
const UpdateCodeParamsSchema = Schema.Struct({ code: Schema.String });
|
|
88
|
+
const PublishCodeParamsSchema = Schema.Struct({ intent: Schema.optional(Schema.String) });
|
|
89
89
|
const executionArgumentsFields = { arguments: Schema.Record(Schema.String, Schema.Unknown) };
|
|
90
90
|
const TestExecution = Schema.Struct({
|
|
91
91
|
...executionArgumentsFields,
|
|
@@ -97,7 +97,7 @@ const ProductionExecution = Schema.Struct({
|
|
|
97
97
|
test: Schema.Literal(false),
|
|
98
98
|
includeLogs: Schema.optional(Schema.Literal(false))
|
|
99
99
|
});
|
|
100
|
-
const
|
|
100
|
+
const ExecuteCodeBlockParamsSchema = Schema.Union([TestExecution, ProductionExecution]);
|
|
101
101
|
|
|
102
102
|
//#endregion
|
|
103
|
-
export {
|
|
103
|
+
export { CodeBlockCodeSchema, CodeBlockDefinitionSchema, CodeBlockExecuteResponseSchema, CodeBlockLogEntrySchema, CodeBlockVersionSchema, CodeBlocksSearchParamsSchema, CodeBlocksSearchResponseSchema, CreateCodeBlockParamsSchema, CreateCodeBlockResponseSchema, CreateCodeVersionParamsSchema, CreateCodeVersionResponseSchema, ExecuteCodeBlockParamsSchema, PublishCodeBlockResponseSchema, PublishCodeParamsSchema, UpdateCodeBlockMetadataParamsSchema, UpdateCodeParamsSchema };
|
|
@@ -1,48 +1,92 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
2
|
|
|
3
3
|
//#region src/schemas/collections.d.ts
|
|
4
|
-
declare const
|
|
4
|
+
declare const CollectionSpecItemSchema: Schema.Struct<{
|
|
5
5
|
readonly expressionRef: Schema.String;
|
|
6
6
|
readonly id: Schema.String;
|
|
7
7
|
readonly type: Schema.Literals<readonly ["action", "adapter"]>;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
declare const
|
|
11
|
-
readonly items: Schema.$Array<
|
|
8
|
+
}>;
|
|
9
|
+
type CollectionSpecItem = typeof CollectionSpecItemSchema.Type;
|
|
10
|
+
declare const CollectionSpecSchema: Schema.Struct<{
|
|
11
|
+
readonly items: Schema.$Array<Schema.Struct<{
|
|
12
|
+
readonly expressionRef: Schema.String;
|
|
13
|
+
readonly id: Schema.String;
|
|
14
|
+
readonly type: Schema.Literals<readonly ["action", "adapter"]>;
|
|
15
|
+
}>>;
|
|
12
16
|
readonly version: Schema.String;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
declare const
|
|
17
|
+
}>;
|
|
18
|
+
type CollectionSpec = typeof CollectionSpecSchema.Type;
|
|
19
|
+
declare const CollectionVersionSchema: Schema.Struct<{
|
|
16
20
|
readonly expressionImports: Schema.$Array<Schema.String>;
|
|
17
21
|
readonly herdVerifiedAt: Schema.NullOr<Schema.String>;
|
|
18
22
|
readonly id: Schema.String;
|
|
19
23
|
readonly name: Schema.String;
|
|
20
24
|
readonly protocols: Schema.$Array<Schema.String>;
|
|
21
|
-
readonly spec:
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
+
readonly spec: Schema.Struct<{
|
|
26
|
+
readonly items: Schema.$Array<Schema.Struct<{
|
|
27
|
+
readonly expressionRef: Schema.String;
|
|
28
|
+
readonly id: Schema.String;
|
|
29
|
+
readonly type: Schema.Literals<readonly ["action", "adapter"]>;
|
|
30
|
+
}>>;
|
|
31
|
+
readonly version: Schema.String;
|
|
32
|
+
}>;
|
|
33
|
+
}>;
|
|
34
|
+
type CollectionVersion = typeof CollectionVersionSchema.Type;
|
|
35
|
+
declare const CollectionSchema: Schema.Struct<{
|
|
25
36
|
readonly description: Schema.String;
|
|
26
37
|
readonly id: Schema.String;
|
|
27
|
-
readonly latestVersion: Schema.NullOr<
|
|
38
|
+
readonly latestVersion: Schema.NullOr<Schema.Struct<{
|
|
39
|
+
readonly expressionImports: Schema.$Array<Schema.String>;
|
|
40
|
+
readonly herdVerifiedAt: Schema.NullOr<Schema.String>;
|
|
41
|
+
readonly id: Schema.String;
|
|
42
|
+
readonly name: Schema.String;
|
|
43
|
+
readonly protocols: Schema.$Array<Schema.String>;
|
|
44
|
+
readonly spec: Schema.Struct<{
|
|
45
|
+
readonly items: Schema.$Array<Schema.Struct<{
|
|
46
|
+
readonly expressionRef: Schema.String;
|
|
47
|
+
readonly id: Schema.String;
|
|
48
|
+
readonly type: Schema.Literals<readonly ["action", "adapter"]>;
|
|
49
|
+
}>>;
|
|
50
|
+
readonly version: Schema.String;
|
|
51
|
+
}>;
|
|
52
|
+
}>>;
|
|
28
53
|
readonly name: Schema.String;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
declare const
|
|
54
|
+
}>;
|
|
55
|
+
type Collection = typeof CollectionSchema.Type;
|
|
56
|
+
declare const CollectionsSearchParamsSchema: Schema.Struct<{
|
|
32
57
|
readonly filters: Schema.optional<Schema.Struct<{
|
|
33
58
|
readonly name: Schema.optional<Schema.String>;
|
|
34
59
|
}>>;
|
|
35
60
|
readonly limit: Schema.Number;
|
|
36
61
|
readonly offset: Schema.Number;
|
|
37
62
|
readonly scope: Schema.optional<Schema.$Array<Schema.Literals<readonly ["yours", "all", "verified"]>>>;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
declare const
|
|
41
|
-
readonly items: Schema.$Array<
|
|
63
|
+
}>;
|
|
64
|
+
type CollectionsSearchParams = typeof CollectionsSearchParamsSchema.Type;
|
|
65
|
+
declare const CollectionsSearchResponseSchema: Schema.Struct<{
|
|
66
|
+
readonly items: Schema.$Array<Schema.Struct<{
|
|
67
|
+
readonly description: Schema.String;
|
|
68
|
+
readonly id: Schema.String;
|
|
69
|
+
readonly latestVersion: Schema.NullOr<Schema.Struct<{
|
|
70
|
+
readonly expressionImports: Schema.$Array<Schema.String>;
|
|
71
|
+
readonly herdVerifiedAt: Schema.NullOr<Schema.String>;
|
|
72
|
+
readonly id: Schema.String;
|
|
73
|
+
readonly name: Schema.String;
|
|
74
|
+
readonly protocols: Schema.$Array<Schema.String>;
|
|
75
|
+
readonly spec: Schema.Struct<{
|
|
76
|
+
readonly items: Schema.$Array<Schema.Struct<{
|
|
77
|
+
readonly expressionRef: Schema.String;
|
|
78
|
+
readonly id: Schema.String;
|
|
79
|
+
readonly type: Schema.Literals<readonly ["action", "adapter"]>;
|
|
80
|
+
}>>;
|
|
81
|
+
readonly version: Schema.String;
|
|
82
|
+
}>;
|
|
83
|
+
}>>;
|
|
84
|
+
readonly name: Schema.String;
|
|
85
|
+
}>>;
|
|
42
86
|
readonly total: Schema.Number;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
declare const
|
|
87
|
+
}>;
|
|
88
|
+
type CollectionsSearchResponse = typeof CollectionsSearchResponseSchema.Type;
|
|
89
|
+
declare const CreateCollectionParamsSchema: Schema.Struct<{
|
|
46
90
|
readonly description: Schema.optional<Schema.String>;
|
|
47
91
|
readonly expressionImports: Schema.$Array<Schema.String>;
|
|
48
92
|
readonly name: Schema.String;
|
|
@@ -55,9 +99,9 @@ declare const CreateCollectionParams_base: Schema.Class<CreateCollectionParams,
|
|
|
55
99
|
readonly expressionRef: Schema.String;
|
|
56
100
|
}>>;
|
|
57
101
|
}>;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
declare const
|
|
102
|
+
}>;
|
|
103
|
+
type CreateCollectionParams = typeof CreateCollectionParamsSchema.Type;
|
|
104
|
+
declare const CreateCollectionResponseSchema: Schema.Struct<{
|
|
61
105
|
readonly collection: Schema.Struct<{
|
|
62
106
|
readonly description: Schema.String;
|
|
63
107
|
readonly id: Schema.String;
|
|
@@ -68,9 +112,9 @@ declare const CreateCollectionResponse_base: Schema.Class<CreateCollectionRespon
|
|
|
68
112
|
readonly name: Schema.String;
|
|
69
113
|
readonly protocols: Schema.optional<Schema.$Array<Schema.String>>;
|
|
70
114
|
}>;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
declare const
|
|
115
|
+
}>;
|
|
116
|
+
type CreateCollectionResponse = typeof CreateCollectionResponseSchema.Type;
|
|
117
|
+
declare const UpdateCollectionParamsSchema: Schema.Struct<{
|
|
74
118
|
readonly description: Schema.optional<Schema.String>;
|
|
75
119
|
readonly expressionImports: Schema.optional<Schema.$Array<Schema.String>>;
|
|
76
120
|
readonly name: Schema.optional<Schema.String>;
|
|
@@ -83,7 +127,7 @@ declare const UpdateCollectionParams_base: Schema.Class<UpdateCollectionParams,
|
|
|
83
127
|
readonly expressionRef: Schema.String;
|
|
84
128
|
}>>;
|
|
85
129
|
}>>;
|
|
86
|
-
}
|
|
87
|
-
|
|
130
|
+
}>;
|
|
131
|
+
type UpdateCollectionParams = typeof UpdateCollectionParamsSchema.Type;
|
|
88
132
|
//#endregion
|
|
89
|
-
export { Collection, CollectionSpec, CollectionSpecItem, CollectionVersion, CollectionsSearchParams, CollectionsSearchResponse, CreateCollectionParams, CreateCollectionResponse, UpdateCollectionParams };
|
|
133
|
+
export { Collection, CollectionSchema, CollectionSpec, CollectionSpecItem, CollectionSpecItemSchema, CollectionSpecSchema, CollectionVersion, CollectionVersionSchema, CollectionsSearchParams, CollectionsSearchParamsSchema, CollectionsSearchResponse, CollectionsSearchResponseSchema, CreateCollectionParams, CreateCollectionParamsSchema, CreateCollectionResponse, CreateCollectionResponseSchema, UpdateCollectionParams, UpdateCollectionParamsSchema };
|