Skip to content

Commit 23ebf8c

Browse files
wixysamcursoragent
andcommitted
Fix JSDoc links and add connectors to type generation docs
- Fix all module JSDoc links to reference /dynamic-types instead of /generated-types - Remove bad import example from EntityRecord JSDoc (don't import from @base44/.types/types) - Add connectors to type generation documentation following the pattern for entities/functions/agents - Update ConnectorIntegrationTypeRegistry and ConnectorIntegrationType JSDoc to match other registries - Add Dynamic Types section to ConnectorsModule JSDoc Addresses PR feedback from kfirstri on PR #127. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent c1c7c16 commit 23ebf8c

File tree

4 files changed

+16
-10
lines changed

4 files changed

+16
-10
lines changed

src/modules/agents.types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ export interface AgentsModuleConfig {
205205
*
206206
* ## Generated Types
207207
*
208-
* If you're working in a TypeScript project, you can generate types from your agents to get autocomplete on agent names when creating conversations or subscribing to updates. See the [Generated Types](/developers/references/sdk/getting-started/generated-types) guide to get started.
208+
* If you're working in a TypeScript project, you can generate types from your agents to get autocomplete on agent names when creating conversations or subscribing to updates. See the [Dynamic Types](/developers/references/sdk/getting-started/dynamic-types) guide to get started.
209209
*/
210210
export interface AgentsModule {
211211
/**

src/modules/connectors.types.ts

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
/**
2-
* Registry of connector integration types.
3-
* Augment this interface to enable autocomplete for connector integration types.
2+
* Registry of connector integration type names. The [`types generate`](/developers/references/cli/commands/types-generate) command fills this registry, then [`ConnectorIntegrationType`](#connectorintegrationtype) resolves to a union of the keys.
43
*/
54
export interface ConnectorIntegrationTypeRegistry {}
65

76
/**
8-
* The type of external integration/connector, such as `'googlecalendar'`, `'slack'`, or `'github'`.
9-
* Uses registry keys if augmented, otherwise falls back to string.
7+
* Union of all connector integration type names from the [`ConnectorIntegrationTypeRegistry`](#connectorintegrationtyperegistry). Defaults to `string` when no types have been generated.
8+
*
9+
* @example
10+
* ```typescript
11+
* // Using generated connector type names
12+
* // With generated types, you get autocomplete on integration types
13+
* const token = await base44.asServiceRole.connectors.getAccessToken('googlecalendar');
14+
* ```
1015
*/
1116
export type ConnectorIntegrationType = keyof ConnectorIntegrationTypeRegistry extends never
1217
? string
@@ -30,6 +35,10 @@ export interface ConnectorAccessTokenResponse {
3035
* covered by Base44's pre-built integrations.
3136
*
3237
* This module is only available to use with a client in service role authentication mode, which means it can only be used in backend environments.
38+
*
39+
* ## Dynamic Types
40+
*
41+
* If you're working in a TypeScript project, you can generate types from your app's connector configurations to get autocomplete on integration type names when calling `getAccessToken()`. See the [Dynamic Types](/developers/references/sdk/getting-started/dynamic-types) guide to get started.
3342
*/
3443
export interface ConnectorsModule {
3544
/**

src/modules/entities.types.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,7 @@ export interface EntityTypeRegistry {}
108108
*
109109
* @example
110110
* ```typescript
111-
* // Type-safe entity records
112111
* import type { EntityRecord } from '@base44/sdk';
113-
* // Import your generated entity schema
114-
* import type { Task } from '@/base44/.types/types';
115112
*
116113
* // Combine your schema with server fields (id, created_date, etc.)
117114
* type TaskRecord = EntityRecord['Task'];
@@ -469,7 +466,7 @@ type DynamicEntitiesModule = {
469466
*
470467
* ## Generated Types
471468
*
472-
* If you're working in a TypeScript project, you can generate types from your entity schemas to get autocomplete and type checking on all entity methods. See the [Generated Types](/developers/references/sdk/getting-started/generated-types) guide to get started.
469+
* If you're working in a TypeScript project, you can generate types from your entity schemas to get autocomplete and type checking on all entity methods. See the [Dynamic Types](/developers/references/sdk/getting-started/dynamic-types) guide to get started.
473470
*
474471
* @example
475472
* ```typescript

src/modules/functions.types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export type FunctionName = keyof FunctionNameRegistry extends never
2929
*
3030
* ## Generated Types
3131
*
32-
* If you're working in a TypeScript project, you can generate types from your backend functions to get autocomplete on function names when calling `invoke()`. See the [Generated Types](/developers/references/sdk/getting-started/generated-types) guide to get started.
32+
* If you're working in a TypeScript project, you can generate types from your backend functions to get autocomplete on function names when calling `invoke()`. See the [Dynamic Types](/developers/references/sdk/getting-started/dynamic-types) guide to get started.
3333
*/
3434
export interface FunctionsModule {
3535
/**

0 commit comments

Comments
 (0)