@bodhiapp/ts-client 0.1.7 → 0.1.8

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.
@@ -885,6 +885,18 @@ export interface components {
885
885
  ApiFormatsResponse: {
886
886
  data: components["schemas"]["ApiFormat"][];
887
887
  };
888
+ /** @description Validated API key wrapper - validates length when Some, allows None for public APIs */
889
+ ApiKey: string | null;
890
+ /** @description Represents an API key update action for API model updates */
891
+ ApiKeyUpdateAction: {
892
+ /** @enum {string} */
893
+ action: "keep";
894
+ } | {
895
+ /** @description Set a new API key (or add one if none exists) - can be None for public APIs */
896
+ value: components["schemas"]["ApiKey"];
897
+ /** @enum {string} */
898
+ action: "set";
899
+ };
888
900
  /**
889
901
  * @description Response containing API model configuration
890
902
  * @example {
@@ -905,7 +917,7 @@ export interface components {
905
917
  id: string;
906
918
  api_format: components["schemas"]["ApiFormat"];
907
919
  base_url: string;
908
- api_key_masked: string;
920
+ api_key_masked?: string | null;
909
921
  models: string[];
910
922
  prefix?: string | null;
911
923
  /** Format: date-time */
@@ -951,6 +963,7 @@ export interface components {
951
963
  /**
952
964
  * @description Application information and status
953
965
  * @example {
966
+ * "commit_sha": "abc1234",
954
967
  * "status": "ready",
955
968
  * "version": "0.1.0"
956
969
  * }
@@ -961,6 +974,11 @@ export interface components {
961
974
  * @example 0.1.0
962
975
  */
963
976
  version: string;
977
+ /**
978
+ * @description Git commit SHA of the build
979
+ * @example abc1234
980
+ */
981
+ commit_sha: string;
964
982
  /** @description Current application setup and operational status */
965
983
  status: components["schemas"]["AppStatus"];
966
984
  };
@@ -1355,8 +1373,8 @@ export interface components {
1355
1373
  api_format: components["schemas"]["ApiFormat"];
1356
1374
  /** @description API base URL */
1357
1375
  base_url: string;
1358
- /** @description API key for authentication */
1359
- api_key: string;
1376
+ /** @description API key for authentication (null for public APIs) */
1377
+ api_key?: components["schemas"]["ApiKey"];
1360
1378
  /** @description List of available models */
1361
1379
  models: string[];
1362
1380
  /** @description Optional prefix for model namespacing (e.g., "azure/" for "azure/gpt-4", "openai:" for "openai:gpt-4") */
@@ -1650,16 +1668,17 @@ export interface components {
1650
1668
  /**
1651
1669
  * @description Request to fetch available models from provider
1652
1670
  * @example {
1653
- * "api_key": "sk-...",
1654
- * "base_url": "https://api.openai.com/v1"
1671
+ * "base_url": "http://localhost:8080/v1",
1672
+ * "creds": {
1673
+ * "type": "api_key",
1674
+ * "value": null
1675
+ * }
1655
1676
  * }
1656
1677
  */
1657
1678
  FetchModelsRequest: {
1658
- /** @description API key for authentication (provide either api_key OR id, api_key takes preference if both provided) */
1659
- api_key?: string;
1660
- /** @description API model ID to look up stored credentials (provide either api_key OR id, api_key takes preference if both provided) */
1661
- id?: string;
1662
- /** @description API base URL (optional when using id) */
1679
+ /** @description Credentials to use for fetching models */
1680
+ creds?: components["schemas"]["TestCreds"];
1681
+ /** @description API base URL (required - always needed to know where to fetch models from) */
1663
1682
  base_url: string;
1664
1683
  };
1665
1684
  /**
@@ -2147,21 +2166,34 @@ export interface components {
2147
2166
  template: string;
2148
2167
  };
2149
2168
  Stop: string | string[];
2169
+ /** @description Credentials for test/fetch operations */
2170
+ TestCreds: {
2171
+ /** @description Look up credentials from stored API model */
2172
+ value: string;
2173
+ /** @enum {string} */
2174
+ type: "id";
2175
+ } | {
2176
+ /** @description Use direct API key (null for no authentication) */
2177
+ value: components["schemas"]["ApiKey"];
2178
+ /** @enum {string} */
2179
+ type: "api_key";
2180
+ };
2150
2181
  /**
2151
2182
  * @description Request to test API connectivity with a prompt
2152
2183
  * @example {
2153
- * "api_key": "sk-...",
2154
2184
  * "base_url": "https://api.openai.com/v1",
2185
+ * "creds": {
2186
+ * "type": "api_key",
2187
+ * "value": "sk-..."
2188
+ * },
2155
2189
  * "model": "gpt-4",
2156
2190
  * "prompt": "Hello, how are you?"
2157
2191
  * }
2158
2192
  */
2159
2193
  TestPromptRequest: {
2160
- /** @description API key for authentication (provide either api_key OR id, api_key takes preference if both provided) */
2161
- api_key?: string;
2162
- /** @description API model ID to look up stored credentials (provide either api_key OR id, api_key takes preference if both provided) */
2163
- id?: string;
2164
- /** @description API base URL (optional when using id) */
2194
+ /** @description Credentials to use for testing */
2195
+ creds?: components["schemas"]["TestCreds"];
2196
+ /** @description API base URL */
2165
2197
  base_url: string;
2166
2198
  /** @description Model to use for testing */
2167
2199
  model: string;
@@ -2211,7 +2243,9 @@ export interface components {
2211
2243
  * @description Request to update an existing API model configuration
2212
2244
  * @example {
2213
2245
  * "api_format": "openai",
2214
- * "api_key": "sk-new-key",
2246
+ * "api_key": {
2247
+ * "action": "keep"
2248
+ * },
2215
2249
  * "base_url": "https://api.openai.com/v1",
2216
2250
  * "models": [
2217
2251
  * "gpt-4-turbo",
@@ -2225,8 +2259,8 @@ export interface components {
2225
2259
  api_format: components["schemas"]["ApiFormat"];
2226
2260
  /** @description API base URL (required) */
2227
2261
  base_url: string;
2228
- /** @description API key for authentication (optional, only update if provided for security) */
2229
- api_key?: string | null;
2262
+ /** @description API key update action (Keep/Set with Some or None) */
2263
+ api_key?: components["schemas"]["ApiKeyUpdateAction"];
2230
2264
  /** @description List of available models (required) */
2231
2265
  models: string[];
2232
2266
  /** @description Optional prefix for model namespacing */
@@ -3759,6 +3793,7 @@ export interface operations {
3759
3793
  };
3760
3794
  content: {
3761
3795
  /** @example {
3796
+ * "commit_sha": "abc1234",
3762
3797
  * "status": "ready",
3763
3798
  * "version": "0.1.0"
3764
3799
  * } */
@@ -886,6 +886,18 @@ export interface components {
886
886
  ApiFormatsResponse: {
887
887
  data: components["schemas"]["ApiFormat"][];
888
888
  };
889
+ /** @description Validated API key wrapper - validates length when Some, allows None for public APIs */
890
+ ApiKey: string | null;
891
+ /** @description Represents an API key update action for API model updates */
892
+ ApiKeyUpdateAction: {
893
+ /** @enum {string} */
894
+ action: "keep";
895
+ } | {
896
+ /** @description Set a new API key (or add one if none exists) - can be None for public APIs */
897
+ value: components["schemas"]["ApiKey"];
898
+ /** @enum {string} */
899
+ action: "set";
900
+ };
889
901
  /**
890
902
  * @description Response containing API model configuration
891
903
  * @example {
@@ -906,7 +918,7 @@ export interface components {
906
918
  id: string;
907
919
  api_format: components["schemas"]["ApiFormat"];
908
920
  base_url: string;
909
- api_key_masked: string;
921
+ api_key_masked?: string | null;
910
922
  models: string[];
911
923
  prefix?: string | null;
912
924
  /** Format: date-time */
@@ -952,6 +964,7 @@ export interface components {
952
964
  /**
953
965
  * @description Application information and status
954
966
  * @example {
967
+ * "commit_sha": "abc1234",
955
968
  * "status": "ready",
956
969
  * "version": "0.1.0"
957
970
  * }
@@ -962,6 +975,11 @@ export interface components {
962
975
  * @example 0.1.0
963
976
  */
964
977
  version: string;
978
+ /**
979
+ * @description Git commit SHA of the build
980
+ * @example abc1234
981
+ */
982
+ commit_sha: string;
965
983
  /** @description Current application setup and operational status */
966
984
  status: components["schemas"]["AppStatus"];
967
985
  };
@@ -1356,8 +1374,8 @@ export interface components {
1356
1374
  api_format: components["schemas"]["ApiFormat"];
1357
1375
  /** @description API base URL */
1358
1376
  base_url: string;
1359
- /** @description API key for authentication */
1360
- api_key: string;
1377
+ /** @description API key for authentication (null for public APIs) */
1378
+ api_key?: components["schemas"]["ApiKey"];
1361
1379
  /** @description List of available models */
1362
1380
  models: string[];
1363
1381
  /** @description Optional prefix for model namespacing (e.g., "azure/" for "azure/gpt-4", "openai:" for "openai:gpt-4") */
@@ -1651,16 +1669,17 @@ export interface components {
1651
1669
  /**
1652
1670
  * @description Request to fetch available models from provider
1653
1671
  * @example {
1654
- * "api_key": "sk-...",
1655
- * "base_url": "https://api.openai.com/v1"
1672
+ * "base_url": "http://localhost:8080/v1",
1673
+ * "creds": {
1674
+ * "type": "api_key",
1675
+ * "value": null
1676
+ * }
1656
1677
  * }
1657
1678
  */
1658
1679
  FetchModelsRequest: {
1659
- /** @description API key for authentication (provide either api_key OR id, api_key takes preference if both provided) */
1660
- api_key?: string;
1661
- /** @description API model ID to look up stored credentials (provide either api_key OR id, api_key takes preference if both provided) */
1662
- id?: string;
1663
- /** @description API base URL (optional when using id) */
1680
+ /** @description Credentials to use for fetching models */
1681
+ creds?: components["schemas"]["TestCreds"];
1682
+ /** @description API base URL (required - always needed to know where to fetch models from) */
1664
1683
  base_url: string;
1665
1684
  };
1666
1685
  /**
@@ -2148,21 +2167,34 @@ export interface components {
2148
2167
  template: string;
2149
2168
  };
2150
2169
  Stop: string | string[];
2170
+ /** @description Credentials for test/fetch operations */
2171
+ TestCreds: {
2172
+ /** @description Look up credentials from stored API model */
2173
+ value: string;
2174
+ /** @enum {string} */
2175
+ type: "id";
2176
+ } | {
2177
+ /** @description Use direct API key (null for no authentication) */
2178
+ value: components["schemas"]["ApiKey"];
2179
+ /** @enum {string} */
2180
+ type: "api_key";
2181
+ };
2151
2182
  /**
2152
2183
  * @description Request to test API connectivity with a prompt
2153
2184
  * @example {
2154
- * "api_key": "sk-...",
2155
2185
  * "base_url": "https://api.openai.com/v1",
2186
+ * "creds": {
2187
+ * "type": "api_key",
2188
+ * "value": "sk-..."
2189
+ * },
2156
2190
  * "model": "gpt-4",
2157
2191
  * "prompt": "Hello, how are you?"
2158
2192
  * }
2159
2193
  */
2160
2194
  TestPromptRequest: {
2161
- /** @description API key for authentication (provide either api_key OR id, api_key takes preference if both provided) */
2162
- api_key?: string;
2163
- /** @description API model ID to look up stored credentials (provide either api_key OR id, api_key takes preference if both provided) */
2164
- id?: string;
2165
- /** @description API base URL (optional when using id) */
2195
+ /** @description Credentials to use for testing */
2196
+ creds?: components["schemas"]["TestCreds"];
2197
+ /** @description API base URL */
2166
2198
  base_url: string;
2167
2199
  /** @description Model to use for testing */
2168
2200
  model: string;
@@ -2212,7 +2244,9 @@ export interface components {
2212
2244
  * @description Request to update an existing API model configuration
2213
2245
  * @example {
2214
2246
  * "api_format": "openai",
2215
- * "api_key": "sk-new-key",
2247
+ * "api_key": {
2248
+ * "action": "keep"
2249
+ * },
2216
2250
  * "base_url": "https://api.openai.com/v1",
2217
2251
  * "models": [
2218
2252
  * "gpt-4-turbo",
@@ -2226,8 +2260,8 @@ export interface components {
2226
2260
  api_format: components["schemas"]["ApiFormat"];
2227
2261
  /** @description API base URL (required) */
2228
2262
  base_url: string;
2229
- /** @description API key for authentication (optional, only update if provided for security) */
2230
- api_key?: string | null;
2263
+ /** @description API key update action (Keep/Set with Some or None) */
2264
+ api_key?: components["schemas"]["ApiKeyUpdateAction"];
2231
2265
  /** @description List of available models (required) */
2232
2266
  models: string[];
2233
2267
  /** @description Optional prefix for model namespacing */
@@ -3760,6 +3794,7 @@ export interface operations {
3760
3794
  };
3761
3795
  content: {
3762
3796
  /** @example {
3797
+ * "commit_sha": "abc1234",
3763
3798
  * "status": "ready",
3764
3799
  * "version": "0.1.0"
3765
3800
  * } */
@@ -28,6 +28,22 @@ export type ApiFormat = 'openai' | 'placeholder';
28
28
  export type ApiFormatsResponse = {
29
29
  data: Array<ApiFormat>;
30
30
  };
31
+ /**
32
+ * Validated API key wrapper - validates length when Some, allows None for public APIs
33
+ */
34
+ export type ApiKey = string | null;
35
+ /**
36
+ * Represents an API key update action for API model updates
37
+ */
38
+ export type ApiKeyUpdateAction = {
39
+ action: 'keep';
40
+ } | {
41
+ /**
42
+ * Set a new API key (or add one if none exists) - can be None for public APIs
43
+ */
44
+ value: ApiKey;
45
+ action: 'set';
46
+ };
31
47
  /**
32
48
  * Response containing API model configuration
33
49
  */
@@ -35,7 +51,7 @@ export type ApiModelResponse = {
35
51
  id: string;
36
52
  api_format: ApiFormat;
37
53
  base_url: string;
38
- api_key_masked: string;
54
+ api_key_masked?: string | null;
39
55
  models: Array<string>;
40
56
  prefix?: string | null;
41
57
  created_at: string;
@@ -72,6 +88,10 @@ export type AppInfo = {
72
88
  * Application version number (semantic versioning)
73
89
  */
74
90
  version: string;
91
+ /**
92
+ * Git commit SHA of the build
93
+ */
94
+ commit_sha: string;
75
95
  /**
76
96
  * Current application setup and operational status
77
97
  */
@@ -517,9 +537,9 @@ export type CreateApiModelRequest = {
517
537
  */
518
538
  base_url: string;
519
539
  /**
520
- * API key for authentication
540
+ * API key for authentication (null for public APIs)
521
541
  */
522
- api_key: string;
542
+ api_key?: ApiKey;
523
543
  /**
524
544
  * List of available models
525
545
  */
@@ -835,15 +855,11 @@ export type ErrorBody = {
835
855
  */
836
856
  export type FetchModelsRequest = {
837
857
  /**
838
- * API key for authentication (provide either api_key OR id, api_key takes preference if both provided)
839
- */
840
- api_key?: string;
841
- /**
842
- * API model ID to look up stored credentials (provide either api_key OR id, api_key takes preference if both provided)
858
+ * Credentials to use for fetching models
843
859
  */
844
- id?: string;
860
+ creds?: TestCreds;
845
861
  /**
846
- * API base URL (optional when using id)
862
+ * API base URL (required - always needed to know where to fetch models from)
847
863
  */
848
864
  base_url: string;
849
865
  };
@@ -1285,19 +1301,31 @@ export type ShowResponse = {
1285
1301
  };
1286
1302
  export type Stop = string | Array<string>;
1287
1303
  /**
1288
- * Request to test API connectivity with a prompt
1304
+ * Credentials for test/fetch operations
1289
1305
  */
1290
- export type TestPromptRequest = {
1306
+ export type TestCreds = {
1291
1307
  /**
1292
- * API key for authentication (provide either api_key OR id, api_key takes preference if both provided)
1308
+ * Look up credentials from stored API model
1293
1309
  */
1294
- api_key?: string;
1310
+ value: string;
1311
+ type: 'id';
1312
+ } | {
1295
1313
  /**
1296
- * API model ID to look up stored credentials (provide either api_key OR id, api_key takes preference if both provided)
1314
+ * Use direct API key (null for no authentication)
1297
1315
  */
1298
- id?: string;
1316
+ value: ApiKey;
1317
+ type: 'api_key';
1318
+ };
1319
+ /**
1320
+ * Request to test API connectivity with a prompt
1321
+ */
1322
+ export type TestPromptRequest = {
1299
1323
  /**
1300
- * API base URL (optional when using id)
1324
+ * Credentials to use for testing
1325
+ */
1326
+ creds?: TestCreds;
1327
+ /**
1328
+ * API base URL
1301
1329
  */
1302
1330
  base_url: string;
1303
1331
  /**
@@ -1359,9 +1387,9 @@ export type UpdateApiModelRequest = {
1359
1387
  */
1360
1388
  base_url: string;
1361
1389
  /**
1362
- * API key for authentication (optional, only update if provided for security)
1390
+ * API key update action (Keep/Set with Some or None)
1363
1391
  */
1364
- api_key?: string | null;
1392
+ api_key?: ApiKeyUpdateAction;
1365
1393
  /**
1366
1394
  * List of available models (required)
1367
1395
  */
@@ -34,6 +34,24 @@ export type ApiFormatsResponse = {
34
34
  data: Array<ApiFormat>;
35
35
  };
36
36
 
37
+ /**
38
+ * Validated API key wrapper - validates length when Some, allows None for public APIs
39
+ */
40
+ export type ApiKey = string | null;
41
+
42
+ /**
43
+ * Represents an API key update action for API model updates
44
+ */
45
+ export type ApiKeyUpdateAction = {
46
+ action: 'keep';
47
+ } | {
48
+ /**
49
+ * Set a new API key (or add one if none exists) - can be None for public APIs
50
+ */
51
+ value: ApiKey;
52
+ action: 'set';
53
+ };
54
+
37
55
  /**
38
56
  * Response containing API model configuration
39
57
  */
@@ -41,7 +59,7 @@ export type ApiModelResponse = {
41
59
  id: string;
42
60
  api_format: ApiFormat;
43
61
  base_url: string;
44
- api_key_masked: string;
62
+ api_key_masked?: string | null;
45
63
  models: Array<string>;
46
64
  prefix?: string | null;
47
65
  created_at: string;
@@ -83,6 +101,10 @@ export type AppInfo = {
83
101
  * Application version number (semantic versioning)
84
102
  */
85
103
  version: string;
104
+ /**
105
+ * Git commit SHA of the build
106
+ */
107
+ commit_sha: string;
86
108
  /**
87
109
  * Current application setup and operational status
88
110
  */
@@ -579,9 +601,9 @@ export type CreateApiModelRequest = {
579
601
  */
580
602
  base_url: string;
581
603
  /**
582
- * API key for authentication
604
+ * API key for authentication (null for public APIs)
583
605
  */
584
- api_key: string;
606
+ api_key?: ApiKey;
585
607
  /**
586
608
  * List of available models
587
609
  */
@@ -912,15 +934,11 @@ export type ErrorBody = {
912
934
  */
913
935
  export type FetchModelsRequest = {
914
936
  /**
915
- * API key for authentication (provide either api_key OR id, api_key takes preference if both provided)
916
- */
917
- api_key?: string;
918
- /**
919
- * API model ID to look up stored credentials (provide either api_key OR id, api_key takes preference if both provided)
937
+ * Credentials to use for fetching models
920
938
  */
921
- id?: string;
939
+ creds?: TestCreds;
922
940
  /**
923
- * API base URL (optional when using id)
941
+ * API base URL (required - always needed to know where to fetch models from)
924
942
  */
925
943
  base_url: string;
926
944
  };
@@ -1415,19 +1433,32 @@ export type ShowResponse = {
1415
1433
  export type Stop = string | Array<string>;
1416
1434
 
1417
1435
  /**
1418
- * Request to test API connectivity with a prompt
1436
+ * Credentials for test/fetch operations
1419
1437
  */
1420
- export type TestPromptRequest = {
1438
+ export type TestCreds = {
1421
1439
  /**
1422
- * API key for authentication (provide either api_key OR id, api_key takes preference if both provided)
1440
+ * Look up credentials from stored API model
1423
1441
  */
1424
- api_key?: string;
1442
+ value: string;
1443
+ type: 'id';
1444
+ } | {
1425
1445
  /**
1426
- * API model ID to look up stored credentials (provide either api_key OR id, api_key takes preference if both provided)
1446
+ * Use direct API key (null for no authentication)
1427
1447
  */
1428
- id?: string;
1448
+ value: ApiKey;
1449
+ type: 'api_key';
1450
+ };
1451
+
1452
+ /**
1453
+ * Request to test API connectivity with a prompt
1454
+ */
1455
+ export type TestPromptRequest = {
1429
1456
  /**
1430
- * API base URL (optional when using id)
1457
+ * Credentials to use for testing
1458
+ */
1459
+ creds?: TestCreds;
1460
+ /**
1461
+ * API base URL
1431
1462
  */
1432
1463
  base_url: string;
1433
1464
  /**
@@ -1496,9 +1527,9 @@ export type UpdateApiModelRequest = {
1496
1527
  */
1497
1528
  base_url: string;
1498
1529
  /**
1499
- * API key for authentication (optional, only update if provided for security)
1530
+ * API key update action (Keep/Set with Some or None)
1500
1531
  */
1501
- api_key?: string | null;
1532
+ api_key?: ApiKeyUpdateAction;
1502
1533
  /**
1503
1534
  * List of available models (required)
1504
1535
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bodhiapp/ts-client",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "description": "TypeScript types for Bodhi API",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",