fix(coding): tighten Pi Data Service schemas

This commit is contained in:
2026-08-26 20:03:07 +08:00
parent 1d63233cd0
commit f61990f3a7
3 changed files with 28 additions and 5 deletions

View File

@@ -327,7 +327,10 @@ export default function makeloreRuntime(pi) {
type: 'object', additionalProperties: false, required: ['collection', 'document_id'],
properties: {
collection: { type: 'string', minLength: 1, maxLength: 48, pattern: '^[a-z][a-z0-9_-]{0,47}$' },
document_id: { type: 'string', minLength: 1, maxLength: 128, pattern: '^[A-Za-z0-9._~-]{1,128}$' },
document_id: {
type: 'string', minLength: 1, maxLength: 128, pattern: '^[A-Za-z0-9._~-]{1,128}$',
not: { enum: ['.', '..'] },
},
},
},
);
@@ -355,9 +358,12 @@ export default function makeloreRuntime(pi) {
required: ['collection', 'document_id', 'data'],
properties: {
collection: { type: 'string', minLength: 1, maxLength: 48, pattern: '^[a-z][a-z0-9_-]{0,47}$' },
document_id: { type: 'string', minLength: 1, maxLength: 128, pattern: '^[A-Za-z0-9._~-]{1,128}$' },
document_id: {
type: 'string', minLength: 1, maxLength: 128, pattern: '^[A-Za-z0-9._~-]{1,128}$',
not: { enum: ['.', '..'] },
},
data: { type: 'object' },
if_revision: { type: 'integer', minimum: 1 },
if_revision: { type: 'integer', minimum: 1, maximum: 9007199254740991 },
},
},
);
@@ -371,8 +377,11 @@ export default function makeloreRuntime(pi) {
required: ['collection', 'document_id', 'confirmed'],
properties: {
collection: { type: 'string', minLength: 1, maxLength: 48, pattern: '^[a-z][a-z0-9_-]{0,47}$' },
document_id: { type: 'string', minLength: 1, maxLength: 128, pattern: '^[A-Za-z0-9._~-]{1,128}$' },
if_revision: { type: 'integer', minimum: 1 },
document_id: {
type: 'string', minLength: 1, maxLength: 128, pattern: '^[A-Za-z0-9._~-]{1,128}$',
not: { enum: ['.', '..'] },
},
if_revision: { type: 'integer', minimum: 1, maximum: 9007199254740991 },
confirmed: { type: 'boolean', const: true },
},
},