Skip to content

Commit 9236a2d

Browse files
committed
fix(docs): preserve items response fields
1 parent 1874cec commit 9236a2d

8 files changed

Lines changed: 295 additions & 39 deletions

File tree

‎apps/docs/content/docs/en/integrations/gong.mdx‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@ Retrieve detailed call data including trackers, topics, highlights, and AI spotl
247247
| ↳ `section` | string | Outline section name |
248248
| ↳ `startTime` | number | Section start in seconds from call start |
249249
| ↳ `duration` | number | Section duration in seconds |
250+
| ↳ `items` | array | Bullet items within the section |
250251
| ↳ `keyPoints` | array | AI-generated key points of the call |
251252
| ↳ `text` | string | Key point text |
252253
| ↳ `callOutcome` | object | AI-determined call outcome \(Call Spotlight\) |
@@ -273,6 +274,9 @@ Retrieve detailed call data including trackers, topics, highlights, and AI spotl
273274
| ↳ `occurrences` | array | Details per occurrence |
274275
| ↳ `highlights` | array | AI-generated highlights including next steps, action items, and key moments |
275276
| ↳ `title` | string | Title of the highlight |
277+
| ↳ `items` | array | Individual highlight items |
278+
| ↳ `text` | string | Text of the highlight item |
279+
| ↳ `startTimes` | array | Start times in seconds from call start |
276280
| ↳ `interaction` | object | Interaction statistics |
277281
| ↳ `interactionStats` | array | Interaction stat measurements \(Longest Monologue, Interactivity, Patience, etc.\) |
278282
| ↳ `name` | string | Stat name |

‎apps/docs/content/docs/en/integrations/google_forms.mdx‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,16 @@ Apply multiple updates to a form (add items, update info, change settings, etc.)
146146
| ↳ `quizSettings` | object | Quiz settings |
147147
| ↳ `isQuiz` | boolean | Whether the form is a quiz |
148148
| ↳ `emailCollectionType` | string | Email collection type |
149+
| ↳ `items` | array | The form items \(questions, sections, etc.\) |
150+
| ↳ `itemId` | string | Item ID |
151+
| ↳ `title` | string | Item title |
152+
| ↳ `description` | string | Item description |
153+
| ↳ `questionItem` | json | Question item configuration |
154+
| ↳ `questionGroupItem` | json | Question group configuration |
155+
| ↳ `pageBreakItem` | json | Page break configuration |
156+
| ↳ `textItem` | json | Text item configuration |
157+
| ↳ `imageItem` | json | Image item configuration |
158+
| ↳ `videoItem` | json | Video item configuration |
149159
| ↳ `revisionId` | string | The revision ID of the form |
150160
| ↳ `responderUri` | string | The URI to share with responders |
151161
| ↳ `linkedSheetId` | string | The ID of the linked Google Sheet |

‎apps/docs/content/docs/en/integrations/onepassword.mdx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ List all vaults accessible by the Connect token or Service Account
5959
| ↳ `description` | string | Vault description |
6060
| ↳ `attributeVersion` | number | Vault attribute version |
6161
| ↳ `contentVersion` | number | Vault content version |
62+
| ↳ `items` | number | Number of items in the vault |
6263
| ↳ `type` | string | Vault type \(USER_CREATED, PERSONAL, or EVERYONE\) |
6364
| ↳ `createdAt` | string | Creation timestamp |
6465
| ↳ `updatedAt` | string | Last update timestamp |

