@sanity/workbench 0.1.0-alpha.6 → 0.1.0-alpha.8

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 (47) hide show
  1. package/dist/{log.js → _chunks-es/index.js} +7 -2
  2. package/dist/_chunks-es/index.js.map +1 -0
  3. package/dist/_internal.d.ts +13 -6
  4. package/dist/_internal.js +20 -9
  5. package/dist/_internal.js.map +1 -1
  6. package/dist/core.d.ts +1464 -0
  7. package/dist/core.js +744 -0
  8. package/dist/core.js.map +1 -0
  9. package/package.json +12 -4
  10. package/src/_exports/core.ts +1 -0
  11. package/src/_internal/index.ts +2 -1
  12. package/src/_internal/render.test.ts +91 -4
  13. package/src/_internal/render.ts +53 -33
  14. package/src/core/__tests__/__fixtures__.ts +245 -0
  15. package/src/core/applications/application-list.test.ts +222 -0
  16. package/src/core/applications/application-list.ts +103 -0
  17. package/src/core/applications/application.ts +78 -0
  18. package/src/core/applications/local-application.test.ts +93 -0
  19. package/src/core/applications/local-application.ts +56 -0
  20. package/src/core/canvases.test.ts +38 -0
  21. package/src/core/canvases.ts +81 -0
  22. package/src/core/config.ts +34 -0
  23. package/src/core/index.ts +12 -0
  24. package/src/{log → core/log}/index.ts +12 -0
  25. package/src/core/media-libraries.test.ts +38 -0
  26. package/src/core/media-libraries.ts +83 -0
  27. package/src/core/organizations.test.ts +134 -0
  28. package/src/core/organizations.ts +115 -0
  29. package/src/core/projects.test.ts +248 -0
  30. package/src/core/projects.ts +114 -0
  31. package/src/core/shared/urls.test.ts +182 -0
  32. package/src/core/shared/urls.ts +128 -0
  33. package/src/core/user-applications/core-app.test.ts +236 -0
  34. package/src/core/user-applications/core-app.ts +113 -0
  35. package/src/core/user-applications/studios/index.ts +3 -0
  36. package/src/core/user-applications/studios/schemas.test.ts +113 -0
  37. package/src/core/user-applications/studios/schemas.ts +106 -0
  38. package/src/core/user-applications/studios/studio.test.ts +997 -0
  39. package/src/core/user-applications/studios/studio.ts +498 -0
  40. package/src/core/user-applications/studios/workspace.ts +143 -0
  41. package/src/core/user-applications/user-application.test.ts +125 -0
  42. package/src/core/user-applications/user-application.ts +107 -0
  43. package/src/vite-env.d.ts +8 -0
  44. package/dist/log.d.ts +0 -48
  45. package/dist/log.js.map +0 -1
  46. package/src/_exports/log.ts +0 -1
  47. /package/src/{log → core/log}/index.test.ts +0 -0
