@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,32 +0,0 @@
|
|
|
1
|
-
import {type BlueprintEventFunctionConfig, type BlueprintEventFunctionResource, validateEventFunction} from '../../index.js'
|
|
2
|
-
import {runValidation} from '../../utils/validation.js'
|
|
3
|
-
import {defineFunction} from './index.js'
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Defines a function that provide event behaviour.
|
|
7
|
-
*
|
|
8
|
-
* @remarks
|
|
9
|
-
* A barebones event function
|
|
10
|
-
* ```ts
|
|
11
|
-
* defineEventFunction({
|
|
12
|
-
* name: 'send-email',
|
|
13
|
-
* })
|
|
14
|
-
* ```
|
|
15
|
-
* @public
|
|
16
|
-
* @alpha Deploying Event Functions via Blueprints is experimental. This feature is not available publicly yet.
|
|
17
|
-
* @hidden
|
|
18
|
-
* @category Definers
|
|
19
|
-
* @expandType BlueprintEventFunctionConfig
|
|
20
|
-
* @param functionConfig The configuration for the event function
|
|
21
|
-
* @returns The validated event function resource
|
|
22
|
-
*/
|
|
23
|
-
export function defineEventFunction(functionConfig: BlueprintEventFunctionConfig): BlueprintEventFunctionResource {
|
|
24
|
-
const functionResource: BlueprintEventFunctionResource = {
|
|
25
|
-
...defineFunction(functionConfig, {skipValidation: true}),
|
|
26
|
-
type: 'sanity.function.event',
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
runValidation(() => validateEventFunction(functionResource))
|
|
30
|
-
|
|
31
|
-
return functionResource
|
|
32
|
-
}
|