@stack0/sdk 0.2.9 → 0.3.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/README.md +233 -10
- package/dist/cdn/index.d.mts +239 -26
- package/dist/cdn/index.d.ts +239 -26
- package/dist/cdn/index.js +219 -20
- package/dist/cdn/index.js.map +1 -1
- package/dist/cdn/index.mjs +219 -20
- package/dist/cdn/index.mjs.map +1 -1
- package/dist/extraction/index.d.mts +1 -1
- package/dist/extraction/index.d.ts +1 -1
- package/dist/extraction/index.js +33 -29
- package/dist/extraction/index.js.map +1 -1
- package/dist/extraction/index.mjs +33 -29
- package/dist/extraction/index.mjs.map +1 -1
- package/dist/http-client-Cgie_Rv6.d.mts +25 -0
- package/dist/http-client-Cgie_Rv6.d.ts +25 -0
- package/dist/index.d.mts +1006 -3
- package/dist/index.d.ts +1006 -3
- package/dist/index.js +958 -69
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +957 -70
- package/dist/index.mjs.map +1 -1
- package/dist/mail/index.d.mts +1 -1
- package/dist/mail/index.d.ts +1 -1
- package/dist/mail/index.js +13 -5
- package/dist/mail/index.js.map +1 -1
- package/dist/mail/index.mjs +13 -5
- package/dist/mail/index.mjs.map +1 -1
- package/dist/screenshots/index.d.mts +1 -1
- package/dist/screenshots/index.d.ts +1 -1
- package/dist/screenshots/index.js +32 -26
- package/dist/screenshots/index.js.map +1 -1
- package/dist/screenshots/index.mjs +32 -26
- package/dist/screenshots/index.mjs.map +1 -1
- package/dist/webdata/index.d.mts +1 -1
- package/dist/webdata/index.d.ts +1 -1
- package/dist/webdata/index.js +37 -8
- package/dist/webdata/index.js.map +1 -1
- package/dist/webdata/index.mjs +37 -8
- package/dist/webdata/index.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/http-client-Wr9lXo9_.d.mts +0 -10
- package/dist/http-client-Wr9lXo9_.d.ts +0 -10
package/dist/index.d.ts
CHANGED
|
@@ -1,15 +1,996 @@
|
|
|
1
1
|
import { Mail } from './mail/index.js';
|
|
2
2
|
export { Attachment, EmailAddress, EmailRecipient, GetEmailResponse, SendEmailRequest, SendEmailResponse, Stack0Error } from './mail/index.js';
|
|
3
3
|
import { CDN } from './cdn/index.js';
|
|
4
|
-
export { Asset, AssetStatus, AssetType, ConfirmUploadRequest, ConfirmUploadResponse, CreateFolderRequest, DeleteAssetRequest, DeleteAssetsRequest, DeleteAssetsResponse, Folder, FolderTreeNode, GetAssetRequest, GetFolderTreeRequest,
|
|
4
|
+
export { Asset, AssetStatus, AssetType, ConfirmUploadRequest, ConfirmUploadResponse, CreateFolderRequest, DeleteAssetRequest, DeleteAssetsRequest, DeleteAssetsResponse, ExtractAudioRequest, ExtractAudioResponse, Folder, FolderTreeNode, GetAssetRequest, GetFolderTreeRequest, ListAssetsRequest, ListAssetsResponse, ListJobsRequest, ListJobsResponse, MoveAssetsRequest, MoveAssetsResponse, StreamingUrls, ThumbnailRequest, ThumbnailResponse, TranscodeJob, TranscodeVideoRequest, TranscodingStatus, TransformOptions, TrimOptions, UpdateAssetRequest, UploadUrlRequest, UploadUrlResponse, VideoCodec, VideoOutputFormat, VideoQuality, VideoVariant, WatermarkOptions } from './cdn/index.js';
|
|
5
5
|
import { Screenshots } from './screenshots/index.js';
|
|
6
6
|
export { BatchScreenshotJob, Clip, CreateBatchScreenshotsRequest, CreateScreenshotRequest, CreateScreenshotResponse, CreateScreenshotScheduleRequest, DeviceType, GetScreenshotRequest, ListScreenshotsRequest, ListScreenshotsResponse, ResourceType, Screenshot, ScreenshotBatchJobsResponse, ScreenshotFormat, ScreenshotSchedule, ScreenshotSchedulesResponse, ScreenshotStatus, UpdateScreenshotScheduleRequest } from './screenshots/index.js';
|
|
7
7
|
import { Extraction } from './extraction/index.js';
|
|
8
8
|
export { BatchExtractionJob, CreateBatchExtractionsRequest, CreateExtractionRequest, CreateExtractionResponse, CreateExtractionScheduleRequest, ExtractionBatchJobsResponse, ExtractionMode, ExtractionResult, ExtractionSchedule, ExtractionSchedulesResponse, ExtractionStatus, ExtractionUsage, GetExtractionRequest, GetUsageRequest, ListExtractionsRequest, ListExtractionsResponse, PageMetadata, UpdateExtractionScheduleRequest } from './extraction/index.js';
|
|
9
9
|
import { Webdata } from './webdata/index.js';
|
|
10
|
-
import { H as HttpClientConfig } from './http-client-
|
|
10
|
+
import { H as HttpClient, a as HttpClientConfig } from './http-client-Cgie_Rv6.js';
|
|
11
11
|
export { B as BatchJobStatus, C as CreateBatchResponse, c as CreateScheduleResponse, E as Environment, G as GetBatchJobRequest, a as GetScheduleRequest, L as ListBatchJobsRequest, b as ListSchedulesRequest, S as ScheduleFrequency } from './shared-types-B0PyC7cF.js';
|
|
12
12
|
|
|
13
|
+
/**
|
|
14
|
+
* Stack0 Integrations SDK Types
|
|
15
|
+
*/
|
|
16
|
+
interface PaginatedResult<T> {
|
|
17
|
+
data: T[];
|
|
18
|
+
nextCursor?: string;
|
|
19
|
+
hasMore: boolean;
|
|
20
|
+
totalCount?: number;
|
|
21
|
+
}
|
|
22
|
+
interface ListOptions {
|
|
23
|
+
cursor?: string;
|
|
24
|
+
limit?: number;
|
|
25
|
+
sortBy?: string;
|
|
26
|
+
sortOrder?: "asc" | "desc";
|
|
27
|
+
filters?: Record<string, unknown>;
|
|
28
|
+
}
|
|
29
|
+
type ConnectorCategory = "crm" | "storage" | "communication" | "productivity";
|
|
30
|
+
interface Connector {
|
|
31
|
+
id: string;
|
|
32
|
+
slug: string;
|
|
33
|
+
name: string;
|
|
34
|
+
description?: string;
|
|
35
|
+
category: ConnectorCategory;
|
|
36
|
+
iconUrl?: string;
|
|
37
|
+
websiteUrl?: string;
|
|
38
|
+
isEnabled: boolean;
|
|
39
|
+
}
|
|
40
|
+
interface Connection {
|
|
41
|
+
id: string;
|
|
42
|
+
connectorId: string;
|
|
43
|
+
connectorSlug: string;
|
|
44
|
+
name?: string;
|
|
45
|
+
status: "pending" | "connected" | "error" | "disconnected";
|
|
46
|
+
externalAccountId?: string;
|
|
47
|
+
externalAccountName?: string;
|
|
48
|
+
lastSyncedAt?: Date;
|
|
49
|
+
lastUsedAt?: Date;
|
|
50
|
+
createdAt: Date;
|
|
51
|
+
updatedAt: Date;
|
|
52
|
+
}
|
|
53
|
+
interface Address {
|
|
54
|
+
type?: "work" | "home" | "billing" | "shipping" | "headquarters" | "other";
|
|
55
|
+
street?: string;
|
|
56
|
+
city?: string;
|
|
57
|
+
state?: string;
|
|
58
|
+
postalCode?: string;
|
|
59
|
+
country?: string;
|
|
60
|
+
}
|
|
61
|
+
interface PhoneNumber {
|
|
62
|
+
type?: "work" | "home" | "mobile" | "fax" | "other";
|
|
63
|
+
number: string;
|
|
64
|
+
isPrimary?: boolean;
|
|
65
|
+
}
|
|
66
|
+
interface IntegrationEmailAddress {
|
|
67
|
+
type?: "work" | "personal" | "other";
|
|
68
|
+
email: string;
|
|
69
|
+
isPrimary?: boolean;
|
|
70
|
+
}
|
|
71
|
+
interface Contact {
|
|
72
|
+
id: string;
|
|
73
|
+
firstName?: string;
|
|
74
|
+
lastName?: string;
|
|
75
|
+
email?: string;
|
|
76
|
+
emails?: IntegrationEmailAddress[];
|
|
77
|
+
phone?: string;
|
|
78
|
+
phones?: PhoneNumber[];
|
|
79
|
+
title?: string;
|
|
80
|
+
department?: string;
|
|
81
|
+
companyId?: string;
|
|
82
|
+
companyName?: string;
|
|
83
|
+
addresses?: Address[];
|
|
84
|
+
website?: string;
|
|
85
|
+
description?: string;
|
|
86
|
+
ownerId?: string;
|
|
87
|
+
customFields?: Record<string, unknown>;
|
|
88
|
+
createdAt?: Date;
|
|
89
|
+
updatedAt?: Date;
|
|
90
|
+
remoteData?: unknown;
|
|
91
|
+
}
|
|
92
|
+
interface CreateContactInput {
|
|
93
|
+
firstName?: string;
|
|
94
|
+
lastName?: string;
|
|
95
|
+
email?: string;
|
|
96
|
+
emails?: IntegrationEmailAddress[];
|
|
97
|
+
phone?: string;
|
|
98
|
+
phones?: PhoneNumber[];
|
|
99
|
+
title?: string;
|
|
100
|
+
department?: string;
|
|
101
|
+
companyId?: string;
|
|
102
|
+
companyName?: string;
|
|
103
|
+
addresses?: Address[];
|
|
104
|
+
website?: string;
|
|
105
|
+
description?: string;
|
|
106
|
+
ownerId?: string;
|
|
107
|
+
customFields?: Record<string, unknown>;
|
|
108
|
+
}
|
|
109
|
+
type UpdateContactInput = Partial<CreateContactInput>;
|
|
110
|
+
interface Company {
|
|
111
|
+
id: string;
|
|
112
|
+
name: string;
|
|
113
|
+
domain?: string;
|
|
114
|
+
website?: string;
|
|
115
|
+
industry?: string;
|
|
116
|
+
description?: string;
|
|
117
|
+
employeeCount?: number;
|
|
118
|
+
annualRevenue?: number;
|
|
119
|
+
phone?: string;
|
|
120
|
+
phones?: PhoneNumber[];
|
|
121
|
+
addresses?: Address[];
|
|
122
|
+
ownerId?: string;
|
|
123
|
+
customFields?: Record<string, unknown>;
|
|
124
|
+
createdAt?: Date;
|
|
125
|
+
updatedAt?: Date;
|
|
126
|
+
remoteData?: unknown;
|
|
127
|
+
}
|
|
128
|
+
interface CreateCompanyInput {
|
|
129
|
+
name: string;
|
|
130
|
+
domain?: string;
|
|
131
|
+
website?: string;
|
|
132
|
+
industry?: string;
|
|
133
|
+
description?: string;
|
|
134
|
+
employeeCount?: number;
|
|
135
|
+
annualRevenue?: number;
|
|
136
|
+
phone?: string;
|
|
137
|
+
phones?: PhoneNumber[];
|
|
138
|
+
addresses?: Address[];
|
|
139
|
+
ownerId?: string;
|
|
140
|
+
customFields?: Record<string, unknown>;
|
|
141
|
+
}
|
|
142
|
+
type UpdateCompanyInput = Partial<CreateCompanyInput>;
|
|
143
|
+
interface Deal {
|
|
144
|
+
id: string;
|
|
145
|
+
name: string;
|
|
146
|
+
amount?: number;
|
|
147
|
+
currency?: string;
|
|
148
|
+
stage?: string;
|
|
149
|
+
status?: "open" | "won" | "lost";
|
|
150
|
+
probability?: number;
|
|
151
|
+
expectedCloseDate?: Date;
|
|
152
|
+
actualCloseDate?: Date;
|
|
153
|
+
companyId?: string;
|
|
154
|
+
contactIds?: string[];
|
|
155
|
+
ownerId?: string;
|
|
156
|
+
description?: string;
|
|
157
|
+
customFields?: Record<string, unknown>;
|
|
158
|
+
createdAt?: Date;
|
|
159
|
+
updatedAt?: Date;
|
|
160
|
+
remoteData?: unknown;
|
|
161
|
+
}
|
|
162
|
+
interface CreateDealInput {
|
|
163
|
+
name: string;
|
|
164
|
+
amount?: number;
|
|
165
|
+
currency?: string;
|
|
166
|
+
stage?: string;
|
|
167
|
+
status?: "open" | "won" | "lost";
|
|
168
|
+
probability?: number;
|
|
169
|
+
expectedCloseDate?: Date;
|
|
170
|
+
companyId?: string;
|
|
171
|
+
contactIds?: string[];
|
|
172
|
+
ownerId?: string;
|
|
173
|
+
description?: string;
|
|
174
|
+
customFields?: Record<string, unknown>;
|
|
175
|
+
}
|
|
176
|
+
type UpdateDealInput = Partial<CreateDealInput>;
|
|
177
|
+
interface FilePermission {
|
|
178
|
+
type: "user" | "group" | "anyone";
|
|
179
|
+
role: "owner" | "writer" | "reader" | "commenter";
|
|
180
|
+
email?: string;
|
|
181
|
+
displayName?: string;
|
|
182
|
+
}
|
|
183
|
+
interface File {
|
|
184
|
+
id: string;
|
|
185
|
+
name: string;
|
|
186
|
+
mimeType?: string;
|
|
187
|
+
size?: number;
|
|
188
|
+
folderId?: string;
|
|
189
|
+
path?: string;
|
|
190
|
+
downloadUrl?: string;
|
|
191
|
+
webUrl?: string;
|
|
192
|
+
thumbnailUrl?: string;
|
|
193
|
+
isFolder: boolean;
|
|
194
|
+
parentId?: string;
|
|
195
|
+
ownerId?: string;
|
|
196
|
+
permissions?: FilePermission[];
|
|
197
|
+
createdAt?: Date;
|
|
198
|
+
updatedAt?: Date;
|
|
199
|
+
remoteData?: unknown;
|
|
200
|
+
}
|
|
201
|
+
interface IntegrationFolder {
|
|
202
|
+
id: string;
|
|
203
|
+
name: string;
|
|
204
|
+
path?: string;
|
|
205
|
+
parentId?: string;
|
|
206
|
+
webUrl?: string;
|
|
207
|
+
itemCount?: number;
|
|
208
|
+
createdAt?: Date;
|
|
209
|
+
updatedAt?: Date;
|
|
210
|
+
remoteData?: unknown;
|
|
211
|
+
}
|
|
212
|
+
interface CreateFolderInput {
|
|
213
|
+
name: string;
|
|
214
|
+
parentId?: string;
|
|
215
|
+
}
|
|
216
|
+
interface UploadFileInput {
|
|
217
|
+
name: string;
|
|
218
|
+
mimeType: string;
|
|
219
|
+
data: ArrayBuffer | Uint8Array;
|
|
220
|
+
folderId?: string;
|
|
221
|
+
}
|
|
222
|
+
interface Channel {
|
|
223
|
+
id: string;
|
|
224
|
+
name: string;
|
|
225
|
+
description?: string;
|
|
226
|
+
type: "public" | "private" | "direct" | "group";
|
|
227
|
+
memberCount?: number;
|
|
228
|
+
isArchived?: boolean;
|
|
229
|
+
topic?: string;
|
|
230
|
+
createdAt?: Date;
|
|
231
|
+
updatedAt?: Date;
|
|
232
|
+
remoteData?: unknown;
|
|
233
|
+
}
|
|
234
|
+
interface MessageAttachment {
|
|
235
|
+
id?: string;
|
|
236
|
+
type?: "file" | "image" | "video" | "link";
|
|
237
|
+
name?: string;
|
|
238
|
+
url?: string;
|
|
239
|
+
size?: number;
|
|
240
|
+
mimeType?: string;
|
|
241
|
+
}
|
|
242
|
+
interface MessageReaction {
|
|
243
|
+
emoji: string;
|
|
244
|
+
count: number;
|
|
245
|
+
userIds?: string[];
|
|
246
|
+
}
|
|
247
|
+
interface Message {
|
|
248
|
+
id: string;
|
|
249
|
+
channelId: string;
|
|
250
|
+
content: string;
|
|
251
|
+
senderId?: string;
|
|
252
|
+
senderName?: string;
|
|
253
|
+
threadId?: string;
|
|
254
|
+
replyCount?: number;
|
|
255
|
+
isEdited?: boolean;
|
|
256
|
+
attachments?: MessageAttachment[];
|
|
257
|
+
reactions?: MessageReaction[];
|
|
258
|
+
createdAt?: Date;
|
|
259
|
+
updatedAt?: Date;
|
|
260
|
+
remoteData?: unknown;
|
|
261
|
+
}
|
|
262
|
+
interface SendMessageInput {
|
|
263
|
+
channelId: string;
|
|
264
|
+
content: string;
|
|
265
|
+
threadId?: string;
|
|
266
|
+
}
|
|
267
|
+
interface CommunicationUser {
|
|
268
|
+
id: string;
|
|
269
|
+
name?: string;
|
|
270
|
+
username?: string;
|
|
271
|
+
displayName?: string;
|
|
272
|
+
email?: string;
|
|
273
|
+
avatarUrl?: string;
|
|
274
|
+
status?: "active" | "away" | "dnd" | "offline" | {
|
|
275
|
+
text: string;
|
|
276
|
+
emoji?: string;
|
|
277
|
+
};
|
|
278
|
+
isBot?: boolean;
|
|
279
|
+
createdAt?: Date;
|
|
280
|
+
updatedAt?: Date;
|
|
281
|
+
remoteData?: unknown;
|
|
282
|
+
}
|
|
283
|
+
interface Document {
|
|
284
|
+
id: string;
|
|
285
|
+
title: string;
|
|
286
|
+
content?: string;
|
|
287
|
+
type?: "page" | "document" | "note";
|
|
288
|
+
parentId?: string;
|
|
289
|
+
webUrl?: string;
|
|
290
|
+
iconUrl?: string;
|
|
291
|
+
iconEmoji?: string;
|
|
292
|
+
coverUrl?: string;
|
|
293
|
+
isArchived?: boolean;
|
|
294
|
+
properties?: Record<string, unknown>;
|
|
295
|
+
createdAt?: Date;
|
|
296
|
+
updatedAt?: Date;
|
|
297
|
+
remoteData?: unknown;
|
|
298
|
+
}
|
|
299
|
+
interface CreateDocumentInput {
|
|
300
|
+
title: string;
|
|
301
|
+
content?: string;
|
|
302
|
+
type?: "page" | "document" | "note";
|
|
303
|
+
parentId?: string;
|
|
304
|
+
iconEmoji?: string;
|
|
305
|
+
}
|
|
306
|
+
type UpdateDocumentInput = Partial<CreateDocumentInput>;
|
|
307
|
+
type ColumnType = "text" | "number" | "boolean" | "date" | "datetime" | "select" | "multiSelect" | "url" | "email" | "phone" | "formula" | "relation" | "rollup" | "file" | "person" | "status" | "checkbox" | "unknown";
|
|
308
|
+
interface SelectOption {
|
|
309
|
+
id: string;
|
|
310
|
+
name: string;
|
|
311
|
+
color?: string;
|
|
312
|
+
}
|
|
313
|
+
interface TableColumn {
|
|
314
|
+
id: string;
|
|
315
|
+
name: string;
|
|
316
|
+
type: ColumnType;
|
|
317
|
+
description?: string;
|
|
318
|
+
options?: string[] | SelectOption[];
|
|
319
|
+
}
|
|
320
|
+
interface Table {
|
|
321
|
+
id: string;
|
|
322
|
+
name: string;
|
|
323
|
+
description?: string;
|
|
324
|
+
columns: TableColumn[];
|
|
325
|
+
webUrl?: string;
|
|
326
|
+
isArchived?: boolean;
|
|
327
|
+
createdAt?: Date;
|
|
328
|
+
updatedAt?: Date;
|
|
329
|
+
remoteData?: unknown;
|
|
330
|
+
}
|
|
331
|
+
interface TableRow {
|
|
332
|
+
id: string;
|
|
333
|
+
tableId: string;
|
|
334
|
+
cells: Record<string, unknown>;
|
|
335
|
+
webUrl?: string;
|
|
336
|
+
createdAt?: Date;
|
|
337
|
+
updatedAt?: Date;
|
|
338
|
+
remoteData?: unknown;
|
|
339
|
+
}
|
|
340
|
+
interface CreateTableRowInput {
|
|
341
|
+
cells: Record<string, unknown>;
|
|
342
|
+
}
|
|
343
|
+
type UpdateTableRowInput = CreateTableRowInput;
|
|
344
|
+
interface PassthroughRequest {
|
|
345
|
+
connectionId: string;
|
|
346
|
+
method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
347
|
+
path: string;
|
|
348
|
+
body?: unknown;
|
|
349
|
+
query?: Record<string, string>;
|
|
350
|
+
headers?: Record<string, string>;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
/**
|
|
354
|
+
* Stack0 Integrations Client
|
|
355
|
+
* Unified API for third-party integrations
|
|
356
|
+
*/
|
|
357
|
+
|
|
358
|
+
/**
|
|
359
|
+
* CRM operations client
|
|
360
|
+
*/
|
|
361
|
+
declare class CRM {
|
|
362
|
+
private http;
|
|
363
|
+
constructor(http: HttpClient);
|
|
364
|
+
listContacts(connectionId: string, options?: ListOptions): Promise<PaginatedResult<Contact>>;
|
|
365
|
+
getContact(connectionId: string, id: string): Promise<Contact>;
|
|
366
|
+
createContact(connectionId: string, data: CreateContactInput): Promise<Contact>;
|
|
367
|
+
updateContact(connectionId: string, id: string, data: UpdateContactInput): Promise<Contact>;
|
|
368
|
+
deleteContact(connectionId: string, id: string): Promise<{
|
|
369
|
+
success: boolean;
|
|
370
|
+
}>;
|
|
371
|
+
listCompanies(connectionId: string, options?: ListOptions): Promise<PaginatedResult<Company>>;
|
|
372
|
+
getCompany(connectionId: string, id: string): Promise<Company>;
|
|
373
|
+
createCompany(connectionId: string, data: CreateCompanyInput): Promise<Company>;
|
|
374
|
+
updateCompany(connectionId: string, id: string, data: UpdateCompanyInput): Promise<Company>;
|
|
375
|
+
deleteCompany(connectionId: string, id: string): Promise<{
|
|
376
|
+
success: boolean;
|
|
377
|
+
}>;
|
|
378
|
+
listDeals(connectionId: string, options?: ListOptions): Promise<PaginatedResult<Deal>>;
|
|
379
|
+
getDeal(connectionId: string, id: string): Promise<Deal>;
|
|
380
|
+
createDeal(connectionId: string, data: CreateDealInput): Promise<Deal>;
|
|
381
|
+
updateDeal(connectionId: string, id: string, data: UpdateDealInput): Promise<Deal>;
|
|
382
|
+
deleteDeal(connectionId: string, id: string): Promise<{
|
|
383
|
+
success: boolean;
|
|
384
|
+
}>;
|
|
385
|
+
}
|
|
386
|
+
/**
|
|
387
|
+
* Storage operations client
|
|
388
|
+
*/
|
|
389
|
+
declare class Storage {
|
|
390
|
+
private http;
|
|
391
|
+
constructor(http: HttpClient);
|
|
392
|
+
listFiles(connectionId: string, folderId?: string, options?: ListOptions): Promise<PaginatedResult<File>>;
|
|
393
|
+
getFile(connectionId: string, id: string): Promise<File>;
|
|
394
|
+
uploadFile(connectionId: string, input: UploadFileInput): Promise<File>;
|
|
395
|
+
deleteFile(connectionId: string, id: string): Promise<{
|
|
396
|
+
success: boolean;
|
|
397
|
+
}>;
|
|
398
|
+
downloadFile(connectionId: string, id: string): Promise<{
|
|
399
|
+
data: ArrayBuffer;
|
|
400
|
+
mimeType: string;
|
|
401
|
+
filename: string;
|
|
402
|
+
}>;
|
|
403
|
+
listFolders(connectionId: string, parentId?: string, options?: ListOptions): Promise<PaginatedResult<IntegrationFolder>>;
|
|
404
|
+
getFolder(connectionId: string, id: string): Promise<IntegrationFolder>;
|
|
405
|
+
createFolder(connectionId: string, data: CreateFolderInput): Promise<IntegrationFolder>;
|
|
406
|
+
deleteFolder(connectionId: string, id: string): Promise<{
|
|
407
|
+
success: boolean;
|
|
408
|
+
}>;
|
|
409
|
+
}
|
|
410
|
+
/**
|
|
411
|
+
* Communication operations client
|
|
412
|
+
*/
|
|
413
|
+
declare class Communication {
|
|
414
|
+
private http;
|
|
415
|
+
constructor(http: HttpClient);
|
|
416
|
+
listChannels(connectionId: string, options?: ListOptions): Promise<PaginatedResult<Channel>>;
|
|
417
|
+
getChannel(connectionId: string, id: string): Promise<Channel>;
|
|
418
|
+
listMessages(connectionId: string, channelId: string, options?: ListOptions): Promise<PaginatedResult<Message>>;
|
|
419
|
+
sendMessage(connectionId: string, input: SendMessageInput): Promise<Message>;
|
|
420
|
+
listUsers(connectionId: string, options?: ListOptions): Promise<PaginatedResult<CommunicationUser>>;
|
|
421
|
+
}
|
|
422
|
+
/**
|
|
423
|
+
* Productivity operations client
|
|
424
|
+
*/
|
|
425
|
+
declare class Productivity {
|
|
426
|
+
private http;
|
|
427
|
+
constructor(http: HttpClient);
|
|
428
|
+
listDocuments(connectionId: string, parentId?: string, options?: ListOptions): Promise<PaginatedResult<Document>>;
|
|
429
|
+
getDocument(connectionId: string, id: string): Promise<Document>;
|
|
430
|
+
createDocument(connectionId: string, data: CreateDocumentInput): Promise<Document>;
|
|
431
|
+
updateDocument(connectionId: string, id: string, data: UpdateDocumentInput): Promise<Document>;
|
|
432
|
+
listTables(connectionId: string, options?: ListOptions): Promise<PaginatedResult<Table>>;
|
|
433
|
+
getTable(connectionId: string, id: string): Promise<Table>;
|
|
434
|
+
listTableRows(connectionId: string, tableId: string, options?: ListOptions): Promise<PaginatedResult<TableRow>>;
|
|
435
|
+
getTableRow(connectionId: string, tableId: string, rowId: string): Promise<TableRow>;
|
|
436
|
+
createTableRow(connectionId: string, tableId: string, data: CreateTableRowInput): Promise<TableRow>;
|
|
437
|
+
updateTableRow(connectionId: string, tableId: string, rowId: string, data: UpdateTableRowInput): Promise<TableRow>;
|
|
438
|
+
deleteTableRow(connectionId: string, tableId: string, rowId: string): Promise<{
|
|
439
|
+
success: boolean;
|
|
440
|
+
}>;
|
|
441
|
+
}
|
|
442
|
+
/**
|
|
443
|
+
* Stack0 Integrations SDK Client
|
|
444
|
+
*
|
|
445
|
+
* @example
|
|
446
|
+
* ```typescript
|
|
447
|
+
* import { Integrations } from '@stack0/sdk';
|
|
448
|
+
*
|
|
449
|
+
* const integrations = new Integrations({ apiKey: 'stack0_...' });
|
|
450
|
+
*
|
|
451
|
+
* // List connectors
|
|
452
|
+
* const connectors = await integrations.listConnectors();
|
|
453
|
+
*
|
|
454
|
+
* // List contacts from a CRM connection
|
|
455
|
+
* const contacts = await integrations.crm.listContacts('conn_123');
|
|
456
|
+
*
|
|
457
|
+
* // Create a contact
|
|
458
|
+
* const contact = await integrations.crm.createContact('conn_123', {
|
|
459
|
+
* firstName: 'John',
|
|
460
|
+
* lastName: 'Doe',
|
|
461
|
+
* email: 'john@example.com',
|
|
462
|
+
* });
|
|
463
|
+
*
|
|
464
|
+
* // Send a message via Slack
|
|
465
|
+
* await integrations.communication.sendMessage('conn_456', {
|
|
466
|
+
* channelId: 'C123',
|
|
467
|
+
* content: 'Hello from Stack0!',
|
|
468
|
+
* });
|
|
469
|
+
*
|
|
470
|
+
* // Upload a file to Google Drive
|
|
471
|
+
* await integrations.storage.uploadFile('conn_789', {
|
|
472
|
+
* name: 'report.pdf',
|
|
473
|
+
* mimeType: 'application/pdf',
|
|
474
|
+
* data: fileBuffer,
|
|
475
|
+
* });
|
|
476
|
+
* ```
|
|
477
|
+
*/
|
|
478
|
+
declare class Integrations {
|
|
479
|
+
private http;
|
|
480
|
+
crm: CRM;
|
|
481
|
+
storage: Storage;
|
|
482
|
+
communication: Communication;
|
|
483
|
+
productivity: Productivity;
|
|
484
|
+
constructor(config: HttpClientConfig);
|
|
485
|
+
/**
|
|
486
|
+
* List all available connectors
|
|
487
|
+
*/
|
|
488
|
+
listConnectors(category?: ConnectorCategory): Promise<Connector[]>;
|
|
489
|
+
/**
|
|
490
|
+
* Get a specific connector
|
|
491
|
+
*/
|
|
492
|
+
getConnector(slug: string): Promise<Connector>;
|
|
493
|
+
/**
|
|
494
|
+
* List all connections
|
|
495
|
+
*/
|
|
496
|
+
listConnections(options?: {
|
|
497
|
+
connectorId?: string;
|
|
498
|
+
status?: Connection["status"];
|
|
499
|
+
}): Promise<Connection[]>;
|
|
500
|
+
/**
|
|
501
|
+
* Get a specific connection
|
|
502
|
+
*/
|
|
503
|
+
getConnection(id: string): Promise<Connection>;
|
|
504
|
+
/**
|
|
505
|
+
* Create a new connection (initiates OAuth flow)
|
|
506
|
+
* Returns the OAuth authorization URL to redirect the user to
|
|
507
|
+
*/
|
|
508
|
+
createConnection(connectorSlug: string, options?: {
|
|
509
|
+
name?: string;
|
|
510
|
+
projectId?: string;
|
|
511
|
+
}): Promise<{
|
|
512
|
+
connectionId: string;
|
|
513
|
+
authorizationUrl: string;
|
|
514
|
+
}>;
|
|
515
|
+
/**
|
|
516
|
+
* Delete a connection
|
|
517
|
+
*/
|
|
518
|
+
deleteConnection(id: string): Promise<{
|
|
519
|
+
success: boolean;
|
|
520
|
+
}>;
|
|
521
|
+
/**
|
|
522
|
+
* Test a connection's credentials
|
|
523
|
+
*/
|
|
524
|
+
testConnection(id: string): Promise<{
|
|
525
|
+
success: boolean;
|
|
526
|
+
error?: string;
|
|
527
|
+
}>;
|
|
528
|
+
/**
|
|
529
|
+
* Make a raw passthrough request to the provider API
|
|
530
|
+
*/
|
|
531
|
+
passthrough(request: PassthroughRequest): Promise<unknown>;
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
/**
|
|
535
|
+
* Marketing SDK Types
|
|
536
|
+
*/
|
|
537
|
+
type MarketingEnvironment = "sandbox" | "production";
|
|
538
|
+
type ContentStatus = "draft" | "pending_review" | "approved" | "rejected" | "publishing" | "published" | "failed" | "archived";
|
|
539
|
+
type TrendStatus = "discovered" | "analyzing" | "active" | "declining" | "expired";
|
|
540
|
+
type ContentType = "tiktok_slideshow" | "instagram_reel" | "youtube_short" | "blog_post" | "twitter_thread";
|
|
541
|
+
type ApprovalStatus = "pending" | "approved" | "rejected";
|
|
542
|
+
interface Trend {
|
|
543
|
+
id: string;
|
|
544
|
+
organizationId: string;
|
|
545
|
+
projectId: string;
|
|
546
|
+
environment: MarketingEnvironment;
|
|
547
|
+
keyword: string;
|
|
548
|
+
source: string;
|
|
549
|
+
category?: string | null;
|
|
550
|
+
searchVolume?: number | null;
|
|
551
|
+
growthRate?: number | null;
|
|
552
|
+
trendScore: number;
|
|
553
|
+
status: TrendStatus;
|
|
554
|
+
sourceData?: Record<string, unknown> | null;
|
|
555
|
+
firstSeenAt: Date;
|
|
556
|
+
lastUpdatedAt: Date;
|
|
557
|
+
expiresAt?: Date | null;
|
|
558
|
+
createdAt: Date;
|
|
559
|
+
}
|
|
560
|
+
interface DiscoverTrendsRequest {
|
|
561
|
+
projectSlug: string;
|
|
562
|
+
environment: MarketingEnvironment;
|
|
563
|
+
}
|
|
564
|
+
interface DiscoverTrendsResponse {
|
|
565
|
+
success: boolean;
|
|
566
|
+
trendsDiscovered: number;
|
|
567
|
+
trends: Trend[];
|
|
568
|
+
}
|
|
569
|
+
interface ListTrendsRequest {
|
|
570
|
+
projectSlug: string;
|
|
571
|
+
environment: MarketingEnvironment;
|
|
572
|
+
status?: TrendStatus;
|
|
573
|
+
limit?: number;
|
|
574
|
+
}
|
|
575
|
+
type ListTrendsResponse = Trend[];
|
|
576
|
+
interface Opportunity {
|
|
577
|
+
id: string;
|
|
578
|
+
organizationId: string;
|
|
579
|
+
projectId: string;
|
|
580
|
+
environment: MarketingEnvironment;
|
|
581
|
+
title: string;
|
|
582
|
+
description?: string | null;
|
|
583
|
+
contentType: ContentType;
|
|
584
|
+
opportunityScore: number;
|
|
585
|
+
estimatedViews?: number | null;
|
|
586
|
+
confidenceLevel?: number | null;
|
|
587
|
+
trendIds?: string[] | null;
|
|
588
|
+
reasoning?: string | null;
|
|
589
|
+
suggestedAngle?: string | null;
|
|
590
|
+
targetAudience?: string | null;
|
|
591
|
+
contentId?: string | null;
|
|
592
|
+
status: string;
|
|
593
|
+
usedAt?: Date | null;
|
|
594
|
+
createdAt: Date;
|
|
595
|
+
expiresAt?: Date | null;
|
|
596
|
+
}
|
|
597
|
+
interface GenerateOpportunitiesRequest {
|
|
598
|
+
projectSlug: string;
|
|
599
|
+
environment: MarketingEnvironment;
|
|
600
|
+
}
|
|
601
|
+
interface GenerateOpportunitiesResponse {
|
|
602
|
+
success: boolean;
|
|
603
|
+
opportunitiesGenerated: number;
|
|
604
|
+
opportunities: Opportunity[];
|
|
605
|
+
}
|
|
606
|
+
interface ListOpportunitiesRequest {
|
|
607
|
+
projectSlug: string;
|
|
608
|
+
environment: MarketingEnvironment;
|
|
609
|
+
status?: string;
|
|
610
|
+
limit?: number;
|
|
611
|
+
}
|
|
612
|
+
type ListOpportunitiesResponse = Opportunity[];
|
|
613
|
+
interface DismissOpportunityRequest {
|
|
614
|
+
opportunityId: string;
|
|
615
|
+
}
|
|
616
|
+
interface Content {
|
|
617
|
+
id: string;
|
|
618
|
+
organizationId: string;
|
|
619
|
+
projectId: string;
|
|
620
|
+
environment: MarketingEnvironment;
|
|
621
|
+
contentType: ContentType;
|
|
622
|
+
title: string;
|
|
623
|
+
description?: string | null;
|
|
624
|
+
opportunityId?: string | null;
|
|
625
|
+
scriptId?: string | null;
|
|
626
|
+
assetUrls?: {
|
|
627
|
+
slides?: string[];
|
|
628
|
+
video?: string;
|
|
629
|
+
thumbnail?: string;
|
|
630
|
+
captions?: string;
|
|
631
|
+
} | null;
|
|
632
|
+
duration?: number | null;
|
|
633
|
+
slideCount?: number | null;
|
|
634
|
+
fileSize?: number | null;
|
|
635
|
+
platformData?: Record<string, unknown> | null;
|
|
636
|
+
status: ContentStatus;
|
|
637
|
+
approvalStatus: ApprovalStatus;
|
|
638
|
+
reviewedByUserId?: string | null;
|
|
639
|
+
reviewedAt?: Date | null;
|
|
640
|
+
reviewNotes?: string | null;
|
|
641
|
+
publishedAt?: Date | null;
|
|
642
|
+
publishedUrl?: string | null;
|
|
643
|
+
views?: number | null;
|
|
644
|
+
likes?: number | null;
|
|
645
|
+
shares?: number | null;
|
|
646
|
+
comments?: number | null;
|
|
647
|
+
creditsUsed?: number | null;
|
|
648
|
+
createdAt: Date;
|
|
649
|
+
updatedAt?: Date | null;
|
|
650
|
+
}
|
|
651
|
+
interface CreateContentRequest {
|
|
652
|
+
projectSlug: string;
|
|
653
|
+
environment: MarketingEnvironment;
|
|
654
|
+
contentType: ContentType;
|
|
655
|
+
title: string;
|
|
656
|
+
description?: string;
|
|
657
|
+
opportunityId?: string;
|
|
658
|
+
scriptId?: string;
|
|
659
|
+
}
|
|
660
|
+
interface ListContentRequest {
|
|
661
|
+
projectSlug: string;
|
|
662
|
+
environment: MarketingEnvironment;
|
|
663
|
+
status?: ContentStatus;
|
|
664
|
+
contentType?: ContentType;
|
|
665
|
+
approvalStatus?: ApprovalStatus;
|
|
666
|
+
limit?: number;
|
|
667
|
+
offset?: number;
|
|
668
|
+
}
|
|
669
|
+
type ListContentResponse = Content[];
|
|
670
|
+
interface UpdateContentRequest {
|
|
671
|
+
contentId: string;
|
|
672
|
+
title?: string;
|
|
673
|
+
description?: string;
|
|
674
|
+
status?: ContentStatus;
|
|
675
|
+
assetUrls?: {
|
|
676
|
+
slides?: string[];
|
|
677
|
+
video?: string;
|
|
678
|
+
thumbnail?: string;
|
|
679
|
+
captions?: string;
|
|
680
|
+
};
|
|
681
|
+
platformData?: Record<string, unknown>;
|
|
682
|
+
publishedUrl?: string;
|
|
683
|
+
}
|
|
684
|
+
interface ApproveContentRequest {
|
|
685
|
+
contentId: string;
|
|
686
|
+
reviewNotes?: string;
|
|
687
|
+
}
|
|
688
|
+
interface RejectContentRequest {
|
|
689
|
+
contentId: string;
|
|
690
|
+
reviewNotes: string;
|
|
691
|
+
}
|
|
692
|
+
interface ScriptSlide {
|
|
693
|
+
order: number;
|
|
694
|
+
text: string;
|
|
695
|
+
voiceoverText: string;
|
|
696
|
+
duration: number;
|
|
697
|
+
visualStyle?: string;
|
|
698
|
+
}
|
|
699
|
+
interface Script {
|
|
700
|
+
id: string;
|
|
701
|
+
organizationId: string;
|
|
702
|
+
projectId: string;
|
|
703
|
+
environment: MarketingEnvironment;
|
|
704
|
+
contentId?: string | null;
|
|
705
|
+
hook: string;
|
|
706
|
+
slides: ScriptSlide[];
|
|
707
|
+
cta: string;
|
|
708
|
+
prompt?: string | null;
|
|
709
|
+
model?: string | null;
|
|
710
|
+
tokensUsed?: number | null;
|
|
711
|
+
generationTimeMs?: number | null;
|
|
712
|
+
version: number;
|
|
713
|
+
previousVersionId?: string | null;
|
|
714
|
+
createdAt: Date;
|
|
715
|
+
}
|
|
716
|
+
interface CreateScriptRequest {
|
|
717
|
+
projectSlug: string;
|
|
718
|
+
environment: MarketingEnvironment;
|
|
719
|
+
contentId?: string;
|
|
720
|
+
hook: string;
|
|
721
|
+
slides: ScriptSlide[];
|
|
722
|
+
cta: string;
|
|
723
|
+
prompt?: string;
|
|
724
|
+
model?: string;
|
|
725
|
+
tokensUsed?: number;
|
|
726
|
+
generationTimeMs?: number;
|
|
727
|
+
}
|
|
728
|
+
interface ListScriptsRequest {
|
|
729
|
+
projectSlug: string;
|
|
730
|
+
environment: MarketingEnvironment;
|
|
731
|
+
contentId?: string;
|
|
732
|
+
limit?: number;
|
|
733
|
+
}
|
|
734
|
+
type ListScriptsResponse = Script[];
|
|
735
|
+
interface AnalyticsOverviewRequest {
|
|
736
|
+
projectSlug: string;
|
|
737
|
+
environment: MarketingEnvironment;
|
|
738
|
+
startDate?: Date;
|
|
739
|
+
endDate?: Date;
|
|
740
|
+
}
|
|
741
|
+
interface AnalyticsOverviewResponse {
|
|
742
|
+
totalContent: number;
|
|
743
|
+
publishedContent: number;
|
|
744
|
+
draftContent: number;
|
|
745
|
+
engagement: {
|
|
746
|
+
views: number;
|
|
747
|
+
likes: number;
|
|
748
|
+
shares: number;
|
|
749
|
+
comments: number;
|
|
750
|
+
};
|
|
751
|
+
contentByType: Array<{
|
|
752
|
+
contentType: ContentType;
|
|
753
|
+
count: number;
|
|
754
|
+
}>;
|
|
755
|
+
contentByStatus: Array<{
|
|
756
|
+
status: ContentStatus;
|
|
757
|
+
count: number;
|
|
758
|
+
}>;
|
|
759
|
+
}
|
|
760
|
+
interface ContentPerformanceRequest {
|
|
761
|
+
projectSlug: string;
|
|
762
|
+
environment: MarketingEnvironment;
|
|
763
|
+
contentType?: ContentType;
|
|
764
|
+
limit?: number;
|
|
765
|
+
}
|
|
766
|
+
interface ContentPerformanceItem {
|
|
767
|
+
id: string;
|
|
768
|
+
title: string;
|
|
769
|
+
contentType: ContentType;
|
|
770
|
+
views: number | null;
|
|
771
|
+
likes: number | null;
|
|
772
|
+
shares: number | null;
|
|
773
|
+
comments: number | null;
|
|
774
|
+
publishedAt: Date | null;
|
|
775
|
+
engagementRate: number;
|
|
776
|
+
}
|
|
777
|
+
type ContentPerformanceResponse = ContentPerformanceItem[];
|
|
778
|
+
|
|
779
|
+
/**
|
|
780
|
+
* Stack0 Marketing Client
|
|
781
|
+
* Discover trends, generate content opportunities, and manage marketing content
|
|
782
|
+
*/
|
|
783
|
+
|
|
784
|
+
declare class Marketing {
|
|
785
|
+
private http;
|
|
786
|
+
constructor(config: HttpClientConfig);
|
|
787
|
+
/**
|
|
788
|
+
* Discover new trends from all sources
|
|
789
|
+
*
|
|
790
|
+
* @example
|
|
791
|
+
* ```typescript
|
|
792
|
+
* const { trendsDiscovered, trends } = await marketing.discoverTrends({
|
|
793
|
+
* projectSlug: 'my-project',
|
|
794
|
+
* environment: 'production',
|
|
795
|
+
* });
|
|
796
|
+
* console.log(`Discovered ${trendsDiscovered} new trends`);
|
|
797
|
+
* ```
|
|
798
|
+
*/
|
|
799
|
+
discoverTrends(request: DiscoverTrendsRequest): Promise<DiscoverTrendsResponse>;
|
|
800
|
+
/**
|
|
801
|
+
* List trends for a project
|
|
802
|
+
*
|
|
803
|
+
* @example
|
|
804
|
+
* ```typescript
|
|
805
|
+
* const trends = await marketing.listTrends({
|
|
806
|
+
* projectSlug: 'my-project',
|
|
807
|
+
* environment: 'production',
|
|
808
|
+
* limit: 20,
|
|
809
|
+
* });
|
|
810
|
+
* ```
|
|
811
|
+
*/
|
|
812
|
+
listTrends(request: ListTrendsRequest): Promise<Trend[]>;
|
|
813
|
+
/**
|
|
814
|
+
* Get a single trend by ID
|
|
815
|
+
*/
|
|
816
|
+
getTrend(trendId: string): Promise<Trend>;
|
|
817
|
+
/**
|
|
818
|
+
* Generate content opportunities from active trends
|
|
819
|
+
*
|
|
820
|
+
* @example
|
|
821
|
+
* ```typescript
|
|
822
|
+
* const { opportunitiesGenerated, opportunities } = await marketing.generateOpportunities({
|
|
823
|
+
* projectSlug: 'my-project',
|
|
824
|
+
* environment: 'production',
|
|
825
|
+
* });
|
|
826
|
+
* console.log(`Generated ${opportunitiesGenerated} new content ideas`);
|
|
827
|
+
* ```
|
|
828
|
+
*/
|
|
829
|
+
generateOpportunities(request: GenerateOpportunitiesRequest): Promise<GenerateOpportunitiesResponse>;
|
|
830
|
+
/**
|
|
831
|
+
* List opportunities for a project
|
|
832
|
+
*
|
|
833
|
+
* @example
|
|
834
|
+
* ```typescript
|
|
835
|
+
* const opportunities = await marketing.listOpportunities({
|
|
836
|
+
* projectSlug: 'my-project',
|
|
837
|
+
* environment: 'production',
|
|
838
|
+
* status: 'pending',
|
|
839
|
+
* limit: 20,
|
|
840
|
+
* });
|
|
841
|
+
* ```
|
|
842
|
+
*/
|
|
843
|
+
listOpportunities(request: ListOpportunitiesRequest): Promise<Opportunity[]>;
|
|
844
|
+
/**
|
|
845
|
+
* Get a single opportunity by ID
|
|
846
|
+
*/
|
|
847
|
+
getOpportunity(opportunityId: string): Promise<Opportunity>;
|
|
848
|
+
/**
|
|
849
|
+
* Dismiss an opportunity
|
|
850
|
+
*
|
|
851
|
+
* @example
|
|
852
|
+
* ```typescript
|
|
853
|
+
* await marketing.dismissOpportunity({ opportunityId: 'opp-id' });
|
|
854
|
+
* ```
|
|
855
|
+
*/
|
|
856
|
+
dismissOpportunity(request: DismissOpportunityRequest): Promise<{
|
|
857
|
+
success: boolean;
|
|
858
|
+
}>;
|
|
859
|
+
/**
|
|
860
|
+
* Create new marketing content
|
|
861
|
+
*
|
|
862
|
+
* @example
|
|
863
|
+
* ```typescript
|
|
864
|
+
* const content = await marketing.createContent({
|
|
865
|
+
* projectSlug: 'my-project',
|
|
866
|
+
* environment: 'production',
|
|
867
|
+
* contentType: 'tiktok_slideshow',
|
|
868
|
+
* title: 'How AI is Changing Marketing',
|
|
869
|
+
* opportunityId: 'opp-id',
|
|
870
|
+
* });
|
|
871
|
+
* ```
|
|
872
|
+
*/
|
|
873
|
+
createContent(request: CreateContentRequest): Promise<Content>;
|
|
874
|
+
/**
|
|
875
|
+
* List content with filters
|
|
876
|
+
*
|
|
877
|
+
* @example
|
|
878
|
+
* ```typescript
|
|
879
|
+
* const content = await marketing.listContent({
|
|
880
|
+
* projectSlug: 'my-project',
|
|
881
|
+
* environment: 'production',
|
|
882
|
+
* status: 'published',
|
|
883
|
+
* limit: 20,
|
|
884
|
+
* });
|
|
885
|
+
* ```
|
|
886
|
+
*/
|
|
887
|
+
listContent(request: ListContentRequest): Promise<Content[]>;
|
|
888
|
+
/**
|
|
889
|
+
* Get a single content by ID
|
|
890
|
+
*/
|
|
891
|
+
getContent(contentId: string): Promise<Content>;
|
|
892
|
+
/**
|
|
893
|
+
* Update content
|
|
894
|
+
*
|
|
895
|
+
* @example
|
|
896
|
+
* ```typescript
|
|
897
|
+
* const updated = await marketing.updateContent({
|
|
898
|
+
* contentId: 'content-id',
|
|
899
|
+
* title: 'Updated Title',
|
|
900
|
+
* status: 'published',
|
|
901
|
+
* });
|
|
902
|
+
* ```
|
|
903
|
+
*/
|
|
904
|
+
updateContent(request: UpdateContentRequest): Promise<Content>;
|
|
905
|
+
/**
|
|
906
|
+
* Approve content for publishing
|
|
907
|
+
*
|
|
908
|
+
* @example
|
|
909
|
+
* ```typescript
|
|
910
|
+
* await marketing.approveContent({
|
|
911
|
+
* contentId: 'content-id',
|
|
912
|
+
* reviewNotes: 'Looks great!',
|
|
913
|
+
* });
|
|
914
|
+
* ```
|
|
915
|
+
*/
|
|
916
|
+
approveContent(request: ApproveContentRequest): Promise<Content>;
|
|
917
|
+
/**
|
|
918
|
+
* Reject content
|
|
919
|
+
*
|
|
920
|
+
* @example
|
|
921
|
+
* ```typescript
|
|
922
|
+
* await marketing.rejectContent({
|
|
923
|
+
* contentId: 'content-id',
|
|
924
|
+
* reviewNotes: 'Needs revisions',
|
|
925
|
+
* });
|
|
926
|
+
* ```
|
|
927
|
+
*/
|
|
928
|
+
rejectContent(request: RejectContentRequest): Promise<Content>;
|
|
929
|
+
/**
|
|
930
|
+
* Delete content
|
|
931
|
+
*/
|
|
932
|
+
deleteContent(contentId: string): Promise<{
|
|
933
|
+
success: boolean;
|
|
934
|
+
}>;
|
|
935
|
+
/**
|
|
936
|
+
* Create a new script
|
|
937
|
+
*
|
|
938
|
+
* @example
|
|
939
|
+
* ```typescript
|
|
940
|
+
* const script = await marketing.createScript({
|
|
941
|
+
* projectSlug: 'my-project',
|
|
942
|
+
* environment: 'production',
|
|
943
|
+
* hook: 'Are you ready to see the future?',
|
|
944
|
+
* slides: [
|
|
945
|
+
* { order: 0, text: 'AI is changing everything', voiceoverText: 'AI is transforming how we work', duration: 3 },
|
|
946
|
+
* ],
|
|
947
|
+
* cta: 'Follow for more insights!',
|
|
948
|
+
* });
|
|
949
|
+
* ```
|
|
950
|
+
*/
|
|
951
|
+
createScript(request: CreateScriptRequest): Promise<Script>;
|
|
952
|
+
/**
|
|
953
|
+
* List scripts
|
|
954
|
+
*/
|
|
955
|
+
listScripts(request: ListScriptsRequest): Promise<Script[]>;
|
|
956
|
+
/**
|
|
957
|
+
* Get a single script by ID
|
|
958
|
+
*/
|
|
959
|
+
getScript(scriptId: string): Promise<Script>;
|
|
960
|
+
/**
|
|
961
|
+
* Get analytics overview
|
|
962
|
+
*
|
|
963
|
+
* @example
|
|
964
|
+
* ```typescript
|
|
965
|
+
* const analytics = await marketing.getAnalyticsOverview({
|
|
966
|
+
* projectSlug: 'my-project',
|
|
967
|
+
* environment: 'production',
|
|
968
|
+
* });
|
|
969
|
+
* console.log(`Total content: ${analytics.totalContent}`);
|
|
970
|
+
* console.log(`Total views: ${analytics.engagement.views}`);
|
|
971
|
+
* ```
|
|
972
|
+
*/
|
|
973
|
+
getAnalyticsOverview(request: AnalyticsOverviewRequest): Promise<AnalyticsOverviewResponse>;
|
|
974
|
+
/**
|
|
975
|
+
* Get content performance metrics
|
|
976
|
+
*
|
|
977
|
+
* @example
|
|
978
|
+
* ```typescript
|
|
979
|
+
* const topContent = await marketing.getContentPerformance({
|
|
980
|
+
* projectSlug: 'my-project',
|
|
981
|
+
* environment: 'production',
|
|
982
|
+
* contentType: 'tiktok_slideshow',
|
|
983
|
+
* limit: 10,
|
|
984
|
+
* });
|
|
985
|
+
* ```
|
|
986
|
+
*/
|
|
987
|
+
getContentPerformance(request: ContentPerformanceRequest): Promise<ContentPerformanceResponse>;
|
|
988
|
+
private convertTrendDates;
|
|
989
|
+
private convertOpportunityDates;
|
|
990
|
+
private convertContentDates;
|
|
991
|
+
private convertScriptDates;
|
|
992
|
+
}
|
|
993
|
+
|
|
13
994
|
/**
|
|
14
995
|
* Stack0 SDK
|
|
15
996
|
* Official SDK for Stack0 services
|
|
@@ -48,12 +1029,32 @@ export { B as BatchJobStatus, C as CreateBatchResponse, c as CreateScheduleRespo
|
|
|
48
1029
|
* url: 'https://example.com/article',
|
|
49
1030
|
* mode: 'markdown',
|
|
50
1031
|
* });
|
|
1032
|
+
*
|
|
1033
|
+
* // List contacts from a connected CRM
|
|
1034
|
+
* const contacts = await stack0.integrations.crm.listContacts('conn_123');
|
|
1035
|
+
*
|
|
1036
|
+
* // Send a Slack message
|
|
1037
|
+
* await stack0.integrations.communication.sendMessage('conn_456', {
|
|
1038
|
+
* channelId: 'C123',
|
|
1039
|
+
* content: 'Hello from Stack0!',
|
|
1040
|
+
* });
|
|
1041
|
+
*
|
|
1042
|
+
* // Discover trends and generate content ideas
|
|
1043
|
+
* const { trendsDiscovered, trends } = await stack0.marketing.discoverTrends({
|
|
1044
|
+
* projectSlug: 'my-project',
|
|
1045
|
+
* environment: 'production',
|
|
1046
|
+
* });
|
|
51
1047
|
* ```
|
|
52
1048
|
*/
|
|
53
1049
|
|
|
54
1050
|
interface Stack0Config extends HttpClientConfig {
|
|
55
1051
|
apiKey: string;
|
|
56
1052
|
baseUrl?: string;
|
|
1053
|
+
/**
|
|
1054
|
+
* CDN base URL for image transformations (e.g., 'https://cdn.yourproject.stack0.dev')
|
|
1055
|
+
* When provided, transform URLs are generated client-side without API calls
|
|
1056
|
+
*/
|
|
1057
|
+
cdnUrl?: string;
|
|
57
1058
|
}
|
|
58
1059
|
/**
|
|
59
1060
|
* Main Stack0 SDK class
|
|
@@ -64,6 +1065,8 @@ declare class Stack0 {
|
|
|
64
1065
|
cdn: CDN;
|
|
65
1066
|
screenshots: Screenshots;
|
|
66
1067
|
extraction: Extraction;
|
|
1068
|
+
integrations: Integrations;
|
|
1069
|
+
marketing: Marketing;
|
|
67
1070
|
/**
|
|
68
1071
|
* @deprecated Use `screenshots` and `extraction` instead. Will be removed in a future version.
|
|
69
1072
|
*/
|
|
@@ -71,4 +1074,4 @@ declare class Stack0 {
|
|
|
71
1074
|
constructor(config: Stack0Config);
|
|
72
1075
|
}
|
|
73
1076
|
|
|
74
|
-
export { CDN, Extraction, Mail, Screenshots, Stack0, type Stack0Config, Webdata, Stack0 as default };
|
|
1077
|
+
export { type AnalyticsOverviewRequest, type AnalyticsOverviewResponse, type ApprovalStatus, type ApproveContentRequest, CDN, type Channel, type CommunicationUser, type Company, type Connection, type Connector, type ConnectorCategory, type Contact, type Content, type ContentPerformanceItem, type ContentPerformanceRequest, type ContentPerformanceResponse, type ContentStatus, type ContentType, type CreateCompanyInput, type CreateContactInput, type CreateContentRequest, type CreateDealInput, type CreateScriptRequest, type Deal, type DiscoverTrendsRequest, type DiscoverTrendsResponse, type DismissOpportunityRequest, Extraction, type GenerateOpportunitiesRequest, type GenerateOpportunitiesResponse, type Address as IntegrationAddress, type ColumnType as IntegrationColumnType, type CreateDocumentInput as IntegrationCreateDocumentInput, type CreateFolderInput as IntegrationCreateFolderInput, type CreateTableRowInput as IntegrationCreateTableRowInput, type Document as IntegrationDocument, type IntegrationEmailAddress, type File as IntegrationFile, type FilePermission as IntegrationFilePermission, type IntegrationFolder, type MessageAttachment as IntegrationMessageAttachment, type MessageReaction as IntegrationMessageReaction, type PhoneNumber as IntegrationPhoneNumber, type SelectOption as IntegrationSelectOption, type Table as IntegrationTable, type TableColumn as IntegrationTableColumn, type TableRow as IntegrationTableRow, type UpdateDocumentInput as IntegrationUpdateDocumentInput, type UpdateTableRowInput as IntegrationUpdateTableRowInput, Integrations, type ListOptions as IntegrationsListOptions, type PaginatedResult as IntegrationsPaginatedResult, type ListContentRequest, type ListContentResponse, type ListOpportunitiesRequest, type ListOpportunitiesResponse, type ListScriptsRequest, type ListScriptsResponse, type ListTrendsRequest, type ListTrendsResponse, Mail, Marketing, type MarketingEnvironment, type Message, type Opportunity, type PassthroughRequest, type RejectContentRequest, Screenshots, type Script, type ScriptSlide, type SendMessageInput, Stack0, type Stack0Config, type Trend, type TrendStatus, type UpdateCompanyInput, type UpdateContactInput, type UpdateContentRequest, type UpdateDealInput, type UploadFileInput, Webdata, Stack0 as default };
|