@sanity/blueprints 0.23.0 → 0.23.2
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/base-event.d.ts +2 -0
- package/dist/definers/functions/base-event.js +2 -0
- package/dist/definers/functions/base-event.js.map +1 -0
- package/dist/definers/functions/document.d.ts +26 -0
- package/dist/definers/functions/document.js +43 -0
- package/dist/definers/functions/document.js.map +1 -0
- package/dist/definers/functions/durable.d.ts +26 -0
- package/dist/definers/functions/durable.js +41 -0
- package/dist/definers/functions/durable.js.map +1 -0
- package/dist/definers/functions/index.d.ts +15 -0
- package/dist/definers/functions/index.js +34 -0
- package/dist/definers/functions/index.js.map +1 -0
- package/dist/definers/functions/media-library.d.ts +23 -0
- package/dist/definers/functions/media-library.js +83 -0
- package/dist/definers/functions/media-library.js.map +1 -0
- package/dist/definers/functions/pubsub.d.ts +20 -0
- package/dist/definers/functions/pubsub.js +30 -0
- package/dist/definers/functions/pubsub.js.map +1 -0
- package/dist/definers/functions/queue.d.ts +30 -0
- package/dist/definers/functions/queue.js +47 -0
- package/dist/definers/functions/queue.js.map +1 -0
- package/dist/definers/functions/scheduled.d.ts +46 -0
- package/dist/definers/functions/scheduled.js +91 -0
- package/dist/definers/functions/scheduled.js.map +1 -0
- package/dist/definers/functions/sync-tag-invalidate.d.ts +31 -0
- package/dist/definers/functions/sync-tag-invalidate.js +43 -0
- package/dist/definers/functions/sync-tag-invalidate.js.map +1 -0
- package/dist/definers/studios.js +5 -0
- package/dist/definers/studios.js.map +1 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.js +8 -1
- package/dist/index.js.map +1 -1
- package/dist/types/functions/event.d.ts +2 -4
- package/dist/types/functions/index.d.ts +61 -43
- 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 +3 -3
- package/dist/validation/functions.js +11 -13
- 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/base-event.ts +4 -0
- package/src/definers/functions/document.ts +129 -0
- package/src/definers/functions/durable.ts +42 -0
- package/src/definers/functions/index.ts +39 -0
- package/src/definers/functions/media-library.ts +98 -0
- package/src/definers/functions/pubsub.ts +32 -0
- package/src/definers/functions/queue.ts +49 -0
- package/src/definers/functions/scheduled.ts +112 -0
- package/src/definers/functions/sync-tag-invalidate.ts +51 -0
- package/src/definers/studios.ts +5 -0
- package/src/index.ts +8 -1
- package/src/types/functions/event.ts +2 -3
- package/src/types/functions/index.ts +73 -54
- package/src/types/studios.ts +46 -8
- package/src/validation/functions.ts +11 -13
- package/src/validation/studios.ts +33 -6
- package/dist/definers/functions.d.ts +0 -210
- package/dist/definers/functions.js +0 -381
- package/dist/definers/functions.js.map +0 -1
- package/src/definers/functions.ts +0 -540
|
@@ -1,381 +0,0 @@
|
|
|
1
|
-
import { validateDocumentFunction, validateEventFunction, validateFunction, validateMediaLibraryAssetFunction, validatePipelineFunction, validateQueueFunction, validateScheduledFunction, validateSyncTagInvalidateFunction, } from '../index.js';
|
|
2
|
-
import { parseScheduledExpression } from '../utils/schedule-parser.js';
|
|
3
|
-
import { runValidation } from '../utils/validation.js';
|
|
4
|
-
const BASE_EVENT_KEYS = new Set(['on', 'filter', 'projection', 'includeDrafts']);
|
|
5
|
-
const DOCUMENT_EVENT_KEYS = new Set(['includeAllVersions', 'resource', ...BASE_EVENT_KEYS.values()]);
|
|
6
|
-
const MEDIA_LIBRARY_EVENT_KEYS = new Set(['resource', ...BASE_EVENT_KEYS.values()]);
|
|
7
|
-
const SCHEDULED_EVENT_KEYS = new Set(['minute', 'hour', 'dayOfWeek', 'month', 'dayOfMonth', 'expression']);
|
|
8
|
-
export function defineDocumentFunction(functionConfig) {
|
|
9
|
-
let { name, src, event, timeout, memory, env, robotToken, project, runtime, ...maybeEvent } = functionConfig;
|
|
10
|
-
// event validation and normalization
|
|
11
|
-
if (event) {
|
|
12
|
-
// `event` was specified, but event keys (aggregated in `maybeEvent`) were also specified at the top level. ambiguous and deprecated usage.
|
|
13
|
-
const duplicateKeys = Array.from(DOCUMENT_EVENT_KEYS).filter((key) => key in maybeEvent);
|
|
14
|
-
if (duplicateKeys.length > 0) {
|
|
15
|
-
throw new Error(`\`event\` properties should be specified under the \`event\` key - specifying them at the top level is deprecated. The following keys were specified at the top level: ${duplicateKeys.map((k) => `\`${k}\``).join(', ')}`);
|
|
16
|
-
}
|
|
17
|
-
event = buildDocumentFunctionEvent(event);
|
|
18
|
-
}
|
|
19
|
-
else {
|
|
20
|
-
event = buildDocumentFunctionEvent(maybeEvent);
|
|
21
|
-
// deprecated usage of putting event properties at the top level, warn about this.
|
|
22
|
-
console.warn('⚠️ Deprecated usage of `defineDocumentFunction`: prefer to put `event` properties under the `event` key rather than at the top level.');
|
|
23
|
-
}
|
|
24
|
-
const functionResource = {
|
|
25
|
-
...defineFunction(functionConfig, { skipValidation: true }),
|
|
26
|
-
type: 'sanity.function.document',
|
|
27
|
-
event,
|
|
28
|
-
};
|
|
29
|
-
runValidation(() => validateDocumentFunction(functionResource));
|
|
30
|
-
return functionResource;
|
|
31
|
-
}
|
|
32
|
-
/*
|
|
33
|
-
* FUTURE example (move below @example when ready)
|
|
34
|
-
* @example With robot token reference
|
|
35
|
-
* ```ts
|
|
36
|
-
* defineRobotToken({
|
|
37
|
-
* name: 'media-robot',
|
|
38
|
-
* memberships: [{
|
|
39
|
-
* resourceType: 'project',
|
|
40
|
-
* resourceId: projectId,
|
|
41
|
-
* roleNames: ['editor'],
|
|
42
|
-
* }],
|
|
43
|
-
* })
|
|
44
|
-
*
|
|
45
|
-
* defineMediaLibraryAssetFunction({
|
|
46
|
-
* name: 'process-uploads',
|
|
47
|
-
* src: 'functions/process-uploads-v2',
|
|
48
|
-
* robotToken: '$.resources.media-robot',
|
|
49
|
-
* event: {
|
|
50
|
-
* on: ['create', 'update'],
|
|
51
|
-
* resource: {
|
|
52
|
-
* type: 'media-library',
|
|
53
|
-
* id: 'my-media-library-id',
|
|
54
|
-
* },
|
|
55
|
-
* filter: "type == 'image'",
|
|
56
|
-
* projection: "{_id}",
|
|
57
|
-
* },
|
|
58
|
-
* env: {
|
|
59
|
-
* CDN_BUCKET: 'my-cdn-bucket',
|
|
60
|
-
* },
|
|
61
|
-
* })
|
|
62
|
-
* ```
|
|
63
|
-
*/
|
|
64
|
-
/**
|
|
65
|
-
* Defines a function that is triggered by media library events.
|
|
66
|
-
*
|
|
67
|
-
* ```ts
|
|
68
|
-
* defineMediaLibraryAssetFunction({
|
|
69
|
-
* name: 'my-media-library-function',
|
|
70
|
-
* event: {
|
|
71
|
-
* on: ['create'],
|
|
72
|
-
* resource: {
|
|
73
|
-
* type: 'media-library',
|
|
74
|
-
* id: 'my-media-library-id',
|
|
75
|
-
* },
|
|
76
|
-
* },
|
|
77
|
-
* })
|
|
78
|
-
* ```
|
|
79
|
-
* @param functionConfig The configuration for the media library asset function
|
|
80
|
-
* @public
|
|
81
|
-
* @category Definers
|
|
82
|
-
* @expandType BlueprintMediaLibraryAssetFunctionConfig
|
|
83
|
-
* @returns The validated media library asset function resource
|
|
84
|
-
*/
|
|
85
|
-
export function defineMediaLibraryAssetFunction(functionConfig) {
|
|
86
|
-
const { event } = functionConfig;
|
|
87
|
-
const functionResource = {
|
|
88
|
-
...defineFunction(functionConfig, { skipValidation: true }),
|
|
89
|
-
type: 'sanity.function.media-library.asset',
|
|
90
|
-
event: buildMediaLibraryFunctionEvent(event),
|
|
91
|
-
};
|
|
92
|
-
runValidation(() => validateMediaLibraryAssetFunction(functionResource));
|
|
93
|
-
return functionResource;
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* Defines a function that is triggered on a schedule.
|
|
97
|
-
* Supports cron expressions or natural language schedules.
|
|
98
|
-
*
|
|
99
|
-
* @remarks
|
|
100
|
-
* Using a cron expression:
|
|
101
|
-
* ```ts
|
|
102
|
-
* defineScheduledFunction({
|
|
103
|
-
* name: 'daily-cleanup',
|
|
104
|
-
* event: {expression: '0 9 * * *'},
|
|
105
|
-
* })
|
|
106
|
-
* ```
|
|
107
|
-
*
|
|
108
|
-
* Using explicit cron fields:
|
|
109
|
-
* ```ts
|
|
110
|
-
* defineScheduledFunction({
|
|
111
|
-
* name: 'daily-cleanup',
|
|
112
|
-
* event: {minute: '0', hour: '9', dayOfMonth: '*', month: '*', dayOfWeek: '*'},
|
|
113
|
-
* })
|
|
114
|
-
* ```
|
|
115
|
-
*
|
|
116
|
-
* The `event.expression` field accepts standard cron expressions or natural language:
|
|
117
|
-
* `'every 15 minutes'`, `'weekdays at 8am'`, `'fridays in the evening'`,
|
|
118
|
-
* `'mon, wed, fri at 9am'`, `'first of the month at noon'`
|
|
119
|
-
*
|
|
120
|
-
* ```ts
|
|
121
|
-
* defineScheduledFunction({
|
|
122
|
-
* name: 'daily-cleanup',
|
|
123
|
-
* event: {expression: 'every day at 9am'},
|
|
124
|
-
* })
|
|
125
|
-
* ```
|
|
126
|
-
* @public
|
|
127
|
-
* @alpha Deploying Scheduled Functions via Blueprints is experimental. This feature is not available publicly yet.
|
|
128
|
-
* @hidden
|
|
129
|
-
* @category Definers
|
|
130
|
-
* @expandType BlueprintScheduledFunctionConfig
|
|
131
|
-
* @param functionConfig The configuration for the scheduled function
|
|
132
|
-
* @returns The validated scheduled function resource
|
|
133
|
-
*/
|
|
134
|
-
export function defineScheduledFunction(functionConfig) {
|
|
135
|
-
const { event, timezone } = functionConfig;
|
|
136
|
-
const functionResource = {
|
|
137
|
-
...defineFunction(functionConfig, { skipValidation: true, scopeType: 'organization' }),
|
|
138
|
-
type: 'sanity.function.cron',
|
|
139
|
-
event: buildScheduledFunctionEvent(event),
|
|
140
|
-
};
|
|
141
|
-
if (timezone)
|
|
142
|
-
functionResource.timezone = timezone;
|
|
143
|
-
// Always normalize to explicit fields (minute, hour, dayOfWeek, month, dayOfMonth)
|
|
144
|
-
if ('expression' in functionResource.event && typeof functionResource.event.expression === 'string') {
|
|
145
|
-
const cron = parseScheduledExpression(functionResource.event.expression);
|
|
146
|
-
functionResource.event = cronStringToExplicitEvent(cron);
|
|
147
|
-
}
|
|
148
|
-
runValidation(() => validateScheduledFunction(functionResource));
|
|
149
|
-
return functionResource;
|
|
150
|
-
}
|
|
151
|
-
/**
|
|
152
|
-
* @deprecated Define scheduled functions using `defineScheduledFunction` instead
|
|
153
|
-
* @hidden
|
|
154
|
-
*/
|
|
155
|
-
export function defineScheduleFunction(functionConfig) {
|
|
156
|
-
return defineScheduledFunction(functionConfig);
|
|
157
|
-
}
|
|
158
|
-
/**
|
|
159
|
-
* Defines a function that is triggered on a sync tag invalidate event.
|
|
160
|
-
*
|
|
161
|
-
* @remarks
|
|
162
|
-
* Using implicit event scoping to all datasets in the function project:
|
|
163
|
-
* ```ts
|
|
164
|
-
* defineSyncTagInvalidateFunction({
|
|
165
|
-
* name: 'bustin-caches',
|
|
166
|
-
* })
|
|
167
|
-
* ```
|
|
168
|
-
*
|
|
169
|
-
* Using explicit event scoping to a particular dataset in the function project:
|
|
170
|
-
* ```ts
|
|
171
|
-
* defineSyncTagInvalidateFunction({
|
|
172
|
-
* name: 'bustin-caches',
|
|
173
|
-
* event: {
|
|
174
|
-
* resource: {
|
|
175
|
-
* type: 'dataset',
|
|
176
|
-
* id: 'myProj.myDataset',
|
|
177
|
-
* },
|
|
178
|
-
* },
|
|
179
|
-
* })
|
|
180
|
-
* ```
|
|
181
|
-
* @public
|
|
182
|
-
* @category Definers
|
|
183
|
-
* @expandType BlueprintSyncTagInvalidateFunctionConfig
|
|
184
|
-
* @param functionConfig The configuration for the sync tag invalidate function
|
|
185
|
-
* @returns The validated sync tag invalidate function resource
|
|
186
|
-
*/
|
|
187
|
-
export function defineSyncTagInvalidateFunction(functionConfig) {
|
|
188
|
-
const { event } = functionConfig;
|
|
189
|
-
const functionResource = {
|
|
190
|
-
...defineFunction(functionConfig, { skipValidation: true }),
|
|
191
|
-
type: 'sanity.function.sync-tag-invalidate',
|
|
192
|
-
...(event?.resource ? { event } : {}),
|
|
193
|
-
};
|
|
194
|
-
runValidation(() => validateSyncTagInvalidateFunction(functionResource));
|
|
195
|
-
return functionResource;
|
|
196
|
-
}
|
|
197
|
-
/**
|
|
198
|
-
* Defines a function that provide queueing behaviour.
|
|
199
|
-
*
|
|
200
|
-
* @remarks
|
|
201
|
-
* Using the reasonable defaults of concurrency: 1, fifo: true, and dlq: true
|
|
202
|
-
* ```ts
|
|
203
|
-
* defineQueueFunction({
|
|
204
|
-
* name: 'send-email',
|
|
205
|
-
* })
|
|
206
|
-
* ```
|
|
207
|
-
*
|
|
208
|
-
* Specifying a concurrency of 5
|
|
209
|
-
* ```ts
|
|
210
|
-
* defineQueueFunction({
|
|
211
|
-
* name: 'bustin-caches',
|
|
212
|
-
* concurrency: 5,
|
|
213
|
-
* fifo: true,
|
|
214
|
-
* dlq: true,
|
|
215
|
-
* })
|
|
216
|
-
* ```
|
|
217
|
-
* @public
|
|
218
|
-
* @alpha Deploying Queue Functions via Blueprints is experimental. This feature is not available publicly yet.
|
|
219
|
-
* @hidden
|
|
220
|
-
* @category Definers
|
|
221
|
-
* @expandType BlueprintQueueFunctionConfig
|
|
222
|
-
* @param functionConfig The configuration for the queue function
|
|
223
|
-
* @returns The validated queue function resource
|
|
224
|
-
*/
|
|
225
|
-
export function defineQueueFunction(functionConfig) {
|
|
226
|
-
const { concurrency = 1, fifo = true, dlq = true, event } = functionConfig;
|
|
227
|
-
const functionResource = {
|
|
228
|
-
...defineFunction(functionConfig, { skipValidation: true }),
|
|
229
|
-
type: 'sanity.function.queue',
|
|
230
|
-
...(concurrency !== undefined && { concurrency }),
|
|
231
|
-
...(fifo !== undefined && { fifo }),
|
|
232
|
-
...(dlq !== undefined && { dlq }),
|
|
233
|
-
...(event !== undefined && { event }),
|
|
234
|
-
};
|
|
235
|
-
runValidation(() => validateQueueFunction(functionResource));
|
|
236
|
-
return functionResource;
|
|
237
|
-
}
|
|
238
|
-
/**
|
|
239
|
-
* Defines a function that provide event behaviour.
|
|
240
|
-
*
|
|
241
|
-
* @remarks
|
|
242
|
-
* A barebones event function
|
|
243
|
-
* ```ts
|
|
244
|
-
* defineEventFunction({
|
|
245
|
-
* name: 'send-email',
|
|
246
|
-
* })
|
|
247
|
-
* ```
|
|
248
|
-
* @public
|
|
249
|
-
* @alpha Deploying Event Functions via Blueprints is experimental. This feature is not available publicly yet.
|
|
250
|
-
* @hidden
|
|
251
|
-
* @category Definers
|
|
252
|
-
* @expandType BlueprintEventFunctionConfig
|
|
253
|
-
* @param functionConfig The configuration for the event function
|
|
254
|
-
* @returns The validated event function resource
|
|
255
|
-
*/
|
|
256
|
-
export function defineEventFunction(functionConfig) {
|
|
257
|
-
const functionResource = {
|
|
258
|
-
...defineFunction(functionConfig, { skipValidation: true }),
|
|
259
|
-
type: 'sanity.function.event',
|
|
260
|
-
};
|
|
261
|
-
runValidation(() => validateEventFunction(functionResource));
|
|
262
|
-
return functionResource;
|
|
263
|
-
}
|
|
264
|
-
/**
|
|
265
|
-
* Defines a base function resource with common properties.
|
|
266
|
-
*
|
|
267
|
-
* @param functionConfig The configuration for the function
|
|
268
|
-
* @param options Optional configuration including validation options
|
|
269
|
-
* @category Definers
|
|
270
|
-
* @internal
|
|
271
|
-
* @expandType BlueprintBaseFunctionConfig
|
|
272
|
-
* @returns The validated function resource
|
|
273
|
-
*/
|
|
274
|
-
export function defineFunction(functionConfig, options) {
|
|
275
|
-
const { name, displayName, src, timeout, memory, env, robotToken, project, runtime, lifecycle } = functionConfig;
|
|
276
|
-
const functionResource = {
|
|
277
|
-
type: 'sanity.function.document',
|
|
278
|
-
name,
|
|
279
|
-
src: src ?? `functions/${name}`,
|
|
280
|
-
displayName,
|
|
281
|
-
timeout,
|
|
282
|
-
memory,
|
|
283
|
-
env,
|
|
284
|
-
robotToken,
|
|
285
|
-
runtime,
|
|
286
|
-
};
|
|
287
|
-
if (options?.scopeType !== 'organization' && project)
|
|
288
|
-
functionResource.project = project;
|
|
289
|
-
if (lifecycle)
|
|
290
|
-
functionResource.lifecycle = lifecycle;
|
|
291
|
-
if (options?.skipValidation !== true)
|
|
292
|
-
runValidation(() => validateFunction(functionResource));
|
|
293
|
-
return functionResource;
|
|
294
|
-
}
|
|
295
|
-
/**
|
|
296
|
-
* Builds a document function event configuration from partial event properties.
|
|
297
|
-
* Filters out non-event properties and applies defaults.
|
|
298
|
-
* @param event Partial document function event configuration
|
|
299
|
-
* @returns Complete document function event configuration
|
|
300
|
-
*/
|
|
301
|
-
function buildDocumentFunctionEvent(event) {
|
|
302
|
-
const cleanEvent = Object.fromEntries(Object.entries(event).filter(([key]) => DOCUMENT_EVENT_KEYS.has(key)));
|
|
303
|
-
return {
|
|
304
|
-
on: cleanEvent.on || ['publish'],
|
|
305
|
-
...cleanEvent,
|
|
306
|
-
};
|
|
307
|
-
}
|
|
308
|
-
/**
|
|
309
|
-
* Builds a media library function event configuration.
|
|
310
|
-
* Filters out non-event properties and applies defaults.
|
|
311
|
-
* @param event Media library function event configuration
|
|
312
|
-
* @returns Complete media library function event configuration
|
|
313
|
-
*/
|
|
314
|
-
function buildMediaLibraryFunctionEvent(event) {
|
|
315
|
-
const cleanEvent = Object.fromEntries(Object.entries(event).filter(([key]) => MEDIA_LIBRARY_EVENT_KEYS.has(key)));
|
|
316
|
-
const fullEvent = {
|
|
317
|
-
on: cleanEvent.on || ['publish'],
|
|
318
|
-
...cleanEvent,
|
|
319
|
-
};
|
|
320
|
-
return fullEvent;
|
|
321
|
-
}
|
|
322
|
-
/**
|
|
323
|
-
* Builds a scheduled function event configuration.
|
|
324
|
-
* Filters out non-event properties. Does not parse expressions.
|
|
325
|
-
* @param event Scheduled function event configuration
|
|
326
|
-
* @returns Cleaned scheduled function event configuration
|
|
327
|
-
*/
|
|
328
|
-
function buildScheduledFunctionEvent(event) {
|
|
329
|
-
return Object.fromEntries(Object.entries(event).filter(([key]) => SCHEDULED_EVENT_KEYS.has(key)));
|
|
330
|
-
}
|
|
331
|
-
/**
|
|
332
|
-
* Converts a cron expression string (minute hour dayOfMonth month dayOfWeek) to explicit event fields.
|
|
333
|
-
* @param cron Cron string with five space-separated fields
|
|
334
|
-
* @returns Explicit scheduled event with minute, hour, dayOfMonth, month, dayOfWeek
|
|
335
|
-
*/
|
|
336
|
-
function cronStringToExplicitEvent(cron) {
|
|
337
|
-
const parts = cron.trim().split(/\s+/);
|
|
338
|
-
if (parts.length !== 5) {
|
|
339
|
-
throw new Error(`Invalid cron string: expected 5 fields, got ${parts.length}`);
|
|
340
|
-
}
|
|
341
|
-
const [minute, hour, dayOfMonth, month, dayOfWeek] = parts;
|
|
342
|
-
return { minute, hour, dayOfMonth, month, dayOfWeek };
|
|
343
|
-
}
|
|
344
|
-
/**
|
|
345
|
-
* Defines a pipeline function resource.
|
|
346
|
-
*
|
|
347
|
-
* @remarks
|
|
348
|
-
*
|
|
349
|
-
* ```ts
|
|
350
|
-
* definePipeline({
|
|
351
|
-
* name: 'daily-cleanup',
|
|
352
|
-
* event: {type: 'document', on: ['create'], filter: "_type == 'post'"},
|
|
353
|
-
* concurrency: 5,
|
|
354
|
-
* debounce: 10,
|
|
355
|
-
* debounceKey: 'document._id',
|
|
356
|
-
* })
|
|
357
|
-
* ```
|
|
358
|
-
*
|
|
359
|
-
*
|
|
360
|
-
* @param functionConfig The configuration for the function
|
|
361
|
-
* @category Definers
|
|
362
|
-
* @alpha Deploying Pipeline Functions via Blueprints is experimental. This feature is not available publicly yet.
|
|
363
|
-
* @public
|
|
364
|
-
* @hidden
|
|
365
|
-
* @expandType BlueprintPipelineConfig
|
|
366
|
-
* @returns The validated pipeline function resource
|
|
367
|
-
*/
|
|
368
|
-
export function definePipeline(functionConfig) {
|
|
369
|
-
const { name, event, concurrency, debounce, debounceKey, src } = functionConfig;
|
|
370
|
-
const functionResource = {
|
|
371
|
-
...defineFunction({ ...functionConfig, src: src ?? `functions/${name}` }, { skipValidation: true }),
|
|
372
|
-
type: 'sanity.function.pipeline',
|
|
373
|
-
...(event !== undefined && { event }),
|
|
374
|
-
...(concurrency !== undefined && { concurrency }),
|
|
375
|
-
...(debounce !== undefined && { debounce }),
|
|
376
|
-
...(debounceKey !== undefined && { debounceKey }),
|
|
377
|
-
};
|
|
378
|
-
runValidation(() => validatePipelineFunction(functionResource));
|
|
379
|
-
return functionResource;
|
|
380
|
-
}
|
|
381
|
-
//# sourceMappingURL=functions.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"functions.js","sourceRoot":"","sources":["../../src/definers/functions.ts"],"names":[],"mappings":"AAAA,OAAO,EAwBL,wBAAwB,EACxB,qBAAqB,EACrB,gBAAgB,EAChB,iCAAiC,EACjC,wBAAwB,EACxB,qBAAqB,EACrB,yBAAyB,EACzB,iCAAiC,GAClC,MAAM,aAAa,CAAA;AACpB,OAAO,EAAC,wBAAwB,EAAC,MAAM,6BAA6B,CAAA;AACpE,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,oBAAoB,GAAG,IAAI,GAAG,CAA4B,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,YAAY,EAAE,YAAY,CAAC,CAAC,CAAA;AAmErI,MAAM,UAAU,sBAAsB,CACpC,cAAiG;IAEjG,IAAI,EAAC,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,E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