@h-ai/api-contract 0.1.0-alpha.66 → 0.1.0-alpha.68
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/README.en.md +29 -9
- package/README.ja.md +30 -10
- package/README.md +30 -10
- package/dist/ai/index.d.ts +981 -200
- package/dist/ai/index.js +2 -2
- package/dist/{chunk-RVSGP2GF.js → chunk-G3SME6V5.js} +4 -5
- package/dist/chunk-G3SME6V5.js.map +1 -0
- package/dist/{chunk-VSPYX4DD.js → chunk-G55ATYDA.js} +64 -39
- package/dist/chunk-G55ATYDA.js.map +1 -0
- package/dist/{chunk-3QSKWVLP.js → chunk-IVZVAWEF.js} +30 -17
- package/dist/chunk-IVZVAWEF.js.map +1 -0
- package/dist/{chunk-CUU2F6YD.js → chunk-JKPLID6E.js} +2 -2
- package/dist/chunk-JKPLID6E.js.map +1 -0
- package/dist/{chunk-JIQINMLG.js → chunk-R5GDWFYC.js} +7 -7
- package/dist/chunk-R5GDWFYC.js.map +1 -0
- package/dist/iam/index.d.ts +845 -32
- package/dist/iam/index.js +2 -2
- package/dist/index.d.ts +196 -89
- package/dist/index.js +10 -10
- package/dist/index.js.map +1 -1
- package/dist/payment/index.d.ts +218 -28
- package/dist/payment/index.js +2 -2
- package/dist/storage/index.d.ts +414 -161
- package/dist/storage/index.js +2 -2
- package/package.json +3 -2
- package/dist/chunk-3QSKWVLP.js.map +0 -1
- package/dist/chunk-CUU2F6YD.js.map +0 -1
- package/dist/chunk-JIQINMLG.js.map +0 -1
- package/dist/chunk-RVSGP2GF.js.map +0 -1
- package/dist/chunk-VSPYX4DD.js.map +0 -1
package/dist/storage/index.d.ts
CHANGED
|
@@ -1,165 +1,201 @@
|
|
|
1
1
|
import * as _orpc_contract from '@orpc/contract';
|
|
2
|
-
import * as zod_v4_core from 'zod/v4/core';
|
|
3
|
-
import * as zod from 'zod';
|
|
4
2
|
import { z } from 'zod';
|
|
5
3
|
import { HaiResult } from '@h-ai/core';
|
|
6
4
|
|
|
7
5
|
/**
|
|
8
|
-
*
|
|
6
|
+
* Storage 领域 oRPC contract。
|
|
7
|
+
* @example
|
|
8
|
+
* ```ts
|
|
9
|
+
* import { apiContract } from '@h-ai/api-contract'
|
|
9
10
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
11
|
+
* const contract = apiContract.storage
|
|
12
|
+
* void contract
|
|
13
|
+
* ```
|
|
13
14
|
*/
|
|
14
|
-
/** Storage 领域 oRPC contract。 */
|
|
15
15
|
declare const storageContract: {
|
|
16
16
|
presignedUrls: {
|
|
17
|
-
createDownload: _orpc_contract.ContractProcedureBuilderWithInputOutput<
|
|
18
|
-
key:
|
|
19
|
-
expiresIn:
|
|
20
|
-
},
|
|
21
|
-
success:
|
|
22
|
-
data:
|
|
23
|
-
url:
|
|
24
|
-
key:
|
|
25
|
-
expiresAt:
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
success:
|
|
29
|
-
error:
|
|
30
|
-
code:
|
|
31
|
-
message:
|
|
32
|
-
httpStatus:
|
|
33
|
-
system:
|
|
34
|
-
module:
|
|
35
|
-
cause:
|
|
36
|
-
suggestion:
|
|
37
|
-
ext:
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
createUpload: _orpc_contract.ContractProcedureBuilderWithInputOutput<
|
|
41
|
-
key:
|
|
42
|
-
contentType:
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}, zod_v4_core.$strip>], "success">, Record<never, never>, Record<never, never>>;
|
|
17
|
+
createDownload: _orpc_contract.ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
18
|
+
key: z.ZodString;
|
|
19
|
+
expiresIn: z.ZodOptional<z.ZodNumber>;
|
|
20
|
+
}, z.core.$strict>, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
21
|
+
success: z.ZodLiteral<true>;
|
|
22
|
+
data: z.ZodObject<{
|
|
23
|
+
url: z.ZodString;
|
|
24
|
+
key: z.ZodString;
|
|
25
|
+
expiresAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
26
|
+
}, z.core.$strip>;
|
|
27
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
28
|
+
success: z.ZodLiteral<false>;
|
|
29
|
+
error: z.ZodObject<{
|
|
30
|
+
code: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
31
|
+
message: z.ZodString;
|
|
32
|
+
httpStatus: z.ZodOptional<z.ZodNumber>;
|
|
33
|
+
system: z.ZodOptional<z.ZodString>;
|
|
34
|
+
module: z.ZodOptional<z.ZodString>;
|
|
35
|
+
cause: z.ZodOptional<z.ZodUnknown>;
|
|
36
|
+
suggestion: z.ZodOptional<z.ZodString>;
|
|
37
|
+
ext: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
38
|
+
}, z.core.$strip>;
|
|
39
|
+
}, z.core.$strip>], "success">, Record<never, never>, Record<never, never>>;
|
|
40
|
+
createUpload: _orpc_contract.ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
41
|
+
key: z.ZodString;
|
|
42
|
+
contentType: z.ZodOptional<z.ZodString>;
|
|
43
|
+
expiresIn: z.ZodOptional<z.ZodNumber>;
|
|
44
|
+
}, z.core.$strict>, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
45
|
+
success: z.ZodLiteral<true>;
|
|
46
|
+
data: z.ZodObject<{
|
|
47
|
+
url: z.ZodString;
|
|
48
|
+
key: z.ZodString;
|
|
49
|
+
expiresAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
50
|
+
}, z.core.$strip>;
|
|
51
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
52
|
+
success: z.ZodLiteral<false>;
|
|
53
|
+
error: z.ZodObject<{
|
|
54
|
+
code: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
55
|
+
message: z.ZodString;
|
|
56
|
+
httpStatus: z.ZodOptional<z.ZodNumber>;
|
|
57
|
+
system: z.ZodOptional<z.ZodString>;
|
|
58
|
+
module: z.ZodOptional<z.ZodString>;
|
|
59
|
+
cause: z.ZodOptional<z.ZodUnknown>;
|
|
60
|
+
suggestion: z.ZodOptional<z.ZodString>;
|
|
61
|
+
ext: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
62
|
+
}, z.core.$strip>;
|
|
63
|
+
}, z.core.$strip>], "success">, Record<never, never>, Record<never, never>>;
|
|
65
64
|
};
|
|
66
65
|
files: {
|
|
67
|
-
list: _orpc_contract.ContractProcedureBuilderWithInputOutput<
|
|
68
|
-
prefix:
|
|
69
|
-
maxKeys:
|
|
70
|
-
continuationToken:
|
|
71
|
-
delimiter:
|
|
72
|
-
},
|
|
73
|
-
success:
|
|
74
|
-
data:
|
|
75
|
-
files:
|
|
76
|
-
key:
|
|
77
|
-
size:
|
|
78
|
-
contentType:
|
|
79
|
-
lastModified:
|
|
80
|
-
etag:
|
|
81
|
-
metadata:
|
|
82
|
-
},
|
|
83
|
-
commonPrefixes:
|
|
84
|
-
nextContinuationToken:
|
|
85
|
-
isTruncated:
|
|
86
|
-
},
|
|
87
|
-
},
|
|
88
|
-
success:
|
|
89
|
-
error:
|
|
90
|
-
code:
|
|
91
|
-
message:
|
|
92
|
-
httpStatus:
|
|
93
|
-
system:
|
|
94
|
-
module:
|
|
95
|
-
cause:
|
|
96
|
-
suggestion:
|
|
97
|
-
ext:
|
|
98
|
-
},
|
|
99
|
-
},
|
|
100
|
-
getMetadata: _orpc_contract.ContractProcedureBuilderWithInputOutput<
|
|
101
|
-
key:
|
|
102
|
-
},
|
|
103
|
-
success:
|
|
104
|
-
data:
|
|
105
|
-
key:
|
|
106
|
-
size:
|
|
107
|
-
contentType:
|
|
108
|
-
lastModified:
|
|
109
|
-
etag:
|
|
110
|
-
metadata:
|
|
111
|
-
},
|
|
112
|
-
},
|
|
113
|
-
success:
|
|
114
|
-
error:
|
|
115
|
-
code:
|
|
116
|
-
message:
|
|
117
|
-
httpStatus:
|
|
118
|
-
system:
|
|
119
|
-
module:
|
|
120
|
-
cause:
|
|
121
|
-
suggestion:
|
|
122
|
-
ext:
|
|
123
|
-
},
|
|
124
|
-
},
|
|
125
|
-
delete: _orpc_contract.ContractProcedureBuilderWithInputOutput<
|
|
126
|
-
key:
|
|
127
|
-
},
|
|
128
|
-
success:
|
|
129
|
-
data:
|
|
130
|
-
},
|
|
131
|
-
success:
|
|
132
|
-
error:
|
|
133
|
-
code:
|
|
134
|
-
message:
|
|
135
|
-
httpStatus:
|
|
136
|
-
system:
|
|
137
|
-
module:
|
|
138
|
-
cause:
|
|
139
|
-
suggestion:
|
|
140
|
-
ext:
|
|
141
|
-
},
|
|
142
|
-
},
|
|
143
|
-
deleteMany: _orpc_contract.ContractProcedureBuilderWithInputOutput<
|
|
144
|
-
keys:
|
|
145
|
-
},
|
|
146
|
-
success:
|
|
147
|
-
data:
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
},
|
|
160
|
-
},
|
|
66
|
+
list: _orpc_contract.ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
67
|
+
prefix: z.ZodOptional<z.ZodString>;
|
|
68
|
+
maxKeys: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
69
|
+
continuationToken: z.ZodOptional<z.ZodString>;
|
|
70
|
+
delimiter: z.ZodOptional<z.ZodString>;
|
|
71
|
+
}, z.core.$strip>, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
72
|
+
success: z.ZodLiteral<true>;
|
|
73
|
+
data: z.ZodObject<{
|
|
74
|
+
files: z.ZodArray<z.ZodObject<{
|
|
75
|
+
key: z.ZodString;
|
|
76
|
+
size: z.ZodNumber;
|
|
77
|
+
contentType: z.ZodString;
|
|
78
|
+
lastModified: z.ZodCoercedDate<unknown>;
|
|
79
|
+
etag: z.ZodOptional<z.ZodString>;
|
|
80
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
81
|
+
}, z.core.$strip>>;
|
|
82
|
+
commonPrefixes: z.ZodArray<z.ZodString>;
|
|
83
|
+
nextContinuationToken: z.ZodOptional<z.ZodString>;
|
|
84
|
+
isTruncated: z.ZodBoolean;
|
|
85
|
+
}, z.core.$strip>;
|
|
86
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
87
|
+
success: z.ZodLiteral<false>;
|
|
88
|
+
error: z.ZodObject<{
|
|
89
|
+
code: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
90
|
+
message: z.ZodString;
|
|
91
|
+
httpStatus: z.ZodOptional<z.ZodNumber>;
|
|
92
|
+
system: z.ZodOptional<z.ZodString>;
|
|
93
|
+
module: z.ZodOptional<z.ZodString>;
|
|
94
|
+
cause: z.ZodOptional<z.ZodUnknown>;
|
|
95
|
+
suggestion: z.ZodOptional<z.ZodString>;
|
|
96
|
+
ext: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
97
|
+
}, z.core.$strip>;
|
|
98
|
+
}, z.core.$strip>], "success">, Record<never, never>, Record<never, never>>;
|
|
99
|
+
getMetadata: _orpc_contract.ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
100
|
+
key: z.ZodString;
|
|
101
|
+
}, z.core.$strip>, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
102
|
+
success: z.ZodLiteral<true>;
|
|
103
|
+
data: z.ZodObject<{
|
|
104
|
+
key: z.ZodString;
|
|
105
|
+
size: z.ZodNumber;
|
|
106
|
+
contentType: z.ZodString;
|
|
107
|
+
lastModified: z.ZodCoercedDate<unknown>;
|
|
108
|
+
etag: z.ZodOptional<z.ZodString>;
|
|
109
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
110
|
+
}, z.core.$strip>;
|
|
111
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
112
|
+
success: z.ZodLiteral<false>;
|
|
113
|
+
error: z.ZodObject<{
|
|
114
|
+
code: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
115
|
+
message: z.ZodString;
|
|
116
|
+
httpStatus: z.ZodOptional<z.ZodNumber>;
|
|
117
|
+
system: z.ZodOptional<z.ZodString>;
|
|
118
|
+
module: z.ZodOptional<z.ZodString>;
|
|
119
|
+
cause: z.ZodOptional<z.ZodUnknown>;
|
|
120
|
+
suggestion: z.ZodOptional<z.ZodString>;
|
|
121
|
+
ext: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
122
|
+
}, z.core.$strip>;
|
|
123
|
+
}, z.core.$strip>], "success">, Record<never, never>, Record<never, never>>;
|
|
124
|
+
delete: _orpc_contract.ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
125
|
+
key: z.ZodString;
|
|
126
|
+
}, z.core.$strip>, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
127
|
+
success: z.ZodLiteral<true>;
|
|
128
|
+
data: z.ZodVoid;
|
|
129
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
130
|
+
success: z.ZodLiteral<false>;
|
|
131
|
+
error: z.ZodObject<{
|
|
132
|
+
code: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
133
|
+
message: z.ZodString;
|
|
134
|
+
httpStatus: z.ZodOptional<z.ZodNumber>;
|
|
135
|
+
system: z.ZodOptional<z.ZodString>;
|
|
136
|
+
module: z.ZodOptional<z.ZodString>;
|
|
137
|
+
cause: z.ZodOptional<z.ZodUnknown>;
|
|
138
|
+
suggestion: z.ZodOptional<z.ZodString>;
|
|
139
|
+
ext: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
140
|
+
}, z.core.$strip>;
|
|
141
|
+
}, z.core.$strip>], "success">, Record<never, never>, Record<never, never>>;
|
|
142
|
+
deleteMany: _orpc_contract.ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
143
|
+
keys: z.ZodArray<z.ZodString>;
|
|
144
|
+
}, z.core.$strip>, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
145
|
+
success: z.ZodLiteral<true>;
|
|
146
|
+
data: z.ZodObject<{
|
|
147
|
+
deletedKeys: z.ZodArray<z.ZodString>;
|
|
148
|
+
failures: z.ZodArray<z.ZodObject<{
|
|
149
|
+
key: z.ZodString;
|
|
150
|
+
code: z.ZodString;
|
|
151
|
+
retryable: z.ZodBoolean;
|
|
152
|
+
outcome: z.ZodEnum<{
|
|
153
|
+
unknown: "unknown";
|
|
154
|
+
failed: "failed";
|
|
155
|
+
notAttempted: "notAttempted";
|
|
156
|
+
}>;
|
|
157
|
+
}, z.core.$strip>>;
|
|
158
|
+
}, z.core.$strip>;
|
|
159
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
160
|
+
success: z.ZodLiteral<false>;
|
|
161
|
+
error: z.ZodObject<{
|
|
162
|
+
code: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
163
|
+
message: z.ZodString;
|
|
164
|
+
httpStatus: z.ZodOptional<z.ZodNumber>;
|
|
165
|
+
system: z.ZodOptional<z.ZodString>;
|
|
166
|
+
module: z.ZodOptional<z.ZodString>;
|
|
167
|
+
cause: z.ZodOptional<z.ZodUnknown>;
|
|
168
|
+
suggestion: z.ZodOptional<z.ZodString>;
|
|
169
|
+
ext: z.ZodOptional<z.ZodObject<{
|
|
170
|
+
deleteMany: z.ZodOptional<z.ZodObject<{
|
|
171
|
+
deletedKeys: z.ZodArray<z.ZodString>;
|
|
172
|
+
failures: z.ZodArray<z.ZodObject<{
|
|
173
|
+
key: z.ZodString;
|
|
174
|
+
code: z.ZodString;
|
|
175
|
+
retryable: z.ZodBoolean;
|
|
176
|
+
outcome: z.ZodEnum<{
|
|
177
|
+
unknown: "unknown";
|
|
178
|
+
failed: "failed";
|
|
179
|
+
notAttempted: "notAttempted";
|
|
180
|
+
}>;
|
|
181
|
+
}, z.core.$strip>>;
|
|
182
|
+
}, z.core.$strip>>;
|
|
183
|
+
}, z.core.$catchall<z.ZodUnknown>>>;
|
|
184
|
+
}, z.core.$strip>;
|
|
185
|
+
}, z.core.$strip>], "success">, Record<never, never>, Record<never, never>>;
|
|
161
186
|
};
|
|
162
187
|
};
|
|
188
|
+
/**
|
|
189
|
+
* storage 领域公开 procedure 契约的完整类型。
|
|
190
|
+
* @example
|
|
191
|
+
* ```ts
|
|
192
|
+
* import type { StorageContract } from '@h-ai/api-contract'
|
|
193
|
+
* import { apiContract } from '@h-ai/api-contract'
|
|
194
|
+
*
|
|
195
|
+
* const contract: StorageContract = apiContract.storage
|
|
196
|
+
* void contract
|
|
197
|
+
* ```
|
|
198
|
+
*/
|
|
163
199
|
type StorageContract = typeof storageContract;
|
|
164
200
|
|
|
165
201
|
/**
|
|
@@ -170,7 +206,21 @@ type StorageContract = typeof storageContract;
|
|
|
170
206
|
* @module storage-schemas
|
|
171
207
|
*/
|
|
172
208
|
|
|
173
|
-
/**
|
|
209
|
+
/**
|
|
210
|
+
* 文件元数据 Schema。
|
|
211
|
+
* @example
|
|
212
|
+
* ```ts
|
|
213
|
+
* import { StorageFileMetadataSchema } from '@h-ai/api-contract'
|
|
214
|
+
*
|
|
215
|
+
* const value = StorageFileMetadataSchema.parse({
|
|
216
|
+
* key: 'examples/readme.txt',
|
|
217
|
+
* size: 0,
|
|
218
|
+
* contentType: 'example',
|
|
219
|
+
* lastModified: null
|
|
220
|
+
* })
|
|
221
|
+
* void value
|
|
222
|
+
* ```
|
|
223
|
+
*/
|
|
174
224
|
declare const StorageFileMetadataSchema: z.ZodObject<{
|
|
175
225
|
key: z.ZodString;
|
|
176
226
|
size: z.ZodNumber;
|
|
@@ -179,32 +229,96 @@ declare const StorageFileMetadataSchema: z.ZodObject<{
|
|
|
179
229
|
etag: z.ZodOptional<z.ZodString>;
|
|
180
230
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
181
231
|
}, z.core.$strip>;
|
|
182
|
-
/**
|
|
232
|
+
/**
|
|
233
|
+
* 获取下载签名 URL 入参 Schema。
|
|
234
|
+
* @example
|
|
235
|
+
* ```ts
|
|
236
|
+
* import { StoragePresignDownloadInputSchema } from '@h-ai/api-contract'
|
|
237
|
+
*
|
|
238
|
+
* const value = StoragePresignDownloadInputSchema.parse({
|
|
239
|
+
* key: 'examples/readme.txt'
|
|
240
|
+
* })
|
|
241
|
+
* void value
|
|
242
|
+
* ```
|
|
243
|
+
*/
|
|
183
244
|
declare const StoragePresignDownloadInputSchema: z.ZodObject<{
|
|
184
245
|
key: z.ZodString;
|
|
185
246
|
expiresIn: z.ZodOptional<z.ZodNumber>;
|
|
186
|
-
}, z.core.$
|
|
187
|
-
/**
|
|
247
|
+
}, z.core.$strict>;
|
|
248
|
+
/**
|
|
249
|
+
* 获取上传签名 URL 入参 Schema。
|
|
250
|
+
* @example
|
|
251
|
+
* ```ts
|
|
252
|
+
* import { StoragePresignUploadInputSchema } from '@h-ai/api-contract'
|
|
253
|
+
*
|
|
254
|
+
* const value = StoragePresignUploadInputSchema.parse({
|
|
255
|
+
* key: 'examples/readme.txt'
|
|
256
|
+
* })
|
|
257
|
+
* void value
|
|
258
|
+
* ```
|
|
259
|
+
*/
|
|
188
260
|
declare const StoragePresignUploadInputSchema: z.ZodObject<{
|
|
189
261
|
key: z.ZodString;
|
|
190
262
|
contentType: z.ZodOptional<z.ZodString>;
|
|
191
|
-
contentLength: z.ZodOptional<z.ZodNumber>;
|
|
192
263
|
expiresIn: z.ZodOptional<z.ZodNumber>;
|
|
193
|
-
}, z.core.$
|
|
194
|
-
/**
|
|
264
|
+
}, z.core.$strict>;
|
|
265
|
+
/**
|
|
266
|
+
* 签名 URL 业务数据 Schema。
|
|
267
|
+
* @example
|
|
268
|
+
* ```ts
|
|
269
|
+
* import { StoragePresignedUrlSchema } from '@h-ai/api-contract'
|
|
270
|
+
*
|
|
271
|
+
* const value = StoragePresignedUrlSchema.parse({
|
|
272
|
+
* url: 'https://example.com/resource',
|
|
273
|
+
* key: 'examples/readme.txt'
|
|
274
|
+
* })
|
|
275
|
+
* void value
|
|
276
|
+
* ```
|
|
277
|
+
*/
|
|
195
278
|
declare const StoragePresignedUrlSchema: z.ZodObject<{
|
|
196
279
|
url: z.ZodString;
|
|
197
280
|
key: z.ZodString;
|
|
198
281
|
expiresAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
199
282
|
}, z.core.$strip>;
|
|
200
|
-
/**
|
|
283
|
+
/**
|
|
284
|
+
* 文件列表查询入参 Schema。
|
|
285
|
+
* @example
|
|
286
|
+
* ```ts
|
|
287
|
+
* import { StorageListFilesInputSchema } from '@h-ai/api-contract'
|
|
288
|
+
*
|
|
289
|
+
* const value = StorageListFilesInputSchema.parse({})
|
|
290
|
+
* void value
|
|
291
|
+
* ```
|
|
292
|
+
*/
|
|
201
293
|
declare const StorageListFilesInputSchema: z.ZodObject<{
|
|
202
294
|
prefix: z.ZodOptional<z.ZodString>;
|
|
203
295
|
maxKeys: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
204
296
|
continuationToken: z.ZodOptional<z.ZodString>;
|
|
205
297
|
delimiter: z.ZodOptional<z.ZodString>;
|
|
206
298
|
}, z.core.$strip>;
|
|
207
|
-
/**
|
|
299
|
+
/**
|
|
300
|
+
* 文件列表业务数据 Schema。
|
|
301
|
+
* @example
|
|
302
|
+
* ```ts
|
|
303
|
+
* import { StorageListFilesDataSchema } from '@h-ai/api-contract'
|
|
304
|
+
*
|
|
305
|
+
* const value = StorageListFilesDataSchema.parse({
|
|
306
|
+
* files: [
|
|
307
|
+
* {
|
|
308
|
+
* key: 'examples/readme.txt',
|
|
309
|
+
* size: 0,
|
|
310
|
+
* contentType: 'example',
|
|
311
|
+
* lastModified: null
|
|
312
|
+
* }
|
|
313
|
+
* ],
|
|
314
|
+
* commonPrefixes: [
|
|
315
|
+
* 'example'
|
|
316
|
+
* ],
|
|
317
|
+
* isTruncated: true
|
|
318
|
+
* })
|
|
319
|
+
* void value
|
|
320
|
+
* ```
|
|
321
|
+
*/
|
|
208
322
|
declare const StorageListFilesDataSchema: z.ZodObject<{
|
|
209
323
|
files: z.ZodArray<z.ZodObject<{
|
|
210
324
|
key: z.ZodString;
|
|
@@ -218,19 +332,158 @@ declare const StorageListFilesDataSchema: z.ZodObject<{
|
|
|
218
332
|
nextContinuationToken: z.ZodOptional<z.ZodString>;
|
|
219
333
|
isTruncated: z.ZodBoolean;
|
|
220
334
|
}, z.core.$strip>;
|
|
221
|
-
/**
|
|
335
|
+
/**
|
|
336
|
+
* 单文件操作入参 Schema。
|
|
337
|
+
* @example
|
|
338
|
+
* ```ts
|
|
339
|
+
* import { StorageFileKeyInputSchema } from '@h-ai/api-contract'
|
|
340
|
+
*
|
|
341
|
+
* const value = StorageFileKeyInputSchema.parse({
|
|
342
|
+
* key: 'examples/readme.txt'
|
|
343
|
+
* })
|
|
344
|
+
* void value
|
|
345
|
+
* ```
|
|
346
|
+
*/
|
|
222
347
|
declare const StorageFileKeyInputSchema: z.ZodObject<{
|
|
223
348
|
key: z.ZodString;
|
|
224
349
|
}, z.core.$strip>;
|
|
225
|
-
/**
|
|
350
|
+
/**
|
|
351
|
+
* 批量删除文件入参 Schema。
|
|
352
|
+
* @example
|
|
353
|
+
* ```ts
|
|
354
|
+
* import { StorageDeleteFilesInputSchema } from '@h-ai/api-contract'
|
|
355
|
+
*
|
|
356
|
+
* const value = StorageDeleteFilesInputSchema.parse({
|
|
357
|
+
* keys: [
|
|
358
|
+
* 'example'
|
|
359
|
+
* ]
|
|
360
|
+
* })
|
|
361
|
+
* void value
|
|
362
|
+
* ```
|
|
363
|
+
*/
|
|
226
364
|
declare const StorageDeleteFilesInputSchema: z.ZodObject<{
|
|
227
365
|
keys: z.ZodArray<z.ZodString>;
|
|
228
366
|
}, z.core.$strip>;
|
|
367
|
+
/**
|
|
368
|
+
* 批量删除的安全进度;响应失败时通过 error.ext.deleteMany 返回同一结构。
|
|
369
|
+
* @example
|
|
370
|
+
* ```ts
|
|
371
|
+
* import { StorageDeleteSummarySchema } from '@h-ai/api-contract'
|
|
372
|
+
*
|
|
373
|
+
* const value = StorageDeleteSummarySchema.parse({
|
|
374
|
+
* deletedKeys: [
|
|
375
|
+
* 'example'
|
|
376
|
+
* ],
|
|
377
|
+
* failures: [
|
|
378
|
+
* {
|
|
379
|
+
* key: 'examples/readme.txt',
|
|
380
|
+
* code: 'example-1',
|
|
381
|
+
* retryable: true,
|
|
382
|
+
* outcome: 'failed'
|
|
383
|
+
* }
|
|
384
|
+
* ]
|
|
385
|
+
* })
|
|
386
|
+
* void value
|
|
387
|
+
* ```
|
|
388
|
+
*/
|
|
389
|
+
declare const StorageDeleteSummarySchema: z.ZodObject<{
|
|
390
|
+
deletedKeys: z.ZodArray<z.ZodString>;
|
|
391
|
+
failures: z.ZodArray<z.ZodObject<{
|
|
392
|
+
key: z.ZodString;
|
|
393
|
+
code: z.ZodString;
|
|
394
|
+
retryable: z.ZodBoolean;
|
|
395
|
+
outcome: z.ZodEnum<{
|
|
396
|
+
unknown: "unknown";
|
|
397
|
+
failed: "failed";
|
|
398
|
+
notAttempted: "notAttempted";
|
|
399
|
+
}>;
|
|
400
|
+
}, z.core.$strip>>;
|
|
401
|
+
}, z.core.$strip>;
|
|
402
|
+
/**
|
|
403
|
+
* 为对象生成下载地址的请求。
|
|
404
|
+
* @example
|
|
405
|
+
* ```ts
|
|
406
|
+
* import type { StoragePresignDownloadInput } from '@h-ai/api-contract'
|
|
407
|
+
* import { StoragePresignDownloadInputSchema } from '@h-ai/api-contract'
|
|
408
|
+
*
|
|
409
|
+
* const value: StoragePresignDownloadInput = StoragePresignDownloadInputSchema.parse({
|
|
410
|
+
* key: 'examples/readme.txt'
|
|
411
|
+
* })
|
|
412
|
+
* void value
|
|
413
|
+
* ```
|
|
414
|
+
*/
|
|
229
415
|
type StoragePresignDownloadInput = z.infer<typeof StoragePresignDownloadInputSchema>;
|
|
416
|
+
/**
|
|
417
|
+
* 为对象生成上传地址的请求。
|
|
418
|
+
* @example
|
|
419
|
+
* ```ts
|
|
420
|
+
* import type { StoragePresignUploadInput } from '@h-ai/api-contract'
|
|
421
|
+
* import { StoragePresignUploadInputSchema } from '@h-ai/api-contract'
|
|
422
|
+
*
|
|
423
|
+
* const value: StoragePresignUploadInput = StoragePresignUploadInputSchema.parse({
|
|
424
|
+
* key: 'examples/readme.txt'
|
|
425
|
+
* })
|
|
426
|
+
* void value
|
|
427
|
+
* ```
|
|
428
|
+
*/
|
|
230
429
|
type StoragePresignUploadInput = z.infer<typeof StoragePresignUploadInputSchema>;
|
|
430
|
+
/**
|
|
431
|
+
* 以 HaiResult 区分成功业务数据和公共错误的 StoragePresignedUrlOutput 响应。
|
|
432
|
+
* @example
|
|
433
|
+
* ```ts
|
|
434
|
+
* import type { StoragePresignedUrlOutput } from '@h-ai/api-contract'
|
|
435
|
+
* import { StoragePresignedUrlSchema } from '@h-ai/api-contract'
|
|
436
|
+
* import { ok } from '@h-ai/core'
|
|
437
|
+
*
|
|
438
|
+
* const response: StoragePresignedUrlOutput = ok(StoragePresignedUrlSchema.parse({
|
|
439
|
+
* url: 'https://example.com/resource',
|
|
440
|
+
* key: 'examples/readme.txt'
|
|
441
|
+
* }))
|
|
442
|
+
* if (response.success) void response.data
|
|
443
|
+
* ```
|
|
444
|
+
*/
|
|
231
445
|
type StoragePresignedUrlOutput = HaiResult<z.infer<typeof StoragePresignedUrlSchema>>;
|
|
446
|
+
/**
|
|
447
|
+
* 按前缀和游标列出对象的请求。
|
|
448
|
+
* @example
|
|
449
|
+
* ```ts
|
|
450
|
+
* import type { StorageListFilesInput } from '@h-ai/api-contract'
|
|
451
|
+
* import { StorageListFilesInputSchema } from '@h-ai/api-contract'
|
|
452
|
+
*
|
|
453
|
+
* const value: StorageListFilesInput = StorageListFilesInputSchema.parse({})
|
|
454
|
+
* void value
|
|
455
|
+
* ```
|
|
456
|
+
*/
|
|
232
457
|
type StorageListFilesInput = z.infer<typeof StorageListFilesInputSchema>;
|
|
458
|
+
/**
|
|
459
|
+
* 以对象 key 定位文件的请求。
|
|
460
|
+
* @example
|
|
461
|
+
* ```ts
|
|
462
|
+
* import type { StorageFileKeyInput } from '@h-ai/api-contract'
|
|
463
|
+
* import { StorageFileKeyInputSchema } from '@h-ai/api-contract'
|
|
464
|
+
*
|
|
465
|
+
* const value: StorageFileKeyInput = StorageFileKeyInputSchema.parse({
|
|
466
|
+
* key: 'examples/readme.txt'
|
|
467
|
+
* })
|
|
468
|
+
* void value
|
|
469
|
+
* ```
|
|
470
|
+
*/
|
|
233
471
|
type StorageFileKeyInput = z.infer<typeof StorageFileKeyInputSchema>;
|
|
472
|
+
/**
|
|
473
|
+
* 批量删除指定对象 key 的请求。
|
|
474
|
+
* @example
|
|
475
|
+
* ```ts
|
|
476
|
+
* import type { StorageDeleteFilesInput } from '@h-ai/api-contract'
|
|
477
|
+
* import { StorageDeleteFilesInputSchema } from '@h-ai/api-contract'
|
|
478
|
+
*
|
|
479
|
+
* const value: StorageDeleteFilesInput = StorageDeleteFilesInputSchema.parse({
|
|
480
|
+
* keys: [
|
|
481
|
+
* 'example'
|
|
482
|
+
* ]
|
|
483
|
+
* })
|
|
484
|
+
* void value
|
|
485
|
+
* ```
|
|
486
|
+
*/
|
|
234
487
|
type StorageDeleteFilesInput = z.infer<typeof StorageDeleteFilesInputSchema>;
|
|
235
488
|
|
|
236
|
-
export { type StorageContract, type StorageDeleteFilesInput, StorageDeleteFilesInputSchema, type StorageFileKeyInput, StorageFileKeyInputSchema, StorageFileMetadataSchema, StorageListFilesDataSchema, type StorageListFilesInput, StorageListFilesInputSchema, type StoragePresignDownloadInput, StoragePresignDownloadInputSchema, type StoragePresignUploadInput, StoragePresignUploadInputSchema, type StoragePresignedUrlOutput, StoragePresignedUrlSchema, storageContract };
|
|
489
|
+
export { type StorageContract, type StorageDeleteFilesInput, StorageDeleteFilesInputSchema, StorageDeleteSummarySchema, type StorageFileKeyInput, StorageFileKeyInputSchema, StorageFileMetadataSchema, StorageListFilesDataSchema, type StorageListFilesInput, StorageListFilesInputSchema, type StoragePresignDownloadInput, StoragePresignDownloadInputSchema, type StoragePresignUploadInput, StoragePresignUploadInputSchema, type StoragePresignedUrlOutput, StoragePresignedUrlSchema, storageContract };
|
package/dist/storage/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { StorageDeleteFilesInputSchema, StorageFileKeyInputSchema, StorageFileMetadataSchema, StorageListFilesDataSchema, StorageListFilesInputSchema, StoragePresignDownloadInputSchema, StoragePresignUploadInputSchema, StoragePresignedUrlSchema, storageContract } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
export { StorageDeleteFilesInputSchema, StorageDeleteSummarySchema, StorageFileKeyInputSchema, StorageFileMetadataSchema, StorageListFilesDataSchema, StorageListFilesInputSchema, StoragePresignDownloadInputSchema, StoragePresignUploadInputSchema, StoragePresignedUrlSchema, storageContract } from '../chunk-IVZVAWEF.js';
|
|
2
|
+
import '../chunk-JKPLID6E.js';
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
4
4
|
//# sourceMappingURL=index.js.map
|