hanzoai 8.5.623 → 8.5.646
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 +64 -9
- package/dist/answer.js +20 -10
- package/dist/api/account-api.d.ts +103 -49
- package/dist/api/account-api.js +122 -50
- package/dist/api/ai-api.d.ts +280 -14
- package/dist/api/ai-api.js +315 -29
- package/dist/api/auto-api.d.ts +64 -0
- package/dist/api/auto-api.js +77 -0
- package/dist/api/billing-api.d.ts +4 -4
- package/dist/api/billing-api.js +4 -4
- package/dist/api/git-api.d.ts +30 -0
- package/dist/api/git-api.js +59 -0
- package/dist/api/iam-api.d.ts +16 -16
- package/dist/api/iam-api.js +16 -16
- package/dist/api/task-api.d.ts +55 -0
- package/dist/api/task-api.js +71 -0
- package/dist/api/train-api.d.ts +1198 -0
- package/dist/api/train-api.js +1687 -0
- package/dist/api.d.ts +1 -0
- package/dist/api.js +1 -0
- package/dist/client.d.ts +3 -2
- package/dist/client.js +4 -3
- package/dist/esm/answer.js +20 -10
- package/dist/esm/api/account-api.d.ts +103 -49
- package/dist/esm/api/account-api.js +122 -50
- package/dist/esm/api/ai-api.d.ts +280 -14
- package/dist/esm/api/ai-api.js +315 -29
- package/dist/esm/api/auto-api.d.ts +64 -0
- package/dist/esm/api/auto-api.js +77 -0
- package/dist/esm/api/billing-api.d.ts +4 -4
- package/dist/esm/api/billing-api.js +4 -4
- package/dist/esm/api/git-api.d.ts +30 -0
- package/dist/esm/api/git-api.js +59 -0
- package/dist/esm/api/iam-api.d.ts +16 -16
- package/dist/esm/api/iam-api.js +16 -16
- package/dist/esm/api/task-api.d.ts +55 -0
- package/dist/esm/api/task-api.js +71 -0
- package/dist/esm/api/train-api.d.ts +1197 -0
- package/dist/esm/api/train-api.js +1677 -0
- package/dist/esm/api.d.ts +1 -0
- package/dist/esm/api.js +1 -0
- package/dist/esm/client.d.ts +3 -2
- package/dist/esm/client.js +3 -2
- package/dist/esm/hanzo.d.ts +3 -0
- package/dist/esm/hanzo.js +6 -0
- package/dist/esm/models/account-api-key-list.d.ts +1 -1
- package/dist/esm/models/account-api-key.d.ts +72 -5
- package/dist/esm/models/account-key-budget.d.ts +30 -0
- package/dist/esm/models/account-key-edit.d.ts +55 -0
- package/dist/esm/models/account-key-in.d.ts +55 -0
- package/dist/esm/models/agent-target-view.d.ts +6 -0
- package/dist/esm/models/ai-chat-in.d.ts +42 -0
- package/dist/esm/models/ai-chat.d.ts +37 -0
- package/dist/esm/models/ai-decide-in.d.ts +50 -0
- package/dist/esm/models/ai-decide-in.js +14 -0
- package/dist/esm/models/ai-decision-sides.d.ts +4 -5
- package/dist/esm/models/ai-decision.d.ts +31 -0
- package/dist/esm/models/ai-decision.js +14 -0
- package/dist/esm/models/ai-decisions-answer.d.ts +2 -3
- package/dist/esm/models/ai-decisions-choice.d.ts +4 -8
- package/dist/esm/models/ai-decisions-noul.d.ts +2 -3
- package/dist/esm/models/ai-decisions-request.d.ts +2 -3
- package/dist/esm/models/ai-decisions-score.d.ts +4 -5
- package/dist/esm/models/ai-model.d.ts +73 -0
- package/dist/esm/models/ai-model.js +14 -0
- package/dist/esm/models/ai-models.d.ts +31 -0
- package/dist/esm/models/ai-models.js +14 -0
- package/dist/esm/models/ai-price.d.ts +48 -0
- package/dist/esm/models/ai-price.js +14 -0
- package/dist/esm/models/ai-receipt.d.ts +60 -0
- package/dist/esm/models/ai-receipt.js +14 -0
- package/dist/esm/models/ai-routing-reward-request.d.ts +54 -0
- package/dist/esm/models/ai-routing-reward-request.js +24 -0
- package/dist/esm/models/auto-automation-in.d.ts +6 -0
- package/dist/esm/models/auto-automation-patch.d.ts +6 -0
- package/dist/esm/models/auto-automation-run.d.ts +14 -1
- package/dist/esm/models/auto-automation.d.ts +6 -0
- package/dist/esm/models/auto-post-result.d.ts +36 -0
- package/dist/esm/models/auto-post-result.js +14 -0
- package/dist/esm/models/{account-revoked-key.d.ts → auto-review-in.d.ts} +14 -8
- package/dist/esm/models/auto-review-in.js +14 -0
- package/dist/esm/models/git-workspace-view.d.ts +36 -0
- package/dist/esm/models/git-workspace-view.js +14 -0
- package/dist/esm/models/iam-key.d.ts +24 -0
- package/dist/esm/models/iam-user.d.ts +1 -1
- package/dist/esm/models/index.d.ts +66 -5
- package/dist/esm/models/index.js +66 -5
- package/dist/esm/models/provider-github-import-out.d.ts +6 -0
- package/dist/esm/models/provider-github-repo-item.d.ts +6 -0
- package/dist/esm/models/task-comment-list.d.ts +31 -0
- package/dist/esm/models/task-comment-list.js +14 -0
- package/dist/esm/models/task-comment.d.ts +42 -0
- package/dist/esm/models/task-comment.js +14 -0
- package/dist/esm/models/train-adaptation.d.ts +67 -0
- package/dist/esm/models/train-adaptation.js +14 -0
- package/dist/esm/models/train-artifact.d.ts +66 -0
- package/dist/esm/models/train-artifact.js +14 -0
- package/dist/esm/models/train-artifacts-out.d.ts +25 -0
- package/dist/esm/models/train-artifacts-out.js +14 -0
- package/dist/esm/models/train-assignment.d.ts +38 -0
- package/dist/esm/models/train-assignment.js +14 -0
- package/dist/esm/models/train-budget.d.ts +30 -0
- package/dist/esm/models/train-budget.js +14 -0
- package/dist/esm/models/train-catalog.d.ts +25 -0
- package/dist/esm/models/train-catalog.js +14 -0
- package/dist/esm/models/train-chose.d.ts +30 -0
- package/dist/esm/models/train-chose.js +14 -0
- package/dist/esm/models/train-claim-in.d.ts +49 -0
- package/dist/esm/models/train-claim-in.js +14 -0
- package/dist/esm/models/train-claimed.d.ts +72 -0
- package/dist/esm/models/train-claimed.js +14 -0
- package/dist/esm/models/train-client-list.d.ts +24 -0
- package/dist/esm/models/train-client-list.js +14 -0
- package/dist/esm/models/train-create-client-in.d.ts +44 -0
- package/dist/esm/models/train-create-client-in.js +14 -0
- package/dist/esm/models/train-dataset.d.ts +32 -0
- package/dist/esm/models/train-dataset.js +14 -0
- package/dist/esm/models/train-deleted-out.d.ts +30 -0
- package/dist/esm/models/train-deleted-out.js +14 -0
- package/dist/esm/models/train-download.d.ts +78 -0
- package/dist/esm/models/train-download.js +14 -0
- package/dist/esm/models/{ai-decision-sides-false.d.ts → train-evaluation.d.ts} +8 -2
- package/dist/esm/models/train-evaluation.js +14 -0
- package/dist/esm/models/train-event.d.ts +42 -0
- package/dist/esm/models/train-event.js +14 -0
- package/dist/esm/models/train-events-out.d.ts +37 -0
- package/dist/esm/models/train-events-out.js +14 -0
- package/dist/esm/models/train-family.d.ts +79 -0
- package/dist/esm/models/train-family.js +14 -0
- package/dist/esm/models/train-forward-in.d.ts +30 -0
- package/dist/esm/models/train-forward-in.js +14 -0
- package/dist/esm/models/train-job.d.ts +166 -0
- package/dist/esm/models/train-job.js +14 -0
- package/dist/esm/models/train-jobs-out.d.ts +25 -0
- package/dist/esm/models/train-jobs-out.js +14 -0
- package/dist/esm/models/train-metrics-out.d.ts +25 -0
- package/dist/esm/models/train-metrics-out.js +14 -0
- package/dist/esm/models/train-object.d.ts +78 -0
- package/dist/esm/models/train-object.js +14 -0
- package/dist/esm/models/train-objective.d.ts +31 -0
- package/dist/esm/models/train-objective.js +14 -0
- package/dist/esm/models/train-objects-out.d.ts +25 -0
- package/dist/esm/models/train-objects-out.js +14 -0
- package/dist/esm/models/train-optim-in.d.ts +30 -0
- package/dist/esm/models/train-optim-in.js +14 -0
- package/dist/esm/models/train-options.d.ts +30 -0
- package/dist/esm/models/train-options.js +14 -0
- package/dist/esm/models/train-output.d.ts +30 -0
- package/dist/esm/models/train-output.js +14 -0
- package/dist/esm/models/train-part.d.ts +50 -0
- package/dist/esm/models/train-part.js +14 -0
- package/dist/{models/ai-decision-sides-false.d.ts → esm/models/train-projection.d.ts} +8 -2
- package/dist/esm/models/train-projection.js +14 -0
- package/dist/esm/models/train-protect.d.ts +50 -0
- package/dist/esm/models/train-protect.js +14 -0
- package/dist/esm/models/train-publish-in.d.ts +43 -0
- package/dist/esm/models/train-publish-in.js +14 -0
- package/dist/esm/models/train-register-in.d.ts +68 -0
- package/dist/esm/models/train-register-in.js +14 -0
- package/dist/esm/models/train-register-out.d.ts +37 -0
- package/dist/esm/models/train-register-out.js +14 -0
- package/dist/esm/models/train-report-in.d.ts +42 -0
- package/dist/esm/models/train-report-in.js +14 -0
- package/dist/esm/models/train-report-out.d.ts +42 -0
- package/dist/esm/models/train-report-out.js +14 -0
- package/dist/esm/models/train-resources.d.ts +48 -0
- package/dist/esm/models/train-resources.js +14 -0
- package/dist/esm/models/train-route.d.ts +33 -0
- package/dist/esm/models/train-route.js +14 -0
- package/dist/esm/models/train-run.d.ts +36 -0
- package/dist/esm/models/train-run.js +14 -0
- package/dist/esm/models/train-sample-in.d.ts +48 -0
- package/dist/esm/models/train-sample-in.js +14 -0
- package/dist/esm/models/train-save-in.d.ts +37 -0
- package/dist/esm/models/train-save-in.js +14 -0
- package/dist/esm/models/train-series.d.ts +30 -0
- package/dist/esm/models/train-series.js +14 -0
- package/dist/esm/models/train-spec.d.ts +85 -0
- package/dist/esm/models/train-spec.js +14 -0
- package/dist/esm/models/train-supports.d.ts +42 -0
- package/dist/esm/models/train-supports.js +14 -0
- package/dist/esm/models/train-task-view.d.ts +78 -0
- package/dist/esm/models/train-task-view.js +14 -0
- package/dist/esm/models/train-term.d.ts +36 -0
- package/dist/esm/models/train-term.js +14 -0
- package/dist/esm/models/train-upload-in.d.ts +42 -0
- package/dist/esm/models/train-upload-in.js +14 -0
- package/dist/esm/models/train-upload.d.ts +51 -0
- package/dist/esm/models/train-upload.js +14 -0
- package/dist/esm/models/train-usage.d.ts +36 -0
- package/dist/esm/models/train-usage.js +14 -0
- package/dist/esm/transport.d.ts +4 -0
- package/dist/esm/transport.js +188 -0
- package/dist/esm/usage.d.ts +98 -0
- package/dist/esm/usage.js +161 -0
- package/dist/hanzo.d.ts +3 -0
- package/dist/hanzo.js +16 -1
- package/dist/models/account-api-key-list.d.ts +1 -1
- package/dist/models/account-api-key.d.ts +72 -5
- package/dist/models/account-key-budget.d.ts +30 -0
- package/dist/models/account-key-edit.d.ts +55 -0
- package/dist/models/account-key-in.d.ts +55 -0
- package/dist/models/agent-target-view.d.ts +6 -0
- package/dist/models/ai-chat-in.d.ts +42 -0
- package/dist/models/ai-chat.d.ts +37 -0
- package/dist/models/ai-decide-in.d.ts +50 -0
- package/dist/models/ai-decide-in.js +15 -0
- package/dist/models/ai-decision-sides.d.ts +4 -5
- package/dist/models/ai-decision.d.ts +31 -0
- package/dist/models/ai-decision.js +15 -0
- package/dist/models/ai-decisions-answer.d.ts +2 -3
- package/dist/models/ai-decisions-choice.d.ts +4 -8
- package/dist/models/ai-decisions-noul.d.ts +2 -3
- package/dist/models/ai-decisions-request.d.ts +2 -3
- package/dist/models/ai-decisions-score.d.ts +4 -5
- package/dist/models/ai-model.d.ts +73 -0
- package/dist/models/ai-model.js +15 -0
- package/dist/models/ai-models.d.ts +31 -0
- package/dist/models/ai-models.js +15 -0
- package/dist/models/ai-price.d.ts +48 -0
- package/dist/models/ai-price.js +15 -0
- package/dist/models/ai-receipt.d.ts +60 -0
- package/dist/models/ai-receipt.js +15 -0
- package/dist/models/ai-routing-reward-request.d.ts +54 -0
- package/dist/models/ai-routing-reward-request.js +27 -0
- package/dist/models/auto-automation-in.d.ts +6 -0
- package/dist/models/auto-automation-patch.d.ts +6 -0
- package/dist/models/auto-automation-run.d.ts +14 -1
- package/dist/models/auto-automation.d.ts +6 -0
- package/dist/models/auto-post-result.d.ts +36 -0
- package/dist/models/auto-post-result.js +15 -0
- package/dist/models/{account-revoked-key.d.ts → auto-review-in.d.ts} +14 -8
- package/dist/models/auto-review-in.js +15 -0
- package/dist/models/git-workspace-view.d.ts +36 -0
- package/dist/models/git-workspace-view.js +15 -0
- package/dist/models/iam-key.d.ts +24 -0
- package/dist/models/iam-user.d.ts +1 -1
- package/dist/models/index.d.ts +66 -5
- package/dist/models/index.js +66 -5
- package/dist/models/provider-github-import-out.d.ts +6 -0
- package/dist/models/provider-github-repo-item.d.ts +6 -0
- package/dist/models/task-comment-list.d.ts +31 -0
- package/dist/models/task-comment-list.js +15 -0
- package/dist/models/task-comment.d.ts +42 -0
- package/dist/models/task-comment.js +15 -0
- package/dist/models/train-adaptation.d.ts +67 -0
- package/dist/models/train-adaptation.js +15 -0
- package/dist/models/train-artifact.d.ts +66 -0
- package/dist/models/train-artifact.js +15 -0
- package/dist/models/train-artifacts-out.d.ts +25 -0
- package/dist/models/train-artifacts-out.js +15 -0
- package/dist/models/train-assignment.d.ts +38 -0
- package/dist/models/train-assignment.js +15 -0
- package/dist/models/train-budget.d.ts +30 -0
- package/dist/models/train-budget.js +15 -0
- package/dist/models/train-catalog.d.ts +25 -0
- package/dist/models/train-catalog.js +15 -0
- package/dist/models/train-chose.d.ts +30 -0
- package/dist/models/train-chose.js +15 -0
- package/dist/models/train-claim-in.d.ts +49 -0
- package/dist/models/train-claim-in.js +15 -0
- package/dist/models/train-claimed.d.ts +72 -0
- package/dist/models/train-claimed.js +15 -0
- package/dist/models/train-client-list.d.ts +24 -0
- package/dist/models/train-client-list.js +15 -0
- package/dist/models/train-create-client-in.d.ts +44 -0
- package/dist/models/train-create-client-in.js +15 -0
- package/dist/models/train-dataset.d.ts +32 -0
- package/dist/models/train-dataset.js +15 -0
- package/dist/models/train-deleted-out.d.ts +30 -0
- package/dist/models/train-deleted-out.js +15 -0
- package/dist/models/train-download.d.ts +78 -0
- package/dist/models/train-download.js +15 -0
- package/dist/{esm/models/ai-decisions-choice-criteria-value.d.ts → models/train-evaluation.d.ts} +8 -2
- package/dist/models/train-evaluation.js +15 -0
- package/dist/models/train-event.d.ts +42 -0
- package/dist/models/train-event.js +15 -0
- package/dist/models/train-events-out.d.ts +37 -0
- package/dist/models/train-events-out.js +15 -0
- package/dist/models/train-family.d.ts +79 -0
- package/dist/models/train-family.js +15 -0
- package/dist/models/train-forward-in.d.ts +30 -0
- package/dist/models/train-forward-in.js +15 -0
- package/dist/models/train-job.d.ts +166 -0
- package/dist/models/train-job.js +15 -0
- package/dist/models/train-jobs-out.d.ts +25 -0
- package/dist/models/train-jobs-out.js +15 -0
- package/dist/models/train-metrics-out.d.ts +25 -0
- package/dist/models/train-metrics-out.js +15 -0
- package/dist/models/train-object.d.ts +78 -0
- package/dist/models/train-object.js +15 -0
- package/dist/models/train-objective.d.ts +31 -0
- package/dist/models/train-objective.js +15 -0
- package/dist/models/train-objects-out.d.ts +25 -0
- package/dist/models/train-objects-out.js +15 -0
- package/dist/models/train-optim-in.d.ts +30 -0
- package/dist/models/train-optim-in.js +15 -0
- package/dist/models/train-options.d.ts +30 -0
- package/dist/models/train-options.js +15 -0
- package/dist/models/train-output.d.ts +30 -0
- package/dist/models/train-output.js +15 -0
- package/dist/models/train-part.d.ts +50 -0
- package/dist/models/train-part.js +15 -0
- package/dist/models/{ai-decisions-choice-criteria-value.d.ts → train-projection.d.ts} +8 -2
- package/dist/models/train-projection.js +15 -0
- package/dist/models/train-protect.d.ts +50 -0
- package/dist/models/train-protect.js +15 -0
- package/dist/models/train-publish-in.d.ts +43 -0
- package/dist/models/train-publish-in.js +15 -0
- package/dist/models/train-register-in.d.ts +68 -0
- package/dist/models/train-register-in.js +15 -0
- package/dist/models/train-register-out.d.ts +37 -0
- package/dist/models/train-register-out.js +15 -0
- package/dist/models/train-report-in.d.ts +42 -0
- package/dist/models/train-report-in.js +15 -0
- package/dist/models/train-report-out.d.ts +42 -0
- package/dist/models/train-report-out.js +15 -0
- package/dist/models/train-resources.d.ts +48 -0
- package/dist/models/train-resources.js +15 -0
- package/dist/models/train-route.d.ts +33 -0
- package/dist/models/train-route.js +15 -0
- package/dist/models/train-run.d.ts +36 -0
- package/dist/models/train-run.js +15 -0
- package/dist/models/train-sample-in.d.ts +48 -0
- package/dist/models/train-sample-in.js +15 -0
- package/dist/models/train-save-in.d.ts +37 -0
- package/dist/models/train-save-in.js +15 -0
- package/dist/models/train-series.d.ts +30 -0
- package/dist/models/train-series.js +15 -0
- package/dist/models/train-spec.d.ts +85 -0
- package/dist/models/train-spec.js +15 -0
- package/dist/models/train-supports.d.ts +42 -0
- package/dist/models/train-supports.js +15 -0
- package/dist/models/train-task-view.d.ts +78 -0
- package/dist/models/train-task-view.js +15 -0
- package/dist/models/train-term.d.ts +36 -0
- package/dist/models/train-term.js +15 -0
- package/dist/models/train-upload-in.d.ts +42 -0
- package/dist/models/train-upload-in.js +15 -0
- package/dist/models/train-upload.d.ts +51 -0
- package/dist/models/train-upload.js +15 -0
- package/dist/models/train-usage.d.ts +36 -0
- package/dist/models/train-usage.js +15 -0
- package/dist/transport.d.ts +4 -0
- package/dist/transport.js +195 -0
- package/dist/usage.d.ts +98 -0
- package/dist/usage.js +174 -0
- package/package.json +1 -1
- package/src/answer.ts +23 -10
- package/src/api/account-api.ts +164 -64
- package/src/api/ai-api.ts +503 -29
- package/src/api/auto-api.ts +117 -0
- package/src/api/billing-api.ts +4 -4
- package/src/api/git-api.ts +68 -0
- package/src/api/iam-api.ts +16 -16
- package/src/api/task-api.ts +101 -0
- package/src/api/train-api.ts +2281 -0
- package/src/api.ts +1 -0
- package/src/client.ts +3 -2
- package/src/hanzo.ts +18 -0
- package/src/models/account-api-key-list.ts +1 -1
- package/src/models/account-api-key.ts +74 -5
- package/src/models/account-key-budget.ts +36 -0
- package/src/models/account-key-edit.ts +63 -0
- package/src/models/account-key-in.ts +63 -0
- package/src/models/agent-target-view.ts +6 -0
- package/src/models/ai-chat-in.ts +48 -0
- package/src/models/ai-chat.ts +45 -0
- package/src/models/ai-decide-in.ts +54 -0
- package/src/models/ai-decision-sides.ts +4 -7
- package/src/models/ai-decision.ts +39 -0
- package/src/models/ai-decisions-answer.ts +2 -5
- package/src/models/ai-decisions-choice.ts +4 -10
- package/src/models/ai-decisions-noul.ts +2 -5
- package/src/models/ai-decisions-question.ts +0 -3
- package/src/models/ai-decisions-request.ts +2 -5
- package/src/models/ai-decisions-score.ts +4 -7
- package/src/models/ai-model.ts +81 -0
- package/src/models/ai-models.ts +39 -0
- package/src/models/ai-price.ts +54 -0
- package/src/models/ai-receipt.ts +66 -0
- package/src/models/ai-routing-reward-request.ts +63 -0
- package/src/models/auto-automation-in.ts +6 -0
- package/src/models/auto-automation-patch.ts +6 -0
- package/src/models/auto-automation-run.ts +16 -1
- package/src/models/auto-automation.ts +6 -0
- package/src/models/auto-post-result.ts +42 -0
- package/src/models/{account-revoked-key.ts → auto-review-in.ts} +14 -8
- package/src/models/git-workspace-view.ts +42 -0
- package/src/models/iam-key.ts +24 -0
- package/src/models/iam-user.ts +1 -1
- package/src/models/index.ts +66 -5
- package/src/models/provider-github-import-out.ts +6 -0
- package/src/models/provider-github-repo-item.ts +6 -0
- package/src/models/task-comment-list.ts +39 -0
- package/src/models/task-comment.ts +48 -0
- package/src/models/train-adaptation.ts +75 -0
- package/src/models/train-artifact.ts +72 -0
- package/src/models/train-artifacts-out.ts +33 -0
- package/src/models/train-assignment.ts +48 -0
- package/src/models/train-budget.ts +36 -0
- package/src/models/train-catalog.ts +33 -0
- package/src/models/train-chose.ts +36 -0
- package/src/models/train-claim-in.ts +57 -0
- package/src/models/train-claimed.ts +78 -0
- package/src/models/train-client-list.ts +30 -0
- package/src/models/train-create-client-in.ts +54 -0
- package/src/models/train-dataset.ts +36 -0
- package/src/models/train-deleted-out.ts +36 -0
- package/src/models/train-download.ts +84 -0
- package/src/models/{ai-decision-sides-false.ts → train-evaluation.ts} +8 -2
- package/src/models/train-event.ts +48 -0
- package/src/models/train-events-out.ts +45 -0
- package/src/models/train-family.ts +87 -0
- package/src/models/train-forward-in.ts +36 -0
- package/src/models/train-job.ts +192 -0
- package/src/models/train-jobs-out.ts +33 -0
- package/src/models/train-metrics-out.ts +33 -0
- package/src/models/train-object.ts +84 -0
- package/src/models/train-objective.ts +39 -0
- package/src/models/train-objects-out.ts +33 -0
- package/src/models/train-optim-in.ts +36 -0
- package/src/models/train-options.ts +36 -0
- package/src/models/train-output.ts +36 -0
- package/src/models/train-part.ts +54 -0
- package/src/models/{ai-decisions-choice-criteria-value.ts → train-projection.ts} +8 -2
- package/src/models/train-protect.ts +60 -0
- package/src/models/train-publish-in.ts +51 -0
- package/src/models/train-register-in.ts +72 -0
- package/src/models/train-register-out.ts +45 -0
- package/src/models/train-report-in.ts +48 -0
- package/src/models/train-report-out.ts +48 -0
- package/src/models/train-resources.ts +54 -0
- package/src/models/train-route.ts +39 -0
- package/src/models/train-run.ts +42 -0
- package/src/models/train-sample-in.ts +54 -0
- package/src/models/train-save-in.ts +45 -0
- package/src/models/train-series.ts +36 -0
- package/src/models/train-spec.ts +105 -0
- package/src/models/train-supports.ts +48 -0
- package/src/models/train-task-view.ts +84 -0
- package/src/models/train-term.ts +42 -0
- package/src/models/train-upload-in.ts +48 -0
- package/src/models/train-upload.ts +57 -0
- package/src/models/train-usage.ts +42 -0
- package/src/transport.ts +190 -0
- package/src/usage.ts +203 -0
- package/dist/esm/models/account-key-type-in.d.ts +0 -30
- package/dist/esm/models/account-minted-key.d.ts +0 -42
- package/dist/models/account-key-type-in.d.ts +0 -30
- package/dist/models/account-minted-key.d.ts +0 -42
- package/src/models/account-key-type-in.ts +0 -36
- package/src/models/account-minted-key.ts +0 -48
- /package/dist/esm/models/{account-key-type-in.js → account-key-budget.js} +0 -0
- /package/dist/esm/models/{account-minted-key.js → account-key-edit.js} +0 -0
- /package/dist/esm/models/{account-revoked-key.js → account-key-in.js} +0 -0
- /package/dist/esm/models/{ai-decision-sides-false.js → ai-chat-in.js} +0 -0
- /package/dist/esm/models/{ai-decisions-choice-criteria-value.js → ai-chat.js} +0 -0
- /package/dist/models/{account-key-type-in.js → account-key-budget.js} +0 -0
- /package/dist/models/{account-minted-key.js → account-key-edit.js} +0 -0
- /package/dist/models/{account-revoked-key.js → account-key-in.js} +0 -0
- /package/dist/models/{ai-decision-sides-false.js → ai-chat-in.js} +0 -0
- /package/dist/models/{ai-decisions-choice-criteria-value.js → ai-chat.js} +0 -0
package/README.md
CHANGED
|
@@ -67,7 +67,10 @@ type Completion = { choices?: Array<{ message?: { content?: string } }> };
|
|
|
67
67
|
|
|
68
68
|
async function main() {
|
|
69
69
|
const { data } = await new AiApi(config).postChatCompletions({
|
|
70
|
-
|
|
70
|
+
openaiChatCompletionRequest: {
|
|
71
|
+
model: 'zen5',
|
|
72
|
+
messages: [{ role: 'user', content: 'Say hello in five words.' }],
|
|
73
|
+
},
|
|
71
74
|
});
|
|
72
75
|
const reply = data as unknown as Completion;
|
|
73
76
|
console.log(reply.choices?.[0]?.message?.content);
|
|
@@ -82,8 +85,8 @@ those, construct a `Configuration` with no `accessToken` and the client sends no
|
|
|
82
85
|
`Authorization` header.
|
|
83
86
|
|
|
84
87
|
A generated call that gets a status outside 2xx throws axios's `AxiosError`,
|
|
85
|
-
with the status on `err.response.status`, after one request
|
|
86
|
-
retried. A 200 whose body is an error object resolves like any other 200, and a
|
|
88
|
+
with the status on `err.response.status`, after one request — or, for a usage
|
|
89
|
+
refusal, its own class (below). Nothing is retried. A 200 whose body is an error object resolves like any other 200, and a
|
|
87
90
|
completion's content comes back as the server sent it, `<think>` blocks
|
|
88
91
|
included.
|
|
89
92
|
|
|
@@ -94,6 +97,55 @@ environment, and mints its own token rather than being handed one.
|
|
|
94
97
|
`GET /v1/iam/oauth/userinfo` is how you check a token: it answers the token's
|
|
95
98
|
identity, or `401 {"error":"invalid_token"}`. That is the `hello` flow below.
|
|
96
99
|
|
|
100
|
+
## Plan usage
|
|
101
|
+
|
|
102
|
+
Every AI answer says how it was paid for in `X-Hanzo-*` headers. `readUsage`
|
|
103
|
+
reads them off an axios response, a fetch `Response` or a plain record; an
|
|
104
|
+
absent header reads `undefined`.
|
|
105
|
+
|
|
106
|
+
```ts
|
|
107
|
+
import { AiApi, Configuration, ModelCapError, UsageLimitError, readUsage } from 'hanzoai';
|
|
108
|
+
|
|
109
|
+
const ai = new AiApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
|
|
110
|
+
try {
|
|
111
|
+
const res = await ai.postChatCompletions({
|
|
112
|
+
openaiChatCompletionRequest: { model: 'anthropic/claude-sonnet-4.5', messages },
|
|
113
|
+
});
|
|
114
|
+
readUsage(res.headers); // { usage: 'ok', usageClass: 'premium', paidBy: 'credits', served: '…', fallback: undefined, reason: undefined }
|
|
115
|
+
} catch (err) {
|
|
116
|
+
if (err instanceof ModelCapError) retry(err.fallback);
|
|
117
|
+
else if (err instanceof UsageLimitError) offer(err.actions);
|
|
118
|
+
else throw err;
|
|
119
|
+
}
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
A 402 or 429 refusal nothing may pay for throws a subclass of
|
|
123
|
+
`UsageLimitError`, which carries `status`, `code`, `type`, `usageClass`,
|
|
124
|
+
`model`, `fallback`, `resetsAt`, `upgradeUrl`, `actions`, `request` (the
|
|
125
|
+
`x-request-id`) and, from a generated call, `cause` (the `AxiosError`):
|
|
126
|
+
|
|
127
|
+
| class | status | `code` |
|
|
128
|
+
|---|---|---|
|
|
129
|
+
| `PlanAllowanceUsedError` | 402 | `plan_allowance_used` |
|
|
130
|
+
| `PaidPlanRequiredError` | 402 | `paid_plan_required` |
|
|
131
|
+
| `FreePlanCapError` | 429 | `free_plan_cap` |
|
|
132
|
+
| `ModelCapError` | 402 | `model_cap` |
|
|
133
|
+
| `UsageCapExceededError` | 429 | `usage_cap_exceeded` |
|
|
134
|
+
| `InsufficientBalanceError` | 402 | `insufficient_balance` |
|
|
135
|
+
|
|
136
|
+
Any other refusal stays an `AxiosError`, as does a refusal through an `*Api`
|
|
137
|
+
built without the package's `Configuration` or with an axios instance of your
|
|
138
|
+
own. A `responseType: 'stream'` JSON body is read for the code, within the
|
|
139
|
+
request's `signal` and `timeout`, and left whole on `err.cause.response.data`. `Client`'s six throw
|
|
140
|
+
these where they would throw `answer.Fault`; a 402 there is still the `denied`
|
|
141
|
+
arm.
|
|
142
|
+
|
|
143
|
+
The routes are generated: `aiLimits()` and `aiSetLimits({ aiLimitsSet: {
|
|
144
|
+
creditsAfterAllowance } })` on `/v1/ai/limits`; `SyncApi`'s `getSync`,
|
|
145
|
+
`getSyncById`, `postSync` and `postSyncByIdRun` ("sync now") on `/v1/sync`;
|
|
146
|
+
`postDecisions`; and `getModels`, whose rows carry `class` (premium, ours or
|
|
147
|
+
free), `family` and `pricing.variable`.
|
|
148
|
+
|
|
97
149
|
## The six capabilities
|
|
98
150
|
|
|
99
151
|
Budget, policy, audit, search, kb and graph — the same six words in the Go,
|
|
@@ -166,7 +218,7 @@ Types are namespaced by capability: `budget.Allowance`, `search.Hit`,
|
|
|
166
218
|
|
|
167
219
|
## Examples
|
|
168
220
|
|
|
169
|
-
|
|
221
|
+
Nine flows under [`examples/`](examples), one directory each, every one a
|
|
170
222
|
complete program:
|
|
171
223
|
|
|
172
224
|
| flow | what it does | routes |
|
|
@@ -179,6 +231,7 @@ complete program:
|
|
|
179
231
|
| [`agent`](examples/agent) | create + run + read | `POST /v1/agent`, `POST /v1/agent/{ref}/run`, `GET /v1/agent/{ref}/runs` |
|
|
180
232
|
| [`tools`](examples/tools) | tool catalog | `GET /v1/tool` |
|
|
181
233
|
| [`six`](examples/six) | budget → policy → search → kb → graph → audit, in one pass | the six capabilities |
|
|
234
|
+
| [`limits`](examples/limits) | plan, catalog by class, who paid, a typed refusal, repo links | `GET /v1/ai/limits`, `GET /v1/models`, `POST /v1/chat/completions`, `POST /v1/decisions`, `GET /v1/sync` |
|
|
182
235
|
|
|
183
236
|
`models` runs with nothing exported:
|
|
184
237
|
|
|
@@ -189,8 +242,8 @@ npm ci && npm run build && npx tsx examples/models/index.ts
|
|
|
189
242
|
(`npm run build` first because the examples import `hanzoai` by name and the
|
|
190
243
|
package resolves its own name through `exports`, which points at `dist/`.)
|
|
191
244
|
|
|
192
|
-
|
|
193
|
-
`HANZO_CLIENT_ID`/`HANZO_CLIENT_SECRET`; all
|
|
245
|
+
Seven of the others read `HANZO_API_KEY` and `six` reads
|
|
246
|
+
`HANZO_CLIENT_ID`/`HANZO_CLIENT_SECRET`; all nine talk to
|
|
194
247
|
`https://api.hanzo.ai` unless `HANZO_BASE_URL` says otherwise:
|
|
195
248
|
|
|
196
249
|
```bash
|
|
@@ -202,8 +255,9 @@ A token the server refuses answers `HTTP 401:
|
|
|
202
255
|
{"error":"invalid_token","error_description":"the access token is invalid or
|
|
203
256
|
revoked"}`.
|
|
204
257
|
|
|
205
|
-
`npm run examples` type-checks all
|
|
206
|
-
runs the six against a scripted `fetch`, and `hanzo.yml`
|
|
258
|
+
`npm run examples` type-checks all nine against the client, `npm run wire`
|
|
259
|
+
runs the six and the usage refusals against a scripted `fetch`, and `hanzo.yml`
|
|
260
|
+
makes both a CI gate.
|
|
207
261
|
|
|
208
262
|
## The API surface
|
|
209
263
|
|
|
@@ -247,7 +301,8 @@ knob lives once, in that repo's `generate.py` and `sdks.yaml`.
|
|
|
247
301
|
|
|
248
302
|
`.generated` lists what the driver owns. A file it does not name is this repo's
|
|
249
303
|
own and a regeneration never touches it — which is where `hanzo.ts`,
|
|
250
|
-
`client.ts`, `answer.ts` and the six capabilities
|
|
304
|
+
`client.ts`, `answer.ts`, `usage.ts`, `transport.ts` and the six capabilities
|
|
305
|
+
live.
|
|
251
306
|
|
|
252
307
|
Requires java 17+ and [uv](https://docs.astral.sh/uv/).
|
|
253
308
|
|
package/dist/answer.js
CHANGED
|
@@ -15,6 +15,7 @@ exports.arm = arm;
|
|
|
15
15
|
exports.value = value;
|
|
16
16
|
exports.page = page;
|
|
17
17
|
const read_1 = require("./read");
|
|
18
|
+
const usage_1 = require("./usage");
|
|
18
19
|
/**
|
|
19
20
|
* An outcome with no decision in it.
|
|
20
21
|
*
|
|
@@ -58,15 +59,17 @@ const refusals = new Set(['spend_cap_exceeded', 'insufficient_balance']);
|
|
|
58
59
|
function refusal(body) {
|
|
59
60
|
const b = (0, read_1.obj)(body);
|
|
60
61
|
// RFC 9457 spells the code `code` and the sentence `detail`; the spend gate's
|
|
61
|
-
// own body spells them `error` and `message` and adds `product` and `cure[]
|
|
62
|
-
//
|
|
63
|
-
//
|
|
64
|
-
//
|
|
65
|
-
//
|
|
62
|
+
// own body spells them `error` and `message` and adds `product` and `cure[]`;
|
|
63
|
+
// the AI gateway's OpenAI envelope nests `code` and `message` under `error`.
|
|
64
|
+
// The spend gate's `reason` — "unpaid", "unresolved" — names the admit leg that
|
|
65
|
+
// failed rather than explaining anything to a person, so it is not read. One
|
|
66
|
+
// reader, named fallbacks — not three paths — so it keeps working unchanged
|
|
67
|
+
// when cloud settles on one envelope.
|
|
68
|
+
const e = (0, read_1.obj)(b['error']);
|
|
66
69
|
const product = (0, read_1.str)(b['product']);
|
|
67
70
|
return {
|
|
68
|
-
code: (0, read_1.str)(b['code']) || (0, read_1.str)(b['error']),
|
|
69
|
-
reason: (0, read_1.str)(b['detail']) || (0, read_1.str)(b['message']),
|
|
71
|
+
code: (0, read_1.str)(b['code']) || (0, read_1.str)(b['error']) || (0, read_1.str)(e['code']),
|
|
72
|
+
reason: (0, read_1.str)(b['detail']) || (0, read_1.str)(b['message']) || (0, read_1.str)(e['message']),
|
|
70
73
|
...(product ? { product } : {}),
|
|
71
74
|
cures: (0, read_1.list)(b['cure']).map((c) => {
|
|
72
75
|
const cure = (0, read_1.obj)(c);
|
|
@@ -107,14 +110,21 @@ function arm(r, read) {
|
|
|
107
110
|
if (r.status === 402 || (r.status === 403 && refusals.has(said.code))) {
|
|
108
111
|
return { status: 'denied', ...said, request: r.request };
|
|
109
112
|
}
|
|
110
|
-
throw
|
|
113
|
+
throw fault(r, said);
|
|
111
114
|
}
|
|
112
115
|
/** A read no gate refuses: the value, or a [Fault] because nothing was decided. */
|
|
113
116
|
function value(r, read) {
|
|
114
117
|
if (r.status >= 200 && r.status < 300)
|
|
115
118
|
return read(r.body);
|
|
116
|
-
|
|
117
|
-
|
|
119
|
+
throw fault(r, refusal(r.body));
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* What a call that decided nothing throws: the usage refusal the body names
|
|
123
|
+
* (usage.ts), or a [Fault]. What [arm] reads as [Denied] never reaches here.
|
|
124
|
+
*/
|
|
125
|
+
function fault(r, said) {
|
|
126
|
+
return ((0, usage_1.limited)(r.status, r.body, r.request || undefined) ??
|
|
127
|
+
new Fault(r.status, said.code, said.reason || `HTTP ${r.status}`, r.request));
|
|
118
128
|
}
|
|
119
129
|
/** `{data, total}` — the page shape every listing on this wire answers with. */
|
|
120
130
|
function page(body, read) {
|
|
@@ -13,28 +13,28 @@ import type { Configuration } from '../configuration';
|
|
|
13
13
|
import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios';
|
|
14
14
|
import globalAxios from 'axios';
|
|
15
15
|
import { type RequestArgs, BaseAPI } from '../base';
|
|
16
|
+
import type { AccountApiKey } from '../models';
|
|
16
17
|
import type { AccountApiKeyList } from '../models';
|
|
17
18
|
import type { AccountAppearance } from '../models';
|
|
18
19
|
import type { AccountCsrfResp } from '../models';
|
|
19
20
|
import type { AccountEmbedStatusResp } from '../models';
|
|
20
|
-
import type {
|
|
21
|
-
import type {
|
|
21
|
+
import type { AccountKeyEdit } from '../models';
|
|
22
|
+
import type { AccountKeyIn } from '../models';
|
|
22
23
|
import type { AccountOnboardReq } from '../models';
|
|
23
24
|
import type { AccountOnboardResp } from '../models';
|
|
24
|
-
import type { AccountRevokedKey } from '../models';
|
|
25
25
|
/**
|
|
26
26
|
* AccountApi - axios parameter creator
|
|
27
27
|
* @export
|
|
28
28
|
*/
|
|
29
29
|
export declare const AccountApiAxiosParamCreator: (configuration?: Configuration) => {
|
|
30
30
|
/**
|
|
31
|
-
* Revokes
|
|
32
|
-
* @summary Revokes
|
|
33
|
-
* @param {string}
|
|
31
|
+
* Revokes exactly one API key, by id. Every other key keeps working. The key stays listed as revoked, with who revoked it and when, and can never be used again. IAM refuses it at once; cloud caches a resolved key for up to 60 seconds, so a request inside that window may still be served. A member revokes their own keys; an org admin revokes any of the org\'s, and revoking someone else\'s is recorded on the audit trail.
|
|
32
|
+
* @summary Revokes exactly one API key, by id.
|
|
33
|
+
* @param {string} id ID is the key to act on, from the path.
|
|
34
34
|
* @param {*} [options] Override http request option.
|
|
35
35
|
* @throws {RequiredError}
|
|
36
36
|
*/
|
|
37
|
-
|
|
37
|
+
deleteAccountKeysById: (id: string, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
|
|
38
38
|
/**
|
|
39
39
|
* Returns the signed-in caller\'s own appearance preference — text size, density and accent — read from their IAM account so it is the same on every device and every Hanzo surface. An unset preference is an empty object. A transient IAM read failure reports the empty preference rather than a 5xx, so a surface applies its published default and never error-toasts on load — the same fail-soft the key read uses.
|
|
40
40
|
* @summary Returns the signed-in caller\'s own appearance preference — text size, density and accent — read from their IAM account so it is the same on every device and every Hanzo surface.
|
|
@@ -68,12 +68,21 @@ export declare const AccountApiAxiosParamCreator: (configuration?: Configuration
|
|
|
68
68
|
*/
|
|
69
69
|
getAccountEmbed: (app?: string, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
|
|
70
70
|
/**
|
|
71
|
-
* Returns the
|
|
72
|
-
* @summary Returns the
|
|
71
|
+
* Returns the API keys the caller may see, newest first: their own, or every key the org holds when the caller administers it. Each is its own credential with its own name, prefix, status, expiry and limit. Revoked keys stay listed. No secret material comes back; a publishable key, which is public by construction, carries its full value.
|
|
72
|
+
* @summary Returns the API keys the caller may see, newest first: their own, or every key the org holds when the caller administers it.
|
|
73
73
|
* @param {*} [options] Override http request option.
|
|
74
74
|
* @throws {RequiredError}
|
|
75
75
|
*/
|
|
76
76
|
getAccountKeys: (options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
|
|
77
|
+
/**
|
|
78
|
+
* Changes one key\'s name, permissions, budget, rate or expiry. The secret is not reissued: the key in your deployment keeps working, under its new policy. Only the person the key belongs to may edit it, and a revoked key cannot be edited.
|
|
79
|
+
* @summary Changes one key\'s name, permissions, budget, rate or expiry.
|
|
80
|
+
* @param {string} id ID is the key to edit, from the path.
|
|
81
|
+
* @param {AccountKeyEdit} accountKeyEdit
|
|
82
|
+
* @param {*} [options] Override http request option.
|
|
83
|
+
* @throws {RequiredError}
|
|
84
|
+
*/
|
|
85
|
+
patchAccountKeysById: (id: string, accountKeyEdit: AccountKeyEdit, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
|
|
77
86
|
/**
|
|
78
87
|
* Stores the caller\'s appearance preference on their IAM account, preserving every other field of the row. The accent is validated as a real colour token before it is stored; an unset or invalid axis is dropped rather than stored.
|
|
79
88
|
* @summary Stores the caller\'s appearance preference on their IAM account, preserving every other field of the row.
|
|
@@ -90,13 +99,13 @@ export declare const AccountApiAxiosParamCreator: (configuration?: Configuration
|
|
|
90
99
|
*/
|
|
91
100
|
postAccountAvatar: (options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
|
|
92
101
|
/**
|
|
93
|
-
* Creates
|
|
94
|
-
* @summary Creates
|
|
95
|
-
* @param {
|
|
102
|
+
* Creates a NEW API key and returns its secret ONCE. It never revokes or changes any other key: every key the caller already holds keeps working. The key is filed in the org the caller acts in and names them as its creator. An org holds at most 1,000 live keys; past that the create is refused until one is revoked.
|
|
103
|
+
* @summary Creates a NEW API key and returns its secret ONCE.
|
|
104
|
+
* @param {AccountKeyIn} accountKeyIn
|
|
96
105
|
* @param {*} [options] Override http request option.
|
|
97
106
|
* @throws {RequiredError}
|
|
98
107
|
*/
|
|
99
|
-
postAccountKeys: (
|
|
108
|
+
postAccountKeys: (accountKeyIn: AccountKeyIn, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
|
|
100
109
|
/**
|
|
101
110
|
* Creates the caller\'s organization. Two flows, keyed on whether the caller already has a home org (mirrors app/onboard/route.ts): - FIRST-RUN (no home org): create + MOVE the user in as admin, so their next JWT carries the new owner and the cloud scopes everything to it. This is the path a fresh OAuth sign-up takes, from the sign-up application\'s org. - ADDITIONAL (owner set): create the org but do NOT move the user — a move changes their IAM owner (stripping a SuperAdmin\'s status + orphaning their current org). They reach the new org via the OrgSwitcher, which re-scopes X-Org-Id without touching IAM membership. A personal-org request from someone who already has an org is meaningless → 409.
|
|
102
111
|
* @summary Creates the caller\'s organization.
|
|
@@ -112,13 +121,13 @@ export declare const AccountApiAxiosParamCreator: (configuration?: Configuration
|
|
|
112
121
|
*/
|
|
113
122
|
export declare const AccountApiFp: (configuration?: Configuration) => {
|
|
114
123
|
/**
|
|
115
|
-
* Revokes
|
|
116
|
-
* @summary Revokes
|
|
117
|
-
* @param {string}
|
|
124
|
+
* Revokes exactly one API key, by id. Every other key keeps working. The key stays listed as revoked, with who revoked it and when, and can never be used again. IAM refuses it at once; cloud caches a resolved key for up to 60 seconds, so a request inside that window may still be served. A member revokes their own keys; an org admin revokes any of the org\'s, and revoking someone else\'s is recorded on the audit trail.
|
|
125
|
+
* @summary Revokes exactly one API key, by id.
|
|
126
|
+
* @param {string} id ID is the key to act on, from the path.
|
|
118
127
|
* @param {*} [options] Override http request option.
|
|
119
128
|
* @throws {RequiredError}
|
|
120
129
|
*/
|
|
121
|
-
|
|
130
|
+
deleteAccountKeysById(id: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<AccountApiKey>>;
|
|
122
131
|
/**
|
|
123
132
|
* Returns the signed-in caller\'s own appearance preference — text size, density and accent — read from their IAM account so it is the same on every device and every Hanzo surface. An unset preference is an empty object. A transient IAM read failure reports the empty preference rather than a 5xx, so a surface applies its published default and never error-toasts on load — the same fail-soft the key read uses.
|
|
124
133
|
* @summary Returns the signed-in caller\'s own appearance preference — text size, density and accent — read from their IAM account so it is the same on every device and every Hanzo surface.
|
|
@@ -152,12 +161,21 @@ export declare const AccountApiFp: (configuration?: Configuration) => {
|
|
|
152
161
|
*/
|
|
153
162
|
getAccountEmbed(app?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<AccountEmbedStatusResp>>;
|
|
154
163
|
/**
|
|
155
|
-
* Returns the
|
|
156
|
-
* @summary Returns the
|
|
164
|
+
* Returns the API keys the caller may see, newest first: their own, or every key the org holds when the caller administers it. Each is its own credential with its own name, prefix, status, expiry and limit. Revoked keys stay listed. No secret material comes back; a publishable key, which is public by construction, carries its full value.
|
|
165
|
+
* @summary Returns the API keys the caller may see, newest first: their own, or every key the org holds when the caller administers it.
|
|
157
166
|
* @param {*} [options] Override http request option.
|
|
158
167
|
* @throws {RequiredError}
|
|
159
168
|
*/
|
|
160
169
|
getAccountKeys(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<AccountApiKeyList>>;
|
|
170
|
+
/**
|
|
171
|
+
* Changes one key\'s name, permissions, budget, rate or expiry. The secret is not reissued: the key in your deployment keeps working, under its new policy. Only the person the key belongs to may edit it, and a revoked key cannot be edited.
|
|
172
|
+
* @summary Changes one key\'s name, permissions, budget, rate or expiry.
|
|
173
|
+
* @param {string} id ID is the key to edit, from the path.
|
|
174
|
+
* @param {AccountKeyEdit} accountKeyEdit
|
|
175
|
+
* @param {*} [options] Override http request option.
|
|
176
|
+
* @throws {RequiredError}
|
|
177
|
+
*/
|
|
178
|
+
patchAccountKeysById(id: string, accountKeyEdit: AccountKeyEdit, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<AccountApiKey>>;
|
|
161
179
|
/**
|
|
162
180
|
* Stores the caller\'s appearance preference on their IAM account, preserving every other field of the row. The accent is validated as a real colour token before it is stored; an unset or invalid axis is dropped rather than stored.
|
|
163
181
|
* @summary Stores the caller\'s appearance preference on their IAM account, preserving every other field of the row.
|
|
@@ -174,13 +192,13 @@ export declare const AccountApiFp: (configuration?: Configuration) => {
|
|
|
174
192
|
*/
|
|
175
193
|
postAccountAvatar(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>>;
|
|
176
194
|
/**
|
|
177
|
-
* Creates
|
|
178
|
-
* @summary Creates
|
|
179
|
-
* @param {
|
|
195
|
+
* Creates a NEW API key and returns its secret ONCE. It never revokes or changes any other key: every key the caller already holds keeps working. The key is filed in the org the caller acts in and names them as its creator. An org holds at most 1,000 live keys; past that the create is refused until one is revoked.
|
|
196
|
+
* @summary Creates a NEW API key and returns its secret ONCE.
|
|
197
|
+
* @param {AccountKeyIn} accountKeyIn
|
|
180
198
|
* @param {*} [options] Override http request option.
|
|
181
199
|
* @throws {RequiredError}
|
|
182
200
|
*/
|
|
183
|
-
postAccountKeys(
|
|
201
|
+
postAccountKeys(accountKeyIn: AccountKeyIn, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<AccountApiKey>>;
|
|
184
202
|
/**
|
|
185
203
|
* Creates the caller\'s organization. Two flows, keyed on whether the caller already has a home org (mirrors app/onboard/route.ts): - FIRST-RUN (no home org): create + MOVE the user in as admin, so their next JWT carries the new owner and the cloud scopes everything to it. This is the path a fresh OAuth sign-up takes, from the sign-up application\'s org. - ADDITIONAL (owner set): create the org but do NOT move the user — a move changes their IAM owner (stripping a SuperAdmin\'s status + orphaning their current org). They reach the new org via the OrgSwitcher, which re-scopes X-Org-Id without touching IAM membership. A personal-org request from someone who already has an org is meaningless → 409.
|
|
186
204
|
* @summary Creates the caller\'s organization.
|
|
@@ -196,13 +214,13 @@ export declare const AccountApiFp: (configuration?: Configuration) => {
|
|
|
196
214
|
*/
|
|
197
215
|
export declare const AccountApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => {
|
|
198
216
|
/**
|
|
199
|
-
* Revokes
|
|
200
|
-
* @summary Revokes
|
|
201
|
-
* @param {
|
|
217
|
+
* Revokes exactly one API key, by id. Every other key keeps working. The key stays listed as revoked, with who revoked it and when, and can never be used again. IAM refuses it at once; cloud caches a resolved key for up to 60 seconds, so a request inside that window may still be served. A member revokes their own keys; an org admin revokes any of the org\'s, and revoking someone else\'s is recorded on the audit trail.
|
|
218
|
+
* @summary Revokes exactly one API key, by id.
|
|
219
|
+
* @param {AccountApiDeleteAccountKeysByIdRequest} requestParameters Request parameters.
|
|
202
220
|
* @param {*} [options] Override http request option.
|
|
203
221
|
* @throws {RequiredError}
|
|
204
222
|
*/
|
|
205
|
-
|
|
223
|
+
deleteAccountKeysById(requestParameters: AccountApiDeleteAccountKeysByIdRequest, options?: RawAxiosRequestConfig): AxiosPromise<AccountApiKey>;
|
|
206
224
|
/**
|
|
207
225
|
* Returns the signed-in caller\'s own appearance preference — text size, density and accent — read from their IAM account so it is the same on every device and every Hanzo surface. An unset preference is an empty object. A transient IAM read failure reports the empty preference rather than a 5xx, so a surface applies its published default and never error-toasts on load — the same fail-soft the key read uses.
|
|
208
226
|
* @summary Returns the signed-in caller\'s own appearance preference — text size, density and accent — read from their IAM account so it is the same on every device and every Hanzo surface.
|
|
@@ -234,12 +252,20 @@ export declare const AccountApiFactory: (configuration?: Configuration, basePath
|
|
|
234
252
|
*/
|
|
235
253
|
getAccountEmbed(requestParameters?: AccountApiGetAccountEmbedRequest, options?: RawAxiosRequestConfig): AxiosPromise<AccountEmbedStatusResp>;
|
|
236
254
|
/**
|
|
237
|
-
* Returns the
|
|
238
|
-
* @summary Returns the
|
|
255
|
+
* Returns the API keys the caller may see, newest first: their own, or every key the org holds when the caller administers it. Each is its own credential with its own name, prefix, status, expiry and limit. Revoked keys stay listed. No secret material comes back; a publishable key, which is public by construction, carries its full value.
|
|
256
|
+
* @summary Returns the API keys the caller may see, newest first: their own, or every key the org holds when the caller administers it.
|
|
239
257
|
* @param {*} [options] Override http request option.
|
|
240
258
|
* @throws {RequiredError}
|
|
241
259
|
*/
|
|
242
260
|
getAccountKeys(options?: RawAxiosRequestConfig): AxiosPromise<AccountApiKeyList>;
|
|
261
|
+
/**
|
|
262
|
+
* Changes one key\'s name, permissions, budget, rate or expiry. The secret is not reissued: the key in your deployment keeps working, under its new policy. Only the person the key belongs to may edit it, and a revoked key cannot be edited.
|
|
263
|
+
* @summary Changes one key\'s name, permissions, budget, rate or expiry.
|
|
264
|
+
* @param {AccountApiPatchAccountKeysByIdRequest} requestParameters Request parameters.
|
|
265
|
+
* @param {*} [options] Override http request option.
|
|
266
|
+
* @throws {RequiredError}
|
|
267
|
+
*/
|
|
268
|
+
patchAccountKeysById(requestParameters: AccountApiPatchAccountKeysByIdRequest, options?: RawAxiosRequestConfig): AxiosPromise<AccountApiKey>;
|
|
243
269
|
/**
|
|
244
270
|
* Stores the caller\'s appearance preference on their IAM account, preserving every other field of the row. The accent is validated as a real colour token before it is stored; an unset or invalid axis is dropped rather than stored.
|
|
245
271
|
* @summary Stores the caller\'s appearance preference on their IAM account, preserving every other field of the row.
|
|
@@ -256,13 +282,13 @@ export declare const AccountApiFactory: (configuration?: Configuration, basePath
|
|
|
256
282
|
*/
|
|
257
283
|
postAccountAvatar(options?: RawAxiosRequestConfig): AxiosPromise<void>;
|
|
258
284
|
/**
|
|
259
|
-
* Creates
|
|
260
|
-
* @summary Creates
|
|
285
|
+
* Creates a NEW API key and returns its secret ONCE. It never revokes or changes any other key: every key the caller already holds keeps working. The key is filed in the org the caller acts in and names them as its creator. An org holds at most 1,000 live keys; past that the create is refused until one is revoked.
|
|
286
|
+
* @summary Creates a NEW API key and returns its secret ONCE.
|
|
261
287
|
* @param {AccountApiPostAccountKeysRequest} requestParameters Request parameters.
|
|
262
288
|
* @param {*} [options] Override http request option.
|
|
263
289
|
* @throws {RequiredError}
|
|
264
290
|
*/
|
|
265
|
-
postAccountKeys(requestParameters: AccountApiPostAccountKeysRequest, options?: RawAxiosRequestConfig): AxiosPromise<
|
|
291
|
+
postAccountKeys(requestParameters: AccountApiPostAccountKeysRequest, options?: RawAxiosRequestConfig): AxiosPromise<AccountApiKey>;
|
|
266
292
|
/**
|
|
267
293
|
* Creates the caller\'s organization. Two flows, keyed on whether the caller already has a home org (mirrors app/onboard/route.ts): - FIRST-RUN (no home org): create + MOVE the user in as admin, so their next JWT carries the new owner and the cloud scopes everything to it. This is the path a fresh OAuth sign-up takes, from the sign-up application\'s org. - ADDITIONAL (owner set): create the org but do NOT move the user — a move changes their IAM owner (stripping a SuperAdmin\'s status + orphaning their current org). They reach the new org via the OrgSwitcher, which re-scopes X-Org-Id without touching IAM membership. A personal-org request from someone who already has an org is meaningless → 409.
|
|
268
294
|
* @summary Creates the caller\'s organization.
|
|
@@ -273,17 +299,17 @@ export declare const AccountApiFactory: (configuration?: Configuration, basePath
|
|
|
273
299
|
postAccountOrgs(requestParameters: AccountApiPostAccountOrgsRequest, options?: RawAxiosRequestConfig): AxiosPromise<AccountOnboardResp>;
|
|
274
300
|
};
|
|
275
301
|
/**
|
|
276
|
-
* Request parameters for
|
|
302
|
+
* Request parameters for deleteAccountKeysById operation in AccountApi.
|
|
277
303
|
* @export
|
|
278
|
-
* @interface
|
|
304
|
+
* @interface AccountApiDeleteAccountKeysByIdRequest
|
|
279
305
|
*/
|
|
280
|
-
export interface
|
|
306
|
+
export interface AccountApiDeleteAccountKeysByIdRequest {
|
|
281
307
|
/**
|
|
282
|
-
*
|
|
308
|
+
* ID is the key to act on, from the path.
|
|
283
309
|
* @type {string}
|
|
284
|
-
* @memberof
|
|
310
|
+
* @memberof AccountApiDeleteAccountKeysById
|
|
285
311
|
*/
|
|
286
|
-
readonly
|
|
312
|
+
readonly id: string;
|
|
287
313
|
}
|
|
288
314
|
/**
|
|
289
315
|
* Request parameters for getAccountAvatarByOrgByUserByDigest operation in AccountApi.
|
|
@@ -323,6 +349,25 @@ export interface AccountApiGetAccountEmbedRequest {
|
|
|
323
349
|
*/
|
|
324
350
|
readonly app?: string;
|
|
325
351
|
}
|
|
352
|
+
/**
|
|
353
|
+
* Request parameters for patchAccountKeysById operation in AccountApi.
|
|
354
|
+
* @export
|
|
355
|
+
* @interface AccountApiPatchAccountKeysByIdRequest
|
|
356
|
+
*/
|
|
357
|
+
export interface AccountApiPatchAccountKeysByIdRequest {
|
|
358
|
+
/**
|
|
359
|
+
* ID is the key to edit, from the path.
|
|
360
|
+
* @type {string}
|
|
361
|
+
* @memberof AccountApiPatchAccountKeysById
|
|
362
|
+
*/
|
|
363
|
+
readonly id: string;
|
|
364
|
+
/**
|
|
365
|
+
*
|
|
366
|
+
* @type {AccountKeyEdit}
|
|
367
|
+
* @memberof AccountApiPatchAccountKeysById
|
|
368
|
+
*/
|
|
369
|
+
readonly accountKeyEdit: AccountKeyEdit;
|
|
370
|
+
}
|
|
326
371
|
/**
|
|
327
372
|
* Request parameters for postAccountAppearance operation in AccountApi.
|
|
328
373
|
* @export
|
|
@@ -344,10 +389,10 @@ export interface AccountApiPostAccountAppearanceRequest {
|
|
|
344
389
|
export interface AccountApiPostAccountKeysRequest {
|
|
345
390
|
/**
|
|
346
391
|
*
|
|
347
|
-
* @type {
|
|
392
|
+
* @type {AccountKeyIn}
|
|
348
393
|
* @memberof AccountApiPostAccountKeys
|
|
349
394
|
*/
|
|
350
|
-
readonly
|
|
395
|
+
readonly accountKeyIn: AccountKeyIn;
|
|
351
396
|
}
|
|
352
397
|
/**
|
|
353
398
|
* Request parameters for postAccountOrgs operation in AccountApi.
|
|
@@ -370,14 +415,14 @@ export interface AccountApiPostAccountOrgsRequest {
|
|
|
370
415
|
*/
|
|
371
416
|
export declare class AccountApi extends BaseAPI {
|
|
372
417
|
/**
|
|
373
|
-
* Revokes
|
|
374
|
-
* @summary Revokes
|
|
375
|
-
* @param {
|
|
418
|
+
* Revokes exactly one API key, by id. Every other key keeps working. The key stays listed as revoked, with who revoked it and when, and can never be used again. IAM refuses it at once; cloud caches a resolved key for up to 60 seconds, so a request inside that window may still be served. A member revokes their own keys; an org admin revokes any of the org\'s, and revoking someone else\'s is recorded on the audit trail.
|
|
419
|
+
* @summary Revokes exactly one API key, by id.
|
|
420
|
+
* @param {AccountApiDeleteAccountKeysByIdRequest} requestParameters Request parameters.
|
|
376
421
|
* @param {*} [options] Override http request option.
|
|
377
422
|
* @throws {RequiredError}
|
|
378
423
|
* @memberof AccountApi
|
|
379
424
|
*/
|
|
380
|
-
|
|
425
|
+
deleteAccountKeysById(requestParameters: AccountApiDeleteAccountKeysByIdRequest, options?: RawAxiosRequestConfig): Promise<globalAxios.AxiosResponse<AccountApiKey, any, {}>>;
|
|
381
426
|
/**
|
|
382
427
|
* Returns the signed-in caller\'s own appearance preference — text size, density and accent — read from their IAM account so it is the same on every device and every Hanzo surface. An unset preference is an empty object. A transient IAM read failure reports the empty preference rather than a 5xx, so a surface applies its published default and never error-toasts on load — the same fail-soft the key read uses.
|
|
383
428
|
* @summary Returns the signed-in caller\'s own appearance preference — text size, density and accent — read from their IAM account so it is the same on every device and every Hanzo surface.
|
|
@@ -413,13 +458,22 @@ export declare class AccountApi extends BaseAPI {
|
|
|
413
458
|
*/
|
|
414
459
|
getAccountEmbed(requestParameters?: AccountApiGetAccountEmbedRequest, options?: RawAxiosRequestConfig): Promise<globalAxios.AxiosResponse<AccountEmbedStatusResp, any, {}>>;
|
|
415
460
|
/**
|
|
416
|
-
* Returns the
|
|
417
|
-
* @summary Returns the
|
|
461
|
+
* Returns the API keys the caller may see, newest first: their own, or every key the org holds when the caller administers it. Each is its own credential with its own name, prefix, status, expiry and limit. Revoked keys stay listed. No secret material comes back; a publishable key, which is public by construction, carries its full value.
|
|
462
|
+
* @summary Returns the API keys the caller may see, newest first: their own, or every key the org holds when the caller administers it.
|
|
418
463
|
* @param {*} [options] Override http request option.
|
|
419
464
|
* @throws {RequiredError}
|
|
420
465
|
* @memberof AccountApi
|
|
421
466
|
*/
|
|
422
467
|
getAccountKeys(options?: RawAxiosRequestConfig): Promise<globalAxios.AxiosResponse<AccountApiKeyList, any, {}>>;
|
|
468
|
+
/**
|
|
469
|
+
* Changes one key\'s name, permissions, budget, rate or expiry. The secret is not reissued: the key in your deployment keeps working, under its new policy. Only the person the key belongs to may edit it, and a revoked key cannot be edited.
|
|
470
|
+
* @summary Changes one key\'s name, permissions, budget, rate or expiry.
|
|
471
|
+
* @param {AccountApiPatchAccountKeysByIdRequest} requestParameters Request parameters.
|
|
472
|
+
* @param {*} [options] Override http request option.
|
|
473
|
+
* @throws {RequiredError}
|
|
474
|
+
* @memberof AccountApi
|
|
475
|
+
*/
|
|
476
|
+
patchAccountKeysById(requestParameters: AccountApiPatchAccountKeysByIdRequest, options?: RawAxiosRequestConfig): Promise<globalAxios.AxiosResponse<AccountApiKey, any, {}>>;
|
|
423
477
|
/**
|
|
424
478
|
* Stores the caller\'s appearance preference on their IAM account, preserving every other field of the row. The accent is validated as a real colour token before it is stored; an unset or invalid axis is dropped rather than stored.
|
|
425
479
|
* @summary Stores the caller\'s appearance preference on their IAM account, preserving every other field of the row.
|
|
@@ -438,14 +492,14 @@ export declare class AccountApi extends BaseAPI {
|
|
|
438
492
|
*/
|
|
439
493
|
postAccountAvatar(options?: RawAxiosRequestConfig): Promise<globalAxios.AxiosResponse<void, any, {}>>;
|
|
440
494
|
/**
|
|
441
|
-
* Creates
|
|
442
|
-
* @summary Creates
|
|
495
|
+
* Creates a NEW API key and returns its secret ONCE. It never revokes or changes any other key: every key the caller already holds keeps working. The key is filed in the org the caller acts in and names them as its creator. An org holds at most 1,000 live keys; past that the create is refused until one is revoked.
|
|
496
|
+
* @summary Creates a NEW API key and returns its secret ONCE.
|
|
443
497
|
* @param {AccountApiPostAccountKeysRequest} requestParameters Request parameters.
|
|
444
498
|
* @param {*} [options] Override http request option.
|
|
445
499
|
* @throws {RequiredError}
|
|
446
500
|
* @memberof AccountApi
|
|
447
501
|
*/
|
|
448
|
-
postAccountKeys(requestParameters: AccountApiPostAccountKeysRequest, options?: RawAxiosRequestConfig): Promise<globalAxios.AxiosResponse<
|
|
502
|
+
postAccountKeys(requestParameters: AccountApiPostAccountKeysRequest, options?: RawAxiosRequestConfig): Promise<globalAxios.AxiosResponse<AccountApiKey, any, {}>>;
|
|
449
503
|
/**
|
|
450
504
|
* Creates the caller\'s organization. Two flows, keyed on whether the caller already has a home org (mirrors app/onboard/route.ts): - FIRST-RUN (no home org): create + MOVE the user in as admin, so their next JWT carries the new owner and the cloud scopes everything to it. This is the path a fresh OAuth sign-up takes, from the sign-up application\'s org. - ADDITIONAL (owner set): create the org but do NOT move the user — a move changes their IAM owner (stripping a SuperAdmin\'s status + orphaning their current org). They reach the new org via the OrgSwitcher, which re-scopes X-Org-Id without touching IAM membership. A personal-org request from someone who already has an org is meaningless → 409.
|
|
451
505
|
* @summary Creates the caller\'s organization.
|