@h-ai/api-contract 0.1.0-alpha.67 → 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.
@@ -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
- * @h-ai/api-contract — Storage 领域 contract
6
+ * Storage 领域 oRPC contract。
7
+ * @example
8
+ * ```ts
9
+ * import { apiContract } from '@h-ai/api-contract'
9
10
  *
10
- * 定义文件存储相关 API 的接口边界:预签名 URL 生成与文件管理。
11
- * 所有接口均需 Bearer Token 认证(由 `@h-ai/serv` 的 feature 层强制)。
12
- * @module storage-contract
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<zod.ZodObject<{
18
- key: zod.ZodString;
19
- expiresIn: zod.ZodOptional<zod.ZodNumber>;
20
- }, zod_v4_core.$strip>, zod.ZodDiscriminatedUnion<[zod.ZodObject<{
21
- success: zod.ZodLiteral<true>;
22
- data: zod.ZodObject<{
23
- url: zod.ZodString;
24
- key: zod.ZodString;
25
- expiresAt: zod.ZodOptional<zod.ZodCoercedDate<unknown>>;
26
- }, zod_v4_core.$strip>;
27
- }, zod_v4_core.$strip>, zod.ZodObject<{
28
- success: zod.ZodLiteral<false>;
29
- error: zod.ZodObject<{
30
- code: zod.ZodUnion<readonly [zod.ZodString, zod.ZodNumber]>;
31
- message: zod.ZodString;
32
- httpStatus: zod.ZodOptional<zod.ZodNumber>;
33
- system: zod.ZodOptional<zod.ZodString>;
34
- module: zod.ZodOptional<zod.ZodString>;
35
- cause: zod.ZodOptional<zod.ZodUnknown>;
36
- suggestion: zod.ZodOptional<zod.ZodString>;
37
- ext: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodUnknown>>;
38
- }, zod_v4_core.$strip>;
39
- }, zod_v4_core.$strip>], "success">, Record<never, never>, Record<never, never>>;
40
- createUpload: _orpc_contract.ContractProcedureBuilderWithInputOutput<zod.ZodObject<{
41
- key: zod.ZodString;
42
- contentType: zod.ZodOptional<zod.ZodString>;
43
- contentLength: zod.ZodOptional<zod.ZodNumber>;
44
- expiresIn: zod.ZodOptional<zod.ZodNumber>;
45
- }, zod_v4_core.$strip>, zod.ZodDiscriminatedUnion<[zod.ZodObject<{
46
- success: zod.ZodLiteral<true>;
47
- data: zod.ZodObject<{
48
- url: zod.ZodString;
49
- key: zod.ZodString;
50
- expiresAt: zod.ZodOptional<zod.ZodCoercedDate<unknown>>;
51
- }, zod_v4_core.$strip>;
52
- }, zod_v4_core.$strip>, zod.ZodObject<{
53
- success: zod.ZodLiteral<false>;
54
- error: zod.ZodObject<{
55
- code: zod.ZodUnion<readonly [zod.ZodString, zod.ZodNumber]>;
56
- message: zod.ZodString;
57
- httpStatus: zod.ZodOptional<zod.ZodNumber>;
58
- system: zod.ZodOptional<zod.ZodString>;
59
- module: zod.ZodOptional<zod.ZodString>;
60
- cause: zod.ZodOptional<zod.ZodUnknown>;
61
- suggestion: zod.ZodOptional<zod.ZodString>;
62
- ext: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodUnknown>>;
63
- }, zod_v4_core.$strip>;
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<zod.ZodObject<{
68
- prefix: zod.ZodOptional<zod.ZodString>;
69
- maxKeys: zod.ZodOptional<zod.ZodCoercedNumber<unknown>>;
70
- continuationToken: zod.ZodOptional<zod.ZodString>;
71
- delimiter: zod.ZodOptional<zod.ZodString>;
72
- }, zod_v4_core.$strip>, zod.ZodDiscriminatedUnion<[zod.ZodObject<{
73
- success: zod.ZodLiteral<true>;
74
- data: zod.ZodObject<{
75
- files: zod.ZodArray<zod.ZodObject<{
76
- key: zod.ZodString;
77
- size: zod.ZodNumber;
78
- contentType: zod.ZodString;
79
- lastModified: zod.ZodCoercedDate<unknown>;
80
- etag: zod.ZodOptional<zod.ZodString>;
81
- metadata: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodString>>;
82
- }, zod_v4_core.$strip>>;
83
- commonPrefixes: zod.ZodArray<zod.ZodString>;
84
- nextContinuationToken: zod.ZodOptional<zod.ZodString>;
85
- isTruncated: zod.ZodBoolean;
86
- }, zod_v4_core.$strip>;
87
- }, zod_v4_core.$strip>, zod.ZodObject<{
88
- success: zod.ZodLiteral<false>;
89
- error: zod.ZodObject<{
90
- code: zod.ZodUnion<readonly [zod.ZodString, zod.ZodNumber]>;
91
- message: zod.ZodString;
92
- httpStatus: zod.ZodOptional<zod.ZodNumber>;
93
- system: zod.ZodOptional<zod.ZodString>;
94
- module: zod.ZodOptional<zod.ZodString>;
95
- cause: zod.ZodOptional<zod.ZodUnknown>;
96
- suggestion: zod.ZodOptional<zod.ZodString>;
97
- ext: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodUnknown>>;
98
- }, zod_v4_core.$strip>;
99
- }, zod_v4_core.$strip>], "success">, Record<never, never>, Record<never, never>>;
100
- getMetadata: _orpc_contract.ContractProcedureBuilderWithInputOutput<zod.ZodObject<{
101
- key: zod.ZodString;
102
- }, zod_v4_core.$strip>, zod.ZodDiscriminatedUnion<[zod.ZodObject<{
103
- success: zod.ZodLiteral<true>;
104
- data: zod.ZodObject<{
105
- key: zod.ZodString;
106
- size: zod.ZodNumber;
107
- contentType: zod.ZodString;
108
- lastModified: zod.ZodCoercedDate<unknown>;
109
- etag: zod.ZodOptional<zod.ZodString>;
110
- metadata: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodString>>;
111
- }, zod_v4_core.$strip>;
112
- }, zod_v4_core.$strip>, zod.ZodObject<{
113
- success: zod.ZodLiteral<false>;
114
- error: zod.ZodObject<{
115
- code: zod.ZodUnion<readonly [zod.ZodString, zod.ZodNumber]>;
116
- message: zod.ZodString;
117
- httpStatus: zod.ZodOptional<zod.ZodNumber>;
118
- system: zod.ZodOptional<zod.ZodString>;
119
- module: zod.ZodOptional<zod.ZodString>;
120
- cause: zod.ZodOptional<zod.ZodUnknown>;
121
- suggestion: zod.ZodOptional<zod.ZodString>;
122
- ext: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodUnknown>>;
123
- }, zod_v4_core.$strip>;
124
- }, zod_v4_core.$strip>], "success">, Record<never, never>, Record<never, never>>;
125
- delete: _orpc_contract.ContractProcedureBuilderWithInputOutput<zod.ZodObject<{
126
- key: zod.ZodString;
127
- }, zod_v4_core.$strip>, zod.ZodDiscriminatedUnion<[zod.ZodObject<{
128
- success: zod.ZodLiteral<true>;
129
- data: zod.ZodVoid;
130
- }, zod_v4_core.$strip>, zod.ZodObject<{
131
- success: zod.ZodLiteral<false>;
132
- error: zod.ZodObject<{
133
- code: zod.ZodUnion<readonly [zod.ZodString, zod.ZodNumber]>;
134
- message: zod.ZodString;
135
- httpStatus: zod.ZodOptional<zod.ZodNumber>;
136
- system: zod.ZodOptional<zod.ZodString>;
137
- module: zod.ZodOptional<zod.ZodString>;
138
- cause: zod.ZodOptional<zod.ZodUnknown>;
139
- suggestion: zod.ZodOptional<zod.ZodString>;
140
- ext: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodUnknown>>;
141
- }, zod_v4_core.$strip>;
142
- }, zod_v4_core.$strip>], "success">, Record<never, never>, Record<never, never>>;
143
- deleteMany: _orpc_contract.ContractProcedureBuilderWithInputOutput<zod.ZodObject<{
144
- keys: zod.ZodArray<zod.ZodString>;
145
- }, zod_v4_core.$strip>, zod.ZodDiscriminatedUnion<[zod.ZodObject<{
146
- success: zod.ZodLiteral<true>;
147
- data: zod.ZodVoid;
148
- }, zod_v4_core.$strip>, zod.ZodObject<{
149
- success: zod.ZodLiteral<false>;
150
- error: zod.ZodObject<{
151
- code: zod.ZodUnion<readonly [zod.ZodString, zod.ZodNumber]>;
152
- message: zod.ZodString;
153
- httpStatus: zod.ZodOptional<zod.ZodNumber>;
154
- system: zod.ZodOptional<zod.ZodString>;
155
- module: zod.ZodOptional<zod.ZodString>;
156
- cause: zod.ZodOptional<zod.ZodUnknown>;
157
- suggestion: zod.ZodOptional<zod.ZodString>;
158
- ext: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodUnknown>>;
159
- }, zod_v4_core.$strip>;
160
- }, zod_v4_core.$strip>], "success">, Record<never, never>, Record<never, never>>;
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
- /** 文件元数据 Schema。 */
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
- /** 获取下载签名 URL 入参 Schema。 */
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.$strip>;
187
- /** 获取上传签名 URL 入参 Schema。 */
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.$strip>;
194
- /** 签名 URL 业务数据 Schema。 */
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
- /** 文件列表查询入参 Schema。 */
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
- /** 文件列表业务数据 Schema。 */
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
- /** 单文件操作入参 Schema。 */
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
- /** 批量删除文件入参 Schema。 */
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 };
@@ -1,4 +1,4 @@
1
- export { StorageDeleteFilesInputSchema, StorageFileKeyInputSchema, StorageFileMetadataSchema, StorageListFilesDataSchema, StorageListFilesInputSchema, StoragePresignDownloadInputSchema, StoragePresignUploadInputSchema, StoragePresignedUrlSchema, storageContract } from '../chunk-3QSKWVLP.js';
2
- import '../chunk-CUU2F6YD.js';
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