@breign/client 1.0.198 → 1.0.200

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/openapi.json CHANGED
@@ -2143,6 +2143,22 @@
2143
2143
  "enum" : [ "positive", "negative" ],
2144
2144
  "type" : "string"
2145
2145
  }
2146
+ }, {
2147
+ "description" : "Keep conversations with at least this many messages from the user (the count shown in the history).",
2148
+ "in" : "query",
2149
+ "name" : "minMessages",
2150
+ "schema" : {
2151
+ "minimum" : 0,
2152
+ "type" : "integer"
2153
+ }
2154
+ }, {
2155
+ "description" : "Keep conversations with at most this many messages from the user (the count shown in the history).",
2156
+ "in" : "query",
2157
+ "name" : "maxMessages",
2158
+ "schema" : {
2159
+ "minimum" : 0,
2160
+ "type" : "integer"
2161
+ }
2146
2162
  } ],
2147
2163
  "responses" : {
2148
2164
  "200" : {
@@ -5203,7 +5219,7 @@
5203
5219
  },
5204
5220
  "/auth/token" : {
5205
5221
  "post" : {
5206
- "description" : "Exchanges the code issued by `POST /auth/authorizations` for an API key of the user, after checking the PKCE verifier, the client and the redirect address. The code is single use. Errors follow RFC 6749 section 5.2.\n",
5222
+ "description" : "Exchanges the code issued by `POST /auth/authorizations` for an API key of the user, after checking the PKCE verifier, the client and the redirect address. The code is single use. With `token_format=jwt`, returns an access token and a refresh token instead of an API key; `grant_type=refresh_token` then renews them. Errors follow RFC 6749 section 5.2.\n",
5207
5223
  "operationId" : "exchangeApplicationAuthorizationCode",
5208
5224
  "requestBody" : {
5209
5225
  "content" : {
@@ -5224,7 +5240,7 @@
5224
5240
  }
5225
5241
  }
5226
5242
  },
5227
- "description" : "API key of the user"
5243
+ "description" : "API key of the user, or access and refresh tokens"
5228
5244
  },
5229
5245
  "400" : {
5230
5246
  "content" : {
@@ -5238,7 +5254,41 @@
5238
5254
  }
5239
5255
  },
5240
5256
  "security" : [ ],
5241
- "summary" : "Exchange an application authorization code",
5257
+ "summary" : "Exchange an application authorization code, or refresh its tokens",
5258
+ "tags" : [ "auth" ]
5259
+ }
5260
+ },
5261
+ "/auth/revoke" : {
5262
+ "post" : {
5263
+ "description" : "Closes the session of a refresh token returned with `token_format=jwt` (RFC 7009), on logout from the application. Answers 200 whether the token existed or not. Access tokens already issued stay valid until they expire (1 h at most).\n",
5264
+ "operationId" : "revokeApplicationToken",
5265
+ "requestBody" : {
5266
+ "content" : {
5267
+ "application/json" : {
5268
+ "schema" : {
5269
+ "$ref" : "#/components/schemas/ApplicationTokenRevocationRequest"
5270
+ }
5271
+ }
5272
+ },
5273
+ "required" : true
5274
+ },
5275
+ "responses" : {
5276
+ "200" : {
5277
+ "description" : "Token revoked, or unknown"
5278
+ },
5279
+ "400" : {
5280
+ "content" : {
5281
+ "application/json" : {
5282
+ "schema" : {
5283
+ "$ref" : "#/components/schemas/ApplicationTokenError"
5284
+ }
5285
+ }
5286
+ },
5287
+ "description" : "OAuth error (`invalid_request`)"
5288
+ }
5289
+ },
5290
+ "security" : [ ],
5291
+ "summary" : "Revoke an application refresh token",
5242
5292
  "tags" : [ "auth" ]
5243
5293
  }
5244
5294
  },
@@ -23570,6 +23620,24 @@
23570
23620
  "type" : "string"
23571
23621
  }
23572
23622
  },
23623
+ "minMessages" : {
23624
+ "description" : "Keep conversations with at least this many messages from the user (the count shown in the history).",
23625
+ "in" : "query",
23626
+ "name" : "minMessages",
23627
+ "schema" : {
23628
+ "minimum" : 0,
23629
+ "type" : "integer"
23630
+ }
23631
+ },
23632
+ "maxMessages" : {
23633
+ "description" : "Keep conversations with at most this many messages from the user (the count shown in the history).",
23634
+ "in" : "query",
23635
+ "name" : "maxMessages",
23636
+ "schema" : {
23637
+ "minimum" : 0,
23638
+ "type" : "integer"
23639
+ }
23640
+ },
23573
23641
  "ephemeral" : {
23574
23642
  "description" : "If true, the resource will not appear in history and will be deleted after a certain time.",
23575
23643
  "in" : "query",
@@ -26444,11 +26512,56 @@
26444
26512
  },
