@ai-accounts/ts-core 0.2.0 → 0.2.1

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.cjs CHANGED
@@ -93,6 +93,18 @@ var AiAccountsClient = class {
93
93
  );
94
94
  if (!r.ok) throw await toError(r);
95
95
  }
96
+ async updateBackend(id, patch) {
97
+ const r = await this._fetch(
98
+ `${this.baseUrl}/api/v1/backends/${encodeURIComponent(id)}`,
99
+ {
100
+ method: "PATCH",
101
+ headers: this.headers(),
102
+ body: JSON.stringify(patch)
103
+ }
104
+ );
105
+ if (!r.ok) throw await toError(r);
106
+ return await r.json();
107
+ }
96
108
  async detectBackend(id) {
97
109
  return this.postAction(id, "detect");
98
110
  }
package/dist/index.d.cts CHANGED
@@ -99,7 +99,8 @@ interface paths {
99
99
  delete: operations["ApiV1BackendsBackendIdDeleteBackend"];
100
100
  options?: never;
101
101
  head?: never;
102
- patch?: never;
102
+ /** UpdateBackend */
103
+ patch: operations["ApiV1BackendsBackendIdUpdateBackend"];
103
104
  trace?: never;
104
105
  };
105
106
  "/api/v1/backends/{backend_id}/detect": {
@@ -384,6 +385,13 @@ interface components {
384
385
  PollLoginRequest: {
385
386
  handle: string;
386
387
  };
388
+ /** UpdateBackendRequest */
389
+ UpdateBackendRequest: {
390
+ config?: {
391
+ [key: string]: unknown;
392
+ } | null;
393
+ display_name?: string | null;
394
+ };
387
395
  };
388
396
  responses: never;
389
397
  parameters: never;
@@ -523,6 +531,47 @@ interface operations {
523
531
  };
524
532
  };
525
533
  };
534
+ ApiV1BackendsBackendIdUpdateBackend: {
535
+ parameters: {
536
+ query?: never;
537
+ header?: never;
538
+ path: {
539
+ backend_id: string;
540
+ };
541
+ cookie?: never;
542
+ };
543
+ requestBody: {
544
+ content: {
545
+ "application/json": components["schemas"]["UpdateBackendRequest"];
546
+ };
547
+ };
548
+ responses: {
549
+ /** @description Request fulfilled, document follows */
550
+ 200: {
551
+ headers: {
552
+ [name: string]: unknown;
553
+ };
554
+ content: {
555
+ "application/json": components["schemas"]["BackendDTO"];
556
+ };
557
+ };
558
+ /** @description Bad request syntax or unsupported method */
559
+ 400: {
560
+ headers: {
561
+ [name: string]: unknown;
562
+ };
563
+ content: {
564
+ "application/json": {
565
+ detail: string;
566
+ extra?: null | {
567
+ [key: string]: unknown;
568
+ } | unknown[];
569
+ status_code: number;
570
+ };
571
+ };
572
+ };
573
+ };
574
+ };
526
575
  ApiV1BackendsBackendIdDetectDetect: {
527
576
  parameters: {
528
577
  query?: never;
@@ -1017,6 +1066,10 @@ declare class AiAccountsClient {
1017
1066
  }): Promise<BackendDTO>;
1018
1067
  getBackend(id: string): Promise<BackendDTO>;
1019
1068
  deleteBackend(id: string): Promise<void>;
1069
+ updateBackend(id: string, patch: {
1070
+ display_name?: string;
1071
+ config?: Record<string, unknown>;
1072
+ }): Promise<BackendDTO>;
1020
1073
  detectBackend(id: string): Promise<DetectResultDTO>;
1021
1074
  loginBackend(id: string, flowKind: string, inputs: Record<string, string>): Promise<LoginResponseDTO>;
1022
1075
  pollBackendLogin(id: string, handle: string): Promise<LoginResponseDTO>;
package/dist/index.d.ts CHANGED
@@ -99,7 +99,8 @@ interface paths {
99
99
  delete: operations["ApiV1BackendsBackendIdDeleteBackend"];
100
100
  options?: never;
101
101
  head?: never;
102
- patch?: never;
102
+ /** UpdateBackend */
103
+ patch: operations["ApiV1BackendsBackendIdUpdateBackend"];
103
104
  trace?: never;
104
105
  };
105
106
  "/api/v1/backends/{backend_id}/detect": {
@@ -384,6 +385,13 @@ interface components {
384
385
  PollLoginRequest: {
385
386
  handle: string;
386
387
  };
388
+ /** UpdateBackendRequest */
389
+ UpdateBackendRequest: {
390
+ config?: {
391
+ [key: string]: unknown;
392
+ } | null;
393
+ display_name?: string | null;
394
+ };
387
395
  };
388
396
  responses: never;
389
397
  parameters: never;
@@ -523,6 +531,47 @@ interface operations {
523
531
  };
524
532
  };
525
533
  };
