@naturalcycles/nodejs-lib 15.47.1 → 15.48.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.
|
@@ -163,6 +163,8 @@ export declare class JsonSchemaObjectBuilder<IN extends AnyObject, OUT extends A
|
|
|
163
163
|
* Extends the current schema with `id`, `created` and `updated` according to NC DB conventions.
|
|
164
164
|
*/
|
|
165
165
|
dbEntity(): JsonSchemaObjectBuilder<any, any, Opt>;
|
|
166
|
+
minProperties(minProperties: number): this;
|
|
167
|
+
maxProperties(maxProperties: number): this;
|
|
166
168
|
}
|
|
167
169
|
export declare class JsonSchemaObjectInferringBuilder<PROPS extends Record<string, JsonSchemaAnyBuilder<any, any, any>>, Opt extends boolean = false> extends JsonSchemaAnyBuilder<Expand<{
|
|
168
170
|
[K in keyof PROPS as PROPS[K] extends JsonSchemaAnyBuilder<any, any, infer IsOpt> ? IsOpt extends true ? never : K : never]: PROPS[K] extends JsonSchemaAnyBuilder<infer IN, any, any> ? IN : never;
|
|
@@ -496,6 +496,14 @@ export class JsonSchemaObjectBuilder extends JsonSchemaAnyBuilder {
|
|
|
496
496
|
updated: j.number().unixTimestamp2000(),
|
|
497
497
|
});
|
|
498
498
|
}
|
|
499
|
+
minProperties(minProperties) {
|
|
500
|
+
Object.assign(this.schema, { minProperties });
|
|
501
|
+
return this;
|
|
502
|
+
}
|
|
503
|
+
maxProperties(maxProperties) {
|
|
504
|
+
Object.assign(this.schema, { maxProperties });
|
|
505
|
+
return this;
|
|
506
|
+
}
|
|
499
507
|
}
|
|
500
508
|
export class JsonSchemaObjectInferringBuilder extends JsonSchemaAnyBuilder {
|
|
501
509
|
constructor(props) {
|
package/package.json
CHANGED
|
@@ -672,6 +672,16 @@ export class JsonSchemaObjectBuilder<
|
|
|
672
672
|
updated: j.number().unixTimestamp2000(),
|
|
673
673
|
})
|
|
674
674
|
}
|
|
675
|
+
|
|
676
|
+
minProperties(minProperties: number): this {
|
|
677
|
+
Object.assign(this.schema, { minProperties })
|
|
678
|
+
return this
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
maxProperties(maxProperties: number): this {
|
|
682
|
+
Object.assign(this.schema, { maxProperties })
|
|
683
|
+
return this
|
|
684
|
+
}
|
|
675
685
|
}
|
|
676
686
|
|
|
677
687
|
export class JsonSchemaObjectInferringBuilder<
|