package/dist/core.d.ts ADDED
@@ -0,0 +1,1464 @@
1
+ import type { ApplicationResource } from "@sanity/message-protocol";
2
+ import type { CanvasResource } from "@sanity/message-protocol";
3
+ import type { MediaResource } from "@sanity/message-protocol";
4
+ import type { Resource } from "@sanity/message-protocol";
5
+ import type { StudioResource } from "@sanity/message-protocol";
6
+ import { z } from "zod";
7
+
8
+ /**
9
+ * @public
10
+ */
11
+ export declare abstract class AbstractApplication<
12
+ TType extends AbstractApplicationType,
13
+ TProtocolResource extends Resource = Extract<
14
+ Resource,
15
+ {
16
+ type: TType;
17
+ }
18
+ >,
19
+ > {
20
+ readonly type: TType;
21
+ constructor(type: TType);
22
+ abstract get href(): string;
23
+ abstract get title(): string;
24
+ abstract get id(): string;
25
+ get initials(): string;
26
+ /**
27
+ * Converts the resource to a protocol resource that comlink expects
28
+ * for backwards compatibility with the old API format.
29
+ */
30
+ abstract toProtocolResource(): TProtocolResource;
31
+ }
32
+
33
+ /**
34
+ * @public
35
+ */
36
+ export declare type AbstractApplicationType =
37
+ | "studio"
38
+ | "coreApp"
39
+ | "canvas"
40
+ | "media-library"
41
+ | "workspace";
42
+
43
+ /**
44
+ * @public
45
+ */
46
+ export declare const ActiveDeployment: z.ZodObject<
47
+ {
48
+ id: z.ZodString;
49
+ version: z.ZodString;
50
+ isActiveDeployment: z.ZodBoolean;
51
+ userApplicationId: z.ZodString;
52
+ isAutoUpdating: z.ZodBoolean;
53
+ size: z.ZodNumber;
54
+ deployedAt: z.ZodString;
55
+ deployedBy: z.ZodString;
56
+ createdAt: z.ZodString;
57
+ updatedAt: z.ZodString;
58
+ },
59
+ z.core.$strip
60
+ >;
61
+
62
+ declare type Application =
63
+ | CoreAppApplication
64
+ | StudioApplication
65
+ | StudioWorkspace
66
+ | CanvasApplication
67
+ | MediaLibraryApplication
68
+ | LocalApplication;
69
+
70
+ /**
71
+ * @public
72
+ */
73
+ export declare class ApplicationList<
74
+ TApplication extends Application = Application,
75
+ > {
76
+ readonly applications: TApplication[];
77
+ /**
78
+ * @param applications - The applications to initialize the list with.
79
+ */
80
+ constructor(applications: TApplication[]);
81
+ findApplicationsByType<T extends TApplication["type"]>(
82
+ type: T,
83
+ ): Extract<
84
+ TApplication,
85
+ {
86
+ type: T;
87
+ }
88
+ >[];
89
+ findApplicationsByType<T extends TApplication["type"][]>(
90
+ types: T,
91
+ ): Extract<
92
+ TApplication,
93
+ {
94
+ type: T[number];
95
+ }
96
+ >[];
97
+ findApplication(type: "media-library"):
98
+ | Extract<
99
+ TApplication,
100
+ {
101
+ type: "media-library";
102
+ }
103
+ >
104
+ | undefined;
105
+ findApplication(type: "canvas"):
106
+ | Extract<
107
+ TApplication,
108
+ {
109
+ type: "canvas";
110
+ }
111
+ >
112
+ | undefined;
113
+ findApplication(
114
+ type: "coreApp",
115
+ id: UserApplicationId,
116
+ ):
117
+ | Extract<
118
+ TApplication,
119
+ {
120
+ type: "coreApp";
121
+ }
122
+ >
123
+ | undefined;
124
+ findApplication(
125
+ type: "studio",
126
+ id: UserApplicationId,
127
+ ):
128
+ | Extract<
129
+ TApplication,
130
+ {
131
+ type: "studio";
132
+ }
133
+ >
134
+ | undefined;
135
+ findApplication(
136
+ type: "workspace",
137
+ id: string,
138
+ ):
139
+ | Extract<
140
+ TApplication,
141
+ {
142
+ type: "workspace";
143
+ }
144
+ >
145
+ | undefined;
146
+ toProtocolResources(): Resource[];
147
+ static areApplicationsEqual(
148
+ application1?: Application,
149
+ application2?: Application,
150
+ ): boolean;
151
+ }
152
+
153
+ /**
154
+ * Validates and brands a string as a CanvasId.
155
+ * @public
156
+ */
157
+ export declare function brandCanvasId(id: string): CanvasId;
158
+
159
+ /**
160
+ * Validates and brands a string as a MediaLibraryId.
161
+ * @public
162
+ */
163
+ export declare function brandMediaLibraryId(id: string): MediaLibraryId;
164
+
165
+ /**
166
+ * Validates and brands a string as an OrganizationId.
167
+ * @public
168
+ */
169
+ export declare function brandOrganizationId(id: string): OrganizationId;
170
+
171
+ /**
172
+ * Validates and brands a string as a ProjectId.
173
+ * @public
174
+ */
175
+ export declare function brandProjectId(id: string): ProjectId;
176
+
177
+ /**
178
+ * Validates and brands a string as a UserApplicationId.
179
+ * @public
180
+ */
181
+ export declare function brandUserApplicationId(id: string): UserApplicationId;
182
+
183
+ /**
184
+ * Represents a Canvas resource as returned from the API.
185
+ * @public
186
+ */
187
+ export declare type Canvas = z.output<typeof Canvas_2>;
188
+
189
+ declare const Canvas_2: z.ZodObject<
190
+ {
191
+ id: z.core.$ZodBranded<z.ZodString, "CanvasId", "out">;
192
+ organizationId: z.core.$ZodBranded<z.ZodString, "OrganizationId", "out">;
193
+ status: z.ZodEnum<{
194
+ active: "active";
195
+ provisioning: "provisioning";
196
+ }>;
197
+ },
198
+ z.core.$strip
199
+ >;
200
+
201
+ /**
202
+ * Represents a Canvas resource as returned from the API.
203
+ * @public
204
+ */
205
+ declare type Canvas = z.output<typeof Canvas_2>;
206
+
207
+ /**
208
+ * Whilst the constructor takes an organization's canvas resource the existance
209
+ * therefore implies the organization has access to the canvas application which
210
+ * is what workbench most importantly wants to know.
211
+ * @public
212
+ */
213
+ export declare class CanvasApplication extends AbstractApplication<"canvas"> {
214
+ readonly canvas: Canvas;
215
+ constructor(canvas: Canvas);
216
+ get id(): CanvasId;
217
+ get href(): string;
218
+ get title(): string;
219
+ toProtocolResource(): CanvasResource;
220
+ }
221
+
222
+ /**
223
+ * Canvas ID type, branded for type safety.
224
+ * @public
225
+ */
226
+ export declare type CanvasId = z.output<typeof CanvasId_2>;
227
+
228
+ /**
229
+ * Canvas ID schema, branded for type safety.
230
+ * @public
231
+ */
232
+ declare const CanvasId_2: z.core.$ZodBranded<z.ZodString, "CanvasId", "out">;
233
+
234
+ /**
235
+ * Canvas ID type, branded for type safety.
236
+ * @public
237
+ */
238
+ declare type CanvasId = z.output<typeof CanvasId_2>;
239
+
240
+ /**
241
+ * @public
242
+ */
243
+ export declare const ClientManifest: z.ZodObject<
244
+ {
245
+ version: z.ZodNumber;
246
+ createdAt: z.ZodString;
247
+ studioVersion: z.ZodOptional<z.ZodString>;
248
+ workspaces: z.ZodArray<
249
+ z.ZodObject<
250
+ {
251
+ name: z.ZodString;
252
+ title: z.ZodString;
253
+ subtitle: z.ZodOptional<z.ZodString>;
254
+ basePath: z.ZodString;
255
+ projectId: z.core.$ZodBranded<z.ZodString, "ProjectId", "out">;
256
+ dataset: z.ZodOptional<z.ZodString>;
257
+ icon: z.ZodOptional<z.ZodNullable<z.ZodString>>;
258
+ schema: z.ZodString;
259
+ tools: z.ZodOptional<z.ZodString>;
260
+ },
261
+ z.core.$strip
262
+ >
263
+ >;
264
+ },
265
+ z.core.$strip
266
+ >;
267
+
268
+ declare type CompatibilityStatus =
269
+ (typeof StudioApplication.CompatibilityStatuses)[keyof typeof StudioApplication.CompatibilityStatuses];
270
+
271
+ /**
272
+ * Workbench configuration.
273
+ *
274
+ * @public
275
+ */
276
+ export declare interface Config {
277
+ /**
278
+ * The organization ID to use when rendering the workbench.
279
+ */
280
+ organizationId?: string;
281
+ }
282
+
283
+ /**
284
+ * @internal
285
+ */
286
+ export declare class CoreAppApplication extends UserApplication<
287
+ CoreAppUserApplication,
288
+ "coreApp",
289
+ ApplicationResource
290
+ > {
291
+ readonly activeDeployment: CoreAppUserApplication["activeDeployment"];
292
+ constructor(application: CoreAppUserApplication);
293
+ get href(): string;
294
+ get title(): string;
295
+ get subtitle(): undefined;
296
+ get updatedAt(): string;
297
+ get<TKey extends keyof CoreAppUserApplication>(
298
+ attr: TKey,
299
+ ): CoreAppUserApplication[TKey];
300
+ toProtocolResource(): ApplicationResource;
301
+ }
302
+
303
+ /**
304
+ * @public
305
+ */
306
+ export declare type CoreAppUserApplication = z.output<
307
+ typeof CoreAppUserApplication_2
308
+ >;
309
+
310
+ /**
311
+ * Core application schema — validates and brands API
312
+ * responses from the `/user-applications?appType=coreApp`
313
+ * endpoint. Uses a discriminated union on `urlType`.
314
+ * @public
315
+ */
316
+ declare const CoreAppUserApplication_2: z.ZodDiscriminatedUnion<
317
+ [
318
+ z.ZodObject<
319
+ {
320
+ id: z.core.$ZodBranded<z.ZodString, "UserApplicationId", "out">;
321
+ appHost: z.ZodString;
322
+ createdAt: z.ZodString;
323
+ updatedAt: z.ZodString;
324
+ dashboardStatus: z.ZodEnum<{
325
+ default: "default";
326
+ disabled: "disabled";
327
+ }>;
328
+ title: z.ZodString;
329
+ organizationId: z.core.$ZodBranded<
330
+ z.ZodString,
331
+ "OrganizationId",
332
+ "out"
333
+ >;
334
+ type: z.ZodLiteral<"coreApp">;
335
+ manifest: z.ZodOptional<
336
+ z.ZodNullable<
337
+ z.ZodObject<
338
+ {
339
+ version: z.ZodString;
340
+ icon: z.ZodOptional<z.ZodString>;
341
+ title: z.ZodOptional<z.ZodString>;
342
+ },
343
+ z.core.$strip
344
+ >
345
+ >
346
+ >;
347
+ urlType: z.ZodLiteral<"internal">;
348
+ activeDeployment: z.ZodObject<
349
+ {
350
+ id: z.ZodString;
351
+ version: z.ZodString;
352
+ isActiveDeployment: z.ZodBoolean;
353
+ userApplicationId: z.ZodString;
354
+ isAutoUpdating: z.ZodBoolean;
355
+ size: z.ZodNumber;
356
+ deployedAt: z.ZodString;
357
+ deployedBy: z.ZodString;
358
+ createdAt: z.ZodString;
359
+ updatedAt: z.ZodString;
360
+ manifest: z.ZodOptional<
361
+ z.ZodNullable<
362
+ z.ZodObject<
363
+ {
364
+ version: z.ZodString;
365
+ icon: z.ZodOptional<z.ZodString>;
366
+ title: z.ZodOptional<z.ZodString>;
367
+ },
368
+ z.core.$strip
369
+ >
370
+ >
371
+ >;
372
+ },
373
+ z.core.$strip
374
+ >;
375
+ },
376
+ z.core.$strip
377
+ >,
378
+ z.ZodObject<
379
+ {
380
+ id: z.core.$ZodBranded<z.ZodString, "UserApplicationId", "out">;
381
+ appHost: z.ZodString;
382
+ createdAt: z.ZodString;
383
+ updatedAt: z.ZodString;
384
+ dashboardStatus: z.ZodEnum<{
385
+ default: "default";
386
+ disabled: "disabled";
387
+ }>;
388
+ title: z.ZodString;
389
+ organizationId: z.core.$ZodBranded<
390
+ z.ZodString,
391
+ "OrganizationId",
392
+ "out"
393
+ >;
394
+ type: z.ZodLiteral<"coreApp">;
395
+ manifest: z.ZodOptional<
396
+ z.ZodNullable<
397
+ z.ZodObject<
398
+ {
399
+ version: z.ZodString;
400
+ icon: z.ZodOptional<z.ZodString>;
401
+ title: z.ZodOptional<z.ZodString>;
402
+ },
403
+ z.core.$strip
404
+ >
405
+ >
406
+ >;
407
+ urlType: z.ZodLiteral<"external">;
408
+ activeDeployment: z.ZodNull;
409
+ },
410
+ z.core.$strip
411
+ >,
412
+ ],
413
+ "urlType"
414
+ >;
415
+
416
+ /**
417
+ * @public
418
+ */
419
+ declare type CoreAppUserApplication = z.output<typeof CoreAppUserApplication_2>;
420
+
421
+ /**
422
+ * @public
423
+ */
424
+ export declare function createLogger({
425
+ namespace,
426
+ context: baseContext,
427
+ logLevel,
428
+ }?: LoggerOptions): Logger;
429
+
430
+ /**
431
+ * An Application wrapping a locally-discovered CLI application.
432
+ * Provides a deterministic id, title and href suitable for use in navigation.
433
+ *
434
+ * @internal
435
+ */
436
+ export declare class LocalApplication extends AbstractApplication<
437
+ "studio" | "coreApp",
438
+ never
439
+ > {
440
+ readonly localApplication: LocalApplicationData;
441
+ constructor(localApplication: LocalApplicationData);
442
+ get id(): string;
443
+ get title(): string;
444
+ get href(): string;
445
+ get url(): URL;
446
+ toProtocolResource(): never;
447
+ }
448
+
449
+ /**
450
+ * Raw data for a local application discovered by the CLI dev server.
451
+ *
452
+ * @experimental
453
+ * @public
454
+ */
455
+ export declare interface LocalApplicationData {
456
+ host: string;
457
+ port: number;
458
+ type: "studio" | "coreApp";
459
+ }
460
+
461
+ declare type LogContext = {
462
+ [key: string]: unknown;
463
+ };
464
+
465
+ /**
466
+ * @public
467
+ */
468
+ export declare interface Logger {
469
+ error: (message: string, context?: LogContext) => void;
470
+ warn: (message: string, context?: LogContext) => void;
471
+ info: (message: string, context?: LogContext) => void;
472
+ debug: (message: string, context?: LogContext) => void;
473
+ }
474
+
475
+ /**
476
+ * Shared workbench logger instance. Use this from both the workbench host
477
+ * and its remotes so lifecycle and diagnostic logs appear under a single
478
+ * namespace.
479
+ *
480
+ * @public
481
+ */
482
+ export declare const logger: Logger;
483
+
484
+ declare interface LoggerOptions {
485
+ namespace?: LogNamespace;
486
+ context?: LogContext;
487
+ logLevel?: LogLevel;
488
+ }
489
+
490
+ /**
491
+ * Log levels in order of verbosity (least to most)
492
+ * - none: Silent
493
+ * - error: Critical failures that prevent operation
494
+ * - warn: Issues that may cause problems but don't stop execution
495
+ * - info: High-level informational messages (default)
496
+ * - debug: Detailed debugging information (maintainer level)
497
+ * - trace: Very detailed tracing — sets `internal: true` on context
498
+ * @public
499
+ */
500
+ export declare type LogLevel = "none" | "error" | "warn" | "info" | "debug";
501
+
502
+ /**
503
+ * Namespaces organize logs by functional domain.
504
+ * @internal
505
+ */
506
+ export declare type LogNamespace = string;
507
+
508
+ /**
509
+ * Represents a MediaLibrary resource as returned from the API.
510
+ * @public
511
+ */
512
+ export declare type MediaLibrary = z.output<typeof MediaLibrary_2>;
513
+
514
+ declare const MediaLibrary_2: z.ZodObject<
515
+ {
516
+ id: z.core.$ZodBranded<z.ZodString, "MediaLibraryId", "out">;
517
+ organizationId: z.core.$ZodBranded<z.ZodString, "OrganizationId", "out">;
518
+ status: z.ZodEnum<{
519
+ active: "active";
520
+ provisioning: "provisioning";
521
+ }>;
522
+ aclMode: z.ZodEnum<{
523
+ private: "private";
524
+ public: "public";
525
+ }>;
526
+ },
527
+ z.core.$strip
528
+ >;
529
+
530
+ /**
531
+ * Represents a MediaLibrary resource as returned from the API.
532
+ * @public
533
+ */
534
+ declare type MediaLibrary = z.output<typeof MediaLibrary_2>;
535
+
536
+ /**
537
+ * Whilst the constructor takes an organization's media library resource the existance
538
+ * therefore implies the organization has access to the media library application which
539
+ * is what workbench most importantly wants to know.
540
+ * @public
541
+ */
542
+ export declare class MediaLibraryApplication extends AbstractApplication<"media-library"> {
543
+ readonly library: MediaLibrary;
544
+ constructor(library: MediaLibrary);
545
+ get id(): string;
546
+ get href(): string;
547
+ get title(): string;
548
+ toProtocolResource(): MediaResource;
549
+ }
550
+
551
+ /**
552
+ * MediaLibrary ID type, branded for type safety.
553
+ * @public
554
+ */
555
+ export declare type MediaLibraryId = z.output<typeof MediaLibraryId_2>;
556
+
557
+ /**
558
+ * Canvas ID schema, branded for type safety.
559
+ * @public
560
+ */
561
+ declare const MediaLibraryId_2: z.core.$ZodBranded<
562
+ z.ZodString,
563
+ "MediaLibraryId",
564
+ "out"
565
+ >;
566
+
567
+ /**
568
+ * MediaLibrary ID type, branded for type safety.
569
+ * @public
570
+ */
571
+ declare type MediaLibraryId = z.output<typeof MediaLibraryId_2>;
572
+
573
+ /**
574
+ * Organization schema — validates and brands API responses
575
+ * from the `/organizations/:id` endpoint.
576
+ * @public
577
+ */
578
+ export declare const Organization: z.ZodObject<
579
+ {
580
+ id: z.core.$ZodBranded<z.ZodString, "OrganizationId", "out">;
581
+ name: z.ZodString;
582
+ slug: z.ZodNullable<z.ZodString>;
583
+ createdAt: z.ZodString;
584
+ updatedAt: z.ZodString;
585
+ dashboardStatus: z.ZodEnum<{
586
+ enabled: "enabled";
587
+ disabled: "disabled";
588
+ }>;
589
+ aiFeaturesStatus: z.ZodEnum<{
590
+ enabled: "enabled";
591
+ disabled: "disabled";
592
+ }>;
593
+ defaultRoleName: z.ZodString;
594
+ },
595
+ z.core.$strip
596
+ >;
597
+
598
+ /**
599
+ * Represents an organization with optional members and
600
+ * features arrays depending on the generic parameters.
601
+ * - `Organization` — base fields only (default)
602
+ * - `Organization<true>` — includes `members`
603
+ * - `Organization<true, true>` — includes both
604
+ * @public
605
+ */
606
+ export declare type Organization<
607
+ IncludeMembers extends boolean = true,
608
+ IncludeFeatures extends boolean = true,
609
+ > = z.output<typeof Organization> &
610
+ (IncludeMembers extends true
611
+ ? {
612
+ members: OrganizationMember[];
613
+ }
614
+ : unknown) &
615
+ (IncludeFeatures extends true
616
+ ? {
617
+ features: string[];
618
+ }
619
+ : unknown);
620
+
621
+ /**
622
+ * Organization ID schema, branded for type safety.
623
+ * @public
624
+ */
625
+ export declare const OrganizationId: z.core.$ZodBranded<
626
+ z.ZodString,
627
+ "OrganizationId",
628
+ "out"
629
+ >;
630
+
631
+ /**
632
+ * Organization ID type, branded for type safety.
633
+ * @public
634
+ */
635
+ export declare type OrganizationId = z.output<typeof OrganizationId>;
636
+
637
+ /**
638
+ * @public
639
+ */
640
+ export declare type OrganizationMember = z.output<typeof OrganizationMember_2>;
641
+
642
+ declare const OrganizationMember_2: z.ZodObject<
643
+ {
644
+ sanityUserId: z.ZodString;
645
+ isCurrentUser: z.ZodBoolean;
646
+ user: z.ZodObject<
647
+ {
648
+ id: z.ZodString;
649
+ displayName: z.ZodString;
650
+ familyName: z.ZodString;
651
+ givenName: z.ZodString;
652
+ middleName: z.ZodNullable<z.ZodString>;
653
+ imageUrl: z.ZodNullable<z.ZodString>;
654
+ email: z.ZodString;
655
+ loginProvider: z.ZodString;
656
+ },
657
+ z.core.$strip
658
+ >;
659
+ roles: z.ZodArray<
660
+ z.ZodObject<
661
+ {
662
+ name: z.ZodString;
663
+ title: z.ZodString;
664
+ description: z.ZodOptional<z.ZodString>;
665
+ },
666
+ z.core.$strip
667
+ >
668
+ >;
669
+ },
670
+ z.core.$strip
671
+ >;
672
+
673
+ /**
674
+ * @public
675
+ */
676
+ declare type OrganizationMember = z.output<typeof OrganizationMember_2>;
677
+
678
+ /**
679
+ * Validates and parses a raw API response into a branded
680
+ * Canvas.
681
+ * @public
682
+ */
683
+ export declare function parseCanvas(data: unknown): Canvas;
684
+
685
+ /**
686
+ * Validates and parses a raw API response into a branded
687
+ * CoreAppUserApplicationData.
688
+ * @public
689
+ */
690
+ export declare function parseCoreApplication(
691
+ data: unknown,
692
+ ): CoreAppUserApplication;
693
+
694
+ /**
695
+ * Validates and parses a raw API response into a branded
696
+ * MediaLibrary.
697
+ * @public
698
+ */
699
+ export declare function parseMediaLibrary(data: unknown): MediaLibrary;
700
+
701
+ /**
702
+ * Validates and parses a raw API response into a branded
703
+ * Organization. The options control which schema is used —
704
+ * matching what the API returns based on query params.
705
+ * @public
706
+ */
707
+ export declare function parseOrganization<
708
+ IncludeMembers extends boolean = true,
709
+ IncludeFeatures extends boolean = true,
710
+ >(
711
+ data: unknown,
712
+ options?: {
713
+ includeMembers?: IncludeMembers;
714
+ includeFeatures?: IncludeFeatures;
715
+ },
716
+ ): Organization<IncludeMembers, IncludeFeatures>;
717
+
718
+ /**
719
+ * Validates and parses a raw API response into a branded
720
+ * Project. The options control which schema is used —
721
+ * matching what the API returns based on query params.
722
+ * @public
723
+ */
724
+ export declare function parseProject<
725
+ IncludeMembers extends boolean = true,
726
+ IncludeFeatures extends boolean = true,
727
+ >(
728
+ data: unknown,
729
+ options?: {
730
+ includeMembers?: IncludeMembers;
731
+ includeFeatures?: IncludeFeatures;
732
+ },
733
+ ): Project<IncludeMembers, IncludeFeatures>;
734
+
735
+ /**
736
+ * Validates and parses a raw API response into a branded
737
+ * StudioUserApplication.
738
+ * @public
739
+ */
740
+ export declare function parseStudioUserApplication(
741
+ data: unknown,
742
+ ): StudioUserApplication;
743
+
744
+ /**
745
+ * Project schema — validates and brands API responses
746
+ * from the `/projects/:id` endpoint.
747
+ * @public
748
+ */
749
+ export declare const Project: z.ZodObject<
750
+ {
751
+ id: z.core.$ZodBranded<z.ZodString, "ProjectId", "out">;
752
+ displayName: z.ZodString;
753
+ studioHost: z.ZodNullable<z.ZodString>;
754
+ organizationId: z.core.$ZodBranded<z.ZodString, "OrganizationId", "out">;
755
+ metadata: z.ZodObject<
756
+ {
757
+ color: z.ZodOptional<z.ZodString>;
758
+ externalStudioHost: z.ZodOptional<z.ZodString>;
759
+ initialTemplate: z.ZodOptional<z.ZodString>;
760
+ cliInitializedAt: z.ZodOptional<z.ZodString>;
761
+ integration: z.ZodLiteral<"manage" | "cli">;
762
+ },
763
+ z.core.$strip
764
+ >;
765
+ isBlocked: z.ZodBoolean;
766
+ isDisabled: z.ZodBoolean;
767
+ isDisabledByUser: z.ZodBoolean;
768
+ activityFeedEnabled: z.ZodBoolean;
769
+ createdAt: z.ZodString;
770
+ updatedAt: z.ZodString;
771
+ },
772
+ z.core.$strip
773
+ >;
774
+
775
+ /**
776
+ * Represents a Sanity project with optional members and
777
+ * features arrays depending on the generic parameters.
778
+ * By default, neither members nor features are included.
779
+ * - `Project` — base fields only (default)
780
+ * - `Project<true>` — includes `members`
781
+ * - `Project<true, true>` — includes both
782
+ * @public
783
+ */
784
+ export declare type Project<
785
+ IncludeMembers extends boolean = true,
786
+ IncludeFeatures extends boolean = true,
787
+ > = z.output<typeof Project> &
788
+ (IncludeMembers extends true
789
+ ? {
790
+ members: ProjectMember[];
791
+ }
792
+ : unknown) &
793
+ (IncludeFeatures extends true
794
+ ? {
795
+ features: string[];
796
+ }
797
+ : unknown);
798
+
799
+ /**
800
+ * Project ID schema, branded for type safety.
801
+ * @public
802
+ */
803
+ export declare const ProjectId: z.core.$ZodBranded<
804
+ z.ZodString,
805
+ "ProjectId",
806
+ "out"
807
+ >;
808
+
809
+ /**
810
+ * Project ID type, branded for type safety.
811
+ * @public
812
+ */
813
+ export declare type ProjectId = z.output<typeof ProjectId>;
814
+
815
+ /**
816
+ * @public
817
+ */
818
+ export declare type ProjectMember = z.output<typeof ProjectMember_2>;
819
+
820
+ declare const ProjectMember_2: z.ZodObject<
821
+ {
822
+ id: z.ZodString;
823
+ createdAt: z.ZodString;
824
+ updatedAt: z.ZodString;
825
+ isCurrentUser: z.ZodBoolean;
826
+ isRobot: z.ZodBoolean;
827
+ roles: z.ZodArray<
828
+ z.ZodObject<
829
+ {
830
+ name: z.ZodString;
831
+ title: z.ZodString;
832
+ description: z.ZodString;
833
+ },
834
+ z.core.$strip
835
+ >
836
+ >;
837
+ },
838
+ z.core.$strip
839
+ >;
840
+
841
+ /**
842
+ * @public
843
+ */
844
+ declare type ProjectMember = z.output<typeof ProjectMember_2>;
845
+
846
+ /**
847
+ * Options for rendering a remote module, such as a user application.
848
+ *
849
+ * @public
850
+ */
851
+ export declare interface RemoteModuleRenderOptions {
852
+ reactStrictMode?: boolean;
853
+ }
854
+
855
+ /**
856
+ * The resolved configuration after processing
857
+ * and validating the provided config.
858
+ *
859
+ * @public
860
+ */
861
+ export declare type ResolvedConfig = Omit<Config, "organizationId"> & {
862
+ organizationId: OrganizationId;
863
+ };
864
+
865
+ /**
866
+ * @internal
867
+ */
868
+ export declare class StudioApplication extends UserApplication<
869
+ StudioUserApplication,
870
+ "studio",
871
+ never
872
+ > {
873
+ /**
874
+ * Returns a list of studio workspaces based on the application manifest.
875
+ * If there is no manifest, or alternatively it is not valid, then we create a default workspace.
876
+ */
877
+ readonly workspaces: readonly StudioWorkspace[];
878
+ readonly project: Project<false, false>;
879
+ /**
880
+ * The projects actually referenced by this studio — the application's own
881
+ * project plus any project used by a workspace. Preserved so the instance
882
+ * can be re-constructed (e.g. by dock wrappers) without having to thread
883
+ * the full organization project list through again.
884
+ */
885
+ readonly projects: Project<false, false>[];
886
+ /**
887
+ * @param application - The studio application to create a list of workspaces for
888
+ * @param projects - The projects available in the organization. It's not enough to just pass
889
+ * the project that associates with the application because that is the project the app is deployed in relation to.
890
+ * The workspaces may have different projects completely.
891
+ */
892
+ constructor(
893
+ application: StudioUserApplication,
894
+ projects: Project<false, false>[],
895
+ );
896
+ get href(): string;
897
+ get title(): string;
898
+ get subtitle(): string;
899
+ get<TKey extends keyof StudioUserApplication>(
900
+ attr: TKey,
901
+ ): StudioUserApplication[TKey];
902
+ get hasManifest(): boolean;
903
+ get hasSchema(): boolean;
904
+ private resolveVersion;
905
+ get version(): string | null;
906
+ get compatibilityStatus(): CompatibilityStatus;
907
+ /**
908
+ * Used to calculate the compatibility status of a given studio application.
909
+ * Optionally if you've resolved the version elsewhere provide that value to
910
+ * get the new compatibility status without mutating the application.
911
+ */
912
+ static resolveCompatibilityStatus(
913
+ application: StudioApplication,
914
+ version?: string | null,
915
+ ): CompatibilityStatus;
916
+ get isAutoRedirecting(): boolean;
917
+ /**
918
+ * Mirrors the `isRedirectable` function from Saison defined in
919
+ * https://github.com/sanity-io/saison/blob/83556405d23e07f6d3a71c76249c67e33fe1101f/src/utils/applications.ts
920
+ *
921
+ * Returns whether a studio application is auto-redirecting, meaning it can only be accessed in the context of
922
+ * Dashboard.
923
+ */
924
+ static resolveIsAutoRedirecting(
925
+ application: StudioApplication,
926
+ versionArg?: string | null,
927
+ ): boolean;
928
+ /**
929
+ * Returns a list of issues that prevent the studio from functioning properly in the Dashboard.
930
+ * This static value depends on the version of the studio that comes from the `activeDeployment` property.
931
+ * As such, if the studio is auto-updating, this list will be incorrect & instead you should use
932
+ * the static method `resolveIssues` to get the correct issues by passing the resolved version.
933
+ */
934
+ get issues(): StudioIssues;
935
+ static resolveIssues(
936
+ application: StudioApplication,
937
+ version?: string | null,
938
+ ): StudioIssues;
939
+ protected isFeatureSupported(
940
+ feature: StudioDashboardIssue,
941
+ version?: string | null,
942
+ ): boolean;
943
+ toProtocolResource(): never;
944
+ static CompatibilityStatuses: {
945
+ readonly UNKNOWN: "unknown";
946
+ readonly PARTIALLY_COMPATIBLE: "partially-compatible";
947
+ readonly FULLY_COMPATIBLE: "fully-compatible";
948
+ };
949
+ static StudioIssues: {
950
+ readonly ISSUE_ACTIVITY: "ACTIVITY";
951
+ readonly ISSUE_AGENT: "AGENT";
952
+ readonly ISSUE_FAVORITES: "FAVORITES";
953
+ readonly ISSUE_URL_SYNCING: "URL_SYNCING";
954
+ readonly ISSUE_UI_ADJUSTMENT: "UI_ADJUSTMENT";
955
+ readonly ISSUE_CONTENT_MAPPING: "CONTENT_MAPPING";
956
+ readonly ISSUE_LOGIN: "LOGIN";
957
+ readonly ISSUE_MANIFEST: "MANIFEST";
958
+ };
959
+ static Features: (
960
+ | {
961
+ id: "AGENT";
962
+ version: string;
963
+ }
964
+ | {
965
+ id: "FAVORITES";
966
+ version: string;
967
+ }
968
+ | {
969
+ id: "ACTIVITY";
970
+ version: string;
971
+ }
972
+ | {
973
+ id: "URL_SYNCING";
974
+ version: string;
975
+ }
976
+ | {
977
+ id: "UI_ADJUSTMENT";
978
+ version: string;
979
+ }
980
+ | {
981
+ id: "CONTENT_MAPPING";
982
+ version: string;
983
+ }
984
+ | {
985
+ id: "LOGIN";
986
+ version: string;
987
+ }
988
+ )[];
989
+ static MinimumStudioVersion: "2.28.0";
990
+ static MinimumStudioVersionWithNoIssues: string | undefined;
991
+ }
992
+
993
+ declare type StudioDashboardIssue =
994
+ (typeof StudioApplication.StudioIssues)[keyof typeof StudioApplication.StudioIssues];
995
+
996
+ declare type StudioIssues = Array<{
997
+ id: StudioDashboardIssue;
998
+ version?: string;
999
+ }>;
1000
+
1001
+ /**
1002
+ * Studio user application schema — validates and brands API
1003
+ * responses from the `/user-applications?appType=studio`
1004
+ * endpoint. Uses a discriminated union on `urlType`.
1005
+ * @public
1006
+ */
1007
+ export declare const StudioUserApplication: z.ZodDiscriminatedUnion<
1008
+ [
1009
+ z.ZodObject<
1010
+ {
1011
+ id: z.core.$ZodBranded<z.ZodString, "UserApplicationId", "out">;
1012
+ appHost: z.ZodString;
1013
+ createdAt: z.ZodString;
1014
+ updatedAt: z.ZodString;
1015
+ dashboardStatus: z.ZodEnum<{
1016
+ default: "default";
1017
+ disabled: "disabled";
1018
+ }>;
1019
+ title: z.ZodNullable<z.ZodString>;
1020
+ projectId: z.core.$ZodBranded<z.ZodString, "ProjectId", "out">;
1021
+ type: z.ZodLiteral<"studio">;
1022
+ manifest: z.ZodNullable<
1023
+ z.ZodObject<
1024
+ {
1025
+ version: z.ZodNumber;
1026
+ createdAt: z.ZodString;
1027
+ studioVersion: z.ZodOptional<z.ZodString>;
1028
+ workspaces: z.ZodArray<
1029
+ z.ZodObject<
1030
+ {
1031
+ name: z.ZodString;
1032
+ title: z.ZodString;
1033
+ subtitle: z.ZodOptional<z.ZodString>;
1034
+ basePath: z.ZodString;
1035
+ projectId: z.core.$ZodBranded<
1036
+ z.ZodString,
1037
+ "ProjectId",
1038
+ "out"
1039
+ >;
1040
+ dataset: z.ZodOptional<z.ZodString>;
1041
+ icon: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1042
+ schema: z.ZodString;
1043
+ tools: z.ZodOptional<z.ZodString>;
1044
+ },
1045
+ z.core.$strip
1046
+ >
1047
+ >;
1048
+ },
1049
+ z.core.$strip
1050
+ >
1051
+ >;
1052
+ manifestData: z.ZodNullable<
1053
+ z.ZodObject<
1054
+ {
1055
+ value: z.ZodObject<
1056
+ {
1057
+ version: z.ZodNumber;
1058
+ createdAt: z.ZodString;
1059
+ studioVersion: z.ZodOptional<z.ZodString>;
1060
+ workspaces: z.ZodArray<
1061
+ z.ZodObject<
1062
+ {
1063
+ name: z.ZodString;
1064
+ title: z.ZodString;
1065
+ subtitle: z.ZodOptional<z.ZodString>;
1066
+ basePath: z.ZodString;
1067
+ projectId: z.core.$ZodBranded<
1068
+ z.ZodString,
1069
+ "ProjectId",
1070
+ "out"
1071
+ >;
1072
+ dataset: z.ZodOptional<z.ZodString>;
1073
+ icon: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1074
+ schema: z.ZodString;
1075
+ tools: z.ZodOptional<z.ZodString>;
1076
+ },
1077
+ z.core.$strip
1078
+ >
1079
+ >;
1080
+ },
1081
+ z.core.$strip
1082
+ >;
1083
+ },
1084
+ z.core.$strip
1085
+ >
1086
+ >;
1087
+ autoUpdatingVersion: z.ZodNullable<z.ZodString>;
1088
+ config: z.ZodObject<
1089
+ {
1090
+ "live-manifest": z.ZodOptional<
1091
+ z.ZodObject<
1092
+ {
1093
+ createdAt: z.ZodString;
1094
+ updatedAt: z.ZodString;
1095
+ updatedBy: z.ZodString;
1096
+ value: z.ZodObject<
1097
+ {
1098
+ buildId: z.ZodOptional<z.ZodString>;
1099
+ bundleVersion: z.ZodOptional<z.ZodString>;
1100
+ version: z.ZodOptional<z.ZodString>;
1101
+ workspaces: z.ZodOptional<
1102
+ z.ZodArray<
1103
+ z.ZodObject<
1104
+ {
1105
+ name: z.ZodString;
1106
+ title: z.ZodString;
1107
+ subtitle: z.ZodOptional<z.ZodString>;
1108
+ basePath: z.ZodString;
1109
+ projectId: z.core.$ZodBranded<
1110
+ z.ZodString,
1111
+ "ProjectId",
1112
+ "out"
1113
+ >;
1114
+ icon: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1115
+ dataset: z.ZodString;
1116
+ schemaDescriptorId: z.ZodString;
1117
+ },
1118
+ z.core.$strip
1119
+ >
1120
+ >
1121
+ >;
1122
+ },
1123
+ z.core.$strip
1124
+ >;
1125
+ },
1126
+ z.core.$strip
1127
+ >
1128
+ >;
1129
+ },
1130
+ z.core.$strip
1131
+ >;
1132
+ urlType: z.ZodLiteral<"internal">;
1133
+ activeDeployment: z.ZodObject<
1134
+ {
1135
+ id: z.ZodString;
1136
+ version: z.ZodString;
1137
+ isActiveDeployment: z.ZodBoolean;
1138
+ userApplicationId: z.ZodString;
1139
+ isAutoUpdating: z.ZodBoolean;
1140
+ size: z.ZodNumber;
1141
+ deployedAt: z.ZodString;
1142
+ deployedBy: z.ZodString;
1143
+ createdAt: z.ZodString;
1144
+ updatedAt: z.ZodString;
1145
+ manifest: z.ZodNullable<
1146
+ z.ZodObject<
1147
+ {
1148
+ buildId: z.ZodOptional<z.ZodString>;
1149
+ bundleVersion: z.ZodOptional<z.ZodString>;
1150
+ version: z.ZodOptional<z.ZodString>;
1151
+ workspaces: z.ZodOptional<
1152
+ z.ZodArray<
1153
+ z.ZodObject<
1154
+ {
1155
+ name: z.ZodString;
1156
+ title: z.ZodString;
1157
+ subtitle: z.ZodOptional<z.ZodString>;
1158
+ basePath: z.ZodString;
1159
+ projectId: z.core.$ZodBranded<
1160
+ z.ZodString,
1161
+ "ProjectId",
1162
+ "out"
1163
+ >;
1164
+ icon: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1165
+ dataset: z.ZodString;
1166
+ schemaDescriptorId: z.ZodString;
1167
+ },
1168
+ z.core.$strip
1169
+ >
1170
+ >
1171
+ >;
1172
+ },
1173
+ z.core.$strip
1174
+ >
1175
+ >;
1176
+ },
1177
+ z.core.$strip
1178
+ >;
1179
+ },
1180
+ z.core.$strip
1181
+ >,
1182
+ z.ZodObject<
1183
+ {
1184
+ id: z.core.$ZodBranded<z.ZodString, "UserApplicationId", "out">;
1185
+ appHost: z.ZodString;
1186
+ createdAt: z.ZodString;
1187
+ updatedAt: z.ZodString;
1188
+ dashboardStatus: z.ZodEnum<{
1189
+ default: "default";
1190
+ disabled: "disabled";
1191
+ }>;
1192
+ title: z.ZodNullable<z.ZodString>;
1193
+ projectId: z.core.$ZodBranded<z.ZodString, "ProjectId", "out">;
1194
+ type: z.ZodLiteral<"studio">;
1195
+ manifest: z.ZodNullable<
1196
+ z.ZodObject<
1197
+ {
1198
+ version: z.ZodNumber;
1199
+ createdAt: z.ZodString;
1200
+ studioVersion: z.ZodOptional<z.ZodString>;
1201
+ workspaces: z.ZodArray<
1202
+ z.ZodObject<
1203
+ {
1204
+ name: z.ZodString;
1205
+ title: z.ZodString;
1206
+ subtitle: z.ZodOptional<z.ZodString>;
1207
+ basePath: z.ZodString;
1208
+ projectId: z.core.$ZodBranded<
1209
+ z.ZodString,
1210
+ "ProjectId",
1211
+ "out"
1212
+ >;
1213
+ dataset: z.ZodOptional<z.ZodString>;
1214
+ icon: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1215
+ schema: z.ZodString;
1216
+ tools: z.ZodOptional<z.ZodString>;
1217
+ },
1218
+ z.core.$strip
1219
+ >
1220
+ >;
1221
+ },
1222
+ z.core.$strip
1223
+ >
1224
+ >;
1225
+ manifestData: z.ZodNullable<
1226
+ z.ZodObject<
1227
+ {
1228
+ value: z.ZodObject<
1229
+ {
1230
+ version: z.ZodNumber;
1231
+ createdAt: z.ZodString;
1232
+ studioVersion: z.ZodOptional<z.ZodString>;
1233
+ workspaces: z.ZodArray<
1234
+ z.ZodObject<
1235
+ {
1236
+ name: z.ZodString;
1237
+ title: z.ZodString;
1238
+ subtitle: z.ZodOptional<z.ZodString>;
1239
+ basePath: z.ZodString;
1240
+ projectId: z.core.$ZodBranded<
1241
+ z.ZodString,
1242
+ "ProjectId",
1243
+ "out"
1244
+ >;
1245
+ dataset: z.ZodOptional<z.ZodString>;
1246
+ icon: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1247
+ schema: z.ZodString;
1248
+ tools: z.ZodOptional<z.ZodString>;
1249
+ },
1250
+ z.core.$strip
1251
+ >
1252
+ >;
1253
+ },
1254
+ z.core.$strip
1255
+ >;
1256
+ },
1257
+ z.core.$strip
1258
+ >
1259
+ >;
1260
+ autoUpdatingVersion: z.ZodNullable<z.ZodString>;
1261
+ config: z.ZodObject<
1262
+ {
1263
+ "live-manifest": z.ZodOptional<
1264
+ z.ZodObject<
1265
+ {
1266
+ createdAt: z.ZodString;
1267
+ updatedAt: z.ZodString;
1268
+ updatedBy: z.ZodString;
1269
+ value: z.ZodObject<
1270
+ {
1271
+ buildId: z.ZodOptional<z.ZodString>;
1272
+ bundleVersion: z.ZodOptional<z.ZodString>;
1273
+ version: z.ZodOptional<z.ZodString>;
1274
+ workspaces: z.ZodOptional<
1275
+ z.ZodArray<
1276
+ z.ZodObject<
1277
+ {
1278
+ name: z.ZodString;
1279
+ title: z.ZodString;
1280
+ subtitle: z.ZodOptional<z.ZodString>;
1281
+ basePath: z.ZodString;
1282
+ projectId: z.core.$ZodBranded<
1283
+ z.ZodString,
1284
+ "ProjectId",
1285
+ "out"
1286
+ >;
1287
+ icon: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1288
+ dataset: z.ZodString;
1289
+ schemaDescriptorId: z.ZodString;
1290
+ },
1291
+ z.core.$strip
1292
+ >
1293
+ >
1294
+ >;
1295
+ },
1296
+ z.core.$strip
1297
+ >;
1298
+ },
1299
+ z.core.$strip
1300
+ >
1301
+ >;
1302
+ },
1303
+ z.core.$strip
1304
+ >;
1305
+ urlType: z.ZodLiteral<"external">;
1306
+ activeDeployment: z.ZodNull;
1307
+ },
1308
+ z.core.$strip
1309
+ >,
1310
+ ],
1311
+ "urlType"
1312
+ >;
1313
+
1314
+ /**
1315
+ * @public
1316
+ */
1317
+ export declare type StudioUserApplication = z.output<
1318
+ typeof StudioUserApplication
1319
+ >;
1320
+
1321
+ /**
1322
+ * @internal
1323
+ */
1324
+ export declare class StudioWorkspace extends AbstractApplication<
1325
+ "workspace",
1326
+ StudioResource
1327
+ > {
1328
+ /**
1329
+ * Workspaces always belong to a studio application.
1330
+ * They do not exist on their own & therefore can access
1331
+ * information about the studio they're in via this property.
1332
+ */
1333
+ private readonly studioApplication;
1334
+ private readonly workspace;
1335
+ readonly project: Project<false, false>;
1336
+ private readonly isDefaultWorkspace;
1337
+ constructor(
1338
+ studioApplication: StudioApplication,
1339
+ workspace: Workspace,
1340
+ project: Project<false, false>,
1341
+ isDefaultWorkspace: boolean,
1342
+ );
1343
+ /**
1344
+ * The studio application that this workspace belongs to.
1345
+ */
1346
+ get studio(): StudioApplication;
1347
+ get id(): string;
1348
+ get href(): string;
1349
+ get title(): string;
1350
+ get subtitle(): string | undefined;
1351
+ get<TKey extends Exclude<keyof Workspace, "id" | "icon" | "title">>(
1352
+ attr: TKey,
1353
+ ): Workspace[TKey];
1354
+ /**
1355
+ * With comlink, studio-applications were not considered applications at all, only workspaces. This is partially why
1356
+ * we create default workspaces when the application has no manifest or the manifest has no workspaces.
1357
+ *
1358
+ * Thereby, to create it we depend on a lot of information from the parent application even if it's duplicated across
1359
+ * different workspaces.
1360
+ */
1361
+ toProtocolResource(): StudioResource;
1362
+ /**
1363
+ * @returns the URL to the workspace of a studio application.
1364
+ */
1365
+ get url(): URL;
1366
+ static makeId(
1367
+ applicationId: UserApplicationId,
1368
+ workspaceName: string,
1369
+ ): string;
1370
+ static splitId(id: string): [string, string];
1371
+ }
1372
+
1373
+ /**
1374
+ * @internal
1375
+ */
1376
+ export declare abstract class UserApplication<
1377
+ TUserApplication extends UserApplicationBase,
1378
+ TType extends Extract<AbstractApplicationType, "coreApp" | "studio">,
1379
+ TProtocolResource extends Resource = Extract<
1380
+ Resource,
1381
+ {
1382
+ type: TType;
1383
+ }
1384
+ >,
1385
+ > extends AbstractApplication<TType, TProtocolResource> {
1386
+ readonly application: TUserApplication;
1387
+ readonly id: UserApplicationId;
1388
+ constructor(application: TUserApplication, type: TType);
1389
+ abstract get subtitle(): string | undefined;
1390
+ /**
1391
+ * @returns A fully resolved URL instance for the application.
1392
+ * For internal applications, constructs a URL using the Sanity studio domain
1393
+ * pattern resolved from the environment at the consuming app's build time.
1394
+ * For external applications, returns the provided app host as a URL.
1395
+ */
1396
+ get url(): URL;
1397
+ }
1398
+
1399
+ /**
1400
+ * @public
1401
+ */
1402
+ export declare const UserApplicationBase: z.ZodObject<
1403
+ {
1404
+ id: z.core.$ZodBranded<z.ZodString, "UserApplicationId", "out">;
1405
+ appHost: z.ZodString;
1406
+ urlType: z.ZodEnum<{
1407
+ internal: "internal";
1408
+ external: "external";
1409
+ }>;
1410
+ createdAt: z.ZodString;
1411
+ updatedAt: z.ZodString;
1412
+ dashboardStatus: z.ZodEnum<{
1413
+ default: "default";
1414
+ disabled: "disabled";
1415
+ }>;
1416
+ },
1417
+ z.core.$strip
1418
+ >;
1419
+
1420
+ /**
1421
+ * @public
1422
+ */
1423
+ export declare type UserApplicationBase = z.output<typeof UserApplicationBase>;
1424
+
1425
+ /**
1426
+ * User application ID schema, branded for type safety.
1427
+ * @public
1428
+ */
1429
+ export declare const UserApplicationId: z.core.$ZodBranded<
1430
+ z.ZodString,
1431
+ "UserApplicationId",
1432
+ "out"
1433
+ >;
1434
+
1435
+ /**
1436
+ * User application ID type, branded for type safety.
1437
+ * @public
1438
+ */
1439
+ export declare type UserApplicationId = z.output<typeof UserApplicationId>;
1440
+
1441
+ /**
1442
+ * @public
1443
+ */
1444
+ export declare type Workspace = z.output<typeof Workspace_2>;
1445
+
1446
+ declare const Workspace_2: z.ZodObject<
1447
+ {
1448
+ name: z.ZodString;
1449
+ title: z.ZodString;
1450
+ subtitle: z.ZodOptional<z.ZodString>;
1451
+ basePath: z.ZodString;
1452
+ projectId: z.core.$ZodBranded<z.ZodString, "ProjectId", "out">;
1453
+ dataset: z.ZodOptional<z.ZodString>;
1454
+ icon: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1455
+ },
1456
+ z.core.$strip
1457
+ >;
1458
+
1459
+ /**
1460
+ * @public
1461
+ */
1462
+ declare type Workspace = z.output<typeof Workspace_2>;
1463
+
1464
+ export {};