@collective-intelligence/extensions-sdk-frontend-react 0.1.8 → 0.1.10

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.
@@ -0,0 +1,492 @@
1
+ export type ClientOptions = {
2
+ baseUrl: `${string}://${string}` | (string & {});
3
+ };
4
+ export type EntityValueDiagnosticEncoded = {
5
+ _tag: "EntityValueDiagnostic";
6
+ code: "entity_value_invalid";
7
+ field: string;
8
+ issues: Array<{
9
+ field: string;
10
+ keyword: string;
11
+ message: string;
12
+ path: string;
13
+ }>;
14
+ message: string;
15
+ };
16
+ export type EntityFileFieldDiagnosticEncoded = {
17
+ _tag: "EntityFileFieldDiagnostic";
18
+ code: "file_field_invalid" | "file_too_large";
19
+ field: string;
20
+ message: string;
21
+ reason: "invalid_form" | "unknown_attachment" | "invalid_upload" | "upload_consumed" | "type_not_accepted" | "file_too_large" | "unknown_stored_file";
22
+ };
23
+ export type EntityRelationFieldDiagnosticEncoded = {
24
+ _tag: "EntityRelationFieldDiagnostic";
25
+ code: "relation_field_invalid";
26
+ field: string;
27
+ message: string;
28
+ reason: "invalid_value" | "duplicate_target" | "max_items_exceeded" | "target_not_found" | "wrong_target_schema" | "target_deleted" | "base_filter_mismatch";
29
+ };
30
+ export type EntityUniqueFieldConflictDiagnosticEncoded = {
31
+ _tag: "EntityUniqueFieldConflictDiagnostic";
32
+ code: "unique_field_conflict";
33
+ fields: Array<string>;
34
+ message: string;
35
+ };
36
+ export type EntityFileFieldConflictDiagnosticEncoded = {
37
+ _tag: "EntityFileFieldConflictDiagnostic";
38
+ code: "file_field_connector_owned";
39
+ message: string;
40
+ };
41
+ export type Suspend2 = null | boolean | number | string | Array<Suspend2> | {
42
+ [key: string]: Suspend2;
43
+ };
44
+ export type InvalidIncludePathEncoded = {
45
+ _tag: "InvalidIncludePath";
46
+ message: string;
47
+ path: string;
48
+ reason: "malformed" | "too_deep" | "unknown_field";
49
+ };
50
+ export type EffectHttpApiErrorBadRequestEncoded = {
51
+ _tag: "BadRequest";
52
+ };
53
+ export type EffectHttpApiErrorUnauthorizedEncoded = {
54
+ _tag: "Unauthorized";
55
+ };
56
+ export type EffectHttpApiErrorForbiddenEncoded = {
57
+ _tag: "Forbidden";
58
+ };
59
+ export type EffectHttpApiErrorNotFoundEncoded = {
60
+ _tag: "NotFound";
61
+ };
62
+ export type EffectHttpApiErrorInternalServerErrorEncoded = {
63
+ _tag: "InternalServerError";
64
+ };
65
+ export type StudioAgentRunsListData = {
66
+ body?: never;
67
+ headers: {
68
+ authorization?: string;
69
+ "x-organization-id": string;
70
+ };
71
+ path?: never;
72
+ query: {
73
+ appId: string;
74
+ pageId: string;
75
+ publishedRevisionId: string;
76
+ viewId: string;
77
+ agent?: string;
78
+ limit?: string;
79
+ page?: string;
80
+ };
81
+ url: "/studio/agent-runs";
82
+ };
83
+ export type StudioAgentRunsListErrors = {
84
+ /**
85
+ * BadRequest
86
+ */
87
+ 400: EffectHttpApiErrorBadRequestEncoded;
88
+ /**
89
+ * Unauthorized
90
+ */
91
+ 401: EffectHttpApiErrorUnauthorizedEncoded;
92
+ /**
93
+ * Forbidden
94
+ */
95
+ 403: EffectHttpApiErrorForbiddenEncoded;
96
+ /**
97
+ * InternalServerError
98
+ */
99
+ 500: EffectHttpApiErrorInternalServerErrorEncoded;
100
+ };
101
+ export type StudioAgentRunsListError = StudioAgentRunsListErrors[keyof StudioAgentRunsListErrors];
102
+ export type StudioAgentRunsListResponses = {
103
+ /**
104
+ * Success
105
+ */
106
+ 200: {
107
+ canManage: boolean;
108
+ data: Array<{
109
+ agentId: string;
110
+ agentName: string;
111
+ completedAt: string | null;
112
+ createdAt: string;
113
+ errorCode: string | null;
114
+ id: string;
115
+ initiator: {
116
+ kind: "user";
117
+ name: string | null;
118
+ } | null;
119
+ source: string;
120
+ startedAt: string | null;
121
+ status: string;
122
+ }>;
123
+ paging: {
124
+ page: number;
125
+ pageSize: number;
126
+ totalItems: number;
127
+ totalPages: number;
128
+ };
129
+ };
130
+ };
131
+ export type StudioAgentRunsListResponse = StudioAgentRunsListResponses[keyof StudioAgentRunsListResponses];
132
+ export type StudioAgentRunsGetData = {
133
+ body?: never;
134
+ headers: {
135
+ authorization?: string;
136
+ "x-organization-id": string;
137
+ };
138
+ path: {
139
+ runId: string;
140
+ };
141
+ query: {
142
+ appId: string;
143
+ pageId: string;
144
+ publishedRevisionId: string;
145
+ viewId: string;
146
+ };
147
+ url: "/studio/agent-runs/{runId}";
148
+ };
149
+ export type StudioAgentRunsGetErrors = {
150
+ /**
151
+ * BadRequest
152
+ */
153
+ 400: EffectHttpApiErrorBadRequestEncoded;
154
+ /**
155
+ * Unauthorized
156
+ */
157
+ 401: EffectHttpApiErrorUnauthorizedEncoded;
158
+ /**
159
+ * Forbidden
160
+ */
161
+ 403: EffectHttpApiErrorForbiddenEncoded;
162
+ /**
163
+ * NotFound
164
+ */
165
+ 404: EffectHttpApiErrorNotFoundEncoded;
166
+ /**
167
+ * InternalServerError
168
+ */
169
+ 500: EffectHttpApiErrorInternalServerErrorEncoded;
170
+ };
171
+ export type StudioAgentRunsGetError = StudioAgentRunsGetErrors[keyof StudioAgentRunsGetErrors];
172
+ export type StudioAgentRunsGetResponses = {
173
+ /**
174
+ * Success
175
+ */
176
+ 200: {
177
+ agentId: string;
178
+ agentName: string;
179
+ completedAt: string | null;
180
+ createdAt: string;
181
+ errorCode: string | null;
182
+ id: string;
183
+ initiator: {
184
+ kind: "user";
185
+ name: string | null;
186
+ } | null;
187
+ source: string;
188
+ startedAt: string | null;
189
+ status: string;
190
+ };
191
+ };
192
+ export type StudioAgentRunsGetResponse = StudioAgentRunsGetResponses[keyof StudioAgentRunsGetResponses];
193
+ export type StudioViewDataSearchData = {
194
+ body: {
195
+ cursor?: string | null;
196
+ filters?: Array<{
197
+ caseSensitive?: boolean;
198
+ field: string;
199
+ operator: "eq" | "ne" | "in" | "nin" | "contains" | "not_contains" | "starts_with" | "ends_with" | "gt" | "gte" | "lt" | "lte" | "exists" | "is_empty" | "is_not_empty";
200
+ value: Suspend2 | Array<Suspend2>;
201
+ }>;
202
+ include?: Array<string>;
203
+ limit?: number;
204
+ sort?: Array<{
205
+ direction: "asc" | "desc";
206
+ field: string;
207
+ }>;
208
+ text?: string;
209
+ };
210
+ headers: {
211
+ authorization?: string;
212
+ "x-organization-id": string;
213
+ };
214
+ path: {
215
+ slug: string;
216
+ viewId: string;
217
+ };
218
+ query?: never;
219
+ url: "/studio/apps/by-slug/{slug}/views/{viewId}/data/search";
220
+ };
221
+ export type StudioViewDataSearchErrors = {
222
+ /**
223
+ * InvalidIncludePath | BadRequest
224
+ */
225
+ 400: InvalidIncludePathEncoded | EffectHttpApiErrorBadRequestEncoded;
226
+ /**
227
+ * Unauthorized
228
+ */
229
+ 401: EffectHttpApiErrorUnauthorizedEncoded;
230
+ /**
231
+ * Forbidden
232
+ */
233
+ 403: EffectHttpApiErrorForbiddenEncoded;
234
+ /**
235
+ * NotFound
236
+ */
237
+ 404: EffectHttpApiErrorNotFoundEncoded;
238
+ /**
239
+ * InternalServerError
240
+ */
241
+ 500: EffectHttpApiErrorInternalServerErrorEncoded;
242
+ };
243
+ export type StudioViewDataSearchError = StudioViewDataSearchErrors[keyof StudioViewDataSearchErrors];
244
+ export type StudioViewDataSearchResponses = {
245
+ /**
246
+ * Success
247
+ */
248
+ 200: unknown;
249
+ };
250
+ export type StudioViewDataGetItemData = {
251
+ body?: never;
252
+ headers: {
253
+ authorization?: string;
254
+ "x-organization-id": string;
255
+ };
256
+ path: {
257
+ slug: string;
258
+ viewId: string;
259
+ instanceId: string;
260
+ };
261
+ query?: {
262
+ include?: string;
263
+ };
264
+ url: "/studio/apps/by-slug/{slug}/views/{viewId}/data/{instanceId}";
265
+ };
266
+ export type StudioViewDataGetItemErrors = {
267
+ /**
268
+ * InvalidIncludePath | BadRequest
269
+ */
270
+ 400: InvalidIncludePathEncoded | EffectHttpApiErrorBadRequestEncoded;
271
+ /**
272
+ * Unauthorized
273
+ */
274
+ 401: EffectHttpApiErrorUnauthorizedEncoded;
275
+ /**
276
+ * Forbidden
277
+ */
278
+ 403: EffectHttpApiErrorForbiddenEncoded;
279
+ /**
280
+ * NotFound
281
+ */
282
+ 404: EffectHttpApiErrorNotFoundEncoded;
283
+ /**
284
+ * InternalServerError
285
+ */
286
+ 500: EffectHttpApiErrorInternalServerErrorEncoded;
287
+ };
288
+ export type StudioViewDataGetItemError = StudioViewDataGetItemErrors[keyof StudioViewDataGetItemErrors];
289
+ export type StudioViewDataGetItemResponses = {
290
+ /**
291
+ * Success
292
+ */
293
+ 200: unknown;
294
+ };
295
+ export type StudioViewDataUpdateItemData = {
296
+ body: {
297
+ data?: {
298
+ [key: string]: unknown;
299
+ } | null;
300
+ description?: string | null;
301
+ name?: string | null;
302
+ };
303
+ headers: {
304
+ authorization?: string;
305
+ "x-organization-id": string;
306
+ "x-idempotency-key"?: string;
307
+ };
308
+ path: {
309
+ slug: string;
310
+ viewId: string;
311
+ instanceId: string;
312
+ };
313
+ query?: never;
314
+ url: "/studio/apps/by-slug/{slug}/views/{viewId}/data/{instanceId}";
315
+ };
316
+ export type StudioViewDataUpdateItemErrors = {
317
+ /**
318
+ * EntityValueDiagnostic | EntityFileFieldDiagnostic | EntityRelationFieldDiagnostic | BadRequest
319
+ */
320
+ 400: EntityValueDiagnosticEncoded | EntityFileFieldDiagnosticEncoded | EntityRelationFieldDiagnosticEncoded | EffectHttpApiErrorBadRequestEncoded;
321
+ /**
322
+ * Unauthorized
323
+ */
324
+ 401: EffectHttpApiErrorUnauthorizedEncoded;
325
+ /**
326
+ * Forbidden
327
+ */
328
+ 403: EffectHttpApiErrorForbiddenEncoded;
329
+ /**
330
+ * NotFound
331
+ */
332
+ 404: EffectHttpApiErrorNotFoundEncoded;
333
+ /**
334
+ * EntityUniqueFieldConflictDiagnostic | EntityFileFieldConflictDiagnostic
335
+ */
336
+ 409: EntityUniqueFieldConflictDiagnosticEncoded | EntityFileFieldConflictDiagnosticEncoded;
337
+ /**
338
+ * InternalServerError
339
+ */
340
+ 500: EffectHttpApiErrorInternalServerErrorEncoded;
341
+ };
342
+ export type StudioViewDataUpdateItemError = StudioViewDataUpdateItemErrors[keyof StudioViewDataUpdateItemErrors];
343
+ export type StudioViewDataUpdateItemResponses = {
344
+ /**
345
+ * Success
346
+ */
347
+ 200: {
348
+ data: unknown;
349
+ };
350
+ };
351
+ export type StudioViewDataUpdateItemResponse = StudioViewDataUpdateItemResponses[keyof StudioViewDataUpdateItemResponses];
352
+ export type StudioWorkflowRunsListData = {
353
+ body?: never;
354
+ headers: {
355
+ authorization?: string;
356
+ "x-organization-id": string;
357
+ };
358
+ path?: never;
359
+ query: {
360
+ appId: string;
361
+ pageId: string;
362
+ publishedRevisionId: string;
363
+ viewId: string;
364
+ limit?: string;
365
+ page?: string;
366
+ workflow?: string;
367
+ };
368
+ url: "/studio/workflow-runs";
369
+ };
370
+ export type StudioWorkflowRunsListErrors = {
371
+ /**
372
+ * BadRequest
373
+ */
374
+ 400: EffectHttpApiErrorBadRequestEncoded;
375
+ /**
376
+ * Unauthorized
377
+ */
378
+ 401: EffectHttpApiErrorUnauthorizedEncoded;
379
+ /**
380
+ * Forbidden
381
+ */
382
+ 403: EffectHttpApiErrorForbiddenEncoded;
383
+ /**
384
+ * InternalServerError
385
+ */
386
+ 500: EffectHttpApiErrorInternalServerErrorEncoded;
387
+ };
388
+ export type StudioWorkflowRunsListError = StudioWorkflowRunsListErrors[keyof StudioWorkflowRunsListErrors];
389
+ export type StudioWorkflowRunsListResponses = {
390
+ /**
391
+ * Success
392
+ */
393
+ 200: {
394
+ canManage: boolean;
395
+ data: Array<{
396
+ completedAt: string | null;
397
+ createdAt: string;
398
+ errorCode: string | null;
399
+ id: string;
400
+ initiator: {
401
+ kind: "user";
402
+ name: string | null;
403
+ } | {
404
+ kind: "application";
405
+ name: string;
406
+ } | null;
407
+ startedAt: string | null;
408
+ status: string;
409
+ triggerType: string;
410
+ workflowId: string;
411
+ workflowName: string;
412
+ }>;
413
+ paging: {
414
+ page: number;
415
+ pageSize: number;
416
+ totalItems: number;
417
+ totalPages: number;
418
+ };
419
+ };
420
+ };
421
+ export type StudioWorkflowRunsListResponse = StudioWorkflowRunsListResponses[keyof StudioWorkflowRunsListResponses];
422
+ export type StudioWorkflowRunsGetData = {
423
+ body?: never;
424
+ headers: {
425
+ authorization?: string;
426
+ "x-organization-id": string;
427
+ };
428
+ path: {
429
+ runId: string;
430
+ };
431
+ query: {
432
+ appId: string;
433
+ pageId: string;
434
+ publishedRevisionId: string;
435
+ viewId: string;
436
+ };
437
+ url: "/studio/workflow-runs/{runId}";
438
+ };
439
+ export type StudioWorkflowRunsGetErrors = {
440
+ /**
441
+ * BadRequest
442
+ */
443
+ 400: EffectHttpApiErrorBadRequestEncoded;
444
+ /**
445
+ * Unauthorized
446
+ */
447
+ 401: EffectHttpApiErrorUnauthorizedEncoded;
448
+ /**
449
+ * Forbidden
450
+ */
451
+ 403: EffectHttpApiErrorForbiddenEncoded;
452
+ /**
453
+ * NotFound
454
+ */
455
+ 404: EffectHttpApiErrorNotFoundEncoded;
456
+ /**
457
+ * InternalServerError
458
+ */
459
+ 500: EffectHttpApiErrorInternalServerErrorEncoded;
460
+ };
461
+ export type StudioWorkflowRunsGetError = StudioWorkflowRunsGetErrors[keyof StudioWorkflowRunsGetErrors];
462
+ export type StudioWorkflowRunsGetResponses = {
463
+ /**
464
+ * Success
465
+ */
466
+ 200: {
467
+ completedAt: string | null;
468
+ createdAt: string;
469
+ errorCode: string | null;
470
+ id: string;
471
+ initiator: {
472
+ kind: "user";
473
+ name: string | null;
474
+ } | {
475
+ kind: "application";
476
+ name: string;
477
+ } | null;
478
+ startedAt: string | null;
479
+ status: string;
480
+ triggerType: string;
481
+ workflowId: string;
482
+ workflowName: string;
483
+ steps: Array<{
484
+ attempt: number;
485
+ completedAt: string | null;
486
+ nodeId: string;
487
+ startedAt: string | null;
488
+ status: string;
489
+ }>;
490
+ };
491
+ };
492
+ export type StudioWorkflowRunsGetResponse = StudioWorkflowRunsGetResponses[keyof StudioWorkflowRunsGetResponses];
@@ -3,37 +3,6 @@ export type LocalizedStudioText = Readonly<{
3
3
  fallbackLocale: string;
4
4
  values: Readonly<Record<string, string>>;
5
5
  }>;
