@collective-intelligence/external-apps-server-sdk 0.1.1 → 0.1.2

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.
@@ -28,7 +28,7 @@ export type EntityInvocationContext = Readonly<{
28
28
  resourceId: string;
29
29
  roles: readonly string[];
30
30
  scopes: readonly string[];
31
- teamIds: readonly string[];
31
+ groupIds: readonly string[];
32
32
  user: ApplicationUserIdentity;
33
33
  }>;
34
34
  export type ResourceJsonValue = null | boolean | number | string | readonly ResourceJsonValue[] | Readonly<{
@@ -431,11 +431,31 @@ export type PackageSchemaProjection = Readonly<{
431
431
  fidelity: ProjectionFidelity;
432
432
  }>;
433
433
  export type FormLayout = "stacked" | "two_column";
434
- /**
435
- * Renderer identifier owned by the consuming product. It remains open so
436
- * external packages can declare their own widget implementations.
437
- */
438
- export type FormWidget = string;
434
+ declare const plainFormWidgets: readonly [
435
+ "checkbox",
436
+ "color",
437
+ "date",
438
+ "date_range",
439
+ "datetime",
440
+ "email",
441
+ "file",
442
+ "hidden",
443
+ "number",
444
+ "password",
445
+ "structured_file_preview",
446
+ "switch",
447
+ "text",
448
+ "textarea",
449
+ "variable_references"
450
+ ];
451
+ export type PlainFormWidget = (typeof plainFormWidgets)[number];
452
+ declare const selectFormWidgets: readonly [
453
+ "folders_explorer",
454
+ "multi_select",
455
+ "radio",
456
+ "select"
457
+ ];
458
+ export type SelectFormWidget = (typeof selectFormWidgets)[number];
439
459
  export type FieldValidationRule = Readonly<{
440
460
  type: "required";
441
461
  code?: string;
@@ -483,6 +503,22 @@ export type SelectOptions<Field extends string = string> = Readonly<{
483
503
  selectionMetadataField?: Field;
484
504
  aiFill?: DynamicFormAiFillConfig;
485
505
  }>;
506
+ /** Options of the upload control for a manual structured-file source. */
507
+ export type StructuredFileUploadOptions<Field extends string = string> = Readonly<{
508
+ /** Field that receives the format inferred from the uploaded file. */
509
+ formatField?: Field;
510
+ }>;
511
+ /** Options of the browser that picks a file from a connected source. */
512
+ export type StructuredFileBrowserOptions<Field extends string = string> = Readonly<{
513
+ /** The source contribution that lists the files and its connection slot. */
514
+ contribution: Readonly<{
515
+ componentFqn: string;
516
+ connectionSlot: string;
517
+ }>;
518
+ label?: string;
519
+ /** Field that receives the format of the picked file. */
520
+ formatField?: Field;
521
+ }>;
486
522
  export type VisibilityCondition<Field extends string = string> = Readonly<{
487
523
  field: Field;
488
524
  equals?: JsonValue;
@@ -496,8 +532,7 @@ export type FieldVisibilityRule<Field extends string = string> = Readonly<{
496
532
  visibleWhen: VisibilityCondition<Field> | readonly VisibilityCondition<Field>[];
497
533
  logic?: "and" | "or";
498
534
  }>;
499
- export type FieldUiSchema<Field extends string = string> = Readonly<{
500
- "ui:widget"?: FormWidget;
535
+ export type FieldUiBase = Readonly<{
501
536
  "ui:placeholder"?: string;
502
537
  "ui:help"?: string;
503
538
  "ui:disabled"?: boolean;
@@ -505,8 +540,29 @@ export type FieldUiSchema<Field extends string = string> = Readonly<{
505
540
  "ui:order"?: number;
506
541
  "ui:suggestedName"?: string;
507
542
  "ui:validation"?: readonly FieldValidationRule[];
543
+ }>;
544
+ export type PlainFieldUi = FieldUiBase & Readonly<{
545
+ "ui:widget": PlainFormWidget;
546
+ "ui:options"?: never;
547
+ }>;
548
+ /**
549
+ * Without a widget the renderer infers one from the field schema, and the
550
+ * select options apply to the inferred control.
551
+ */
552
+ export type SelectFieldUi<Field extends string = string> = FieldUiBase & Readonly<{
553
+ "ui:widget"?: SelectFormWidget;
508
554
  "ui:options"?: SelectOptions<Field>;
509
555
  }>;
556
+ export type StructuredFileUploadFieldUi<Field extends string = string> = FieldUiBase & Readonly<{
557
+ "ui:widget": "structured_file_upload";
558
+ "ui:options"?: StructuredFileUploadOptions<Field>;
559
+ }>;
560
+ export type StructuredFileBrowserFieldUi<Field extends string = string> = FieldUiBase & Readonly<{
561
+ "ui:widget": "structured_file_browser";
562
+ "ui:options": StructuredFileBrowserOptions<Field>;
563
+ }>;
564
+ /** Presentation of one field; `ui:widget` selects the options contract. */
565
+ export type FieldUiSchema<Field extends string = string> = PlainFieldUi | SelectFieldUi<Field> | StructuredFileUploadFieldUi<Field> | StructuredFileBrowserFieldUi<Field>;
510
566
  export type FormMarkdownBlock = Readonly<{
511
567
  md: string;
512
568
  }>;