@done-coding/schema-api 0.0.1-alpha.1 → 0.0.1-alpha.2
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.md +6 -7
- package/es/index.mjs +31 -470
- package/es/reference.mjs +469 -0
- package/lib/index.cjs +1 -1
- package/lib/reference.cjs +1 -0
- package/package.json +6 -1
- package/schemas/common-error-codes.schema.json +24 -23
- package/schemas/cursor-list-request.schema.json +2 -3
- package/schemas/error-body.schema.json +1 -2
- package/schemas/list-reference-values.schema.json +23 -0
- package/schemas/paged-list-request.schema.json +4 -7
- package/schemas/paged-list.schema.json +2 -3
- package/schemas/service-error-codes.schema.json +2 -3
- package/types/index.d.ts +7 -158
- package/types/reference.d.ts +250 -0
package/README.md
CHANGED
|
@@ -4,7 +4,9 @@
|
|
|
4
4
|
跨前后端通用接口结构的类型、常量与定义文件
|
|
5
5
|
```
|
|
6
6
|
|
|
7
|
-
成功外壳、错误体、三种列表(一次性 / 页码式 / 游标式)、列表请求参数与业务码的 TypeScript
|
|
7
|
+
成功外壳、错误体、三种列表(一次性 / 页码式 / 游标式)、列表请求参数与业务码的 TypeScript 类型与 JSON Schema 定义文件,由同一份定义生成;同版本的 Python 包为 PyPI 上的 `done-coding-schema-api`。
|
|
8
|
+
|
|
9
|
+
两个出口:主入口 `@done-coding/schema-api` 只有结构(类型、成功码、结构定义文件);通用失败码与码表、字段路径与参数名、参考数值在 `@done-coding/schema-api/reference`,只是参考,不随结构生效,要用须显式引入。
|
|
8
10
|
|
|
9
11
|
## 使用
|
|
10
12
|
|
|
@@ -13,11 +15,8 @@ npm install @done-coding/schema-api
|
|
|
13
15
|
```
|
|
14
16
|
|
|
15
17
|
```ts
|
|
16
|
-
import {
|
|
17
|
-
|
|
18
|
-
type PagedList,
|
|
19
|
-
type SuccessEnvelope,
|
|
20
|
-
} from "@done-coding/schema-api";
|
|
18
|
+
import type { PagedList, SuccessEnvelope } from "@done-coding/schema-api";
|
|
19
|
+
import { PAGED_LIST_REQUEST_PARAMS } from "@done-coding/schema-api/reference";
|
|
21
20
|
|
|
22
21
|
interface User {
|
|
23
22
|
id: string;
|
|
@@ -29,6 +28,6 @@ response.data.page.totalRecord; // number
|
|
|
29
28
|
PAGED_LIST_REQUEST_PARAMS.pageSize; // "page.pageSize"
|
|
30
29
|
```
|
|
31
30
|
|
|
32
|
-
|
|
31
|
+
结构定义文件以 `schemas` 导出,参考资源定义文件以 `referenceSchemas` 从 `./reference` 导出,也可按路径取:`@done-coding/schema-api/schemas/<结构名>.schema.json`。
|
|
33
32
|
|
|
34
33
|
各结构的说明、怎么选列表、业务码与版本规则见仓库 README:<https://github.com/done-coding/done-coding-schema#readme>
|
package/es/index.mjs
CHANGED
|
@@ -1,108 +1,5 @@
|
|
|
1
|
-
const
|
|
1
|
+
const c = {
|
|
2
2
|
OK: "OK"
|
|
3
|
-
}, u = {
|
|
4
|
-
INVALID_REQUEST: "INVALID_REQUEST",
|
|
5
|
-
UNAUTHENTICATED: "UNAUTHENTICATED",
|
|
6
|
-
FORBIDDEN: "FORBIDDEN",
|
|
7
|
-
NOT_FOUND: "NOT_FOUND",
|
|
8
|
-
ROUTE_NOT_FOUND: "ROUTE_NOT_FOUND",
|
|
9
|
-
METHOD_NOT_ALLOWED: "METHOD_NOT_ALLOWED",
|
|
10
|
-
CONFLICT: "CONFLICT",
|
|
11
|
-
RATE_LIMITED: "RATE_LIMITED",
|
|
12
|
-
INTERNAL_ERROR: "INTERNAL_ERROR",
|
|
13
|
-
LIST_LIMIT_EXCEEDED: "LIST_LIMIT_EXCEEDED",
|
|
14
|
-
SERVICE_UNAVAILABLE: "SERVICE_UNAVAILABLE"
|
|
15
|
-
}, m = {
|
|
16
|
-
INVALID_REQUEST: {
|
|
17
|
-
httpStatus: 400,
|
|
18
|
-
retryable: !1,
|
|
19
|
-
outcome: "not_executed",
|
|
20
|
-
meaning: "请求不符合接口契约"
|
|
21
|
-
},
|
|
22
|
-
UNAUTHENTICATED: {
|
|
23
|
-
httpStatus: 401,
|
|
24
|
-
retryable: !1,
|
|
25
|
-
outcome: "not_executed",
|
|
26
|
-
meaning: "未登录,或令牌无效、过期"
|
|
27
|
-
},
|
|
28
|
-
FORBIDDEN: {
|
|
29
|
-
httpStatus: 403,
|
|
30
|
-
retryable: !1,
|
|
31
|
-
outcome: "not_executed",
|
|
32
|
-
meaning: "已认证但无权执行"
|
|
33
|
-
},
|
|
34
|
-
NOT_FOUND: {
|
|
35
|
-
httpStatus: 404,
|
|
36
|
-
retryable: !1,
|
|
37
|
-
outcome: "not_executed",
|
|
38
|
-
meaning: "资源不存在,或调用方无权得知其存在"
|
|
39
|
-
},
|
|
40
|
-
ROUTE_NOT_FOUND: {
|
|
41
|
-
httpStatus: 404,
|
|
42
|
-
retryable: !1,
|
|
43
|
-
outcome: "not_executed",
|
|
44
|
-
meaning: "接口路径不存在"
|
|
45
|
-
},
|
|
46
|
-
METHOD_NOT_ALLOWED: {
|
|
47
|
-
httpStatus: 405,
|
|
48
|
-
retryable: !1,
|
|
49
|
-
outcome: "not_executed",
|
|
50
|
-
meaning: "接口不支持该 HTTP 方法"
|
|
51
|
-
},
|
|
52
|
-
CONFLICT: {
|
|
53
|
-
httpStatus: 409,
|
|
54
|
-
retryable: !1,
|
|
55
|
-
outcome: "not_executed",
|
|
56
|
-
meaning: "资源状态冲突"
|
|
57
|
-
},
|
|
58
|
-
RATE_LIMITED: {
|
|
59
|
-
httpStatus: 429,
|
|
60
|
-
retryable: !0,
|
|
61
|
-
outcome: "not_executed",
|
|
62
|
-
meaning: "请求过于频繁,可稍后重试"
|
|
63
|
-
},
|
|
64
|
-
INTERNAL_ERROR: {
|
|
65
|
-
httpStatus: 500,
|
|
66
|
-
retryable: !1,
|
|
67
|
-
outcome: "unknown",
|
|
68
|
-
meaning: "服务内部错误,可能已产生副作用"
|
|
69
|
-
},
|
|
70
|
-
LIST_LIMIT_EXCEEDED: {
|
|
71
|
-
httpStatus: 500,
|
|
72
|
-
retryable: !1,
|
|
73
|
-
outcome: "unknown",
|
|
74
|
-
meaning: "一次性列表的结果超出接口声明的上限"
|
|
75
|
-
},
|
|
76
|
-
SERVICE_UNAVAILABLE: {
|
|
77
|
-
httpStatus: 503,
|
|
78
|
-
retryable: !0,
|
|
79
|
-
outcome: "unknown",
|
|
80
|
-
meaning: "服务或其依赖暂不可用"
|
|
81
|
-
}
|
|
82
|
-
}, l = {
|
|
83
|
-
items: "items"
|
|
84
|
-
}, h = {
|
|
85
|
-
after: "cursor.after",
|
|
86
|
-
limit: "cursor.limit"
|
|
87
|
-
}, E = {
|
|
88
|
-
items: "items",
|
|
89
|
-
next: "cursor.next",
|
|
90
|
-
hasMore: "cursor.hasMore"
|
|
91
|
-
}, f = {
|
|
92
|
-
prefix: "filter.",
|
|
93
|
-
operators: {
|
|
94
|
-
eq: "eq"
|
|
95
|
-
}
|
|
96
|
-
}, g = {
|
|
97
|
-
page: "page.page",
|
|
98
|
-
pageSize: "page.pageSize",
|
|
99
|
-
query: "page.query",
|
|
100
|
-
orderBy: "page.orderBy"
|
|
101
|
-
}, S = {
|
|
102
|
-
items: "items",
|
|
103
|
-
totalRecord: "page.totalRecord",
|
|
104
|
-
pageSize: "page.pageSize",
|
|
105
|
-
totalPage: "page.totalPage"
|
|
106
3
|
}, e = {
|
|
107
4
|
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
108
5
|
$id: "bounded-list.schema.json",
|
|
@@ -120,317 +17,6 @@ const d = {
|
|
|
120
17
|
},
|
|
121
18
|
required: ["items"]
|
|
122
19
|
}, t = {
|
|
123
|
-
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
124
|
-
$id: "common-error-codes.schema.json",
|
|
125
|
-
title: "CommonErrorCodes",
|
|
126
|
-
description: "通用失败码表:每个码固定 HTTP 状态(x-httpStatus),并给出能否重试与是否已执行的缺省值(default)。错误体引用本表:code 是通用失败码时,服务未另行指定 error.retryable 与 error.outcome 就取表中值;服务能确定更具体的重试性或执行结局时可以覆盖,任何合法的 retryable 与 outcome 都合法。$defs/code 列出全部通用失败码,须与 allOf 各项一一对应。",
|
|
127
|
-
$defs: {
|
|
128
|
-
code: {
|
|
129
|
-
description: "通用失败码。",
|
|
130
|
-
enum: [
|
|
131
|
-
"INVALID_REQUEST",
|
|
132
|
-
"UNAUTHENTICATED",
|
|
133
|
-
"FORBIDDEN",
|
|
134
|
-
"NOT_FOUND",
|
|
135
|
-
"ROUTE_NOT_FOUND",
|
|
136
|
-
"METHOD_NOT_ALLOWED",
|
|
137
|
-
"CONFLICT",
|
|
138
|
-
"RATE_LIMITED",
|
|
139
|
-
"INTERNAL_ERROR",
|
|
140
|
-
"LIST_LIMIT_EXCEEDED",
|
|
141
|
-
"SERVICE_UNAVAILABLE"
|
|
142
|
-
]
|
|
143
|
-
}
|
|
144
|
-
},
|
|
145
|
-
allOf: [
|
|
146
|
-
{
|
|
147
|
-
description: "请求不符合接口契约",
|
|
148
|
-
"x-httpStatus": 400,
|
|
149
|
-
if: {
|
|
150
|
-
properties: {
|
|
151
|
-
code: {
|
|
152
|
-
const: "INVALID_REQUEST"
|
|
153
|
-
}
|
|
154
|
-
},
|
|
155
|
-
required: ["code"]
|
|
156
|
-
},
|
|
157
|
-
then: {
|
|
158
|
-
properties: {
|
|
159
|
-
error: {
|
|
160
|
-
properties: {
|
|
161
|
-
retryable: {
|
|
162
|
-
default: !1
|
|
163
|
-
},
|
|
164
|
-
outcome: {
|
|
165
|
-
default: "not_executed"
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
},
|
|
172
|
-
{
|
|
173
|
-
description: "未登录,或令牌无效、过期",
|
|
174
|
-
"x-httpStatus": 401,
|
|
175
|
-
if: {
|
|
176
|
-
properties: {
|
|
177
|
-
code: {
|
|
178
|
-
const: "UNAUTHENTICATED"
|
|
179
|
-
}
|
|
180
|
-
},
|
|
181
|
-
required: ["code"]
|
|
182
|
-
},
|
|
183
|
-
then: {
|
|
184
|
-
properties: {
|
|
185
|
-
error: {
|
|
186
|
-
properties: {
|
|
187
|
-
retryable: {
|
|
188
|
-
default: !1
|
|
189
|
-
},
|
|
190
|
-
outcome: {
|
|
191
|
-
default: "not_executed"
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
},
|
|
198
|
-
{
|
|
199
|
-
description: "已认证但无权执行",
|
|
200
|
-
"x-httpStatus": 403,
|
|
201
|
-
if: {
|
|
202
|
-
properties: {
|
|
203
|
-
code: {
|
|
204
|
-
const: "FORBIDDEN"
|
|
205
|
-
}
|
|
206
|
-
},
|
|
207
|
-
required: ["code"]
|
|
208
|
-
},
|
|
209
|
-
then: {
|
|
210
|
-
properties: {
|
|
211
|
-
error: {
|
|
212
|
-
properties: {
|
|
213
|
-
retryable: {
|
|
214
|
-
default: !1
|
|
215
|
-
},
|
|
216
|
-
outcome: {
|
|
217
|
-
default: "not_executed"
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
},
|
|
224
|
-
{
|
|
225
|
-
description: "资源不存在,或调用方无权得知其存在",
|
|
226
|
-
"x-httpStatus": 404,
|
|
227
|
-
if: {
|
|
228
|
-
properties: {
|
|
229
|
-
code: {
|
|
230
|
-
const: "NOT_FOUND"
|
|
231
|
-
}
|
|
232
|
-
},
|
|
233
|
-
required: ["code"]
|
|
234
|
-
},
|
|
235
|
-
then: {
|
|
236
|
-
properties: {
|
|
237
|
-
error: {
|
|
238
|
-
properties: {
|
|
239
|
-
retryable: {
|
|
240
|
-
default: !1
|
|
241
|
-
},
|
|
242
|
-
outcome: {
|
|
243
|
-
default: "not_executed"
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
},
|
|
250
|
-
{
|
|
251
|
-
description: "接口路径不存在",
|
|
252
|
-
"x-httpStatus": 404,
|
|
253
|
-
if: {
|
|
254
|
-
properties: {
|
|
255
|
-
code: {
|
|
256
|
-
const: "ROUTE_NOT_FOUND"
|
|
257
|
-
}
|
|
258
|
-
},
|
|
259
|
-
required: ["code"]
|
|
260
|
-
},
|
|
261
|
-
then: {
|
|
262
|
-
properties: {
|
|
263
|
-
error: {
|
|
264
|
-
properties: {
|
|
265
|
-
retryable: {
|
|
266
|
-
default: !1
|
|
267
|
-
},
|
|
268
|
-
outcome: {
|
|
269
|
-
default: "not_executed"
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
},
|
|
276
|
-
{
|
|
277
|
-
description: "接口不支持该 HTTP 方法",
|
|
278
|
-
"x-httpStatus": 405,
|
|
279
|
-
if: {
|
|
280
|
-
properties: {
|
|
281
|
-
code: {
|
|
282
|
-
const: "METHOD_NOT_ALLOWED"
|
|
283
|
-
}
|
|
284
|
-
},
|
|
285
|
-
required: ["code"]
|
|
286
|
-
},
|
|
287
|
-
then: {
|
|
288
|
-
properties: {
|
|
289
|
-
error: {
|
|
290
|
-
properties: {
|
|
291
|
-
retryable: {
|
|
292
|
-
default: !1
|
|
293
|
-
},
|
|
294
|
-
outcome: {
|
|
295
|
-
default: "not_executed"
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
},
|
|
302
|
-
{
|
|
303
|
-
description: "资源状态冲突",
|
|
304
|
-
"x-httpStatus": 409,
|
|
305
|
-
if: {
|
|
306
|
-
properties: {
|
|
307
|
-
code: {
|
|
308
|
-
const: "CONFLICT"
|
|
309
|
-
}
|
|
310
|
-
},
|
|
311
|
-
required: ["code"]
|
|
312
|
-
},
|
|
313
|
-
then: {
|
|
314
|
-
properties: {
|
|
315
|
-
error: {
|
|
316
|
-
properties: {
|
|
317
|
-
retryable: {
|
|
318
|
-
default: !1
|
|
319
|
-
},
|
|
320
|
-
outcome: {
|
|
321
|
-
default: "not_executed"
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
},
|
|
328
|
-
{
|
|
329
|
-
description: "请求过于频繁,可稍后重试",
|
|
330
|
-
"x-httpStatus": 429,
|
|
331
|
-
if: {
|
|
332
|
-
properties: {
|
|
333
|
-
code: {
|
|
334
|
-
const: "RATE_LIMITED"
|
|
335
|
-
}
|
|
336
|
-
},
|
|
337
|
-
required: ["code"]
|
|
338
|
-
},
|
|
339
|
-
then: {
|
|
340
|
-
properties: {
|
|
341
|
-
error: {
|
|
342
|
-
properties: {
|
|
343
|
-
retryable: {
|
|
344
|
-
default: !0
|
|
345
|
-
},
|
|
346
|
-
outcome: {
|
|
347
|
-
default: "not_executed"
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
},
|
|
354
|
-
{
|
|
355
|
-
description: "服务内部错误,可能已产生副作用",
|
|
356
|
-
"x-httpStatus": 500,
|
|
357
|
-
if: {
|
|
358
|
-
properties: {
|
|
359
|
-
code: {
|
|
360
|
-
const: "INTERNAL_ERROR"
|
|
361
|
-
}
|
|
362
|
-
},
|
|
363
|
-
required: ["code"]
|
|
364
|
-
},
|
|
365
|
-
then: {
|
|
366
|
-
properties: {
|
|
367
|
-
error: {
|
|
368
|
-
properties: {
|
|
369
|
-
retryable: {
|
|
370
|
-
default: !1
|
|
371
|
-
},
|
|
372
|
-
outcome: {
|
|
373
|
-
default: "unknown"
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
}
|
|
379
|
-
},
|
|
380
|
-
{
|
|
381
|
-
description: "一次性列表的结果超出接口声明的上限",
|
|
382
|
-
"x-httpStatus": 500,
|
|
383
|
-
if: {
|
|
384
|
-
properties: {
|
|
385
|
-
code: {
|
|
386
|
-
const: "LIST_LIMIT_EXCEEDED"
|
|
387
|
-
}
|
|
388
|
-
},
|
|
389
|
-
required: ["code"]
|
|
390
|
-
},
|
|
391
|
-
then: {
|
|
392
|
-
properties: {
|
|
393
|
-
error: {
|
|
394
|
-
properties: {
|
|
395
|
-
retryable: {
|
|
396
|
-
default: !1
|
|
397
|
-
},
|
|
398
|
-
outcome: {
|
|
399
|
-
default: "unknown"
|
|
400
|
-
}
|
|
401
|
-
}
|
|
402
|
-
}
|
|
403
|
-
}
|
|
404
|
-
}
|
|
405
|
-
},
|
|
406
|
-
{
|
|
407
|
-
description: "服务或其依赖暂不可用",
|
|
408
|
-
"x-httpStatus": 503,
|
|
409
|
-
if: {
|
|
410
|
-
properties: {
|
|
411
|
-
code: {
|
|
412
|
-
const: "SERVICE_UNAVAILABLE"
|
|
413
|
-
}
|
|
414
|
-
},
|
|
415
|
-
required: ["code"]
|
|
416
|
-
},
|
|
417
|
-
then: {
|
|
418
|
-
properties: {
|
|
419
|
-
error: {
|
|
420
|
-
properties: {
|
|
421
|
-
retryable: {
|
|
422
|
-
default: !0
|
|
423
|
-
},
|
|
424
|
-
outcome: {
|
|
425
|
-
default: "unknown"
|
|
426
|
-
}
|
|
427
|
-
}
|
|
428
|
-
}
|
|
429
|
-
}
|
|
430
|
-
}
|
|
431
|
-
}
|
|
432
|
-
]
|
|
433
|
-
}, r = {
|
|
434
20
|
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
435
21
|
$id: "cursor-list-request.schema.json",
|
|
436
22
|
title: "CursorListRequest",
|
|
@@ -446,14 +32,13 @@ const d = {
|
|
|
446
32
|
maxLength: 1024
|
|
447
33
|
},
|
|
448
34
|
limit: {
|
|
449
|
-
description: "
|
|
35
|
+
description: "本批最多取多少条,至少 1;不带时取多少条、上限多少由接口自己声明。",
|
|
450
36
|
type: "integer",
|
|
451
|
-
minimum: 1
|
|
452
|
-
maximum: 100
|
|
37
|
+
minimum: 1
|
|
453
38
|
}
|
|
454
39
|
},
|
|
455
40
|
additionalProperties: !1
|
|
456
|
-
},
|
|
41
|
+
}, r = {
|
|
457
42
|
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
458
43
|
$id: "cursor-list.schema.json",
|
|
459
44
|
title: "CursorList",
|
|
@@ -507,7 +92,7 @@ const d = {
|
|
|
507
92
|
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
508
93
|
$id: "error-body.schema.json",
|
|
509
94
|
title: "ErrorBody",
|
|
510
|
-
description: "错误体。HTTP 状态表达大类,包体带业务码、说明、能否重试、是否已执行与出错字段定位。
|
|
95
|
+
description: "错误体。HTTP 状态表达大类,包体带业务码、说明、能否重试、是否已执行与出错字段定位。retryable 与 outcome 由服务按实际情形填写,包不替使用方填写;通用失败码表给了一组参考值,使用方可显式引用。",
|
|
511
96
|
type: "object",
|
|
512
97
|
properties: {
|
|
513
98
|
code: {
|
|
@@ -543,11 +128,6 @@ const d = {
|
|
|
543
128
|
},
|
|
544
129
|
required: ["code", "message", "data", "error", "requestId"],
|
|
545
130
|
additionalProperties: !1,
|
|
546
|
-
allOf: [
|
|
547
|
-
{
|
|
548
|
-
$ref: "common-error-codes.schema.json"
|
|
549
|
-
}
|
|
550
|
-
],
|
|
551
131
|
$defs: {
|
|
552
132
|
errorDetail: {
|
|
553
133
|
title: "ErrorDetail",
|
|
@@ -658,7 +238,7 @@ const d = {
|
|
|
658
238
|
additionalProperties: !1
|
|
659
239
|
}
|
|
660
240
|
}
|
|
661
|
-
},
|
|
241
|
+
}, o = {
|
|
662
242
|
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
663
243
|
$id: "paged-list-request.schema.json",
|
|
664
244
|
title: "PagedListRequest",
|
|
@@ -668,17 +248,14 @@ const d = {
|
|
|
668
248
|
type: "object",
|
|
669
249
|
properties: {
|
|
670
250
|
page: {
|
|
671
|
-
description: "页码,从 1
|
|
251
|
+
description: "页码,从 1 开始;不带时的含义由接口自己声明。",
|
|
672
252
|
type: "integer",
|
|
673
|
-
minimum: 1
|
|
674
|
-
default: 1
|
|
253
|
+
minimum: 1
|
|
675
254
|
},
|
|
676
255
|
pageSize: {
|
|
677
|
-
description: "
|
|
256
|
+
description: "每页条数,至少 1;不带时的含义与上限由接口自己声明。",
|
|
678
257
|
type: "integer",
|
|
679
|
-
minimum: 1
|
|
680
|
-
maximum: 100,
|
|
681
|
-
default: 10
|
|
258
|
+
minimum: 1
|
|
682
259
|
},
|
|
683
260
|
query: {
|
|
684
261
|
description: "模糊搜索词,最多 200 个字符。",
|
|
@@ -693,7 +270,7 @@ const d = {
|
|
|
693
270
|
}
|
|
694
271
|
},
|
|
695
272
|
additionalProperties: !1
|
|
696
|
-
},
|
|
273
|
+
}, a = {
|
|
697
274
|
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
698
275
|
$id: "paged-list.schema.json",
|
|
699
276
|
title: "PagedList",
|
|
@@ -724,10 +301,9 @@ const d = {
|
|
|
724
301
|
minimum: 0
|
|
725
302
|
},
|
|
726
303
|
pageSize: {
|
|
727
|
-
description: "
|
|
304
|
+
description: "每页条数,回显请求值,至少 1。",
|
|
728
305
|
type: "integer",
|
|
729
|
-
minimum: 1
|
|
730
|
-
maximum: 100
|
|
306
|
+
minimum: 1
|
|
731
307
|
},
|
|
732
308
|
totalPage: {
|
|
733
309
|
description: "总页数。",
|
|
@@ -755,11 +331,11 @@ const d = {
|
|
|
755
331
|
"x-totalPageEqualsCeil": !0
|
|
756
332
|
}
|
|
757
333
|
}
|
|
758
|
-
},
|
|
334
|
+
}, n = {
|
|
759
335
|
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
760
336
|
$id: "service-error-codes.schema.json",
|
|
761
337
|
title: "ServiceErrorCodes",
|
|
762
|
-
description: "
|
|
338
|
+
description: "一个服务的专有业务码清单。OK 与 HTTP_<数字> 形式的码是结构保留字,不得使用;比较按字节精确进行,不做大小写归一。专有码是否要避开某组通用码由使用方显式检查:把那组码传给参考资源出口的检查函数,不传就不比。",
|
|
763
339
|
type: "object",
|
|
764
340
|
properties: {
|
|
765
341
|
service: {
|
|
@@ -801,11 +377,6 @@ const d = {
|
|
|
801
377
|
type: "string",
|
|
802
378
|
pattern: "^HTTP_[0-9]+$"
|
|
803
379
|
}
|
|
804
|
-
},
|
|
805
|
-
{
|
|
806
|
-
not: {
|
|
807
|
-
$ref: "common-error-codes.schema.json#/$defs/code"
|
|
808
|
-
}
|
|
809
380
|
}
|
|
810
381
|
]
|
|
811
382
|
},
|
|
@@ -870,7 +441,7 @@ const d = {
|
|
|
870
441
|
}
|
|
871
442
|
}
|
|
872
443
|
}
|
|
873
|
-
},
|
|
444
|
+
}, p = {
|
|
874
445
|
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
875
446
|
$id: "success-envelope.schema.json",
|
|
876
447
|
title: "SuccessEnvelope",
|
|
@@ -894,37 +465,27 @@ const d = {
|
|
|
894
465
|
},
|
|
895
466
|
required: ["code", "message", "data"],
|
|
896
467
|
additionalProperties: !1
|
|
897
|
-
},
|
|
468
|
+
}, d = {
|
|
898
469
|
"bounded-list.schema.json": e,
|
|
899
|
-
"
|
|
900
|
-
"cursor-list
|
|
901
|
-
"cursor-list.schema.json": o,
|
|
470
|
+
"cursor-list-request.schema.json": t,
|
|
471
|
+
"cursor-list.schema.json": r,
|
|
902
472
|
"error-body.schema.json": s,
|
|
903
473
|
"list-filter.schema.json": i,
|
|
904
|
-
"paged-list-request.schema.json":
|
|
905
|
-
"paged-list.schema.json":
|
|
906
|
-
"service-error-codes.schema.json":
|
|
907
|
-
"success-envelope.schema.json":
|
|
474
|
+
"paged-list-request.schema.json": o,
|
|
475
|
+
"paged-list.schema.json": a,
|
|
476
|
+
"service-error-codes.schema.json": n,
|
|
477
|
+
"success-envelope.schema.json": p
|
|
908
478
|
};
|
|
909
479
|
export {
|
|
910
|
-
|
|
911
|
-
u as COMMON_ERROR_CODES,
|
|
912
|
-
m as COMMON_ERROR_CODE_TABLE,
|
|
913
|
-
h as CURSOR_LIST_REQUEST_PARAMS,
|
|
914
|
-
E as CURSOR_LIST_RESPONSE_PATHS,
|
|
915
|
-
f as LIST_FILTER_PARAMS,
|
|
916
|
-
g as PAGED_LIST_REQUEST_PARAMS,
|
|
917
|
-
S as PAGED_LIST_RESPONSE_PATHS,
|
|
918
|
-
d as SUCCESS_CODES,
|
|
480
|
+
c as SUCCESS_CODES,
|
|
919
481
|
e as boundedListSchema,
|
|
920
|
-
t as
|
|
921
|
-
r as
|
|
922
|
-
o as cursorListSchema,
|
|
482
|
+
t as cursorListRequestSchema,
|
|
483
|
+
r as cursorListSchema,
|
|
923
484
|
s as errorBodySchema,
|
|
924
485
|
i as listFilterSchema,
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
486
|
+
o as pagedListRequestSchema,
|
|
487
|
+
a as pagedListSchema,
|
|
488
|
+
d as schemas,
|
|
489
|
+
n as serviceErrorCodesSchema,
|
|
490
|
+
p as successEnvelopeSchema
|
|
930
491
|
};
|