‎apps/docs/content/docs/en/integrations/sap_concur.mdx‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1479,6 +1479,7 @@ List allocations on an expense (GET /expensereports/v4/users/\{userId\}/context/
14791479
| --------- | ---- | ----------- |
14801480
| `status` | number | HTTP status code returned by Concur |
14811481
| `data` | json | Allocations list payload |
1482+
| ↳ `items` | array | Array of allocation objects \(allocationId, accountCode, percentage, allocationAmount, approvedAmount, claimedAmount, customData, expenseId, isSystemAllocation, isPercentEdited, overLimitAccountCode\) |
14821483

14831484
### SAP Concur List Attendee Associations
14841485

@@ -1547,6 +1548,12 @@ List budget categories (GET /budget/v4/budgetCategory).
15471548
| --------- | ---- | ----------- |
15481549
| `status` | number | HTTP status code returned by Concur |
15491550
| `data` | json | Budget categories collection payload |
1551+
| ↳ `items` | array | Array of budget category objects |
1552+
| ↳ `id` | string | Category ID |
1553+
| ↳ `name` | string | Admin-facing category name |
1554+
| ↳ `description` | string | Friendly name |
1555+
| ↳ `statusType` | string | Status: OPEN or REMOVED |
1556+
| ↳ `expenseTypes` | array | Expense types in this category \(id, featureTypeCode, expenseTypeCode, name\) |
15501557

15511558
### SAP Concur List Budgets
15521559

@@ -1573,6 +1580,7 @@ List budget item headers (GET /budget/v4/budgetItemHeader).
15731580
| --------- | ---- | ----------- |
15741581
| `status` | number | HTTP status code returned by Concur |
15751582
| `data` | json | Budget headers collection payload |
1583+
| ↳ `items` | array | Array of budget item header summaries \(id, name, description, budgetItemStatusType, budgetType, currencyCode, fiscalYear, budgetAmounts, owner, ...\) |
15761584
| ↳ `offset` | number | Page offset |
15771585
| ↳ `limit` | number | Page size |
15781586
| ↳ `totalCount` | number | Total result count |

‎apps/docs/content/docs/en/integrations/sharepoint.mdx‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,9 @@ Get metadata (and optionally columns/items) for a SharePoint list
267267
| ↳ `lastModifiedDateTime` | string | When the list was last modified |
268268
| ↳ `list` | object | List properties \(e.g., template\) |
269269
| ↳ `columns` | array | List column definitions |
270+
| ↳ `items` | array | List items \(with fields when expanded\) |
271+
| ↳ `id` | string | Item ID |
272+
| ↳ `fields` | object | Field values for the item |
270273
| `lists` | array | All lists in the site when no listId/title provided |
271274
| `items` | array | List items with expanded fields when reading list items |
272275
| ↳ `id` | string | Item ID |

‎apps/docs/content/docs/en/integrations/stripe.mdx‎

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -961,6 +961,20 @@ Create a new subscription for a customer
961961
| ↳ `description` | string | Subscription description \(max 500 characters\) |
962962
| ↳ `discount` | json | Discount that applies to the subscription |
963963
| ↳ `ended_at` | number | Unix timestamp when the subscription ended |
964+
| ↳ `items` | object | List of subscription items |
965+
| ↳ `object` | string | String representing the object type \(list\) |
966+
| ↳ `data` | array | Array of subscription items |
967+
| ↳ `id` | string | Unique identifier for the subscription item |
968+
| ↳ `object` | string | String representing the object type \(subscription_item\) |
969+
| ↳ `billing_thresholds` | json | Billing thresholds for the subscription item |
970+
| ↳ `created` | number | Unix timestamp when the item was added |
971+
| ↳ `metadata` | json | Set of key-value pairs for storing additional information |
972+
| ↳ `price` | json | Price object for this subscription item |
973+
| ↳ `quantity` | number | Quantity of the plan to subscribe to |
974+
| ↳ `subscription` | string | ID of the subscription this item belongs to |
975+
| ↳ `tax_rates` | array | Tax rates applied to this subscription item |
976+
| ↳ `has_more` | boolean | Whether there are more items |
977+
| ↳ `url` | string | URL to fetch more items |
964978
| ↳ `latest_invoice` | string | ID of the most recent invoice |
965979
| ↳ `livemode` | boolean | Whether object exists in live mode or test mode |
966980
| ↳ `metadata` | json | Set of key-value pairs for storing additional information |
@@ -1024,6 +1038,20 @@ Retrieve an existing subscription by ID
10241038
| ↳ `description` | string | Subscription description \(max 500 characters\) |
10251039
| ↳ `discount` | json | Discount that applies to the subscription |
10261040
| ↳ `ended_at` | number | Unix timestamp when the subscription ended |
1041+
| ↳ `items` | object | List of subscription items |
1042+
| ↳ `object` | string | String representing the object type \(list\) |
1043+
| ↳ `data` | array | Array of subscription items |
1044+
| ↳ `id` | string | Unique identifier for the subscription item |
1045+
| ↳ `object` | string | String representing the object type \(subscription_item\) |
1046+
| ↳ `billing_thresholds` | json | Billing thresholds for the subscription item |
1047+
| ↳ `created` | number | Unix timestamp when the item was added |
1048+
| ↳ `metadata` | json | Set of key-value pairs for storing additional information |
1049+
| ↳ `price` | json | Price object for this subscription item |
1050+
| ↳ `quantity` | number | Quantity of the plan to subscribe to |
1051+
| ↳ `subscription` | string | ID of the subscription this item belongs to |
1052+
| ↳ `tax_rates` | array | Tax rates applied to this subscription item |
1053+
| ↳ `has_more` | boolean | Whether there are more items |
1054+
| ↳ `url` | string | URL to fetch more items |
10271055
| ↳ `latest_invoice` | string | ID of the most recent invoice |
10281056
| ↳ `livemode` | boolean | Whether object exists in live mode or test mode |
10291057
| ↳ `metadata` | json | Set of key-value pairs for storing additional information |
@@ -1090,6 +1118,20 @@ Update an existing subscription
10901118
| ↳ `description` | string | Subscription description \(max 500 characters\) |
10911119
| ↳ `discount` | json | Discount that applies to the subscription |
10921120
| ↳ `ended_at` | number | Unix timestamp when the subscription ended |
1121+
| ↳ `items` | object | List of subscription items |
1122+
| ↳ `object` | string | String representing the object type \(list\) |
1123+
| ↳ `data` | array | Array of subscription items |
1124+
| ↳ `id` | string | Unique identifier for the subscription item |
1125+
| ↳ `object` | string | String representing the object type \(subscription_item\) |
1126+
| ↳ `billing_thresholds` | json | Billing thresholds for the subscription item |
1127+
| ↳ `created` | number | Unix timestamp when the item was added |
1128+
| ↳ `metadata` | json | Set of key-value pairs for storing additional information |
1129+
| ↳ `price` | json | Price object for this subscription item |
1130+
| ↳ `quantity` | number | Quantity of the plan to subscribe to |
1131+
| ↳ `subscription` | string | ID of the subscription this item belongs to |
1132+
| ↳ `tax_rates` | array | Tax rates applied to this subscription item |
1133+
| ↳ `has_more` | boolean | Whether there are more items |
1134+
| ↳ `url` | string | URL to fetch more items |
10931135
| ↳ `latest_invoice` | string | ID of the most recent invoice |
10941136
| ↳ `livemode` | boolean | Whether object exists in live mode or test mode |
10951137
| ↳ `metadata` | json | Set of key-value pairs for storing additional information |
@@ -1155,6 +1197,20 @@ Cancel a subscription
11551197
| ↳ `description` | string | Subscription description \(max 500 characters\) |
11561198
| ↳ `discount` | json | Discount that applies to the subscription |
11571199
| ↳ `ended_at` | number | Unix timestamp when the subscription ended |
1200+
| ↳ `items` | object | List of subscription items |
1201+
| ↳ `object` | string | String representing the object type \(list\) |
1202+
| ↳ `data` | array | Array of subscription items |
1203+
| ↳ `id` | string | Unique identifier for the subscription item |
1204+
| ↳ `object` | string | String representing the object type \(subscription_item\) |
1205+
| ↳ `billing_thresholds` | json | Billing thresholds for the subscription item |
1206+
| ↳ `created` | number | Unix timestamp when the item was added |
1207+
| ↳ `metadata` | json | Set of key-value pairs for storing additional information |
1208+
| ↳ `price` | json | Price object for this subscription item |
1209+
| ↳ `quantity` | number | Quantity of the plan to subscribe to |
1210+
| ↳ `subscription` | string | ID of the subscription this item belongs to |
1211+
| ↳ `tax_rates` | array | Tax rates applied to this subscription item |
1212+
| ↳ `has_more` | boolean | Whether there are more items |
1213+
| ↳ `url` | string | URL to fetch more items |
11581214
| ↳ `latest_invoice` | string | ID of the most recent invoice |
11591215
| ↳ `livemode` | boolean | Whether object exists in live mode or test mode |
11601216
| ↳ `metadata` | json | Set of key-value pairs for storing additional information |
@@ -1218,6 +1274,20 @@ Resume a subscription that was scheduled for cancellation
12181274
| ↳ `description` | string | Subscription description \(max 500 characters\) |
12191275
| ↳ `discount` | json | Discount that applies to the subscription |
12201276
| ↳ `ended_at` | number | Unix timestamp when the subscription ended |
1277+
| ↳ `items` | object | List of subscription items |
1278+
| ↳ `object` | string | String representing the object type \(list\) |
1279+
| ↳ `data` | array | Array of subscription items |
1280+
| ↳ `id` | string | Unique identifier for the subscription item |
1281+
| ↳ `object` | string | String representing the object type \(subscription_item\) |
1282+
| ↳ `billing_thresholds` | json | Billing thresholds for the subscription item |
1283+
| ↳ `created` | number | Unix timestamp when the item was added |
1284+
| ↳ `metadata` | json | Set of key-value pairs for storing additional information |
1285+
| ↳ `price` | json | Price object for this subscription item |
1286+
| ↳ `quantity` | number | Quantity of the plan to subscribe to |
1287+
| ↳ `subscription` | string | ID of the subscription this item belongs to |
1288+
| ↳ `tax_rates` | array | Tax rates applied to this subscription item |
1289+
| ↳ `has_more` | boolean | Whether there are more items |
1290+
| ↳ `url` | string | URL to fetch more items |
12211291
| ↳ `latest_invoice` | string | ID of the most recent invoice |
12221292
| ↳ `livemode` | boolean | Whether object exists in live mode or test mode |
12231293
| ↳ `metadata` | json | Set of key-value pairs for storing additional information |
@@ -1284,6 +1354,20 @@ List all subscriptions
12841354
| ↳ `description` | string | Subscription description \(max 500 characters\) |
12851355
| ↳ `discount` | json | Discount that applies to the subscription |
12861356
| ↳ `ended_at` | number | Unix timestamp when the subscription ended |
1357+
| ↳ `items` | object | List of subscription items |
1358+
| ↳ `object` | string | String representing the object type \(list\) |
1359+
| ↳ `data` | array | Array of subscription items |
1360+
| ↳ `id` | string | Unique identifier for the subscription item |
1361+
| ↳ `object` | string | String representing the object type \(subscription_item\) |
1362+
| ↳ `billing_thresholds` | json | Billing thresholds for the subscription item |
1363+
| ↳ `created` | number | Unix timestamp when the item was added |
1364+
| ↳ `metadata` | json | Set of key-value pairs for storing additional information |
1365+
| ↳ `price` | json | Price object for this subscription item |
1366+
| ↳ `quantity` | number | Quantity of the plan to subscribe to |
1367+
| ↳ `subscription` | string | ID of the subscription this item belongs to |
1368+
| ↳ `tax_rates` | array | Tax rates applied to this subscription item |
1369+
| ↳ `has_more` | boolean | Whether there are more items |
1370+
| ↳ `url` | string | URL to fetch more items |
12871371
| ↳ `latest_invoice` | string | ID of the most recent invoice |
12881372
| ↳ `livemode` | boolean | Whether object exists in live mode or test mode |
12891373
| ↳ `metadata` | json | Set of key-value pairs for storing additional information |
@@ -1347,6 +1431,20 @@ Search for subscriptions using query syntax
13471431
| ↳ `description` | string | Subscription description \(max 500 characters\) |
13481432
| ↳ `discount` | json | Discount that applies to the subscription |
13491433
| ↳ `ended_at` | number | Unix timestamp when the subscription ended |
1434+
| ↳ `items` | object | List of subscription items |
1435+
| ↳ `object` | string | String representing the object type \(list\) |
1436+
| ↳ `data` | array | Array of subscription items |
1437+
| ↳ `id` | string | Unique identifier for the subscription item |
1438+
| ↳ `object` | string | String representing the object type \(subscription_item\) |
1439+
| ↳ `billing_thresholds` | json | Billing thresholds for the subscription item |
1440+
| ↳ `created` | number | Unix timestamp when the item was added |
1441+
| ↳ `metadata` | json | Set of key-value pairs for storing additional information |
1442+
| ↳ `price` | json | Price object for this subscription item |
1443+
| ↳ `quantity` | number | Quantity of the plan to subscribe to |
1444+
| ↳ `subscription` | string | ID of the subscription this item belongs to |
1445+
| ↳ `tax_rates` | array | Tax rates applied to this subscription item |
1446+
| ↳ `has_more` | boolean | Whether there are more items |
1447+
| ↳ `url` | string | URL to fetch more items |
13501448
| ↳ `latest_invoice` | string | ID of the most recent invoice |
13511449
| ↳ `livemode` | boolean | Whether object exists in live mode or test mode |
13521450
| ↳ `metadata` | json | Set of key-value pairs for storing additional information |

‎scripts/generate-docs.test.ts‎

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
import { describe, expect, it } from 'vitest'
2+
import { parseConstProperties, parsePropertiesContent } from './generate-docs'
3+
4+
describe('documentation output property parsing', () => {
5+
it('keeps a response field named items inside an array element', () => {
6+
const properties = parsePropertiesContent(`
7+
vaults: {
8+
type: 'array',
9+
description: 'List of accessible vaults',
10+
items: {
11+
type: 'object',
12+
properties: {
13+
id: { type: 'string', description: 'Vault ID' },
14+
items: { type: 'number', description: 'Number of items in the vault' },
15+
},
16+
},
17+
},
18+
`)
19+
20+
expect(Object.keys(properties)).toEqual(['vaults'])
21+
expect(properties.vaults.items.properties.items).toEqual({
22+
type: 'number',
23+
description: 'Number of items in the vault',
24+
})
25+
})
26+
27+
it('keeps a response field named items that directly references a constant', () => {
28+
const properties = parsePropertiesContent('items: ATTENDEES_OUTPUT,', 'calcom')
29+
30+
expect(properties.items).toMatchObject({
31+
type: 'array',
32+
description: 'List of attendees',
33+
})
34+
})
35+
36+
it('keeps a response field named items that references a constant property', () => {
37+
const properties = parsePropertiesContent('items: EVENT_TYPE_OUTPUT_PROPERTIES.id,', 'calcom')
38+
39+
expect(properties.items).toEqual({
40+
type: 'number',
41+
description: 'Event type ID',
42+
})
43+
})
44+
45+
it('keeps items fields in constant-defined property maps', () => {
46+
const typesContent = `
47+
export const RECORD_OUTPUT_PROPERTIES = {
48+
id: { type: 'string', description: 'Record ID' },
49+
}
50+
`
51+
const properties = parseConstProperties(
52+
`
53+
items: {
54+
type: 'object',
55+
description: 'Result page',
56+
properties: {
57+
object: { type: 'string', description: 'Page type' },
58+
data: {
59+
type: 'array',
60+
description: 'Result records',
61+
items: { type: 'object', properties: RECORD_OUTPUT_PROPERTIES },
62+
},
63+
hasMore: { type: 'boolean', description: 'Whether more results exist' },
64+
},
65+
},
66+
`,
67+
'test',
68+
typesContent,
69+
0
70+
)
71+
72+
expect(Object.keys(properties)).toEqual(['items'])
73+
expect(Object.keys(properties.items.properties)).toEqual(['object', 'data', 'hasMore'])
74+
expect(properties.items.properties.data.items.properties.id).toEqual({
75+
type: 'string',
76+
description: 'Record ID',
77+
})
78+
})
79+
})

0 commit comments

Comments
 (0)