@sanity/functions 1.6.1 → 1.6.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sanity/functions",
3
- "version": "1.6.1",
3
+ "version": "1.6.3",
4
4
  "description": "Helper methods and type definitions for Sanity Functions",
5
5
  "keywords": [
6
6
  "sanity",
@@ -56,13 +56,13 @@
56
56
  "@aws-lite/sns-types": "^0.0.11",
57
57
  "@aws-lite/sqs": "^0.2.4",
58
58
  "@aws-lite/sqs-types": "^0.2.7",
59
- "@biomejs/biome": "2.3.12",
59
+ "@biomejs/biome": "2.5.8",
60
60
  "@types/node": "^22",
61
- "@vitest/coverage-v8": "^4.0.18",
61
+ "@vitest/coverage-v8": "4.1.10",
62
62
  "rimraf": "^6.1.2",
63
63
  "typedoc": "^0.28.16",
64
- "typescript": "^5.9.3",
65
- "vitest": "4.0.18"
64
+ "typescript": "^6.0.3",
65
+ "vitest": "4.1.10"
66
66
  },
67
67
  "engines": {
68
68
  "node": ">=22"
package/src/definers.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type {DocumentEventHandler, EventHandler, ScheduledEventHandler, SyncTagInvalidateEventHandler} from './types.js'
1
+ import type {DocumentEventHandler, PubSubEventHandler, ScheduledEventHandler, SyncTagInvalidateEventHandler} from './types.js'
2
2
 
3
3
  /**
4
4
  * Defines a "document event" function handler.
@@ -37,13 +37,31 @@ export function syncTagInvalidateEventHandler(handler: SyncTagInvalidateEventHan
37
37
  }
38
38
 
39
39
  /**
40
- * Defines a "generic" function handler.
40
+ * Defines a "pubsub event" function handler.
41
41
  * Returns the handler function as-is, only providing the types and doing basic validation.
42
42
  *
43
+ * The handler's return type is inferred, so a pubsub function can resolve to a value that
44
+ * callers receive from `invoke(name, payload, {sync: true})`.
45
+ *
43
46
  * @param handler - The event handler function to use.
44
47
  * @returns The handler function, unmodified.
45
48
  */
46
- export function eventHandler<IData = any>(handler: EventHandler<IData>): EventHandler<IData> {
49
+ export function pubSubEventHandler<IData = any, IResult = void>(
50
+ handler: PubSubEventHandler<IData, IResult>,
51
+ ): PubSubEventHandler<IData, IResult> {
47
52
  if (typeof handler !== 'function') throw new TypeError('`handler` must be a function')
48
53
  return handler
49
54
  }
55
+
56
+ /**
57
+ * Defines a "generic" function handler.
58
+ * Returns the handler function as-is, only providing the types and doing basic validation.
59
+ *
60
+ * @deprecated Renamed to {@link pubSubEventHandler}. This alias will be removed in the next
61
+ * major version.
62
+ * @param handler - The event handler function to use.
63
+ * @returns The handler function, unmodified.
64
+ */
65
+ export function eventHandler<IData = any, IResult = void>(handler: PubSubEventHandler<IData, IResult>): PubSubEventHandler<IData, IResult> {
66
+ return pubSubEventHandler(handler)
67
+ }
package/src/invoke.ts CHANGED
@@ -112,8 +112,6 @@ export function buildLineageToken(name: string, lineage: string | undefined) {
112
112
  * event source and nothing is returned. Pass `{sync: true}` to invoke the function and
113
113
  * wait for its return value.
114
114
  *
115
- * @alpha Experimental / preview function not ready for use
116
- * @hidden
117
115
  * @param name - Name of the function to invoke
118
116
  * @param payload - The `{event, context}` envelope to deliver
119
117
  * @param options - Set `sync: true` to wait for and return the function's result
@@ -134,6 +132,20 @@ export async function invoke<T = unknown>(name: string, payload: FunctionPayload
134
132
  // Check to make sure payload is not over the max we can handle
135
133
  checkPayloadSize(stringPayload, sync)
136
134
 
135
+ // Make sure we can invoke this function type
136
+ const contextResource = payload?.context?.resources?.(name)
137
+ const functionType = contextResource?.type
138
+ if (sync === true) {
139
+ if (functionType === undefined) {
140
+ throw new Error(`Function ${name} cannot be invoked synchronously.`)
141
+ }
142
+ if (functionType !== 'sanity.function.pubsub') {
143
+ throw new Error(`Function ${name} of type ${functionType} cannot be invoked synchronously.`)
144
+ }
145
+ } else if (functionType !== 'sanity.function.pubsub' && functionType !== 'sanity.function.queue') {
146
+ throw new Error(`No invokeable resource for function: ${name}`)
147
+ }
148
+
137
149
  // Local invoke path for Sanity CLI
138
150
  if (outgoingPayload?.context?.local) {
139
151
  if (!outgoingPayload?.context?.invoke) {
@@ -147,16 +159,12 @@ export async function invoke<T = unknown>(name: string, payload: FunctionPayload
147
159
 
148
160
  // Look up the function details
149
161
  const resource = await getResource(name, aws)
150
- const contextResource = payload?.context?.resources?.(name)
151
162
 
152
163
  // Synchronous invocation
153
164
  if (sync === true) {
154
165
  if (!resource.function || !contextResource) {
155
166
  throw new Error(`Function ${name} cannot be invoked synchronously.`)
156
167
  }
157
- if (contextResource.type !== 'sanity.function.pubsub') {
158
- throw new Error(`Function ${name} of type ${contextResource.type} cannot be invoked synchronously.`)
159
- }
160
168
  const {Payload, FunctionError} = await aws.Lambda.Invoke({
161
169
  FunctionName: resource.function.physicalResourceId,
162
170
  Payload: outgoingPayload,
@@ -171,12 +179,12 @@ export async function invoke<T = unknown>(name: string, payload: FunctionPayload
171
179
  }
172
180
 
173
181
  // Async invocation by type
174
- if (resource.topic && contextResource?.type === 'sanity.function.pubsub') {
182
+ if (resource.topic && functionType === 'sanity.function.pubsub') {
175
183
  await aws.SNS.Publish({
176
184
  TopicArn: resource.topic.physicalResourceId,
177
185
  Message: stringPayload,
178
186
  })
179
- } else if (resource.queue && contextResource?.type === 'sanity.function.queue') {
187
+ } else if (resource.queue && functionType === 'sanity.function.queue') {
180
188
  await aws.SQS.SendMessage({
181
189
  MessageBody: stringPayload,
182
190
  QueueUrl: resource.queue.physicalResourceId,
@@ -184,6 +192,7 @@ export async function invoke<T = unknown>(name: string, payload: FunctionPayload
184
192
  } else {
185
193
  throw new Error(`No invokeable resource for function: ${name}`)
186
194
  }
195
+
187
196
  return
188
197
  }
189
198
 
package/src/types.ts CHANGED
@@ -1,14 +1,10 @@
1
1
  /**
2
2
  * Callback provided by Sanity CLI when doing local development
3
- * @alpha
4
- * @hidden
5
3
  */
6
4
  export type InvokeCallback = <T = unknown>(name: string, payload: FunctionPayload, options?: InvokeOptions) => Promise<T>
7
5
 
8
6
  /**
9
7
  * Options provided to invoke
10
- * @alpha
11
- * @hidden
12
8
  */
13
9
  export type InvokeOptions = {
14
10
  // Whether the function should be invoked synchronously
@@ -144,18 +140,29 @@ export type GenericContext = FunctionContext | ScheduledFunctionContext | SyncTa
144
140
  export type GenericEvent = DocumentEvent | SyncTagInvalidateEvent
145
141
 
146
142
  /**
147
- * A generic function handler that can receive the payload of any function type.
143
+ * A function handler for a pubsub event.
148
144
  *
149
- * The envelope is intentionally permissive so a single handler can be registered
150
- * regardless of the event source without narrowing: `context` is any supported
151
- * context, `event` is any supported event, and `done` is optional (present only
152
- * for sync-tag-invalidate events).
145
+ * A pubsub function can be triggered by any event source, so the envelope is intentionally
146
+ * permissive and needs no narrowing: `context` is any supported context, `event` is any
147
+ * supported event, and `done` is optional (present only for sync-tag-invalidate events).
148
+ *
149
+ * `IResult` is the value the handler resolves to and defaults to `void`. Pubsub is the one
150
+ * function type that may be invoked with {@link invoke | `invoke(name, payload, {sync: true})`},
151
+ * which returns the handler's resolved value to the caller.
153
152
  */
154
- export type EventHandler<IData = any> = (envelope: {
153
+ export type PubSubEventHandler<IData = any, IResult = void> = (envelope: {
155
154
  context: GenericContext
156
155
  event: DocumentEvent<IData> | SyncTagInvalidateEvent
157
156
  done?: SyncTagInvalidateCallback
158
- }) => void | Promise<void>
157
+ }) => IResult | Promise<IResult>
158
+
159
+ /**
160
+ * A generic function handler that can receive the payload of any function type.
161
+ *
162
+ * @deprecated Renamed to {@link PubSubEventHandler}. This alias will be removed in the next
163
+ * major version.
164
+ */
165
+ export type EventHandler<IData = any, IResult = void> = PubSubEventHandler<IData, IResult>
159
166
 
160
167
  /**
161
168
  * A callback function to invoke once a sync-tag-invalidate event has been processed. Signals to Sanity that sync tag invalidation has completed.
@@ -238,31 +245,34 @@ export type FunctionResourceEnvelope = {
238
245
  [K in FunctionResourceKey]-?: {[P in K]: FunctionResource} & {[P in Exclude<FunctionResourceKey, K>]?: FunctionResource}
239
246
  }[FunctionResourceKey]
240
247
 
241
- type DurableLogLevel = 'DEBUG' | 'INFO' | 'WARN' | 'ERROR'
248
+ /**
249
+ * Logger interface for durables.
250
+ * @alpha Using durables is considered experimental and may change in the future.
251
+ * @hidden
252
+ */
253
+ export interface DurableLogger {
254
+ debug(message?: string, ...optionalParams: unknown[]): void
255
+ info(message?: string, ...optionalParams: unknown[]): void
256
+ warn(message?: string, ...optionalParams: unknown[]): void
257
+ error(message?: string, ...optionalParams: unknown[]): void
258
+ log(message?: string, ...optionalParams: unknown[]): void
259
+ }
242
260
 
243
261
  /**
244
- * Context logger interface for durables.
245
- * Exposes console.log through the durable context.
262
+ * // @todo: follow-up to better define separated context
246
263
  * @alpha Using durables is considered experimental and may change in the future.
247
264
  * @hidden
248
265
  */
249
- interface DurableLogger {
250
- log?(level: DurableLogLevel, ...params: unknown[]): void
251
- debug(...params: unknown[]): void
252
- info(...params: unknown[]): void
253
- warn(...params: unknown[]): void
254
- error(...params: unknown[]): void
266
+ export interface BaseDurableOperationArgs {
267
+ logger: DurableLogger
255
268
  }
256
269
 
257
270
  /**
271
+ * @todo: follow-up to better define separated context
258
272
  * @alpha Using durables is considered experimental and may change in the future.
259
273
  * @hidden
260
274
  */
261
275
  export type DurableContext = FunctionContext & {
262
- /**
263
- * Durable logger
264
- */
265
- log: DurableLogger
266
276
  /**
267
277
  * Current attempt of the active durable operation.
268
278
  * Only available in methods that expose the attempt like `waitForCondition`
@@ -298,7 +308,7 @@ export type DurableWaitForConditionDecision = {shouldContinue: true; delay: Dura
298
308
  */
299
309
  export interface DurableWaitForConditionOptions<T> {
300
310
  initial: T
301
- next: (state: T, context: DurableContext) => DurableWaitForConditionDecision
311
+ next: (state: T, context: BaseDurableOperationArgs) => DurableWaitForConditionDecision
302
312
  }
303
313
 
304
314
  /**
@@ -317,7 +327,7 @@ export interface DurableOperations {
317
327
  * @param fn - function being executed
318
328
  * @returns The value returned by the executed function
319
329
  */
320
- run<T>(name: string, fn: (ctx: DurableContext) => T | Promise<T>): Promise<T>
330
+ run<T>(name: string, fn: (args: BaseDurableOperationArgs) => T | Promise<T>): Promise<T>
321
331
  /**
322
332
  * Calls another function and awaits its result.
323
333
  * similar to ctx.invoke()
@@ -336,7 +346,7 @@ export interface DurableOperations {
336
346
  * @param fn - Receives the generated callbackId and returns a delivered promise
337
347
  * @returns The value returned by the executed function
338
348
  */
339
- waitForCallback<T>(name: string, fn: (callbackId: string, ctx: DurableContext) => Promise<void>): Promise<T>
349
+ waitForCallback<T>(name: string, fn: (callbackId: string, args: BaseDurableOperationArgs) => Promise<void>): Promise<T>
340
350
 
341
351
  /**
342
352
  * Waits for a specified duration
@@ -381,11 +391,8 @@ export interface DurableOperations {
381
391
  * ```ts
382
392
  * await step.waitForCondition(
383
393
  * 'waitForCondition',
384
- * async (state, context) => {
385
- * context.log.info('Checking for article', {
386
- * runId: context.runId,
387
- * attempt: context.attempt,
388
- * })
394
+ * async (state, {logger}) => {
395
+ * logger.log('Checking for article')
389
396
  *
390
397
  * const client = createClient({
391
398
  * apiVersion: '2026-08-05',
@@ -422,7 +429,7 @@ export interface DurableOperations {
422
429
  */
423
430
  waitForCondition<T>(
424
431
  name: string,
425
- fn: (state: T, context: DurableContext) => Promise<T>,
432
+ fn: (state: T, args: BaseDurableOperationArgs) => Promise<T>,
426
433
  options: DurableWaitForConditionOptions<T>,
427
434
  ): Promise<T>
428
435
 
@@ -433,11 +440,8 @@ export interface DurableOperations {
433
440
  * @example
434
441
  * ```ts
435
442
  * await step.waitForCondition(
436
- * async (state, context) => {
437
- * context.log.info('Checking for article', {
438
- * runId: context.runId,
439
- * attempt: context.attempt,
440
- * })
443
+ * async (state, {logger}) => {
444
+ * logger.log('Checking for article')
441
445
  *
442
446
  * const client = createClient({
443
447
  * apiVersion: '2026-08-05',
@@ -471,7 +475,7 @@ export interface DurableOperations {
471
475
  * @param options - Configuration options for the condition
472
476
  * @returns The value returned by the executed function
473
477
  */
474
- waitForCondition<T>(fn: (state: T, context: DurableContext) => Promise<T>, options: DurableWaitForConditionOptions<T>): Promise<T>
478
+ waitForCondition<T>(fn: (state: T, args: BaseDurableOperationArgs) => Promise<T>, options: DurableWaitForConditionOptions<T>): Promise<T>
475
479
  }
476
480
 
477
481
  /**
@@ -482,4 +486,5 @@ export type DurableHandler = (envelope: {
482
486
  context: DurableContext
483
487
  event?: GenericEvent
484
488
  step: DurableOperations
489
+ logger: DurableLogger
485
490
  }) => unknown | Promise<unknown>
@@ -1 +0,0 @@
1
- {"version":3,"file":"definers.js","sourceRoot":"","sources":["../src/definers.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAAc,OAAoC;IACpF,IAAI,OAAO,OAAO,KAAK,UAAU;QAAE,MAAM,IAAI,SAAS,CAAC,8BAA8B,CAAC,CAAA;IACtF,OAAO,OAAO,CAAA;AAChB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,qBAAqB,CAAC,OAA8B;IAClE,IAAI,OAAO,OAAO,KAAK,UAAU;QAAE,MAAM,IAAI,SAAS,CAAC,8BAA8B,CAAC,CAAA;IACtF,OAAO,OAAO,CAAA;AAChB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,6BAA6B,CAAC,OAAsC;IAClF,IAAI,OAAO,OAAO,KAAK,UAAU;QAAE,MAAM,IAAI,SAAS,CAAC,8BAA8B,CAAC,CAAA;IACtF,OAAO,OAAO,CAAA;AAChB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CAAc,OAA4B;IACpE,IAAI,OAAO,OAAO,KAAK,UAAU;QAAE,MAAM,IAAI,SAAS,CAAC,8BAA8B,CAAC,CAAA;IACtF,OAAO,OAAO,CAAA;AAChB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"durables.js","sourceRoot":"","sources":["../src/durables.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,eAAe,GAAG,CACtB,eAAyC,EACzC,YAA6B,EACwC,EAAE;IACvE,OAAO,OAAO,eAAe,KAAK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I,EAAE,CAAC;YACpD,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAA;QAC1D,CAAC;IACH,CAAC;AACH,CAAC"}
package/dist/types.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
File without changes
File without changes
File without changes
File without changes
File without changes