api_binding_ui 1.1.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/README.md +74 -394
  2. package/SKILL.md +49 -350
  3. package/dist/framework/contract.d.ts +268 -0
  4. package/dist/framework/engine.d.ts +88 -0
  5. package/dist/framework/expr.d.ts +34 -0
  6. package/dist/framework/loadCatalog.d.ts +6 -0
  7. package/dist/framework/names.d.ts +7 -0
  8. package/dist/framework/openapi.d.ts +7 -0
  9. package/dist/framework/runner.d.ts +33 -0
  10. package/dist/framework/schema.d.ts +22 -0
  11. package/dist/framework/store.d.ts +17 -0
  12. package/dist/framework/validate.d.ts +7 -0
  13. package/dist/index-e9twc25y.js +754 -0
  14. package/dist/index-e9twc25y.js.map +16 -0
  15. package/dist/index.d.ts +11 -29
  16. package/dist/index.js +345 -11932
  17. package/dist/index.js.map +14 -0
  18. package/dist/runtime/BindingProvider.d.ts +42 -0
  19. package/dist/runtime/BindingScreen.d.ts +23 -0
  20. package/dist/runtime/hooks.d.ts +22 -0
  21. package/dist/runtime/screenStore.d.ts +7 -0
  22. package/dist/studio/ApiPicker.d.ts +15 -0
  23. package/dist/studio/BindingStudio.d.ts +21 -0
  24. package/dist/studio/BindingWidget.d.ts +9 -0
  25. package/dist/studio/Collapse.d.ts +6 -0
  26. package/dist/studio/ComponentList.d.ts +10 -0
  27. package/dist/studio/FindAnything.d.ts +7 -0
  28. package/dist/studio/Inspector.d.ts +12 -0
  29. package/dist/studio/Navigator.d.ts +17 -0
  30. package/dist/studio/SettingsPanel.d.ts +15 -0
  31. package/dist/studio/Tip.d.ts +23 -0
  32. package/dist/studio/editors/ConsumeEditor.d.ts +4 -0
  33. package/dist/studio/editors/RequestInputs.d.ts +11 -0
  34. package/dist/studio/editors/ScopedEditor.d.ts +3 -0
  35. package/dist/studio/editors/SlotSection.d.ts +3 -0
  36. package/dist/studio/editors/SourceSelect.d.ts +10 -0
  37. package/dist/studio/editors/StepCard.d.ts +12 -0
  38. package/dist/studio/editors/TriggerEditor.d.ts +4 -0
  39. package/dist/studio/editors/types.d.ts +14 -0
  40. package/dist/studio/icons.d.ts +65 -0
  41. package/dist/studio/index.css +2021 -0
  42. package/dist/studio/index.d.ts +3 -0
  43. package/dist/studio/index.js +2806 -0
  44. package/dist/studio/index.js.map +33 -0
  45. package/dist/studio/useBindings.d.ts +20 -0
  46. package/dist/studio/useCatalog.d.ts +15 -0
  47. package/dist/studio/useGlide.d.ts +11 -0
  48. package/dist/studio/useSettings.d.ts +8 -0
  49. package/package.json +20 -14
  50. package/spec/FRAMEWORK.md +271 -0
  51. package/dist/api-binding-ui.css +0 -248
  52. package/dist/components/ApiBindingWorkspace.d.ts +0 -10
  53. package/dist/components/ApiMappings.d.ts +0 -21
  54. package/dist/components/BindApiButton.d.ts +0 -41
  55. package/dist/components/RequestPreview.d.ts +0 -7
  56. package/dist/components/SimulationDialog.d.ts +0 -8
  57. package/dist/components/ValidationDialog.d.ts +0 -8
  58. package/dist/components/WorkspaceContext.d.ts +0 -7
  59. package/dist/components/ui/AppGrid.d.ts +0 -27
  60. package/dist/components/ui/Badge.d.ts +0 -9
  61. package/dist/components/ui/Banner.d.ts +0 -8
  62. package/dist/components/ui/Button.d.ts +0 -31
  63. package/dist/components/ui/Card.d.ts +0 -14
  64. package/dist/components/ui/Dialog.d.ts +0 -61
  65. package/dist/components/ui/Icons.d.ts +0 -21
  66. package/dist/components/ui/Input.d.ts +0 -31
  67. package/dist/core/bindingContext.d.ts +0 -67
  68. package/dist/core/catalog.d.ts +0 -18
  69. package/dist/core/componentId.d.ts +0 -12
  70. package/dist/core/model.d.ts +0 -63
  71. package/dist/core/openapi.d.ts +0 -2
  72. package/dist/core/transport.d.ts +0 -33
  73. package/dist/core/validation.d.ts +0 -2
  74. package/dist/core/valueCoercion.d.ts +0 -17
  75. package/dist/hooks/useAppliedBinding.d.ts +0 -6
  76. package/dist/index.css +0 -248
  77. package/dist/style.css +0 -244
  78. package/dist/types.d.ts +0 -245
