@opensecret/react 1.3.3 → 1.3.5

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.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { default as default_2 } from 'react';
2
2
  import { JSX } from 'react/jsx-runtime';
3
+ import { Model } from 'openai/resources/models.js';
3
4
  import { z } from 'zod';
4
5
 
5
6
  declare function acceptInvite(code: string): Promise<{
@@ -45,6 +46,7 @@ declare namespace api {
45
46
  decryptData,
46
47
  requestAccountDeletion,
47
48
  confirmAccountDeletion,
49
+ fetchModels,
48
50
  LoginResponse,
49
51
  UserResponse,
50
52
  KVListItem,
@@ -380,6 +382,16 @@ declare function fetchLogin(email: string, password: string, client_id: string):
380
382
 
381
383
  declare function fetchLogout(refresh_token: string): Promise<void>;
382
384
 
385
+ /**
386
+ * Fetches available AI models from the OpenAI-compatible API
387
+ * @returns A promise resolving to an array of Model objects
388
+ * @throws {Error} If:
389
+ * - The user is not authenticated
390
+ * - The request fails
391
+ * - The response format is invalid
392
+ */
393
+ declare function fetchModels(): Promise<Model[]>;
394
+
383
395
  /**
384
396
  * Fetches the private key as a mnemonic phrase with optional derivation paths
385
397
  * @param key_options - Optional key derivation options (see KeyOptions type)
@@ -623,12 +635,16 @@ declare type MeResponse = {
623
635
  organizations: PlatformOrg[];
624
636
  };
625
637
 
638
+ export { Model }
639
+
626
640
  /**
627
641
  * Provider-specific OAuth settings
628
642
  */
629
643
  declare type OAuthProviderSettings = {
630
644
  client_id: string;
631
645
  redirect_url: string;
646
+ team_id?: string;
647
+ key_id?: string;
632
648
  };
633
649
 
634
650
  declare type OAuthSettings = {
@@ -1071,6 +1087,20 @@ export declare type OpenSecretContextType = {
1071
1087
  * that were used for encryption.
1072
1088
  */
1073
1089
  decryptData: typeof api.decryptData;
1090
+ /**
1091
+ * Fetches available AI models from the OpenAI-compatible API
1092
+ * @returns A promise resolving to an array of Model objects
1093
+ * @throws {Error} If:
1094
+ * - The user is not authenticated
1095
+ * - The request fails
1096
+ *
1097
+ *
1098
+ * - Returns a list of available AI models from the configured OpenAI-compatible API
1099
+ * - Response is encrypted and automatically decrypted
1100
+ * - Guest users will receive a 401 Unauthorized error
1101
+ * - Requires an active authentication session
1102
+ */
1103
+ fetchModels: () => Promise<Model[]>;
1074
1104
  };
1075
1105
 
1076
1106
  /**