Skip to content

Commit 991d316

Browse files
Fixing component key references in Connect docs (#16653)
* Fixing component key references You can pass component keys in a structured object or as a string, updating the docs to use a common string interface to reduce complexity. * Update pnpm-lock.yaml * Fixing over-zealous Claude
1 parent 970ca68 commit 991d316

File tree

2 files changed

+15
-31
lines changed

2 files changed

+15
-31
lines changed

docs-v2/pages/connect/api.mdx

Lines changed: 9 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1314,9 +1314,7 @@ const pd = createBackendClient({
13141314
});
13151315

13161316
// Retrieve the "New Issue (Instant)" component for the Gitlab app
1317-
const { data: component } = await pd.getComponent({
1318-
key: "gitlab-new-issue",
1319-
});
1317+
const { data: component } = await pd.getComponent({ key: "gitlab-new-issue" });
13201318

13211319
// Parse and return the data you need
13221320
```
@@ -1452,9 +1450,7 @@ const pd: BackendClient = createBackendClient(clientOpts);
14521450
// Retrieve the configuration options for the "projectId" prop of the "List
14531451
// Commits" component for the Gitlab app.
14541452
const requestOpts: ConfigureComponentOpts = {
1455-
componentId: {
1456-
key: "gitlab-list-commits",
1457-
},
1453+
id: "gitlab-list-commits",
14581454
configuredProps: {
14591455
gitlab: {
14601456
authProvisionId: "apn_kVh9AoD",
@@ -1493,9 +1489,7 @@ const pd = createBackendClient({
14931489
// Retrieve the configuration options for the "projectId" prop of the "List
14941490
// Commits" component for the Gitlab app.
14951491
const { options } = await pd.configureComponent({
1496-
componentId: {
1497-
key: "gitlab-list-commits",
1498-
},
1492+
id: "gitlab-list-commits",
14991493
configuredProps: {
15001494
gitlab: {
15011495
authProvisionId: "apn_kVh9AoD",
@@ -1668,9 +1662,7 @@ const pd: BackendClient = createBackendClient(clientOpts);
16681662
// Retrieve the configuration options for the "Add Single Row" component for
16691663
// the Google Sheets app. Note that the `sheetId` prop is a dynamic prop.
16701664
const requestOpts: ReloadComponentPropsOpts = {
1671-
componentId: {
1672-
key: "google_sheets-add-single-row",
1673-
},
1665+
id: "google_sheets-add-single-row",
16741666
configuredProps: {
16751667
googleSheets: {
16761668
authProvisionId: "apn_V1hMoE7",
@@ -1707,9 +1699,7 @@ const pd = createBackendClient({
17071699
// Retrieve the configuration options for the "Add Single Row" component for
17081700
// the Google Sheets app. Note that the `sheetId` prop is a dynamic prop.
17091701
const { dynamicProps } = await pd.reloadComponentProps({
1710-
componentId: {
1711-
key: "google_sheets-add-single-row",
1712-
},
1702+
id: "google_sheets-add-single-row",
17131703
configuredProps: {
17141704
googleSheets: {
17151705
authProvisionId: "apn_V1hMoE7",
@@ -1883,9 +1873,7 @@ const pd: BackendClient = createBackendClient(clientOpts);
18831873

18841874
// Run the "List Commits" action for the Gitlab app
18851875
const requestOpts: RunActionOpts = {
1886-
actionId: {
1887-
key: "gitlab-list-commits",
1888-
},
1876+
id: "gitlab-list-commits",
18891877
configuredProps: {
18901878
gitlab: {
18911879
authProvisionId: "apn_kVh9AoD",
@@ -1928,9 +1916,7 @@ const {
19281916
os, // The observations produced by the action
19291917
ret, // The value returned by the action
19301918
} = await pd.runAction({
1931-
actionId: {
1932-
key: "gitlab-list-commits",
1933-
},
1919+
id: "gitlab-list-commits",
19341920
configuredProps: {
19351921
gitlab: {
19361922
authProvisionId: "apn_kVh9AoD",
@@ -2092,9 +2078,7 @@ const pd: BackendClient = createBackendClient(clientOpts);
20922078

20932079
// Deploy the "New Issue (Instant)" trigger for the Gitlab app
20942080
const requestOpts: DeployTriggerOpts = {
2095-
triggerId: {
2096-
key: "gitlab-new-issue",
2097-
},
2081+
id: "gitlab-new-issue",
20982082
configuredProps: {
20992083
gitlab: {
21002084
authProvisionId: "apn_kVh9AoD",
@@ -2133,9 +2117,7 @@ const pd = createBackendClient({
21332117

21342118
// Deploy the "New Issue (Instant)" trigger for the Gitlab app
21352119
const { data: deployedTrigger } = await pd.deployTrigger({
2136-
triggerId: {
2137-
key: "gitlab-new-issue",
2138-
},
2120+
id: "gitlab-new-issue",
21392121
configuredProps: {
21402122
gitlab: {
21412123
authProvisionId: "apn_kVh9AoD",

docs-v2/pages/connect/components.mdx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,10 @@ steps, focused on getting the right input parameters (aka
305305
Configuring each prop for a component often involves an API call to retrieve the possible values,
306306
unless the values that a prop can take are static or free-form. The endpoint is accessible at:
307307

308+
```
309+
POST /v1/connect/{project_id}/components/configure
310+
```
311+
308312
Typically, the options for a prop are linked to a specific user's account. Each
309313
of these props implements an `options` method that retrieves the necessary
310314
options from the third-party API, formats them, and sends them back in the
@@ -1119,9 +1123,7 @@ You can call `configureComponent` on the `sql` prop to retrieve database schema
11191123
const resp = await pd.configureComponent({
11201124
externalUserId: externalUserId,
11211125
propName: "sql",
1122-
componentId: {
1123-
key: "postgresql-execute-custom-query",
1124-
},
1126+
id: "postgresql-execute-custom-query",
11251127
configuredProps: {
11261128
postgresql: {
11271129
authProvisionId: accountId
@@ -1234,7 +1236,7 @@ const { dynamicProps } = await pd.reloadProps({ … });
12341236
const resp = await pd.runAction({
12351237
externalUserId: "abc-123",
12361238
id: "google_sheets-add-single-row",
1237-
dynamicPropsId: dynamicProps.id, // Must include this
1239+
dynamicPropsId: dynamicProps.id, // Must include this
12381240
configuredProps: {
12391241
googleSheets: {
12401242
authProvisionId: account.id,

0 commit comments

Comments
 (0)