Skip to content

Commit d878510

Browse files
committed
feat(sdk): typing improvements -- configurableProp.withLabel, app.featured_weight, docs (1.5.1)
1 parent 7d1bbdc commit d878510

File tree

5 files changed

+57
-8
lines changed

5 files changed

+57
-8
lines changed

packages/sdk/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
# Changelog
44

5+
## [1.5.1] - 2025-04-15
6+
7+
### Added
8+
9+
- `withLabel` to `BaseConfigurableProp` type definition
10+
- documentation describing various fields in `BaseConfigurableProp`
11+
- `featured_weight` to `App` type definition now that API returns this value
12+
513
## [1.5.0] - 2025-04-08
614

715
### Added

packages/sdk/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@pipedream/sdk",
33
"type": "module",
4-
"version": "1.5.0",
4+
"version": "1.5.1",
55
"description": "Pipedream SDK",
66
"main": "./dist/server.js",
77
"module": "./dist/server.js",

packages/sdk/src/shared/component.ts

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,57 @@
11
// eslint-disable @typescript-eslint/no-explicit-any
22
type BaseConfigurableProp = {
3+
/**
4+
* When building `configuredProps`, make sure to use this field as the key when
5+
* setting the prop value.
6+
*/
37
name: string;
48
type: string;
59

610
// XXX don't actually apply to all, fix
11+
12+
/**
13+
* Value to use as an input label. In cases where `type` is "app", should load
14+
* the app via `getApp`, etc. and show `app.name` instead.
15+
*/
716
label?: string;
17+
818
description?: string;
919
optional?: boolean;
1020
disabled?: boolean;
21+
22+
/**
23+
* If true, should not expose this prop to the user.
24+
*/
1125
hidden?: boolean;
26+
27+
/**
28+
* If true, call `configureComponent` for this prop to load remote options.
29+
* It is safe, and preferred, given a returned list of
30+
* { label: string; value: any } objects to set the prop
31+
* value to { __lv: { label: string; value: any } }. This way, on load, you
32+
* can access label for the value without necessarily reloading these options.
33+
*/
1234
remoteOptions?: boolean;
35+
36+
/**
37+
* If true, calls to `configureComponent` for this prop support receiving a
38+
* `query` parameter to filter remote options.
39+
*/
1340
useQuery?: boolean;
41+
42+
/**
43+
* If true, after setting a value for this prop, a call to `reloadComponentProps` is
44+
* required as the component has dynamic configurable props dependent on this
45+
* one.
46+
*/
1447
reloadProps?: boolean;
48+
49+
/**
50+
* If true, you must save the configured prop value as a "label-value" object
51+
* which should look like: { __lv: { label: string; value: any } }
52+
* because the execution needs to access the label.
53+
*/
54+
withLabel?: boolean;
1555
};
1656

1757
// XXX fix duplicating mapping to value type here and with PropValue

packages/sdk/src/shared/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,11 @@ export type App = AppInfo & {
109109
* Categories associated with the app.
110110
*/
111111
categories: string[];
112+
113+
/**
114+
* A rough directional ordering of app popularity, subject to changes by Pipedream.
115+
*/
116+
featured_weight: number
112117
};
113118

114119
/**

pnpm-lock.yaml

Lines changed: 3 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)