@stack0/sdk 0.5.6 → 0.5.8
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/cdn/index.d.mts +151 -1
- package/dist/cdn/index.d.ts +151 -1
- package/dist/cdn/index.js +74 -0
- package/dist/cdn/index.js.map +1 -1
- package/dist/cdn/index.mjs +74 -0
- package/dist/cdn/index.mjs.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +80 -13
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +80 -13
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1335,6 +1335,80 @@ var CDN = class {
|
|
|
1335
1335
|
async extractAudio(request) {
|
|
1336
1336
|
return this.http.post("/cdn/video/extract-audio", request);
|
|
1337
1337
|
}
|
|
1338
|
+
// ============================================================================
|
|
1339
|
+
// GIF Generation Methods
|
|
1340
|
+
// ============================================================================
|
|
1341
|
+
/**
|
|
1342
|
+
* Generate an animated GIF from a video segment
|
|
1343
|
+
*
|
|
1344
|
+
* Creates an optimized GIF from a portion of the video. Uses two-pass
|
|
1345
|
+
* palette generation by default for smaller file sizes with better quality.
|
|
1346
|
+
*
|
|
1347
|
+
* @example
|
|
1348
|
+
* ```typescript
|
|
1349
|
+
* const gif = await cdn.generateGif({
|
|
1350
|
+
* projectSlug: 'my-project',
|
|
1351
|
+
* assetId: 'video-asset-id',
|
|
1352
|
+
* startTime: 5, // Start at 5 seconds
|
|
1353
|
+
* duration: 3, // 3 second GIF
|
|
1354
|
+
* width: 480, // 480px wide
|
|
1355
|
+
* fps: 10, // 10 frames per second
|
|
1356
|
+
* });
|
|
1357
|
+
*
|
|
1358
|
+
* // Poll for completion
|
|
1359
|
+
* let result = await cdn.getGif(gif.id);
|
|
1360
|
+
* while (result?.status === 'pending' || result?.status === 'processing') {
|
|
1361
|
+
* await new Promise(r => setTimeout(r, 1000));
|
|
1362
|
+
* result = await cdn.getGif(gif.id);
|
|
1363
|
+
* }
|
|
1364
|
+
*
|
|
1365
|
+
* console.log(`GIF URL: ${result?.url}`);
|
|
1366
|
+
* ```
|
|
1367
|
+
*/
|
|
1368
|
+
async generateGif(request) {
|
|
1369
|
+
const response = await this.http.post("/cdn/video/gif", request);
|
|
1370
|
+
return this.convertGifDates(response);
|
|
1371
|
+
}
|
|
1372
|
+
/**
|
|
1373
|
+
* Get a specific GIF by ID
|
|
1374
|
+
*
|
|
1375
|
+
* @example
|
|
1376
|
+
* ```typescript
|
|
1377
|
+
* const gif = await cdn.getGif('gif-id');
|
|
1378
|
+
* if (gif?.status === 'completed') {
|
|
1379
|
+
* console.log(`GIF URL: ${gif.url}`);
|
|
1380
|
+
* console.log(`Size: ${gif.sizeBytes} bytes`);
|
|
1381
|
+
* }
|
|
1382
|
+
* ```
|
|
1383
|
+
*/
|
|
1384
|
+
async getGif(gifId) {
|
|
1385
|
+
const response = await this.http.get(`/cdn/video/gif/${gifId}`);
|
|
1386
|
+
return response ? this.convertGifDates(response) : null;
|
|
1387
|
+
}
|
|
1388
|
+
/**
|
|
1389
|
+
* List all GIFs generated for a video asset
|
|
1390
|
+
*
|
|
1391
|
+
* @example
|
|
1392
|
+
* ```typescript
|
|
1393
|
+
* const gifs = await cdn.listGifs({ assetId: 'video-asset-id' });
|
|
1394
|
+
* for (const gif of gifs) {
|
|
1395
|
+
* console.log(`GIF at ${gif.startTime}s: ${gif.url}`);
|
|
1396
|
+
* }
|
|
1397
|
+
* ```
|
|
1398
|
+
*/
|
|
1399
|
+
async listGifs(request) {
|
|
1400
|
+
const response = await this.http.get(`/cdn/video/${request.assetId}/gifs`);
|
|
1401
|
+
return response.map((gif) => this.convertGifDates(gif));
|
|
1402
|
+
}
|
|
1403
|
+
convertGifDates(gif) {
|
|
1404
|
+
if (typeof gif.createdAt === "string") {
|
|
1405
|
+
gif.createdAt = new Date(gif.createdAt);
|
|
1406
|
+
}
|
|
1407
|
+
if (gif.completedAt && typeof gif.completedAt === "string") {
|
|
1408
|
+
gif.completedAt = new Date(gif.completedAt);
|
|
1409
|
+
}
|
|
1410
|
+
return gif;
|
|
1411
|
+
}
|
|
1338
1412
|
convertJobDates(job) {
|
|
1339
1413
|
if (typeof job.createdAt === "string") {
|
|
1340
1414
|
job.createdAt = new Date(job.createdAt);
|
|
@@ -3511,9 +3585,7 @@ var Productivity = class {
|
|
|
3511
3585
|
return this.http.get(`/integrations/productivity/tables/${tableId}/rows?${params}`);
|
|
3512
3586
|
}
|
|
3513
3587
|
async getTableRow(connectionId, tableId, rowId) {
|
|
3514
|
-
return this.http.get(
|
|
3515
|
-
`/integrations/productivity/tables/${tableId}/rows/${rowId}?connectionId=${connectionId}`
|
|
3516
|
-
);
|
|
3588
|
+
return this.http.get(`/integrations/productivity/tables/${tableId}/rows/${rowId}?connectionId=${connectionId}`);
|
|
3517
3589
|
}
|
|
3518
3590
|
async createTableRow(connectionId, tableId, data) {
|
|
3519
3591
|
return this.http.post(`/integrations/productivity/tables/${tableId}/rows`, {
|
|
@@ -3528,9 +3600,7 @@ var Productivity = class {
|
|
|
3528
3600
|
});
|
|
3529
3601
|
}
|
|
3530
3602
|
async deleteTableRow(connectionId, tableId, rowId) {
|
|
3531
|
-
return this.http.delete(
|
|
3532
|
-
`/integrations/productivity/tables/${tableId}/rows/${rowId}?connectionId=${connectionId}`
|
|
3533
|
-
);
|
|
3603
|
+
return this.http.delete(`/integrations/productivity/tables/${tableId}/rows/${rowId}?connectionId=${connectionId}`);
|
|
3534
3604
|
}
|
|
3535
3605
|
};
|
|
3536
3606
|
var Integrations = class {
|
|
@@ -3657,10 +3727,9 @@ var Integrations = class {
|
|
|
3657
3727
|
* ```
|
|
3658
3728
|
*/
|
|
3659
3729
|
async reconnectConnection(request) {
|
|
3660
|
-
return this.http.post(
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
);
|
|
3730
|
+
return this.http.post(`/integrations/connections/${request.connectionId}/reconnect`, {
|
|
3731
|
+
redirectUrl: request.redirectUrl
|
|
3732
|
+
});
|
|
3664
3733
|
}
|
|
3665
3734
|
/**
|
|
3666
3735
|
* Get integration statistics
|
|
@@ -3704,9 +3773,7 @@ var Integrations = class {
|
|
|
3704
3773
|
if (request?.limit) params.set("limit", request.limit.toString());
|
|
3705
3774
|
if (request?.cursor) params.set("cursor", request.cursor);
|
|
3706
3775
|
const queryString = params.toString();
|
|
3707
|
-
const response = await this.http.get(
|
|
3708
|
-
`/integrations/logs${queryString ? `?${queryString}` : ""}`
|
|
3709
|
-
);
|
|
3776
|
+
const response = await this.http.get(`/integrations/logs${queryString ? `?${queryString}` : ""}`);
|
|
3710
3777
|
return {
|
|
3711
3778
|
...response,
|
|
3712
3779
|
logs: response.logs.map((log) => this.convertLogDates(log))
|