@sanity/blueprints 0.23.6 → 0.26.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.
Files changed (46) hide show
  1. package/dist/definers/applications.d.ts +164 -0
  2. package/dist/definers/applications.js +211 -0
  3. package/dist/definers/applications.js.map +1 -0
  4. package/dist/definers/installation-config.d.ts +26 -0
  5. package/dist/definers/installation-config.js +36 -0
  6. package/dist/definers/installation-config.js.map +1 -0
  7. package/dist/definers/studios.d.ts +1 -1
  8. package/dist/definers/studios.js +1 -1
  9. package/dist/index.d.ts +6 -0
  10. package/dist/index.js +6 -0
  11. package/dist/index.js.map +1 -1
  12. package/dist/types/applications.d.ts +290 -0
  13. package/dist/types/applications.js +25 -0
  14. package/dist/types/applications.js.map +1 -0
  15. package/dist/types/installation-config.d.ts +75 -0
  16. package/dist/types/installation-config.js +2 -0
  17. package/dist/types/installation-config.js.map +1 -0
  18. package/dist/types/projects.d.ts +1 -1
  19. package/dist/types/robotTokens.d.ts +4 -4
  20. package/dist/types/studios.d.ts +2 -2
  21. package/dist/utils/validation.d.ts +1 -1
  22. package/dist/validation/applications.d.ts +58 -0
  23. package/dist/validation/applications.js +308 -0
  24. package/dist/validation/applications.js.map +1 -0
  25. package/dist/validation/installation-config.d.ts +18 -0
  26. package/dist/validation/installation-config.js +110 -0
  27. package/dist/validation/installation-config.js.map +1 -0
  28. package/dist/validation/robotTokens.js +14 -10
  29. package/dist/validation/robotTokens.js.map +1 -1
  30. package/dist/validation/studios.js +4 -4
  31. package/dist/validation/studios.js.map +1 -1
  32. package/package.json +4 -4
  33. package/src/definers/applications.ts +237 -0
  34. package/src/definers/installation-config.ts +38 -0
  35. package/src/definers/studios.ts +1 -1
  36. package/src/index.ts +6 -0
  37. package/src/types/applications.ts +337 -0
  38. package/src/types/installation-config.ts +86 -0
  39. package/src/types/projects.ts +1 -1
  40. package/src/types/robotTokens.ts +4 -4
  41. package/src/types/studios.ts +2 -2
  42. package/src/utils/validation.ts +1 -1
  43. package/src/validation/applications.ts +330 -0
  44. package/src/validation/installation-config.ts +115 -0
  45. package/src/validation/robotTokens.ts +16 -8
  46. package/src/validation/studios.ts +4 -4
