teak-sdk 1.0.86 → 1.0.88
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/README.md +3 -3
- package/{dist/sdk.js → index.js} +277 -60
- package/package.json +3 -18
- package/{dist/types/client → types}/authDiscovery.d.ts +3 -3
- package/{dist/types → types/convex}/devUrls.d.ts +0 -1
- package/{dist/types → types/convex}/shared/constants.d.ts +11 -36
- package/types/convex/shared/filesOrigins.d.ts +4 -0
- package/types/convex/shared/folders.d.ts +27 -0
- package/types/convex/shared/oauthSurfaces.d.ts +2 -0
- package/types/convex/shared/oauthUrl.d.ts +2 -0
- package/types/convex/shared/tags.d.ts +37 -0
- package/types/convex/shared/utils/codePoints.d.ts +2 -0
- package/types/convex/shared/utils/formatBytes.d.ts +1 -0
- package/types/convex/shared/workosResources.d.ts +7 -0
- package/types/index.d.ts +569 -0
- package/types/oauthCredentials.d.ts +10 -0
- package/dist/types/client/sdk.d.ts +0 -253
- package/dist/types/shared/workosResources.d.ts +0 -4
- /package/{dist/types → types/convex}/shared/boundedResponse.d.ts +0 -0
- /package/{dist/types → types/convex}/shared/fileFormats.d.ts +0 -0
- /package/{dist/types → types/convex}/shared/markdown.d.ts +0 -0
- /package/{dist/types/client → types}/workosConnect.d.ts +0 -0
|
@@ -1,253 +0,0 @@
|
|
|
1
|
-
export { type AuthDiscovery, discoverAuthServer, type OAuthSurface, validateOAuthUrl, } from "./authDiscovery.js";
|
|
2
|
-
export { type ConnectTokenResult, type ConnectTokens, createConnectAuthorizeUrl, createPkceChallenge, disconnectConnectGrant, fetchConnectOwnerId, randomBase64Url, requestConnectTokens, WORKOS_CONNECT_SCOPE, } from "./workosConnect.js";
|
|
3
|
-
import { type CardType } from "../shared/constants.js";
|
|
4
|
-
import type { FileKind, FilePreviewFacts } from "../shared/fileFormats.js";
|
|
5
|
-
export type { CardType } from "../shared/constants.js";
|
|
6
|
-
export declare const CARD_TYPES: readonly ["text", "link", "image", "video", "audio", "document", "palette", "quote"];
|
|
7
|
-
export declare const CARD_SORTS: readonly ["newest", "oldest"];
|
|
8
|
-
export declare const ERROR_CODES: readonly ["AUTH_REQUIRED", "BAD_REQUEST", "CONFIG_ERROR", "CONFLICT", "CONTENT_TOO_LARGE", "INTERNAL_ERROR", "INVALID_API_KEY", "INVALID_INPUT", "INVALID_UTF8", "METHOD_NOT_ALLOWED", "NETWORK_ERROR", "NOT_FOUND", "PARSE_ERROR", "RATE_LIMITED", "REQUEST_FAILED", "TIMEOUT", "UNAUTHORIZED"];
|
|
9
|
-
export type CardSort = (typeof CARD_SORTS)[number];
|
|
10
|
-
export type TeakApiErrorCode = (typeof ERROR_CODES)[number];
|
|
11
|
-
export type FetchLike = typeof fetch;
|
|
12
|
-
export interface TokenProvider {
|
|
13
|
-
getAccessToken: () => Promise<string | null> | string | null;
|
|
14
|
-
onUnauthorized?: (rejectedToken: string) => Promise<string | null> | string | null;
|
|
15
|
-
}
|
|
16
|
-
export interface Card {
|
|
17
|
-
aiSummary: string | null;
|
|
18
|
-
aiTags: string[];
|
|
19
|
-
aiTranscript: string | null;
|
|
20
|
-
appUrl: string;
|
|
21
|
-
colors: Array<{
|
|
22
|
-
hex: string;
|
|
23
|
-
name?: string;
|
|
24
|
-
}>;
|
|
25
|
-
compactUrl: string | null;
|
|
26
|
-
content: string;
|
|
27
|
-
createdAt: number;
|
|
28
|
-
detailUrl: string | null;
|
|
29
|
-
fileExtension: string | null;
|
|
30
|
-
fileKind: FileKind | null;
|
|
31
|
-
fileLanguage: string | null;
|
|
32
|
-
fileName: string | null;
|
|
33
|
-
filePreview: FilePreviewFacts | null;
|
|
34
|
-
fileSize: number | null;
|
|
35
|
-
fileUrl: string | null;
|
|
36
|
-
id: string;
|
|
37
|
-
isDeleted: boolean;
|
|
38
|
-
isFavorited: boolean;
|
|
39
|
-
linkAuthor: string | null;
|
|
40
|
-
linkFacts: Array<{
|
|
41
|
-
label: string;
|
|
42
|
-
value: string;
|
|
43
|
-
}>;
|
|
44
|
-
linkPreviewImageUrl: string | null;
|
|
45
|
-
linkPreviewMedia: Array<{
|
|
46
|
-
type: "image" | "video";
|
|
47
|
-
url: string;
|
|
48
|
-
contentType?: string;
|
|
49
|
-
width?: number;
|
|
50
|
-
height?: number;
|
|
51
|
-
posterUrl?: string;
|
|
52
|
-
posterContentType?: string;
|
|
53
|
-
posterWidth?: number;
|
|
54
|
-
posterHeight?: number;
|
|
55
|
-
}>;
|
|
56
|
-
linkPublishedAt: string | null;
|
|
57
|
-
linkPublisher: string | null;
|
|
58
|
-
linkSiteName: string | null;
|
|
59
|
-
metadataDescription: string | null;
|
|
60
|
-
metadataStatus: string | null;
|
|
61
|
-
metadataTitle: string | null;
|
|
62
|
-
mimeType: string | null;
|
|
63
|
-
notes: string | null;
|
|
64
|
-
placeholderUrl: string | null;
|
|
65
|
-
processingStatus: Record<string, unknown> | null;
|
|
66
|
-
screenshotUrl: string | null;
|
|
67
|
-
tags: string[];
|
|
68
|
-
thumbnailUrl: string | null;
|
|
69
|
-
type: CardType | string;
|
|
70
|
-
updatedAt: number;
|
|
71
|
-
url: string | null;
|
|
72
|
-
}
|
|
73
|
-
export type CardListItem = Partial<Card> & Pick<Card, "aiTags" | "appUrl" | "createdAt" | "id" | "isFavorited" | "tags" | "type" | "updatedAt">;
|
|
74
|
-
export interface PageInfo {
|
|
75
|
-
hasMore: boolean;
|
|
76
|
-
nextCursor: string | null;
|
|
77
|
-
}
|
|
78
|
-
export interface CardsPage {
|
|
79
|
-
items: CardListItem[];
|
|
80
|
-
pageInfo: PageInfo;
|
|
81
|
-
}
|
|
82
|
-
export interface CardChangesResponse {
|
|
83
|
-
deletedIds: string[];
|
|
84
|
-
items: Card[];
|
|
85
|
-
pageInfo: PageInfo;
|
|
86
|
-
}
|
|
87
|
-
export interface TagSummary {
|
|
88
|
-
count: number;
|
|
89
|
-
name: string;
|
|
90
|
-
}
|
|
91
|
-
export interface CreateCardInput {
|
|
92
|
-
cardType?: CardType;
|
|
93
|
-
content?: string;
|
|
94
|
-
fileEtag?: string;
|
|
95
|
-
fileKey?: string;
|
|
96
|
-
fileName?: string;
|
|
97
|
-
fileSize?: number;
|
|
98
|
-
mimeType?: string;
|
|
99
|
-
notes?: string | null;
|
|
100
|
-
source?: string;
|
|
101
|
-
tags?: string[];
|
|
102
|
-
url?: string;
|
|
103
|
-
}
|
|
104
|
-
export interface UpdateCardInput {
|
|
105
|
-
content?: string;
|
|
106
|
-
metadataTitle?: string | null;
|
|
107
|
-
notes?: string | null;
|
|
108
|
-
/** AI tags to drop. `tags` replaces only the card's own tags. */
|
|
109
|
-
removeAiTags?: string[];
|
|
110
|
-
tags?: string[];
|
|
111
|
-
url?: string;
|
|
112
|
-
}
|
|
113
|
-
export interface Me {
|
|
114
|
-
cardCount: number;
|
|
115
|
-
/** Null on Pro, which has no card limit. */
|
|
116
|
-
cardLimit: number | null;
|
|
117
|
-
email: string;
|
|
118
|
-
id: string;
|
|
119
|
-
name?: string;
|
|
120
|
-
plan: "free" | "pro";
|
|
121
|
-
settingsUrl: string;
|
|
122
|
-
}
|
|
123
|
-
export interface ExportJob {
|
|
124
|
-
cardCount: number | null;
|
|
125
|
-
completedAt: number | null;
|
|
126
|
-
createdAt: number;
|
|
127
|
-
downloadUrl: string | null;
|
|
128
|
-
expiresAt: number | null;
|
|
129
|
-
failureClass: string | null;
|
|
130
|
-
filesIncluded: number | null;
|
|
131
|
-
filesOmitted: number | null;
|
|
132
|
-
id: string;
|
|
133
|
-
processedCount: number | null;
|
|
134
|
-
sizeBytes: number | null;
|
|
135
|
-
stage: "snapshotting" | "archiving" | null;
|
|
136
|
-
status: "pending" | "running" | "ready" | "failed" | "canceled" | "expired";
|
|
137
|
-
updatedAt: number;
|
|
138
|
-
}
|
|
139
|
-
export interface LatestExport {
|
|
140
|
-
canStartNew: boolean;
|
|
141
|
-
job: ExportJob | null;
|
|
142
|
-
nextAvailableAt: number | null;
|
|
143
|
-
}
|
|
144
|
-
export interface RequestOptions {
|
|
145
|
-
/** Makes a retried create or bulk request safe to repeat. */
|
|
146
|
-
idempotencyKey?: string;
|
|
147
|
-
}
|
|
148
|
-
export interface CreateUploadInput {
|
|
149
|
-
fileName: string;
|
|
150
|
-
fileSize: number;
|
|
151
|
-
mimeType: string;
|
|
152
|
-
}
|
|
153
|
-
export interface CreateUploadResponse {
|
|
154
|
-
expiresIn: number;
|
|
155
|
-
fileKey: string;
|
|
156
|
-
maxFileSize: number;
|
|
157
|
-
method: "PUT";
|
|
158
|
-
uploadUrl: string;
|
|
159
|
-
}
|
|
160
|
-
export interface CreateCardResponse {
|
|
161
|
-
appUrl: string;
|
|
162
|
-
card?: Card;
|
|
163
|
-
cardId: string;
|
|
164
|
-
status: "created";
|
|
165
|
-
}
|
|
166
|
-
export interface BulkCardsResponse {
|
|
167
|
-
operation: "create" | "update" | "favorite" | "delete";
|
|
168
|
-
results: unknown[];
|
|
169
|
-
summary: {
|
|
170
|
-
failed: number;
|
|
171
|
-
succeeded: number;
|
|
172
|
-
total: number;
|
|
173
|
-
};
|
|
174
|
-
}
|
|
175
|
-
export declare class TeakApiError extends Error {
|
|
176
|
-
code: TeakApiErrorCode;
|
|
177
|
-
requestId?: string;
|
|
178
|
-
retryAt?: number;
|
|
179
|
-
status?: number;
|
|
180
|
-
constructor(code: TeakApiErrorCode, message?: string, init?: {
|
|
181
|
-
requestId?: string;
|
|
182
|
-
retryAt?: number;
|
|
183
|
-
status?: number;
|
|
184
|
-
});
|
|
185
|
-
}
|
|
186
|
-
export declare const staticTokenProvider: (token: string) => TokenProvider;
|
|
187
|
-
export declare const normalizeLimit: (limit?: number) => number;
|
|
188
|
-
export declare const buildCardsSearchParams: (input: {
|
|
189
|
-
createdAfter?: number;
|
|
190
|
-
createdBefore?: number;
|
|
191
|
-
cursor?: string;
|
|
192
|
-
favorited?: boolean;
|
|
193
|
-
hex?: string | readonly string[];
|
|
194
|
-
hue?: string | readonly string[];
|
|
195
|
-
include?: string;
|
|
196
|
-
limit?: number;
|
|
197
|
-
query?: string;
|
|
198
|
-
sort?: CardSort;
|
|
199
|
-
style?: string | readonly string[];
|
|
200
|
-
tag?: string;
|
|
201
|
-
trashed?: boolean;
|
|
202
|
-
type?: CardType | string | readonly (CardType | string)[];
|
|
203
|
-
}) => string;
|
|
204
|
-
export declare const createTeakClient: (options: {
|
|
205
|
-
baseUrl?: string;
|
|
206
|
-
fetch?: FetchLike;
|
|
207
|
-
timeoutMs?: number;
|
|
208
|
-
tokenProvider: TokenProvider;
|
|
209
|
-
userAgent?: string;
|
|
210
|
-
}) => {
|
|
211
|
-
cards: {
|
|
212
|
-
bulk: (operation: BulkCardsResponse["operation"], items: unknown[], requestOptions?: RequestOptions) => Promise<BulkCardsResponse>;
|
|
213
|
-
changes: (input: {
|
|
214
|
-
cursor?: string;
|
|
215
|
-
limit?: number;
|
|
216
|
-
since: number;
|
|
217
|
-
}) => Promise<CardChangesResponse>;
|
|
218
|
-
create: (input: CreateCardInput, requestOptions?: RequestOptions) => Promise<CreateCardResponse>;
|
|
219
|
-
/** Moves the card to Trash, or deletes it for good with `permanent`. */
|
|
220
|
-
delete: (id: string, deleteOptions?: {
|
|
221
|
-
permanent?: boolean;
|
|
222
|
-
}) => Promise<null>;
|
|
223
|
-
/** The ID of a saved card with exactly this URL, or null. */
|
|
224
|
-
duplicate: (url: string) => Promise<string | null>;
|
|
225
|
-
favorites: (input?: Parameters<(params: Parameters<typeof buildCardsSearchParams>[0]) => string>[0]) => Promise<CardsPage>;
|
|
226
|
-
get: (id: string) => Promise<Card>;
|
|
227
|
-
list: (input?: Parameters<(params: Parameters<typeof buildCardsSearchParams>[0]) => string>[0]) => Promise<CardsPage>;
|
|
228
|
-
restore: (id: string) => Promise<null>;
|
|
229
|
-
search: (input?: Parameters<(params: Parameters<typeof buildCardsSearchParams>[0]) => string>[0]) => Promise<CardsPage>;
|
|
230
|
-
setFavorite: (id: string, isFavorited: boolean) => Promise<Card>;
|
|
231
|
-
update: (id: string, input: UpdateCardInput) => Promise<Card>;
|
|
232
|
-
};
|
|
233
|
-
exports: {
|
|
234
|
-
latest: () => Promise<LatestExport>;
|
|
235
|
-
start: () => Promise<ExportJob>;
|
|
236
|
-
};
|
|
237
|
-
me: () => Promise<Me>;
|
|
238
|
-
tags: {
|
|
239
|
-
list: () => Promise<{
|
|
240
|
-
items: TagSummary[];
|
|
241
|
-
}>;
|
|
242
|
-
};
|
|
243
|
-
uploads: {
|
|
244
|
-
create: (input: CreateUploadInput) => Promise<CreateUploadResponse>;
|
|
245
|
-
putFile: (uploadUrl: string, bytes: BodyInit, mimeType: string) => Promise<{
|
|
246
|
-
fileEtag: string | undefined;
|
|
247
|
-
}>;
|
|
248
|
-
};
|
|
249
|
-
};
|
|
250
|
-
export type TeakClient = ReturnType<typeof createTeakClient>;
|
|
251
|
-
export declare const parseTags: (value: string | undefined) => string[] | undefined;
|
|
252
|
-
export declare const isCardType: (value: string) => value is CardType;
|
|
253
|
-
export declare const isStringList: (value: unknown) => value is string[];
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|