@doist/comms-sdk 3.7.0 → 3.8.1
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/dist/esm/clients/channels-client.js +1 -1
- package/dist/esm/clients/comments-client.js +1 -1
- package/dist/esm/clients/conversation-messages-client.js +1 -1
- package/dist/esm/clients/conversations-client.js +1 -1
- package/dist/esm/clients/groups-client.js +1 -1
- package/dist/esm/clients/hooks-client.js +1 -1
- package/dist/esm/clients/inbox-client.js +1 -1
- package/dist/esm/clients/threads-client.js +1 -1
- package/dist/esm/clients/users-client.js +1 -1
- package/dist/esm/clients/workspace-users-client.js +1 -1
- package/dist/esm/clients/workspaces-client.js +1 -1
- package/dist/esm/consts/endpoints.js +3 -3
- package/dist/esm/types/api-version.js +2 -2
- package/dist/types/clients/base-client.d.ts +1 -1
- package/dist/types/clients/channels-client.d.ts +1 -1
- package/dist/types/clients/comments-client.d.ts +1 -1
- package/dist/types/clients/conversation-messages-client.d.ts +1 -1
- package/dist/types/clients/conversations-client.d.ts +1 -1
- package/dist/types/clients/groups-client.d.ts +1 -1
- package/dist/types/clients/hooks-client.d.ts +1 -1
- package/dist/types/clients/inbox-client.d.ts +1 -1
- package/dist/types/clients/threads-client.d.ts +1 -1
- package/dist/types/clients/users-client.d.ts +1 -1
- package/dist/types/clients/workspace-users-client.d.ts +1 -1
- package/dist/types/clients/workspaces-client.d.ts +1 -1
- package/dist/types/comms-api.d.ts +1 -1
- package/dist/types/consts/endpoints.d.ts +3 -3
- package/dist/types/types/api-version.d.ts +1 -1
- package/dist/types/utils/multipart-upload.d.ts +1 -1
- package/package.json +1 -1
|
@@ -6,7 +6,7 @@ import { resolveCreateId } from '../utils/uuidv7.js';
|
|
|
6
6
|
import { BaseClient } from './base-client.js';
|
|
7
7
|
export const ChannelListSchema = z.array(ChannelSchema);
|
|
8
8
|
/**
|
|
9
|
-
* Client for `/api/v1/channels/`. The SDK auto-generates an `id` on
|
|
9
|
+
* Client for `/api/v1.0/channels/`. The SDK auto-generates an `id` on
|
|
10
10
|
* `createChannel` when the caller doesn't supply one — pass your own `id`
|
|
11
11
|
* to keep an optimistic-UI ID stable through the round-trip.
|
|
12
12
|
*/
|
|
@@ -6,7 +6,7 @@ import { addCommentRequest } from './add-comment-helper.js';
|
|
|
6
6
|
import { BaseClient } from './base-client.js';
|
|
7
7
|
export const CommentListSchema = z.array(CommentSchema);
|
|
8
8
|
/**
|
|
9
|
-
* Client for `/api/v1/comments/`. The SDK auto-generates the comment `id`
|
|
9
|
+
* Client for `/api/v1.0/comments/`. The SDK auto-generates the comment `id`
|
|
10
10
|
* on `createComment` when the caller doesn't supply one.
|
|
11
11
|
*/
|
|
12
12
|
export class CommentsClient extends BaseClient {
|
|
@@ -6,7 +6,7 @@ import { resolveCreateId } from '../utils/uuidv7.js';
|
|
|
6
6
|
import { BaseClient } from './base-client.js';
|
|
7
7
|
export const ConversationMessageListSchema = z.array(ConversationMessageSchema);
|
|
8
8
|
/**
|
|
9
|
-
* Client for `/api/v1/conversation_messages/`. The SDK auto-generates the
|
|
9
|
+
* Client for `/api/v1.0/conversation_messages/`. The SDK auto-generates the
|
|
10
10
|
* message `id` on `createMessage` when the caller doesn't supply one.
|
|
11
11
|
*/
|
|
12
12
|
export class ConversationMessagesClient extends BaseClient {
|
|
@@ -10,7 +10,7 @@ const GetUnreadResponseSchema = z.object({
|
|
|
10
10
|
version: z.number().int(),
|
|
11
11
|
});
|
|
12
12
|
/**
|
|
13
|
-
* Client for `/api/v1/conversations/`. `getOrCreate` requires an `id` (the
|
|
13
|
+
* Client for `/api/v1.0/conversations/`. `getOrCreate` requires an `id` (the
|
|
14
14
|
* SDK auto-generates one for new conversations); the backend dedupes on
|
|
15
15
|
* `userIds`, so an existing conversation will be returned with its own
|
|
16
16
|
* already-assigned `id` and your generated one is silently dropped.
|
|
@@ -6,7 +6,7 @@ import { resolveCreateId } from '../utils/uuidv7.js';
|
|
|
6
6
|
import { BaseClient } from './base-client.js';
|
|
7
7
|
export const GroupListSchema = z.array(GroupSchema);
|
|
8
8
|
/**
|
|
9
|
-
* Client for `/api/v1/groups/`. The broadcast markers `EVERYONE` /
|
|
9
|
+
* Client for `/api/v1.0/groups/`. The broadcast markers `EVERYONE` /
|
|
10
10
|
* `EVERYONE_IN_THREAD` are NOT addressable through these endpoints — they
|
|
11
11
|
* only appear as members of `direct_group_mentions` / `groups` lists on
|
|
12
12
|
* thread/comment writes.
|
|
@@ -3,7 +3,7 @@ import { request } from '../transport/http-client.js';
|
|
|
3
3
|
import { HookSubscribeResponseSchema, StatusOkSchema, } from '../types/entities.js';
|
|
4
4
|
import { BaseClient } from './base-client.js';
|
|
5
5
|
/**
|
|
6
|
-
* Client for `/api/v1/hooks/`. REST hooks require Todoist OAuth bearer tokens
|
|
6
|
+
* Client for `/api/v1.0/hooks/`. REST hooks require Todoist OAuth bearer tokens
|
|
7
7
|
* that include Comms audience; session tokens are rejected by the backend.
|
|
8
8
|
*/
|
|
9
9
|
export class HooksClient extends BaseClient {
|
|
@@ -4,7 +4,7 @@ import { request } from '../transport/http-client.js';
|
|
|
4
4
|
import { createInboxThreadSchema, InboxThreadSchema } from '../types/entities.js';
|
|
5
5
|
import { BaseClient } from './base-client.js';
|
|
6
6
|
export const InboxThreadListSchema = z.array(InboxThreadSchema);
|
|
7
|
-
/** Client for `/api/v1/inbox/`. */
|
|
7
|
+
/** Client for `/api/v1.0/inbox/`. */
|
|
8
8
|
export class InboxClient extends BaseClient {
|
|
9
9
|
constructor() {
|
|
10
10
|
super(...arguments);
|
|
@@ -13,7 +13,7 @@ const GetUnreadResponseSchema = z.object({
|
|
|
13
13
|
inboxUnread: z.number().int().nullable().optional(),
|
|
14
14
|
});
|
|
15
15
|
/**
|
|
16
|
-
* Client for `/api/v1/threads/`. The SDK auto-generates the thread `id` on
|
|
16
|
+
* Client for `/api/v1.0/threads/`. The SDK auto-generates the thread `id` on
|
|
17
17
|
* `createThread` when the caller doesn't supply one.
|
|
18
18
|
*/
|
|
19
19
|
export class ThreadsClient extends BaseClient {
|
|
@@ -3,7 +3,7 @@ import { request } from '../transport/http-client.js';
|
|
|
3
3
|
import { UserSchema } from '../types/entities.js';
|
|
4
4
|
import { BaseClient } from './base-client.js';
|
|
5
5
|
/**
|
|
6
|
-
* Client for the `/api/v1/users/` endpoints. Authentication flows through
|
|
6
|
+
* Client for the `/api/v1.0/users/` endpoints. Authentication flows through
|
|
7
7
|
* Todoist-ID; `register` / `login` / `loginWithGoogle` / `loginWithToken` /
|
|
8
8
|
* `loginWithTodoist` are the available entry points.
|
|
9
9
|
*/
|
|
@@ -2,7 +2,7 @@ import { request } from '../transport/http-client.js';
|
|
|
2
2
|
import { VisibleWorkspaceUserSchema, WorkspaceUserSchema, } from '../types/entities.js';
|
|
3
3
|
import { BaseClient } from './base-client.js';
|
|
4
4
|
/**
|
|
5
|
-
* Client for `/api/v1/workspace_users/`. The backend's `add` endpoint
|
|
5
|
+
* Client for `/api/v1.0/workspace_users/`. The backend's `add` endpoint
|
|
6
6
|
* rejects non-empty `name` and `channelIds` — set neither.
|
|
7
7
|
*/
|
|
8
8
|
export class WorkspaceUsersClient extends BaseClient {
|
|
@@ -5,7 +5,7 @@ import { ChannelSchema, createChannelSchema, WorkspaceSchema, } from '../types/e
|
|
|
5
5
|
import { BaseClient } from './base-client.js';
|
|
6
6
|
export const ChannelListSchema = z.array(ChannelSchema);
|
|
7
7
|
/**
|
|
8
|
-
* Client for `/api/v1/workspaces/`. Workspace IDs are integers. The backend
|
|
8
|
+
* Client for `/api/v1.0/workspaces/`. Workspace IDs are integers. The backend
|
|
9
9
|
* currently rejects any `color` other than `1` on add/update.
|
|
10
10
|
*/
|
|
11
11
|
export class WorkspacesClient extends BaseClient {
|
|
@@ -4,11 +4,11 @@ const BASE_URI = 'https://comms.todoist.com';
|
|
|
4
4
|
* Gets the base URI for Comms API requests.
|
|
5
5
|
*
|
|
6
6
|
* Preserves any path component on `domainBase` so callers can route through
|
|
7
|
-
* a proxy (e.g. `https://proxy.example.com/comms` → `.../comms/api/v1/`).
|
|
7
|
+
* a proxy (e.g. `https://proxy.example.com/comms` → `.../comms/api/v1.0/`).
|
|
8
8
|
*
|
|
9
|
-
* @param version - API version. Defaults to 'v1'.
|
|
9
|
+
* @param version - API version. Defaults to 'v1.0'.
|
|
10
10
|
* @param domainBase - Custom domain base URL. Defaults to Comms' API domain.
|
|
11
|
-
* @returns Complete base URI with trailing slash (e.g., 'https://comms.todoist.com/api/v1/')
|
|
11
|
+
* @returns Complete base URI with trailing slash (e.g., 'https://comms.todoist.com/api/v1.0/')
|
|
12
12
|
*/
|
|
13
13
|
export function getCommsBaseUri(version = DEFAULT_API_VERSION, domainBase = BASE_URI) {
|
|
14
14
|
const base = domainBase.endsWith('/') ? domainBase : `${domainBase}/`;
|
|
@@ -5,7 +5,7 @@ export type ClientConfig = {
|
|
|
5
5
|
apiToken: string;
|
|
6
6
|
/** Optional custom base URL. If not provided, uses the default Comms API URL */
|
|
7
7
|
baseUrl?: string;
|
|
8
|
-
/** Optional API version. Defaults to 'v1' */
|
|
8
|
+
/** Optional API version. Defaults to 'v1.0' */
|
|
9
9
|
version?: ApiVersion;
|
|
10
10
|
/** Optional custom fetch implementation for cross-platform compatibility */
|
|
11
11
|
customFetch?: CustomFetch;
|
|
@@ -59,7 +59,7 @@ export declare const ChannelListSchema: z.ZodArray<z.ZodPipe<z.ZodObject<{
|
|
|
59
59
|
filters?: Record<string, string> | null | undefined;
|
|
60
60
|
}>>>;
|
|
61
61
|
/**
|
|
62
|
-
* Client for `/api/v1/channels/`. The SDK auto-generates an `id` on
|
|
62
|
+
* Client for `/api/v1.0/channels/`. The SDK auto-generates an `id` on
|
|
63
63
|
* `createChannel` when the caller doesn't supply one — pass your own `id`
|
|
64
64
|
* to keep an optimistic-UI ID stable through the round-trip.
|
|
65
65
|
*/
|
|
@@ -130,7 +130,7 @@ export declare const CommentListSchema: z.ZodArray<z.ZodPipe<z.ZodObject<{
|
|
|
130
130
|
actions?: unknown[] | null | undefined;
|
|
131
131
|
}>>>;
|
|
132
132
|
/**
|
|
133
|
-
* Client for `/api/v1/comments/`. The SDK auto-generates the comment `id`
|
|
133
|
+
* Client for `/api/v1.0/comments/`. The SDK auto-generates the comment `id`
|
|
134
134
|
* on `createComment` when the caller doesn't supply one.
|
|
135
135
|
*/
|
|
136
136
|
export declare class CommentsClient extends BaseClient {
|
|
@@ -109,7 +109,7 @@ export declare const ConversationMessageListSchema: z.ZodArray<z.ZodPipe<z.ZodOb
|
|
|
109
109
|
version?: number | null | undefined;
|
|
110
110
|
}>>>;
|
|
111
111
|
/**
|
|
112
|
-
* Client for `/api/v1/conversation_messages/`. The SDK auto-generates the
|
|
112
|
+
* Client for `/api/v1.0/conversation_messages/`. The SDK auto-generates the
|
|
113
113
|
* message `id` on `createMessage` when the caller doesn't supply one.
|
|
114
114
|
*/
|
|
115
115
|
export declare class ConversationMessagesClient extends BaseClient {
|
|
@@ -157,7 +157,7 @@ export declare const ConversationListSchema: z.ZodArray<z.ZodPipe<z.ZodObject<{
|
|
|
157
157
|
} | null | undefined;
|
|
158
158
|
}>>>;
|
|
159
159
|
/**
|
|
160
|
-
* Client for `/api/v1/conversations/`. `getOrCreate` requires an `id` (the
|
|
160
|
+
* Client for `/api/v1.0/conversations/`. `getOrCreate` requires an `id` (the
|
|
161
161
|
* SDK auto-generates one for new conversations); the backend dedupes on
|
|
162
162
|
* `userIds`, so an existing conversation will be returned with its own
|
|
163
163
|
* already-assigned `id` and your generated one is silently dropped.
|
|
@@ -11,7 +11,7 @@ export declare const GroupListSchema: z.ZodArray<z.ZodObject<{
|
|
|
11
11
|
version: z.ZodNumber;
|
|
12
12
|
}, z.core.$strip>>;
|
|
13
13
|
/**
|
|
14
|
-
* Client for `/api/v1/groups/`. The broadcast markers `EVERYONE` /
|
|
14
|
+
* Client for `/api/v1.0/groups/`. The broadcast markers `EVERYONE` /
|
|
15
15
|
* `EVERYONE_IN_THREAD` are NOT addressable through these endpoints — they
|
|
16
16
|
* only appear as members of `direct_group_mentions` / `groups` lists on
|
|
17
17
|
* thread/comment writes.
|
|
@@ -2,7 +2,7 @@ import { type HookSubscribeResponse, type StatusOk } from '../types/entities.js'
|
|
|
2
2
|
import type { SubscribeHookArgs, UnsubscribeHookArgs } from '../types/requests.js';
|
|
3
3
|
import { BaseClient } from './base-client.js';
|
|
4
4
|
/**
|
|
5
|
-
* Client for `/api/v1/hooks/`. REST hooks require Todoist OAuth bearer tokens
|
|
5
|
+
* Client for `/api/v1.0/hooks/`. REST hooks require Todoist OAuth bearer tokens
|
|
6
6
|
* that include Comms audience; session tokens are rejected by the backend.
|
|
7
7
|
*/
|
|
8
8
|
export declare class HooksClient extends BaseClient {
|
|
@@ -380,7 +380,7 @@ export declare const InboxThreadListSchema: z.ZodArray<z.ZodPipe<z.ZodObject<{
|
|
|
380
380
|
toEmails?: string[] | null | undefined;
|
|
381
381
|
version?: number | null | undefined;
|
|
382
382
|
}>>>;
|
|
383
|
-
/** Client for `/api/v1/inbox/`. */
|
|
383
|
+
/** Client for `/api/v1.0/inbox/`. */
|
|
384
384
|
export declare class InboxClient extends BaseClient {
|
|
385
385
|
private readonly linkBaseUrl;
|
|
386
386
|
private readonly inboxThreadSchema;
|
|
@@ -288,7 +288,7 @@ export declare const ThreadListSchema: z.ZodArray<z.ZodPipe<z.ZodObject<{
|
|
|
288
288
|
} | null | undefined;
|
|
289
289
|
}>>>;
|
|
290
290
|
/**
|
|
291
|
-
* Client for `/api/v1/threads/`. The SDK auto-generates the thread `id` on
|
|
291
|
+
* Client for `/api/v1.0/threads/`. The SDK auto-generates the thread `id` on
|
|
292
292
|
* `createThread` when the caller doesn't supply one.
|
|
293
293
|
*/
|
|
294
294
|
export declare class ThreadsClient extends BaseClient {
|
|
@@ -33,7 +33,7 @@ type MfaChallengeArgs = {
|
|
|
33
33
|
methodType: string;
|
|
34
34
|
};
|
|
35
35
|
/**
|
|
36
|
-
* Client for the `/api/v1/users/` endpoints. Authentication flows through
|
|
36
|
+
* Client for the `/api/v1.0/users/` endpoints. Authentication flows through
|
|
37
37
|
* Todoist-ID; `register` / `login` / `loginWithGoogle` / `loginWithToken` /
|
|
38
38
|
* `loginWithTodoist` are the available entry points.
|
|
39
39
|
*/
|
|
@@ -3,7 +3,7 @@ import { UserType } from '../types/enums.js';
|
|
|
3
3
|
import type { GetUserByEmailArgs, GetUserByIdArgs, GetUserInfoArgs, GetUserLocalTimeArgs, GetWorkspaceUsersArgs } from '../types/requests.js';
|
|
4
4
|
import { BaseClient } from './base-client.js';
|
|
5
5
|
/**
|
|
6
|
-
* Client for `/api/v1/workspace_users/`. The backend's `add` endpoint
|
|
6
|
+
* Client for `/api/v1.0/workspace_users/`. The backend's `add` endpoint
|
|
7
7
|
* rejects non-empty `name` and `channelIds` — set neither.
|
|
8
8
|
*/
|
|
9
9
|
export declare class WorkspaceUsersClient extends BaseClient {
|
|
@@ -58,7 +58,7 @@ export declare const ChannelListSchema: z.ZodArray<z.ZodPipe<z.ZodObject<{
|
|
|
58
58
|
filters?: Record<string, string> | null | undefined;
|
|
59
59
|
}>>>;
|
|
60
60
|
/**
|
|
61
|
-
* Client for `/api/v1/workspaces/`. Workspace IDs are integers. The backend
|
|
61
|
+
* Client for `/api/v1.0/workspaces/`. Workspace IDs are integers. The backend
|
|
62
62
|
* currently rejects any `color` other than `1` on add/update.
|
|
63
63
|
*/
|
|
64
64
|
export declare class WorkspacesClient extends BaseClient {
|
|
@@ -17,7 +17,7 @@ import type { CustomFetch, CustomHeaders } from './types/http.js';
|
|
|
17
17
|
export type CommsApiOptions = {
|
|
18
18
|
/** Optional custom API base URL. If not provided, defaults to Comms' standard API endpoint. */
|
|
19
19
|
baseUrl?: string;
|
|
20
|
-
/** Optional API version. Defaults to 'v1'. */
|
|
20
|
+
/** Optional API version. Defaults to 'v1.0'. */
|
|
21
21
|
version?: ApiVersion;
|
|
22
22
|
/** Optional custom fetch implementation for cross-platform compatibility (e.g., Obsidian, React Native, Electron). */
|
|
23
23
|
customFetch?: CustomFetch;
|
|
@@ -3,11 +3,11 @@ import type { ApiVersion } from '../types/api-version.js';
|
|
|
3
3
|
* Gets the base URI for Comms API requests.
|
|
4
4
|
*
|
|
5
5
|
* Preserves any path component on `domainBase` so callers can route through
|
|
6
|
-
* a proxy (e.g. `https://proxy.example.com/comms` → `.../comms/api/v1/`).
|
|
6
|
+
* a proxy (e.g. `https://proxy.example.com/comms` → `.../comms/api/v1.0/`).
|
|
7
7
|
*
|
|
8
|
-
* @param version - API version. Defaults to 'v1'.
|
|
8
|
+
* @param version - API version. Defaults to 'v1.0'.
|
|
9
9
|
* @param domainBase - Custom domain base URL. Defaults to Comms' API domain.
|
|
10
|
-
* @returns Complete base URI with trailing slash (e.g., 'https://comms.todoist.com/api/v1/')
|
|
10
|
+
* @returns Complete base URI with trailing slash (e.g., 'https://comms.todoist.com/api/v1.0/')
|
|
11
11
|
*/
|
|
12
12
|
export declare function getCommsBaseUri(version?: ApiVersion, domainBase?: string): string;
|
|
13
13
|
export declare const ENDPOINT_USERS = "users";
|
|
@@ -12,7 +12,7 @@ import type { CustomFetch, CustomHeaders } from '../types/http.js';
|
|
|
12
12
|
*/
|
|
13
13
|
export type UploadFile = Blob | Uint8Array;
|
|
14
14
|
type UploadMultipartFileArgs = {
|
|
15
|
-
/** Base API URI with trailing slash, e.g. `https://comms.todoist.com/api/v1/`. */
|
|
15
|
+
/** Base API URI with trailing slash, e.g. `https://comms.todoist.com/api/v1.0/`. */
|
|
16
16
|
baseUrl: string;
|
|
17
17
|
/** API token used for `Authorization: Bearer`. */
|
|
18
18
|
authToken: string;
|