@sanity/blueprints 0.23.1 → 0.23.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/definers/functions/durable.d.ts +26 -0
- package/dist/definers/functions/{pipeline.js → durable.js} +9 -9
- package/dist/definers/functions/durable.js.map +1 -0
- package/dist/definers/functions/pubsub.d.ts +18 -0
- package/dist/definers/functions/pubsub.js +28 -0
- package/dist/definers/functions/pubsub.js.map +1 -0
- package/dist/definers/studios.js +5 -0
- package/dist/definers/studios.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/types/functions/event.d.ts +2 -4
- package/dist/types/functions/index.d.ts +17 -27
- package/dist/types/studios.d.ts +36 -7
- package/dist/types/studios.js +7 -1
- package/dist/types/studios.js.map +1 -1
- package/dist/validation/functions.d.ts +4 -7
- package/dist/validation/functions.js +12 -17
- package/dist/validation/functions.js.map +1 -1
- package/dist/validation/studios.js +29 -5
- package/dist/validation/studios.js.map +1 -1
- package/package.json +1 -1
- package/src/definers/functions/{pipeline.ts → durable.ts} +9 -9
- package/src/definers/functions/pubsub.ts +30 -0
- package/src/definers/studios.ts +5 -0
- package/src/index.ts +2 -2
- package/src/types/functions/event.ts +2 -3
- package/src/types/functions/index.ts +17 -27
- package/src/types/studios.ts +46 -8
- package/src/validation/functions.ts +12 -17
- package/src/validation/studios.ts +33 -6
- package/dist/definers/functions/event.d.ts +0 -20
- package/dist/definers/functions/event.js +0 -30
- package/dist/definers/functions/event.js.map +0 -1
- package/dist/definers/functions/pipeline.d.ts +0 -26
- package/dist/definers/functions/pipeline.js.map +0 -1
- package/src/definers/functions/event.ts +0 -32
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { APPLICATION_VISIBILITIES } from '../types/studios.js';
|
|
1
2
|
import { validateResource } from './resources.js';
|
|
2
3
|
/**
|
|
3
4
|
* Validates that the given resource is a valid Studio.
|
|
@@ -21,6 +22,34 @@ export function validateStudio(resource) {
|
|
|
21
22
|
else if (typeof resource.src !== 'string') {
|
|
22
23
|
errors.push({ type: 'invalid_type', message: 'Studio src must be a string' });
|
|
23
24
|
}
|
|
25
|
+
if (!('project' in resource) || !resource.project) {
|
|
26
|
+
errors.push({ type: 'missing_parameter', message: 'Studio project is required' });
|
|
27
|
+
}
|
|
28
|
+
else if (typeof resource.project !== 'string') {
|
|
29
|
+
errors.push({ type: 'invalid_type', message: 'Studio project must be a string' });
|
|
30
|
+
}
|
|
31
|
+
if (!('slug' in resource) || !resource.slug) {
|
|
32
|
+
errors.push({ type: 'missing_parameter', message: 'Studio slug is required' });
|
|
33
|
+
}
|
|
34
|
+
else if (typeof resource.slug !== 'string') {
|
|
35
|
+
errors.push({ type: 'invalid_type', message: 'Studio slug must be a string' });
|
|
36
|
+
}
|
|
37
|
+
if (!('title' in resource) || !resource.title) {
|
|
38
|
+
errors.push({ type: 'missing_parameter', message: 'Studio title is required' });
|
|
39
|
+
}
|
|
40
|
+
else if (typeof resource.title !== 'string') {
|
|
41
|
+
errors.push({ type: 'invalid_type', message: 'Studio title must be a string' });
|
|
42
|
+
}
|
|
43
|
+
if ('icon' in resource) {
|
|
44
|
+
if (typeof resource.icon !== 'string') {
|
|
45
|
+
errors.push({ type: 'invalid_type', message: 'Studio icon must be a string' });
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
if ('visibility' in resource &&
|
|
49
|
+
typeof resource.visibility !== 'undefined' &&
|
|
50
|
+
!APPLICATION_VISIBILITIES.some((av) => av === resource.visibility)) {
|
|
51
|
+
errors.push({ type: 'invalid_value', message: 'visibility must be one of `default`, `unlisted`, or `disabled`' });
|
|
52
|
+
}
|
|
24
53
|
if (!('autoUpdates' in resource) || !resource.autoUpdates) {
|
|
25
54
|
errors.push({ type: 'missing_parameter', message: 'Studio autoUpdates is required' });
|
|
26
55
|
}
|
|
@@ -60,11 +89,6 @@ export function validateStudio(resource) {
|
|
|
60
89
|
errors.push({ type: 'invalid_type', message: 'Studio sourceMap must be a boolean' });
|
|
61
90
|
}
|
|
62
91
|
}
|
|
63
|
-
if ('project' in resource) {
|
|
64
|
-
if (typeof resource.project !== 'string') {
|
|
65
|
-
errors.push({ type: 'invalid_type', message: 'Studio project must be a string' });
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
92
|
return errors;
|
|
69
93
|
}
|
|
70
94
|
//# sourceMappingURL=studios.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"studios.js","sourceRoot":"","sources":["../../src/validation/studios.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,gBAAgB,EAAC,MAAM,gBAAgB,CAAA;AAE/C;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAAC,QAAiB;IAC9C,IAAI,CAAC,QAAQ;QAAE,OAAO,CAAC,EAAC,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,gCAAgC,EAAC,CAAC,CAAA;IAC1F,IAAI,OAAO,QAAQ,KAAK,QAAQ;QAAE,OAAO,CAAC,EAAC,IAAI,EAAE,cAAc,EAAE,OAAO,EAAE,iCAAiC,EAAC,CAAC,CAAA;IAE7G,MAAM,MAAM,GAAqB,gBAAgB,CAAC,QAAQ,EAAE,EAAC,gBAAgB,EAAE,IAAI,EAAC,CAAC,CAAA;IAErF,IAAI,MAAM,IAAI,QAAQ,IAAI,QAAQ,CAAC,IAAI,KAAK,eAAe,EAAE,CAAC;QAC5D,MAAM,CAAC,IAAI,CAAC,EAAC,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,qCAAqC,EAAC,CAAC,CAAA;IACtF,CAAC;IAED,IAAI,CAAC,CAAC,KAAK,IAAI,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC;QAC1C,MAAM,CAAC,IAAI,CAAC,EAAC,IAAI,EAAE,mBAAmB,EAAE,OAAO,EAAE,wBAAwB,EAAC,CAAC,CAAA;IAC7E,CAAC;SAAM,IAAI,OAAO,QAA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,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {type
|
|
1
|
+
import {type BlueprintDurableConfig, type BlueprintDurableFunctionResource, validateDurableFunction} from '../../index.js'
|
|
2
2
|
import {runValidation} from '../../utils/validation.js'
|
|
3
3
|
import {defineFunction} from './index.js'
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* Defines a
|
|
6
|
+
* Defines a durable function resource.
|
|
7
7
|
*
|
|
8
8
|
* @remarks
|
|
9
9
|
*
|
|
10
10
|
* ```ts
|
|
11
|
-
*
|
|
11
|
+
* defineDurableFunction({
|
|
12
12
|
* name: 'daily-cleanup',
|
|
13
13
|
* event: {type: 'document', on: ['create'], filter: "_type == 'post'"},
|
|
14
14
|
* concurrency: 5,
|
|
@@ -20,23 +20,23 @@ import {defineFunction} from './index.js'
|
|
|
20
20
|
*
|
|
21
21
|
* @param functionConfig The configuration for the function
|
|
22
22
|
* @category Definers
|
|
23
|
-
* @alpha Deploying
|
|
23
|
+
* @alpha Deploying Durable Functions via Blueprints is experimental. This feature is not available publicly yet.
|
|
24
24
|
* @public
|
|
25
25
|
* @hidden
|
|
26
26
|
* @expandType BlueprintPipelineConfig
|
|
27
|
-
* @returns The validated
|
|
27
|
+
* @returns The validated durable function resource
|
|
28
28
|
*/
|
|
29
|
-
export function
|
|
29
|
+
export function defineDurableFunction(functionConfig: BlueprintDurableConfig): BlueprintDurableFunctionResource {
|
|
30
30
|
const {name, event, concurrency, debounce, debounceKey, src} = functionConfig
|
|
31
|
-
const functionResource:
|
|
31
|
+
const functionResource: BlueprintDurableFunctionResource = {
|
|
32
32
|
...defineFunction({...functionConfig, src: src ?? `functions/${name}`}, {skipValidation: true}),
|
|
33
|
-
type: 'sanity.function.
|
|
33
|
+
type: 'sanity.function.durable',
|
|
34
34
|
...(event !== undefined && {event}),
|
|
35
35
|
...(concurrency !== undefined && {concurrency}),
|
|
36
36
|
...(debounce !== undefined && {debounce}),
|
|
37
37
|
...(debounceKey !== undefined && {debounceKey}),
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
runValidation(() =>
|
|
40
|
+
runValidation(() => validateDurableFunction(functionResource))
|
|
41
41
|
return functionResource
|
|
42
42
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import {type BlueprintPubSubFunctionConfig, type BlueprintPubSubFunctionResource, validatePubSubFunction} from '../../index.js'
|
|
2
|
+
import {runValidation} from '../../utils/validation.js'
|
|
3
|
+
import {defineFunction} from './index.js'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Defines a function that provide pubsub behaviour.
|
|
7
|
+
*
|
|
8
|
+
* @remarks
|
|
9
|
+
* A barebones pubsub function
|
|
10
|
+
* ```ts
|
|
11
|
+
* definePubSubFunction({
|
|
12
|
+
* name: 'send-email',
|
|
13
|
+
* })
|
|
14
|
+
* ```
|
|
15
|
+
* @public
|
|
16
|
+
* @category Definers
|
|
17
|
+
* @expandType BlueprintPubSubFunctionConfig
|
|
18
|
+
* @param functionConfig The configuration for the pubsub function
|
|
19
|
+
* @returns The validated pubsub function resource
|
|
20
|
+
*/
|
|
21
|
+
export function definePubSubFunction(functionConfig: BlueprintPubSubFunctionConfig): BlueprintPubSubFunctionResource {
|
|
22
|
+
const functionResource: BlueprintPubSubFunctionResource = {
|
|
23
|
+
...defineFunction(functionConfig, {skipValidation: true}),
|
|
24
|
+
type: 'sanity.function.pubsub',
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
runValidation(() => validatePubSubFunction(functionResource))
|
|
28
|
+
|
|
29
|
+
return functionResource
|
|
30
|
+
}
|
package/src/definers/studios.ts
CHANGED
|
@@ -24,6 +24,11 @@ import {runValidation} from '../utils/validation.js'
|
|
|
24
24
|
*/
|
|
25
25
|
export function defineStudio(config: BlueprintStudioConfig): BlueprintStudioResource {
|
|
26
26
|
const studioResource: BlueprintStudioResource = {
|
|
27
|
+
title: config.name,
|
|
28
|
+
autoUpdates: {
|
|
29
|
+
enabled: config.autoUpdates?.enabled ?? true,
|
|
30
|
+
version: config.autoUpdates?.version,
|
|
31
|
+
},
|
|
27
32
|
...config,
|
|
28
33
|
type: 'sanity.studio',
|
|
29
34
|
}
|
package/src/index.ts
CHANGED
|
@@ -11,10 +11,10 @@ export * from './definers/blueprints.js'
|
|
|
11
11
|
export * from './definers/cors.js'
|
|
12
12
|
export * from './definers/datasets.js'
|
|
13
13
|
export * from './definers/functions/document.js'
|
|
14
|
-
export * from './definers/functions/
|
|
14
|
+
export * from './definers/functions/durable.js'
|
|
15
15
|
export * from './definers/functions/index.js'
|
|
16
16
|
export * from './definers/functions/media-library.js'
|
|
17
|
-
export * from './definers/functions/
|
|
17
|
+
export * from './definers/functions/pubsub.js'
|
|
18
18
|
export * from './definers/functions/queue.js'
|
|
19
19
|
export * from './definers/functions/scheduled.js'
|
|
20
20
|
export * from './definers/functions/sync-tag-invalidate.js'
|
|
@@ -84,13 +84,12 @@ export type BlueprintScheduledFunctionConfigEvent =
|
|
|
84
84
|
| BlueprintScheduledFunctionExpressionResourceEvent
|
|
85
85
|
|
|
86
86
|
/**
|
|
87
|
-
* Union type of all
|
|
87
|
+
* Union type of all Content Lake event source configurations
|
|
88
88
|
* @category Functions Types
|
|
89
89
|
*/
|
|
90
|
-
export type
|
|
90
|
+
export type BlueprintFunctionResourceContentLakeEvent =
|
|
91
91
|
| ({type: 'document'} & BlueprintDocumentFunctionResourceEvent)
|
|
92
92
|
| ({type: 'media-library'} & BlueprintMediaLibraryFunctionResourceEvent)
|
|
93
|
-
| ({type: 'cron'} & BlueprintScheduledFunctionResourceEvent)
|
|
94
93
|
| ({type: 'sync-tag-invalidate'} & BlueprintSyncTagInvalidateFunctionResourceEvent)
|
|
95
94
|
|
|
96
95
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type {BlueprintResource} from '../../index.js'
|
|
2
2
|
import type {
|
|
3
3
|
BlueprintDocumentFunctionResourceEvent,
|
|
4
|
-
|
|
4
|
+
BlueprintFunctionResourceContentLakeEvent,
|
|
5
5
|
BlueprintMediaLibraryFunctionResourceEvent,
|
|
6
6
|
BlueprintScheduledFunctionConfigEvent,
|
|
7
7
|
BlueprintScheduledFunctionResourceEvent,
|
|
@@ -146,31 +146,27 @@ export interface BlueprintSyncTagInvalidateFunctionResource extends BlueprintBas
|
|
|
146
146
|
*/
|
|
147
147
|
export interface BlueprintQueueFunctionResource extends BlueprintBaseFunctionResource, QueueConfig {
|
|
148
148
|
type: 'sanity.function.queue'
|
|
149
|
-
/** Optional event
|
|
150
|
-
event?:
|
|
149
|
+
/** Optional Content Lake event source that triggers the function */
|
|
150
|
+
event?: BlueprintFunctionResourceContentLakeEvent
|
|
151
151
|
}
|
|
152
152
|
|
|
153
153
|
/**
|
|
154
154
|
* A function resource triggered by another function
|
|
155
155
|
* @category Functions Types
|
|
156
|
-
* @alpha
|
|
157
|
-
* @hidden
|
|
158
156
|
*/
|
|
159
|
-
export interface
|
|
160
|
-
type: 'sanity.function.
|
|
157
|
+
export interface BlueprintPubSubFunctionResource extends BlueprintBaseFunctionResource {
|
|
158
|
+
type: 'sanity.function.pubsub'
|
|
161
159
|
}
|
|
162
160
|
|
|
163
161
|
/**
|
|
164
|
-
* A durable, step-based
|
|
165
|
-
* @
|
|
166
|
-
* @alpha Deploying Pipeline Functions via Blueprints is experimental. This feature is not available publicly yet.
|
|
162
|
+
* A durable, step-based function.
|
|
163
|
+
* @alpha Deploying Durable Functions via Blueprints is experimental. This feature is not available publicly yet.
|
|
167
164
|
* @hidden
|
|
168
165
|
* @category Functions Types
|
|
169
|
-
* @interface
|
|
170
166
|
*/
|
|
171
|
-
export interface
|
|
172
|
-
type: 'sanity.function.
|
|
173
|
-
event?:
|
|
167
|
+
export interface BlueprintDurableFunctionResource extends BlueprintBaseFunctionResource, QueueConfig {
|
|
168
|
+
type: 'sanity.function.durable'
|
|
169
|
+
event?: BlueprintFunctionResourceContentLakeEvent
|
|
174
170
|
}
|
|
175
171
|
|
|
176
172
|
// --- Function Config (Input) Types: : `define*Function` method parameter types ---
|
|
@@ -225,8 +221,6 @@ export type BlueprintMediaLibraryAssetFunctionConfig = Omit<BlueprintMediaLibrar
|
|
|
225
221
|
/**
|
|
226
222
|
* Configuration for defining a scheduled function.
|
|
227
223
|
* @public
|
|
228
|
-
* @alpha Deploying Scheduled Functions via Blueprints is experimental. This feature is not available publicly yet.
|
|
229
|
-
* @hidden
|
|
230
224
|
* @category Functions Types
|
|
231
225
|
* @interface
|
|
232
226
|
*/
|
|
@@ -245,8 +239,6 @@ export type BlueprintScheduledFunctionConfig = Omit<BlueprintScheduledFunctionRe
|
|
|
245
239
|
/**
|
|
246
240
|
* Configuration for defining a sync tag invalidate function.
|
|
247
241
|
* @public
|
|
248
|
-
* @alpha Deploying Sync Tag Invalidate Functions via Blueprints is experimental. This feature is not available publicly yet.
|
|
249
|
-
* @hidden
|
|
250
242
|
* @category Functions Types
|
|
251
243
|
* @interface
|
|
252
244
|
*/
|
|
@@ -275,18 +267,16 @@ export type BlueprintQueueFunctionConfig = Omit<BlueprintQueueFunctionResource,
|
|
|
275
267
|
src?: string
|
|
276
268
|
|
|
277
269
|
/** Optional event configuration that triggers the queue function */
|
|
278
|
-
event?:
|
|
270
|
+
event?: BlueprintFunctionResourceContentLakeEvent
|
|
279
271
|
}
|
|
280
272
|
|
|
281
273
|
/**
|
|
282
274
|
* Configuration for defining an event function.
|
|
283
275
|
* @public
|
|
284
|
-
* @alpha Deploying Event Functions via Blueprints is experimental. This feature is not available publicly yet.
|
|
285
|
-
* @hidden
|
|
286
276
|
* @category Functions Types
|
|
287
277
|
* @interface
|
|
288
278
|
*/
|
|
289
|
-
export type
|
|
279
|
+
export type BlueprintPubSubFunctionConfig = Omit<BlueprintPubSubFunctionResource, 'type' | 'src'> & {
|
|
290
280
|
/**
|
|
291
281
|
* Path to the function source code
|
|
292
282
|
* @defaultValue `functions/${name}`
|
|
@@ -295,21 +285,21 @@ export type BlueprintEventFunctionConfig = Omit<BlueprintEventFunctionResource,
|
|
|
295
285
|
}
|
|
296
286
|
|
|
297
287
|
/**
|
|
298
|
-
* Configuration for defining a
|
|
288
|
+
* Configuration for defining a durable function.
|
|
299
289
|
* @public
|
|
300
|
-
* @alpha Deploying
|
|
290
|
+
* @alpha Deploying Durable Functions via Blueprints is experimental. This feature is not available publicly yet.
|
|
301
291
|
* @hidden
|
|
302
292
|
* @category Functions Types
|
|
303
293
|
* @interface
|
|
304
294
|
*/
|
|
305
|
-
export type
|
|
295
|
+
export type BlueprintDurableConfig = Omit<BlueprintDurableFunctionResource, 'type' | 'src' | 'event'> & {
|
|
306
296
|
/**
|
|
307
|
-
* Path to the
|
|
297
|
+
* Path to the function source code
|
|
308
298
|
* @defaultValue `functions/${name}`
|
|
309
299
|
*/
|
|
310
300
|
src?: string
|
|
311
301
|
/**
|
|
312
302
|
* Trigger configuration
|
|
313
303
|
*/
|
|
314
|
-
event?:
|
|
304
|
+
event?: BlueprintFunctionResourceContentLakeEvent
|
|
315
305
|
}
|
package/src/types/studios.ts
CHANGED
|
@@ -10,6 +10,22 @@ import type {BlueprintProjectResourceLifecycle, BlueprintResource} from '../inde
|
|
|
10
10
|
*/
|
|
11
11
|
export type UserViteConfig = ((config: InlineConfig, env: ConfigEnv) => InlineConfig | Promise<InlineConfig>) | InlineConfig
|
|
12
12
|
|
|
13
|
+
/**
|
|
14
|
+
* The set of valid application visibilities.
|
|
15
|
+
* @beta This feature is subject to breaking changes.
|
|
16
|
+
* @category Resource Types
|
|
17
|
+
* @hidden
|
|
18
|
+
*/
|
|
19
|
+
export const APPLICATION_VISIBILITIES = ['default', 'unlisted', 'disabled'] as const
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* The visibility of the studio in the dashboard.
|
|
23
|
+
* @beta This feature is subject to breaking changes.
|
|
24
|
+
* @category Resource Types
|
|
25
|
+
* @hidden
|
|
26
|
+
*/
|
|
27
|
+
export type ApplicationVisibility = (typeof APPLICATION_VISIBILITIES)[number]
|
|
28
|
+
|
|
13
29
|
/**
|
|
14
30
|
* Represents a Studio resource.
|
|
15
31
|
* @see https://www.sanity.io/docs/studio
|
|
@@ -23,6 +39,21 @@ export interface BlueprintStudioResource extends BlueprintResource<BlueprintProj
|
|
|
23
39
|
/** The relative location of the studio source code. */
|
|
24
40
|
src: string
|
|
25
41
|
|
|
42
|
+
/** The project ID of the project that contains your Studio. */
|
|
43
|
+
project: string
|
|
44
|
+
|
|
45
|
+
/** The slug to be used in the studio hostname. */
|
|
46
|
+
slug: string
|
|
47
|
+
|
|
48
|
+
/** Title for the studio. */
|
|
49
|
+
title: string
|
|
50
|
+
|
|
51
|
+
/** Icon for the studio in the browser. */
|
|
52
|
+
icon?: string
|
|
53
|
+
|
|
54
|
+
/** Dashboard visibility */
|
|
55
|
+
visibility?: ApplicationVisibility
|
|
56
|
+
|
|
26
57
|
/**
|
|
27
58
|
* Auto update settings for the studio.
|
|
28
59
|
*/
|
|
@@ -48,13 +79,6 @@ export interface BlueprintStudioResource extends BlueprintResource<BlueprintProj
|
|
|
48
79
|
|
|
49
80
|
/** Custom Vite configuration for the Studio so it can be changed and extended. */
|
|
50
81
|
vite?: UserViteConfig
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* The project ID of the project that contains your Studio.
|
|
54
|
-
*
|
|
55
|
-
* The `project` attribute must be defined if your blueprint is scoped to an organization.
|
|
56
|
-
*/
|
|
57
|
-
project?: string
|
|
58
82
|
}
|
|
59
83
|
|
|
60
84
|
/**
|
|
@@ -65,4 +89,18 @@ export interface BlueprintStudioResource extends BlueprintResource<BlueprintProj
|
|
|
65
89
|
* @interface
|
|
66
90
|
* @hidden
|
|
67
91
|
*/
|
|
68
|
-
export interface BlueprintStudioConfig extends Omit<BlueprintStudioResource, 'type'> {
|
|
92
|
+
export interface BlueprintStudioConfig extends Omit<BlueprintStudioResource, 'type' | 'title' | 'autoUpdates'> {
|
|
93
|
+
/** Title for the studio. Defaults to the name of the resource. */
|
|
94
|
+
title?: string
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Auto update settings for the studio.
|
|
98
|
+
*/
|
|
99
|
+
autoUpdates?: {
|
|
100
|
+
/** Whether auto updates are enabled for the studio. Defaults to true if autoUpdates is not provided. */
|
|
101
|
+
enabled: boolean
|
|
102
|
+
|
|
103
|
+
/** What "version"/"channel" to use for auto updates */
|
|
104
|
+
version?: string // 'next', 'stable', 'latest' or a semantic version (e.g., "1.2.3", "2.0.0-beta.1")
|
|
105
|
+
}
|
|
106
|
+
}
|
|
@@ -228,9 +228,8 @@ function validateMediaLibraryFunctionEvent(event: unknown): BlueprintError[] {
|
|
|
228
228
|
|
|
229
229
|
/**
|
|
230
230
|
* Validates a scheduled function resource configuration.
|
|
231
|
-
* @param functionResource The function resource to validate
|
|
232
|
-
* @alpha
|
|
233
231
|
* @hidden
|
|
232
|
+
* @param functionResource The function resource to validate
|
|
234
233
|
* @category Functions Types
|
|
235
234
|
* @returns Array of validation errors, empty if valid
|
|
236
235
|
*/
|
|
@@ -409,7 +408,6 @@ function validateScheduledFunctionTimezone(timezone: unknown): BlueprintError[]
|
|
|
409
408
|
/**
|
|
410
409
|
* Validates a sync tag invalidate function resource configuration.
|
|
411
410
|
* @param functionResource The function resource to validate
|
|
412
|
-
* @alpha
|
|
413
411
|
* @hidden
|
|
414
412
|
* @category Functions Types
|
|
415
413
|
* @returns Array of validation errors, empty if valid
|
|
@@ -468,7 +466,7 @@ export function validateQueueFunction(functionResource: unknown): BlueprintError
|
|
|
468
466
|
}
|
|
469
467
|
|
|
470
468
|
if ('event' in functionResource && typeof functionResource.event !== 'undefined') {
|
|
471
|
-
errors.push(...
|
|
469
|
+
errors.push(...validateFunctionContentLakeEvent(functionResource.event))
|
|
472
470
|
}
|
|
473
471
|
|
|
474
472
|
errors.push(...validateFunction(functionResource))
|
|
@@ -483,7 +481,7 @@ export function validateQueueFunction(functionResource: unknown): BlueprintError
|
|
|
483
481
|
* @param event The event configuration to validate
|
|
484
482
|
* @returns Array of validation errors, empty if valid
|
|
485
483
|
*/
|
|
486
|
-
function
|
|
484
|
+
function validateFunctionContentLakeEvent(event: unknown): BlueprintError[] {
|
|
487
485
|
if (!event || typeof event !== 'object') return [{type: 'invalid_type', message: '`event` must be an object'}]
|
|
488
486
|
if (!('type' in event)) return [{type: 'missing_parameter', message: '`event.type` is required'}]
|
|
489
487
|
|
|
@@ -492,15 +490,13 @@ function validateFunctionEvent(event: unknown): BlueprintError[] {
|
|
|
492
490
|
return validateDocumentFunctionEvent(event)
|
|
493
491
|
case 'media-library':
|
|
494
492
|
return validateMediaLibraryFunctionEvent(event)
|
|
495
|
-
case 'cron':
|
|
496
|
-
return validateScheduledFunctionEvent(event)
|
|
497
493
|
case 'sync-tag-invalidate':
|
|
498
494
|
return validateFunctionEventResourceDataset(event)
|
|
499
495
|
default:
|
|
500
496
|
return [
|
|
501
497
|
{
|
|
502
498
|
type: 'invalid_value',
|
|
503
|
-
message: '`event.type` must be either `
|
|
499
|
+
message: '`event.type` must be either `document`, `sync-tag-invalidate`, or `media-library`',
|
|
504
500
|
},
|
|
505
501
|
]
|
|
506
502
|
}
|
|
@@ -509,20 +505,19 @@ function validateFunctionEvent(event: unknown): BlueprintError[] {
|
|
|
509
505
|
/**
|
|
510
506
|
* Validates an event function resource configuration.
|
|
511
507
|
* @param functionResource The function resource to validate
|
|
512
|
-
* @alpha
|
|
513
508
|
* @hidden
|
|
514
509
|
* @category Functions Types
|
|
515
510
|
* @returns Array of validation errors, empty if valid
|
|
516
511
|
*/
|
|
517
512
|
|
|
518
|
-
export function
|
|
513
|
+
export function validatePubSubFunction(functionResource: unknown): BlueprintError[] {
|
|
519
514
|
if (!functionResource) return [{type: 'invalid_value', message: 'Function config must be provided'}]
|
|
520
515
|
if (typeof functionResource !== 'object') return [{type: 'invalid_type', message: 'Function config must be an object'}]
|
|
521
516
|
|
|
522
517
|
const errors: BlueprintError[] = []
|
|
523
518
|
|
|
524
|
-
if ('type' in functionResource && functionResource.type !== 'sanity.function.
|
|
525
|
-
errors.push({type: 'invalid_value', message: '`type` must be `sanity.function.
|
|
519
|
+
if ('type' in functionResource && functionResource.type !== 'sanity.function.pubsub') {
|
|
520
|
+
errors.push({type: 'invalid_value', message: '`type` must be `sanity.function.pubsub`'})
|
|
526
521
|
}
|
|
527
522
|
|
|
528
523
|
errors.push(...validateFunction(functionResource))
|
|
@@ -531,21 +526,21 @@ export function validateEventFunction(functionResource: unknown): BlueprintError
|
|
|
531
526
|
}
|
|
532
527
|
|
|
533
528
|
/**
|
|
534
|
-
* Validates a
|
|
529
|
+
* Validates a durable function resource configuration.
|
|
535
530
|
* @param functionResource The function resource to validate
|
|
536
531
|
* @alpha
|
|
537
532
|
* @hidden
|
|
538
533
|
* @category Functions Types
|
|
539
534
|
* @returns Array of validation errors, empty if valid
|
|
540
535
|
*/
|
|
541
|
-
export function
|
|
536
|
+
export function validateDurableFunction(functionResource: unknown): BlueprintError[] {
|
|
542
537
|
if (!functionResource) return [{type: 'invalid_value', message: 'Function config must be provided'}]
|
|
543
538
|
if (typeof functionResource !== 'object') return [{type: 'invalid_type', message: 'Function config must be an object'}]
|
|
544
539
|
|
|
545
540
|
const errors: BlueprintError[] = []
|
|
546
541
|
|
|
547
|
-
if ('type' in functionResource && functionResource.type !== 'sanity.function.
|
|
548
|
-
errors.push({type: 'invalid_value', message: '`type` must be `sanity.function.
|
|
542
|
+
if ('type' in functionResource && functionResource.type !== 'sanity.function.durable') {
|
|
543
|
+
errors.push({type: 'invalid_value', message: '`type` must be `sanity.function.durable`'})
|
|
549
544
|
}
|
|
550
545
|
|
|
551
546
|
if ('debounceKey' in functionResource && typeof functionResource.debounceKey !== 'string') {
|
|
@@ -573,7 +568,7 @@ export function validatePipelineFunction(functionResource: unknown): BlueprintEr
|
|
|
573
568
|
}
|
|
574
569
|
|
|
575
570
|
if ('event' in functionResource) {
|
|
576
|
-
errors.push(...
|
|
571
|
+
errors.push(...validateFunctionContentLakeEvent(functionResource.event))
|
|
577
572
|
}
|
|
578
573
|
|
|
579
574
|
errors.push(...validateFunction(functionResource))
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type {BlueprintError} from '../types/errors.js'
|
|
2
|
+
import {APPLICATION_VISIBILITIES} from '../types/studios.js'
|
|
2
3
|
import {validateResource} from './resources.js'
|
|
3
4
|
|
|
4
5
|
/**
|
|
@@ -24,6 +25,38 @@ export function validateStudio(resource: unknown): BlueprintError[] {
|
|
|
24
25
|
errors.push({type: 'invalid_type', message: 'Studio src must be a string'})
|
|
25
26
|
}
|
|
26
27
|
|
|
28
|
+
if (!('project' in resource) || !resource.project) {
|
|
29
|
+
errors.push({type: 'missing_parameter', message: 'Studio project is required'})
|
|
30
|
+
} else if (typeof resource.project !== 'string') {
|
|
31
|
+
errors.push({type: 'invalid_type', message: 'Studio project must be a string'})
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (!('slug' in resource) || !resource.slug) {
|
|
35
|
+
errors.push({type: 'missing_parameter', message: 'Studio slug is required'})
|
|
36
|
+
} else if (typeof resource.slug !== 'string') {
|
|
37
|
+
errors.push({type: 'invalid_type', message: 'Studio slug must be a string'})
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
if (!('title' in resource) || !resource.title) {
|
|
41
|
+
errors.push({type: 'missing_parameter', message: 'Studio title is required'})
|
|
42
|
+
} else if (typeof resource.title !== 'string') {
|
|
43
|
+
errors.push({type: 'invalid_type', message: 'Studio title must be a string'})
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
if ('icon' in resource) {
|
|
47
|
+
if (typeof resource.icon !== 'string') {
|
|
48
|
+
errors.push({type: 'invalid_type', message: 'Studio icon must be a string'})
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if (
|
|
53
|
+
'visibility' in resource &&
|
|
54
|
+
typeof resource.visibility !== 'undefined' &&
|
|
55
|
+
!APPLICATION_VISIBILITIES.some((av) => av === resource.visibility)
|
|
56
|
+
) {
|
|
57
|
+
errors.push({type: 'invalid_value', message: 'visibility must be one of `default`, `unlisted`, or `disabled`'})
|
|
58
|
+
}
|
|
59
|
+
|
|
27
60
|
if (!('autoUpdates' in resource) || !resource.autoUpdates) {
|
|
28
61
|
errors.push({type: 'missing_parameter', message: 'Studio autoUpdates is required'})
|
|
29
62
|
} else if (typeof resource.autoUpdates !== 'object') {
|
|
@@ -66,11 +99,5 @@ export function validateStudio(resource: unknown): BlueprintError[] {
|
|
|
66
99
|
}
|
|
67
100
|
}
|
|
68
101
|
|
|
69
|
-
if ('project' in resource) {
|
|
70
|
-
if (typeof resource.project !== 'string') {
|
|
71
|
-
errors.push({type: 'invalid_type', message: 'Studio project must be a string'})
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
102
|
return errors
|
|
76
103
|
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { type BlueprintEventFunctionConfig, type BlueprintEventFunctionResource } from '../../index.js';
|
|
2
|
-
/**
|
|
3
|
-
* Defines a function that provide event behaviour.
|
|
4
|
-
*
|
|
5
|
-
* @remarks
|
|
6
|
-
* A barebones event function
|
|
7
|
-
* ```ts
|
|
8
|
-
* defineEventFunction({
|
|
9
|
-
* name: 'send-email',
|
|
10
|
-
* })
|
|
11
|
-
* ```
|
|
12
|
-
* @public
|
|
13
|
-
* @alpha Deploying Event Functions via Blueprints is experimental. This feature is not available publicly yet.
|
|
14
|
-
* @hidden
|
|
15
|
-
* @category Definers
|
|
16
|
-
* @expandType BlueprintEventFunctionConfig
|
|
17
|
-
* @param functionConfig The configuration for the event function
|
|
18
|
-
* @returns The validated event function resource
|
|
19
|
-
*/
|
|
20
|
-
export declare function defineEventFunction(functionConfig: BlueprintEventFunctionConfig): BlueprintEventFunctionResource;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { validateEventFunction } from '../../index.js';
|
|
2
|
-
import { runValidation } from '../../utils/validation.js';
|
|
3
|
-
import { defineFunction } from './index.js';
|
|
4
|
-
/**
|
|
5
|
-
* Defines a function that provide event behaviour.
|
|
6
|
-
*
|
|
7
|
-
* @remarks
|
|
8
|
-
* A barebones event function
|
|
9
|
-
* ```ts
|
|
10
|
-
* defineEventFunction({
|
|
11
|
-
* name: 'send-email',
|
|
12
|
-
* })
|
|
13
|
-
* ```
|
|
14
|
-
* @public
|
|
15
|
-
* @alpha Deploying Event Functions via Blueprints is experimental. This feature is not available publicly yet.
|
|
16
|
-
* @hidden
|
|
17
|
-
* @category Definers
|
|
18
|
-
* @expandType BlueprintEventFunctionConfig
|
|
19
|
-
* @param functionConfig The configuration for the event function
|
|
20
|
-
* @returns The validated event function resource
|
|
21
|
-
*/
|
|
22
|
-
export function defineEventFunction(functionConfig) {
|
|
23
|
-
const functionResource = {
|
|
24
|
-
...defineFunction(functionConfig, { skipValidation: true }),
|
|
25
|
-
type: 'sanity.function.event',
|
|
26
|
-
};
|
|
27
|
-
runValidation(() => validateEventFunction(functionResource));
|
|
28
|
-
return functionResource;
|
|
29
|
-
}
|
|
30
|
-
//# sourceMappingURL=event.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"event.js","sourceRoot":"","sources":["../../../src/definers/functions/event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyE,qBAAqB,EAAC,MAAM,gBAAgB,CAAA;AAC5H,OAAO,EAAC,aAAa,EAAC,MAAM,2BAA2B,CAAA;AACvD,OAAO,EAAC,cAAc,EAAC,MAAM,YAAY,CAAA;AAEzC;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,mBAAmB,CAAC,cAA4C;IAC9E,MAAM,gBAAgB,GAAmC;QACvD,GAAG,cAAc,CAAC,cAAc,EAAE,EAAC,cAAc,EAAE,IAAI,EAAC,CAAC;QACzD,IAAI,EAAE,uBAAuB;KAC9B,CAAA;IAED,aAAa,CAAC,GAAG,EAAE,CAAC,qBAAqB,CAAC,gBAAgB,CAAC,CAAC,CAAA;IAE5D,OAAO,gBAAgB,CAAA;AACzB,CAAC"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { type BlueprintPipelineConfig, type BlueprintPipelineResource } from '../../index.js';
|
|
2
|
-
/**
|
|
3
|
-
* Defines a pipeline function resource.
|
|
4
|
-
*
|
|
5
|
-
* @remarks
|
|
6
|
-
*
|
|
7
|
-
* ```ts
|
|
8
|
-
* definePipeline({
|
|
9
|
-
* name: 'daily-cleanup',
|
|
10
|
-
* event: {type: 'document', on: ['create'], filter: "_type == 'post'"},
|
|
11
|
-
* concurrency: 5,
|
|
12
|
-
* debounce: 10,
|
|
13
|
-
* debounceKey: 'document._id',
|
|
14
|
-
* })
|
|
15
|
-
* ```
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* @param functionConfig The configuration for the function
|
|
19
|
-
* @category Definers
|
|
20
|
-
* @alpha Deploying Pipeline Functions via Blueprints is experimental. This feature is not available publicly yet.
|
|
21
|
-
* @public
|
|
22
|
-
* @hidden
|
|
23
|
-
* @expandType BlueprintPipelineConfig
|
|
24
|
-
* @returns The validated pipeline function resource
|
|
25
|
-
*/
|
|
26
|
-
export declare function definePipeline(functionConfig: BlueprintPipelineConfig): BlueprintPipelineResource;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline.js","sourceRoot":"","sources":["../../../src/definers/functions/pipeline.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+D,wBAAwB,EAAC,MAAM,gBAAgB,CAAA;AACrH,OAAO,EAAC,aAAa,EAAC,MAAM,2BAA2B,CAAA;AACvD,OAAO,EAAC,cAAc,EAAC,MAAM,YAAY,CAAA;AAEzC;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,UAAU,cAAc,CAAC,cAAuC;IACpE,MAAM,EAAC,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,EAAE,GAAG,EAAC,GAAG,cAAc,CAAA;IAC7E,MAAM,gBAAgB,GAA8B;QAClD,GAAG,cAAc,CAAC,EAAC,GAAG,cAAc,EAAE,GAAG,EAAE,GAAG,IAAI,aAAa,IAAI,EAAE,EAAC,EAAE,EAAC,cAAc,EAAE,IAAI,EAAC,CAAC;QAC/F,IAAI,EAAE,0BAA0B;QAChC,GAAG,CAAC,KAAK,KAAK,SAAS,IAAI,EAAC,KAAK,EAAC,CAAC;QACnC,GAAG,CAAC,WAAW,KAAK,SAAS,IAAI,EAAC,WAAW,EAAC,CAAC;QAC/C,GAAG,CAAC,QAAQ,KAAK,SAAS,IAAI,EAAC,QAAQ,EAAC,CAAC;QACzC,GAAG,CAAC,WAAW,KAAK,SAAS,IAAI,EAAC,WAAW,EAAC,CAAC;KAChD,CAAA;IAED,aAAa,CAAC,GAAG,EAAE,CAAC,wBAAwB,CAAC,gBAAgB,CAAC,CAAC,CAAA;IAC/D,OAAO,gBAAgB,CAAA;AACzB,CAAC"}
|