26445
26513
  "totalTokens" : {
26446
26514
  "type" : "number"
26515
+ },
26516
+ "models" : {
26517
+ "description" : "Modèles identifiés qui ont consommé ces tokens, du plus au moins utilisé, chacun avec sa propre consommation. Les totaux ci-dessus peuvent inclure une consommation non attribuée à un modèle (OCR…).",
26518
+ "items" : {
26519
+ "$ref" : "#/components/schemas/ModelUsed"
26520
+ },
26521
+ "type" : "array"
26447
26522
  }
26448
26523
  },
26449
26524
  "required" : [ "inputTokens", "outputTokens", "reasoningTokens", "totalTokens" ],
26450
26525
  "type" : "object"
26451
26526
  },
26527
+ "ModelUsed" : {
26528
+ "description" : "Un modèle utilisé, avec le moteur qui l'a servi (un même modelId peut venir de plusieurs), et les tokens que ce modèle-là a consommés.",
26529
+ "properties" : {
26530
+ "model" : {
26531
+ "description" : "modelId du modèle.",
26532
+ "type" : "string"
26533
+ },
26534
+ "provider" : {
26535
+ "description" : "Id du moteur.",
26536
+ "nullable" : true,
26537
+ "type" : "string"
26538
+ },
26539
+ "providerName" : {
26540
+ "nullable" : true,
26541
+ "type" : "string"
26542
+ },
26543
+ "origin" : {
26544
+ "description" : "D'où vient le moteur : l'organisation (ses propres clés) ou la plateforme (Breign). Null si le moteur est inconnu (supprimé, ou ligne de métrique antérieure à l'id du moteur).",
26545
+ "enum" : [ "organization", "platform" ],
26546
+ "nullable" : true,
26547
+ "type" : "string"
26548
+ },
26549
+ "inputTokens" : {
26550
+ "type" : "number"
26551
+ },
26552
+ "outputTokens" : {
26553
+ "type" : "number"
26554
+ },
26555
+ "reasoningTokens" : {
26556
+ "type" : "number"
26557
+ },
26558
+ "totalTokens" : {
26559
+ "type" : "number"
26560
+ }
26561
+ },
26562
+ "required" : [ "inputTokens", "model", "origin", "outputTokens", "provider", "providerName", "reasoningTokens", "totalTokens" ],
26563
+ "type" : "object"
26564
+ },
26452
26565
  "ConversationContextUsage" : {
26453
26566
  "additionalProperties" : false,
26454
26567
  "description" : "How much of the model's context window this conversation occupies: the prompt of the last generation call, not the conversation's cumulated token count. Absent until a turn has been measured — an unmeasured conversation has an unknown occupancy, not an empty window.",
@@ -27943,7 +28056,7 @@
27943
28056
  "type" : "array"
27944
28057
  },
27945
28058
  "usage" : {
27946
- "$ref" : "#/components/schemas/TokenUsage"
28059
+ "$ref" : "#/components/schemas/TokenUsage_1"
27947
28060
  },
