@integry/sdk 4.8.76 → 4.8.78

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
@@ -19,3 +19,23 @@ npm i @integry/sdk
19
19
  ```
20
20
 
21
21
  Get started and learn more using our [documentation.](https://sdk.integry.io)
22
+
23
+ ## Activity meta passthrough (renderFunctionForm)
24
+
25
+ When `is_activity: true` is used with `renderFunctionForm`, the saved
26
+ `json_schema.meta` is a verbatim copy of the activity details response meta
27
+ shape (including nested `app` and `ui` fields). For example:
28
+
29
+ ```json
30
+ {
31
+ "json_schema": {
32
+ "type": "function",
33
+ "function": { "name": "activities.send_message" }
34
+ },
35
+ "meta": {
36
+ "type": "ACTIVITY",
37
+ "app": { "title": "Slack", "icon_url": "https://..." },
38
+ "ui": { "title": "Send message" }
39
+ }
40
+ }
41
+ ```
@@ -11,6 +11,18 @@ declare enum RenderModes {
11
11
  MODAL = "MODAL",
12
12
  INLINE = "INLINE"
13
13
  }
14
+ type CustomFunctionSelection = {
15
+ id: number | string;
16
+ isActivity?: boolean;
17
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
18
+ preloadedValue?: any;
19
+ };
20
+ type CustomFunctionSelectionHandler = {
21
+ (id: number | string,
22
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
23
+ preloadedValue?: any, selectActivity?: boolean): void | Promise<void>;
24
+ (selection: CustomFunctionSelection): void | Promise<void>;
25
+ };
14
26
  type IntegrySDKEventPayloads = {
15
27
  ready: {
16
28
  isReady: boolean;
@@ -275,7 +287,12 @@ type RenderFlowStepOptions = {
275
287
  containerId: string;
276
288
  }) => void;
277
289
  functionsListContainerId?: string;
278
- onCustomFunctionSelect?: (handler: (functionId: number | string) => void | Promise<void>) => void;
290
+ /**
291
+ * Pass a handler to receive selections from custom function/activity pickers.
292
+ * Clients can call the handler with `(id, preloadedValue?, true)` for activities,
293
+ * or with `{ id, isActivity: true, preloadedValue }`.
294
+ */
295
+ onCustomFunctionSelect?: (handler: CustomFunctionSelectionHandler) => void;
279
296
  enableExpandedTextarea?: boolean;
280
297
  requireAuthentication?: boolean;
281
298
  };
@@ -283,6 +300,9 @@ type RenderFunctionFormOptions = {
283
300
  containerId: string;
284
301
  functionName: string | null;
285
302
  activity_id?: number | string | null;
303
+ /**
304
+ * When true, the saved json_schema.meta mirrors the activity details meta shape.
305
+ */
286
306
  is_activity?: boolean;
287
307
  onChange?: (val: any) => void;
288
308
  value?: any;
@@ -689,7 +709,11 @@ interface FunctionFieldType {
689
709
  containerId: string;
690
710
  }) => void;
691
711
  functionsListContainerId?: string;
692
- onCustomFunctionSelect?: (handler: (functionId: number | string) => void | Promise<void>) => void;
712
+ /**
713
+ * Provide a handler that can receive function or activity selections.
714
+ * Call it as `(id, preloadedValue?, true)` or `{ id, isActivity: true, preloadedValue }`.
715
+ */
716
+ onCustomFunctionSelect?: (handler: CustomFunctionSelectionHandler) => void;
693
717
  }
694
718
  /**
695
719
  *