6
- export type StudioAppPageDefinition = Readonly<{
7
- fullWidth?: boolean;
8
- icon?: string;
9
- kind: "predefined";
10
- label: string;
11
- orderIndex: number;
12
- predefinedPageRef: string;
13
- routeSegment: string;
14
- slug: string;
15
- }>;
16
- export type StudioAppSectionDefinition = Readonly<{
17
- description?: string;
18
- icon?: string;
19
- label: string;
20
- orderIndex: number;
21
- pages: readonly StudioAppPageDefinition[];
22
- slug: string;
23
- }>;
24
- export type StudioAppDefinition = Readonly<{
25
- color?: string;
26
- description?: string;
27
- icon?: string;
28
- isDefaultTemplate?: boolean;
29
- name: string;
30
- sections: readonly StudioAppSectionDefinition[];
31
- slug: string;
32
- }>;
33
- export type StudioAppDeclaration = ComponentManifest & ComponentPresentation & Readonly<{
34
- definition: StudioAppDefinition;
35
- kind: "studioApp";
36
- }>;
37
6
  export type StudioComponentComposition = Readonly<{
38
7
  extensions?: JsonObject;
39
8
  slotSource: "props" | "static";
@@ -50,13 +19,6 @@ export type StudioComponentDeclaration = ComponentManifest & ComponentPresentati
50
19
  propsSchema: PackageSchemaProjection;
51
20
  sourceRef: string;
52
21
  }>;
