@collective-intelligence/extensions-sdk-frontend-react 0.1.7 → 0.1.9

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,476 @@
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 EntityUniqueFieldConflictDiagnosticEncoded = {
24
+ _tag: "EntityUniqueFieldConflictDiagnostic";
25
+ code: "unique_field_conflict";
26
+ fields: Array<string>;
27
+ message: string;
28
+ };
29
+ export type EntityFileFieldConflictDiagnosticEncoded = {
30
+ _tag: "EntityFileFieldConflictDiagnostic";
31
+ code: "file_field_connector_owned";
32
+ message: string;
33
+ };
34
+ export type Suspend1 = null | boolean | number | string | Array<Suspend1> | {
35
+ [key: string]: Suspend1;
36
+ };
37
+ export type EffectHttpApiErrorBadRequestEncoded = {
38
+ _tag: "BadRequest";
39
+ };
40
+ export type EffectHttpApiErrorUnauthorizedEncoded = {
41
+ _tag: "Unauthorized";
42
+ };
43
+ export type EffectHttpApiErrorForbiddenEncoded = {
44
+ _tag: "Forbidden";
45
+ };
46
+ export type EffectHttpApiErrorNotFoundEncoded = {
47
+ _tag: "NotFound";
48
+ };
49
+ export type EffectHttpApiErrorInternalServerErrorEncoded = {
50
+ _tag: "InternalServerError";
51
+ };
52
+ export type StudioAgentRunsListData = {
53
+ body?: never;
54
+ headers: {
55
+ authorization?: string;
56
+ "x-organization-id": string;
57
+ };
58
+ path?: never;
59
+ query: {
60
+ appId: string;
61
+ pageId: string;
62
+ publishedRevisionId: string;
63
+ viewId: string;
64
+ agent?: string;
65
+ limit?: string;
66
+ page?: string;
67
+ };
68
+ url: "/studio/agent-runs";
69
+ };
70
+ export type StudioAgentRunsListErrors = {
71
+ /**
72
+ * BadRequest
73
+ */
74
+ 400: EffectHttpApiErrorBadRequestEncoded;
75
+ /**
76
+ * Unauthorized
77
+ */
78
+ 401: EffectHttpApiErrorUnauthorizedEncoded;
79
+ /**
80
+ * Forbidden
81
+ */
82
+ 403: EffectHttpApiErrorForbiddenEncoded;
83
+ /**
84
+ * InternalServerError
85
+ */
86
+ 500: EffectHttpApiErrorInternalServerErrorEncoded;
87
+ };
88
+ export type StudioAgentRunsListError = StudioAgentRunsListErrors[keyof StudioAgentRunsListErrors];
89
+ export type StudioAgentRunsListResponses = {
90
+ /**
91
+ * Success
92
+ */
93
+ 200: {
94
+ canManage: boolean;
95
+ data: Array<{
96
+ agentId: string;
97
+ agentName: string;
98
+ completedAt: string | null;
99
+ createdAt: string;
100
+ errorCode: string | null;
101
+ id: string;
102
+ initiator: {
103
+ kind: "user";
104
+ name: string | null;
105
+ } | null;
106
+ source: string;
107
+ startedAt: string | null;
108
+ status: string;
109
+ }>;
110
+ paging: {
111
+ page: number;
112
+ pageSize: number;
113
+ totalItems: number;
114
+ totalPages: number;
115
+ };
116
+ };
117
+ };
118
+ export type StudioAgentRunsListResponse = StudioAgentRunsListResponses[keyof StudioAgentRunsListResponses];
119
+ export type StudioAgentRunsGetData = {
120
+ body?: never;
121
+ headers: {
122
+ authorization?: string;
123
+ "x-organization-id": string;
124
+ };
125
+ path: {
126
+ runId: string;
127
+ };
128
+ query: {
129
+ appId: string;
130
+ pageId: string;
131
+ publishedRevisionId: string;
132
+ viewId: string;
133
+ };
134
+ url: "/studio/agent-runs/{runId}";
135
+ };
136
+ export type StudioAgentRunsGetErrors = {
137
+ /**
138
+ * BadRequest
139
+ */
140
+ 400: EffectHttpApiErrorBadRequestEncoded;
141
+ /**
142
+ * Unauthorized
143
+ */
144
+ 401: EffectHttpApiErrorUnauthorizedEncoded;
145
+ /**
146
+ * Forbidden
147
+ */
148
+ 403: EffectHttpApiErrorForbiddenEncoded;
149
+ /**
150
+ * NotFound
151
+ */
152
+ 404: EffectHttpApiErrorNotFoundEncoded;
153
+ /**
154
+ * InternalServerError
155
+ */
156
+ 500: EffectHttpApiErrorInternalServerErrorEncoded;
157
+ };
158
+ export type StudioAgentRunsGetError = StudioAgentRunsGetErrors[keyof StudioAgentRunsGetErrors];
159
+ export type StudioAgentRunsGetResponses = {
160
+ /**
161
+ * Success
162
+ */
163
+ 200: {
164
+ agentId: string;
165
+ agentName: string;
166
+ completedAt: string | null;
167
+ createdAt: string;
168
+ errorCode: string | null;
169
+ id: string;
170
+ initiator: {
171
+ kind: "user";
172
+ name: string | null;
173
+ } | null;
174
+ source: string;
175
+ startedAt: string | null;
176
+ status: string;
177
+ };
178
+ };
179
+ export type StudioAgentRunsGetResponse = StudioAgentRunsGetResponses[keyof StudioAgentRunsGetResponses];
180
+ export type StudioViewDataSearchData = {
181
+ body: {
182
+ cursor?: string | null;
183
+ filters?: Array<{
184
+ caseSensitive?: boolean;
185
+ field: string;
186
+ operator: "eq" | "ne" | "in" | "nin" | "contains" | "not_contains" | "starts_with" | "ends_with" | "gt" | "gte" | "lt" | "lte" | "exists" | "is_empty" | "is_not_empty";
187
+ value: Suspend1 | Array<Suspend1>;
188
+ }>;
189
+ limit?: number;
190
+ sort?: Array<{
191
+ direction: "asc" | "desc";
192
+ field: string;
193
+ }>;
194
+ text?: string;
195
+ };
196
+ headers: {
197
+ authorization?: string;
198
+ "x-organization-id": string;
199
+ };
200
+ path: {
201
+ slug: string;
202
+ viewId: string;
203
+ };
204
+ query?: never;
205
+ url: "/studio/apps/by-slug/{slug}/views/{viewId}/data/search";
206
+ };
207
+ export type StudioViewDataSearchErrors = {
208
+ /**
209
+ * BadRequest
210
+ */
211
+ 400: EffectHttpApiErrorBadRequestEncoded;
212
+ /**
213
+ * Unauthorized
214
+ */
215
+ 401: EffectHttpApiErrorUnauthorizedEncoded;
216
+ /**
217
+ * Forbidden
218
+ */
219
+ 403: EffectHttpApiErrorForbiddenEncoded;
220
+ /**
221
+ * NotFound
222
+ */
223
+ 404: EffectHttpApiErrorNotFoundEncoded;
224
+ /**
225
+ * InternalServerError
226
+ */
227
+ 500: EffectHttpApiErrorInternalServerErrorEncoded;
228
+ };
229
+ export type StudioViewDataSearchError = StudioViewDataSearchErrors[keyof StudioViewDataSearchErrors];
230
+ export type StudioViewDataSearchResponses = {
231
+ /**
232
+ * Success
233
+ */
234
+ 200: unknown;
235
+ };
236
+ export type StudioViewDataGetItemData = {
237
+ body?: never;
238
+ headers: {
239
+ authorization?: string;
240
+ "x-organization-id": string;
241
+ };
242
+ path: {
243
+ slug: string;
244
+ viewId: string;
245
+ instanceId: string;
246
+ };
247
+ query?: never;
248
+ url: "/studio/apps/by-slug/{slug}/views/{viewId}/data/{instanceId}";
249
+ };
250
+ export type StudioViewDataGetItemErrors = {
251
+ /**
252
+ * BadRequest
253
+ */
254
+ 400: EffectHttpApiErrorBadRequestEncoded;
255
+ /**
256
+ * Unauthorized
257
+ */
258
+ 401: EffectHttpApiErrorUnauthorizedEncoded;
259
+ /**
260
+ * Forbidden
261
+ */
262
+ 403: EffectHttpApiErrorForbiddenEncoded;
263
+ /**
264
+ * NotFound
265
+ */
266
+ 404: EffectHttpApiErrorNotFoundEncoded;
267
+ /**
268
+ * InternalServerError
269
+ */
270
+ 500: EffectHttpApiErrorInternalServerErrorEncoded;
271
+ };
272
+ export type StudioViewDataGetItemError = StudioViewDataGetItemErrors[keyof StudioViewDataGetItemErrors];
273
+ export type StudioViewDataGetItemResponses = {
274
+ /**
275
+ * Success
276
+ */
277
+ 200: unknown;
278
+ };
279
+ export type StudioViewDataUpdateItemData = {
280
+ body: {
281
+ data?: {
282
+ [key: string]: unknown;
283
+ } | null;
284
+ description?: string | null;
285
+ name?: string | null;
286
+ };
287
+ headers: {
288
+ authorization?: string;
289
+ "x-organization-id": string;
290
+ "x-idempotency-key"?: string;
291
+ };
292
+ path: {
293
+ slug: string;
294
+ viewId: string;
295
+ instanceId: string;
296
+ };
297
+ query?: never;
298
+ url: "/studio/apps/by-slug/{slug}/views/{viewId}/data/{instanceId}";
299
+ };
300
+ export type StudioViewDataUpdateItemErrors = {
301
+ /**
302
+ * EntityValueDiagnostic | EntityFileFieldDiagnostic | BadRequest
303
+ */
304
+ 400: EntityValueDiagnosticEncoded | EntityFileFieldDiagnosticEncoded | EffectHttpApiErrorBadRequestEncoded;
305
+ /**
306
+ * Unauthorized
307
+ */
308
+ 401: EffectHttpApiErrorUnauthorizedEncoded;
309
+ /**
310
+ * Forbidden
311
+ */
312
+ 403: EffectHttpApiErrorForbiddenEncoded;
313
+ /**
314
+ * NotFound
315
+ */
316
+ 404: EffectHttpApiErrorNotFoundEncoded;
317
+ /**
318
+ * EntityUniqueFieldConflictDiagnostic | EntityFileFieldConflictDiagnostic
319
+ */
320
+ 409: EntityUniqueFieldConflictDiagnosticEncoded | EntityFileFieldConflictDiagnosticEncoded;
321
+ /**
322
+ * InternalServerError
323
+ */
324
+ 500: EffectHttpApiErrorInternalServerErrorEncoded;
325
+ };
326
+ export type StudioViewDataUpdateItemError = StudioViewDataUpdateItemErrors[keyof StudioViewDataUpdateItemErrors];
327
+ export type StudioViewDataUpdateItemResponses = {
328
+ /**
329
+ * Success
330
+ */
331
+ 200: {
332
+ data: unknown;
333
+ };
334
+ };
335
+ export type StudioViewDataUpdateItemResponse = StudioViewDataUpdateItemResponses[keyof StudioViewDataUpdateItemResponses];
336
+ export type StudioWorkflowRunsListData = {
337
+ body?: never;
338
+ headers: {
339
+ authorization?: string;
340
+ "x-organization-id": string;
341
+ };
342
+ path?: never;
343
+ query: {
344
+ appId: string;
345
+ pageId: string;
346
+ publishedRevisionId: string;
347
+ viewId: string;
348
+ limit?: string;
349
+ page?: string;
350
+ workflow?: string;
351
+ };
352
+ url: "/studio/workflow-runs";
353
+ };
354
+ export type StudioWorkflowRunsListErrors = {
355
+ /**
356
+ * BadRequest
357
+ */
358
+ 400: EffectHttpApiErrorBadRequestEncoded;
359
+ /**
360
+ * Unauthorized
361
+ */
362
+ 401: EffectHttpApiErrorUnauthorizedEncoded;
363
+ /**
364
+ * Forbidden
365
+ */
366
+ 403: EffectHttpApiErrorForbiddenEncoded;
367
+ /**
368
+ * InternalServerError
369
+ */
370
+ 500: EffectHttpApiErrorInternalServerErrorEncoded;
371
+ };
372
+ export type StudioWorkflowRunsListError = StudioWorkflowRunsListErrors[keyof StudioWorkflowRunsListErrors];
373
+ export type StudioWorkflowRunsListResponses = {
374
+ /**
375
+ * Success
376
+ */
377
+ 200: {
378
+ canManage: boolean;
379
+ data: Array<{
380
+ completedAt: string | null;
381
+ createdAt: string;
382
+ errorCode: string | null;
383
+ id: string;
384
+ initiator: {
385
+ kind: "user";
386
+ name: string | null;
387
+ } | {
388
+ kind: "application";
389
+ name: string;
390
+ } | null;
391
+ startedAt: string | null;
392
+ status: string;
393
+ triggerType: string;
394
+ workflowId: string;
395
+ workflowName: string;
396
+ }>;
397
+ paging: {
398
+ page: number;
399
+ pageSize: number;
400
+ totalItems: number;
401
+ totalPages: number;
402
+ };
403
+ };
404
+ };
405
+ export type StudioWorkflowRunsListResponse = StudioWorkflowRunsListResponses[keyof StudioWorkflowRunsListResponses];
406
+ export type StudioWorkflowRunsGetData = {
407
+ body?: never;
408
+ headers: {
409
+ authorization?: string;
410
+ "x-organization-id": string;
411
+ };
412
+ path: {
413
+ runId: string;
414
+ };
415
+ query: {
416
+ appId: string;
417
+ pageId: string;
418
+ publishedRevisionId: string;
419
+ viewId: string;
420
+ };
421
+ url: "/studio/workflow-runs/{runId}";
422
+ };
423
+ export type StudioWorkflowRunsGetErrors = {
424
+ /**
425
+ * BadRequest
426
+ */
427
+ 400: EffectHttpApiErrorBadRequestEncoded;
428
+ /**
429
+ * Unauthorized
430
+ */
431
+ 401: EffectHttpApiErrorUnauthorizedEncoded;
432
+ /**
433
+ * Forbidden
434
+ */
435
+ 403: EffectHttpApiErrorForbiddenEncoded;
436
+ /**
437
+ * NotFound
438
+ */
439
+ 404: EffectHttpApiErrorNotFoundEncoded;
440
+ /**
441
+ * InternalServerError
442
+ */
443
+ 500: EffectHttpApiErrorInternalServerErrorEncoded;
444
+ };
445
+ export type StudioWorkflowRunsGetError = StudioWorkflowRunsGetErrors[keyof StudioWorkflowRunsGetErrors];
446
+ export type StudioWorkflowRunsGetResponses = {
447
+ /**
448
+ * Success
449
+ */
450
+ 200: {
451
+ completedAt: string | null;
452
+ createdAt: string;
453
+ errorCode: string | null;
454
+ id: string;
455
+ initiator: {
456
+ kind: "user";
457
+ name: string | null;
458
+ } | {
459
+ kind: "application";
460
+ name: string;
461
+ } | null;
462
+ startedAt: string | null;
463
+ status: string;
464
+ triggerType: string;
465
+ workflowId: string;
466
+ workflowName: string;
467
+ steps: Array<{
468
+ attempt: number;
469
+ completedAt: string | null;
470
+ nodeId: string;
471
+ startedAt: string | null;
472
+ status: string;
473
+ }>;
474
+ };
475
+ };
476
+ 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};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@collective-intelligence/extensions-sdk-frontend-react",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "description": "Public hosted React contribution contracts for Collective Intelligence extensions.",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -46,9 +46,17 @@
46
46
  "types": "./dist/frontend/index.d.ts",
