Skip to content

Commit b11dbcd

Browse files
committed
feat(cli): 游客云端任务创建后显式 start,完成后经 down 取结果
对齐 deckops node-cli:无凭证时调用 tasks.start;升级 @deckops/sdk 至 0.7.3。
1 parent 903fe7a commit b11dbcd

5 files changed

Lines changed: 19 additions & 7 deletions

File tree

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@deckflow/deckhtml",
3-
"version": "0.3.2",
3+
"version": "0.4.0",
44
"description": "Convert HTML to PPTX or PNG presentations",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",
@@ -42,7 +42,7 @@
4242
"homepage": "https://github.com/deckflow/deckhtml#readme",
4343
"license": "MIT",
4444
"dependencies": {
45-
"@deckops/sdk": "^0.7.2",
45+
"@deckops/sdk": "^0.7.3",
4646
"chrome-launcher": "^1.2.1",
4747
"commander": "^11.1.0",
4848
"jszip": "^3.10.1",

pnpm-lock.yaml

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pnpm-workspace.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
minimumReleaseAgeExclude:
2+
- '@deckops/sdk@0.7.3'

src/cli/commands/convert.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,15 @@ async function runCloudConvert(
246246
: await deck.convertHtmlToPptx(taskInput);
247247

248248
logProgress(ctx.quiet, `Task created: ${task.id}`);
249+
250+
// Guest mode (no token/api-key): the backend parks the task in pending and
251+
// waits for an explicit start. If create triggered 401 → login → retry,
252+
// credentials are now set and authenticated tasks auto-start.
253+
if (!ctx.hasCredentials()) {
254+
logProgress(ctx.quiet, 'Starting guest task...');
255+
await deck.tasks.start(task.id);
256+
}
257+
249258
logProgress(ctx.quiet, 'Converting...');
250259

251260
const completed = await deck.tasks.wait(task.id, {

src/cli/types/sdk.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export interface DeckClient {
1313
convertHtmlToPptx(params: Record<string, unknown>): Promise<DeckTask>;
1414
convertHtmlToPng(params: Record<string, unknown>): Promise<DeckTask>;
1515
tasks: {
16+
start(taskId: string): Promise<DeckTask>;
1617
wait(
1718
taskId: string,
1819
options?: {

0 commit comments

Comments
 (0)