@sanity/schema 6.13.1 → 6.13.2-next.3

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.
@@ -11,7 +11,7 @@ type Scheduler = {
11
11
  forEachIter<T>(iter: Iterable<T>, fn: (val: T) => void): Promise<void>;
12
12
  };
13
13
  type RegistryType = 'sanity.schema.registry';
14
- declare class DescriptorConverter {
14
+ export declare class DescriptorConverter {
15
15
  cache: WeakMap<Schema, SetSynchronization<RegistryType>>;
16
16
  /**
17
17
  * Returns a synchronization object for a schema.
@@ -37,7 +37,7 @@ type SchemaSynchronizationResult = SynchronizationResult;
37
37
  * @param response - The previous response, or `null` if it's the first request.
38
38
  * @returns The next request, or `null` if it's been fully synchronized.
39
39
  */
40
- declare function processSchemaSynchronization(sync: SetSynchronization<RegistryType>, response: SchemaSynchronizationResult | null): SchemaSynchronizationRequest | null;
40
+ export declare function processSchemaSynchronization(sync: SetSynchronization<RegistryType>, response: SchemaSynchronizationResult | null): SchemaSynchronizationRequest | null;
41
41
  /**
42
42
  * Headers applied to each request.
43
43
  *
@@ -177,7 +177,7 @@ interface PreparedSchemaUpload {
177
177
  *
178
178
  * @internal
179
179
  */
180
- declare function prepareSchemaUpload(schema: Schema, options: PrepareSchemaUploadOptions): Promise<PreparedSchemaUpload>;
180
+ export declare function prepareSchemaUpload(schema: Schema, options: PrepareSchemaUploadOptions): Promise<PreparedSchemaUpload>;
181
181
  /**
182
182
  * Convert a Sanity schema to a descriptor set and upload it permanently:
183
183
  * permanently claim the id, run the synchronization loop until complete, then
@@ -190,16 +190,16 @@ declare function prepareSchemaUpload(schema: Schema, options: PrepareSchemaUploa
190
190
  *
191
191
  * @internal
192
192
  */
193
- declare function uploadSchema(schema: Schema, options: UploadSchemaOptions): Promise<string>;
194
- declare const isActionEnabled: (schemaType: SchemaType, action: string) => boolean;
195
- declare const DEFAULT_MAX_FIELD_DEPTH = 5;
196
- declare function resolveSearchConfigForBaseFieldPaths(type: any, maxDepth?: number): any;
193
+ export declare function uploadSchema(schema: Schema, options: UploadSchemaOptions): Promise<string>;
194
+ export declare const isActionEnabled: (schemaType: SchemaType, action: string) => boolean;
195
+ export declare const DEFAULT_MAX_FIELD_DEPTH = 5;
196
+ export declare function resolveSearchConfigForBaseFieldPaths(type: any, maxDepth?: number): any;
197
197
  /**
198
198
  * @internal
199
199
  */
200
- declare function resolveSearchConfig(type: any, maxDepth?: number): any;
201
- declare const ALL_FIELDS_GROUP_NAME = "all-fields";
202
- declare function createSchemaFromManifestTypes(schemaDef: {
200
+ export declare function resolveSearchConfig(type: any, maxDepth?: number): any;
201
+ export declare const ALL_FIELDS_GROUP_NAME = "all-fields";
202
+ export declare function createSchemaFromManifestTypes(schemaDef: {
203
203
  name: string;
204
204
  types: unknown[];
205
205
  }): Schema$1;
@@ -344,15 +344,15 @@ type IconResolver = (props: {
344
344
  title: string;
345
345
  subtitle?: string;
346
346
  }) => string | undefined | Promise<string | undefined>;
347
- declare function extractCreateWorkspaceManifest(workspace: ManifestWorkspaceInput, iconResolver?: IconResolver): Promise<CreateWorkspaceManifest>;
347
+ export declare function extractCreateWorkspaceManifest(workspace: ManifestWorkspaceInput, iconResolver?: IconResolver): Promise<CreateWorkspaceManifest>;
348
348
  /**
349
349
  * Extracts all serializable properties from userland schema types,
350
350
  * so they best-effort can be used as definitions for Schema.compile
351
351
  . */
352
- declare function extractManifestSchemaTypes(schema: Schema): ManifestSchemaType[];
353
- declare const validForNamesChars = "a-zA-Z0-9_-";
354
- declare const validForNamesPattern: RegExp;
355
- declare function getWorkspaceSchemaId(args: {
352
+ export declare function extractManifestSchemaTypes(schema: Schema): ManifestSchemaType[];
353
+ export declare const validForNamesChars = "a-zA-Z0-9_-";
354
+ export declare const validForNamesPattern: RegExp;
355
+ export declare function getWorkspaceSchemaId(args: {
356
356
  workspaceName: string;
357
357
  tag?: string;
358
358
  }): {
@@ -364,8 +364,8 @@ interface ParsedWorkspaceSchemaId {
364
364
  schemaId: string;
365
365
  workspace: string;
366
366
  }
367
- declare function parseWorkspaceSchemaId(id: string, errors: string[]): ParsedWorkspaceSchemaId | undefined;
368
- declare function createStoredWorkspaceSchemaPayload(args: {
367
+ export declare function parseWorkspaceSchemaId(id: string, errors: string[]): ParsedWorkspaceSchemaId | undefined;
368
+ export declare function createStoredWorkspaceSchemaPayload(args: {
369
369
  workspace: {
370
370
  name: string;
371
371
  title?: string;
@@ -373,7 +373,7 @@ declare function createStoredWorkspaceSchemaPayload(args: {
373
373
  schema: ManifestSchemaType[];
374
374
  tag?: string;
375
375
  }): Omit<StoredWorkspaceSchema, '_id' | '_type'>;
376
- declare const builtinTypes: ({
376
+ export declare const builtinTypes: ({
377
377
  name: string;
378
378
  title: string;
379
379
  type: string;
@@ -387,17 +387,17 @@ declare const builtinTypes: ({
387
387
  type: string;
388
388
  title: string;
389
389
  readOnly: boolean;
390
- fieldset?: undefined;
391
390
  validation?: undefined;
392
391
  hidden?: undefined;
392
+ fieldset?: undefined;
393
393
  } | {
394
394
  name: string;
395
395
  type: string;
396
396
  title: string;
397
- fieldset?: undefined;
398
- readOnly?: undefined;
399
397
  validation?: undefined;
400
398
  hidden?: undefined;
399
+ readOnly?: undefined;
400
+ fieldset?: undefined;
401
401
  } | {
402
402
  name: string;
403
403
  type: string;
@@ -412,8 +412,8 @@ declare const builtinTypes: ({
412
412
  readOnly: boolean;
413
413
  hidden: boolean;
414
414
  fieldset: string;
415
- title?: undefined;
416
415
  validation?: undefined;
416
+ title?: undefined;
417
417
  } | {
418
418
  name: string;
419
419
  type: string;
@@ -466,17 +466,17 @@ declare const builtinTypes: ({
466
466
  type: string;
467
467
  title: string;
468
468
  readOnly: boolean;
469
- fieldset?: undefined;
470
469
  validation?: undefined;
471
470
  hidden?: undefined;
471
+ fieldset?: undefined;
472
472
  } | {
473
473
  name: string;
474
474
  type: string;
475
475
  title: string;
476
- fieldset?: undefined;
477
- readOnly?: undefined;
478
476
  validation?: undefined;
479
477
  hidden?: undefined;
478
+ readOnly?: undefined;
479
+ fieldset?: undefined;
480
480
  } | {
481
481
  name: string;
482
482
  type: string;
@@ -486,21 +486,21 @@ declare const builtinTypes: ({
486
486
  validation: (Rule: import("@sanity/types").Rule) => import("@sanity/types").Rule;
487
487
  hidden?: undefined;
488
488
  } | {
489
+ validation?: undefined;
489
490
  name: string;
490
491
  type: string;
491
492
  readOnly: boolean;
492
493
  hidden: boolean;
493
494
  fieldset: string;
494
495
  title?: undefined;
495
- validation?: undefined;
496
496
  } | {
497
+ validation?: undefined;
498
+ hidden?: undefined;
497
499
  name: string;
498
500
  type: string;
499
501
  title: string;
500
502
  readOnly: boolean;
501
503
  fieldset: string;
502
- validation?: undefined;
503
- hidden?: undefined;
504
504
  })[];
505
505
  preview: {
506
506
  select: {
@@ -550,17 +550,17 @@ declare const builtinTypes: ({
550
550
  };
551
551
  }[];
552
552
  fields: ({
553
- name: string;
554
- type: string;
555
- fieldset?: undefined;
556
553
  title?: undefined;
557
554
  readOnly?: undefined;
555
+ fieldset?: undefined;
556
+ name: string;
557
+ type: string;
558
558
  } | {
559
+ readOnly?: undefined;
559
560
  name: string;
560
561
  title: string;
561
562
  type: string;
562
563
  fieldset: string;
563
- readOnly?: undefined;
564
564
  } | {
565
565
  fieldset?: undefined;
566
566
  name: string;
@@ -585,17 +585,17 @@ interface ExtractSchemaOptions {
585
585
  * 3. **Main type conversion**: Processes each schema type in dependency order. When a field was marked for
586
586
  * hoisting, we emit an `inline` reference to the hoisted type instead of duplicating the structure.
587
587
  */
588
- declare function extractSchema(schemaDef: Schema, extractOptions?: ExtractSchemaOptions): SchemaType$1;
588
+ export declare function extractSchema(schemaDef: Schema, extractOptions?: ExtractSchemaOptions): SchemaType$1;
589
589
  /**
590
590
  * @internal
591
591
  */
592
- declare function groupProblems(types: SchemaTypeDefinition[]): SchemaValidationProblemGroup[];
592
+ export declare function groupProblems(types: SchemaTypeDefinition[]): SchemaValidationProblemGroup[];
593
593
  /**
594
594
  * Ensure that the provided value is a valid Media Library asset aspect that can be safely deployed.
595
595
  *
596
596
  * @internal
597
597
  */
598
- declare function validateMediaLibraryAssetAspect(maybeAspect: unknown): [isValidMediaLibraryAspect: boolean, validationErrors: SchemaValidationProblem[][]];
598
+ export declare function validateMediaLibraryAssetAspect(maybeAspect: unknown): [isValidMediaLibraryAspect: boolean, validationErrors: SchemaValidationProblem[][]];
599
599
  declare function validateBlockType(typeDef: any, visitorContext: any): {
600
600
  marks: any;
601
601
  styles: any;
@@ -622,16 +622,16 @@ interface Options {
622
622
  /**
623
623
  * @internal
624
624
  */
625
- declare function validateSchema(schemaTypes: _FIXME_, { transformTypeVisitors, transformCommonVisitors }?: Options): {
625
+ export declare function validateSchema(schemaTypes: _FIXME_, { transformTypeVisitors, transformCommonVisitors }?: Options): {
626
626
  get(typeName: string): any;
627
627
  has(typeName: string): boolean;
628
628
  getTypeNames(): string[];
629
629
  getTypes(): any[];
630
630
  toJSON(): any[];
631
631
  };
632
- declare class ValidationError extends Error {
632
+ export declare class ValidationError extends Error {
633
633
  problems: SchemaValidationProblemGroup[];
634
634
  constructor(problems: SchemaValidationProblemGroup[]);
635
635
  }
636
- export { ALL_FIELDS_GROUP_NAME, type CreateManifest, type CreateWorkspaceManifest, DEFAULT_MAX_FIELD_DEPTH, type DefaultWorkspaceSchemaId, DescriptorConverter, type DescriptorRequester, type _FIXME_ as FIXME, type IconResolver, type ManifestSchemaType, type ManifestWorkspaceFile, type ParsedWorkspaceSchemaId, type PrepareSchemaUploadOptions, type PreparedSchemaUpload, type SchemaValidationResult as Problem, type SchemaValidationResult as ValidationResult, type ProblemPath, type ProblemPathPropertySegment, type ProblemPathSegment, type ProblemPathTypeSegment, type SchemaSynchronizationRequest, type SchemaSynchronizationResult, type StoredWorkspaceSchema, type TypeWithProblems, type UploadSchemaOptions, type UploadSchemaPhase, ValidationError, type WorkspaceSchemaId, builtinTypes, createSchemaFromManifestTypes, createStoredWorkspaceSchemaPayload, extractCreateWorkspaceManifest, extractManifestSchemaTypes, extractSchema, getWorkspaceSchemaId, groupProblems, isActionEnabled, parseWorkspaceSchemaId, prepareSchemaUpload, processSchemaSynchronization, resolveSearchConfig, resolveSearchConfigForBaseFieldPaths, uploadSchema, validForNamesChars, validForNamesPattern, validateMediaLibraryAssetAspect, validateSchema };
636
+ export type { CreateManifest, CreateWorkspaceManifest, DefaultWorkspaceSchemaId, DescriptorRequester, _FIXME_ as FIXME, IconResolver, ManifestSchemaType, ManifestWorkspaceFile, ParsedWorkspaceSchemaId, PrepareSchemaUploadOptions, PreparedSchemaUpload, SchemaValidationResult as Problem, SchemaValidationResult as ValidationResult, ProblemPath, ProblemPathPropertySegment, ProblemPathSegment, ProblemPathTypeSegment, SchemaSynchronizationRequest, SchemaSynchronizationResult, StoredWorkspaceSchema, TypeWithProblems, UploadSchemaOptions, UploadSchemaPhase, WorkspaceSchemaId };
637
637
  //# sourceMappingURL=_internal.d.ts.map