@sanity/blueprints 0.34.1 → 0.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -2
- package/dist/definers/agents.d.ts +3 -1
- package/dist/definers/agents.js +4 -2
- package/dist/definers/agents.js.map +1 -1
- package/dist/definers/applications.d.ts +30 -18
- package/dist/definers/applications.js +36 -24
- package/dist/definers/applications.js.map +1 -1
- package/dist/definers/blueprints.d.ts +1 -0
- package/dist/definers/blueprints.js +5 -27
- package/dist/definers/blueprints.js.map +1 -1
- package/dist/definers/context.d.ts +6 -2
- package/dist/definers/context.js +8 -4
- package/dist/definers/context.js.map +1 -1
- package/dist/definers/cors.d.ts +11 -1
- package/dist/definers/cors.js +11 -13
- package/dist/definers/cors.js.map +1 -1
- package/dist/definers/datasets.d.ts +30 -3
- package/dist/definers/datasets.js +32 -16
- package/dist/definers/datasets.js.map +1 -1
- package/dist/definers/functions/document.d.ts +29 -0
- package/dist/definers/functions/document.js +1 -1
- package/dist/definers/functions/document.js.map +1 -1
- package/dist/definers/functions/durable.d.ts +4 -3
- package/dist/definers/functions/durable.js +5 -4
- package/dist/definers/functions/durable.js.map +1 -1
- package/dist/definers/functions/index.js +1 -1
- package/dist/definers/functions/index.js.map +1 -1
- package/dist/definers/functions/media-library.d.ts +30 -0
- package/dist/definers/functions/media-library.js +19 -21
- package/dist/definers/functions/media-library.js.map +1 -1
- package/dist/definers/functions/pubsub.d.ts +2 -3
- package/dist/definers/functions/pubsub.js +3 -4
- package/dist/definers/functions/pubsub.js.map +1 -1
- package/dist/definers/functions/queue.d.ts +26 -6
- package/dist/definers/functions/queue.js +31 -10
- package/dist/definers/functions/queue.js.map +1 -1
- package/dist/definers/functions/scheduled.d.ts +7 -6
- package/dist/definers/functions/scheduled.js +8 -7
- package/dist/definers/functions/scheduled.js.map +1 -1
- package/dist/definers/functions/sync-tag-invalidate.d.ts +5 -2
- package/dist/definers/functions/sync-tag-invalidate.js +6 -3
- package/dist/definers/functions/sync-tag-invalidate.js.map +1 -1
- package/dist/definers/installation-config.d.ts +4 -2
- package/dist/definers/installation-config.js +5 -3
- package/dist/definers/installation-config.js.map +1 -1
- package/dist/definers/permissions.d.ts +8 -2
- package/dist/definers/permissions.js +12 -5
- package/dist/definers/permissions.js.map +1 -1
- package/dist/definers/projects.d.ts +3 -4
- package/dist/definers/projects.js +4 -5
- package/dist/definers/projects.js.map +1 -1
- package/dist/definers/resources.d.ts +1 -0
- package/dist/definers/resources.js +1 -11
- package/dist/definers/resources.js.map +1 -1
- package/dist/definers/robotTokens.d.ts +22 -4
- package/dist/definers/robotTokens.js +53 -20
- package/dist/definers/robotTokens.js.map +1 -1
- package/dist/definers/roles.d.ts +49 -9
- package/dist/definers/roles.js +54 -55
- package/dist/definers/roles.js.map +1 -1
- package/dist/definers/studios.d.ts +5 -3
- package/dist/definers/studios.js +6 -4
- package/dist/definers/studios.js.map +1 -1
- package/dist/definers/webhooks.d.ts +19 -1
- package/dist/definers/webhooks.js +18 -22
- package/dist/definers/webhooks.js.map +1 -1
- package/dist/index.d.ts +18 -18
- package/dist/index.js +19 -20
- package/dist/index.js.map +1 -1
- package/dist/resolve/index.d.ts +2 -3
- package/dist/resolve/index.js +2 -3
- package/dist/resolve/index.js.map +1 -1
- package/dist/types/agents.d.ts +7 -3
- package/dist/types/applications.d.ts +68 -50
- package/dist/types/applications.js +9 -6
- package/dist/types/applications.js.map +1 -1
- package/dist/types/context.d.ts +17 -7
- package/dist/types/cors.d.ts +0 -2
- package/dist/types/datasets.d.ts +0 -6
- package/dist/types/functions/index.d.ts +96 -21
- package/dist/types/functions/index.js +2 -1
- package/dist/types/functions/index.js.map +1 -1
- package/dist/types/installation-config.d.ts +14 -11
- package/dist/types/permissions.d.ts +8 -4
- package/dist/types/projects.d.ts +5 -4
- package/dist/types/robotTokens.d.ts +14 -4
- package/dist/types/roles.d.ts +10 -9
- package/dist/types/studios.d.ts +29 -14
- package/dist/types/studios.js +3 -2
- package/dist/types/studios.js.map +1 -1
- package/dist/types/webhooks.d.ts +0 -3
- package/dist/utils/debounce.d.ts +0 -11
- package/dist/utils/debounce.js +0 -22
- package/dist/utils/debounce.js.map +1 -1
- package/dist/utils/parse-duration.d.ts +13 -0
- package/dist/utils/parse-duration.js +24 -0
- package/dist/utils/parse-duration.js.map +1 -1
- package/dist/utils/throttle.d.ts +9 -0
- package/dist/utils/throttle.js +22 -0
- package/dist/utils/throttle.js.map +1 -0
- package/dist/utils/validation.d.ts +14 -11
- package/dist/utils/validation.js +25 -17
- package/dist/utils/validation.js.map +1 -1
- package/dist/validation/applications.js +7 -2
- package/dist/validation/applications.js.map +1 -1
- package/dist/validation/blueprints.js +120 -4
- package/dist/validation/blueprints.js.map +1 -1
- package/dist/validation/functions.d.ts +19 -0
- package/dist/validation/functions.js +169 -36
- package/dist/validation/functions.js.map +1 -1
- package/dist/validation/projects.js +3 -0
- package/dist/validation/projects.js.map +1 -1
- package/dist/validation/resources.js +1 -1
- package/dist/validation/resources.js.map +1 -1
- package/dist/validation/studios.js +4 -0
- package/dist/validation/studios.js.map +1 -1
- package/package.json +1 -1
- package/src/definers/agents.ts +4 -2
- package/src/definers/applications.ts +36 -24
- package/src/definers/blueprints.ts +4 -27
- package/src/definers/context.ts +8 -4
- package/src/definers/cors.ts +11 -13
- package/src/definers/datasets.ts +40 -16
- package/src/definers/functions/document.ts +17 -25
- package/src/definers/functions/durable.ts +5 -4
- package/src/definers/functions/index.ts +1 -1
- package/src/definers/functions/media-library.ts +19 -21
- package/src/definers/functions/pubsub.ts +3 -4
- package/src/definers/functions/queue.ts +31 -10
- package/src/definers/functions/scheduled.ts +8 -7
- package/src/definers/functions/sync-tag-invalidate.ts +6 -3
- package/src/definers/installation-config.ts +5 -3
- package/src/definers/permissions.ts +14 -6
- package/src/definers/projects.ts +4 -5
- package/src/definers/resources.ts +1 -11
- package/src/definers/robotTokens.ts +55 -20
- package/src/definers/roles.ts +60 -58
- package/src/definers/studios.ts +6 -4
- package/src/definers/webhooks.ts +18 -23
- package/src/index.ts +20 -21
- package/src/resolve/index.ts +2 -4
- package/src/types/agents.ts +7 -3
- package/src/types/applications.ts +68 -50
- package/src/types/context.ts +17 -7
- package/src/types/cors.ts +0 -2
- package/src/types/datasets.ts +0 -6
- package/src/types/functions/index.ts +100 -21
- package/src/types/installation-config.ts +14 -11
- package/src/types/permissions.ts +8 -4
- package/src/types/projects.ts +6 -4
- package/src/types/robotTokens.ts +15 -4
- package/src/types/roles.ts +10 -9
- package/src/types/studios.ts +33 -14
- package/src/types/webhooks.ts +0 -3
- package/src/utils/debounce.ts +0 -25
- package/src/utils/parse-duration.ts +27 -0
- package/src/utils/throttle.ts +25 -0
- package/src/utils/validation.ts +24 -17
- package/src/validation/applications.ts +6 -2
- package/src/validation/blueprints.ts +132 -5
- package/src/validation/functions.ts +183 -37
- package/src/validation/projects.ts +4 -0
- package/src/validation/resources.ts +1 -1
- package/src/validation/studios.ts +3 -0
package/src/definers/webhooks.ts
CHANGED
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
import {type BlueprintDocumentWebhookConfig, type BlueprintDocumentWebhookResource, validateDocumentWebhook} from '../index.js'
|
|
2
2
|
import {runValidation} from '../utils/validation.js'
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
*
|
|
4
|
+
/**
|
|
5
|
+
* Defines a webhook that is called when document changes occur.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```ts
|
|
9
|
+
* defineDocumentWebhook({
|
|
10
|
+
* name: 'my-webhook',
|
|
11
|
+
* on: ['create'],
|
|
12
|
+
* url: 'https://example.com/webhook',
|
|
13
|
+
* projection: '{_id}',
|
|
14
|
+
* dataset: 'production',
|
|
15
|
+
* apiVersion: 'v2026-01-01',
|
|
16
|
+
* })
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
6
19
|
* @example All options
|
|
7
20
|
* ```ts
|
|
8
21
|
* defineDocumentWebhook({
|
|
@@ -20,39 +33,21 @@ import {runValidation} from '../utils/validation.js'
|
|
|
20
33
|
* status: 'enabled',
|
|
21
34
|
* })
|
|
22
35
|
* ```
|
|
23
|
-
*/
|
|
24
|
-
/**
|
|
25
|
-
* Defines a webhook that is called when document changes occur.
|
|
26
|
-
*
|
|
27
|
-
* ```ts
|
|
28
|
-
* defineDocumentWebhook({
|
|
29
|
-
* name: 'my-webhook',
|
|
30
|
-
* on: ['create'],
|
|
31
|
-
* url: 'https://example.com/webhook',
|
|
32
|
-
* projection: '{_id}',
|
|
33
|
-
* dataset: 'production',
|
|
34
|
-
* apiVersion: 'v2026-01-01',
|
|
35
|
-
* })
|
|
36
|
-
* ```
|
|
37
36
|
* @param parameters The webhook configuration
|
|
38
37
|
* @public
|
|
39
|
-
* @beta Deploying Webhooks via Blueprints is experimental. This feature is stabilizing but may still be subject to breaking changes.
|
|
40
38
|
* @category Definers
|
|
41
39
|
* @expandType BlueprintDocumentWebhookConfig
|
|
42
40
|
* @returns The webhook resource
|
|
43
41
|
*/
|
|
44
42
|
export function defineDocumentWebhook(parameters: BlueprintDocumentWebhookConfig): BlueprintDocumentWebhookResource {
|
|
45
|
-
// default the display name
|
|
46
|
-
if (!parameters.displayName) {
|
|
47
|
-
parameters.displayName = parameters.name.substring(0, 100)
|
|
48
|
-
}
|
|
49
|
-
|
|
50
43
|
const webhookResource: BlueprintDocumentWebhookResource = {
|
|
51
44
|
...parameters,
|
|
45
|
+
// default the display name
|
|
46
|
+
displayName: parameters.displayName || parameters.name.substring(0, 100),
|
|
52
47
|
type: 'sanity.project.webhook',
|
|
53
48
|
}
|
|
54
49
|
|
|
55
|
-
runValidation(() => validateDocumentWebhook(webhookResource))
|
|
50
|
+
runValidation(webhookResource, () => validateDocumentWebhook(webhookResource))
|
|
56
51
|
|
|
57
52
|
return webhookResource
|
|
58
53
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,12 +1,29 @@
|
|
|
1
|
-
// DEFINERS - helper functions to create resources
|
|
2
1
|
/**
|
|
2
|
+
* @packageDocumentation
|
|
3
|
+
*
|
|
3
4
|
* @categoryDescription Definers
|
|
4
5
|
* These functions are used to define resources in a Blueprint.
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
*
|
|
7
|
+
* @categoryDescription Application Children
|
|
8
|
+
* These functions define the views and web workers of an application. Pass them to `defineApplication`.
|
|
9
|
+
*
|
|
7
10
|
* @categoryDescription Referencers
|
|
8
11
|
* These functions are used to reference resources in another Blueprint.
|
|
12
|
+
*
|
|
13
|
+
* @categoryDescription Resource Types
|
|
14
|
+
* These types are used to define the shape of resources in a Blueprint.
|
|
15
|
+
*
|
|
16
|
+
* @categoryDescription Functions Types
|
|
17
|
+
* Resource types for functions in a Blueprint.
|
|
18
|
+
*
|
|
19
|
+
* @categoryDescription Validation
|
|
20
|
+
* These functions are used to validate resources in a Blueprint.
|
|
21
|
+
*
|
|
22
|
+
* @categoryDescription Blueprint Internals
|
|
23
|
+
* Shared types that Blueprints and resources are built on. Definers and resource types use them, so most code does not need to import them.
|
|
9
24
|
*/
|
|
25
|
+
|
|
26
|
+
// DEFINERS - helper functions to create resources
|
|
10
27
|
export * from './definers/agents.js'
|
|
11
28
|
export * from './definers/applications.js'
|
|
12
29
|
export * from './definers/blueprints.js'
|
|
@@ -32,14 +49,6 @@ export * from './definers/studios.js'
|
|
|
32
49
|
export * from './definers/webhooks.js'
|
|
33
50
|
|
|
34
51
|
// TYPES - base types for all resources
|
|
35
|
-
/**
|
|
36
|
-
* @categoryDescription Resource Types
|
|
37
|
-
* These types are used to define the shape of resources in a Blueprint.
|
|
38
|
-
*/
|
|
39
|
-
/**
|
|
40
|
-
* @categoryDescription Functions Types
|
|
41
|
-
* Resource types for functions in a Blueprint.
|
|
42
|
-
*/
|
|
43
52
|
export * from './types/agents.js'
|
|
44
53
|
export * from './types/applications.js'
|
|
45
54
|
export * from './types/blueprints.js'
|
|
@@ -59,10 +68,6 @@ export * from './types/studios.js'
|
|
|
59
68
|
export * from './types/webhooks.js'
|
|
60
69
|
|
|
61
70
|
// VALIDATION - validation for all resources
|
|
62
|
-
/**
|
|
63
|
-
* @categoryDescription Validation
|
|
64
|
-
* These functions are used to validate resources in a Blueprint.
|
|
65
|
-
*/
|
|
66
71
|
export * from './validation/agents.js'
|
|
67
72
|
export * from './validation/applications.js'
|
|
68
73
|
export * from './validation/blueprints.js'
|
|
@@ -79,9 +84,3 @@ export * from './validation/robotTokens.js'
|
|
|
79
84
|
export * from './validation/roles.js'
|
|
80
85
|
export * from './validation/studios.js'
|
|
81
86
|
export * from './validation/webhooks.js'
|
|
82
|
-
|
|
83
|
-
// Public BLUEPRINTS INTERNALS - published bucket of misc Blueprint types
|
|
84
|
-
/**
|
|
85
|
-
* @categoryDescription Blueprint Internals
|
|
86
|
-
* Miscellaneous Blueprint types that make up the public API but are not exported directly.
|
|
87
|
-
*/
|
package/src/resolve/index.ts
CHANGED
|
@@ -6,12 +6,10 @@
|
|
|
6
6
|
* {@link readStack} reads remote stack.
|
|
7
7
|
*
|
|
8
8
|
* This entry point imports Node built-ins, so it is separate from `@sanity/blueprints`.
|
|
9
|
-
*
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
/**
|
|
9
|
+
*
|
|
13
10
|
* @categoryDescription Resolve
|
|
14
11
|
* These functions read a blueprint from disk, resolve the Stack it deploys to, and read that Stack from the Blueprints API.
|
|
12
|
+
* @module
|
|
15
13
|
*/
|
|
16
14
|
export {
|
|
17
15
|
BLUEPRINT_FILE_NAMES,
|
package/src/types/agents.ts
CHANGED
|
@@ -3,9 +3,11 @@ import type {BlueprintProjectResourceLifecycle, BlueprintResource} from '../inde
|
|
|
3
3
|
/**
|
|
4
4
|
* The model value carried on a {@link BlueprintAgentResource}.
|
|
5
5
|
*
|
|
6
|
+
* This feature is subject to breaking changes.
|
|
7
|
+
*
|
|
6
8
|
* @remarks
|
|
7
9
|
* `provider`, `id`, and `baseURL` are non-secret and ride on the resource literally; `apiKey` is passed by reference and resolved at blueprint-eval time.
|
|
8
|
-
* @alpha
|
|
10
|
+
* @alpha
|
|
9
11
|
* @hidden
|
|
10
12
|
* @category Resource Types
|
|
11
13
|
*/
|
|
@@ -22,7 +24,9 @@ export interface BlueprintAgentModel {
|
|
|
22
24
|
|
|
23
25
|
/**
|
|
24
26
|
* Represents an Agent resource.
|
|
25
|
-
*
|
|
27
|
+
*
|
|
28
|
+
* This feature is subject to breaking changes.
|
|
29
|
+
* @alpha
|
|
26
30
|
* @hidden
|
|
27
31
|
* @category Resource Types
|
|
28
32
|
*/
|
|
@@ -42,7 +46,7 @@ export interface BlueprintAgentResource extends BlueprintResource<BlueprintProje
|
|
|
42
46
|
|
|
43
47
|
/**
|
|
44
48
|
* Configuration for an Agent resource.
|
|
45
|
-
* @alpha
|
|
49
|
+
* @alpha
|
|
46
50
|
* @hidden
|
|
47
51
|
* @category Resource Types
|
|
48
52
|
* @interface
|
|
@@ -3,61 +3,68 @@ import type {ApplicationVisibility, BlueprintResource} from '../index.js'
|
|
|
3
3
|
/**
|
|
4
4
|
* The set of valid tile footprint families.
|
|
5
5
|
*
|
|
6
|
+
* This feature is subject to breaking changes.
|
|
7
|
+
*
|
|
6
8
|
* Modelled on widget families rather than a linear scale: `banner` is
|
|
7
9
|
* full-width and shallow, which a `small` → `large` magnitude can't express.
|
|
8
|
-
* @beta
|
|
10
|
+
* @beta
|
|
9
11
|
* @category Resource Types
|
|
10
|
-
* @hidden
|
|
11
12
|
*/
|
|
12
13
|
export const APPLICATION_TILE_SIZES = ['small', 'large', 'banner'] as const
|
|
13
14
|
|
|
14
15
|
/**
|
|
15
16
|
* The footprint family a tile view occupies on the dashboard.
|
|
16
|
-
*
|
|
17
|
+
*
|
|
18
|
+
* This feature is subject to breaking changes.
|
|
19
|
+
* @beta
|
|
17
20
|
* @category Resource Types
|
|
18
|
-
* @hidden
|
|
19
21
|
*/
|
|
20
22
|
export type ApplicationTileSize = (typeof APPLICATION_TILE_SIZES)[number]
|
|
21
23
|
|
|
22
24
|
/**
|
|
23
25
|
* The set of surfaces a view can target within the Dashboard/Workbench.
|
|
24
|
-
*
|
|
26
|
+
*
|
|
27
|
+
* This feature is subject to breaking changes.
|
|
28
|
+
* @beta
|
|
25
29
|
* @category Resource Types
|
|
26
|
-
* @hidden
|
|
27
30
|
*/
|
|
28
31
|
export const APPLICATION_VIEW_SURFACES = ['window', 'panel', 'asset-source', 'tile'] as const
|
|
29
32
|
|
|
30
33
|
/**
|
|
31
34
|
* The surface a view targets. Used as the discriminator on view configs; the
|
|
32
35
|
* definers transform it to the emitted view `type` the backend expects.
|
|
33
|
-
*
|
|
36
|
+
*
|
|
37
|
+
* This feature is subject to breaking changes.
|
|
38
|
+
* @beta
|
|
34
39
|
* @category Resource Types
|
|
35
|
-
* @hidden
|
|
36
40
|
*/
|
|
37
41
|
export type ApplicationViewSurface = (typeof APPLICATION_VIEW_SURFACES)[number]
|
|
38
42
|
|
|
39
43
|
/**
|
|
40
44
|
* The set of dock groups a window or panel view can be placed into.
|
|
41
|
-
*
|
|
45
|
+
*
|
|
46
|
+
* This feature is subject to breaking changes.
|
|
47
|
+
* @beta
|
|
42
48
|
* @category Resource Types
|
|
43
|
-
* @hidden
|
|
44
49
|
*/
|
|
45
50
|
export const APPLICATION_DOCK_GROUPS = ['system', 'applications'] as const
|
|
46
51
|
|
|
47
52
|
/**
|
|
48
53
|
* The dock group a window or panel view is placed into.
|
|
49
|
-
*
|
|
54
|
+
*
|
|
55
|
+
* This feature is subject to breaking changes.
|
|
56
|
+
* @beta
|
|
50
57
|
* @category Resource Types
|
|
51
|
-
* @hidden
|
|
52
58
|
*/
|
|
53
59
|
export type ApplicationDockGroup = (typeof APPLICATION_DOCK_GROUPS)[number]
|
|
54
60
|
|
|
55
61
|
/**
|
|
56
62
|
* Dock placement for a window view.
|
|
57
|
-
*
|
|
63
|
+
*
|
|
64
|
+
* This feature is subject to breaking changes.
|
|
65
|
+
* @beta
|
|
58
66
|
* @category Resource Types
|
|
59
67
|
* @expand
|
|
60
|
-
* @hidden
|
|
61
68
|
*/
|
|
62
69
|
export interface BlueprintApplicationDock {
|
|
63
70
|
/**
|
|
@@ -77,9 +84,10 @@ export interface BlueprintApplicationDock {
|
|
|
77
84
|
|
|
78
85
|
/**
|
|
79
86
|
* Fields shared by every view and web worker an application exposes.
|
|
80
|
-
*
|
|
87
|
+
*
|
|
88
|
+
* This feature is subject to breaking changes.
|
|
89
|
+
* @beta
|
|
81
90
|
* @category Resource Types
|
|
82
|
-
* @hidden
|
|
83
91
|
*/
|
|
84
92
|
export interface BlueprintApplicationChildBase {
|
|
85
93
|
/** Unique within the application. Must match `^[a-zA-Z0-9_-]+$`. */
|
|
@@ -94,9 +102,10 @@ export interface BlueprintApplicationChildBase {
|
|
|
94
102
|
|
|
95
103
|
/**
|
|
96
104
|
* A window view — the navigable, full-page view of an application.
|
|
97
|
-
*
|
|
105
|
+
*
|
|
106
|
+
* This feature is subject to breaking changes.
|
|
107
|
+
* @beta
|
|
98
108
|
* @category Resource Types
|
|
99
|
-
* @hidden
|
|
100
109
|
*/
|
|
101
110
|
export interface BlueprintWindowView extends BlueprintApplicationChildBase {
|
|
102
111
|
type: 'app'
|
|
@@ -111,9 +120,10 @@ export interface BlueprintWindowView extends BlueprintApplicationChildBase {
|
|
|
111
120
|
|
|
112
121
|
/**
|
|
113
122
|
* A panel view — renders in the dock.
|
|
114
|
-
*
|
|
123
|
+
*
|
|
124
|
+
* This feature is subject to breaking changes.
|
|
125
|
+
* @beta
|
|
115
126
|
* @category Resource Types
|
|
116
|
-
* @hidden
|
|
117
127
|
*/
|
|
118
128
|
export interface BlueprintPanelView extends BlueprintApplicationChildBase {
|
|
119
129
|
type: 'panel'
|
|
@@ -128,9 +138,10 @@ export interface BlueprintPanelView extends BlueprintApplicationChildBase {
|
|
|
128
138
|
|
|
129
139
|
/**
|
|
130
140
|
* An asset source view — contributes an asset source.
|
|
131
|
-
*
|
|
141
|
+
*
|
|
142
|
+
* This feature is subject to breaking changes.
|
|
143
|
+
* @beta
|
|
132
144
|
* @category Resource Types
|
|
133
|
-
* @hidden
|
|
134
145
|
*/
|
|
135
146
|
export interface BlueprintAssetSourceView extends BlueprintApplicationChildBase {
|
|
136
147
|
type: 'asset_source'
|
|
@@ -138,9 +149,10 @@ export interface BlueprintAssetSourceView extends BlueprintApplicationChildBase
|
|
|
138
149
|
|
|
139
150
|
/**
|
|
140
151
|
* A tile view — docks on the dashboard with a footprint `size`.
|
|
141
|
-
*
|
|
152
|
+
*
|
|
153
|
+
* This feature is subject to breaking changes.
|
|
154
|
+
* @beta
|
|
142
155
|
* @category Resource Types
|
|
143
|
-
* @hidden
|
|
144
156
|
*/
|
|
145
157
|
export interface BlueprintTileView extends BlueprintApplicationChildBase {
|
|
146
158
|
type: 'tile'
|
|
@@ -158,9 +170,10 @@ export interface BlueprintTileView extends BlueprintApplicationChildBase {
|
|
|
158
170
|
|
|
159
171
|
/**
|
|
160
172
|
* A background web worker an application runs.
|
|
161
|
-
*
|
|
173
|
+
*
|
|
174
|
+
* This feature is subject to breaking changes.
|
|
175
|
+
* @beta
|
|
162
176
|
* @category Resource Types
|
|
163
|
-
* @hidden
|
|
164
177
|
*/
|
|
165
178
|
export interface BlueprintWebWorker extends BlueprintApplicationChildBase {
|
|
166
179
|
type: 'worker'
|
|
@@ -168,26 +181,29 @@ export interface BlueprintWebWorker extends BlueprintApplicationChildBase {
|
|
|
168
181
|
|
|
169
182
|
/**
|
|
170
183
|
* A union of all view declarations an application can expose.
|
|
171
|
-
*
|
|
184
|
+
*
|
|
185
|
+
* This feature is subject to breaking changes.
|
|
186
|
+
* @beta
|
|
172
187
|
* @category Resource Types
|
|
173
188
|
* @expand
|
|
174
|
-
* @hidden
|
|
175
189
|
*/
|
|
176
190
|
export type BlueprintApplicationView = BlueprintWindowView | BlueprintPanelView | BlueprintAssetSourceView | BlueprintTileView
|
|
177
191
|
|
|
178
192
|
/**
|
|
179
193
|
* A union of everything an application declares — its views and web workers.
|
|
180
|
-
*
|
|
194
|
+
*
|
|
195
|
+
* This feature is subject to breaking changes.
|
|
196
|
+
* @beta
|
|
181
197
|
* @category Resource Types
|
|
182
|
-
* @hidden
|
|
183
198
|
*/
|
|
184
199
|
export type BlueprintApplicationChild = BlueprintApplicationView | BlueprintWebWorker
|
|
185
200
|
|
|
186
201
|
/**
|
|
187
202
|
* Represents an Application resource.
|
|
188
|
-
*
|
|
203
|
+
*
|
|
204
|
+
* This feature is subject to breaking changes.
|
|
205
|
+
* @beta
|
|
189
206
|
* @category Resource Types
|
|
190
|
-
* @hidden
|
|
191
207
|
*/
|
|
192
208
|
export interface BlueprintApplicationResource extends BlueprintResource {
|
|
193
209
|
type: 'sanity.application'
|
|
@@ -200,12 +216,15 @@ export interface BlueprintApplicationResource extends BlueprintResource {
|
|
|
200
216
|
|
|
201
217
|
/**
|
|
202
218
|
* The application root directory, relative to the blueprint file. Contains the
|
|
203
|
-
* application's `package.json`; every view and web worker `src`
|
|
204
|
-
* relative to it.
|
|
219
|
+
* application's `package.json`; `icon` and every view and web worker `src` are
|
|
220
|
+
* resolved relative to it.
|
|
205
221
|
*/
|
|
206
222
|
root: string
|
|
207
223
|
|
|
208
|
-
/**
|
|
224
|
+
/**
|
|
225
|
+
* Path to the icon image, relative to `root`. Uploaded on every deploy; omitting it removes the icon.
|
|
226
|
+
* PNG, JPEG, BMP, GIF, TIFF, SVG, WebP, HEIF or AVIF, up to 5 MB.
|
|
227
|
+
*/
|
|
209
228
|
icon?: string
|
|
210
229
|
|
|
211
230
|
/** Dashboard visibility. */
|
|
@@ -227,7 +246,13 @@ export interface BlueprintApplicationResource extends BlueprintResource {
|
|
|
227
246
|
mfManifest?: Record<string, unknown>
|
|
228
247
|
}
|
|
229
248
|
|
|
249
|
+
/**
|
|
250
|
+
* Base shape shared by all view configs.
|
|
251
|
+
* @beta
|
|
252
|
+
* @category Resource Types
|
|
253
|
+
*/
|
|
230
254
|
export interface BlueprintViewConfigBase {
|
|
255
|
+
/** Set by the view definers. */
|
|
231
256
|
type: 'view'
|
|
232
257
|
}
|
|
233
258
|
|
|
@@ -237,10 +262,9 @@ export interface BlueprintViewConfigBase {
|
|
|
237
262
|
* @remarks
|
|
238
263
|
* Discriminated by `surface`. The definer transforms `surface: 'window'` to the
|
|
239
264
|
* emitted view `type: 'app'`.
|
|
240
|
-
* @beta
|
|
265
|
+
* @beta
|
|
241
266
|
* @category Resource Types
|
|
242
267
|
* @interface
|
|
243
|
-
* @hidden
|
|
244
268
|
*/
|
|
245
269
|
export type BlueprintWindowViewConfig = Omit<BlueprintWindowView, 'type'> &
|
|
246
270
|
BlueprintViewConfigBase & {
|
|
@@ -254,10 +278,9 @@ export type BlueprintWindowViewConfig = Omit<BlueprintWindowView, 'type'> &
|
|
|
254
278
|
* @remarks
|
|
255
279
|
* Discriminated by `surface`. The definer transforms `surface: 'panel'` to the
|
|
256
280
|
* emitted view `type: 'panel'`.
|
|
257
|
-
* @beta
|
|
281
|
+
* @beta
|
|
258
282
|
* @category Resource Types
|
|
259
283
|
* @interface
|
|
260
|
-
* @hidden
|
|
261
284
|
*/
|
|
262
285
|
export type BlueprintPanelViewConfig = Omit<BlueprintPanelView, 'type'> &
|
|
263
286
|
BlueprintViewConfigBase & {
|
|
@@ -271,10 +294,9 @@ export type BlueprintPanelViewConfig = Omit<BlueprintPanelView, 'type'> &
|
|
|
271
294
|
* @remarks
|
|
272
295
|
* Discriminated by `surface`. The definer transforms `surface: 'asset-source'`
|
|
273
296
|
* to the emitted view `type: 'asset_source'`.
|
|
274
|
-
* @beta
|
|
297
|
+
* @beta
|
|
275
298
|
* @category Resource Types
|
|
276
299
|
* @interface
|
|
277
|
-
* @hidden
|
|
278
300
|
*/
|
|
279
301
|
export type BlueprintAssetSourceViewConfig = Omit<BlueprintAssetSourceView, 'type'> &
|
|
280
302
|
BlueprintViewConfigBase & {
|
|
@@ -288,10 +310,9 @@ export type BlueprintAssetSourceViewConfig = Omit<BlueprintAssetSourceView, 'typ
|
|
|
288
310
|
* @remarks
|
|
289
311
|
* Discriminated by `surface`. The definer transforms `surface: 'tile'` to the
|
|
290
312
|
* emitted view `type: 'tile'`.
|
|
291
|
-
* @beta
|
|
313
|
+
* @beta
|
|
292
314
|
* @category Resource Types
|
|
293
315
|
* @interface
|
|
294
|
-
* @hidden
|
|
295
316
|
*/
|
|
296
317
|
export type BlueprintTileViewConfig = Omit<BlueprintTileView, 'type'> &
|
|
297
318
|
BlueprintViewConfigBase & {
|
|
@@ -301,19 +322,17 @@ export type BlueprintTileViewConfig = Omit<BlueprintTileView, 'type'> &
|
|
|
301
322
|
|
|
302
323
|
/**
|
|
303
324
|
* Configuration for a web worker.
|
|
304
|
-
* @beta
|
|
325
|
+
* @beta
|
|
305
326
|
* @category Resource Types
|
|
306
327
|
* @interface
|
|
307
|
-
* @hidden
|
|
308
328
|
*/
|
|
309
329
|
export type BlueprintWebWorkerConfig = Omit<BlueprintWebWorker, 'type'>
|
|
310
330
|
|
|
311
331
|
/**
|
|
312
332
|
* A union of all view configs an application can declare, discriminated by `surface`.
|
|
313
|
-
* @beta
|
|
333
|
+
* @beta
|
|
314
334
|
* @category Resource Types
|
|
315
335
|
* @expand
|
|
316
|
-
* @hidden
|
|
317
336
|
*/
|
|
318
337
|
export type BlueprintApplicationViewConfig =
|
|
319
338
|
| BlueprintWindowViewConfig
|
|
@@ -323,12 +342,11 @@ export type BlueprintApplicationViewConfig =
|
|
|
323
342
|
|
|
324
343
|
/**
|
|
325
344
|
* Configuration for an Application resource.
|
|
326
|
-
* @beta
|
|
345
|
+
* @beta
|
|
327
346
|
* @category Resource Types
|
|
328
347
|
* @interface
|
|
329
|
-
* @hidden
|
|
330
348
|
*/
|
|
331
|
-
export type BlueprintApplicationConfig = Omit<BlueprintApplicationResource, 'type' | 'slug' | 'views'> & {
|
|
349
|
+
export type BlueprintApplicationConfig = Omit<BlueprintApplicationResource, 'type' | 'slug' | 'views' | 'mfManifest'> & {
|
|
332
350
|
/**
|
|
333
351
|
* The slug to be used in the application hostname. Must match `^[a-z0-9]([a-z0-9-]*[a-z0-9])?$`.
|
|
334
352
|
*
|
package/src/types/context.ts
CHANGED
|
@@ -2,7 +2,9 @@ import type {BlueprintResource} from '../index.js'
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* A knowledge base that a Context MCP endpoint serves.
|
|
5
|
-
*
|
|
5
|
+
*
|
|
6
|
+
* This feature is subject to breaking changes.
|
|
7
|
+
* @beta
|
|
6
8
|
* @category Resource Types
|
|
7
9
|
*/
|
|
8
10
|
export interface ContextKnowledgeBaseSource {
|
|
@@ -13,7 +15,9 @@ export interface ContextKnowledgeBaseSource {
|
|
|
13
15
|
|
|
14
16
|
/**
|
|
15
17
|
* A Sanity dataset that a Context MCP endpoint serves.
|
|
16
|
-
*
|
|
18
|
+
*
|
|
19
|
+
* This feature is subject to breaking changes.
|
|
20
|
+
* @beta
|
|
17
21
|
* @category Resource Types
|
|
18
22
|
*/
|
|
19
23
|
export interface ContextDatasetSource {
|
|
@@ -33,14 +37,18 @@ export interface ContextDatasetSource {
|
|
|
33
37
|
|
|
34
38
|
/**
|
|
35
39
|
* Content that a Context MCP endpoint serves.
|
|
36
|
-
*
|
|
40
|
+
*
|
|
41
|
+
* This feature is subject to breaking changes.
|
|
42
|
+
* @beta
|
|
37
43
|
* @category Resource Types
|
|
38
44
|
*/
|
|
39
45
|
export type ContextMcpEndpointSource = ContextKnowledgeBaseSource | ContextDatasetSource
|
|
40
46
|
|
|
41
47
|
/**
|
|
42
48
|
* A Context knowledge base resource.
|
|
43
|
-
*
|
|
49
|
+
*
|
|
50
|
+
* This feature is subject to breaking changes.
|
|
51
|
+
* @beta
|
|
44
52
|
* @category Resource Types
|
|
45
53
|
*/
|
|
46
54
|
export interface BlueprintContextKnowledgeBaseResource extends BlueprintResource {
|
|
@@ -58,7 +66,7 @@ export interface BlueprintContextKnowledgeBaseResource extends BlueprintResource
|
|
|
58
66
|
|
|
59
67
|
/**
|
|
60
68
|
* Configuration for a Context knowledge base.
|
|
61
|
-
* @beta
|
|
69
|
+
* @beta
|
|
62
70
|
* @category Resource Types
|
|
63
71
|
* @interface
|
|
64
72
|
*/
|
|
@@ -66,7 +74,9 @@ export type BlueprintContextKnowledgeBaseConfig = Omit<BlueprintContextKnowledge
|
|
|
66
74
|
|
|
67
75
|
/**
|
|
68
76
|
* A Context MCP endpoint resource.
|
|
69
|
-
*
|
|
77
|
+
*
|
|
78
|
+
* This feature is subject to breaking changes.
|
|
79
|
+
* @beta
|
|
70
80
|
* @category Resource Types
|
|
71
81
|
*/
|
|
72
82
|
export interface BlueprintContextMcpEndpointResource extends BlueprintResource {
|
|
@@ -89,7 +99,7 @@ export interface BlueprintContextMcpEndpointResource extends BlueprintResource {
|
|
|
89
99
|
|
|
90
100
|
/**
|
|
91
101
|
* Configuration for a Context MCP endpoint.
|
|
92
|
-
* @beta
|
|
102
|
+
* @beta
|
|
93
103
|
* @category Resource Types
|
|
94
104
|
* @interface
|
|
95
105
|
*/
|
package/src/types/cors.ts
CHANGED
|
@@ -3,7 +3,6 @@ import type {BlueprintProjectResourceLifecycle, BlueprintResource} from '../inde
|
|
|
3
3
|
/**
|
|
4
4
|
* Represents a CORS Origin resource.
|
|
5
5
|
* @see https://www.sanity.io/docs/content-lake/cors
|
|
6
|
-
* @beta This feature is subject to breaking changes.
|
|
7
6
|
* @category Resource Types
|
|
8
7
|
*/
|
|
9
8
|
export interface BlueprintCorsOriginResource extends BlueprintResource<BlueprintProjectResourceLifecycle> {
|
|
@@ -33,7 +32,6 @@ export interface BlueprintCorsOriginResource extends BlueprintResource<Blueprint
|
|
|
33
32
|
/**
|
|
34
33
|
* Configuration for a CORS Origin resource.
|
|
35
34
|
* @see https://www.sanity.io/docs/content-lake/cors
|
|
36
|
-
* @beta This feature is subject to breaking changes.
|
|
37
35
|
* @category Resource Types
|
|
38
36
|
* @interface
|
|
39
37
|
*/
|
package/src/types/datasets.ts
CHANGED
|
@@ -2,8 +2,6 @@ import type {BlueprintProjectResourceLifecycle, BlueprintResource} from '../inde
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* The ACL mode for a dataset.
|
|
5
|
-
* @alpha
|
|
6
|
-
* @hidden
|
|
7
5
|
* @category Resource Types
|
|
8
6
|
*/
|
|
9
7
|
export type AclMode = 'public' | 'private' | 'custom'
|
|
@@ -11,8 +9,6 @@ export type AclMode = 'public' | 'private' | 'custom'
|
|
|
11
9
|
/**
|
|
12
10
|
* Represents a Dataset resource.
|
|
13
11
|
* @see https://www.sanity.io/docs/content-lake/datasets
|
|
14
|
-
* @alpha This feature is subject to breaking changes.
|
|
15
|
-
* @hidden
|
|
16
12
|
* @category Resource Types
|
|
17
13
|
*/
|
|
18
14
|
export interface BlueprintDatasetResource extends BlueprintResource<BlueprintProjectResourceLifecycle> {
|
|
@@ -37,8 +33,6 @@ export interface BlueprintDatasetResource extends BlueprintResource<BlueprintPro
|
|
|
37
33
|
/**
|
|
38
34
|
* Configuration for a Dataset resource.
|
|
39
35
|
* @see https://www.sanity.io/docs/content-lake/datasets
|
|
40
|
-
* @alpha This feature is subject to breaking changes.
|
|
41
|
-
* @hidden
|
|
42
36
|
* @category Resource Types
|
|
43
37
|
* @interface
|
|
44
38
|
*/
|