@sprucelabs/schema 32.3.8 → 32.3.9

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.
@@ -28,6 +28,7 @@ export interface StaticSchemaEntity<S extends Schema> extends SchemaEntity {
28
28
  validate(options?: SchemaValidateOptions<S>): void;
29
29
  isValid(options?: SchemaValidateOptions<S>): boolean;
30
30
  }
31
+ /** @ts-ignore */
31
32
  export type SchemaValues<S extends Schema, CreateEntityInstances extends boolean = false, IncludePrivateFields extends boolean = true, ShouldIncludeNullAndUndefinedFields extends boolean = false, F extends SchemaFieldNames<S> = SchemaFieldNames<S>, PF extends SchemaPublicFieldNames<S> = SchemaPublicFieldNames<S>> = IsDynamicSchema<S> extends true ? DynamicSchemaAllValues<S> : IncludePrivateFields extends false ? ShouldIncludeNullAndUndefinedFields extends true ? Pick<SchemaAllValues<S, CreateEntityInstances>, PF> : Pick<SchemaStaticValues<S, CreateEntityInstances>, PF> : ShouldIncludeNullAndUndefinedFields extends true ? Pick<SchemaAllValues<S, CreateEntityInstances>, F> : Pick<SchemaStaticValues<S, CreateEntityInstances>, F>;
32
33
  export interface DynamicSchemaEntityByName<ISchema extends Schema, OurField extends Field<any> = ISchema['dynamicFieldSignature'] extends FieldDefinitions ? FieldMap[ISchema['dynamicFieldSignature']['type']] : any> extends SchemaEntity, Omit<StaticSchemaEntity<ISchema>, 'get' | 'set' | 'getValues' | 'setValues' | 'getNamedFields' | 'schemaId' | 'namespace' | 'name' | 'version' | 'description'> {
33
34
  get<F extends string, CreateEntityInstances extends boolean = true>(fieldName: F, options?: DynamicSchemaNormalizeOptions<CreateEntityInstances>): FieldDefinitionValueType<OurField, CreateEntityInstances>;
@@ -47,7 +48,7 @@ export interface Schema {
47
48
  description?: string;
48
49
  importsWhenLocal?: string[];
49
50
  importsWhenRemote?: string[];
50
- moduleToImportFromWhenRemote?: string | SchemaImport;
51
+ moduleToImportFromWhenRemote?: string;
51
52
  typeSuffix?: string;
52
53
  dynamicFieldSignature?: FieldDefinitions & {
53
54
  keyName: string;
@@ -56,10 +57,6 @@ export interface Schema {
56
57
  fields?: SchemaFieldsByName;
57
58
  }
58
59
  export type SchemaSupportedLanguages = 'ts' | 'go';
59
- export interface SchemaImport {
60
- language: SchemaSupportedLanguages;
61
- module: string;
62
- }
63
60
  export interface SchemaFieldValueUnion<V extends Record<string, any> = Record<string, any>, Id extends string = string, Version extends string | undefined = undefined> {
64
61
  id: Id;
65
62
  version?: Version;
@@ -28,6 +28,7 @@ export interface StaticSchemaEntity<S extends Schema> extends SchemaEntity {
28
28
  validate(options?: SchemaValidateOptions<S>): void;
29
29
  isValid(options?: SchemaValidateOptions<S>): boolean;
30
30
  }
31
+ /** @ts-ignore */
31
32
  export type SchemaValues<S extends Schema, CreateEntityInstances extends boolean = false, IncludePrivateFields extends boolean = true, ShouldIncludeNullAndUndefinedFields extends boolean = false, F extends SchemaFieldNames<S> = SchemaFieldNames<S>, PF extends SchemaPublicFieldNames<S> = SchemaPublicFieldNames<S>> = IsDynamicSchema<S> extends true ? DynamicSchemaAllValues<S> : IncludePrivateFields extends false ? ShouldIncludeNullAndUndefinedFields extends true ? Pick<SchemaAllValues<S, CreateEntityInstances>, PF> : Pick<SchemaStaticValues<S, CreateEntityInstances>, PF> : ShouldIncludeNullAndUndefinedFields extends true ? Pick<SchemaAllValues<S, CreateEntityInstances>, F> : Pick<SchemaStaticValues<S, CreateEntityInstances>, F>;
32
33
  export interface DynamicSchemaEntityByName<ISchema extends Schema, OurField extends Field<any> = ISchema['dynamicFieldSignature'] extends FieldDefinitions ? FieldMap[ISchema['dynamicFieldSignature']['type']] : any> extends SchemaEntity, Omit<StaticSchemaEntity<ISchema>, 'get' | 'set' | 'getValues' | 'setValues' | 'getNamedFields' | 'schemaId' | 'namespace' | 'name' | 'version' | 'description'> {
33
34
  get<F extends string, CreateEntityInstances extends boolean = true>(fieldName: F, options?: DynamicSchemaNormalizeOptions<CreateEntityInstances>): FieldDefinitionValueType<OurField, CreateEntityInstances>;
@@ -47,7 +48,7 @@ export interface Schema {
47
48
  description?: string;
48
49
  importsWhenLocal?: string[];
49
50
  importsWhenRemote?: string[];
50
- moduleToImportFromWhenRemote?: string | SchemaImport;
51
+ moduleToImportFromWhenRemote?: string;
51
52
  typeSuffix?: string;
52
53
  dynamicFieldSignature?: FieldDefinitions & {
53
54
  keyName: string;
@@ -56,10 +57,6 @@ export interface Schema {
56
57
  fields?: SchemaFieldsByName;
57
58
  }
58
59
  export type SchemaSupportedLanguages = 'ts' | 'go';
59
- export interface SchemaImport {
60
- language: SchemaSupportedLanguages;
61
- module: string;
62
- }
63
60
  export interface SchemaFieldValueUnion<V extends Record<string, any> = Record<string, any>, Id extends string = string, Version extends string | undefined = undefined> {
64
61
  id: Id;
65
62
  version?: Version;
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "!build/__tests__",
9
9
  "esm"
10
10
  ],
11
- "version": "32.3.8",
11
+ "version": "32.3.9",
12
12
  "main": "./build/index.js",
13
13
  "types": "./build/index.d.ts",
14
14
  "module": "./build/esm/index.js",