@sanity/functions 1.0.3 → 1.1.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/dist/types.d.ts CHANGED
@@ -4,6 +4,14 @@
4
4
  * @beta
5
5
  */
6
6
  export interface FunctionContext {
7
+ /** The resource type of the event source; resource type that invoked the function. */
8
+ eventResourceType: string;
9
+ /** The resource ID of the event source; resource ID that invoked the function. */
10
+ eventResourceId: string;
11
+ /** The resource type of the function container; resource type that houses the function. */
12
+ functionResourceType: string;
13
+ /** The resource ID of the function container; resource ID that houses the function. */
14
+ functionResourceId: string;
7
15
  /**
8
16
  * `local` is set to `true` when testing your function locally.
9
17
  * i.e. `sanity function test func-name`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sanity/functions",
3
- "version": "1.0.3",
3
+ "version": "1.1.0",
4
4
  "description": "Helper methods and type definitions for Sanity Functions",
5
5
  "keywords": [
6
6
  "sanity",
@@ -38,7 +38,7 @@
38
38
  "build": "rimraf dist && tsc",
39
39
  "coverage": "vitest --coverage",
40
40
  "lint": "tsc --noEmit --project tsconfig.test.json",
41
- "prepublishOnly": "npm run build",
41
+ "prepare": "npm run build",
42
42
  "test": "vitest run --typecheck --reporter=verbose",
43
43
  "test:watch": "vitest --typecheck --reporter=verbose"
44
44
  },
package/src/types.ts CHANGED
@@ -4,6 +4,14 @@
4
4
  * @beta
5
5
  */
6
6
  export interface FunctionContext {
7
+ /** The resource type of the event source; resource type that invoked the function. */
8
+ eventResourceType: string
9
+ /** The resource ID of the event source; resource ID that invoked the function. */
10
+ eventResourceId: string
11
+ /** The resource type of the function container; resource type that houses the function. */
12
+ functionResourceType: string
13
+ /** The resource ID of the function container; resource ID that houses the function. */
14
+ functionResourceId: string
7
15
  /**
8
16
  * `local` is set to `true` when testing your function locally.
9
17
  * i.e. `sanity function test func-name`