534
+ ApiV1BackendsBackendIdUpdateBackend: {
535
+ parameters: {
536
+ query?: never;
537
+ header?: never;
538
+ path: {
539
+ backend_id: string;
540
+ };
541
+ cookie?: never;
542
+ };
543
+ requestBody: {
544
+ content: {
545
+ "application/json": components["schemas"]["UpdateBackendRequest"];
546
+ };
547
+ };
548
+ responses: {
549
+ /** @description Request fulfilled, document follows */
550
+ 200: {
551
+ headers: {
552
+ [name: string]: unknown;
553
+ };
554
+ content: {
555
+ "application/json": components["schemas"]["BackendDTO"];
556
+ };
557
+ };
558
+ /** @description Bad request syntax or unsupported method */
559
+ 400: {
560
+ headers: {
561
+ [name: string]: unknown;
562
+ };
563
+ content: {
564
+ "application/json": {
565
+ detail: string;
566
+ extra?: null | {
567
+ [key: string]: unknown;
568
+ } | unknown[];
569
+ status_code: number;
570
+ };
571
+ };
572
+ };
573
+ };
574
+ };
526
575
  ApiV1BackendsBackendIdDetectDetect: {
527
576
  parameters: {
528
577
  query?: never;
@@ -1017,6 +1066,10 @@ declare class AiAccountsClient {
1017
1066
  }): Promise<BackendDTO>;
1018
1067
  getBackend(id: string): Promise<BackendDTO>;
1019
1068
  deleteBackend(id: string): Promise<void>;
1069
+ updateBackend(id: string, patch: {
1070
+ display_name?: string;
1071
+ config?: Record<string, unknown>;
1072
+ }): Promise<BackendDTO>;
1020
1073
  detectBackend(id: string): Promise<DetectResultDTO>;
1021
1074
  loginBackend(id: string, flowKind: string, inputs: Record<string, string>): Promise<LoginResponseDTO>;
1022
1075
  pollBackendLogin(id: string, handle: string): Promise<LoginResponseDTO>;
package/dist/index.js CHANGED
@@ -63,6 +63,18 @@ var AiAccountsClient = class {
63
63
  );
64
64
  if (!r.ok) throw await toError(r);
65
65
  }
66
+ async updateBackend(id, patch) {
67
+ const r = await this._fetch(
68
+ `${this.baseUrl}/api/v1/backends/${encodeURIComponent(id)}`,
69
+ {
70
+ method: "PATCH",
71
+ headers: this.headers(),
72
+ body: JSON.stringify(patch)
73
+ }
74
+ );
75
+ if (!r.ok) throw await toError(r);
76
+ return await r.json();
77
+ }
66
78
  async detectBackend(id) {
67
79
  return this.postAction(id, "detect");
68
80
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-accounts/ts-core",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Framework-agnostic TypeScript client and protocol for ai-accounts",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",