@sanity/schema 6.13.1 → 6.13.2-next.18
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/lib/_internal.d.ts +30 -30
- package/lib/_internal.js.map +1 -1
- package/lib/index.d.ts +7 -7
- package/package.json +5 -5
package/lib/_internal.d.ts
CHANGED
|
@@ -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;
|
|
@@ -394,8 +394,8 @@ declare const builtinTypes: ({
|
|
|
394
394
|
name: string;
|
|
395
395
|
type: string;
|
|
396
396
|
title: string;
|
|
397
|
-
fieldset?: undefined;
|
|
398
397
|
readOnly?: undefined;
|
|
398
|
+
fieldset?: undefined;
|
|
399
399
|
validation?: undefined;
|
|
400
400
|
hidden?: undefined;
|
|
401
401
|
} | {
|
|
@@ -473,8 +473,8 @@ declare const builtinTypes: ({
|
|
|
473
473
|
name: string;
|
|
474
474
|
type: string;
|
|
475
475
|
title: string;
|
|
476
|
-
fieldset?: undefined;
|
|
477
476
|
readOnly?: undefined;
|
|
477
|
+
fieldset?: undefined;
|
|
478
478
|
validation?: undefined;
|
|
479
479
|
hidden?: undefined;
|
|
480
480
|
} | {
|
|
@@ -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 {
|
|
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
|