@sanity/types 5.0.0-next.0-9b570ece82-202507150640 → 5.0.0-next.7
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/LICENSE +1 -1
- package/lib/index.d.ts +145 -31
- package/lib/index.js +62 -61
- package/lib/index.js.map +1 -1
- package/package.json +18 -17
- package/lib/index.d.mts +0 -3893
- package/lib/index.mjs +0 -265
- package/lib/index.mjs.map +0 -1
package/LICENSE
CHANGED
package/lib/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import {ComponentType} from 'react'
|
|
|
5
5
|
import {ElementType} from 'react'
|
|
6
6
|
import {ReactNode} from 'react'
|
|
7
7
|
import {SanityClient} from '@sanity/client'
|
|
8
|
+
import {StackablePerspective} from '@sanity/client'
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* Types of array actions that can be performed
|
|
@@ -58,8 +59,7 @@ export declare type ArrayOfType<
|
|
|
58
59
|
|
|
59
60
|
/** @public */
|
|
60
61
|
export declare interface ArrayOptions<V = unknown>
|
|
61
|
-
extends SearchConfiguration,
|
|
62
|
-
BaseSchemaTypeOptions {
|
|
62
|
+
extends SearchConfiguration, BaseSchemaTypeOptions {
|
|
63
63
|
list?: TitledListValue<V>[] | V[]
|
|
64
64
|
layout?: 'list' | 'tags' | 'grid'
|
|
65
65
|
/** @deprecated This option does not have any effect anymore */
|
|
@@ -300,7 +300,7 @@ export declare interface AssetSourceUploadFile {
|
|
|
300
300
|
id: string
|
|
301
301
|
file: globalThis.File
|
|
302
302
|
progress: number
|
|
303
|
-
status: 'pending' | 'uploading' | 'complete' | 'error' | 'aborted'
|
|
303
|
+
status: 'pending' | 'uploading' | 'complete' | 'error' | 'aborted' | 'alreadyExists'
|
|
304
304
|
error?: Error
|
|
305
305
|
result?: unknown
|
|
306
306
|
}
|
|
@@ -444,7 +444,7 @@ export declare type BlockChildrenObjectField = {
|
|
|
444
444
|
* {title: 'Strong', value: 'strong'},
|
|
445
445
|
* {title: 'Emphasis', value: 'em'},
|
|
446
446
|
* {title: 'Underline', value: 'underline'},
|
|
447
|
-
* {title: 'Strike', value: 'strike'},
|
|
447
|
+
* {title: 'Strike', value: 'strike-through'},
|
|
448
448
|
* {title: 'Code', value: 'code'},
|
|
449
449
|
* ]
|
|
450
450
|
* }
|
|
@@ -478,7 +478,7 @@ export declare interface BlockDecoratorDefinition {
|
|
|
478
478
|
* {title: 'Strong', value: 'strong'},
|
|
479
479
|
* {title: 'Emphasis', value: 'em'},
|
|
480
480
|
* {title: 'Underline', value: 'underline'},
|
|
481
|
-
* {title: 'Strike', value: 'strike'},
|
|
481
|
+
* {title: 'Strike', value: 'strike-through'},
|
|
482
482
|
* {title: 'Code', value: 'code'},
|
|
483
483
|
* ],
|
|
484
484
|
* annotations: [
|
|
@@ -717,6 +717,18 @@ export declare interface CanvasAppOptions {
|
|
|
717
717
|
purpose?: string
|
|
718
718
|
}
|
|
719
719
|
|
|
720
|
+
/**
|
|
721
|
+
* @internal
|
|
722
|
+
* Payload that will be passed by canvas to our notifications system to display the notification in canvas.
|
|
723
|
+
* */
|
|
724
|
+
export declare interface CanvasNotificationPayload extends DashboardNotificationPayload {
|
|
725
|
+
applicationType: 'canvas'
|
|
726
|
+
link: {
|
|
727
|
+
type: 'dashboard'
|
|
728
|
+
path: string
|
|
729
|
+
}
|
|
730
|
+
}
|
|
731
|
+
|
|
720
732
|
/** @public */
|
|
721
733
|
export declare interface CollapseOptions {
|
|
722
734
|
collapsed?: boolean
|
|
@@ -908,6 +920,34 @@ export declare type CustomValidatorResult =
|
|
|
908
920
|
| ValidationError[]
|
|
909
921
|
| LocalizedValidationMessages
|
|
910
922
|
|
|
923
|
+
/**
|
|
924
|
+
* @internal
|
|
925
|
+
* Payload notifications have to provide to the notification system in order to display correctly in dashboard
|
|
926
|
+
*/
|
|
927
|
+
export declare interface DashboardNotificationPayload {
|
|
928
|
+
version: '1.0.0'
|
|
929
|
+
applicationType: string
|
|
930
|
+
createdAt: string
|
|
931
|
+
/**
|
|
932
|
+
* The user who took the action which triggered the notification.
|
|
933
|
+
*/
|
|
934
|
+
actor: User
|
|
935
|
+
title: PortableTextBlock[]
|
|
936
|
+
body: PortableTextBlock[] | undefined
|
|
937
|
+
organizationId: string
|
|
938
|
+
applicationId?: string
|
|
939
|
+
workspaceName?: string
|
|
940
|
+
link:
|
|
941
|
+
| {
|
|
942
|
+
type: 'url'
|
|
943
|
+
url: string
|
|
944
|
+
}
|
|
945
|
+
| {
|
|
946
|
+
type: 'dashboard'
|
|
947
|
+
path: string
|
|
948
|
+
}
|
|
949
|
+
}
|
|
950
|
+
|
|
911
951
|
/** @public */
|
|
912
952
|
export declare interface DateDefinition extends BaseSchemaDefinition {
|
|
913
953
|
type: 'date'
|
|
@@ -1445,8 +1485,10 @@ export declare interface FileAsset extends Asset {
|
|
|
1445
1485
|
}
|
|
1446
1486
|
|
|
1447
1487
|
/** @public */
|
|
1448
|
-
export declare interface FileDefinition
|
|
1449
|
-
|
|
1488
|
+
export declare interface FileDefinition extends Omit<
|
|
1489
|
+
ObjectDefinition,
|
|
1490
|
+
'type' | 'fields' | 'options' | 'groups' | 'validation'
|
|
1491
|
+
> {
|
|
1450
1492
|
type: 'file'
|
|
1451
1493
|
fields?: ObjectDefinition['fields']
|
|
1452
1494
|
options?: FileOptions
|
|
@@ -1459,6 +1501,7 @@ export declare interface FileOptions extends ObjectOptions {
|
|
|
1459
1501
|
storeOriginalFilename?: boolean
|
|
1460
1502
|
accept?: string
|
|
1461
1503
|
sources?: AssetSource[]
|
|
1504
|
+
mediaLibrary?: MediaLibraryOptions
|
|
1462
1505
|
}
|
|
1463
1506
|
|
|
1464
1507
|
/** @public */
|
|
@@ -1570,8 +1613,10 @@ export declare type GlobalDocumentReferenceFilterSearchOptions = {
|
|
|
1570
1613
|
}
|
|
1571
1614
|
|
|
1572
1615
|
/** @beta */
|
|
1573
|
-
export declare interface GlobalDocumentReferenceSchemaType
|
|
1574
|
-
|
|
1616
|
+
export declare interface GlobalDocumentReferenceSchemaType extends Omit<
|
|
1617
|
+
ObjectSchemaType,
|
|
1618
|
+
'options'
|
|
1619
|
+
> {
|
|
1575
1620
|
jsonType: 'object'
|
|
1576
1621
|
to: GlobalDocumentReferenceType[]
|
|
1577
1622
|
resourceType: string
|
|
@@ -1656,8 +1701,10 @@ export declare interface ImageCrop {
|
|
|
1656
1701
|
}
|
|
1657
1702
|
|
|
1658
1703
|
/** @public */
|
|
1659
|
-
export declare interface ImageDefinition
|
|
1660
|
-
|
|
1704
|
+
export declare interface ImageDefinition extends Omit<
|
|
1705
|
+
ObjectDefinition,
|
|
1706
|
+
'type' | 'fields' | 'options' | 'groups' | 'validation'
|
|
1707
|
+
> {
|
|
1661
1708
|
type: 'image'
|
|
1662
1709
|
fields?: FieldDefinition[]
|
|
1663
1710
|
options?: ImageOptions
|
|
@@ -1863,24 +1910,28 @@ export declare interface InsertMenuOptions {
|
|
|
1863
1910
|
* `filter: 'auto'` automatically turns on filtering if there are more than 5
|
|
1864
1911
|
* schema types added to the menu.
|
|
1865
1912
|
*/
|
|
1866
|
-
filter?: 'auto' | boolean
|
|
1867
|
-
groups?:
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1913
|
+
filter?: 'auto' | boolean | undefined
|
|
1914
|
+
groups?:
|
|
1915
|
+
| Array<{
|
|
1916
|
+
name: string
|
|
1917
|
+
title?: string
|
|
1918
|
+
of?: Array<string>
|
|
1919
|
+
}>
|
|
1920
|
+
| undefined
|
|
1872
1921
|
/** defaultValue `true` */
|
|
1873
|
-
showIcons?: boolean
|
|
1922
|
+
showIcons?: boolean | undefined
|
|
1874
1923
|
/** @defaultValue `[{name: 'list'}]` */
|
|
1875
|
-
views?:
|
|
1876
|
-
|
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1924
|
+
views?:
|
|
1925
|
+
| Array<
|
|
1926
|
+
| {
|
|
1927
|
+
name: 'list'
|
|
1928
|
+
}
|
|
1929
|
+
| {
|
|
1930
|
+
name: 'grid'
|
|
1931
|
+
previewImageUrl?: (schemaTypeName: string) => string | undefined
|
|
1932
|
+
}
|
|
1933
|
+
>
|
|
1934
|
+
| undefined
|
|
1884
1935
|
}
|
|
1885
1936
|
|
|
1886
1937
|
/** @internal */
|
|
@@ -2284,6 +2335,7 @@ export declare type MediaAssetTypes = AssetInstanceDocument['_type']
|
|
|
2284
2335
|
export declare type MediaLibraryAssetAspectDefinition =
|
|
2285
2336
|
MediaLibraryAssetAspectSupportedFieldDefinitions & {
|
|
2286
2337
|
assetType?: MediaLibraryAssetType | MediaLibraryAssetType[]
|
|
2338
|
+
public?: boolean
|
|
2287
2339
|
}
|
|
2288
2340
|
|
|
2289
2341
|
/**
|
|
@@ -2302,6 +2354,7 @@ export declare interface MediaLibraryAssetAspectDocument extends SanityDocumentL
|
|
|
2302
2354
|
*/
|
|
2303
2355
|
assetType?: MediaLibraryAssetType[]
|
|
2304
2356
|
definition: FieldDefinition
|
|
2357
|
+
public?: boolean
|
|
2305
2358
|
}
|
|
2306
2359
|
|
|
2307
2360
|
/**
|
|
@@ -2321,6 +2374,17 @@ export declare type MediaLibraryAssetAspectTypeName = typeof MEDIA_LIBRARY_ASSET
|
|
|
2321
2374
|
*/
|
|
2322
2375
|
export declare type MediaLibraryAssetType = ImageAsset['_type'] | FileAsset['_type']
|
|
2323
2376
|
|
|
2377
|
+
/** @public */
|
|
2378
|
+
export declare interface MediaLibraryFilter {
|
|
2379
|
+
name: string
|
|
2380
|
+
query: string
|
|
2381
|
+
}
|
|
2382
|
+
|
|
2383
|
+
/** @public */
|
|
2384
|
+
export declare interface MediaLibraryOptions {
|
|
2385
|
+
filters?: MediaLibraryFilter[]
|
|
2386
|
+
}
|
|
2387
|
+
|
|
2324
2388
|
/** @public */
|
|
2325
2389
|
export declare interface MediaValidationValue<T extends MediaAssetTypes = MediaAssetTypes> {
|
|
2326
2390
|
/**
|
|
@@ -2707,6 +2771,7 @@ export declare interface ReferenceFilterResolverContext {
|
|
|
2707
2771
|
document: SanityDocument
|
|
2708
2772
|
parent?: Record<string, unknown> | Record<string, unknown>[]
|
|
2709
2773
|
parentPath: Path
|
|
2774
|
+
perspective: StackablePerspective[]
|
|
2710
2775
|
getClient: (options: {apiVersion: string}) => SanityClient
|
|
2711
2776
|
}
|
|
2712
2777
|
|
|
@@ -2723,7 +2788,7 @@ export declare type ReferenceFilterSearchOptions = {
|
|
|
2723
2788
|
tag?: string
|
|
2724
2789
|
maxFieldDepth?: number
|
|
2725
2790
|
strategy?: SearchStrategy
|
|
2726
|
-
perspective?: ClientPerspective
|
|
2791
|
+
perspective?: Exclude<ClientPerspective, 'raw' | 'previewDrafts'>
|
|
2727
2792
|
}
|
|
2728
2793
|
|
|
2729
2794
|
/**
|
|
@@ -3413,6 +3478,29 @@ export declare type SpanTextObjectField = {
|
|
|
3413
3478
|
/** @beta */
|
|
3414
3479
|
export declare type StrictDefinition = boolean | undefined
|
|
3415
3480
|
|
|
3481
|
+
/**
|
|
3482
|
+
* @internal
|
|
3483
|
+
*/
|
|
3484
|
+
export declare interface StrictVersionLayeringOptions {
|
|
3485
|
+
/**
|
|
3486
|
+
* By default, version layering includes all document versions, regardless of their expected
|
|
3487
|
+
* publication time—or lack thereof. For example, it includes all ASAP and undecided versions,
|
|
3488
|
+
* despite ASAP and undecided versions having no fixed chronology. There is no way to determine
|
|
3489
|
+
* which ASAP or undecided version is expected to be published before another.
|
|
3490
|
+
*
|
|
3491
|
+
* It also includes any existing draft, which has no fixed chronology, either.
|
|
3492
|
+
*
|
|
3493
|
+
* This functionality is useful for listing all document versions in a deterministic order, but
|
|
3494
|
+
* doesn't accurately portray the upstream and downstream versions based on expected publication
|
|
3495
|
+
* time.
|
|
3496
|
+
*
|
|
3497
|
+
* In strict mode, version layering instead only includes versions that have a fixed chronology.
|
|
3498
|
+
* **Cross-version layering is only effective for scheduled versions, with all other
|
|
3499
|
+
* versions being layered directly onto the published version (if it exists).**
|
|
3500
|
+
*/
|
|
3501
|
+
strict?: boolean
|
|
3502
|
+
}
|
|
3503
|
+
|
|
3416
3504
|
/** @public */
|
|
3417
3505
|
export declare interface StringDefinition extends BaseSchemaDefinition {
|
|
3418
3506
|
type: 'string'
|
|
@@ -3424,9 +3512,7 @@ export declare interface StringDefinition extends BaseSchemaDefinition {
|
|
|
3424
3512
|
|
|
3425
3513
|
/** @public */
|
|
3426
3514
|
export declare interface StringOptions
|
|
3427
|
-
extends EnumListProps<string>,
|
|
3428
|
-
SearchConfiguration,
|
|
3429
|
-
BaseSchemaTypeOptions {}
|
|
3515
|
+
extends EnumListProps<string>, SearchConfiguration, BaseSchemaTypeOptions {}
|
|
3430
3516
|
|
|
3431
3517
|
/** @public */
|
|
3432
3518
|
export declare interface StringRule extends RuleDef<StringRule, string> {
|
|
@@ -3467,6 +3553,20 @@ export declare interface StringSchemaType extends BaseSchemaType {
|
|
|
3467
3553
|
initialValue?: InitialValueProperty<any, string>
|
|
3468
3554
|
}
|
|
3469
3555
|
|
|
3556
|
+
/**
|
|
3557
|
+
* @internal
|
|
3558
|
+
* Payload that will be passed by the comments backend to our notifications system to display the notification in dashboard.
|
|
3559
|
+
* */
|
|
3560
|
+
export declare interface StudioNotificationPayload extends DashboardNotificationPayload {
|
|
3561
|
+
applicationType: 'studio'
|
|
3562
|
+
applicationId: string | undefined
|
|
3563
|
+
workspaceName: string | undefined
|
|
3564
|
+
link: {
|
|
3565
|
+
type: 'url'
|
|
3566
|
+
url: string
|
|
3567
|
+
}
|
|
3568
|
+
}
|
|
3569
|
+
|
|
3470
3570
|
/** @public */
|
|
3471
3571
|
export declare type SwatchName =
|
|
3472
3572
|
| 'darkMuted'
|
|
@@ -3746,6 +3846,13 @@ export declare interface ValidationError {
|
|
|
3746
3846
|
* the document.
|
|
3747
3847
|
*/
|
|
3748
3848
|
path?: Path
|
|
3849
|
+
/**
|
|
3850
|
+
* Extra metadata for the validation error. Currently used by the Media Library asset source to ignore
|
|
3851
|
+
* certain validation markers when validating asset source media library assets.
|
|
3852
|
+
*
|
|
3853
|
+
* @internal
|
|
3854
|
+
*/
|
|
3855
|
+
__internal_metadata?: unknown
|
|
3749
3856
|
/**
|
|
3750
3857
|
* Same as `path` but allows more than one value. If provided, the same
|
|
3751
3858
|
* message will create two markers from each path with the same message
|
|
@@ -3806,6 +3913,13 @@ export declare interface ValidationMarker {
|
|
|
3806
3913
|
* are not compatible with deep getters like lodash/get
|
|
3807
3914
|
*/
|
|
3808
3915
|
path: Path
|
|
3916
|
+
/**
|
|
3917
|
+
* Extra metadata for the validation marker. Currently used by the Media Library asset source to ignore
|
|
3918
|
+
* certain validation markers when validating asset source media library assets.
|
|
3919
|
+
*
|
|
3920
|
+
* @internal
|
|
3921
|
+
*/
|
|
3922
|
+
__internal_metadata?: unknown
|
|
3809
3923
|
}
|
|
3810
3924
|
|
|
3811
3925
|
/**
|
package/lib/index.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
3
1
|
function isObject(obj) {
|
|
4
2
|
return typeof obj == "object" && obj !== null && !Array.isArray(obj);
|
|
5
3
|
}
|
|
@@ -45,7 +43,8 @@ function defineAssetAspect(definition) {
|
|
|
45
43
|
definition,
|
|
46
44
|
...assetType && {
|
|
47
45
|
assetType: Array.isArray(assetType) ? assetType : [assetType]
|
|
48
|
-
}
|
|
46
|
+
},
|
|
47
|
+
public: definition.public
|
|
49
48
|
};
|
|
50
49
|
}
|
|
51
50
|
function isCreateMutation(mutation) {
|
|
@@ -204,62 +203,64 @@ function isValidationWarning(node) {
|
|
|
204
203
|
function isValidationInfo(node) {
|
|
205
204
|
return node.level === "info";
|
|
206
205
|
}
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
206
|
+
export {
|
|
207
|
+
MEDIA_LIBRARY_ASSET_ASPECT_TYPE_NAME,
|
|
208
|
+
defineArrayMember,
|
|
209
|
+
defineAssetAspect,
|
|
210
|
+
defineField,
|
|
211
|
+
defineType,
|
|
212
|
+
isArrayOfBlocksSchemaType,
|
|
213
|
+
isArrayOfObjectsSchemaType,
|
|
214
|
+
isArrayOfPrimitivesSchemaType,
|
|
215
|
+
isArraySchemaType,
|
|
216
|
+
isAssetAspect,
|
|
217
|
+
isBlockChildrenObjectField,
|
|
218
|
+
isBlockListObjectField,
|
|
219
|
+
isBlockSchemaType,
|
|
220
|
+
isBlockStyleObjectField,
|
|
221
|
+
isBooleanSchemaType,
|
|
222
|
+
isCreateIfNotExistsMutation,
|
|
223
|
+
isCreateMutation,
|
|
224
|
+
isCreateOrReplaceMutation,
|
|
225
|
+
isCreateSquashedMutation,
|
|
226
|
+
isCrossDatasetReference,
|
|
227
|
+
isCrossDatasetReferenceSchemaType,
|
|
228
|
+
isDateTimeSchemaType,
|
|
229
|
+
isDeleteMutation,
|
|
230
|
+
isDeprecatedSchemaType,
|
|
231
|
+
isDeprecationConfiguration,
|
|
232
|
+
isDocumentSchemaType,
|
|
233
|
+
isFileSchemaType,
|
|
234
|
+
isGlobalDocumentReference,
|
|
235
|
+
isImage,
|
|
236
|
+
isImageSchemaType,
|
|
237
|
+
isIndexSegment,
|
|
238
|
+
isIndexTuple,
|
|
239
|
+
isKeySegment,
|
|
240
|
+
isKeyedObject,
|
|
241
|
+
isNumberSchemaType,
|
|
242
|
+
isObjectSchemaType,
|
|
243
|
+
isPatchMutation,
|
|
244
|
+
isPortableTextListBlock,
|
|
245
|
+
isPortableTextSpan,
|
|
246
|
+
isPortableTextTextBlock,
|
|
247
|
+
isPrimitiveSchemaType,
|
|
248
|
+
isReference,
|
|
249
|
+
isReferenceSchemaType,
|
|
250
|
+
isSanityDocument,
|
|
251
|
+
isSearchStrategy,
|
|
252
|
+
isSlug,
|
|
253
|
+
isSpanSchemaType,
|
|
254
|
+
isStringSchemaType,
|
|
255
|
+
isTitledListValue,
|
|
256
|
+
isTypedObject,
|
|
257
|
+
isValidationError,
|
|
258
|
+
isValidationErrorMarker,
|
|
259
|
+
isValidationInfo,
|
|
260
|
+
isValidationInfoMarker,
|
|
261
|
+
isValidationWarning,
|
|
262
|
+
isValidationWarningMarker,
|
|
263
|
+
searchStrategies,
|
|
264
|
+
typed
|
|
265
|
+
};
|
|
265
266
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/helpers.ts","../src/reference/asserters.ts","../src/assets/asserters.ts","../src/crossDatasetReference/asserters.ts","../src/documents/asserters.ts","../src/globalDocumentReference/asserters.ts","../src/markers/asserters.ts","../src/mediaLibrary/types.ts","../src/mediaLibrary/asserters.ts","../src/mediaLibrary/defineAssetAspect.ts","../src/mutations/asserters.ts","../src/paths/asserters.ts","../src/portableText/asserters.ts","../src/schema/asserters.ts","../src/schema/define.ts","../src/search/types.ts","../src/search/asserters.ts","../src/slug/asserters.ts","../src/transactionLog/asserters.ts","../src/validation/asserters.ts"],"sourcesContent":["export function isObject(obj: unknown): obj is Record<string, unknown> {\n return typeof obj === 'object' && obj !== null && !Array.isArray(obj)\n}\n","import {isObject} from '../helpers'\nimport {type Reference} from './types'\n\n/** @internal */\nexport function isReference(reference: unknown): reference is Reference {\n return isObject(reference) && typeof reference._ref === 'string'\n}\n","import {isObject} from '../helpers'\nimport {isReference} from '../reference'\nimport {type Image} from './types'\n\n/** @public */\nexport function isImage(value: unknown): value is Image {\n return isObject(value) && isReference(value.asset) && value.asset._ref.startsWith('image-')\n}\n","import {isObject} from '../helpers'\nimport {type CrossDatasetReferenceValue} from './types'\n\n/** @beta */\nexport function isCrossDatasetReference(\n reference: unknown,\n): reference is CrossDatasetReferenceValue {\n return (\n isObject(reference) &&\n typeof reference._ref === 'string' &&\n typeof reference._dataset === 'string' &&\n typeof reference._projectId === 'string'\n )\n}\n","import {isObject} from '../helpers'\nimport {type KeyedObject, type SanityDocument, type TypedObject} from './types'\n\n/** @public */\nexport function isSanityDocument(document: unknown): document is SanityDocument {\n return (\n isObject(document) && typeof document._id === 'string' && typeof document._type === 'string'\n )\n}\n\n/** @public */\nexport function isTypedObject(obj: unknown): obj is TypedObject {\n return isObject(obj) && typeof obj._type === 'string'\n}\n\n/** @public */\nexport function isKeyedObject(obj: unknown): obj is KeyedObject {\n return isObject(obj) && typeof obj._key === 'string'\n}\n","import {isObject} from '../helpers'\nimport {type GlobalDocumentReferenceValue} from './types'\n\n/** @beta */\nexport function isGlobalDocumentReference(\n reference: unknown,\n): reference is GlobalDocumentReferenceValue {\n if (!isObject(reference) || typeof reference._ref !== 'string') {\n return false\n }\n\n return reference._ref.split(':').length === 3\n}\n","import {type ValidationMarker} from './types'\n\n/** @internal */\nexport function isValidationErrorMarker(\n marker: ValidationMarker,\n): marker is ValidationMarker & {level: 'error'} {\n return marker.level === 'error'\n}\n\n/** @internal */\nexport function isValidationWarningMarker(\n marker: ValidationMarker,\n): marker is ValidationMarker & {level: 'warning'} {\n return marker.level === 'warning'\n}\n\n/** @internal */\nexport function isValidationInfoMarker(\n marker: ValidationMarker,\n): marker is ValidationMarker & {level: 'info'} {\n return marker.level === 'info'\n}\n","import {type FileAsset, type ImageAsset} from '../assets/types'\nimport {type SanityDocumentLike} from '../documents/types'\nimport {type FieldDefinition, type IntrinsicTypeName} from '../schema/definition/schemaDefinition'\n\n/**\n * @public\n */\nexport type MediaLibraryAssetAspectSupportedFieldDefinitions = FieldDefinition<\n Exclude<IntrinsicTypeName, 'document' | 'image' | 'file' | 'reference' | 'crossDatasetReference'>\n>\n\n/**\n * @public\n */\nexport type MediaLibraryAssetAspectDefinition = MediaLibraryAssetAspectSupportedFieldDefinitions & {\n assetType?: MediaLibraryAssetType | MediaLibraryAssetType[]\n}\n\n/**\n * @public\n */\nexport const MEDIA_LIBRARY_ASSET_ASPECT_TYPE_NAME = 'sanity.asset.aspect'\n\n/**\n * @public\n */\nexport type MediaLibraryAssetAspectTypeName = typeof MEDIA_LIBRARY_ASSET_ASPECT_TYPE_NAME\n\n/**\n * @public\n */\nexport type MediaLibraryAssetType = ImageAsset['_type'] | FileAsset['_type']\n\n/**\n * A document representing a Media Library asset aspect.\n *\n * Each aspect provides a schema describing custom data that can be assigned to assets.\n *\n * @public\n */\nexport interface MediaLibraryAssetAspectDocument extends SanityDocumentLike {\n _type: MediaLibraryAssetAspectTypeName\n /**\n * Asset types the aspect can be assigned to.\n *\n * If no `assetType` is defined, the aspect may be assigned to any asset type.\n */\n assetType?: MediaLibraryAssetType[]\n definition: FieldDefinition\n}\n","import {MEDIA_LIBRARY_ASSET_ASPECT_TYPE_NAME, type MediaLibraryAssetAspectDocument} from './types'\n\n/**\n * Check whether the provided value resembles a Media Library asset aspect document.\n *\n * Note: This function does not perform a comprehensive check.\n *\n * @see validateMediaLibraryAssetAspect\n *\n * @internal\n */\nexport function isAssetAspect(\n maybeAssetAspect: unknown,\n): maybeAssetAspect is MediaLibraryAssetAspectDocument {\n return (\n typeof maybeAssetAspect === 'object' &&\n maybeAssetAspect !== null &&\n '_type' in maybeAssetAspect &&\n maybeAssetAspect._type === MEDIA_LIBRARY_ASSET_ASPECT_TYPE_NAME\n )\n}\n","import {\n MEDIA_LIBRARY_ASSET_ASPECT_TYPE_NAME,\n type MediaLibraryAssetAspectDefinition,\n type MediaLibraryAssetAspectDocument,\n} from './types'\n\n/**\n * Define a Media Library asset aspect.\n *\n * Aspects can be deployed using the `sanity media deploy-aspect` CLI command.\n *\n * @public\n * @beta\n */\nexport function defineAssetAspect(\n definition: MediaLibraryAssetAspectDefinition,\n): MediaLibraryAssetAspectDocument {\n const {assetType, name} = definition\n\n return {\n _type: MEDIA_LIBRARY_ASSET_ASPECT_TYPE_NAME,\n _id: `${name}`,\n definition,\n ...(assetType && {\n assetType: Array.isArray(assetType) ? assetType : [assetType],\n }),\n }\n}\n","import {type TransactionLogMutation} from '../transactionLog'\nimport {\n type CreateIfNotExistsMutation,\n type CreateMutation,\n type CreateOrReplaceMutation,\n type DeleteMutation,\n type Mutation,\n type PatchMutation,\n} from './types'\n\n/** @internal */\nexport function isCreateMutation(\n mutation: Mutation | TransactionLogMutation,\n): mutation is CreateMutation {\n return 'create' in mutation\n}\n\n/** @internal */\nexport function isCreateIfNotExistsMutation(\n mutation: Mutation | TransactionLogMutation,\n): mutation is CreateIfNotExistsMutation {\n return 'createIfNotExists' in mutation\n}\n\n/** @internal */\nexport function isCreateOrReplaceMutation(\n mutation: Mutation | TransactionLogMutation,\n): mutation is CreateOrReplaceMutation {\n return 'createOrReplace' in mutation\n}\n\n/** @internal */\nexport function isDeleteMutation(\n mutation: Mutation | TransactionLogMutation,\n): mutation is DeleteMutation {\n return 'delete' in mutation\n}\n\n/** @internal */\nexport function isPatchMutation(\n mutation: Mutation | TransactionLogMutation,\n): mutation is PatchMutation {\n return 'patch' in mutation\n}\n","import {type IndexTuple, type KeyedSegment, type PathSegment} from './types'\n\nconst reKeySegment = /_key\\s*==\\s*['\"](.*)['\"]/\nconst reIndexTuple = /^\\d*:\\d*$/\n\n/** @internal */\nexport function isIndexSegment(segment: PathSegment): segment is number {\n return typeof segment === 'number' || (typeof segment === 'string' && /^\\[\\d+\\]$/.test(segment))\n}\n\n/** @internal */\nexport function isKeySegment(segment: PathSegment): segment is KeyedSegment {\n if (typeof segment === 'string') {\n return reKeySegment.test(segment.trim())\n }\n\n return typeof segment === 'object' && '_key' in segment\n}\n\n/** @internal */\nexport function isIndexTuple(segment: PathSegment): segment is IndexTuple {\n if (typeof segment === 'string' && reIndexTuple.test(segment)) {\n return true\n }\n\n if (!Array.isArray(segment) || segment.length !== 2) {\n return false\n }\n\n const [from, to] = segment\n return (typeof from === 'number' || from === '') && (typeof to === 'number' || to === '')\n}\n","import {type PortableTextObject, type PortableTextSpan, type PortableTextTextBlock} from './types'\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return !!value && (typeof value == 'object' || typeof value == 'function')\n}\n\n/**\n * Assert that a given object is a portable-text text-block type object\n *\n * @remarks\n * * The `markDefs` and `style` property of a block is optional.\n * * Block types can be named, so expect anything of the _type property.\n *\n * @alpha\n */\nexport function isPortableTextTextBlock<T = PortableTextSpan | PortableTextObject>(\n value: unknown,\n): value is PortableTextTextBlock<T> {\n return (\n isRecord(value) &&\n typeof value._type === 'string' && // block types can be named, so expect anything here.\n Array.isArray(value.children) &&\n value.children.every((child) => isRecord(child)) &&\n ('markDefs' in value // optional property\n ? Array.isArray(value.markDefs) && value.markDefs.every((def) => isRecord(def))\n : true) &&\n ('style' in value ? typeof value.style === 'string' : true) // optional property\n )\n}\n\n/**\n * Assert that a given object is a portable-text span-type object\n *\n * @remarks\n * The `marks` property of a block is optional.\n *\n * @alpha\n */\nexport function isPortableTextSpan(value: unknown): value is PortableTextSpan {\n return (\n isRecord(value) &&\n value._type === 'span' &&\n typeof value.text === 'string' &&\n ('marks' in value // optional property\n ? Array.isArray(value.marks) && value.marks.every((mark) => typeof mark === 'string')\n : true)\n )\n}\n\n/**\n * Assert that a given object is a portable-text list-text-block-type object\n *\n * @remarks\n * Uses `isPortableTextTextBlock` and checks for `listItem` and `level`\n *\n * @see isPortableTextTextBlock\n *\n * @alpha\n */\nexport function isPortableTextListBlock<T = PortableTextSpan | PortableTextObject>(\n value: unknown,\n): value is PortableTextTextBlock<T> {\n return (\n isPortableTextTextBlock(value) &&\n 'listItem' in value &&\n typeof value.listItem === 'string' &&\n 'level' in value &&\n Number.isInteger(value.level)\n )\n}\n","import {type CrossDatasetReferenceSchemaType} from '../crossDatasetReference'\nimport {type TitledListValue} from './definition'\nimport {\n type ArraySchemaType,\n type BaseSchemaType,\n type BlockChildrenObjectField,\n type BlockListObjectField,\n type BlockSchemaType,\n type BlockStyleObjectField,\n type BooleanSchemaType,\n type DeprecatedSchemaType,\n type DeprecationConfiguration,\n type FileSchemaType,\n type ImageSchemaType,\n type NumberSchemaType,\n type ObjectSchemaType,\n type ReferenceSchemaType,\n type SchemaType,\n type SpanSchemaType,\n type StringSchemaType,\n} from './types'\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return !!value && (typeof value == 'object' || typeof value == 'function')\n}\n\n/**\n * Returns wether or not the given type is a document type\n * (eg that it was defined as `type: 'document'`)\n *\n * @param type - Schema type to test\n * @returns True if type is a document type, false otherwise\n *\n * @public\n */\nexport function isDocumentSchemaType(type: unknown): type is ObjectSchemaType {\n if (!isObjectSchemaType(type)) {\n return false\n }\n\n let current: SchemaType | undefined = type as SchemaType\n while (current) {\n if (current.name === 'document') {\n return true\n }\n\n current = current.type\n }\n return false\n}\n\n/** @internal */\nexport function isObjectSchemaType(type: unknown): type is ObjectSchemaType {\n if (!isRecord(type)) return false\n return type.jsonType === 'object'\n}\n\n/** @internal */\nexport function isArraySchemaType(type: unknown): type is ArraySchemaType {\n if (!isRecord(type)) return false\n return type.jsonType === 'array'\n}\n\n/** @internal */\nexport function isArrayOfBlocksSchemaType(\n type: unknown,\n): type is ArraySchemaType<ObjectSchemaType> {\n return isArraySchemaType(type) && type.of.some((memberType) => isBlockSchemaType(memberType))\n}\n\n/** @internal */\nexport function isArrayOfObjectsSchemaType(\n type: unknown,\n): type is ArraySchemaType<ObjectSchemaType> {\n return isArraySchemaType(type) && type.of.every((memberType) => isObjectSchemaType(memberType))\n}\n\n/** @internal */\nexport function isArrayOfPrimitivesSchemaType(type: unknown): type is ArraySchemaType {\n return isArraySchemaType(type) && type.of.every((memberType) => isPrimitiveSchemaType(memberType))\n}\n\n/** @internal */\nexport function isBooleanSchemaType(type: unknown): type is BooleanSchemaType {\n if (!isRecord(type)) return false\n return type.jsonType === 'boolean'\n}\n\n/** @internal */\nexport function isStringSchemaType(type: unknown): type is StringSchemaType {\n if (!isRecord(type)) return false\n return type.jsonType === 'string'\n}\n\n/** @internal */\nexport function isDateTimeSchemaType(type: unknown): type is StringSchemaType {\n if (!isStringSchemaType(type)) return false\n return type.name === 'datetime'\n}\n\n/** @internal */\nexport function isNumberSchemaType(type: unknown): type is NumberSchemaType {\n if (!isRecord(type)) return false\n return type.jsonType === 'number'\n}\n\n/** @internal */\nexport function isPrimitiveSchemaType(\n type: unknown,\n): type is BooleanSchemaType | StringSchemaType | NumberSchemaType {\n return isBooleanSchemaType(type) || isStringSchemaType(type) || isNumberSchemaType(type)\n}\n\n/** @internal */\nexport function isReferenceSchemaType(type: unknown): type is ReferenceSchemaType {\n return isRecord(type) && (type.name === 'reference' || isReferenceSchemaType(type.type))\n}\n\n/** @internal */\nexport function isImageSchemaType(type: unknown): type is ImageSchemaType {\n return isRecord(type) && (type.name === 'image' || isImageSchemaType(type.type))\n}\n\n/** @internal */\nexport function isFileSchemaType(type: unknown): type is FileSchemaType {\n return isRecord(type) && (type.name === 'file' || isFileSchemaType(type.type))\n}\n\n/** @internal */\nexport function isDeprecatedSchemaType<TSchemaType extends BaseSchemaType>(\n type: TSchemaType,\n): type is DeprecatedSchemaType<TSchemaType> {\n if (!isRecord(type)) return false\n return typeof type.deprecated !== 'undefined'\n}\n\n/** @internal */\nexport function isDeprecationConfiguration(type: unknown): type is DeprecationConfiguration {\n if (!isRecord(type)) return false\n return typeof type.deprecated !== 'undefined'\n}\n\n/** @internal */\nexport function isCrossDatasetReferenceSchemaType(\n type: unknown,\n): type is CrossDatasetReferenceSchemaType {\n return (\n isRecord(type) &&\n (type.name === 'crossDatasetReference' || isCrossDatasetReferenceSchemaType(type.type))\n )\n}\n\n/** @internal */\nexport function isTitledListValue(item: unknown): item is TitledListValue {\n return typeof item === 'object' && item !== null && 'title' in item && 'value' in item\n}\n\n/** @internal */\nexport function isSpanSchemaType(type: unknown): type is SpanSchemaType {\n if (!isRecord(type)) return false\n // we check for `annotations` and `decorators` instead of `type.name` because\n // schema names can technically change if someone extends the type\n return Array.isArray(type.annotations) && Array.isArray(type.decorators)\n}\n\n/** @internal */\nexport function isBlockSchemaType(type: unknown): type is BlockSchemaType {\n if (!isRecord(type)) return false\n if (!Array.isArray(type.fields)) return false\n const maybeSpanChildren = type.fields.find(isBlockChildrenObjectField)\n const maybeStyle = type.fields.find(isBlockStyleObjectField)\n const maybeList = type.fields.find(isBlockListObjectField)\n return (\n isBlockChildrenObjectField(maybeSpanChildren) &&\n isBlockStyleObjectField(maybeStyle) &&\n isBlockListObjectField(maybeList)\n )\n}\n\n/** @internal */\nexport function isBlockStyleObjectField(field: unknown): field is BlockStyleObjectField {\n if (!isRecord(field)) return false\n if (field.name !== 'style') return false\n return isRecord(field.type) && field.type.jsonType === 'string'\n}\n\n/** @internal */\nexport function isBlockListObjectField(field: unknown): field is BlockListObjectField {\n if (!isRecord(field)) return false\n if (field.name !== 'listItem') return false\n return isRecord(field.type) && field.type.jsonType === 'string'\n}\n\n/** @internal */\nexport function isBlockChildrenObjectField(field: unknown): field is BlockChildrenObjectField {\n if (!isRecord(field)) return false\n if (field.name !== 'children') return false\n if (!isArraySchemaType(field.type)) return false\n // there will always be a span item in `SpanChildrenObjectField`\n return field.type.of.some(isSpanSchemaType)\n}\n","import {\n type DefineArrayMemberBase,\n type DefineSchemaBase,\n type DefineSchemaOptions,\n type MaybeAllowUnknownProps,\n type NarrowPreview,\n type StrictDefinition,\n type WidenInitialValue,\n type WidenValidation,\n} from './defineTypes'\nimport {type FieldDefinitionBase, type IntrinsicTypeName} from './definition'\nimport {type AutocompleteString} from './types'\n\n/**\n * Helper function for defining a Sanity type definition. This function does not do anything on its own;\n * it exists to check that your schema definition is correct, and help autocompletion in your IDE.\n *\n * This function will narrow the schema type down to fields and options based on the provided type-string.\n *\n * Schema types defined using `defineType` should typically be added to the Studio config under `schema.types`.\n * Defined types can be referenced by their `name`. This is referred to as a type-alias.\n *\n * When using type-aliases as `type`, `defineType` cannot know the base-type, so type-safety will be reduced.\n * If you know the base type of the type-alias, provide `defineOptions.aliasFor: <base type name>`.\n * This will enforce that the schema definition conforms with the provided type.\n *\n * By default, `defineType` only allows known properties and options.\n * Use `defineOptions.strict: false` to allow unknown properties and options.\n *\n * ### Basic usage\n *\n * ```ts\n * defineType({\n * type: 'object',\n * name: 'custom-object',\n * fields: [ {type: 'string', name: 'title', title: 'Title'}],\n * })\n * ```\n *\n * ### Usage with aliasFor narrowing\n *\n * ```ts\n * defineType({\n * type: 'custom-object',\n * name: 'redefined-custom-object',\n * options: {\n * columns: 2\n * }\n * }, {aliasFor: 'object' })\n * ```\n *\n * ### Allow unknown properties\n *\n * ```ts\n * defineType({\n * type: 'custom-object',\n * name: 'redefined-custom-object',\n * allowsUnknownProperties: true\n * options: {\n * columns: 2,\n * allowsUnknownOptions: true\n * }\n * }, {strict: false})\n * ```\n * ### Maximum safety and best autocompletion\n *\n * Use {@link defineType}, {@link defineField} and {@link defineArrayMember}:\n *\n * ```ts\n * defineType({\n * type: 'object',\n * name: 'custom-object',\n * fields: [\n * defineField({\n * type: 'array',\n * name: 'arrayField',\n * title: 'Things',\n * of: [\n * defineArrayMember({\n * type: 'object',\n * name: 'type-name-in-array',\n * fields: [defineField({type: 'string', name: 'title', title: 'Title'})],\n * }),\n * ],\n * }),\n * ],\n * })\n * ```\n *\n * ## Note on type-safety in the current implementation\n *\n * Type-safety inside array-like properties (schema properties like `fields` and `of`) can only be guaranteed when\n * {@link defineField} and {@link defineArrayMember} are used to wrap each value in the array.\n *\n * For array-values without a function-wrapper, TypeScript will resolve to a union type of all possible properties across\n * all schema types. This result in less precise typing.\n *\n * ### Extending the Sanity Schema types\n *\n * If you want to extend the Sanity Schema types with your own properties or options to make them typesafe,\n * you can use [TypeScript declaration merging](https://www.typescriptlang.org/docs/handbook/declaration-merging.html).\n *\n * With declaration merging, properties and options will be available in a type-safe manner, and\n * `strict: false` will not be necessary.\n *\n * #### Example: Add option to StringOptions\n *\n * ```ts\n * // string.ts\n *\n * //redeclare the sanity module\n * declare module 'sanity' {\n * // redeclare StringOptions; it will be merged with StringOptions in the sanity module\n * export interface StringOptions {\n * myCustomOption?: boolean\n * }\n * }\n *\n * // the option is now part of the StringOptions type, just as if it was declared in the sanity codebase:\n * defineType({\n * type: 'string',\n * name: 'my-string',\n * options: {\n * myCustomOption: true // this does not give an error anymore\n * }\n * })\n *\n * ```\n *\n * #### Example: Add a schema definition to \"intrinsic-types\"\n *\n * ```ts\n * //my-custom-type-definition.ts\n *\n * // create a new schema definition based on object (we remove the ability to assign field, change the type add some options)\n * export type MagicallyAddedDefinition = Omit<Schema.ObjectDefinition, 'type' | 'fields'> & {\n * type: 'magically-added-type'\n * options?: {\n * sparkles?: boolean\n * }\n * }\n *\n * // redeclares sanity module so we can add interfaces props to it\n * declare module 'sanity' {\n * // redeclares IntrinsicDefinitions and adds a named definition to it\n * // it is important that the key is the same as the type in the definition ('magically-added-type')\n * export interface IntrinsicDefinitions {\n * 'magically-added-type': MagicallyAddedDefinition\n * }\n * }\n *\n * // defineType will now narrow `type: 'magically-added-type'` to `MagicallyAddedDefinition`\n * defineType({\n * type: 'magically-added-type'\n * name: 'magic',\n * options: {\n * sparkles: true // this is allowed,\n * //@ts-expect-error this is not allowed in MagicallyAddedDefinition.options\n * sparks: true\n * }\n * })\n * ```\n *\n * @param schemaDefinition - should be a valid schema type definition.\n * @param defineOptions - optional param to provide type hints for `schemaDefinition`.\n *\n * @see defineField\n * @see defineArrayMember\n * @see typed\n *\n * @beta\n */\nexport function defineType<\n const TType extends IntrinsicTypeName | AutocompleteString,\n const TName extends string,\n TSelect extends Record<string, string> | undefined,\n TPrepareValue extends Record<keyof TSelect, any> | undefined,\n TAlias extends IntrinsicTypeName | undefined,\n TStrict extends StrictDefinition,\n>(\n schemaDefinition: {\n type: TType\n name: TName\n } & DefineSchemaBase<TType, TAlias> &\n NarrowPreview<TType, TAlias, TSelect, TPrepareValue> &\n MaybeAllowUnknownProps<TStrict>,\n\n defineOptions?: DefineSchemaOptions<TStrict, TAlias>,\n): typeof schemaDefinition {\n return schemaDefinition\n}\n\n/**\n * Define a field within a document, object, image or file definition `fields` array.\n *\n * This function will narrow the schema type down to fields and options based on the provided\n * type-string.\n *\n * Using `defineField` is optional, but should provide improved autocompletion in your IDE, when building your schema.\n * Field-properties like `validation` and `initialValue`will also be more specific.\n *\n * See {@link defineType} for more examples.\n *\n * @param schemaField - should be a valid field type definition.\n * @param defineOptions - optional param to provide type hints for `schemaField`.\n *\n * @see defineField\n * @see defineArrayMember\n * @see typed\n *\n * @beta\n */\nexport function defineField<\n const TType extends IntrinsicTypeName | AutocompleteString,\n const TName extends string,\n TSelect extends Record<string, string> | undefined,\n TPrepareValue extends Record<keyof TSelect, any> | undefined,\n TAlias extends IntrinsicTypeName | undefined,\n TStrict extends StrictDefinition,\n>(\n schemaField: {\n type: TType\n name: TName\n } & DefineSchemaBase<TType, TAlias> &\n NarrowPreview<TType, TAlias, TSelect, TPrepareValue> &\n MaybeAllowUnknownProps<TStrict> &\n FieldDefinitionBase,\n\n defineOptions?: DefineSchemaOptions<TStrict, TAlias>,\n): typeof schemaField & WidenValidation & WidenInitialValue {\n // TODO: re-evaluate the need for this cast\n return schemaField as typeof schemaField & WidenValidation & WidenInitialValue\n}\n\n/**\n * Define an array item member type within an array definition `of`-array.\n *\n * This function will narrow the schema type down to fields and options based on the provided\n * `type` string.\n *\n * Using `defineArrayMember` is optional, but should provide improved autocompletion in your IDE, when building your schema.\n * Field properties like `validation` and `initialValue` will also be more specific.\n *\n * See {@link defineType} for example usage.\n *\n * @param arrayOfSchema - should be a valid `array.of` member definition.\n * @param defineOptions - optional param to provide type hints for `arrayOfSchema`.\n *\n * @see defineType\n * @see defineField\n * @see typed\n *\n * @beta\n */\nexport function defineArrayMember<\n const TType extends IntrinsicTypeName | AutocompleteString,\n const TName extends string,\n TSelect extends Record<string, string> | undefined,\n TPrepareValue extends Record<keyof TSelect, any> | undefined,\n TAlias extends IntrinsicTypeName | undefined,\n TStrict extends StrictDefinition,\n>(\n arrayOfSchema: {\n type: TType\n /**\n * When provided, `name` is used as `_type` for the array item when stored.\n *\n * Necessary when an array contains multiple entries with the same `type`, each with\n * different configuration (title and initialValue for instance).\n */\n name?: TName\n } & DefineArrayMemberBase<TType, TAlias> &\n NarrowPreview<TType, TAlias, TSelect, TPrepareValue> &\n MaybeAllowUnknownProps<TStrict>,\n\n defineOptions?: DefineSchemaOptions<TStrict, TAlias>,\n): typeof arrayOfSchema & WidenValidation & WidenInitialValue {\n // TODO: re-evaluate the need for this cast\n return arrayOfSchema as typeof arrayOfSchema & WidenValidation & WidenInitialValue\n}\n\n/**\n * `typed` can be used to ensure that an object conforms to an exact interface.\n *\n * It can be useful when working with `defineType` and `defineField` on occasions where a wider type with\n * custom options or properties is required.\n *\n * ## Example usage\n * ```ts\n * defineField({\n * type: 'string',\n * name: 'nestedField',\n * options: typed<StringOptions & {myCustomOption: boolean}>({\n * layout: 'radio',\n * // allowed\n * myCustomOption: true,\n * //@ts-expect-error unknownProp is not part of StringOptions & {myCustomOption: boolean}\n * unknownProp: 'not allowed in typed context',\n * }),\n * }),\n * ```\n *\n * @param input - returned directly\n *\n * @internal\n */\nexport function typed<T>(input: T): T {\n return input\n}\n","/**\n * @public\n */\nexport const searchStrategies = ['groqLegacy', 'groq2024'] as const\n\n/**\n * @public\n */\nexport type SearchStrategy = (typeof searchStrategies)[number]\n","import {searchStrategies, type SearchStrategy} from './types'\n\n/**\n * @internal\n */\nexport function isSearchStrategy(\n maybeSearchStrategy: unknown,\n): maybeSearchStrategy is SearchStrategy {\n return searchStrategies.includes(maybeSearchStrategy as SearchStrategy)\n}\n","import {isObject} from '../helpers'\nimport {type Slug} from './types'\n\n/**\n * Checks whether the given `thing` is a slug, eg an object with a `current` string property.\n *\n * @param thing - The thing to check\n * @returns True if slug, false otherwise\n * @public\n */\nexport function isSlug(thing: unknown): thing is Slug {\n return isObject(thing) && typeof thing.current === 'string'\n}\n","import {type Mutation} from '../mutations'\nimport {type CreateSquashedMutation, type TransactionLogMutation} from './types'\n\n/** @internal */\nexport function isCreateSquashedMutation(\n mutation: Mutation | TransactionLogMutation,\n): mutation is CreateSquashedMutation {\n return 'createSquashed' in mutation\n}\n","import {type FormNodeValidation} from './types'\n\n/** @internal */\nexport function isValidationError(\n node: FormNodeValidation,\n): node is FormNodeValidation & {level: 'error'} {\n return node.level === 'error'\n}\n\n/** @internal */\nexport function isValidationWarning(\n node: FormNodeValidation,\n): node is FormNodeValidation & {level: 'warning'} {\n return node.level === 'warning'\n}\n\n/** @internal */\nexport function isValidationInfo(\n node: FormNodeValidation,\n): node is FormNodeValidation & {level: 'info'} {\n return node.level === 'info'\n}\n"],"names":["isRecord"],"mappings":";;AAAO,SAAS,SAAS,KAA8C;AAC9D,SAAA,OAAO,OAAQ,YAAY,QAAQ,QAAQ,CAAC,MAAM,QAAQ,GAAG;AACtE;ACEO,SAAS,YAAY,WAA4C;AACtE,SAAO,SAAS,SAAS,KAAK,OAAO,UAAU,QAAS;AAC1D;ACDO,SAAS,QAAQ,OAAgC;AAC/C,SAAA,SAAS,KAAK,KAAK,YAAY,MAAM,KAAK,KAAK,MAAM,MAAM,KAAK,WAAW,QAAQ;AAC5F;ACHO,SAAS,wB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S;AAEpC;AAGO,SAAS,wBAAwB,OAAgD;AAEtF,SADI,CAAC,SAAS,KAAK,KACf,MAAM,SAAS,UAAgB,KAC5B,SAAS,MAAM,IAAI,KAAK,MAAM,KAAK,aAAa;AACzD;AAGO,SAAS,uBAAuB,OAA+C;AAEpF,SADI,CAAC,SAAS,KAAK,KACf,MAAM,SAAS,aAAmB,KAC/B,SAAS,MAAM,IAAI,KAAK,MAAM,KAAK,aAAa;AACzD;AAGO,SAAS,2BAA2B,OAAmD;AAG5F,SAFI,CAAC,SAAS,KAAK,KACf,MAAM,SAAS,cACf,CAAC,kBAAkB,MAAM,IAAI,IAAU,KAEpC,MAAM,KAAK,GAAG,KAAK,gBAAgB;AAC5C;AC5BgB,SAAA,WAQd,kBAOA,eACyB;AAClB,SAAA;AACT;AAsBgB,SAAA,YAQd,aAQA,eAC0D;AAEnD,SAAA;AACT;AAsBgB,SAAA,kBAQd,eAaA,eAC4D;AAErD,SAAA;AACT;AA2BO,SAAS,MAAS,OAAa;AAC7B,SAAA;AACT;ACjTa,MAAA,mBAAmB,CAAC,cAAc,UAAU;ACElD,SAAS,iBACd,qBACuC;AAChC,SAAA,iBAAiB,SAAS,mBAAqC;AACxE;ACCO,SAAS,OAAO,OAA+B;AACpD,SAAO,SAAS,KAAK,KAAK,OAAO,MAAM,WAAY;AACrD;ACRO,SAAS,yBACd,UACoC;AACpC,SAAO,oBAAoB;AAC7B;ACLO,SAAS,kBACd,MAC+C;AAC/C,SAAO,KAAK,UAAU;AACxB;AAGO,SAAS,oBACd,MACiD;AACjD,SAAO,KAAK,UAAU;AACxB;AAGO,SAAS,iBACd,MAC8C;AAC9C,SAAO,KAAK,UAAU;AACxB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/helpers.ts","../src/reference/asserters.ts","../src/assets/asserters.ts","../src/crossDatasetReference/asserters.ts","../src/documents/asserters.ts","../src/globalDocumentReference/asserters.ts","../src/markers/asserters.ts","../src/mediaLibrary/types.ts","../src/mediaLibrary/asserters.ts","../src/mediaLibrary/defineAssetAspect.ts","../src/mutations/asserters.ts","../src/paths/asserters.ts","../src/portableText/asserters.ts","../src/schema/asserters.ts","../src/schema/define.ts","../src/search/types.ts","../src/search/asserters.ts","../src/slug/asserters.ts","../src/transactionLog/asserters.ts","../src/validation/asserters.ts"],"sourcesContent":["export function isObject(obj: unknown): obj is Record<string, unknown> {\n return typeof obj === 'object' && obj !== null && !Array.isArray(obj)\n}\n","import {isObject} from '../helpers'\nimport {type Reference} from './types'\n\n/** @internal */\nexport function isReference(reference: unknown): reference is Reference {\n return isObject(reference) && typeof reference._ref === 'string'\n}\n","import {isObject} from '../helpers'\nimport {isReference} from '../reference'\nimport {type Image} from './types'\n\n/** @public */\nexport function isImage(value: unknown): value is Image {\n return isObject(value) && isReference(value.asset) && value.asset._ref.startsWith('image-')\n}\n","import {isObject} from '../helpers'\nimport {type CrossDatasetReferenceValue} from './types'\n\n/** @beta */\nexport function isCrossDatasetReference(\n reference: unknown,\n): reference is CrossDatasetReferenceValue {\n return (\n isObject(reference) &&\n typeof reference._ref === 'string' &&\n typeof reference._dataset === 'string' &&\n typeof reference._projectId === 'string'\n )\n}\n","import {isObject} from '../helpers'\nimport {type KeyedObject, type SanityDocument, type TypedObject} from './types'\n\n/** @public */\nexport function isSanityDocument(document: unknown): document is SanityDocument {\n return (\n isObject(document) && typeof document._id === 'string' && typeof document._type === 'string'\n )\n}\n\n/** @public */\nexport function isTypedObject(obj: unknown): obj is TypedObject {\n return isObject(obj) && typeof obj._type === 'string'\n}\n\n/** @public */\nexport function isKeyedObject(obj: unknown): obj is KeyedObject {\n return isObject(obj) && typeof obj._key === 'string'\n}\n","import {isObject} from '../helpers'\nimport {type GlobalDocumentReferenceValue} from './types'\n\n/** @beta */\nexport function isGlobalDocumentReference(\n reference: unknown,\n): reference is GlobalDocumentReferenceValue {\n if (!isObject(reference) || typeof reference._ref !== 'string') {\n return false\n }\n\n return reference._ref.split(':').length === 3\n}\n","import {type ValidationMarker} from './types'\n\n/** @internal */\nexport function isValidationErrorMarker(\n marker: ValidationMarker,\n): marker is ValidationMarker & {level: 'error'} {\n return marker.level === 'error'\n}\n\n/** @internal */\nexport function isValidationWarningMarker(\n marker: ValidationMarker,\n): marker is ValidationMarker & {level: 'warning'} {\n return marker.level === 'warning'\n}\n\n/** @internal */\nexport function isValidationInfoMarker(\n marker: ValidationMarker,\n): marker is ValidationMarker & {level: 'info'} {\n return marker.level === 'info'\n}\n","import {type FileAsset, type ImageAsset} from '../assets/types'\nimport {type SanityDocumentLike} from '../documents/types'\nimport {type FieldDefinition, type IntrinsicTypeName} from '../schema/definition/schemaDefinition'\n\n/**\n * @public\n */\nexport type MediaLibraryAssetAspectSupportedFieldDefinitions = FieldDefinition<\n Exclude<IntrinsicTypeName, 'document' | 'image' | 'file' | 'reference' | 'crossDatasetReference'>\n>\n\n/**\n * @public\n */\nexport type MediaLibraryAssetAspectDefinition = MediaLibraryAssetAspectSupportedFieldDefinitions & {\n assetType?: MediaLibraryAssetType | MediaLibraryAssetType[]\n\n // Whether the aspect is publicly available from GROQ queries\n public?: boolean\n}\n\n/**\n * @public\n */\nexport const MEDIA_LIBRARY_ASSET_ASPECT_TYPE_NAME = 'sanity.asset.aspect'\n\n/**\n * @public\n */\nexport type MediaLibraryAssetAspectTypeName = typeof MEDIA_LIBRARY_ASSET_ASPECT_TYPE_NAME\n\n/**\n * @public\n */\nexport type MediaLibraryAssetType = ImageAsset['_type'] | FileAsset['_type']\n\n/**\n * A document representing a Media Library asset aspect.\n *\n * Each aspect provides a schema describing custom data that can be assigned to assets.\n *\n * @public\n */\nexport interface MediaLibraryAssetAspectDocument extends SanityDocumentLike {\n _type: MediaLibraryAssetAspectTypeName\n /**\n * Asset types the aspect can be assigned to.\n *\n * If no `assetType` is defined, the aspect may be assigned to any asset type.\n */\n assetType?: MediaLibraryAssetType[]\n definition: FieldDefinition\n public?: boolean\n}\n","import {MEDIA_LIBRARY_ASSET_ASPECT_TYPE_NAME, type MediaLibraryAssetAspectDocument} from './types'\n\n/**\n * Check whether the provided value resembles a Media Library asset aspect document.\n *\n * Note: This function does not perform a comprehensive check.\n *\n * @see validateMediaLibraryAssetAspect\n *\n * @internal\n */\nexport function isAssetAspect(\n maybeAssetAspect: unknown,\n): maybeAssetAspect is MediaLibraryAssetAspectDocument {\n return (\n typeof maybeAssetAspect === 'object' &&\n maybeAssetAspect !== null &&\n '_type' in maybeAssetAspect &&\n maybeAssetAspect._type === MEDIA_LIBRARY_ASSET_ASPECT_TYPE_NAME\n )\n}\n","import {\n MEDIA_LIBRARY_ASSET_ASPECT_TYPE_NAME,\n type MediaLibraryAssetAspectDefinition,\n type MediaLibraryAssetAspectDocument,\n} from './types'\n\n/**\n * Define a Media Library asset aspect.\n *\n * Aspects can be deployed using the `sanity media deploy-aspect` CLI command.\n *\n * @public\n * @beta\n */\nexport function defineAssetAspect(\n definition: MediaLibraryAssetAspectDefinition,\n): MediaLibraryAssetAspectDocument {\n const {assetType, name} = definition\n\n return {\n _type: MEDIA_LIBRARY_ASSET_ASPECT_TYPE_NAME,\n _id: `${name}`,\n definition,\n ...(assetType && {\n assetType: Array.isArray(assetType) ? assetType : [assetType],\n }),\n public: definition.public,\n }\n}\n","import {type TransactionLogMutation} from '../transactionLog'\nimport {\n type CreateIfNotExistsMutation,\n type CreateMutation,\n type CreateOrReplaceMutation,\n type DeleteMutation,\n type Mutation,\n type PatchMutation,\n} from './types'\n\n/** @internal */\nexport function isCreateMutation(\n mutation: Mutation | TransactionLogMutation,\n): mutation is CreateMutation {\n return 'create' in mutation\n}\n\n/** @internal */\nexport function isCreateIfNotExistsMutation(\n mutation: Mutation | TransactionLogMutation,\n): mutation is CreateIfNotExistsMutation {\n return 'createIfNotExists' in mutation\n}\n\n/** @internal */\nexport function isCreateOrReplaceMutation(\n mutation: Mutation | TransactionLogMutation,\n): mutation is CreateOrReplaceMutation {\n return 'createOrReplace' in mutation\n}\n\n/** @internal */\nexport function isDeleteMutation(\n mutation: Mutation | TransactionLogMutation,\n): mutation is DeleteMutation {\n return 'delete' in mutation\n}\n\n/** @internal */\nexport function isPatchMutation(\n mutation: Mutation | TransactionLogMutation,\n): mutation is PatchMutation {\n return 'patch' in mutation\n}\n","import {type IndexTuple, type KeyedSegment, type PathSegment} from './types'\n\nconst reKeySegment = /_key\\s*==\\s*['\"](.*)['\"]/\nconst reIndexTuple = /^\\d*:\\d*$/\n\n/** @internal */\nexport function isIndexSegment(segment: PathSegment): segment is number {\n return typeof segment === 'number' || (typeof segment === 'string' && /^\\[\\d+\\]$/.test(segment))\n}\n\n/** @internal */\nexport function isKeySegment(segment: PathSegment): segment is KeyedSegment {\n if (typeof segment === 'string') {\n return reKeySegment.test(segment.trim())\n }\n\n return typeof segment === 'object' && '_key' in segment\n}\n\n/** @internal */\nexport function isIndexTuple(segment: PathSegment): segment is IndexTuple {\n if (typeof segment === 'string' && reIndexTuple.test(segment)) {\n return true\n }\n\n if (!Array.isArray(segment) || segment.length !== 2) {\n return false\n }\n\n const [from, to] = segment\n return (typeof from === 'number' || from === '') && (typeof to === 'number' || to === '')\n}\n","import {type PortableTextObject, type PortableTextSpan, type PortableTextTextBlock} from './types'\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return !!value && (typeof value == 'object' || typeof value == 'function')\n}\n\n/**\n * Assert that a given object is a portable-text text-block type object\n *\n * @remarks\n * * The `markDefs` and `style` property of a block is optional.\n * * Block types can be named, so expect anything of the _type property.\n *\n * @alpha\n */\nexport function isPortableTextTextBlock<T = PortableTextSpan | PortableTextObject>(\n value: unknown,\n): value is PortableTextTextBlock<T> {\n return (\n isRecord(value) &&\n typeof value._type === 'string' && // block types can be named, so expect anything here.\n Array.isArray(value.children) &&\n value.children.every((child) => isRecord(child)) &&\n ('markDefs' in value // optional property\n ? Array.isArray(value.markDefs) && value.markDefs.every((def) => isRecord(def))\n : true) &&\n ('style' in value ? typeof value.style === 'string' : true) // optional property\n )\n}\n\n/**\n * Assert that a given object is a portable-text span-type object\n *\n * @remarks\n * The `marks` property of a block is optional.\n *\n * @alpha\n */\nexport function isPortableTextSpan(value: unknown): value is PortableTextSpan {\n return (\n isRecord(value) &&\n value._type === 'span' &&\n typeof value.text === 'string' &&\n ('marks' in value // optional property\n ? Array.isArray(value.marks) && value.marks.every((mark) => typeof mark === 'string')\n : true)\n )\n}\n\n/**\n * Assert that a given object is a portable-text list-text-block-type object\n *\n * @remarks\n * Uses `isPortableTextTextBlock` and checks for `listItem` and `level`\n *\n * @see isPortableTextTextBlock\n *\n * @alpha\n */\nexport function isPortableTextListBlock<T = PortableTextSpan | PortableTextObject>(\n value: unknown,\n): value is PortableTextTextBlock<T> {\n return (\n isPortableTextTextBlock(value) &&\n 'listItem' in value &&\n typeof value.listItem === 'string' &&\n 'level' in value &&\n Number.isInteger(value.level)\n )\n}\n","import {type CrossDatasetReferenceSchemaType} from '../crossDatasetReference'\nimport {type TitledListValue} from './definition'\nimport {\n type ArraySchemaType,\n type BaseSchemaType,\n type BlockChildrenObjectField,\n type BlockListObjectField,\n type BlockSchemaType,\n type BlockStyleObjectField,\n type BooleanSchemaType,\n type DeprecatedSchemaType,\n type DeprecationConfiguration,\n type FileSchemaType,\n type ImageSchemaType,\n type NumberSchemaType,\n type ObjectSchemaType,\n type ReferenceSchemaType,\n type SchemaType,\n type SpanSchemaType,\n type StringSchemaType,\n} from './types'\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return !!value && (typeof value == 'object' || typeof value == 'function')\n}\n\n/**\n * Returns wether or not the given type is a document type\n * (eg that it was defined as `type: 'document'`)\n *\n * @param type - Schema type to test\n * @returns True if type is a document type, false otherwise\n *\n * @public\n */\nexport function isDocumentSchemaType(type: unknown): type is ObjectSchemaType {\n if (!isObjectSchemaType(type)) {\n return false\n }\n\n let current: SchemaType | undefined = type as SchemaType\n while (current) {\n if (current.name === 'document') {\n return true\n }\n\n current = current.type\n }\n return false\n}\n\n/** @internal */\nexport function isObjectSchemaType(type: unknown): type is ObjectSchemaType {\n if (!isRecord(type)) return false\n return type.jsonType === 'object'\n}\n\n/** @internal */\nexport function isArraySchemaType(type: unknown): type is ArraySchemaType {\n if (!isRecord(type)) return false\n return type.jsonType === 'array'\n}\n\n/** @internal */\nexport function isArrayOfBlocksSchemaType(\n type: unknown,\n): type is ArraySchemaType<ObjectSchemaType> {\n return isArraySchemaType(type) && type.of.some((memberType) => isBlockSchemaType(memberType))\n}\n\n/** @internal */\nexport function isArrayOfObjectsSchemaType(\n type: unknown,\n): type is ArraySchemaType<ObjectSchemaType> {\n return isArraySchemaType(type) && type.of.every((memberType) => isObjectSchemaType(memberType))\n}\n\n/** @internal */\nexport function isArrayOfPrimitivesSchemaType(type: unknown): type is ArraySchemaType {\n return isArraySchemaType(type) && type.of.every((memberType) => isPrimitiveSchemaType(memberType))\n}\n\n/** @internal */\nexport function isBooleanSchemaType(type: unknown): type is BooleanSchemaType {\n if (!isRecord(type)) return false\n return type.jsonType === 'boolean'\n}\n\n/** @internal */\nexport function isStringSchemaType(type: unknown): type is StringSchemaType {\n if (!isRecord(type)) return false\n return type.jsonType === 'string'\n}\n\n/** @internal */\nexport function isDateTimeSchemaType(type: unknown): type is StringSchemaType {\n if (!isStringSchemaType(type)) return false\n return type.name === 'datetime'\n}\n\n/** @internal */\nexport function isNumberSchemaType(type: unknown): type is NumberSchemaType {\n if (!isRecord(type)) return false\n return type.jsonType === 'number'\n}\n\n/** @internal */\nexport function isPrimitiveSchemaType(\n type: unknown,\n): type is BooleanSchemaType | StringSchemaType | NumberSchemaType {\n return isBooleanSchemaType(type) || isStringSchemaType(type) || isNumberSchemaType(type)\n}\n\n/** @internal */\nexport function isReferenceSchemaType(type: unknown): type is ReferenceSchemaType {\n return isRecord(type) && (type.name === 'reference' || isReferenceSchemaType(type.type))\n}\n\n/** @internal */\nexport function isImageSchemaType(type: unknown): type is ImageSchemaType {\n return isRecord(type) && (type.name === 'image' || isImageSchemaType(type.type))\n}\n\n/** @internal */\nexport function isFileSchemaType(type: unknown): type is FileSchemaType {\n return isRecord(type) && (type.name === 'file' || isFileSchemaType(type.type))\n}\n\n/** @internal */\nexport function isDeprecatedSchemaType<TSchemaType extends BaseSchemaType>(\n type: TSchemaType,\n): type is DeprecatedSchemaType<TSchemaType> {\n if (!isRecord(type)) return false\n return typeof type.deprecated !== 'undefined'\n}\n\n/** @internal */\nexport function isDeprecationConfiguration(type: unknown): type is DeprecationConfiguration {\n if (!isRecord(type)) return false\n return typeof type.deprecated !== 'undefined'\n}\n\n/** @internal */\nexport function isCrossDatasetReferenceSchemaType(\n type: unknown,\n): type is CrossDatasetReferenceSchemaType {\n return (\n isRecord(type) &&\n (type.name === 'crossDatasetReference' || isCrossDatasetReferenceSchemaType(type.type))\n )\n}\n\n/** @internal */\nexport function isTitledListValue(item: unknown): item is TitledListValue {\n return typeof item === 'object' && item !== null && 'title' in item && 'value' in item\n}\n\n/** @internal */\nexport function isSpanSchemaType(type: unknown): type is SpanSchemaType {\n if (!isRecord(type)) return false\n // we check for `annotations` and `decorators` instead of `type.name` because\n // schema names can technically change if someone extends the type\n return Array.isArray(type.annotations) && Array.isArray(type.decorators)\n}\n\n/** @internal */\nexport function isBlockSchemaType(type: unknown): type is BlockSchemaType {\n if (!isRecord(type)) return false\n if (!Array.isArray(type.fields)) return false\n const maybeSpanChildren = type.fields.find(isBlockChildrenObjectField)\n const maybeStyle = type.fields.find(isBlockStyleObjectField)\n const maybeList = type.fields.find(isBlockListObjectField)\n return (\n isBlockChildrenObjectField(maybeSpanChildren) &&\n isBlockStyleObjectField(maybeStyle) &&\n isBlockListObjectField(maybeList)\n )\n}\n\n/** @internal */\nexport function isBlockStyleObjectField(field: unknown): field is BlockStyleObjectField {\n if (!isRecord(field)) return false\n if (field.name !== 'style') return false\n return isRecord(field.type) && field.type.jsonType === 'string'\n}\n\n/** @internal */\nexport function isBlockListObjectField(field: unknown): field is BlockListObjectField {\n if (!isRecord(field)) return false\n if (field.name !== 'listItem') return false\n return isRecord(field.type) && field.type.jsonType === 'string'\n}\n\n/** @internal */\nexport function isBlockChildrenObjectField(field: unknown): field is BlockChildrenObjectField {\n if (!isRecord(field)) return false\n if (field.name !== 'children') return false\n if (!isArraySchemaType(field.type)) return false\n // there will always be a span item in `SpanChildrenObjectField`\n return field.type.of.some(isSpanSchemaType)\n}\n","import {\n type DefineArrayMemberBase,\n type DefineSchemaBase,\n type DefineSchemaOptions,\n type MaybeAllowUnknownProps,\n type NarrowPreview,\n type StrictDefinition,\n type WidenInitialValue,\n type WidenValidation,\n} from './defineTypes'\nimport {type FieldDefinitionBase, type IntrinsicTypeName} from './definition'\nimport {type AutocompleteString} from './types'\n\n/**\n * Helper function for defining a Sanity type definition. This function does not do anything on its own;\n * it exists to check that your schema definition is correct, and help autocompletion in your IDE.\n *\n * This function will narrow the schema type down to fields and options based on the provided type-string.\n *\n * Schema types defined using `defineType` should typically be added to the Studio config under `schema.types`.\n * Defined types can be referenced by their `name`. This is referred to as a type-alias.\n *\n * When using type-aliases as `type`, `defineType` cannot know the base-type, so type-safety will be reduced.\n * If you know the base type of the type-alias, provide `defineOptions.aliasFor: <base type name>`.\n * This will enforce that the schema definition conforms with the provided type.\n *\n * By default, `defineType` only allows known properties and options.\n * Use `defineOptions.strict: false` to allow unknown properties and options.\n *\n * ### Basic usage\n *\n * ```ts\n * defineType({\n * type: 'object',\n * name: 'custom-object',\n * fields: [ {type: 'string', name: 'title', title: 'Title'}],\n * })\n * ```\n *\n * ### Usage with aliasFor narrowing\n *\n * ```ts\n * defineType({\n * type: 'custom-object',\n * name: 'redefined-custom-object',\n * options: {\n * columns: 2\n * }\n * }, {aliasFor: 'object' })\n * ```\n *\n * ### Allow unknown properties\n *\n * ```ts\n * defineType({\n * type: 'custom-object',\n * name: 'redefined-custom-object',\n * allowsUnknownProperties: true\n * options: {\n * columns: 2,\n * allowsUnknownOptions: true\n * }\n * }, {strict: false})\n * ```\n * ### Maximum safety and best autocompletion\n *\n * Use {@link defineType}, {@link defineField} and {@link defineArrayMember}:\n *\n * ```ts\n * defineType({\n * type: 'object',\n * name: 'custom-object',\n * fields: [\n * defineField({\n * type: 'array',\n * name: 'arrayField',\n * title: 'Things',\n * of: [\n * defineArrayMember({\n * type: 'object',\n * name: 'type-name-in-array',\n * fields: [defineField({type: 'string', name: 'title', title: 'Title'})],\n * }),\n * ],\n * }),\n * ],\n * })\n * ```\n *\n * ## Note on type-safety in the current implementation\n *\n * Type-safety inside array-like properties (schema properties like `fields` and `of`) can only be guaranteed when\n * {@link defineField} and {@link defineArrayMember} are used to wrap each value in the array.\n *\n * For array-values without a function-wrapper, TypeScript will resolve to a union type of all possible properties across\n * all schema types. This result in less precise typing.\n *\n * ### Extending the Sanity Schema types\n *\n * If you want to extend the Sanity Schema types with your own properties or options to make them typesafe,\n * you can use [TypeScript declaration merging](https://www.typescriptlang.org/docs/handbook/declaration-merging.html).\n *\n * With declaration merging, properties and options will be available in a type-safe manner, and\n * `strict: false` will not be necessary.\n *\n * #### Example: Add option to StringOptions\n *\n * ```ts\n * // string.ts\n *\n * //redeclare the sanity module\n * declare module 'sanity' {\n * // redeclare StringOptions; it will be merged with StringOptions in the sanity module\n * export interface StringOptions {\n * myCustomOption?: boolean\n * }\n * }\n *\n * // the option is now part of the StringOptions type, just as if it was declared in the sanity codebase:\n * defineType({\n * type: 'string',\n * name: 'my-string',\n * options: {\n * myCustomOption: true // this does not give an error anymore\n * }\n * })\n *\n * ```\n *\n * #### Example: Add a schema definition to \"intrinsic-types\"\n *\n * ```ts\n * //my-custom-type-definition.ts\n *\n * // create a new schema definition based on object (we remove the ability to assign field, change the type add some options)\n * export type MagicallyAddedDefinition = Omit<Schema.ObjectDefinition, 'type' | 'fields'> & {\n * type: 'magically-added-type'\n * options?: {\n * sparkles?: boolean\n * }\n * }\n *\n * // redeclares sanity module so we can add interfaces props to it\n * declare module 'sanity' {\n * // redeclares IntrinsicDefinitions and adds a named definition to it\n * // it is important that the key is the same as the type in the definition ('magically-added-type')\n * export interface IntrinsicDefinitions {\n * 'magically-added-type': MagicallyAddedDefinition\n * }\n * }\n *\n * // defineType will now narrow `type: 'magically-added-type'` to `MagicallyAddedDefinition`\n * defineType({\n * type: 'magically-added-type'\n * name: 'magic',\n * options: {\n * sparkles: true // this is allowed,\n * //@ts-expect-error this is not allowed in MagicallyAddedDefinition.options\n * sparks: true\n * }\n * })\n * ```\n *\n * @param schemaDefinition - should be a valid schema type definition.\n * @param defineOptions - optional param to provide type hints for `schemaDefinition`.\n *\n * @see defineField\n * @see defineArrayMember\n * @see typed\n *\n * @beta\n */\nexport function defineType<\n const TType extends IntrinsicTypeName | AutocompleteString,\n const TName extends string,\n TSelect extends Record<string, string> | undefined,\n TPrepareValue extends Record<keyof TSelect, any> | undefined,\n TAlias extends IntrinsicTypeName | undefined,\n TStrict extends StrictDefinition,\n>(\n schemaDefinition: {\n type: TType\n name: TName\n } & DefineSchemaBase<TType, TAlias> &\n NarrowPreview<TType, TAlias, TSelect, TPrepareValue> &\n MaybeAllowUnknownProps<TStrict>,\n\n defineOptions?: DefineSchemaOptions<TStrict, TAlias>,\n): typeof schemaDefinition {\n return schemaDefinition\n}\n\n/**\n * Define a field within a document, object, image or file definition `fields` array.\n *\n * This function will narrow the schema type down to fields and options based on the provided\n * type-string.\n *\n * Using `defineField` is optional, but should provide improved autocompletion in your IDE, when building your schema.\n * Field-properties like `validation` and `initialValue`will also be more specific.\n *\n * See {@link defineType} for more examples.\n *\n * @param schemaField - should be a valid field type definition.\n * @param defineOptions - optional param to provide type hints for `schemaField`.\n *\n * @see defineField\n * @see defineArrayMember\n * @see typed\n *\n * @beta\n */\nexport function defineField<\n const TType extends IntrinsicTypeName | AutocompleteString,\n const TName extends string,\n TSelect extends Record<string, string> | undefined,\n TPrepareValue extends Record<keyof TSelect, any> | undefined,\n TAlias extends IntrinsicTypeName | undefined,\n TStrict extends StrictDefinition,\n>(\n schemaField: {\n type: TType\n name: TName\n } & DefineSchemaBase<TType, TAlias> &\n NarrowPreview<TType, TAlias, TSelect, TPrepareValue> &\n MaybeAllowUnknownProps<TStrict> &\n FieldDefinitionBase,\n\n defineOptions?: DefineSchemaOptions<TStrict, TAlias>,\n): typeof schemaField & WidenValidation & WidenInitialValue {\n // TODO: re-evaluate the need for this cast\n return schemaField as typeof schemaField & WidenValidation & WidenInitialValue\n}\n\n/**\n * Define an array item member type within an array definition `of`-array.\n *\n * This function will narrow the schema type down to fields and options based on the provided\n * `type` string.\n *\n * Using `defineArrayMember` is optional, but should provide improved autocompletion in your IDE, when building your schema.\n * Field properties like `validation` and `initialValue` will also be more specific.\n *\n * See {@link defineType} for example usage.\n *\n * @param arrayOfSchema - should be a valid `array.of` member definition.\n * @param defineOptions - optional param to provide type hints for `arrayOfSchema`.\n *\n * @see defineType\n * @see defineField\n * @see typed\n *\n * @beta\n */\nexport function defineArrayMember<\n const TType extends IntrinsicTypeName | AutocompleteString,\n const TName extends string,\n TSelect extends Record<string, string> | undefined,\n TPrepareValue extends Record<keyof TSelect, any> | undefined,\n TAlias extends IntrinsicTypeName | undefined,\n TStrict extends StrictDefinition,\n>(\n arrayOfSchema: {\n type: TType\n /**\n * When provided, `name` is used as `_type` for the array item when stored.\n *\n * Necessary when an array contains multiple entries with the same `type`, each with\n * different configuration (title and initialValue for instance).\n */\n name?: TName\n } & DefineArrayMemberBase<TType, TAlias> &\n NarrowPreview<TType, TAlias, TSelect, TPrepareValue> &\n MaybeAllowUnknownProps<TStrict>,\n\n defineOptions?: DefineSchemaOptions<TStrict, TAlias>,\n): typeof arrayOfSchema & WidenValidation & WidenInitialValue {\n // TODO: re-evaluate the need for this cast\n return arrayOfSchema as typeof arrayOfSchema & WidenValidation & WidenInitialValue\n}\n\n/**\n * `typed` can be used to ensure that an object conforms to an exact interface.\n *\n * It can be useful when working with `defineType` and `defineField` on occasions where a wider type with\n * custom options or properties is required.\n *\n * ## Example usage\n * ```ts\n * defineField({\n * type: 'string',\n * name: 'nestedField',\n * options: typed<StringOptions & {myCustomOption: boolean}>({\n * layout: 'radio',\n * // allowed\n * myCustomOption: true,\n * //@ts-expect-error unknownProp is not part of StringOptions & {myCustomOption: boolean}\n * unknownProp: 'not allowed in typed context',\n * }),\n * }),\n * ```\n *\n * @param input - returned directly\n *\n * @internal\n */\nexport function typed<T>(input: T): T {\n return input\n}\n","/**\n * @public\n */\nexport const searchStrategies = ['groqLegacy', 'groq2024'] as const\n\n/**\n * @public\n */\nexport type SearchStrategy = (typeof searchStrategies)[number]\n","import {searchStrategies, type SearchStrategy} from './types'\n\n/**\n * @internal\n */\nexport function isSearchStrategy(\n maybeSearchStrategy: unknown,\n): maybeSearchStrategy is SearchStrategy {\n return searchStrategies.includes(maybeSearchStrategy as SearchStrategy)\n}\n","import {isObject} from '../helpers'\nimport {type Slug} from './types'\n\n/**\n * Checks whether the given `thing` is a slug, eg an object with a `current` string property.\n *\n * @param thing - The thing to check\n * @returns True if slug, false otherwise\n * @public\n */\nexport function isSlug(thing: unknown): thing is Slug {\n return isObject(thing) && typeof thing.current === 'string'\n}\n","import {type Mutation} from '../mutations'\nimport {type CreateSquashedMutation, type TransactionLogMutation} from './types'\n\n/** @internal */\nexport function isCreateSquashedMutation(\n mutation: Mutation | TransactionLogMutation,\n): mutation is CreateSquashedMutation {\n return 'createSquashed' in mutation\n}\n","import {type FormNodeValidation} from './types'\n\n/** @internal */\nexport function isValidationError(\n node: FormNodeValidation,\n): node is FormNodeValidation & {level: 'error'} {\n return node.level === 'error'\n}\n\n/** @internal */\nexport function isValidationWarning(\n node: FormNodeValidation,\n): node is FormNodeValidation & {level: 'warning'} {\n return node.level === 'warning'\n}\n\n/** @internal */\nexport function isValidationInfo(\n node: FormNodeValidation,\n): node is FormNodeValidation & {level: 'info'} {\n return node.level === 'info'\n}\n"],"names":["isRecord"],"mappings":"AAAO,SAAS,SAAS,KAA8C;AACrE,SAAO,OAAO,OAAQ,YAAY,QAAQ,QAAQ,CAAC,MAAM,QAAQ,G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