@@ -0,0 +1,164 @@
1
+ import { type BlueprintApplicationConfig, type BlueprintApplicationResource, type BlueprintAssetSourceViewConfig, type BlueprintPanelViewConfig, type BlueprintTileViewConfig, type BlueprintWebWorker, type BlueprintWebWorkerConfig, type BlueprintWindowViewConfig } from '../index.js';
2
+ /**
3
+ * Defines a window view — the navigable, full-page view of an application.
4
+ * An application may declare at most one window view.
5
+ *
6
+ * ```ts
7
+ * defineWindowView({
8
+ * name: 'main',
9
+ * title: 'Design Retro',
10
+ * src: './src/windows/main.tsx',
11
+ * })
12
+ * ```
13
+ *
14
+ * @example With dock placement
15
+ * ```ts
16
+ * defineWindowView({
17
+ * name: 'main',
18
+ * title: 'Design Retro',
19
+ * src: './src/windows/main.tsx',
20
+ * dock: {group: 'applications', order: 10},
21
+ * })
22
+ * ```
23
+ * @param config The window view configuration
24
+ * @public
25
+ * @beta Deploying Applications via Blueprints is experimental. This may be subject to breaking changes.
26
+ * @category Definers
27
+ * @expandType BlueprintWindowViewConfig
28
+ * @returns The window view declaration
29
+ * @hidden
30
+ */
31
+ export declare function defineWindowView(config: Omit<BlueprintWindowViewConfig, 'surface' | 'type'>): BlueprintWindowViewConfig;
32
+ /**
33
+ * Defines a panel view — renders in the dock.
34
+ *
35
+ * ```ts
36
+ * definePanelView({
37
+ * name: 'side',
38
+ * title: 'Favorites',
39
+ * src: './src/panels/main.tsx',
40
+ * })
41
+ * ```
42
+ * @param config The panel view configuration
43
+ * @public
44
+ * @beta Deploying Applications via Blueprints is experimental. This may be subject to breaking changes.
45
+ * @category Definers
46
+ * @expandType BlueprintPanelViewConfig
47
+ * @returns The panel view declaration
48
+ * @hidden
49
+ */
50
+ export declare function definePanelView(config: Omit<BlueprintPanelViewConfig, 'surface' | 'type'>): BlueprintPanelViewConfig;
51
+ /**
52
+ * Defines an asset source view — contributes an asset source.
53
+ *
54
+ * ```ts
55
+ * defineAssetSourceView({
56
+ * name: 'image-picker',
57
+ * title: 'Image Picker',
58
+ * src: './src/asset-sources/image-picker.tsx',
59
+ * })
60
+ * ```
61
+ * @param config The asset source view configuration
62
+ * @public
63
+ * @beta Deploying Applications via Blueprints is experimental. This may be subject to breaking changes.
64
+ * @category Definers
65
+ * @expandType BlueprintAssetSourceViewConfig
66
+ * @returns The asset source view declaration
67
+ * @hidden
68
+ */
69
+ export declare function defineAssetSourceView(config: Omit<BlueprintAssetSourceViewConfig, 'surface' | 'type'>): BlueprintAssetSourceViewConfig;
70
+ /**
71
+ * Defines a tile view — docks on the dashboard with a footprint `size`.
72
+ *
73
+ * ```ts
74
+ * defineTileView({
75
+ * name: 'jump-back-in',
76
+ * title: 'Main Tile',
77
+ * src: './src/tiles/jump-back-in.tsx',
78
+ * size: 'banner',
79
+ * })
80
+ * ```
81
+ * @param config The tile view configuration
82
+ * @public
83
+ * @beta Deploying Applications via Blueprints is experimental. This may be subject to breaking changes.
84
+ * @category Definers
85
+ * @expandType BlueprintTileViewConfig
86
+ * @returns The tile view declaration
87
+ * @hidden
88
+ */
89
+ export declare function defineTileView(config: Omit<BlueprintTileViewConfig, 'surface' | 'type'>): BlueprintTileViewConfig;
90
+ /**
91
+ * Defines a background web worker an application runs.
92
+ *
93
+ * ```ts
94
+ * defineWebWorker({
95
+ * name: 'background-refresh',
96
+ * title: 'Background Worker',
97
+ * src: './src/workers/background-refresh.ts',
98
+ * })
99
+ * ```
100
+ * @param config The web worker configuration
101
+ * @public
102
+ * @beta Deploying Applications via Blueprints is experimental. This may be subject to breaking changes.
103
+ * @category Definers
104
+ * @expandType BlueprintWebWorkerConfig
105
+ * @returns The web worker declaration
106
+ * @hidden
107
+ */
108
+ export declare function defineWebWorker(config: BlueprintWebWorkerConfig): BlueprintWebWorker;
109
+ /**
110
+ * Defines an application.
111
+ *
112
+ * @remarks
113
+ * Views are authored in `views` and web workers in `webWorkers`, mirroring the
114
+ * emitted resource. Views are discriminated by `surface` (`window`, `panel`,
115
+ * `asset-source`, `tile`) and transformed to the emitted view `type` the
116
+ * backend expects. An application must declare at least one view of any
117
+ * surface, and at most one `window` view. Every view and web worker `src` is
118
+ * resolved relative to `root`. The `slug` defaults to the resource `name`.
119
+ *
120
+ * ```ts
121
+ * defineApplication({
122
+ * name: 'design-retro',
123
+ * title: 'Design Retro',
124
+ * root: './apps/design-retro',
125
+ * views: [
126
+ * defineWindowView({name: 'main', title: 'Design Retro', src: './src/windows/main.tsx'}),
127
+ * ],
128
+ * })
129
+ * ```
130
+ *
131
+ * @example With views and web workers
132
+ * ```ts
133
+ * defineApplication({
134
+ * name: 'design-retro',
135
+ * title: 'Design Retro',
136
+ * root: './apps/design-retro',
137
+ * slug: 'design-retro',
138
+ * icon: './src/icons/app-icon.svg',
139
+ * visibility: 'unlisted',
140
+ * views: [
141
+ * defineWindowView({
142
+ * name: 'main',
143
+ * title: 'Design Retro',
144
+ * src: './src/windows/main.tsx',
145
+ * dock: {group: 'applications', order: 10},
146
+ * }),
147
+ * definePanelView({name: 'side', title: 'Favorites', src: './src/panels/main.tsx'}),
148
+ * defineAssetSourceView({name: 'image-picker', title: 'Image Picker', src: './src/asset-sources/image-picker.tsx'}),
149
+ * defineTileView({name: 'jump-back-in', title: 'Main Tile', src: './src/tiles/jump-back-in.tsx', size: 'banner'}),
150
+ * ],
151
+ * webWorkers: [
152
+ * defineWebWorker({name: 'background-refresh', title: 'Background Worker', src: './src/workers/background-refresh.ts'}),
153
+ * ],
154
+ * })
155
+ * ```
156
+ * @param config The application configuration
157
+ * @public
158
+ * @beta Deploying Applications via Blueprints is experimental. This may be subject to breaking changes.
159
+ * @category Definers
160
+ * @expandType BlueprintApplicationConfig
161
+ * @returns The application resource
162
+ * @hidden
163
+ */
164
+ export declare function defineApplication(config: BlueprintApplicationConfig): BlueprintApplicationResource;
@@ -0,0 +1,211 @@
1
+ import { validateApplication, validateAssetSourceView, validatePanelView, validateTileView, validateWebWorker, validateWindowView, } from '../index.js';
2
+ import { runValidation } from '../utils/validation.js';
3
+ /** Maps a view `surface` to the view `type` the backend expects. */
4
+ const SURFACE_TO_TYPE = {
5
+ window: 'app',
6
+ panel: 'panel',
7
+ 'asset-source': 'asset_source',
8
+ tile: 'tile',
9
+ };
10
+ /**
11
+ * Transforms an authored view config (discriminated by `surface`) into the
12
+ * emitted view resource (discriminated by `type`), stripping `surface`.
13
+ */
14
+ function viewConfigToResource(view) {
15
+ const { surface, ...rest } = view;
16
+ // The surface→type mapping guarantees a valid member of the emitted union.
17
+ return { ...rest, type: SURFACE_TO_TYPE[surface] };
18
+ }
19
+ /**
20
+ * Defines a window view — the navigable, full-page view of an application.
21
+ * An application may declare at most one window view.
22
+ *
23
+ * ```ts
24
+ * defineWindowView({
25
+ * name: 'main',
26
+ * title: 'Design Retro',
27
+ * src: './src/windows/main.tsx',
28
+ * })
29
+ * ```
30
+ *
31
+ * @example With dock placement
32
+ * ```ts
33
+ * defineWindowView({
34
+ * name: 'main',
35
+ * title: 'Design Retro',
36
+ * src: './src/windows/main.tsx',
37
+ * dock: {group: 'applications', order: 10},
38
+ * })
39
+ * ```
40
+ * @param config The window view configuration
41
+ * @public
42
+ * @beta Deploying Applications via Blueprints is experimental. This may be subject to breaking changes.
43
+ * @category Definers
44
+ * @expandType BlueprintWindowViewConfig
45
+ * @returns The window view declaration
46
+ * @hidden
47
+ */
48
+ export function defineWindowView(config) {
49
+ const view = { ...config, surface: 'window', type: 'view' };
50
+ runValidation(() => validateWindowView(viewConfigToResource(view)));
51
+ return view;
52
+ }
53
+ /**
54
+ * Defines a panel view — renders in the dock.
55
+ *
56
+ * ```ts
57
+ * definePanelView({
58
+ * name: 'side',
59
+ * title: 'Favorites',
60
+ * src: './src/panels/main.tsx',
61
+ * })
62
+ * ```
63
+ * @param config The panel view configuration
64
+ * @public
65
+ * @beta Deploying Applications via Blueprints is experimental. This may be subject to breaking changes.
66
+ * @category Definers
67
+ * @expandType BlueprintPanelViewConfig
68
+ * @returns The panel view declaration
69
+ * @hidden
70
+ */
71
+ export function definePanelView(config) {
72
+ const view = { ...config, surface: 'panel', type: 'view' };
73
+ runValidation(() => validatePanelView(viewConfigToResource(view)));
74
+ return view;
75
+ }
76
+ /**
77
+ * Defines an asset source view — contributes an asset source.
78
+ *
79
+ * ```ts
80
+ * defineAssetSourceView({
81
+ * name: 'image-picker',
82
+ * title: 'Image Picker',
83
+ * src: './src/asset-sources/image-picker.tsx',
84
+ * })
85
+ * ```
86
+ * @param config The asset source view configuration
87
+ * @public
88
+ * @beta Deploying Applications via Blueprints is experimental. This may be subject to breaking changes.
89
+ * @category Definers
90
+ * @expandType BlueprintAssetSourceViewConfig
91
+ * @returns The asset source view declaration
92
+ * @hidden
93
+ */
94
+ export function defineAssetSourceView(config) {
95
+ const view = { ...config, surface: 'asset-source', type: 'view' };
96
+ runValidation(() => validateAssetSourceView(viewConfigToResource(view)));
97
+ return view;
98
+ }
99
+ /**
100
+ * Defines a tile view — docks on the dashboard with a footprint `size`.
101
+ *
102
+ * ```ts
103
+ * defineTileView({
104
+ * name: 'jump-back-in',
105
+ * title: 'Main Tile',
106
+ * src: './src/tiles/jump-back-in.tsx',
107
+ * size: 'banner',
108
+ * })
109
+ * ```
110
+ * @param config The tile view configuration
111
+ * @public
112
+ * @beta Deploying Applications via Blueprints is experimental. This may be subject to breaking changes.
113
+ * @category Definers
114
+ * @expandType BlueprintTileViewConfig
115
+ * @returns The tile view declaration
116
+ * @hidden
117
+ */
118
+ export function defineTileView(config) {
119
+ const view = { ...config, surface: 'tile', type: 'view' };
120
+ runValidation(() => validateTileView(viewConfigToResource(view)));
121
+ return view;
122
+ }
123
+ /**
124
+ * Defines a background web worker an application runs.
125
+ *
126
+ * ```ts
127
+ * defineWebWorker({
128
+ * name: 'background-refresh',
129
+ * title: 'Background Worker',
130
+ * src: './src/workers/background-refresh.ts',
131
+ * })
132
+ * ```
133
+ * @param config The web worker configuration
134
+ * @public
135
+ * @beta Deploying Applications via Blueprints is experimental. This may be subject to breaking changes.
136
+ * @category Definers
137
+ * @expandType BlueprintWebWorkerConfig
138
+ * @returns The web worker declaration
139
+ * @hidden
140
+ */
141
+ export function defineWebWorker(config) {
142
+ const worker = { ...config, type: 'worker' };
143
+ runValidation(() => validateWebWorker(worker));
144
+ return worker;
145
+ }
146
+ /**
147
+ * Defines an application.
148
+ *
149
+ * @remarks
150
+ * Views are authored in `views` and web workers in `webWorkers`, mirroring the
151
+ * emitted resource. Views are discriminated by `surface` (`window`, `panel`,
152
+ * `asset-source`, `tile`) and transformed to the emitted view `type` the
153
+ * backend expects. An application must declare at least one view of any
154
+ * surface, and at most one `window` view. Every view and web worker `src` is
155
+ * resolved relative to `root`. The `slug` defaults to the resource `name`.
156
+ *
157
+ * ```ts
158
+ * defineApplication({
159
+ * name: 'design-retro',
160
+ * title: 'Design Retro',
161
+ * root: './apps/design-retro',
162
+ * views: [
163
+ * defineWindowView({name: 'main', title: 'Design Retro', src: './src/windows/main.tsx'}),
164
+ * ],
165
+ * })
166
+ * ```
167
+ *
168
+ * @example With views and web workers
169
+ * ```ts
170
+ * defineApplication({
171
+ * name: 'design-retro',
172
+ * title: 'Design Retro',
173
+ * root: './apps/design-retro',
174
+ * slug: 'design-retro',
175
+ * icon: './src/icons/app-icon.svg',
176
+ * visibility: 'unlisted',
177
+ * views: [
178
+ * defineWindowView({
179
+ * name: 'main',
180
+ * title: 'Design Retro',
181
+ * src: './src/windows/main.tsx',
182
+ * dock: {group: 'applications', order: 10},
183
+ * }),
184
+ * definePanelView({name: 'side', title: 'Favorites', src: './src/panels/main.tsx'}),
185
+ * defineAssetSourceView({name: 'image-picker', title: 'Image Picker', src: './src/asset-sources/image-picker.tsx'}),
186
+ * defineTileView({name: 'jump-back-in', title: 'Main Tile', src: './src/tiles/jump-back-in.tsx', size: 'banner'}),
187
+ * ],
188
+ * webWorkers: [
189
+ * defineWebWorker({name: 'background-refresh', title: 'Background Worker', src: './src/workers/background-refresh.ts'}),
190
+ * ],
191
+ * })
192
+ * ```
193
+ * @param config The application configuration
194
+ * @public
195
+ * @beta Deploying Applications via Blueprints is experimental. This may be subject to breaking changes.
196
+ * @category Definers
197
+ * @expandType BlueprintApplicationConfig
198
+ * @returns The application resource
199
+ * @hidden
200
+ */
201
+ export function defineApplication(config) {
202
+ const { views, webWorkers, slug, ...rest } = config;
203
+ const applicationResource = { ...rest, type: 'sanity.application', slug: slug ?? rest.name };
204
+ if (views && views.length > 0)
205
+ applicationResource.views = views.map(viewConfigToResource);
206
+ if (webWorkers && webWorkers.length > 0)
207
+ applicationResource.webWorkers = webWorkers;
208
+ runValidation(() => validateApplication(applicationResource));
209
+ return applicationResource;
210
+ }
211
+ //# sourceMappingURL=applications.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"applications.js","sourceRoot":"","sources":["../../src/definers/applications.ts"],"names":[],"mappings":"AAAA,OAAO,EAYL,mBAAmB,EACnB,uBAAuB,EACvB,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,aAAa,CAAA;AACpB,OAAO,EAAC,aAAa,EAAC,MAAM,wBAAwB,CAAA;AAEpD,oEAAoE;AACpE,MAAM,eAAe,GAAG;IACtB,MAAM,EAAE,KAAK;IACb,KAAK,EAAE,OAAO;IACd,cAAc,EAAE,cAAc;IAC9B,IAAI,EAAE,MAAM;CACuE,CAAA;AAErF;;;GAGG;AACH,SAAS,oBAAoB,CAAC,IAAoC;IAChE,MAAM,EAAC,OAAO,EAAE,GAAG,IAAI,EAAC,GAAG,IAAI,CAAA;IAC/B,2EAA2E;IAC3E,OAAO,EAAC,GAAG,IAAI,EAAE,IAAI,EAAE,eAAe,CAAC,OAAO,CAAC,EAA6B,CAAA;AAC9E,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAA2D;IAC1F,MAAM,IAAI,GAA8B,EAAC,GA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EAAE,QAAQ,EAAC,CAAA;IAC9D,aAAa,CAAC,GAAG,EAAE,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAA;IAC9C,OAAO,MAAM,CAAA;AACf,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAAkC;IAClE,MAAM,EAAC,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,IAAI,EAAC,GAAG,MAAM,CAAA;IAEjD,MAAM,mBAAmB,GAAiC,EAAC,GAAG,IAAI,EAAE,IAAI,EAAE,oBAAoB,EAAE,IAAI,EAAE,IAAI,IAAI,IAAI,CAAC,IAAI,EAAC,CAAA;IACxH,IAAI,KAAK,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC;QAAE,mBAAmB,CAAC,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAA;IAC1F,IAAI,UAAU,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC;QAAE,mBAAmB,CAAC,UAAU,GAAG,UAAU,CAAA;IAEpF,aAAa,CAAC,GAAG,EAAE,CAAC,mBAAmB,CAAC,mBAAmB,CAAC,CAAC,CAAA;IAE7D,OAAO,mBAAmB,CAAA;AAC5B,CAAC"}
@@ -0,0 +1,26 @@
1
+ import { type BlueprintMediaLibraryConfigConfig, type BlueprintMediaLibraryConfigResource } from '../index.js';
2
+ /**
3
+ * Defines a singleton Media Library configuration.
4
+ *
5
+ * @remarks
6
+ * The Media Library is a Sanity-owned singleton, so this resource carries no
7
+ * application identity of its own — only the config `root` and its `fields`.
8
+ * The provider resolves the organization's media library installation id at
9
+ * deploy time.
10
+ *
11
+ * ```ts
12
+ * defineMediaLibraryConfig({
13
+ * name: 'media-library',
14
+ * root: './media-library',
15
+ * fields: [{name: 'brand', title: 'Brand', src: './src/fields/brand.tsx'}],
16
+ * })
17
+ * ```
18
+ * @param config The Media Library configuration
19
+ * @public
20
+ * @beta Configuring the Media Library via Blueprints is experimental. This may be subject to breaking changes.
21
+ * @category Definers
22
+ * @expandType BlueprintMediaLibraryConfigConfig
23
+ * @returns The Media Library configuration resource
24
+ * @hidden
25
+ */
26
+ export declare function defineMediaLibraryConfig(config: BlueprintMediaLibraryConfigConfig): BlueprintMediaLibraryConfigResource;
@@ -0,0 +1,36 @@
1
+ import { validateMediaLibraryConfig } from '../index.js';
2
+ import { runValidation } from '../utils/validation.js';
3
+ /**
4
+ * Defines a singleton Media Library configuration.
5
+ *
6
+ * @remarks
7
+ * The Media Library is a Sanity-owned singleton, so this resource carries no
8
+ * application identity of its own — only the config `root` and its `fields`.
9
+ * The provider resolves the organization's media library installation id at
10
+ * deploy time.
11
+ *
12
+ * ```ts
13
+ * defineMediaLibraryConfig({
14
+ * name: 'media-library',
15
+ * root: './media-library',
16
+ * fields: [{name: 'brand', title: 'Brand', src: './src/fields/brand.tsx'}],
17
+ * })
18
+ * ```
19
+ * @param config The Media Library configuration
20
+ * @public
21
+ * @beta Configuring the Media Library via Blueprints is experimental. This may be subject to breaking changes.
22
+ * @category Definers
23
+ * @expandType BlueprintMediaLibraryConfigConfig
24
+ * @returns The Media Library configuration resource
25
+ * @hidden
26
+ */
27
+ export function defineMediaLibraryConfig(config) {
28
+ const resource = {
29
+ ...config,
30
+ type: 'sanity.installation.config',
31
+ appType: 'media-library',
32
+ };
33
+ runValidation(() => validateMediaLibraryConfig(resource));
34
+ return resource;
35
+ }
36
+ //# sourceMappingURL=installation-config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"installation-config.js","sourceRoot":"","sources":["../../src/definers/installation-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmF,0BAA0B,EAAC,MAAM,aAAa,CAAA;AACxI,OAAO,EAAC,aAAa,EAAC,MAAM,wBAAwB,CAAA;AAEpD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,UAAU,wBAAwB,CAAC,MAAyC;IAChF,MAAM,QAAQ,GAAG;QACf,GAAG,MAAM;QACT,IAAI,EAAE,4BAA4B;QAClC,OAAO,EAAE,eAAe;KACqB,CAAA;IAE/C,aAAa,CAAC,GAAG,EAAE,CAAC,0BAA0B,CAAC,QAAQ,CAAC,CAAC,CAAA;IAEzD,OAAO,QAAQ,CAAA;AACjB,CAAC"}
@@ -6,7 +6,7 @@ import type { BlueprintStudioConfig, BlueprintStudioResource } from '../types/st
6
6
  * defineStudio({
7
7
  * name: 'my-studio',
8
8
  * project: 'my-project-id',
9
- * src: 'studios/my-studio',
9
+ * root: 'studios/my-studio',
10
10
  * autoUpdates: {
11
11
  * enabled: true
12
12
  * }
@@ -7,7 +7,7 @@ import { runValidation } from '../utils/validation.js';
7
7
  * defineStudio({
8
8
  * name: 'my-studio',
9
9
  * project: 'my-project-id',
10
- * src: 'studios/my-studio',
10
+ * root: 'studios/my-studio',
11
11
  * autoUpdates: {
12
12
  * enabled: true
13
13
  * }
package/dist/index.d.ts CHANGED
@@ -6,6 +6,7 @@
6
6
  * @categoryDescription Referencers
7
7
  * These functions are used to reference resources in another Blueprint.
8
8
  */
9
+ export * from './definers/applications.js';
9
10
  export * from './definers/blueprints.js';
10
11
  export * from './definers/cors.js';
11
12
  export * from './definers/datasets.js';
@@ -17,6 +18,7 @@ export * from './definers/functions/pubsub.js';
17
18
  export * from './definers/functions/queue.js';
18
19
  export * from './definers/functions/scheduled.js';
19
20
  export * from './definers/functions/sync-tag-invalidate.js';
21
+ export * from './definers/installation-config.js';
20
22
  export * from './definers/projects.js';
21
23
  export * from './definers/resources.js';
22
24
  export * from './definers/robots.js';
@@ -32,11 +34,13 @@ export * from './definers/webhooks.js';
32
34
  * @categoryDescription Functions Types
33
35
  * Resource types for functions in a Blueprint.
34
36
  */
37
+ export * from './types/applications.js';
35
38
  export * from './types/blueprints.js';
36
39
  export * from './types/cors.js';
37
40
  export * from './types/datasets.js';
38
41
  export * from './types/errors.js';
39
42
  export * from './types/functions/index.js';
43
+ export * from './types/installation-config.js';
40
44
  export * from './types/projects.js';
41
45
  export * from './types/resources.js';
42
46
  export * from './types/robots.js';
@@ -48,10 +52,12 @@ export * from './types/webhooks.js';
48
52
  * @categoryDescription Validation
49
53
  * These functions are used to validate resources in a Blueprint.
50
54
  */
55
+ export * from './validation/applications.js';
51
56
  export * from './validation/blueprints.js';
52
57
  export * from './validation/cors.js';
53
58
  export * from './validation/datasets.js';
54
59
  export * from './validation/functions.js';
60
+ export * from './validation/installation-config.js';
55
61
  export * from './validation/projects.js';
56
62
  export * from './validation/resources.js';
57
63
  export * from './validation/robots.js';
package/dist/index.js CHANGED
@@ -7,6 +7,7 @@
7
7
  * @categoryDescription Referencers
8
8
  * These functions are used to reference resources in another Blueprint.
9
9
  */
10
+ export * from './definers/applications.js';
10
11
  export * from './definers/blueprints.js';
11
12
  export * from './definers/cors.js';
12
13
  export * from './definers/datasets.js';
@@ -18,6 +19,7 @@ export * from './definers/functions/pubsub.js';
18
19
  export * from './definers/functions/queue.js';
19
20
  export * from './definers/functions/scheduled.js';
20
21
  export * from './definers/functions/sync-tag-invalidate.js';
22
+ export * from './definers/installation-config.js';
21
23
  export * from './definers/projects.js';
22
24
  export * from './definers/resources.js';
23
25
  export * from './definers/robots.js';
@@ -34,11 +36,13 @@ export * from './definers/webhooks.js';
34
36
  * @categoryDescription Functions Types
35
37
  * Resource types for functions in a Blueprint.
36
38
  */
39
+ export * from './types/applications.js';
37
40
  export * from './types/blueprints.js';
38
41
  export * from './types/cors.js';
39
42
  export * from './types/datasets.js';
40
43
  export * from './types/errors.js';
41
44
  export * from './types/functions/index.js';
45
+ export * from './types/installation-config.js';
42
46
  export * from './types/projects.js';
43
47
  export * from './types/resources.js';
44
48
  export * from './types/robots.js';
@@ -51,10 +55,12 @@ export * from './types/webhooks.js';
51
55
  * @categoryDescription Validation
52
56
  * These functions are used to validate resources in a Blueprint.
53
57
  */
58
+ export * from './validation/applications.js';
54
59
  export * from './validation/blueprints.js';
55
60
  export * from './validation/cors.js';
56
61
  export * from './validation/datasets.js';
57
62
  export * from './validation/functions.js';
63
+ export * from './validation/installation-config.js';
58
64
  export * from './validation/projects.js';
59
65
  export * from './validation/resources.js';
60
66
  export * from './validation/robots.js';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,kDAAkD;AAClD;;;GAGG;AACH;;;GAGG;AACH,cAAc,0BAA0B,CAAA;AACxC,cAAc,oBAAoB,CAAA;AAClC,cAAc,wBAAwB,CAAA;AACtC,cAAc,kCAAkC,CAAA;AAChD,cAAc,iCAAiC,CAAA;AAC/C,cAAc,+BAA+B,CAAA;AAC7C,cAAc,uCAAuC,CAAA;AACrD,cAAc,gCAAgC,CAAA;AAC9C,cAAc,+BAA+B,CAAA;AAC7C,cAAc,mCAAmC,CAAA;AACjD,cAAc,6CAA6C,CAAA;AAC3D,cAAc,wBAAwB,CAAA;AACtC,cAAc,yBAAyB,CAAA;AACvC,cAAc,sBAAsB,CAAA;AACpC,cAAc,2BAA2B,CAAA;AACzC,cAAc,qBAAqB,CAAA;AACnC,cAAc,uBAAuB,CAAA;AACrC,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,4BAA4B,CAAA;AAC1C,cAAc,qBAAqB,CAAA;AACnC,cAAc,sBAAsB,CAAA;AACpC,cAAc,mBAAmB,CAAA;AACjC,cAAc,wBAAwB,CAAA;AACtC,cAAc,kBAAkB,CAAA;AAChC,cAAc,oBAAoB,CAAA;AAClC,cAAc,qBAAqB,CAAA;AAEnC,4CAA4C;AAC5C;;;GAGG;AACH,cAAc,4BAA4B,CAAA;AAC1C,cAAc,sBAAsB,CAAA;AACpC,cAAc,0BAA0B,CAAA;AAC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