@integry/sdk 4.9.24 → 4.9.26

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.
package/README.md CHANGED
@@ -46,3 +46,13 @@ activity fields for `type`, `activity_type`, `endpoint_id`, and `session_id`. Fo
46
46
  }
47
47
  }
48
48
  ```
49
+
50
+ ## Headless function-to-tool conversion
51
+
52
+ Use `getFunctionTools` when you already have function details (for example from `getFunctionDetails`) and only want a tool payload without rendering UI.
53
+
54
+ ```ts
55
+ const tool = sdk.getFunctionTools(functionDetails);
56
+ const staticTool = IntegryJS.Helpers.getFunctionTools(functionDetails);
57
+ ```
58
+
@@ -318,9 +318,33 @@ type RenderFlowStepOptions = {
318
318
  enableExpandedTextarea?: boolean;
319
319
  requireAuthentication?: boolean;
320
320
  };
321
+ type FunctionTool = {
322
+ json_schema: {
323
+ type: "function";
324
+ function: any;
325
+ };
326
+ meta: {
327
+ id?: number | string;
328
+ version?: string | null;
329
+ connected_account_id: string | number | null;
330
+ form_page_machine_name: string | null;
331
+ name?: string;
332
+ title?: string;
333
+ app_name?: string;
334
+ app_icon_url?: string;
335
+ ai_assisted_fields: string[];
336
+ type?: string;
337
+ activity_type?: string;
338
+ endpoint_id?: number | string;
339
+ session_id?: string;
340
+ };
341
+ default_arguments: Record<string, any>;
342
+ parameters_visible_to_user: Record<string, any>;
343
+ };
321
344
  type RenderFunctionFormOptions = {
322
345
  containerId: string;
323
346
  functionName: string | null;
347
+ version?: string | null;
324
348
  activity_id?: number | string | null;
325
349
  /**
326
350
  * When true, the saved json_schema.meta mirrors the activity details meta shape.
@@ -338,6 +362,7 @@ type RenderFunctionFormOptions = {
338
362
  enableExpandedTextarea?: boolean;
339
363
  variables?: Record<string, any>;
340
364
  queryParams?: Record<string, any>;
365
+ hideOptionalFields?: boolean;
341
366
  };
342
367
  type RenderMappingMenuOptions = {
343
368
  containerId: string;
@@ -770,6 +795,7 @@ declare class EventEmitter<ESet extends EventSet> implements EventEmitterType<Ev
770
795
  }
771
796
  declare const Helpers: {
772
797
  getAuthHash: typeof HMAC;
798
+ getFunctionTools: (functionStructure: any) => FunctionTool;
773
799
  };
774
800
  /**
775
801
  * Integry JS SDK
@@ -789,6 +815,7 @@ declare class IntegryJS {
789
815
  static MarketplaceRenderModes: typeof MarketplaceRenderModes;
790
816
  static Helpers: {
791
817
  getAuthHash: (key: string, message: string) => Promise<string>;
818
+ getFunctionTools: (functionStructure: any) => FunctionTool;
792
819
  };
793
820
  private authModalId;
794
821
  private forceRerender;
@@ -923,6 +950,7 @@ declare class IntegryJS {
923
950
  }) => void;
924
951
  renderFunctionForm: (options?: RenderFunctionFormOptions) => void;
925
952
  renderFunctionField: (containerId: string, functionFieldProps: FunctionFieldType) => void;
953
+ getFunctionTools: (functionStructure: any) => FunctionTool;
926
954
  renderAppAuthorizations: (options?: RenderAppAuthrozationsOptions) => Promise<void>;
927
955
  renderFlowStep: (options?: RenderFlowStepOptions) => void;
928
956
  renderMappingMenu: (options?: RenderMappingMenuOptions) => void;