@soat/sdk 0.107.0 → 0.109.0

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/index.mjs CHANGED
@@ -1085,7 +1085,7 @@ var ApiKeys = class {
1085
1085
  /**
1086
1086
  * List API keys
1087
1087
  *
1088
- * Lists API keys accessible to the caller. - JWT admin: returns all API keys. - JWT regular user: returns only the user's own API keys. - Project-scoped credential (API key or OAuth token): returns the caller's own
1088
+ * Lists API keys accessible to the caller. - An unrestricted admin (a login, or a key bound to no project and narrowed by no policy): returns all API keys. - Any other unscoped credential: returns only its user's own API keys. - Project-scoped credential (API key or OAuth token): returns the caller's own
1089
1089
  * keys scoped to that project, or every key scoped to it when the credential
1090
1090
  * holds `api-keys:ListApiKeys` on the project. Confinement to a project is not
1091
1091
  * authority over it, and a key's metadata names its owner, prefix and attached
@@ -1105,7 +1105,7 @@ var ApiKeys = class {
1105
1105
  /**
1106
1106
  * Create an API key
1107
1107
  *
1108
- * Creates a new API key for the authenticated user. - `project_id` is optional. When set, the key is scoped to that single project. When omitted or null, the key is **unscoped** and spans every project its owner can reach. - If `policy_ids` is provided, the key's effective permissions are the intersection of the user's policies and the key's policies. - Otherwise the key inherits the user's permissions (confined to the key's project when scoped). - When the request is authenticated with a **project-scoped token** (an OAuth access token, a trigger run-as token or a run token), it returns `403 API_KEY_SCOPED_TOKEN`: such a token never creates a key. - When the request is authenticated with a **project-scoped API key**, the new key is confined to that same project: omitting `project_id` defaults to it, naming a different project returns `403 API_KEY_PROJECT_SCOPE`, and `project_id: null` (an unscoped key) is likewise refused. Minting an unscoped key requires an unscoped credential. - When the request is authenticated with an **API key narrowed by `policy_ids`**, the new key stays inside that boundary: omitting `policy_ids` inherits the caller's own, a non-empty subset of them is accepted, and an empty list or any other policy returns `403 API_KEY_POLICY_BOUNDARY`.
1108
+ * Creates a new API key for the authenticated user. - `project_id` is optional. When set, the key is scoped to that single project. When omitted or null, the key is **unscoped** and spans every project its owner can reach. - If `policy_ids` is provided, the key's effective permissions are the intersection of the user's policies and the key's policies. - Otherwise the key inherits the user's permissions (confined to the key's project when scoped). - When the request is narrowed beyond its credential's own grant (an OAuth access token, a trigger run-as token, a run token, an IAM token, or an `On-Behalf-Of` assertion), it returns `403 CREDENTIAL_NARROWED`: a key would outlive that narrowing. - When the request is authenticated with a **project-scoped API key**, the new key is confined to that same project: omitting `project_id` defaults to it, naming a different project returns `403 API_KEY_PROJECT_SCOPE`, and `project_id: null` (an unscoped key) is likewise refused. Minting an unscoped key requires an unscoped credential. - When the request is authenticated with an **API key narrowed by `policy_ids`**, the new key stays inside that boundary: omitting `policy_ids` inherits the caller's own, a non-empty subset of them is accepted, and an empty list or any other policy returns `403 API_KEY_POLICY_BOUNDARY`.
1109
1109
  *
1110
1110
  */
1111
1111
  static createApiKey(options) {
@@ -1121,7 +1121,7 @@ var ApiKeys = class {
1121
1121
  /**
1122
1122
  * Delete an API key
1123
1123
  *
1124
- * Deletes an API key. Only the owner or an admin can delete it, and a project-scoped credential can only delete keys in its own project.
1124
+ * Deletes an API key. Only the owner or an unrestricted admin can delete it, and a project-scoped credential can only delete keys in its own project.
1125
1125
  */
1126
1126
  static deleteApiKey(options) {
1127
1127
  return (options.client ?? client).delete({
@@ -1132,7 +1132,7 @@ var ApiKeys = class {
1132
1132
  /**
1133
1133
  * Get an API key
1134
1134
  *
1135
- * Returns details of an API key. Only the owner or an admin can access it, and a project-scoped credential can only reach keys in its own project.
1135
+ * Returns details of an API key. Only the owner or an unrestricted admin can access it, and a project-scoped credential can only reach keys in its own project.
1136
1136
  */
1137
1137
  static getApiKey(options) {
1138
1138
  return (options.client ?? client).get({
@@ -1143,7 +1143,7 @@ var ApiKeys = class {
1143
1143
  /**
1144
1144
  * Update an API key
1145
1145
  *
1146
- * Updates an API key's name, project scope, or policies. The project scope can be changed to another project, set (scoping a previously unscoped key), or cleared with null (unscoping the key). Only the owner or an admin can update it. A project-scoped credential can only update keys in its own project, and cannot move a key to another project or unscope it. An API key narrowed by `policy_ids` can only set `policy_ids` to a non-empty subset of its own (`403 API_KEY_POLICY_BOUNDARY` otherwise). A project-scoped token (OAuth, trigger or run) never updates a key (`403 API_KEY_SCOPED_TOKEN`).
1146
+ * Updates an API key's name, project scope, or policies. The project scope can be changed to another project, set (scoping a previously unscoped key), or cleared with null (unscoping the key). Only the owner or an unrestricted admin (a login, or a key bound to no project and narrowed by no policy) can update it. A project-scoped credential can only update keys in its own project, and cannot move a key to another project or unscope it. An API key narrowed by `policy_ids` can only set `policy_ids` to a non-empty subset of its own (`403 API_KEY_POLICY_BOUNDARY` otherwise). A request narrowed beyond its credential's own grant (OAuth, trigger, run or IAM token, or `On-Behalf-Of`) never updates a key (`403 CREDENTIAL_NARROWED`).
1147
1147
  */
1148
1148
  static updateApiKey(options) {
1149
1149
  return (options.client ?? client).put({
@@ -3039,7 +3039,7 @@ var Iam = class {
3039
3039
  /**
3040
3040
  * Check a permission of the calling credential
3041
3041
  *
3042
- * Evaluates the calling credential's own policies (its owner's and, for an API key or OAuth token, its boundary and project scope) for an action the deployment registered (`IAM_REGISTRATIONS_CONFIG`) on an SRN, with the engine the runtime's own routes use. A denial is `200` with `allowed: false`, never `403`. Only policies are evaluated: the answer says nothing about whether the resource exists.
3042
+ * Evaluates the calling credential's own policies (its owner's and, for an API key or OAuth token, its boundary and project scope) for an action the deployment registered (`IAM_REGISTRATIONS_CONFIG`) or any built-in action, such as one a resource the deployment stores will perform later, on an SRN, with the engine the runtime's own routes use. A denial is `200` with `allowed: false`, never `403`. Only policies are evaluated: the answer says nothing about whether the resource exists.
3043
3043
  */
3044
3044
  static checkIamPermission(options) {
3045
3045
  return (options.client ?? client).post({
@@ -3051,6 +3051,21 @@ var Iam = class {
3051
3051
  }
3052
3052
  });
3053
3053
  }
3054
+ /**
3055
+ * Issue an IAM token
3056
+ *
3057
+ * Issues a short-lived token that acts as the calling API key held to a bound: `policy`, an inline policy document, or `policy_ids`, policies of the key's project or global ones. Every request on the token is authorized against the key's grant as it stands at that request ∩ the bound, so an `Allow` beyond the key grants nothing and a permission removed from the key leaves the token too. Work the token starts (a generation, a session turn, a task dispatch, an orchestration run, a playbook version) keeps the bound after the token expires. Only an API key scoped to a project issues one (`403 IAM_TOKEN_ISSUER_NOT_ALLOWED`); a token creates neither tokens nor API keys. The audit log records the token's `jti` and `principal` under `detail.iam_token` on every entry the token makes.
3058
+ */
3059
+ static createIamToken(options) {
3060
+ return (options.client ?? client).post({
3061
+ url: "/api/v1/iam/tokens",
3062
+ ...options,
3063
+ headers: {
3064
+ "Content-Type": "application/json",
3065
+ ...options.headers
3066
+ }
3067
+ });
3068
+ }
3054
3069
  };
3055
3070
  var IngestionRules = class {
3056
3071
  /**
@@ -4020,7 +4035,7 @@ var Playbooks = class {
4020
4035
  *
4021
4036
  * Creates a playbook at version 1. The definition is refused with `400 PLAYBOOK_VALIDATION_FAILED` when it holds a duplicate node or input, an input reading a missing node or field, an `execute` node without an executor or another kind with one, transformations on a non-final node, or a cycle; `meta.problems` lists every one. A duplicate `name` in the project is `409 NAME_CONFLICT`.
4022
4037
  *
4023
- * The caller becomes the version's author, whom its executors run as, so it must be allowed to start every executor the definition names (`403 PLAYBOOK_EXECUTOR_FORBIDDEN`), and each must exist in the project, or be an agent or tool shared with it (`400 PLAYBOOK_VALIDATION_FAILED`, an `EXECUTOR_NOT_FOUND` problem). A `tool` executor on an `mcp` tool must name in `operation_id` an action the tool's binding allows (`EXECUTOR_ACTION_REQUIRED`, `EXECUTOR_ACTION_UNAVAILABLE`). An executor cannot be a `client` tool (`EXECUTOR_TOOL_UNSUPPORTED`), nor a transformation's tool a `client` or `mcp` tool (`TRANSFORMATION_TOOL_UNSUPPORTED`). A definition with executors written with a trigger or OAuth token is `409 PLAYBOOK_AUTHOR_UNAVAILABLE`: those carry their boundary in the token, so no run can act as them.
4038
+ * The caller becomes the version's author, whom its executors run as, so it must be allowed to start every executor the definition names (`403 ACTION_NOT_HELD`), and each must exist in the project, or be an agent or tool shared with it (`400 PLAYBOOK_VALIDATION_FAILED`, an `EXECUTOR_NOT_FOUND` problem). A `tool` executor on an `mcp` tool must name in `operation_id` an action the tool's binding allows (`EXECUTOR_ACTION_REQUIRED`, `EXECUTOR_ACTION_UNAVAILABLE`). An executor cannot be a `client` tool (`EXECUTOR_TOOL_UNSUPPORTED`), nor a transformation's tool a `client` or `mcp` tool (`TRANSFORMATION_TOOL_UNSUPPORTED`). A definition with executors written with a trigger or OAuth token is `409 PLAYBOOK_AUTHOR_UNAVAILABLE`: those carry their boundary in the token, so no run can act as them.
4024
4039
  */
4025
4040
  static createPlaybook(options) {
4026
4041
  return (options.client ?? client).post({
@@ -4076,7 +4091,7 @@ var Playbooks = class {
4076
4091
  *
4077
4092
  * Updates any of `name`, `description` and `definition`. Only a change to `definition` archives a new version; a rename or a rewrite of the definition the playbook already holds leaves `version` where it is. A case keeps the version it was created on.
4078
4093
  *
4079
- * A new version is authored by the caller, checked as on create: `403 PLAYBOOK_EXECUTOR_FORBIDDEN` for an executor it may not start, an `EXECUTOR_NOT_FOUND` problem for one that does not exist, `EXECUTOR_ACTION_REQUIRED` or `EXECUTOR_ACTION_UNAVAILABLE` for an `mcp` tool action a run could not call, `EXECUTOR_TOOL_UNSUPPORTED` for a `client` tool executor, `TRANSFORMATION_TOOL_UNSUPPORTED` for a `client` or `mcp` transformation tool, `409 PLAYBOOK_AUTHOR_UNAVAILABLE` for a trigger or OAuth token.
4094
+ * A new version is authored by the caller, checked as on create: `403 ACTION_NOT_HELD` for an executor it may not start, an `EXECUTOR_NOT_FOUND` problem for one that does not exist, `EXECUTOR_ACTION_REQUIRED` or `EXECUTOR_ACTION_UNAVAILABLE` for an `mcp` tool action a run could not call, `EXECUTOR_TOOL_UNSUPPORTED` for a `client` tool executor, `TRANSFORMATION_TOOL_UNSUPPORTED` for a `client` or `mcp` transformation tool, `409 PLAYBOOK_AUTHOR_UNAVAILABLE` for a trigger or OAuth token.
4080
4095
  */
4081
4096
  static updatePlaybook(options) {
4082
4097
  return (options.client ?? client).patch({
@@ -4395,7 +4410,7 @@ var Policies = class {
4395
4410
  /**
4396
4411
  * Delete a policy
4397
4412
  *
4398
- * Deletes a policy. A project policy needs `policies:DeletePolicy` in its project; a global one, the unrestricted admin. Refused with `409 POLICY_HAS_DEPENDENTS` while a trigger, agent or webhook names it in its `policy_ids`.
4413
+ * Deletes a policy. A project policy needs `policies:DeletePolicy` in its project; a global one, the unrestricted admin. Refused with `409 POLICY_HAS_DEPENDENTS` while a trigger, agent, webhook, user or API key names it in its `policy_ids`.
4399
4414
  */
4400
4415
  static deletePolicy(options) {
4401
4416
  return (options.client ?? client).delete({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soat/sdk",
3
- "version": "0.107.0",
3
+ "version": "0.109.0",
4
4
  "description": "TypeScript SDK for SOAT — open-source infrastructure for production-ready AI agents.",
5
5
  "keywords": [
6
6
  "ai-agents",