27948
28061
  "metrics" : {
27949
28062
  "items" : {
@@ -27976,6 +28089,31 @@
27976
28089
  "required" : [ "brainId", "createdAt", "id", "messages", "updatedAt" ],
27977
28090
  "type" : "object"
27978
28091
  },
28092
+ "TokenUsage_1" : {
28093
+ "properties" : {
28094
+ "inputTokens" : {
28095
+ "type" : "number"
28096
+ },
28097
+ "outputTokens" : {
28098
+ "type" : "number"
28099
+ },
28100
+ "reasoningTokens" : {
28101
+ "type" : "number"
28102
+ },
28103
+ "totalTokens" : {
28104
+ "type" : "number"
28105
+ },
28106
+ "models" : {
28107
+ "description" : "Modèles identifiés qui ont consommé ces tokens, du plus au moins utilisé, chacun avec sa propre consommation. Les totaux ci-dessus peuvent inclure une consommation non attribuée à un modèle (OCR…).",
28108
+ "items" : {
28109
+ "$ref" : "#/components/schemas/ModelUsed"
28110
+ },
28111
+ "type" : "array"
28112
+ }
28113
+ },
28114
+ "required" : [ "inputTokens", "outputTokens", "reasoningTokens", "totalTokens" ],
28115
+ "type" : "object"
28116
+ },
27979
28117
  "AuthCodeRequest" : {
27980
28118
  "additionalProperties" : false,
27981
28119
  "properties" : {
@@ -28110,9 +28248,10 @@
28110
28248
  "type" : "object"
28111
28249
  },
28112
28250
  "ApplicationTokenRequest" : {
28251
+ "description" : "`authorization_code` exchanges the code (with `code`, `code_verifier` and `redirect_uri`); `refresh_token` renews the tokens of a session opened with `token_format=jwt`.\n",
28113
28252
  "properties" : {
28114
28253
  "grant_type" : {
28115
- "enum" : [ "authorization_code" ],
28254
+ "enum" : [ "authorization_code", "refresh_token" ],
28116
28255
  "type" : "string"
28117
28256
  },
28118
28257
  "code" : {
@@ -28124,35 +28263,78 @@
28124
28263
  "redirect_uri" : {
28125
28264
  "type" : "string"
28126
28265
  },
28266
+ "refresh_token" : {
28267
+ "description" : "Required with `grant_type=refresh_token`.",
28268
+ "type" : "string"
28269
+ },
28127
28270
  "client_id" : {
28128
28271
  "type" : "string"
28272
+ },
28273
+ "token_format" : {
28274
+ "$ref" : "#/components/schemas/ApplicationTokenFormat"
28129
28275
  }
28130
28276
  },
28131
- "required" : [ "client_id", "code", "code_verifier", "grant_type", "redirect_uri" ],
28277
+ "required" : [ "client_id", "grant_type" ],
28132
28278
  "type" : "object"
28133
28279
  },
28280
+ "ApplicationTokenFormat" : {
28281
+ "default" : "api_key",
28282
+ "description" : "`api_key` (default) creates an API key of the user. `jwt` returns a 1 h access token and a rotating 30-day refresh token instead, without creating an API key.\n",
28283
+ "enum" : [ "api_key", "jwt" ],
28284
+ "type" : "string"
28285
+ },
28134
28286
  "ApplicationTokenResponse" : {
28287
+ "description" : "An API key (`token_type: api_key`), or with `token_format=jwt` an access token and a refresh token (`token_type: Bearer`). Each refresh returns a new refresh token; the previous one stops working, and presenting it again closes the session.\n",
28135
28288
  "properties" : {
28136
28289
  "access_token" : {
28137
- "description" : "API key, to send in the `x-api-key` header.",
28290
+ "description" : "API key, to send in the `x-api-key` header; or access token, to send as `Authorization: Bearer`.\n",
28138
28291
  "type" : "string"
28139
28292
  },
28140
28293
  "token_type" : {
28141
- "enum" : [ "api_key" ],
28294
+ "enum" : [ "api_key", "Bearer" ],
28142
28295
  "type" : "string"
28143
28296
  },
28144
28297
  "key_id" : {
28298
+ "description" : "Only for an API key.",
28145
28299
  "type" : "string"
28146
28300
  },
28147
28301
  "key_name" : {
28302
+ "description" : "Only for an API key.",
28303
+ "type" : "string"
28304
+ },
28305
+ "expires_in" : {
28306
+ "description" : "Lifetime of the access token in seconds. Only with `token_format=jwt`.",
28307
+ "type" : "integer"
28308
+ },
28309
+ "refresh_token" : {
28310
+ "description" : "Only with `token_format=jwt`.",
28148
28311
  "type" : "string"
28149
28312
  },
28150
28313
  "email" : {
28151
28314
  "nullable" : true,
28152
28315
  "type" : "string"
28316
+ },
28317
+ "user_id" : {
28318
+ "type" : "string"
28319
+ }
28320
+ },
28321
+ "required" : [ "access_token", "token_type" ],
28322
+ "type" : "object"
28323
+ },
28324
+ "ApplicationTokenRevocationRequest" : {
28325
+ "properties" : {
28326
+ "token" : {
28327
+ "description" : "The refresh token to revoke.",
28328
+ "type" : "string"
28329
+ },
28330
+ "client_id" : {
28331
+ "type" : "string"
28332
+ },
28333
+ "token_type_hint" : {
28334
+ "type" : "string"
28153
28335
  }
28154
28336
  },
28155
- "required" : [ "access_token", "key_id", "key_name", "token_type" ],
28337
+ "required" : [ "client_id", "token" ],
28156
28338
  "type" : "object"
28157
28339
  },
28158
28340
  "OAuthProviderInfo" : {
@@ -40157,7 +40339,7 @@
40157
40339
  "type" : "array"
40158
40340
  },
40159
40341
  "usage" : {
40160
- "$ref" : "#/components/schemas/TokenUsage"
40342
+ "$ref" : "#/components/schemas/TokenUsage_1"
40161
40343
  },
40162
40344
  "toolResults" : {
40163
40345
  "items" : {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@breign/client",
3
- "version": "1.0.198",
3
+ "version": "1.0.200",
4
4
  "main": "dist/index.js",
5
5
  "exports": {
6
6
  ".": "./dist/index.js",