47
47
  "import": "./dist/frontend/index.js",
48
48
  "default": "./dist/frontend/index.js"
49
+ },
50
+ "./studio-api": {
51
+ "ci-source": "./src/studio-api/index.ts",
52
+ "types": "./dist/studio-api/index.d.ts",
53
+ "import": "./dist/studio-api/index.js",
54
+ "default": "./dist/studio-api/index.js"
49
55
  }
50
56
  },
51
57
  "scripts": {
58
+ "api:codegen:studio-api": "bun tools/codegen/generate-studio-api.ts",
59
+ "api:codegen:studio-api:check": "bun tools/codegen/generate-studio-api.ts --check",
52
60
  "build": "bun tools/build.ts",
53
61
  "test": "bun test src tools && bun run test:pack && vitest run test/frontend-runtime.test.tsx test/built-runtime.test.ts test/workflow-field-help.test.tsx",
54
62
  "test:unit": "bun test src",
@@ -62,11 +70,11 @@
62
70
  "type-check": "bun check"
63
71
  },
64
72
  "dependencies": {
65
- "@collective-intelligence/extensions-sdk": "0.1.7",
66
- "@collective-intelligence/extensions-sdk-frontend": "0.1.7"
73
+ "@collective-intelligence/extensions-sdk": "0.1.9",
74
+ "@collective-intelligence/extensions-sdk-frontend": "0.1.9"
67
75
  },
68
76
  "peerDependencies": {
69
- "@collective-intelligence/ui-react": "0.1.7",
77
+ "@collective-intelligence/ui-react": "0.1.9",
70
78
  "@tanstack/react-query": ">=5 <6",
71
79
  "@xyflow/react": ">=12 <13",
72
80
  "react": ">=18 <20",
@@ -82,6 +90,7 @@
82
90
  },
83
91
  "devDependencies": {
84
92
  "@collective-intelligence/ui-react": "workspace:*",
93
+ "@hey-api/openapi-ts": "^0.96.0",
85
94
  "@oxlint/plugins": "1.85.0",
86
95
  "@tanstack/react-query": "5.101.4",
87
96
  "@testing-library/react": "^16.3.2",