@sanity/blueprints 0.9.0 → 0.11.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 +326 -14
- package/dist/definers/blueprints.d.ts +2 -0
- package/dist/definers/blueprints.js +2 -0
- package/dist/definers/blueprints.js.map +1 -1
- package/dist/definers/cors.d.ts +4 -0
- package/dist/definers/cors.js +4 -0
- package/dist/definers/cors.js.map +1 -1
- package/dist/definers/datasets.d.ts +5 -0
- package/dist/definers/datasets.js +5 -0
- package/dist/definers/datasets.js.map +1 -1
- package/dist/definers/functions.d.ts +41 -12
- package/dist/definers/functions.js +60 -16
- package/dist/definers/functions.js.map +1 -1
- package/dist/definers/resources.d.ts +2 -0
- package/dist/definers/resources.js +2 -0
- package/dist/definers/resources.js.map +1 -1
- package/dist/definers/robots.d.ts +4 -0
- package/dist/definers/robots.js +4 -0
- package/dist/definers/robots.js.map +1 -1
- package/dist/definers/roles.d.ts +6 -0
- package/dist/definers/roles.js +6 -0
- package/dist/definers/roles.js.map +1 -1
- package/dist/definers/webhooks.d.ts +4 -0
- package/dist/definers/webhooks.js +4 -0
- package/dist/definers/webhooks.js.map +1 -1
- package/dist/index.d.ts +20 -0
- package/dist/index.js +21 -0
- package/dist/index.js.map +1 -1
- package/dist/types/blueprints.d.ts +16 -4
- package/dist/types/cors.d.ts +4 -0
- package/dist/types/datasets.d.ts +14 -2
- package/dist/types/errors.d.ts +4 -1
- package/dist/types/functions.d.ts +81 -16
- package/dist/types/functions.js +5 -1
- package/dist/types/functions.js.map +1 -1
- package/dist/types/resources.d.ts +16 -1
- package/dist/types/robots.d.ts +12 -3
- package/dist/types/roles.d.ts +11 -3
- package/dist/types/webhooks.d.ts +18 -6
- package/dist/utils/schedule-parser.d.ts +42 -0
- package/dist/utils/schedule-parser.js +450 -0
- package/dist/utils/schedule-parser.js.map +1 -0
- package/dist/utils/validation.d.ts +1 -0
- package/dist/utils/validation.js +1 -0
- package/dist/utils/validation.js.map +1 -1
- package/dist/validation/blueprints.d.ts +1 -0
- package/dist/validation/blueprints.js +1 -0
- package/dist/validation/blueprints.js.map +1 -1
- package/dist/validation/cors.d.ts +1 -0
- package/dist/validation/cors.js +1 -0
- package/dist/validation/cors.js.map +1 -1
- package/dist/validation/datasets.d.ts +2 -0
- package/dist/validation/datasets.js +2 -0
- package/dist/validation/datasets.js.map +1 -1
- package/dist/validation/functions.d.ts +11 -0
- package/dist/validation/functions.js +37 -1
- package/dist/validation/functions.js.map +1 -1
- package/dist/validation/resources.d.ts +7 -1
- package/dist/validation/resources.js +23 -16
- package/dist/validation/resources.js.map +1 -1
- package/dist/validation/robots.d.ts +7 -0
- package/dist/validation/robots.js +7 -0
- package/dist/validation/robots.js.map +1 -1
- package/dist/validation/roles.d.ts +3 -1
- package/dist/validation/roles.js +3 -1
- package/dist/validation/roles.js.map +1 -1
- package/dist/validation/webhooks.d.ts +1 -0
- package/dist/validation/webhooks.js +1 -0
- package/dist/validation/webhooks.js.map +1 -1
- package/package.json +4 -1
- package/src/definers/blueprints.ts +2 -0
- package/src/definers/cors.ts +4 -0
- package/src/definers/datasets.ts +5 -0
- package/src/definers/functions.ts +65 -18
- package/src/definers/resources.ts +2 -0
- package/src/definers/robots.ts +4 -0
- package/src/definers/roles.ts +6 -0
- package/src/definers/webhooks.ts +4 -0
- package/src/index.ts +22 -0
- package/src/types/blueprints.ts +16 -4
- package/src/types/cors.ts +4 -0
- package/src/types/datasets.ts +14 -2
- package/src/types/errors.ts +4 -1
- package/src/types/functions.ts +93 -15
- package/src/types/resources.ts +16 -1
- package/src/types/robots.ts +12 -3
- package/src/types/roles.ts +11 -3
- package/src/types/webhooks.ts +18 -6
- package/src/utils/schedule-parser.ts +502 -0
- package/src/utils/validation.ts +1 -0
- package/src/validation/blueprints.ts +1 -0
- package/src/validation/cors.ts +1 -0
- package/src/validation/datasets.ts +2 -0
- package/src/validation/functions.ts +37 -0
- package/src/validation/resources.ts +24 -16
- package/src/validation/robots.ts +7 -0
- package/src/validation/roles.ts +3 -1
- package/src/validation/webhooks.ts +1 -0
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { validateDocumentFunction, validateFunction, validateMediaLibraryAssetFunction, validateScheduleFunction, } from '../index.js';
|
|
2
|
+
import { parseScheduleExpression } from '../utils/schedule-parser.js';
|
|
2
3
|
import { runValidation } from '../utils/validation.js';
|
|
3
4
|
const BASE_EVENT_KEYS = new Set(['on', 'filter', 'projection', 'includeDrafts']);
|
|
4
5
|
const DOCUMENT_EVENT_KEYS = new Set(['includeAllVersions', 'resource', ...BASE_EVENT_KEYS.values()]);
|
|
5
6
|
const MEDIA_LIBRARY_EVENT_KEYS = new Set(['resource', ...BASE_EVENT_KEYS.values()]);
|
|
6
7
|
const SCHEDULE_EVENT_KEYS = new Set(['minute', 'hour', 'dayOfWeek', 'month', 'dayOfMonth', 'expression']);
|
|
7
8
|
export function defineDocumentFunction(functionConfig) {
|
|
8
|
-
let { name, src, event, timeout, memory, env, type, robotToken, ...maybeEvent } = functionConfig;
|
|
9
|
+
let { name, src, event, timeout, memory, env, type, robotToken, project, runtime, ...maybeEvent } = functionConfig;
|
|
9
10
|
if (!type)
|
|
10
11
|
type = 'sanity.function.document';
|
|
11
12
|
// event validation and normalization
|
|
@@ -30,6 +31,8 @@ export function defineDocumentFunction(functionConfig) {
|
|
|
30
31
|
memory,
|
|
31
32
|
env,
|
|
32
33
|
robotToken,
|
|
34
|
+
project,
|
|
35
|
+
runtime,
|
|
33
36
|
}, {
|
|
34
37
|
skipValidation: true, // already done below
|
|
35
38
|
}),
|
|
@@ -60,10 +63,12 @@ export function defineDocumentFunction(functionConfig) {
|
|
|
60
63
|
* })
|
|
61
64
|
* ```
|
|
62
65
|
* @param functionConfig The configuration for the media library asset function
|
|
66
|
+
* @public
|
|
67
|
+
* @category Definers
|
|
63
68
|
* @returns The validated media library asset function resource
|
|
64
69
|
*/
|
|
65
70
|
export function defineMediaLibraryAssetFunction(functionConfig) {
|
|
66
|
-
let { name, src, event, timeout, memory, env, type, robotToken } = functionConfig;
|
|
71
|
+
let { name, src, event, timeout, memory, env, type, robotToken, project, runtime } = functionConfig;
|
|
67
72
|
if (!type)
|
|
68
73
|
type = 'sanity.function.media-library.asset';
|
|
69
74
|
const functionResource = {
|
|
@@ -74,6 +79,8 @@ export function defineMediaLibraryAssetFunction(functionConfig) {
|
|
|
74
79
|
memory,
|
|
75
80
|
env,
|
|
76
81
|
robotToken,
|
|
82
|
+
project,
|
|
83
|
+
runtime,
|
|
77
84
|
}, {
|
|
78
85
|
skipValidation: true, // already done below
|
|
79
86
|
}),
|
|
@@ -85,27 +92,49 @@ export function defineMediaLibraryAssetFunction(functionConfig) {
|
|
|
85
92
|
}
|
|
86
93
|
/**
|
|
87
94
|
* Defines a function that is triggered on a schedule.
|
|
95
|
+
* Supports cron expressions or natural language schedules.
|
|
96
|
+
*
|
|
88
97
|
* ```
|
|
98
|
+
* // Using cron expression
|
|
99
|
+
* defineScheduleFunction({
|
|
100
|
+
* name: 'daily-cleanup',
|
|
101
|
+
* event: {expression: '0 9 * * *'},
|
|
102
|
+
* })
|
|
103
|
+
*
|
|
104
|
+
* // Using natural language
|
|
105
|
+
* defineScheduleFunction({
|
|
106
|
+
* name: 'daily-report',
|
|
107
|
+
* event: {expression: 'every day at 9am'},
|
|
108
|
+
* })
|
|
109
|
+
*
|
|
110
|
+
* // More natural language examples:
|
|
111
|
+
* // 'every 15 minutes'
|
|
112
|
+
* // 'weekdays at 8am'
|
|
113
|
+
* // 'fridays in the evening'
|
|
114
|
+
* // 'mon, wed, fri at 9am'
|
|
115
|
+
* // 'first of the month at noon'
|
|
116
|
+
*
|
|
117
|
+
* // Using explicit cron fields
|
|
89
118
|
* defineScheduleFunction({
|
|
90
119
|
* name: 'my-schedule-function',
|
|
91
|
-
* src: 'functions/schedule-function',
|
|
92
|
-
* memory: 3,
|
|
93
|
-
* timeout: 300,
|
|
94
120
|
* event: {
|
|
95
|
-
* minute:
|
|
96
|
-
* hour:
|
|
97
|
-
* dayOfMonth:
|
|
98
|
-
* month:
|
|
99
|
-
* dayOfWeek:
|
|
121
|
+
* minute: '0',
|
|
122
|
+
* hour: '9',
|
|
123
|
+
* dayOfMonth: '*',
|
|
124
|
+
* month: '*',
|
|
125
|
+
* dayOfWeek: '*',
|
|
100
126
|
* },
|
|
101
127
|
* })
|
|
102
128
|
* ```
|
|
103
|
-
* @
|
|
104
|
-
* @
|
|
129
|
+
* @public
|
|
130
|
+
* @alpha Deploying Schedule Functions via Blueprints is experimental. This feature is not available publicly yet.
|
|
131
|
+
* @hidden
|
|
132
|
+
* @category Definers
|
|
133
|
+
* @param functionConfig The configuration for the schedule function
|
|
105
134
|
* @returns The validated schedule function resource
|
|
106
135
|
*/
|
|
107
136
|
export function defineScheduleFunction(functionConfig) {
|
|
108
|
-
let { name, src, event, timeout, memory, env, type, timezone } = functionConfig;
|
|
137
|
+
let { name, src, event, timeout, memory, env, type, timezone, runtime } = functionConfig;
|
|
109
138
|
if (!type)
|
|
110
139
|
type = 'sanity.function.cron';
|
|
111
140
|
const functionResource = {
|
|
@@ -115,6 +144,7 @@ export function defineScheduleFunction(functionConfig) {
|
|
|
115
144
|
timeout,
|
|
116
145
|
memory,
|
|
117
146
|
env,
|
|
147
|
+
runtime,
|
|
118
148
|
}, {
|
|
119
149
|
skipValidation: true, // already done below
|
|
120
150
|
}),
|
|
@@ -125,6 +155,10 @@ export function defineScheduleFunction(functionConfig) {
|
|
|
125
155
|
functionResource.timezone = timezone;
|
|
126
156
|
}
|
|
127
157
|
runValidation(() => validateScheduleFunction(functionResource));
|
|
158
|
+
// Parse expression after validation (validation ensures it's valid)
|
|
159
|
+
if ('expression' in functionResource.event && functionResource.event.expression) {
|
|
160
|
+
functionResource.event.expression = parseScheduleExpression(functionResource.event.expression);
|
|
161
|
+
}
|
|
128
162
|
return functionResource;
|
|
129
163
|
}
|
|
130
164
|
/**
|
|
@@ -135,6 +169,7 @@ export function defineScheduleFunction(functionConfig) {
|
|
|
135
169
|
* src: 'functions/my-function',
|
|
136
170
|
* timeout: 300,
|
|
137
171
|
* memory: 1,
|
|
172
|
+
* runtime: 'nodejs24.x',
|
|
138
173
|
* env: {
|
|
139
174
|
* MY_ENV_VAR: 'my-custom-value'
|
|
140
175
|
* },
|
|
@@ -142,10 +177,12 @@ export function defineScheduleFunction(functionConfig) {
|
|
|
142
177
|
* ```
|
|
143
178
|
* @param functionConfig The configuration for the function
|
|
144
179
|
* @param options Optional configuration including validation options
|
|
180
|
+
* @category Definers
|
|
181
|
+
* @internal
|
|
145
182
|
* @returns The validated function resource
|
|
146
183
|
*/
|
|
147
184
|
export function defineFunction(functionConfig, options) {
|
|
148
|
-
let { name, src, timeout, memory, env, type, robotToken } = functionConfig;
|
|
185
|
+
let { name, src, timeout, memory, env, type, robotToken, project, runtime } = functionConfig;
|
|
149
186
|
// defaults
|
|
150
187
|
if (!src)
|
|
151
188
|
src = `functions/${name}`;
|
|
@@ -159,6 +196,8 @@ export function defineFunction(functionConfig, options) {
|
|
|
159
196
|
memory,
|
|
160
197
|
env,
|
|
161
198
|
robotToken,
|
|
199
|
+
project,
|
|
200
|
+
runtime,
|
|
162
201
|
};
|
|
163
202
|
if (options?.skipValidation !== true)
|
|
164
203
|
runValidation(() => validateFunction(functionResource));
|
|
@@ -191,8 +230,13 @@ function buildMediaLibraryFunctionEvent(event) {
|
|
|
191
230
|
};
|
|
192
231
|
return fullEvent;
|
|
193
232
|
}
|
|
233
|
+
/**
|
|
234
|
+
* Builds a schedule function event configuration.
|
|
235
|
+
* Filters out non-event properties. Does not parse expressions.
|
|
236
|
+
* @param event Schedule function event configuration
|
|
237
|
+
* @returns Cleaned schedule function event configuration
|
|
238
|
+
*/
|
|
194
239
|
function buildScheduleFunctionEvent(event) {
|
|
195
|
-
|
|
196
|
-
return cleanEvent;
|
|
240
|
+
return Object.fromEntries(Object.entries(event).filter(([key]) => SCHEDULE_EVENT_KEYS.has(key)));
|
|
197
241
|
}
|
|
198
242
|
//# sourceMappingURL=functions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"functions.js","sourceRoot":"","sources":["../../src/definers/functions.ts"],"names":[],"mappings":"AAAA,OAAO,EAWL,wBAAwB,EACxB,gBAAgB,EAChB,iCAAiC,EACjC,wBAAwB,GACzB,MAAM,aAAa,CAAA;AACpB,OAAO,EAAC,aAAa,EAAC,MAAM,wBAAwB,CAAA;AAGpD,MAAM,eAAe,GAAG,IAAI,GAAG,CAAuB,CAAC,IAAI,EAAE,QAAQ,EAAE,YAAY,EAAE,eAAe,CAAC,CAAC,CAAA;AAEtG,MAAM,mBAAmB,GAAG,IAAI,GAAG,CAA2B,CAAC,oBAAoB,EAAE,UAAU,EAAE,GAAG,eAAe,CAAC,MAAM,EAAE,CAAC,CAAC,CAAA;AAE9H,MAAM,wBAAwB,GAAG,IAAI,GAAG,CAA+B,CAAC,UAAU,EAAE,GAAG,eAAe,CAAC,MAAM,EAAE,CAAC,CAAC,CAAA;AAIjH,MAAM,mBAAmB,GAAG,IAAI,GAAG,CAA2B,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,YAAY,EAAE,YAAY,CAAC,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"functions.js","sourceRoot":"","sources":["../../src/definers/functions.ts"],"names":[],"mappings":"AAAA,OAAO,EAWL,wBAAwB,EACxB,gBAAgB,EAChB,iCAAiC,EACjC,wBAAwB,GACzB,MAAM,aAAa,CAAA;AACpB,OAAO,EAAC,uBAAuB,EAAC,MAAM,6BAA6B,CAAA;AACnE,OAAO,EAAC,aAAa,EAAC,MAAM,wBAAwB,CAAA;AAGpD,MAAM,eAAe,GAAG,IAAI,GAAG,CAAuB,CAAC,IAAI,EAAE,QAAQ,EAAE,YAAY,EAAE,eAAe,CAAC,CAAC,CAAA;AAEtG,MAAM,mBAAmB,GAAG,IAAI,GAAG,CAA2B,CAAC,oBAAoB,EAAE,UAAU,EAAE,GAAG,eAAe,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
|
* Defines a generic resource to be managed in Blueprints.
|
|
4
4
|
* This is useful if the resource type does not yet have a `define*` function.
|
|
5
5
|
* @param resourceConfig The resource configuration
|
|
6
|
+
* @category Definers
|
|
7
|
+
* @internal
|
|
6
8
|
*/
|
|
7
9
|
export declare function defineResource(resourceConfig: Partial<BlueprintResource>): BlueprintResource;
|
|
@@ -3,6 +3,8 @@ import { assertResource } from '../index.js';
|
|
|
3
3
|
* Defines a generic resource to be managed in Blueprints.
|
|
4
4
|
* This is useful if the resource type does not yet have a `define*` function.
|
|
5
5
|
* @param resourceConfig The resource configuration
|
|
6
|
+
* @category Definers
|
|
7
|
+
* @internal
|
|
6
8
|
*/
|
|
7
9
|
export function defineResource(resourceConfig) {
|
|
8
10
|
const resource = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resources.js","sourceRoot":"","sources":["../../src/definers/resources.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAyB,MAAM,aAAa,CAAA;AAElE
|
|
1
|
+
{"version":3,"file":"resources.js","sourceRoot":"","sources":["../../src/definers/resources.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAyB,MAAM,aAAa,CAAA;AAElE;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAAC,cAA0C;IACvE,MAAM,QAAQ,GAAG;QACf,GAAG,cAAc;KAClB,CAAA;IAED,cAAc,CAAC,QAAQ,CAAC,CAAA;IAExB,OAAO,QAAQ,CAAA;AACjB,CAAC"}
|
|
@@ -14,5 +14,9 @@ import { type BlueprintRobotConfig, type BlueprintRobotResource } from '../index
|
|
|
14
14
|
* ```
|
|
15
15
|
*
|
|
16
16
|
* @param parameters The robot configuration
|
|
17
|
+
* @public
|
|
18
|
+
* @beta Deploying Robots via Blueprints is experimental. This feature is stabilizing but may still be subject to breaking changes.
|
|
19
|
+
* @category Definers
|
|
20
|
+
* @returns The robot resource
|
|
17
21
|
*/
|
|
18
22
|
export declare function defineRobot(parameters: BlueprintRobotConfig): BlueprintRobotResource;
|
package/dist/definers/robots.js
CHANGED
|
@@ -15,6 +15,10 @@ import { runValidation } from '../utils/validation.js';
|
|
|
15
15
|
* ```
|
|
16
16
|
*
|
|
17
17
|
* @param parameters The robot configuration
|
|
18
|
+
* @public
|
|
19
|
+
* @beta Deploying Robots via Blueprints is experimental. This feature is stabilizing but may still be subject to breaking changes.
|
|
20
|
+
* @category Definers
|
|
21
|
+
* @returns The robot resource
|
|
18
22
|
*/
|
|
19
23
|
export function defineRobot(parameters) {
|
|
20
24
|
// default robot label
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"robots.js","sourceRoot":"","sources":["../../src/definers/robots.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyD,aAAa,EAAC,MAAM,aAAa,CAAA;AACjG,OAAO,EAAC,aAAa,EAAC,MAAM,wBAAwB,CAAA;AAEpD
|
|
1
|
+
{"version":3,"file":"robots.js","sourceRoot":"","sources":["../../src/definers/robots.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyD,aAAa,EAAC,MAAM,aAAa,CAAA;AACjG,OAAO,EAAC,aAAa,EAAC,MAAM,wBAAwB,CAAA;AAEpD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,WAAW,CAAC,UAAgC;IAC1D,sBAAsB;IACtB,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,IAAI,UAAU,CAAC,IAAI,CAAA;IAEjD,MAAM,aAAa,GAA2B;QAC5C,GAAG,UAAU;QACb,KAAK;QACL,IAAI,EAAE,qBAAqB;KAC5B,CAAA;IAED,aAAa,CAAC,GAAG,EAAE,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC,CAAA;IAEjD,OAAO,aAAa,CAAA;AACtB,CAAC"}
|
package/dist/definers/roles.d.ts
CHANGED
|
@@ -20,6 +20,9 @@ import { type BlueprintProjectRoleResource, type BlueprintRoleConfig, type Bluep
|
|
|
20
20
|
* }),
|
|
21
21
|
* ```
|
|
22
22
|
* @param parameters The configuration of the role
|
|
23
|
+
* @public
|
|
24
|
+
* @beta Deploying Roles via Blueprints is experimental. This feature is stabilizing but may still be subject to breaking changes.
|
|
25
|
+
* @category Definers
|
|
23
26
|
* @returns The role resource
|
|
24
27
|
*/
|
|
25
28
|
export declare function defineRole(parameters: BlueprintRoleConfig, options?: {
|
|
@@ -45,6 +48,9 @@ export declare function defineRole(parameters: BlueprintRoleConfig, options?: {
|
|
|
45
48
|
* }]
|
|
46
49
|
* }),
|
|
47
50
|
* ```
|
|
51
|
+
* @public
|
|
52
|
+
* @beta Deploying Roles via Blueprints is experimental. This feature is stabilizing but may still be subject to breaking changes.
|
|
53
|
+
* @category Definers
|
|
48
54
|
* @param projectId The ID of the project to which the role will be scoped
|
|
49
55
|
* @param parameters The configuration of the role
|
|
50
56
|
* @returns The role resource
|
package/dist/definers/roles.js
CHANGED
|
@@ -21,6 +21,9 @@ import { runValidation } from '../utils/validation.js';
|
|
|
21
21
|
* }),
|
|
22
22
|
* ```
|
|
23
23
|
* @param parameters The configuration of the role
|
|
24
|
+
* @public
|
|
25
|
+
* @beta Deploying Roles via Blueprints is experimental. This feature is stabilizing but may still be subject to breaking changes.
|
|
26
|
+
* @category Definers
|
|
24
27
|
* @returns The role resource
|
|
25
28
|
*/
|
|
26
29
|
export function defineRole(parameters, options) {
|
|
@@ -60,6 +63,9 @@ export function defineRole(parameters, options) {
|
|
|
60
63
|
* }]
|
|
61
64
|
* }),
|
|
62
65
|
* ```
|
|
66
|
+
* @public
|
|
67
|
+
* @beta Deploying Roles via Blueprints is experimental. This feature is stabilizing but may still be subject to breaking changes.
|
|
68
|
+
* @category Definers
|
|
63
69
|
* @param projectId The ID of the project to which the role will be scoped
|
|
64
70
|
* @param parameters The configuration of the role
|
|
65
71
|
* @returns The role resource
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"roles.js","sourceRoot":"","sources":["../../src/definers/roles.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,mBAA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EAAE,CAAC,mBAAmB,CAAC,mBAAmB,CAAC,CAAC,CAAA;IAE7D,OAAO,mBAAmB,CAAA;AAC5B,CAAC"}
|
|
@@ -11,5 +11,9 @@ import { type BlueprintDocumentWebhookConfig, type BlueprintDocumentWebhookResou
|
|
|
11
11
|
* })
|
|
12
12
|
* ```
|
|
13
13
|
* @param parameters The webhook configuration
|
|
14
|
+
* @public
|
|
15
|
+
* @beta Deploying Webhooks via Blueprints is experimental. This feature is stabilizing but may still be subject to breaking changes.
|
|
16
|
+
* @category Definers
|
|
17
|
+
* @returns The webhook resource
|
|
14
18
|
*/
|
|
15
19
|
export declare function defineDocumentWebhook(parameters: BlueprintDocumentWebhookConfig): BlueprintDocumentWebhookResource;
|
|
@@ -12,6 +12,10 @@ import { runValidation } from '../utils/validation.js';
|
|
|
12
12
|
* })
|
|
13
13
|
* ```
|
|
14
14
|
* @param parameters The webhook configuration
|
|
15
|
+
* @public
|
|
16
|
+
* @beta Deploying Webhooks via Blueprints is experimental. This feature is stabilizing but may still be subject to breaking changes.
|
|
17
|
+
* @category Definers
|
|
18
|
+
* @returns The webhook resource
|
|
15
19
|
*/
|
|
16
20
|
export function defineDocumentWebhook(parameters) {
|
|
17
21
|
// default the display name
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webhooks.js","sourceRoot":"","sources":["../../src/definers/webhooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6E,uBAAuB,EAAC,MAAM,aAAa,CAAA;AAC/H,OAAO,EAAC,aAAa,EAAC,MAAM,wBAAwB,CAAA;AAEpD
|
|
1
|
+
{"version":3,"file":"webhooks.js","sourceRoot":"","sources":["../../src/definers/webhooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6E,uBAAuB,EAAC,MAAM,aAAa,CAAA;AAC/H,OAAO,EAAC,aAAa,EAAC,MAAM,wBAAwB,CAAA;AAEpD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,qBAAqB,CAAC,UAA0C;IAC9E,2BAA2B;IAC3B,IAAI,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC;QAC5B,UAAU,CAAC,WAAW,GAAG,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,GAAG,CAAC,CAAA;IAC5D,CAAC;IAED,MAAM,eAAe,GAAqC;QACxD,GAAG,UAAU;QACb,IAAI,EAAE,wBAAwB;KAC/B,CAAA;IAED,aAAa,CAAC,GAAG,EAAE,CAAC,uBAAuB,CAAC,eAAe,CAAC,CAAC,CAAA;IAE7D,OAAO,eAAe,CAAA;AACxB,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @categoryDescription Definers
|
|
3
|
+
* These functions are used to define resources in a Blueprint.
|
|
4
|
+
*/
|
|
1
5
|
export * from './definers/blueprints.js';
|
|
2
6
|
export * from './definers/cors.js';
|
|
3
7
|
export * from './definers/datasets.js';
|
|
@@ -6,6 +10,14 @@ export * from './definers/resources.js';
|
|
|
6
10
|
export * from './definers/robots.js';
|
|
7
11
|
export * from './definers/roles.js';
|
|
8
12
|
export * from './definers/webhooks.js';
|
|
13
|
+
/**
|
|
14
|
+
* @categoryDescription Resource Types
|
|
15
|
+
* These types are used to define the shape of resources in a Blueprint.
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* @categoryDescription Functions Types
|
|
19
|
+
* Resource types for functions in a Blueprint.
|
|
20
|
+
*/
|
|
9
21
|
export * from './types/blueprints.js';
|
|
10
22
|
export * from './types/cors.js';
|
|
11
23
|
export * from './types/datasets.js';
|
|
@@ -15,6 +27,10 @@ export * from './types/resources.js';
|
|
|
15
27
|
export * from './types/robots.js';
|
|
16
28
|
export * from './types/roles.js';
|
|
17
29
|
export * from './types/webhooks.js';
|
|
30
|
+
/**
|
|
31
|
+
* @categoryDescription Validation
|
|
32
|
+
* These functions are used to validate resources in a Blueprint.
|
|
33
|
+
*/
|
|
18
34
|
export * from './validation/blueprints.js';
|
|
19
35
|
export * from './validation/cors.js';
|
|
20
36
|
export * from './validation/datasets.js';
|
|
@@ -23,3 +39,7 @@ export * from './validation/resources.js';
|
|
|
23
39
|
export * from './validation/robots.js';
|
|
24
40
|
export * from './validation/roles.js';
|
|
25
41
|
export * from './validation/webhooks.js';
|
|
42
|
+
/**
|
|
43
|
+
* @categoryDescription Blueprint Internals
|
|
44
|
+
* Miscellaneous Blueprint types that make up the public API but are not exported directly.
|
|
45
|
+
*/
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
// DEFINERS - helper functions to create resources
|
|
2
|
+
/**
|
|
3
|
+
* @categoryDescription Definers
|
|
4
|
+
* These functions are used to define resources in a Blueprint.
|
|
5
|
+
*/
|
|
2
6
|
export * from './definers/blueprints.js';
|
|
3
7
|
export * from './definers/cors.js';
|
|
4
8
|
export * from './definers/datasets.js';
|
|
@@ -8,6 +12,14 @@ export * from './definers/robots.js';
|
|
|
8
12
|
export * from './definers/roles.js';
|
|
9
13
|
export * from './definers/webhooks.js';
|
|
10
14
|
// TYPES - base types for all resources
|
|
15
|
+
/**
|
|
16
|
+
* @categoryDescription Resource Types
|
|
17
|
+
* These types are used to define the shape of resources in a Blueprint.
|
|
18
|
+
*/
|
|
19
|
+
/**
|
|
20
|
+
* @categoryDescription Functions Types
|
|
21
|
+
* Resource types for functions in a Blueprint.
|
|
22
|
+
*/
|
|
11
23
|
export * from './types/blueprints.js';
|
|
12
24
|
export * from './types/cors.js';
|
|
13
25
|
export * from './types/datasets.js';
|
|
@@ -18,6 +30,10 @@ export * from './types/robots.js';
|
|
|
18
30
|
export * from './types/roles.js';
|
|
19
31
|
export * from './types/webhooks.js';
|
|
20
32
|
// VALIDATION - validation for all resources
|
|
33
|
+
/**
|
|
34
|
+
* @categoryDescription Validation
|
|
35
|
+
* These functions are used to validate resources in a Blueprint.
|
|
36
|
+
*/
|
|
21
37
|
export * from './validation/blueprints.js';
|
|
22
38
|
export * from './validation/cors.js';
|
|
23
39
|
export * from './validation/datasets.js';
|
|
@@ -26,4 +42,9 @@ export * from './validation/resources.js';
|
|
|
26
42
|
export * from './validation/robots.js';
|
|
27
43
|
export * from './validation/roles.js';
|
|
28
44
|
export * from './validation/webhooks.js';
|
|
45
|
+
// Public BLUEPRINTS INTERNALS - published bucket of misc Blueprint types
|
|
46
|
+
/**
|
|
47
|
+
* @categoryDescription Blueprint Internals
|
|
48
|
+
* Miscellaneous Blueprint types that make up the public API but are not exported directly.
|
|
49
|
+
*/
|
|
29
50
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,kDAAkD;AAClD,cAAc,0BAA0B,CAAA;AACxC,cAAc,oBAAoB,CAAA;AAClC,cAAc,wBAAwB,CAAA;AACtC,cAAc,yBAAyB,CAAA;AACvC,cAAc,yBAAyB,CAAA;AACvC,cAAc,sBAAsB,CAAA;AACpC,cAAc,qBAAqB,CAAA;AACnC,cAAc,wBAAwB,CAAA;AAEtC,uCAAuC;AACvC,cAAc,uBAAuB,CAAA;AACrC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,qBAAqB,CAAA;AACnC,cAAc,mBAAmB,CAAA;AACjC,cAAc,sBAAsB,CAAA;AACpC,cAAc,sBAAsB,CAAA;AACpC,cAAc,mBAAmB,CAAA;AACjC,cAAc,kBAAkB,CAAA;AAChC,cAAc,qBAAqB,CAAA;AAEnC,4CAA4C;AAC5C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,sBAAsB,CAAA;AACpC,cAAc,0BAA0B,CAAA;AACxC,cAAc,2BAA2B,CAAA;AACzC,cAAc,2BAA2B,CAAA;AACzC,cAAc,wBAAwB,CAAA;AACtC,cAAc,uBAAuB,CAAA;AACrC,cAAc,0BAA0B,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,kDAAkD;AAClD;;;GAGG;AACH,cAAc,0BAA0B,CAAA;AACxC,cAAc,oBAAoB,CAAA;AAClC,cAAc,wBAAwB,CAAA;AACtC,cAAc,yBAAyB,CAAA;AACvC,cAAc,yBAAyB,CAAA;AACvC,cAAc,sBAAsB,CAAA;AACpC,cAAc,qBAAqB,CAAA;AACnC,cAAc,wBAAwB,CAAA;AAEtC,uCAAuC;AACvC;;;GAGG;AACH;;;GAGG;AACH,cAAc,uBAAuB,CAAA;AACrC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,qBAAqB,CAAA;AACnC,cAAc,mBAAmB,CAAA;AACjC,cAAc,sBAAsB,CAAA;AACpC,cAAc,sBAAsB,CAAA;AACpC,cAAc,mBAAmB,CAAA;AACjC,cAAc,kBAAkB,CAAA;AAChC,cAAc,qBAAqB,CAAA;AAEnC,4CAA4C;AAC5C;;;GAGG;AACH,cAAc,4BAA4B,CAAA;AAC1C,cAAc,sBAAsB,CAAA;AACpC,cAAc,0BAA0B,CAAA;AACxC,cAAc,2BAA2B,CAAA;AACzC,cAAc,2BAA2B,CAAA;AACzC,cAAc,wBAAwB,CAAA;AACtC,cAAc,uBAAuB,CAAA;AACrC,cAAc,0BAA0B,CAAA;AAExC,yEAAyE;AACzE;;;GAGG"}
|
|
@@ -1,16 +1,25 @@
|
|
|
1
1
|
import type { BlueprintResource } from '../index.js';
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* Additional configuration on a Blueprint that overrides the normal configuration
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
3
6
|
export interface BlueprintsApiConfig {
|
|
4
7
|
organizationId: string;
|
|
5
8
|
projectId: string;
|
|
6
9
|
stackId: string;
|
|
7
10
|
}
|
|
8
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
* A key-value pair that will be output from a Blueprint
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
9
15
|
export interface BlueprintOutput {
|
|
10
16
|
name: string;
|
|
11
17
|
value: string;
|
|
12
18
|
}
|
|
13
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* A representation of a Blueprint document
|
|
21
|
+
* @category Blueprint Internals
|
|
22
|
+
*/
|
|
14
23
|
export interface Blueprint {
|
|
15
24
|
$schema: string;
|
|
16
25
|
blueprintVersion: string;
|
|
@@ -18,5 +27,8 @@ export interface Blueprint {
|
|
|
18
27
|
values?: Record<string, unknown>;
|
|
19
28
|
outputs?: BlueprintOutput[];
|
|
20
29
|
}
|
|
21
|
-
/**
|
|
30
|
+
/**
|
|
31
|
+
* The result of defining a blueprint with `defineBlueprint`
|
|
32
|
+
* @internal
|
|
33
|
+
*/
|
|
22
34
|
export type BlueprintModule = ((args?: unknown) => Blueprint) & Partial<BlueprintsApiConfig>;
|
package/dist/types/cors.d.ts
CHANGED
|
@@ -2,6 +2,8 @@ import type { BlueprintProjectResourceLifecycle, BlueprintResource } from '../in
|
|
|
2
2
|
/**
|
|
3
3
|
* Represents a CORS Origin resource.
|
|
4
4
|
* @see https://www.sanity.io/docs/content-lake/cors
|
|
5
|
+
* @beta This feature is subject to breaking changes.
|
|
6
|
+
* @category Resource Types
|
|
5
7
|
*/
|
|
6
8
|
export interface BlueprintCorsOriginResource extends BlueprintResource<BlueprintProjectResourceLifecycle> {
|
|
7
9
|
type: 'sanity.project.cors';
|
|
@@ -28,6 +30,8 @@ export interface BlueprintCorsOriginResource extends BlueprintResource<Blueprint
|
|
|
28
30
|
/**
|
|
29
31
|
* Configuration for a CORS Origin resource.
|
|
30
32
|
* @see https://www.sanity.io/docs/content-lake/cors
|
|
33
|
+
* @beta This feature is subject to breaking changes.
|
|
34
|
+
* @category Resource Types
|
|
31
35
|
*/
|
|
32
36
|
export type BlueprintCorsOriginConfig = Omit<BlueprintCorsOriginResource, 'type' | 'allowCredentials'> & {
|
|
33
37
|
/**
|
package/dist/types/datasets.d.ts
CHANGED
|
@@ -1,10 +1,19 @@
|
|
|
1
|
-
import type { BlueprintResource } from '../index.js';
|
|
1
|
+
import type { BlueprintProjectResourceLifecycle, BlueprintResource } from '../index.js';
|
|
2
|
+
/**
|
|
3
|
+
* The ACL mode for a dataset.
|
|
4
|
+
* @alpha
|
|
5
|
+
* @hidden
|
|
6
|
+
* @category Resource Types
|
|
7
|
+
*/
|
|
2
8
|
export type AclMode = 'public' | 'private' | 'custom';
|
|
3
9
|
/**
|
|
4
10
|
* Represents a Dataset resource.
|
|
5
11
|
* @see https://www.sanity.io/docs/content-lake/datasets
|
|
12
|
+
* @alpha This feature is subject to breaking changes.
|
|
13
|
+
* @hidden
|
|
14
|
+
* @category Resource Types
|
|
6
15
|
*/
|
|
7
|
-
export interface BlueprintDatasetResource extends BlueprintResource {
|
|
16
|
+
export interface BlueprintDatasetResource extends BlueprintResource<BlueprintProjectResourceLifecycle> {
|
|
8
17
|
type: 'sanity.project.dataset';
|
|
9
18
|
/** The name of the dataset. Must be unique within a project. */
|
|
10
19
|
datasetName: string;
|
|
@@ -20,6 +29,9 @@ export interface BlueprintDatasetResource extends BlueprintResource {
|
|
|
20
29
|
/**
|
|
21
30
|
* Configuration for a Dataset resource.
|
|
22
31
|
* @see https://www.sanity.io/docs/content-lake/datasets
|
|
32
|
+
* @alpha This feature is subject to breaking changes.
|
|
33
|
+
* @hidden
|
|
34
|
+
* @category Resource Types
|
|
23
35
|
*/
|
|
24
36
|
export type BlueprintDatasetConfig = Omit<BlueprintDatasetResource, 'type' | 'datasetName'> & {
|
|
25
37
|
/** The name of the dataset. Must be unique within a project. Defaults to the name of the resource. */
|