Repository navigation
feat(operation): add operation list, view, wait, watch, and cancel - #24
Conversation
|
Warning Review limit reached
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Next included review available in 12 minutes. View limit detailsLimit details: You’ve used the included review currently available. Your 89 included PR review attempts over the past 7 days set your current allowance at 1 review per hour. The included review limit has been reached and this organization has disabled usage-based review continuation. Wait for reviews to reset or ask a billing admin to change After included review limits. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (9)
Comment |
|
@coderabbitai review |
|
|
Reviewed locally (the CodeRabbit bot is rate-limited on this org): Fixed since the first push:
The branch is merged with |
Brings in the npm SDK prerelease pin (#16), operation commands (#24), doctor, link/project, api fields and the Blacksmith CI runners. package.json takes dev's exact pin, @polymorfa/sdk 0.1.0-dev.20260922102711, plus jq-wasm, so it now matches dev's package-lock.json and npm ci resolves. That prerelease lacks the campaign recipient, audience member and opt-out settings methods, so typecheck still fails against it until sdks#285 is published and this pin is bumped to the resulting exact version. README keeps this branch's stop and recipients/audiences/opt-outs sections and takes dev's pointer to the operation commands in place of the old "operation inspection is console-only" line. oclif topics are the union.
Summary
Adds
polymorfa operation list|view|wait|watch|canceland removes the README statements that operations are console-only.operation list: filters are--status,--kind,--resource-type/--resource-id,--since,--until, and cursor pagination.--owner organizationshows team and project operations;--owner project --project <id>shows one project.operation view <id>operation wait <id> [--timeout 300]chains server long-polls (?wait=30). Exit codes: 0 on success, 1 on failure or cancellation, 8 (action_required) when the timeout ends first.operation watch <id>prints the current state and then each transition (afterSequencelong-polls). With--jsonit prints one JSON document per change. Exit codes matchwait.operation cancel <id>needs confirmation (or--yes) and accepts--idempotency-key.SDK dependency, and why I used an adapter. The CLI pins
@polymorfa/sdktogithub:polymorfa/sdks#94bfd09. Since sdks4f54b26, the SDK repo root is a private workspace (polymorfa-sdks), so a git ref to any newer SDK commit won't install.@polymorfa/sdkalso isn't on npm yet (404). So the CLI can't consumeclient.operationsfrom polymorfa/sdks#280 yet. Instead,src/developer/operations.tssends the same Platform requests through the pinned SDK's authenticated raw transport, with the same list/get/wait/cancel shape as the SDK resource. Once the SDK is consumable, the adapter should be replaced withsession.client.operations. That's tracked as a follow-up.Five-part assessment
Verification
tsc --noEmit, eslint, and prettier on the changed filestest/commands/operations.test.ts(8 tests): org vs project routing, filters, long-poll query and request timeout, exit codes 0/1/8,watchtransitions withafterSequence, cancel with the idempotency key, and refusal without--yes.npm testlocally: 18 pre-existing failures inapi,auth,calls,calls-sockets, andlisten. The same tests fail on a cleandevcheckout on this machine. I'm relying on CI for those.