53
- export type StudioAppDeclarationInput = Readonly<{
54
- definition: Readonly<{
55
- definition: StudioAppDefinition;
56
- }>;
57
- manifest: ComponentManifest;
58
- presentation: ComponentPresentation;
59
- }>;
60
22
  export type StudioComponentDeclarationInput<Schema extends PackageDecoderSource = PackageDecoderSource> = Readonly<{
61
23
  definition: Readonly<{
62
24
  category: StudioComponentDeclaration["category"];
@@ -67,5 +29,4 @@ export type StudioComponentDeclarationInput<Schema extends PackageDecoderSource
67
29
  manifest: ComponentManifest;
68
30
  presentation: ComponentPresentation;
69
31
  }>;
70
- export declare const declareStudioApp: (input: StudioAppDeclarationInput) => DeclaredComponent<StudioAppDeclaration>;
71
32
  export declare const declareStudioComponent: (input: StudioComponentDeclarationInput) => DeclaredComponent<StudioComponentDeclaration>;
@@ -0,0 +1,45 @@
1
+ /**
2
+ * The Studio Host's scope of one placed view. View, page, and revision ids
3
+ * are generated when an app is installed or published, so a Widget reads
4
+ * them here instead of declaring them.
5
+ */
6
+ export type StudioViewContext = Readonly<{
7
+ appId: string;
8
+ appSlug: string;
9
+ organizationId: string;
10
+ pageId: string;
11
+ publishedRevisionId: string;
12
+ viewId: string;
13
+ }>;
14
+ /**
15
+ * Props the Studio Host gives every placed view and Widget component, next to
16
+ * its configured props. `context` is `null` when the view has no published
17
+ * scope: in the builder preview, or before the app has a published revision.
18
+ */
19
+ export type StudioViewComponentProps = Readonly<{
20
+ context: StudioViewContext | null;
21
+ }>;
22
+ /** Generated `studio-api` options for the view-data operations of a view. */
23
+ export type StudioViewScope = Readonly<{
24
+ headers: Readonly<{
25
+ "x-organization-id": string;
26
+ }>;
27
+ path: Readonly<{
28
+ slug: string;
29
+ viewId: string;
30
+ }>;
31
+ }>;
32
+ /** Generated `studio-api` options for operations on a published view. */
33
+ export type StudioPublishedViewScope = Readonly<{
34
+ headers: Readonly<{
35
+ "x-organization-id": string;
36
+ }>;
37
+ query: Readonly<{
38
+ appId: string;
39
+ pageId: string;
40
+ publishedRevisionId: string;
41
+ viewId: string;
42
+ }>;
43
+ }>;
44
+ export declare const studioViewScope: (context: StudioViewContext) => StudioViewScope;
45
+ export declare const studioPublishedViewScope: (context: StudioViewContext) => StudioPublishedViewScope;
package/dist/studio.d.ts CHANGED
@@ -1,5 +1,23 @@
1
- import { declareStudioApp as declareStudioAppImplementation, declareStudioComponent as declareStudioComponentImplementation } from "./studio-declarations.js";
2
- export declare const declareStudioApp: typeof declareStudioAppImplementation;
1
+ import { declareStudioComponent as declareStudioComponentImplementation } from "./studio-declarations.js";
2
+ import { studioPublishedViewScope as studioPublishedViewScopeImplementation, studioViewScope as studioViewScopeImplementation } from "./studio-view-context.js";
3
+ export declare const declareStudioApp: (input: import("@collective-intelligence/extensions-sdk").StudioAppDeclarationInput) => import("@collective-intelligence/extensions-sdk").DeclaredComponent<import("@collective-intelligence/extensions-sdk").StudioAppDeclaration>;
4
+ export declare const declareStudioAppTemplate: (input: Readonly<{
5
+ definition: Omit<import("@collective-intelligence/extensions-sdk").StudioAppTemplateDeclaration, "description" | "displayName" | "fqn" | "icon" | "kind" | "tags" | "version">;
6
+ manifest: Readonly<{
7
+ fqn: string;
8
+ version: string;
9
+ }>;
10
+ presentation: Readonly<{
11
+ description?: string;
12
+ displayName: string;
13
+ icon?: string;
14
+ tags?: readonly string[];
15
+ }>;
16
+ }>) => import("@collective-intelligence/extensions-sdk").DeclaredComponent<import("@collective-intelligence/extensions-sdk").StudioAppTemplateDeclaration>;
3
17
  export declare const declareStudioComponent: typeof declareStudioComponentImplementation;
18
+ export declare const studioPublishedViewScope: typeof studioPublishedViewScopeImplementation;
19
+ export declare const studioViewScope: typeof studioViewScopeImplementation;
4
20
  export type { HostedContributionErrorBoundaryProps, HostedContributionLoadFailure, HostedContributionLoadState, HostedContributionUnavailableProps } from "./load-state.js";
5
- export type { LocalizedStudioText, StudioAppDeclaration, StudioAppDeclarationInput, StudioAppDefinition, StudioAppPageDefinition, StudioAppSectionDefinition, StudioComponentComposition, StudioComponentDeclaration, StudioComponentDeclarationInput } from "./studio-declarations.js";
21
+ export type { StudioAppDeclaration, StudioAppDeclarationInput, StudioAppDefinition, StudioAppPageDefinition, StudioAppSectionDefinition, StudioAppTemplateDeclaration, StudioAppTemplateDefinition, StudioAppTemplatePageDefinition, StudioAppTemplateSectionDefinition } from "@collective-intelligence/extensions-sdk";
22
+ export type { LocalizedStudioText, StudioComponentComposition, StudioComponentDeclaration, StudioComponentDeclarationInput } from "./studio-declarations.js";
23
+ export type { StudioPublishedViewScope, StudioViewComponentProps, StudioViewContext, StudioViewScope } from "./studio-view-context.js";
package/dist/studio.js CHANGED
@@ -1 +1 @@
1
- import{assertConsumerProfile as s,canonicalJson as d,normalizePackageSchemaProjection as c}from"@collective-intelligence/extensions-sdk";var a=(o)=>{try{d(o)}catch(e){let t=e instanceof Error?e.message:String(e);throw TypeError(`Studio declaration must be serializable JSON: ${t}`,{cause:e})}},r=(o)=>{let e={...o.definition,...o.presentation,...o.manifest,kind:"studioApp"};return a(e),{manifest:e,schemaSidecars:[]}},p=(o)=>{let e=o.definition.propsSchema,t=`studio_component:${o.manifest.fqn}.propsSchema`,n=c(e.project("input"));s(n,"studio_props",t);let i={category:o.definition.category,...o.definition.composition===void 0?void 0:{composition:o.definition.composition},...o.presentation,...o.manifest,kind:"studioComponent",propsSchema:n,sourceRef:o.definition.sourceRef};return a(i),{manifest:i,schemaSidecars:[{direction:"input",location:t,profile:"studio_props",source:e}]}};var f=r,g=p;export{f as declareStudioApp,g as declareStudioComponent};
1
+ import{declareStudioApp as l,declareStudioAppTemplate as m}from"@collective-intelligence/extensions-sdk";import{assertConsumerProfile as r,canonicalJson as s,normalizePackageSchemaProjection as c}from"@collective-intelligence/extensions-sdk";var u=(e)=>{try{s(e)}catch(o){let t=o instanceof Error?o.message:String(o);throw TypeError(`Studio declaration must be serializable JSON: ${t}`,{cause:o})}},a=(e)=>{let o=e.definition.propsSchema,t=`studio_component:${e.manifest.fqn}.propsSchema`,i=c(o.project("input"));r(i,"studio_props",t);let n={category:e.definition.category,...e.definition.composition===void 0?void 0:{composition:e.definition.composition},...e.presentation,...e.manifest,kind:"studioComponent",propsSchema:i,sourceRef:e.definition.sourceRef};return u(n),{manifest:n,schemaSidecars:[{direction:"input",location:t,profile:"studio_props",source:o}]}};var p=(e)=>({headers:{"x-organization-id":e.organizationId},path:{slug:e.appSlug,viewId:e.viewId}}),d=(e)=>({headers:{"x-organization-id":e.organizationId},query:{appId:e.appId,pageId:e.pageId,publishedRevisionId:e.publishedRevisionId,viewId:e.viewId}});var h=l,I=m,P=a,R=d,b=p;export{h as declareStudioApp,I as declareStudioAppTemplate,P as declareStudioComponent,R as studioPublishedViewScope,b as studioViewScope};