@sanity/blueprints 0.34.0 → 0.35.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/definers/agents.d.ts +3 -1
- package/dist/definers/agents.js +3 -1
- package/dist/definers/agents.js.map +1 -1
- package/dist/definers/applications.d.ts +30 -18
- package/dist/definers/applications.js +30 -18
- package/dist/definers/applications.js.map +1 -1
- package/dist/definers/blueprints.d.ts +1 -0
- package/dist/definers/blueprints.js +1 -25
- package/dist/definers/blueprints.js.map +1 -1
- package/dist/definers/context.d.ts +6 -2
- package/dist/definers/context.js +6 -2
- package/dist/definers/context.js.map +1 -1
- package/dist/definers/cors.d.ts +11 -1
- package/dist/definers/cors.js +10 -12
- package/dist/definers/cors.js.map +1 -1
- package/dist/definers/datasets.d.ts +12 -2
- package/dist/definers/datasets.js +11 -14
- package/dist/definers/datasets.js.map +1 -1
- package/dist/definers/functions/document.d.ts +30 -0
- package/dist/definers/functions/document.js.map +1 -1
- package/dist/definers/functions/durable.d.ts +4 -3
- package/dist/definers/functions/durable.js +4 -3
- package/dist/definers/functions/durable.js.map +1 -1
- package/dist/definers/functions/media-library.d.ts +31 -0
- package/dist/definers/functions/media-library.js +18 -19
- package/dist/definers/functions/media-library.js.map +1 -1
- package/dist/definers/functions/pubsub.d.ts +2 -3
- package/dist/definers/functions/pubsub.js +2 -3
- package/dist/definers/functions/pubsub.js.map +1 -1
- package/dist/definers/functions/queue.d.ts +15 -4
- package/dist/definers/functions/queue.js +19 -6
- package/dist/definers/functions/queue.js.map +1 -1
- package/dist/definers/functions/scheduled.d.ts +7 -6
- package/dist/definers/functions/scheduled.js +7 -6
- package/dist/definers/functions/scheduled.js.map +1 -1
- package/dist/definers/functions/sync-tag-invalidate.d.ts +5 -2
- package/dist/definers/functions/sync-tag-invalidate.js +5 -2
- package/dist/definers/functions/sync-tag-invalidate.js.map +1 -1
- package/dist/definers/installation-config.d.ts +4 -2
- package/dist/definers/installation-config.js +4 -2
- package/dist/definers/installation-config.js.map +1 -1
- package/dist/definers/permissions.d.ts +8 -2
- package/dist/definers/permissions.js +8 -2
- package/dist/definers/permissions.js.map +1 -1
- package/dist/definers/projects.d.ts +3 -4
- package/dist/definers/projects.js +3 -4
- package/dist/definers/projects.js.map +1 -1
- package/dist/definers/resources.d.ts +1 -0
- package/dist/definers/resources.js +1 -11
- package/dist/definers/resources.js.map +1 -1
- package/dist/definers/robotTokens.d.ts +22 -3
- package/dist/definers/robotTokens.js +17 -18
- package/dist/definers/robotTokens.js.map +1 -1
- package/dist/definers/roles.d.ts +53 -5
- package/dist/definers/roles.js +38 -40
- package/dist/definers/roles.js.map +1 -1
- package/dist/definers/studios.d.ts +5 -3
- package/dist/definers/studios.js +5 -3
- package/dist/definers/studios.js.map +1 -1
- package/dist/definers/webhooks.d.ts +19 -1
- package/dist/definers/webhooks.js +15 -17
- package/dist/definers/webhooks.js.map +1 -1
- package/dist/index.d.ts +18 -18
- package/dist/index.js +19 -20
- package/dist/index.js.map +1 -1
- package/dist/resolve/index.d.ts +2 -3
- package/dist/resolve/index.js +2 -3
- package/dist/resolve/index.js.map +1 -1
- package/dist/types/agents.d.ts +7 -3
- package/dist/types/applications.d.ts +67 -49
- package/dist/types/applications.js +9 -6
- package/dist/types/applications.js.map +1 -1
- package/dist/types/context.d.ts +17 -7
- package/dist/types/cors.d.ts +0 -2
- package/dist/types/datasets.d.ts +0 -6
- package/dist/types/functions/index.d.ts +64 -14
- package/dist/types/functions/index.js +2 -1
- package/dist/types/functions/index.js.map +1 -1
- package/dist/types/installation-config.d.ts +13 -10
- package/dist/types/permissions.d.ts +8 -4
- package/dist/types/projects.d.ts +5 -4
- package/dist/types/robotTokens.d.ts +0 -3
- package/dist/types/roles.d.ts +0 -4
- package/dist/types/studios.d.ts +28 -15
- package/dist/types/studios.js +3 -2
- package/dist/types/studios.js.map +1 -1
- package/dist/types/webhooks.d.ts +0 -3
- package/dist/utils/debounce.d.ts +0 -11
- package/dist/utils/debounce.js +0 -22
- package/dist/utils/debounce.js.map +1 -1
- package/dist/utils/parse-duration.d.ts +13 -0
- package/dist/utils/parse-duration.js +24 -0
- package/dist/utils/parse-duration.js.map +1 -1
- package/dist/utils/throttle.d.ts +9 -0
- package/dist/utils/throttle.js +22 -0
- package/dist/utils/throttle.js.map +1 -0
- package/dist/validation/applications.js +7 -2
- package/dist/validation/applications.js.map +1 -1
- package/dist/validation/functions.d.ts +10 -0
- package/dist/validation/functions.js +112 -12
- package/dist/validation/functions.js.map +1 -1
- package/dist/validation/projects.js +3 -0
- package/dist/validation/projects.js.map +1 -1
- package/dist/validation/studios.js +4 -5
- package/dist/validation/studios.js.map +1 -1
- package/package.json +1 -1
- package/src/definers/agents.ts +3 -1
- package/src/definers/applications.ts +30 -18
- package/src/definers/blueprints.ts +1 -25
- package/src/definers/context.ts +6 -2
- package/src/definers/cors.ts +10 -12
- package/src/definers/datasets.ts +11 -14
- package/src/definers/functions/document.ts +17 -24
- package/src/definers/functions/durable.ts +4 -3
- package/src/definers/functions/media-library.ts +18 -19
- package/src/definers/functions/pubsub.ts +2 -3
- package/src/definers/functions/queue.ts +19 -6
- package/src/definers/functions/scheduled.ts +7 -6
- package/src/definers/functions/sync-tag-invalidate.ts +5 -2
- package/src/definers/installation-config.ts +4 -2
- package/src/definers/permissions.ts +8 -2
- package/src/definers/projects.ts +3 -4
- package/src/definers/resources.ts +1 -11
- package/src/definers/robotTokens.ts +17 -18
- package/src/definers/roles.ts +38 -40
- package/src/definers/studios.ts +5 -3
- package/src/definers/webhooks.ts +15 -17
- package/src/index.ts +20 -21
- package/src/resolve/index.ts +2 -4
- package/src/types/agents.ts +7 -3
- package/src/types/applications.ts +67 -49
- package/src/types/context.ts +17 -7
- package/src/types/cors.ts +0 -2
- package/src/types/datasets.ts +0 -6
- package/src/types/functions/index.ts +67 -14
- package/src/types/installation-config.ts +13 -10
- package/src/types/permissions.ts +8 -4
- package/src/types/projects.ts +6 -4
- package/src/types/robotTokens.ts +0 -3
- package/src/types/roles.ts +0 -4
- package/src/types/studios.ts +28 -16
- package/src/types/webhooks.ts +0 -3
- package/src/utils/debounce.ts +0 -25
- package/src/utils/parse-duration.ts +27 -0
- package/src/utils/throttle.ts +25 -0
- package/src/validation/applications.ts +6 -2
- package/src/validation/functions.ts +123 -12
- package/src/validation/projects.ts +4 -0
- package/src/validation/studios.ts +3 -6
|
@@ -2,24 +2,25 @@ import { type BlueprintCrossStackReferenceConfig, type BlueprintProjectConfig, t
|
|
|
2
2
|
/**
|
|
3
3
|
* Defines a project.
|
|
4
4
|
*
|
|
5
|
+
* @example
|
|
5
6
|
* ```ts
|
|
6
7
|
* defineProject({
|
|
7
8
|
* name: 'my-project',
|
|
8
9
|
* displayName: 'My Project',
|
|
10
|
+
* logo: './logo.png',
|
|
9
11
|
* })
|
|
10
12
|
* ```
|
|
11
13
|
* @param parameters The project configuration
|
|
12
14
|
* @public
|
|
13
|
-
* @beta Deploying Projects via Blueprints is experimental. This feature is stabilizing but may still be subject to breaking changes.
|
|
14
15
|
* @category Definers
|
|
15
16
|
* @expandType BlueprintProjectConfig
|
|
16
17
|
* @returns The project resource
|
|
17
|
-
* @hidden
|
|
18
18
|
*/
|
|
19
19
|
export declare function defineProject(parameters: BlueprintProjectConfig): BlueprintProjectResource;
|
|
20
20
|
/**
|
|
21
21
|
* Creates a reference to a project in another stack.
|
|
22
22
|
*
|
|
23
|
+
* @example
|
|
23
24
|
* ```ts
|
|
24
25
|
* referenceProject({
|
|
25
26
|
* name: 'editorial-project',
|
|
@@ -29,9 +30,7 @@ export declare function defineProject(parameters: BlueprintProjectConfig): Bluep
|
|
|
29
30
|
*
|
|
30
31
|
* @param params The parameters for referencing the project
|
|
31
32
|
* @public
|
|
32
|
-
* @beta Referencing Projects via Blueprints is experimental. This feature is stabilizing but may still be subject to breaking changes.
|
|
33
33
|
* @category Referencers
|
|
34
34
|
* @returns The project reference
|
|
35
|
-
* @hidden
|
|
36
35
|
*/
|
|
37
36
|
export declare function referenceProject({ name, stack, localName }: BlueprintCrossStackReferenceConfig): BlueprintResource;
|
|
@@ -3,19 +3,19 @@ import { runValidation } from '../utils/validation.js';
|
|
|
3
3
|
/**
|
|
4
4
|
* Defines a project.
|
|
5
5
|
*
|
|
6
|
+
* @example
|
|
6
7
|
* ```ts
|
|
7
8
|
* defineProject({
|
|
8
9
|
* name: 'my-project',
|
|
9
10
|
* displayName: 'My Project',
|
|
11
|
+
* logo: './logo.png',
|
|
10
12
|
* })
|
|
11
13
|
* ```
|
|
12
14
|
* @param parameters The project configuration
|
|
13
15
|
* @public
|
|
14
|
-
* @beta Deploying Projects via Blueprints is experimental. This feature is stabilizing but may still be subject to breaking changes.
|
|
15
16
|
* @category Definers
|
|
16
17
|
* @expandType BlueprintProjectConfig
|
|
17
18
|
* @returns The project resource
|
|
18
|
-
* @hidden
|
|
19
19
|
*/
|
|
20
20
|
export function defineProject(parameters) {
|
|
21
21
|
// default project name
|
|
@@ -31,6 +31,7 @@ export function defineProject(parameters) {
|
|
|
31
31
|
/**
|
|
32
32
|
* Creates a reference to a project in another stack.
|
|
33
33
|
*
|
|
34
|
+
* @example
|
|
34
35
|
* ```ts
|
|
35
36
|
* referenceProject({
|
|
36
37
|
* name: 'editorial-project',
|
|
@@ -40,10 +41,8 @@ export function defineProject(parameters) {
|
|
|
40
41
|
*
|
|
41
42
|
* @param params The parameters for referencing the project
|
|
42
43
|
* @public
|
|
43
|
-
* @beta Referencing Projects via Blueprints is experimental. This feature is stabilizing but may still be subject to breaking changes.
|
|
44
44
|
* @category Referencers
|
|
45
45
|
* @returns The project reference
|
|
46
|
-
* @hidden
|
|
47
46
|
*/
|
|
48
47
|
export function referenceProject({ name, stack, localName }) {
|
|
49
48
|
return referenceResource({ name, stack, localName, type: 'sanity.project' });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projects.js","sourceRoot":"","sources":["../../src/definers/projects.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,iBAAiB,EACjB,eAAe,GAChB,MAAM,aAAa,CAAA;AACpB,OAAO,EAAC,aAAa,EAAC,MAAM,wBAAwB,CAAA;AAEpD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,aAAa,CAAC,UAAkC;IAC9D,uBAAuB;IACvB,MAAM,WAAW,GAAG,UAAU,CAAC,WAAW,IAAI,UAAU,CAAC,IAAI,CAAA;IAE7D,MAAM,eAAe,GAA6B;QAChD,GAAG,UAAU;QACb,WAAW;QACX,IAAI,EAAE,gBAAgB;KACvB,CAAA;IAED,aAAa,CAAC,GAAG,EAAE,CAAC,eAAe,CAAC,eAAe,CAAC,CAAC,CAAA;IAErD,OAAO,eAAe,CAAA;AACxB,CAAC;AAED
|
|
1
|
+
{"version":3,"file":"projects.js","sourceRoot":"","sources":["../../src/definers/projects.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,iBAAiB,EACjB,eAAe,GAChB,MAAM,aAAa,CAAA;AACpB,OAAO,EAAC,aAAa,EAAC,MAAM,wBAAwB,CAAA;AAEpD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,aAAa,CAAC,UAAkC;IAC9D,uBAAuB;IACvB,MAAM,WAAW,GAAG,UAAU,CAAC,WAAW,IAAI,UAAU,CAAC,IAAI,CAAA;IAE7D,MAAM,eAAe,GAA6B;QAChD,GAAG,UAAU;QACb,WAAW;QACX,IAAI,EAAE,gBAAgB;KACvB,CAAA;IAED,aAAa,CAAC,GAAG,EAAE,CAAC,eAAe,CAAC,eAAe,CAAC,CAAC,CAAA;IAErD,OAAO,eAAe,CAAA;AACxB,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,gBAAgB,CAAC,EAAC,IAAI,EAAE,KAAK,EAAE,SAAS,EAAqC;IAC3F,OAAO,iBAAiB,CAAC,EAAC,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,gBAAgB,EAAC,CAAC,CAAA;AAC5E,CAAC"}
|
|
@@ -1,21 +1,11 @@
|
|
|
1
1
|
import { assertResource } from '../index.js';
|
|
2
|
-
/*
|
|
3
|
-
* FUTURE example (move below @example when ready)
|
|
4
|
-
* @example With lifecycle
|
|
5
|
-
* ```ts
|
|
6
|
-
* defineResource({
|
|
7
|
-
* name: 'my-resource',
|
|
8
|
-
* type: 'sanity.new.resource',
|
|
9
|
-
* lifecycle: {deletionPolicy: 'retain'},
|
|
10
|
-
* })
|
|
11
|
-
* ```
|
|
12
|
-
*/
|
|
13
2
|
/**
|
|
14
3
|
* Defines a generic resource to be managed in Blueprints.
|
|
15
4
|
*
|
|
16
5
|
* @remarks
|
|
17
6
|
* This is useful if the resource type does not yet have a `define*` function.
|
|
18
7
|
*
|
|
8
|
+
* @example
|
|
19
9
|
* ```ts
|
|
20
10
|
* defineResource({
|
|
21
11
|
* name: 'my-resource',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resources.js","sourceRoot":"","sources":["../../src/definers/resources.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAA0E,MAAM,aAAa,CAAA;AAEnH
|
|
1
|
+
{"version":3,"file":"resources.js","sourceRoot":"","sources":["../../src/definers/resources.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAA0E,MAAM,aAAa,CAAA;AAEnH;;;;;;;;;;;;;;;;;GAiBG;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;AAED;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAAC,EAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAA6C;IAC1G,MAAM,QAAQ,GAAG;QACf,IAAI;QACJ,IAAI,EAAE,SAAS,IAAI,IAAI;QACvB,SAAS,EAAE;YACT,eAAe,EAAE;gBACf,IAAI,EAAE,WAAoB;gBAC1B,KAAK;gBACL,IAAI;aACL;SACF;KACF,CAAA;IAED,cAAc,CAAC,QAAQ,CAAC,CAAA;IAExB,OAAO,QAAQ,CAAA;AACjB,CAAC"}
|
|
@@ -2,19 +2,38 @@ import { type BlueprintCrossStackReferenceConfig, type BlueprintResource, type B
|
|
|
2
2
|
/**
|
|
3
3
|
* Defines a Robot Token for automated access. Has a token property provided during deployment that can be referenced by other resources.
|
|
4
4
|
*
|
|
5
|
+
* @example
|
|
5
6
|
* ```ts
|
|
6
7
|
* defineRobotToken({
|
|
7
8
|
* name: 'my-robot',
|
|
8
9
|
* memberships: [{
|
|
9
10
|
* resourceType: 'project',
|
|
10
|
-
* resourceId:
|
|
11
|
+
* resourceId: 'my-project-id',
|
|
11
12
|
* roleNames: ['editor'],
|
|
12
13
|
* }],
|
|
13
14
|
* })
|
|
14
15
|
* ```
|
|
16
|
+
*
|
|
17
|
+
* @example Cross-resource references
|
|
18
|
+
* ```ts
|
|
19
|
+
* defineRole({
|
|
20
|
+
* name: 'ci-deploy-role',
|
|
21
|
+
* title: 'CI Deploy Role',
|
|
22
|
+
* appliesToRobots: true,
|
|
23
|
+
* appliesToUsers: false,
|
|
24
|
+
* permissions: [{name: 'sanity-project-cors', action: 'create'}],
|
|
25
|
+
* })
|
|
26
|
+
*
|
|
27
|
+
* defineRobotToken({
|
|
28
|
+
* name: 'ci-robot',
|
|
29
|
+
* label: 'CI Deploy Robot',
|
|
30
|
+
* memberships: [{
|
|
31
|
+
* roleNames: ['$.resources.ci-deploy-role'],
|
|
32
|
+
* }],
|
|
33
|
+
* })
|
|
34
|
+
* ```
|
|
15
35
|
* @param parameters The robot token configuration
|
|
16
36
|
* @public
|
|
17
|
-
* @beta Deploying Robot Tokens via Blueprints is experimental. This feature is stabilizing but may still be subject to breaking changes.
|
|
18
37
|
* @category Definers
|
|
19
38
|
* @expandType BlueprintRobotTokenConfig
|
|
20
39
|
* @returns The robot token resource
|
|
@@ -23,6 +42,7 @@ export declare function defineRobotToken(parameters: BlueprintRobotTokenConfig):
|
|
|
23
42
|
/**
|
|
24
43
|
* Creates a reference to a robot token in another stack.
|
|
25
44
|
*
|
|
45
|
+
* @example
|
|
26
46
|
* ```ts
|
|
27
47
|
* referenceRobotToken({
|
|
28
48
|
* name: 'editor-token',
|
|
@@ -31,7 +51,6 @@ export declare function defineRobotToken(parameters: BlueprintRobotTokenConfig):
|
|
|
31
51
|
* ```
|
|
32
52
|
*
|
|
33
53
|
* @public
|
|
34
|
-
* @beta Referencing Robot Tokens via Blueprints is experimental. This feature is stabilizing but may still be subject to breaking changes.
|
|
35
54
|
* @category Referencers
|
|
36
55
|
* @expandType BlueprintCrossStackReferenceConfig
|
|
37
56
|
* @param params The parameters for referencing the robot token
|
|
@@ -1,13 +1,27 @@
|
|
|
1
1
|
import { referenceResource, validateRobotToken, } from '../index.js';
|
|
2
2
|
import { runValidation } from '../utils/validation.js';
|
|
3
|
-
|
|
4
|
-
*
|
|
3
|
+
/**
|
|
4
|
+
* Defines a Robot Token for automated access. Has a token property provided during deployment that can be referenced by other resources.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```ts
|
|
8
|
+
* defineRobotToken({
|
|
9
|
+
* name: 'my-robot',
|
|
10
|
+
* memberships: [{
|
|
11
|
+
* resourceType: 'project',
|
|
12
|
+
* resourceId: 'my-project-id',
|
|
13
|
+
* roleNames: ['editor'],
|
|
14
|
+
* }],
|
|
15
|
+
* })
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
5
18
|
* @example Cross-resource references
|
|
6
19
|
* ```ts
|
|
7
20
|
* defineRole({
|
|
8
21
|
* name: 'ci-deploy-role',
|
|
9
22
|
* title: 'CI Deploy Role',
|
|
10
23
|
* appliesToRobots: true,
|
|
24
|
+
* appliesToUsers: false,
|
|
11
25
|
* permissions: [{name: 'sanity-project-cors', action: 'create'}],
|
|
12
26
|
* })
|
|
13
27
|
*
|
|
@@ -19,23 +33,8 @@ import { runValidation } from '../utils/validation.js';
|
|
|
19
33
|
* }],
|
|
20
34
|
* })
|
|
21
35
|
* ```
|
|
22
|
-
*/
|
|
23
|
-
/**
|
|
24
|
-
* Defines a Robot Token for automated access. Has a token property provided during deployment that can be referenced by other resources.
|
|
25
|
-
*
|
|
26
|
-
* ```ts
|
|
27
|
-
* defineRobotToken({
|
|
28
|
-
* name: 'my-robot',
|
|
29
|
-
* memberships: [{
|
|
30
|
-
* resourceType: 'project',
|
|
31
|
-
* resourceId: projectId,
|
|
32
|
-
* roleNames: ['editor'],
|
|
33
|
-
* }],
|
|
34
|
-
* })
|
|
35
|
-
* ```
|
|
36
36
|
* @param parameters The robot token configuration
|
|
37
37
|
* @public
|
|
38
|
-
* @beta Deploying Robot Tokens via Blueprints is experimental. This feature is stabilizing but may still be subject to breaking changes.
|
|
39
38
|
* @category Definers
|
|
40
39
|
* @expandType BlueprintRobotTokenConfig
|
|
41
40
|
* @returns The robot token resource
|
|
@@ -53,6 +52,7 @@ export function defineRobotToken(parameters) {
|
|
|
53
52
|
/**
|
|
54
53
|
* Creates a reference to a robot token in another stack.
|
|
55
54
|
*
|
|
55
|
+
* @example
|
|
56
56
|
* ```ts
|
|
57
57
|
* referenceRobotToken({
|
|
58
58
|
* name: 'editor-token',
|
|
@@ -61,7 +61,6 @@ export function defineRobotToken(parameters) {
|
|
|
61
61
|
* ```
|
|
62
62
|
*
|
|
63
63
|
* @public
|
|
64
|
-
* @beta Referencing Robot Tokens via Blueprints is experimental. This feature is stabilizing but may still be subject to breaking changes.
|
|
65
64
|
* @category Referencers
|
|
66
65
|
* @expandType BlueprintCrossStackReferenceConfig
|
|
67
66
|
* @param params The parameters for referencing the robot token
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"robotTokens.js","sourceRoot":"","sources":["../../src/definers/robotTokens.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,aAAa,CAAA;AACpB,OAAO,EAAC,aAAa,EAAC,MAAM,wBAAwB,CAAA;AAEpD
|
|
1
|
+
{"version":3,"file":"robotTokens.js","sourceRoot":"","sources":["../../src/definers/robotTokens.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,aAAa,CAAA;AACpB,OAAO,EAAC,aAAa,EAAC,MAAM,wBAAwB,CAAA;AAEpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,MAAM,UAAU,gBAAgB,CAAC,UAAqC;IACpE,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,IAAI,UAAU,CAAC,IAAI,CAAA;IAEjD,MAAM,aAAa,GAAgC;QACjD,GAAG,UAAU;QACb,KAAK;QACL,IAAI,EAAE,qBAAqB;KAC5B,CAAA;IAED,aAAa,CAAC,GAAG,EAAE,CAAC,kBAAkB,CAAC,aAAa,CAAC,CAAC,CAAA;IAEtD,OAAO,aAAa,CAAA;AACtB,CAAC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,mBAAmB,CAAC,EAAC,IAAI,EAAE,KAAK,EAAE,SAAS,EAAqC;IAC9F,OAAO,iBAAiB,CAAC,EAAC,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,qBAAqB,EAAC,CAAC,CAAA;AACjF,CAAC"}
|
package/dist/definers/roles.d.ts
CHANGED
|
@@ -2,20 +2,42 @@ import { type BlueprintCrossStackReferenceConfig, type BlueprintProjectRoleResou
|
|
|
2
2
|
/**
|
|
3
3
|
* Defines a role that is scoped to the same resource as the blueprint.
|
|
4
4
|
*
|
|
5
|
+
* @example
|
|
5
6
|
* ```ts
|
|
6
7
|
* defineRole({
|
|
7
8
|
* name: 'custom-robot-role',
|
|
8
9
|
* title: 'Custom Robot Role',
|
|
9
10
|
* appliesToRobots: true,
|
|
11
|
+
* appliesToUsers: false,
|
|
10
12
|
* permissions: [{
|
|
11
13
|
* name: 'sanity-project-cors',
|
|
12
14
|
* action: 'create',
|
|
13
15
|
* }],
|
|
14
16
|
* })
|
|
15
17
|
* ```
|
|
18
|
+
*
|
|
19
|
+
* @example All options
|
|
20
|
+
* ```ts
|
|
21
|
+
* defineRole({
|
|
22
|
+
* name: 'ci-deploy-role',
|
|
23
|
+
* title: 'CI Deploy Role',
|
|
24
|
+
* description: 'Permissions for CI/CD pipelines to manage CORS origins',
|
|
25
|
+
* appliesToRobots: true,
|
|
26
|
+
* appliesToUsers: false,
|
|
27
|
+
* permissions: [{
|
|
28
|
+
* name: 'sanity-project-cors',
|
|
29
|
+
* action: 'create',
|
|
30
|
+
* }, {
|
|
31
|
+
* name: 'sanity-project-cors',
|
|
32
|
+
* action: 'read',
|
|
33
|
+
* }, {
|
|
34
|
+
* name: 'sanity-project-cors',
|
|
35
|
+
* action: 'delete',
|
|
36
|
+
* }],
|
|
37
|
+
* })
|
|
38
|
+
* ```
|
|
16
39
|
* @param parameters The configuration of the role
|
|
17
40
|
* @public
|
|
18
|
-
* @beta Deploying Roles via Blueprints is experimental. This feature is stabilizing but may still be subject to breaking changes.
|
|
19
41
|
* @category Definers
|
|
20
42
|
* @expandType BlueprintRoleConfig
|
|
21
43
|
* @returns The role resource
|
|
@@ -26,20 +48,46 @@ export declare function defineRole(parameters: BlueprintRoleConfig, options?: {
|
|
|
26
48
|
/**
|
|
27
49
|
* Defines a role that is scoped to the specified project.
|
|
28
50
|
*
|
|
51
|
+
* @example
|
|
29
52
|
* ```ts
|
|
30
|
-
* defineProjectRole(
|
|
53
|
+
* defineProjectRole('my-project-id', {
|
|
31
54
|
* name: 'viewer-role',
|
|
32
55
|
* title: 'Viewer',
|
|
33
56
|
* appliesToUsers: true,
|
|
57
|
+
* appliesToRobots: false,
|
|
34
58
|
* permissions: [{
|
|
35
59
|
* name: 'sanity-project-cors',
|
|
36
60
|
* action: 'read',
|
|
37
61
|
* }],
|
|
38
62
|
* })
|
|
39
63
|
* ```
|
|
64
|
+
*
|
|
65
|
+
* @example Cross-resource references
|
|
66
|
+
* ```ts
|
|
67
|
+
* defineProjectRole('my-project-id', {
|
|
68
|
+
* name: 'ci-deploy-role',
|
|
69
|
+
* title: 'CI Deploy Role',
|
|
70
|
+
* appliesToRobots: true,
|
|
71
|
+
* appliesToUsers: false,
|
|
72
|
+
* permissions: [{
|
|
73
|
+
* name: 'sanity-project-cors',
|
|
74
|
+
* action: 'create',
|
|
75
|
+
* }, {
|
|
76
|
+
* name: 'sanity-project-cors',
|
|
77
|
+
* action: 'delete',
|
|
78
|
+
* }],
|
|
79
|
+
* })
|
|
80
|
+
*
|
|
81
|
+
* defineRobotToken({
|
|
82
|
+
* name: 'ci-robot',
|
|
83
|
+
* memberships: [{
|
|
84
|
+
* resourceType: 'project',
|
|
85
|
+
* resourceId: 'my-project-id',
|
|
86
|
+
* roleNames: ['$.resources.ci-deploy-role'],
|
|
87
|
+
* }],
|
|
88
|
+
* })
|
|
89
|
+
* ```
|
|
40
90
|
* @public
|
|
41
|
-
* @beta Deploying Roles via Blueprints is experimental. This feature is stabilizing but may still be subject to breaking changes.
|
|
42
|
-
* @hidden
|
|
43
91
|
* @category Definers
|
|
44
92
|
* @expandType BlueprintRoleConfig
|
|
45
93
|
* @param projectId The ID of the project to which the role will be scoped
|
|
@@ -50,6 +98,7 @@ export declare function defineProjectRole(projectId: string, parameters: Bluepri
|
|
|
50
98
|
/**
|
|
51
99
|
* Creates a reference to a role in another stack.
|
|
52
100
|
*
|
|
101
|
+
* @example
|
|
53
102
|
* ```ts
|
|
54
103
|
* referenceRole({
|
|
55
104
|
* name: 'editor-role',
|
|
@@ -58,7 +107,6 @@ export declare function defineProjectRole(projectId: string, parameters: Bluepri
|
|
|
58
107
|
* ```
|
|
59
108
|
*
|
|
60
109
|
* @public
|
|
61
|
-
* @beta Referencing Roles via Blueprints is experimental. This feature is stabilizing but may still be subject to breaking changes.
|
|
62
110
|
* @category Referencers
|
|
63
111
|
* @expandType BlueprintCrossStackReferenceConfig
|
|
64
112
|
* @param params The parameters for referencing the role
|
package/dist/definers/roles.js
CHANGED
|
@@ -1,45 +1,44 @@
|
|
|
1
1
|
import { referenceResource, validateProjectRole, validateRole, } from '../index.js';
|
|
2
2
|
import { runValidation } from '../utils/validation.js';
|
|
3
|
-
|
|
4
|
-
*
|
|
5
|
-
*
|
|
3
|
+
/**
|
|
4
|
+
* Defines a role that is scoped to the same resource as the blueprint.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
6
7
|
* ```ts
|
|
7
8
|
* defineRole({
|
|
8
|
-
* name: '
|
|
9
|
-
* title: '
|
|
10
|
-
* description: 'Permissions for CI/CD pipelines to manage CORS and datasets',
|
|
9
|
+
* name: 'custom-robot-role',
|
|
10
|
+
* title: 'Custom Robot Role',
|
|
11
11
|
* appliesToRobots: true,
|
|
12
12
|
* appliesToUsers: false,
|
|
13
13
|
* permissions: [{
|
|
14
14
|
* name: 'sanity-project-cors',
|
|
15
15
|
* action: 'create',
|
|
16
|
-
* }, {
|
|
17
|
-
* name: 'sanity-project-cors',
|
|
18
|
-
* action: 'read',
|
|
19
|
-
* }, {
|
|
20
|
-
* name: 'sanity-project-cors',
|
|
21
|
-
* action: 'delete',
|
|
22
16
|
* }],
|
|
23
17
|
* })
|
|
24
18
|
* ```
|
|
25
|
-
*/
|
|
26
|
-
/**
|
|
27
|
-
* Defines a role that is scoped to the same resource as the blueprint.
|
|
28
19
|
*
|
|
20
|
+
* @example All options
|
|
29
21
|
* ```ts
|
|
30
22
|
* defineRole({
|
|
31
|
-
* name: '
|
|
32
|
-
* title: '
|
|
23
|
+
* name: 'ci-deploy-role',
|
|
24
|
+
* title: 'CI Deploy Role',
|
|
25
|
+
* description: 'Permissions for CI/CD pipelines to manage CORS origins',
|
|
33
26
|
* appliesToRobots: true,
|
|
27
|
+
* appliesToUsers: false,
|
|
34
28
|
* permissions: [{
|
|
35
29
|
* name: 'sanity-project-cors',
|
|
36
30
|
* action: 'create',
|
|
31
|
+
* }, {
|
|
32
|
+
* name: 'sanity-project-cors',
|
|
33
|
+
* action: 'read',
|
|
34
|
+
* }, {
|
|
35
|
+
* name: 'sanity-project-cors',
|
|
36
|
+
* action: 'delete',
|
|
37
37
|
* }],
|
|
38
38
|
* })
|
|
39
39
|
* ```
|
|
40
40
|
* @param parameters The configuration of the role
|
|
41
41
|
* @public
|
|
42
|
-
* @beta Deploying Roles via Blueprints is experimental. This feature is stabilizing but may still be subject to breaking changes.
|
|
43
42
|
* @category Definers
|
|
44
43
|
* @expandType BlueprintRoleConfig
|
|
45
44
|
* @returns The role resource
|
|
@@ -61,14 +60,30 @@ export function defineRole(parameters, options) {
|
|
|
61
60
|
runValidation(() => validateRole(roleResource));
|
|
62
61
|
return roleResource;
|
|
63
62
|
}
|
|
64
|
-
|
|
65
|
-
*
|
|
63
|
+
/**
|
|
64
|
+
* Defines a role that is scoped to the specified project.
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```ts
|
|
68
|
+
* defineProjectRole('my-project-id', {
|
|
69
|
+
* name: 'viewer-role',
|
|
70
|
+
* title: 'Viewer',
|
|
71
|
+
* appliesToUsers: true,
|
|
72
|
+
* appliesToRobots: false,
|
|
73
|
+
* permissions: [{
|
|
74
|
+
* name: 'sanity-project-cors',
|
|
75
|
+
* action: 'read',
|
|
76
|
+
* }],
|
|
77
|
+
* })
|
|
78
|
+
* ```
|
|
79
|
+
*
|
|
66
80
|
* @example Cross-resource references
|
|
67
81
|
* ```ts
|
|
68
|
-
*
|
|
82
|
+
* defineProjectRole('my-project-id', {
|
|
69
83
|
* name: 'ci-deploy-role',
|
|
70
84
|
* title: 'CI Deploy Role',
|
|
71
85
|
* appliesToRobots: true,
|
|
86
|
+
* appliesToUsers: false,
|
|
72
87
|
* permissions: [{
|
|
73
88
|
* name: 'sanity-project-cors',
|
|
74
89
|
* action: 'create',
|
|
@@ -82,29 +97,12 @@ export function defineRole(parameters, options) {
|
|
|
82
97
|
* name: 'ci-robot',
|
|
83
98
|
* memberships: [{
|
|
84
99
|
* resourceType: 'project',
|
|
85
|
-
* resourceId:
|
|
100
|
+
* resourceId: 'my-project-id',
|
|
86
101
|
* roleNames: ['$.resources.ci-deploy-role'],
|
|
87
102
|
* }],
|
|
88
103
|
* })
|
|
89
104
|
* ```
|
|
90
|
-
*/
|
|
91
|
-
/**
|
|
92
|
-
* Defines a role that is scoped to the specified project.
|
|
93
|
-
*
|
|
94
|
-
* ```ts
|
|
95
|
-
* defineProjectRole(projectId, {
|
|
96
|
-
* name: 'viewer-role',
|
|
97
|
-
* title: 'Viewer',
|
|
98
|
-
* appliesToUsers: true,
|
|
99
|
-
* permissions: [{
|
|
100
|
-
* name: 'sanity-project-cors',
|
|
101
|
-
* action: 'read',
|
|
102
|
-
* }],
|
|
103
|
-
* })
|
|
104
|
-
* ```
|
|
105
105
|
* @public
|
|
106
|
-
* @beta Deploying Roles via Blueprints is experimental. This feature is stabilizing but may still be subject to breaking changes.
|
|
107
|
-
* @hidden
|
|
108
106
|
* @category Definers
|
|
109
107
|
* @expandType BlueprintRoleConfig
|
|
110
108
|
* @param projectId The ID of the project to which the role will be scoped
|
|
@@ -124,6 +122,7 @@ export function defineProjectRole(projectId, parameters) {
|
|
|
124
122
|
/**
|
|
125
123
|
* Creates a reference to a role in another stack.
|
|
126
124
|
*
|
|
125
|
+
* @example
|
|
127
126
|
* ```ts
|
|
128
127
|
* referenceRole({
|
|
129
128
|
* name: 'editor-role',
|
|
@@ -132,7 +131,6 @@ export function defineProjectRole(projectId, parameters) {
|
|
|
132
131
|
* ```
|
|
133
132
|
*
|
|
134
133
|
* @public
|
|
135
|
-
* @beta Referencing Roles via Blueprints is experimental. This feature is stabilizing but may still be subject to breaking changes.
|
|
136
134
|
* @category Referencers
|
|
137
135
|
* @expandType BlueprintCrossStackReferenceConfig
|
|
138
136
|
* @param params The parameters for referencing the role
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"roles.js","sourceRoot":"","sources":["../../src/definers/roles.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,iBAAiB,EACjB,mBAAmB,EACnB,YAAY,GACb,MAAM,aAAa,CAAA;AACpB,OAAO,EAAC,aAAa,EAAC,MAAM,wBAAwB,CAAA;AAEpD
|
|
1
|
+
{"version":3,"file":"roles.js","sourceRoot":"","sources":["../../src/definers/roles.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,iBAAiB,EACjB,mBAAmB,EACnB,YAAY,GACb,MAAM,aAAa,CAAA;AACpB,OAAO,EAAC,aAAa,EAAC,MAAM,wBAAwB,CAAA;AAEpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,MAAM,UAAU,UAAU,CAAC,UAA+B,EAAE,OAAoC;IAC9F,MAAM,YAAY,GAA0B;QAC1C,IAAI,EAAE,UAAU,CAAC,IAAI;QACrB,IAAI,EAAE,oBAAoB;QAC1B,KAAK,EAAE,UAAU,CAAC,KAAK;QACvB,WAAW,EAAE,UAAU,CAAC,WAAW;QACnC,cAAc,EAAE,UAAU,CAAC,cAAc;QACzC,eAAe,EAAE,UAAU,CAAC,eAAe;QAC3C,WAAW,EAAE,UAAU,CAAC,WAAW;KACpC,CAAA;IAED,IAAI,UAAU,CAAC,SAAS,EAAE,CAAC;QACzB,YAAY,CAAC,SAAS,GAAG,UAAU,CAAC,SAAS,CAAA;IAC/C,CAAC;IAED,IAAI,OAAO,EAAE,cAAc,KAAK,IAAI;QAAE,aAAa,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC,CAAA;IAErF,OAAO,YAAY,CAAA;AACrB,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,MAAM,UAAU,iBAAiB,CAAC,SAAiB,EAAE,UAA+B;IAClF,MAAM,YAAY,GAAG,UAAU,CAAC,UAAU,EAAE,EAAC,cAAc,EAAE,IAAI,EAAC,CAAC,CAAA;IAEnE,MAAM,mBAAmB,GAAiC;QACxD,GAAG,YAAY;QACf,YAAY,EAAE,SAAS;QACvB,UAAU,EAAE,SAAS;KACtB,CAAA;IAED,aAAa,CAAC,GAAG,EAAE,CAAC,mBAAmB,CAAC,mBAAmB,CAAC,CAAC,CAAA;IAE7D,OAAO,mBAAmB,CAAA;AAC5B,CAAC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,aAAa,CAAC,EAAC,IAAI,EAAE,KAAK,EAAE,SAAS,EAAqC;IACxF,OAAO,iBAAiB,CAAC,EAAC,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,oBAAoB,EAAC,CAAC,CAAA;AAChF,CAAC"}
|
|
@@ -2,6 +2,9 @@ import type { BlueprintStudioConfig, BlueprintStudioResource } from '../types/st
|
|
|
2
2
|
/**
|
|
3
3
|
* Defines a studio.
|
|
4
4
|
*
|
|
5
|
+
* Deploying Studios via Blueprints is experimental. This may be subject to breaking changes.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
5
8
|
* ```ts
|
|
6
9
|
* defineStudio({
|
|
7
10
|
* name: 'my-studio',
|
|
@@ -12,12 +15,11 @@ import type { BlueprintStudioConfig, BlueprintStudioResource } from '../types/st
|
|
|
12
15
|
* }
|
|
13
16
|
* })
|
|
14
17
|
* ```
|
|
15
|
-
* @param
|
|
18
|
+
* @param config The studio configuration
|
|
16
19
|
* @public
|
|
17
|
-
* @beta
|
|
20
|
+
* @beta
|
|
18
21
|
* @category Definers
|
|
19
22
|
* @expandType BlueprintStudioConfig
|
|
20
23
|
* @returns The studio resource
|
|
21
|
-
* @hidden
|
|
22
24
|
*/
|
|
23
25
|
export declare function defineStudio(config: BlueprintStudioConfig): BlueprintStudioResource;
|
package/dist/definers/studios.js
CHANGED
|
@@ -3,6 +3,9 @@ import { runValidation } from '../utils/validation.js';
|
|
|
3
3
|
/**
|
|
4
4
|
* Defines a studio.
|
|
5
5
|
*
|
|
6
|
+
* Deploying Studios via Blueprints is experimental. This may be subject to breaking changes.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
6
9
|
* ```ts
|
|
7
10
|
* defineStudio({
|
|
8
11
|
* name: 'my-studio',
|
|
@@ -13,13 +16,12 @@ import { runValidation } from '../utils/validation.js';
|
|
|
13
16
|
* }
|
|
14
17
|
* })
|
|
15
18
|
* ```
|
|
16
|
-
* @param
|
|
19
|
+
* @param config The studio configuration
|
|
17
20
|
* @public
|
|
18
|
-
* @beta
|
|
21
|
+
* @beta
|
|
19
22
|
* @category Definers
|
|
20
23
|
* @expandType BlueprintStudioConfig
|
|
21
24
|
* @returns The studio resource
|
|
22
|
-
* @hidden
|
|
23
25
|
*/
|
|
24
26
|
export function defineStudio(config) {
|
|
25
27
|
const autoUpdates = { enabled: config.autoUpdates?.enabled ?? true };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"studios.js","sourceRoot":"","sources":["../../src/definers/studios.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAC,MAAM,aAAa,CAAA;AAE1C,OAAO,EAAC,aAAa,EAAC,MAAM,wBAAwB,CAAA;AAEpD
|
|
1
|
+
{"version":3,"file":"studios.js","sourceRoot":"","sources":["../../src/definers/studios.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAC,MAAM,aAAa,CAAA;AAE1C,OAAO,EAAC,aAAa,EAAC,MAAM,wBAAwB,CAAA;AAEpD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,UAAU,YAAY,CAAC,MAA6B;IACxD,MAAM,WAAW,GAA2C,EAAC,OAAO,EAAE,MAAM,CAAC,WAAW,EAAE,OAAO,IAAI,IAAI,EAAC,CAAA;IAC1G,IAAI,MAAM,CAAC,WAAW,EAAE,OAAO,KAAK,SAAS,EAAE,CAAC;QAC9C,WAAW,CAAC,OAAO,GAAG,MAAM,CAAC,WAAW,CAAC,OAAO,CAAA;IAClD,CAAC;IAED,MAAM,cAAc,GAA4B;QAC9C,GAAG,MAAM;QACT,IAAI,EAAE,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,IAAI;QAChC,KAAK,EAAE,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,IAAI;QAClC,WAAW;QACX,IAAI,EAAE,eAAe;KACtB,CAAA;IAED,aAAa,CAAC,GAAG,EAAE,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC,CAAA;IAEnD,OAAO,cAAc,CAAA;AACvB,CAAC"}
|
|
@@ -2,6 +2,7 @@ import { type BlueprintDocumentWebhookConfig, type BlueprintDocumentWebhookResou
|
|
|
2
2
|
/**
|
|
3
3
|
* Defines a webhook that is called when document changes occur.
|
|
4
4
|
*
|
|
5
|
+
* @example
|
|
5
6
|
* ```ts
|
|
6
7
|
* defineDocumentWebhook({
|
|
7
8
|
* name: 'my-webhook',
|
|
@@ -12,9 +13,26 @@ import { type BlueprintDocumentWebhookConfig, type BlueprintDocumentWebhookResou
|
|
|
12
13
|
* apiVersion: 'v2026-01-01',
|
|
13
14
|
* })
|
|
14
15
|
* ```
|
|
16
|
+
*
|
|
17
|
+
* @example All options
|
|
18
|
+
* ```ts
|
|
19
|
+
* defineDocumentWebhook({
|
|
20
|
+
* name: 'sync-webhook',
|
|
21
|
+
* url: 'https://example.com/sync',
|
|
22
|
+
* on: ['create', 'update', 'delete'],
|
|
23
|
+
* dataset: 'production',
|
|
24
|
+
* apiVersion: 'v2026-01-01',
|
|
25
|
+
* filter: "_type == 'product'",
|
|
26
|
+
* projection: '{_id, title, slug}',
|
|
27
|
+
* httpMethod: 'POST',
|
|
28
|
+
* headers: {'X-Custom-Header': 'value'},
|
|
29
|
+
* secret: 'my-webhook-secret',
|
|
30
|
+
* includeDrafts: false,
|
|
31
|
+
* status: 'enabled',
|
|
32
|
+
* })
|
|
33
|
+
* ```
|
|
15
34
|
* @param parameters The webhook configuration
|
|
16
35
|
* @public
|
|
17
|
-
* @beta Deploying Webhooks via Blueprints is experimental. This feature is stabilizing but may still be subject to breaking changes.
|
|
18
36
|
* @category Definers
|
|
19
37
|
* @expandType BlueprintDocumentWebhookConfig
|
|
20
38
|
* @returns The webhook resource
|
|
@@ -1,7 +1,20 @@
|
|
|
1
1
|
import { validateDocumentWebhook } from '../index.js';
|
|
2
2
|
import { runValidation } from '../utils/validation.js';
|
|
3
|
-
|
|
4
|
-
*
|
|
3
|
+
/**
|
|
4
|
+
* Defines a webhook that is called when document changes occur.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```ts
|
|
8
|
+
* defineDocumentWebhook({
|
|
9
|
+
* name: 'my-webhook',
|
|
10
|
+
* on: ['create'],
|
|
11
|
+
* url: 'https://example.com/webhook',
|
|
12
|
+
* projection: '{_id}',
|
|
13
|
+
* dataset: 'production',
|
|
14
|
+
* apiVersion: 'v2026-01-01',
|
|
15
|
+
* })
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
5
18
|
* @example All options
|
|
6
19
|
* ```ts
|
|
7
20
|
* defineDocumentWebhook({
|
|
@@ -19,23 +32,8 @@ import { runValidation } from '../utils/validation.js';
|
|
|
19
32
|
* status: 'enabled',
|
|
20
33
|
* })
|
|
21
34
|
* ```
|
|
22
|
-
*/
|
|
23
|
-
/**
|
|
24
|
-
* Defines a webhook that is called when document changes occur.
|
|
25
|
-
*
|
|
26
|
-
* ```ts
|
|
27
|
-
* defineDocumentWebhook({
|
|
28
|
-
* name: 'my-webhook',
|
|
29
|
-
* on: ['create'],
|
|
30
|
-
* url: 'https://example.com/webhook',
|
|
31
|
-
* projection: '{_id}',
|
|
32
|
-
* dataset: 'production',
|
|
33
|
-
* apiVersion: 'v2026-01-01',
|
|
34
|
-
* })
|
|
35
|
-
* ```
|
|
36
35
|
* @param parameters The webhook configuration
|
|
37
36
|
* @public
|
|
38
|
-
* @beta Deploying Webhooks via Blueprints is experimental. This feature is stabilizing but may still be subject to breaking changes.
|
|
39
37
|
* @category Definers
|
|
40
38
|
* @expandType BlueprintDocumentWebhookConfig
|
|
41
39
|
* @returns The webhook resource
|
|
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;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"}
|