@@ -1,8 +0,0 @@
1
- import * as React from "react";
2
- export type BannerTone = "caution" | "resolved" | "danger";
3
- export interface BannerProps {
4
- tone?: BannerTone;
5
- children: React.ReactNode;
6
- className?: string;
7
- }
8
- export declare function Banner({ tone, children, className }: BannerProps): React.JSX.Element;
@@ -1,31 +0,0 @@
1
- import * as React from "react";
2
- import { type ActionIcon } from "./Icons";
3
- export type ButtonVariant = "primary" | "secondary" | "ghost" | "destructive" | "outline";
4
- export type ButtonSize = "sm" | "md";
5
- export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
6
- variant?: ButtonVariant;
7
- size?: ButtonSize;
8
- icon?: ActionIcon;
9
- tooltip?: string | false;
10
- children?: React.ReactNode;
11
- className?: string;
12
- }
13
- export declare function Button({ variant, size, icon, tooltip, children, className, type, ...rest }: ButtonProps): React.JSX.Element;
14
- export interface ButtonBarProps {
15
- justify?: "between" | "start" | "end";
16
- children: React.ReactNode;
17
- className?: string;
18
- }
19
- export declare function ButtonBar({ justify, children, className }: ButtonBarProps): React.JSX.Element;
20
- export interface ButtonGroupOption<T extends string> {
21
- value: T;
22
- label: string;
23
- }
24
- export interface ButtonGroupProps<T extends string> {
25
- value: T;
26
- onChange: (value: T) => void;
27
- options: ButtonGroupOption<T>[];
28
- "aria-label"?: string;
29
- className?: string;
30
- }
31
- export declare function ButtonGroup<T extends string>({ value, onChange, options, "aria-label": ariaLabel, className, }: ButtonGroupProps<T>): React.JSX.Element;
@@ -1,14 +0,0 @@
1
- import * as React from "react";
2
- export interface DetailCardField {
3
- label: string;
4
- value?: React.ReactNode;
5
- }
6
- export interface DetailCardProps {
7
- title?: string;
8
- subtitle?: string;
9
- actions?: React.ReactNode;
10
- fields?: DetailCardField[];
11
- dense?: boolean;
12
- className?: string;
13
- }
14
- export declare function DetailCard({ title, subtitle, actions, fields, dense, className, }: DetailCardProps): React.JSX.Element;
@@ -1,61 +0,0 @@
1
- import * as React from "react";
2
- export interface DialogProps {
3
- open?: boolean;
4
- title: string;
5
- description?: string;
6
- submitLabel?: string;
7
- cancelLabel?: string;
8
- onCancel?: () => void;
9
- onSubmit?: () => void;
10
- children: React.ReactNode;
11
- size?: "large" | "medium";
12
- formId?: string;
13
- className?: string;
14
- }
15
- export declare function Dialog({ open, title, description, submitLabel, cancelLabel, onCancel, onSubmit, children, size, formId, className, }: DialogProps): React.JSX.Element | null;
16
- export declare function actionFormDialogTemplateV1(spec: {
17
- open: boolean;
18
- title: string;
19
- description: string;
20
- size?: "large" | "medium";
21
- formId: string;
22
- submitLabel: string;
23
- cancelLabel: string;
24
- onCancel: () => void;
25
- onSubmit: () => void;
26
- children: React.ReactNode;
27
- }): {
28
- open: boolean;
29
- title: string;
30
- description: string;
31
- size?: "large" | "medium";
32
- formId: string;
33
- submitLabel: string;
34
- cancelLabel: string;
35
- onCancel: () => void;
36
- onSubmit: () => void;
37
- children: React.ReactNode;
38
- };
39
- export declare function alertDialogTemplateV1(spec: {
40
- open: boolean;
41
- kind?: "destructive" | "neutral" | string;
42
- title: string;
43
- message: string;
44
- confirmLabel?: string;
45
- cancelLabel?: string;
46
- primaryAction?: {
47
- label: string;
48
- onClick: () => void;
49
- };
50
- onConfirm?: () => void;
51
- onCancel: () => void;
52
- }): {
53
- open: boolean;
54
- title: string;
55
- description: string;
56
- submitLabel: string;
57
- cancelLabel: string;
58
- onSubmit: (() => void) | undefined;
59
- onCancel: () => void;
60
- children: null;
61
- };
@@ -1,21 +0,0 @@
1
- import * as React from "react";
2
- export interface IconProps extends React.SVGProps<SVGSVGElement> {
3
- size?: number | string;
4
- className?: string;
5
- }
6
- export declare const LinkIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
7
- export declare const PencilIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
8
- export declare const SettingsIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
9
- export declare const PlusIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
10
- export declare const Trash2Icon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
11
- export declare const ArrowUpIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
12
- export declare const ArrowDownIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
13
- export declare const PlayIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
14
- export declare const CheckIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
15
- export declare const XIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
16
- export declare const SearchIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
17
- export declare const AlertTriangleIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
18
- export declare const AlertCircleIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
19
- export declare const iconMap: Record<string, React.ComponentType<IconProps>>;
20
- export type ActionIcon = string | React.ReactNode;
21
- export declare function renderIcon(icon?: ActionIcon, props?: IconProps): React.ReactNode;
@@ -1,31 +0,0 @@
1
- import * as React from "react";
2
- export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
3
- label?: string;
4
- required?: boolean;
5
- }
6
- export declare function Input({ label, required, className, id, ...rest }: InputProps): React.JSX.Element;
7
- export interface TextAreaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {
8
- label?: string;
9
- required?: boolean;
10
- }
11
- export declare function TextArea({ label, required, className, id, ...rest }: TextAreaProps): React.JSX.Element;
12
- export interface SelectOption {
13
- value: string;
14
- label: string;
15
- description?: string;
16
- }
17
- export interface SelectProps extends Omit<React.SelectHTMLAttributes<HTMLSelectElement>, "onChange" | "value"> {
18
- label?: string;
19
- required?: boolean;
20
- value?: string | null;
21
- options?: SelectOption[];
22
- onChange?: (value: string | null) => void;
23
- placeholder?: string;
24
- }
25
- export declare function Select({ label, required, value, options, onChange, placeholder, disabled, className, id, ...rest }: SelectProps): React.JSX.Element;
26
- export interface CheckboxProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange"> {
27
- label: string;
28
- checked?: boolean;
29
- onChange?: (checked: boolean) => void;
30
- }
31
- export declare function Checkbox({ label, checked, onChange, disabled, className, id, ...rest }: CheckboxProps): React.JSX.Element;
@@ -1,67 +0,0 @@
1
- /**
2
- * Snapshot extraction, DOM inspection, and context building utilities.
3
- * Completely generic: works on modals, drawers, panels, cards, and full screens.
4
- */
5
- import type { BindingGrid, BindingSnapshot, SnapshotComponent, SnapshotContext, WindowKind, WindowTrigger } from "../types";
6
- export declare const FREE_TEXT_SOURCE = "freeText";
7
- export declare const FREE_TEXT_OPTION: {
8
- value: string;
9
- label: string;
10
- };
11
- export declare function storageKey(key: string): string;
12
- export declare function storeSnapshot(snapshot: BindingSnapshot): void;
13
- export declare function readSnapshot(key: string): BindingSnapshot | null;
14
- export declare function windowIds({ appId, windowId, gridId, parentWindowIds, }: {
15
- appId: string;
16
- windowId: string;
17
- gridId?: string;
18
- parentWindowIds?: string[];
19
- }): {
20
- appId: string;
21
- windowId: string;
22
- gridId: string | undefined;
23
- parentWindowIds: string[] | undefined;
24
- key: string;
25
- };
26
- export declare function gridPropertyPaths({ gridId, rows }: {
27
- gridId: string;
28
- rows: Record<string, unknown>[];
29
- }): string[];
30
- export declare function contextComponents(snapshot: BindingSnapshot): Array<{
31
- value: string;
32
- label: string;
33
- }>;
34
- export declare function sourceComponents(snapshot: BindingSnapshot): Array<{
35
- value: string;
36
- label: string;
37
- }>;
38
- /**
39
- * Intelligently locates the nearest enclosing screen, modal, drawer, form, or panel container
40
- * where the trigger button resides.
41
- */
42
- export declare function findEnclosingContextElement(triggerElement: HTMLElement | null, options?: {
43
- containerRef?: React.RefObject<HTMLElement | null>;
44
- containerSelector?: string;
45
- rootElement?: HTMLElement | null;
46
- formId?: string;
47
- }): HTMLElement | null;
48
- export declare function discoverFormComponents(root: HTMLElement | null): SnapshotComponent[];
49
- export declare function discoverButtons(root: HTMLElement | null): string[];
50
- export declare function buildSnapshot({ ids, source, parent, root, grid, kind, trigger, contexts, components: explicitComponents, buttons: explicitButtons, }: {
51
- ids: {
52
- appId: string;
53
- windowId: string;
54
- gridId?: string;
55
- parentWindowIds?: string[];
56
- key: string;
57
- };
58
- source: string;
59
- parent: string;
60
- root: HTMLElement | null;
61
- grid?: BindingGrid;
62
- kind?: WindowKind;
63
- trigger?: WindowTrigger;
64
- contexts?: SnapshotContext[];
65
- components?: SnapshotComponent[];
66
- buttons?: string[];
67
- }): BindingSnapshot;
@@ -1,18 +0,0 @@
1
- /**
2
- * API Catalog builder and validator for API Binding Studio.
3
- */
4
- import type { ApiDefinition, ApiParameter } from "../types";
5
- export declare function friendlyLabel(operationId?: string): string | undefined;
6
- export type RawBindings = Record<string, Record<string, {
7
- operationId?: string;
8
- [key: string]: unknown;
9
- }>>;
10
- export declare function buildCatalogFromRegistry({ bindings, hookResolver, paramsResolver, availabilityChecker, }: {
11
- bindings: RawBindings;
12
- hookResolver?: (api: string, method: string) => string | undefined;
13
- paramsResolver?: (api: string, method: string) => ApiParameter[];
14
- availabilityChecker?: (api: string, method: string) => {
15
- available: boolean;
16
- problem?: string;
17
- };
18
- }): ApiDefinition[];
@@ -1,12 +0,0 @@
1
- /**
2
- * Component ID utilities for normalized component identification.
3
- */
4
- export interface ComponentDescriptor {
5
- kind: "field" | "button" | string;
6
- name: string;
7
- parentId?: string;
8
- }
9
- export declare function componentId(c: ComponentDescriptor): string;
10
- export declare function isButtonId(id: string): boolean;
11
- export declare function parseComponentId(id: string): ComponentDescriptor;
12
- export declare function normalizeComponent(id: string): string;
@@ -1,63 +0,0 @@
1
- /**
2
- * API Binding Studio - Canonical Data Model and Simulation Engine
3
- * Single source of truth for parameter mappings, live request resolution, and simulations.
4
- */
5
- import type { ActionContext, ApiBindingConfig, ApiBindingContext, ApiDefinition, BindingCall, BindingPurpose, ParamMapping, RequestPreviewItem, SampleNote, SimulationInput } from "../types";
6
- import { isButtonId } from "./componentId";
7
- export declare const CONFIG_VERSION = 2;
8
- export declare const draftKey: (key: string) => string;
9
- export declare const appliedKey: (key: string) => string;
10
- export declare const fingerprint: (config: ApiBindingConfig) => string;
11
- export declare const SUBMIT: string;
12
- export declare const CANCEL: string;
13
- export declare const CUSTOMER_PARAM = "customerIds";
14
- export declare const newCallId: () => string;
15
- export declare const definitionFor: (context: ApiBindingContext, api: string, method?: string) => ApiDefinition | undefined;
16
- export declare const methodsFor: (context: ApiBindingContext, api: string) => string[];
17
- export declare const apisOf: (context: ApiBindingContext) => string[];
18
- export declare const fieldId: (name: string) => string;
19
- export declare function reconcileCallParams(call: BindingCall, context: ApiBindingContext): BindingCall;
20
- export declare function proposeConfig(context: ApiBindingContext): ApiBindingConfig;
21
- export declare function reconcileConfig(config: ApiBindingConfig, context: ApiBindingContext): ApiBindingConfig;
22
- export declare function migrateConfig(raw: unknown, context: ApiBindingContext): ApiBindingConfig | null;
23
- export declare function callsFor(config: ApiBindingConfig, component?: string): BindingCall[];
24
- export declare function changeCallTarget(call: BindingCall, api: string, method: string | undefined, context: ApiBindingContext): BindingCall;
25
- export declare function droppedBy(call: BindingCall, api: string, method: string | undefined, context: ApiBindingContext): number;
26
- export declare const populated: (call: BindingCall) => boolean;
27
- export declare function changePurpose(call: BindingCall, purpose: BindingPurpose): BindingCall;
28
- export declare function newCall(purpose: BindingPurpose, component: string): BindingCall;
29
- export declare function moveCall(calls: BindingCall[], id: string, delta: -1 | 1): BindingCall[];
30
- export declare function setParamSource(p: ParamMapping, source: string, gridId?: string): ParamMapping;
31
- export declare const gridPaths: (context: ApiBindingContext) => string[];
32
- export declare const componentLabel: (context: ApiBindingContext, id: string) => string;
33
- export declare const endpointLabel: (call: Pick<BindingCall, "api" | "method">) => string;
34
- export declare function callIssues(call: BindingCall, index: number, context: ApiBindingContext): string[];
35
- export declare function issuesFor(config: ApiBindingConfig, context: ApiBindingContext): string[];
36
- export declare function actionContext(context: ApiBindingContext, form: Record<string, string>, rows?: Record<string, unknown>[]): ActionContext;
37
- export declare const snapshotForm: (context: ApiBindingContext) => {
38
- [k: string]: string;
39
- };
40
- export declare function resolutionIssues(call: BindingCall, index: number, def: ApiDefinition | undefined, ctx: ActionContext): string[];
41
- export declare function previewRequests(config: ApiBindingConfig, context: ApiBindingContext, ctx: ActionContext, filter?: (c: BindingCall) => boolean): RequestPreviewItem[];
42
- export declare const isNoteContract: (def?: ApiDefinition) => boolean;
43
- export declare function isSimulated(call: BindingCall, context: ApiBindingContext): boolean;
44
- export declare function simulatorGaps(config: ApiBindingConfig, context: ApiBindingContext): string[];
45
- export declare function simulationErrors(config: ApiBindingConfig, input: SimulationInput, customers: number): string[];
46
- export declare const simulationForm: (input: SimulationInput) => Record<string, string>;
47
- export declare function simulateSave(config: ApiBindingConfig, context: ApiBindingContext, input: SimulationInput, rows: Record<string, unknown>[], fail: boolean): {
48
- notes: SampleNote[];
49
- errors: string[];
50
- requests: RequestPreviewItem[];
51
- };
52
- export declare function validateBindings(config: ApiBindingConfig, context: ApiBindingContext, form?: {
53
- [k: string]: string;
54
- }): string[];
55
- export declare function verificationSignature(config: ApiBindingConfig, context: ApiBindingContext, form?: {
56
- [k: string]: string;
57
- }): string;
58
- export declare function canApply(config: ApiBindingConfig, context: ApiBindingContext, verified: string | null): boolean;
59
- export declare function fieldSummary(config: ApiBindingConfig, context: ApiBindingContext, name: string): {
60
- from: string;
61
- to: string;
62
- };
63
- export declare const isButton: typeof isButtonId;
@@ -1,2 +0,0 @@
1
- import type { ApiDefinition } from "../types";
2
- export declare function buildCatalogFromOpenApi(document: unknown): ApiDefinition[];
@@ -1,33 +0,0 @@
1
- /**
2
- * Cross-window communication transport and state management for API Binding Studio.
3
- */
4
- import type { ApiBindingConfig, ApiBindingContext, BindingAppliedMessage, BindingContextMessage, BindingReadyMessage, BindingSelectionUpdateMessage } from "../types";
5
- import { BINDING_APPLIED, BINDING_CHANNEL, BINDING_CONTEXT, BINDING_READY, BINDING_SELECTION_UPDATE } from "../types";
6
- export declare const contextKey: (key: string) => string;
7
- export declare function storeBindingContext(context: ApiBindingContext): void;
8
- export declare function readBindingContext(key: string): ApiBindingContext | null;
9
- export declare function validBindingContext(value: unknown, key: string): value is ApiBindingContext;
10
- export interface OpenStudioOptions {
11
- /** Base URL path for the route, defaults to `/api-binding` */
12
- routeBase?: string;
13
- /** Custom window features (e.g. `width=1200,height=800`) */
14
- features?: string;
15
- }
16
- /**
17
- * Opens or focuses an existing named tab for this binding key.
18
- * Never resets active simulation or unapplied in-memory edits.
19
- */
20
- export declare function openBindingStudio(context: ApiBindingContext, options?: OpenStudioOptions): Window | null;
21
- /**
22
- * Notifies the opener and any open host tabs that the binding has been applied.
23
- */
24
- export declare function notifyApplied(key: string, config: ApiBindingConfig): void;
25
- /**
26
- * Allows the host window to update customer selection live without closing the child window.
27
- */
28
- export declare function notifySelectionUpdate(key: string, grid: {
29
- id: string;
30
- rows: Record<string, unknown>[];
31
- }): void;
32
- export declare const validContext: typeof validBindingContext;
33
- export { BINDING_APPLIED, BINDING_CHANNEL, BINDING_CONTEXT, BINDING_READY, BINDING_SELECTION_UPDATE, type BindingAppliedMessage, type BindingContextMessage, type BindingReadyMessage, type BindingSelectionUpdateMessage, };
@@ -1,2 +0,0 @@
1
- import type { ApiDefinition, RequestParts } from "../types";
2
- export declare function validateRequest(parts: RequestParts, definition: ApiDefinition): string[];
@@ -1,17 +0,0 @@
1
- /**
2
- * Type coercion and request construction for API Binding Studio.
3
- */
4
- import type { ActionContext, ApiParameter, ParamMapping, RequestParts } from "../types";
5
- export type Scalar = string | number | boolean;
6
- export declare function baseType(type: string): {
7
- base: string;
8
- array: boolean;
9
- };
10
- export declare function coerceScalar(text: string, base: string): Scalar | undefined;
11
- export declare function coerce(text: string, type: string): Scalar | Scalar[] | undefined;
12
- export declare const FREE_TEXT_SOURCE = "freeText";
13
- export declare function resolveParam(p: ParamMapping, ctx: ActionContext): string | undefined;
14
- export declare const parameterKey: (name: string, location?: string) => string;
15
- export declare function parameterFor(mapping: ParamMapping, spec: ApiParameter[]): ApiParameter | undefined;
16
- export declare function coerceValue(text: string, spec: ApiParameter): unknown;
17
- export declare function buildRequest(mappings: ParamMapping[], ctx: ActionContext, spec: ApiParameter[]): RequestParts;
@@ -1,6 +0,0 @@
1
- import type { ApiBindingConfig } from "../types";
2
- export declare function useAppliedBinding(pageKey: string): {
3
- appliedConfig: ApiBindingConfig | null;
4
- isApplied: boolean;
5
- appliedAt: string | null;
6
- };
package/dist/index.css DELETED
@@ -1,248 +0,0 @@
1
- /* src/styles/highradius-bridge.css */
2
-
3
-
4
- /* src/styles/index.css */
5
-
6
-
7
- /* src/styles/workspace.css */
8
- .binding-workspace, .binding-workspace * {
9
- box-sizing: border-box;
10
- }
11
-
12
- .binding-workspace, .api-binding, .binding-v2 {
13
- display: flex;
14
- background: var(--ds-color-background, #fff);
15
- color: var(--ds-color-foreground, #0f172a);
16
- font-family: var(--ds-font-family-sans, sans-serif);
17
- flex-direction: column;
18
- height: 100vh;
19
- }
20
-
21
- .binding-workspace h1, .api-binding h1, .binding-v2 h1 {
22
- font-size: var(--ds-font-size-2xl, 1.5rem);
23
- font-weight: var(--ds-font-weight-bold, 700);
24
- margin: 0;
25
- }
26
-
27
- .binding-workspace h2, .api-binding h2, .binding-v2 h2 {
28
- font-size: var(--ds-font-size-lg, 1.125rem);
29
- font-weight: var(--ds-font-weight-semibold, 600);
30
- margin: 0;
31
- }
32
-
33
- .binding-workspace h3, .api-binding h3, .binding-v2 h3 {
34
- font-size: var(--ds-font-size-base, .875rem);
35
- font-weight: var(--ds-font-weight-semibold, 600);
36
- margin: 0;
37
- }
38
-
39
- .binding-workspace p, .api-binding p, .binding-v2 p {
40
- line-height: var(--ds-line-height-normal, 1.5);
41
- margin: 0;
42
- }
43
-
44
- .binding-header, .binding-footer, .binding-v2-header, .binding-v2-footer {
45
- padding: var(--ds-page-padding, 1rem 1.5rem);
46
- display: flex;
47
- gap: var(--ds-space-4, 1rem);
48
- flex-wrap: wrap;
49
- justify-content: space-between;
50
- align-items: center;
51
- }
52
-
53
- .binding-header, .binding-v2-header {
54
- border-bottom-width: var(--ds-screen-surface-border-width, 1px);
55
- border-bottom-style: solid;
56
- border-bottom-color: var(--ds-color-border, #e2e8f0);
57
- }
58
-
59
- .binding-body, .binding-v2-body {
60
- overflow: auto;
61
- position: relative;
62
- padding: var(--ds-page-padding, 1rem 1.5rem);
63
- flex: 1;
64
- min-height: 0;
65
- }
66
-
67
- .binding-columns, .binding-v2-columns {
68
- isolation: isolate;
69
- display: flex;
70
- gap: var(--ds-space-8, 2rem);
71
- flex-wrap: wrap;
72
- align-items: start;
73
- }
74
-
75
- .binding-main, .binding-v2-main {
76
- flex-grow: 1;
77
- flex-basis: var(--ds-dialog-form-min-width, 32rem);
78
- padding-bottom: var(--ds-space-12, 3rem);
79
- }
80
-
81
- .binding-main, .binding-stack, .binding-v2-main, .binding-v2-stack {
82
- display: flex;
83
- gap: var(--ds-space-4, 1rem);
84
- flex-direction: column;
85
- min-width: 0;
86
- }
87
-
88
- .binding-section, .binding-v2-section {
89
- padding-bottom: var(--ds-space-6, 1.5rem);
90
- display: flex;
91
- gap: var(--ds-space-4, 1rem);
92
- border-bottom-width: var(--ds-screen-surface-border-width, 1px);
93
- border-bottom-style: solid;
94
- border-bottom-color: var(--ds-color-border, #e2e8f0);
95
- flex-direction: column;
96
- }
97
-
98
- .binding-section-title, .binding-v2-section-title {
99
- display: flex;
100
- justify-content: space-between;
101
- align-items: center;
102
- gap: var(--ds-space-4, 1rem);
103
- }
104
-
105
- .binding-muted, .binding-v2-muted {
106
- color: var(--ds-color-muted-foreground, #64748b);
107
- font-size: var(--ds-font-size-sm, .8125rem);
108
- }
109
-
110
- .binding-preview, .binding-v2-preview {
111
- flex-basis: var(--ds-dialog-min-width, 24rem);
112
- position: sticky;
113
- background: var(--ds-color-surface, #fff);
114
- border-width: var(--ds-screen-surface-border-width, 1px);
115
- border-style: solid;
116
- border-color: var(--ds-color-border, #e2e8f0);
117
- border-radius: var(--ds-radius-md, 6px);
118
- padding: var(--ds-space-6, 1.5rem);
119
- display: flex;
120
- gap: var(--ds-space-4, 1rem);
121
- flex-direction: column;
122
- flex-grow: 0;
123
- max-width: 100%;
124
- top: 0;
125
- }
126
-
127
- .binding-panel, .binding-v2-panel {
128
- position: absolute;
129
- width: var(--ds-dialog-form-min-width, 32rem);
130
- background: var(--ds-color-background, #fff);
131
- border-left-width: var(--ds-screen-surface-border-width, 1px);
132
- border-left-style: solid;
133
- border-left-color: var(--ds-color-border, #e2e8f0);
134
- box-shadow: var(--ds-shadow-md, 0 4px 6px -1px #0000001a);
135
- padding: var(--ds-space-6, 1.5rem);
136
- display: flex;
137
- gap: var(--ds-space-6, 1.5rem);
138
- z-index: var(--ds-focus-z-index, 50);
139
- flex-direction: column;
140
- max-width: 100%;
141
- min-height: 100%;
142
- top: 0;
143
- right: 0;
144
- }
145
-
146
- .binding-details, .binding-v2-details {
147
- display: flex;
148
- gap: var(--ds-space-2, .5rem);
149
- font-size: var(--ds-font-size-sm, .8125rem);
150
- overflow-wrap: anywhere;
151
- flex-direction: column;
152
- }
153
-
154
- .binding-details summary, .binding-v2-details summary {
155
- cursor: pointer;
156
- color: var(--ds-color-muted-foreground, #64748b);
157
- }
158
-
159
- .binding-footer, .binding-v2-footer {
160
- border-top-width: var(--ds-screen-surface-border-width, 1px);
161
- border-top-style: solid;
162
- border-top-color: var(--ds-color-border, #e2e8f0);
163
- background: var(--ds-color-background, #fff);
164
- }
165
-
166
- .binding-simulation, .binding-v2-simulation {
167
- display: flex;
168
- gap: var(--ds-space-4, 1rem);
169
- flex-direction: column;
170
- }
171
-
172
- .binding-empty, .binding-v2-empty {
173
- padding: var(--ds-space-12, 3rem);
174
- margin: auto;
175
- }
176
-
177
- .binding-error, .binding-v2-error {
178
- color: var(--ds-color-destructive, #ef4444);
179
- }
180
-
181
- .binding-stack-tight, .binding-v2-stack-tight {
182
- display: flex;
183
- align-items: flex-start;
184
- gap: var(--ds-space-1, .25rem);
185
- flex-direction: column;
186
- }
187
-
188
- .binding-list, .binding-v2-list {
189
- padding-left: var(--ds-space-4, 1rem);
190
- margin: 0;
191
- }
192
-
193
- .binding-panel-wide, .binding-v2-panel-wide {
194
- width: var(--ds-dialog-width-large, 48rem);
195
- overflow: auto;
196
- }
197
-
198
- .binding-call, .binding-v2-call {
199
- display: flex;
200
- gap: var(--ds-space-3, .75rem);
201
- padding: var(--ds-space-4, 1rem);
202
- border-width: var(--ds-screen-surface-border-width, 1px);
203
- border-style: solid;
204
- border-color: var(--ds-color-border, #e2e8f0);
205
- border-radius: var(--ds-radius-md, 6px);
206
- flex-direction: column;
207
- min-width: 0;
208
- }
209
-
210
- .binding-call-grid, .binding-v2-call-grid {
211
- display: grid;
212
- grid-template-columns: repeat(auto-fill, minmax(var(--ds-menu-min-width, 12rem), 1fr));
213
- gap: var(--ds-space-3, .75rem);
214
- }
215
-
216
- .binding-params, .binding-v2-params {
217
- display: flex;
218
- gap: var(--ds-space-2, .5rem);
219
- flex-direction: column;
220
- }
221
-
222
- .binding-param, .binding-v2-param {
223
- display: grid;
224
- grid-template-columns: repeat(3, minmax(0, 1fr));
225
- gap: var(--ds-space-3, .75rem);
226
- overflow-wrap: anywhere;
227
- align-items: start;
228
- }
229
-
230
- .binding-endpoint, .binding-v2-endpoint {
231
- font-family: var(--ds-font-family-mono, monospace);
232
- font-size: var(--ds-font-size-sm, .8125rem);
233
- overflow-wrap: anywhere;
234
- }
235
-
236
- .binding-preview-parts, .binding-v2-preview-parts {
237
- display: grid;
238
- grid-template-columns: repeat(auto-fill, minmax(var(--ds-menu-min-width, 12rem), 1fr));
239
- gap: var(--ds-space-3, .75rem);
240
- }
241
-
242
- .binding-pre, .binding-v2-pre {
243
- font-family: var(--ds-font-family-mono, monospace);
244
- font-size: var(--ds-font-size-sm, .8125rem);
245
- white-space: pre-wrap;
246
- overflow-wrap: anywhere;
247
- margin: 0;
248
- }