@opensecret/react 1.5.0 → 1.5.2
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/LICENSE.md +7 -0
- package/dist/index.d.ts +43 -1
- package/dist/opensecret-react.es.js +941 -929
- package/dist/opensecret-react.umd.js +19 -19
- package/package.json +1 -1
package/LICENSE.md
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
Copyright (c) 2024 OpenSecret
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
4
|
+
|
|
5
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/dist/index.d.ts
CHANGED
|
@@ -43,6 +43,7 @@ declare namespace api {
|
|
|
43
43
|
fetchUser,
|
|
44
44
|
fetchPut,
|
|
45
45
|
fetchDelete,
|
|
46
|
+
fetchDeleteAllKV,
|
|
46
47
|
fetchGet,
|
|
47
48
|
fetchList,
|
|
48
49
|
fetchLogout,
|
|
@@ -85,6 +86,7 @@ declare namespace api {
|
|
|
85
86
|
getConversation,
|
|
86
87
|
updateConversation,
|
|
87
88
|
deleteConversation,
|
|
89
|
+
deleteConversations,
|
|
88
90
|
addConversationItems,
|
|
89
91
|
listConversationItems,
|
|
90
92
|
listConversations,
|
|
@@ -135,6 +137,7 @@ declare namespace api {
|
|
|
135
137
|
ConversationItemsResponse,
|
|
136
138
|
ConversationsListResponse,
|
|
137
139
|
ConversationDeleteResponse,
|
|
140
|
+
ConversationsDeleteResponse,
|
|
138
141
|
ResponsesCancelResponse,
|
|
139
142
|
ResponsesDeleteResponse,
|
|
140
143
|
ResponsesCreateRequest,
|
|
@@ -425,6 +428,11 @@ export declare type ConversationItemsResponse = {
|
|
|
425
428
|
has_more: boolean;
|
|
426
429
|
};
|
|
427
430
|
|
|
431
|
+
export declare type ConversationsDeleteResponse = {
|
|
432
|
+
object: "list.deleted";
|
|
433
|
+
deleted: boolean;
|
|
434
|
+
};
|
|
435
|
+
|
|
428
436
|
export declare type ConversationsListResponse = {
|
|
429
437
|
object: "list";
|
|
430
438
|
data: Conversation[];
|
|
@@ -645,6 +653,27 @@ export declare function deleteApiKey(name: string): Promise<void>;
|
|
|
645
653
|
*/
|
|
646
654
|
declare function deleteConversation(conversationId: string): Promise<ConversationDeleteResponse>;
|
|
647
655
|
|
|
656
|
+
/**
|
|
657
|
+
* Deletes all conversations
|
|
658
|
+
* @returns A promise resolving to deletion confirmation
|
|
659
|
+
* @throws {Error} If:
|
|
660
|
+
* - The user is not authenticated
|
|
661
|
+
* - The request fails
|
|
662
|
+
*
|
|
663
|
+
* @description
|
|
664
|
+
* This function permanently deletes all conversations and their associated items.
|
|
665
|
+
* This action cannot be undone.
|
|
666
|
+
*
|
|
667
|
+
* @example
|
|
668
|
+
* ```typescript
|
|
669
|
+
* const result = await deleteConversations();
|
|
670
|
+
* if (result.deleted) {
|
|
671
|
+
* console.log("All conversations deleted successfully");
|
|
672
|
+
* }
|
|
673
|
+
* ```
|
|
674
|
+
*/
|
|
675
|
+
declare function deleteConversations(): Promise<ConversationsDeleteResponse>;
|
|
676
|
+
|
|
648
677
|
/**
|
|
649
678
|
* Deletes an instruction permanently
|
|
650
679
|
* @param instructionId - The UUID of the instruction to delete
|
|
@@ -793,6 +822,8 @@ declare function fetchAttestationDocument(nonce: string, explicitApiUrl?: string
|
|
|
793
822
|
|
|
794
823
|
declare function fetchDelete(key: string): Promise<void>;
|
|
795
824
|
|
|
825
|
+
declare function fetchDeleteAllKV(): Promise<void>;
|
|
826
|
+
|
|
796
827
|
declare function fetchGet(key: string): Promise<string | undefined>;
|
|
797
828
|
|
|
798
829
|
declare function fetchGuestLogin(id: string, password: string, client_id: string): Promise<LoginResponse>;
|
|
@@ -1493,6 +1524,12 @@ export declare type OpenSecretContextType = {
|
|
|
1493
1524
|
* - Propagates any server-side errors directly
|
|
1494
1525
|
*/
|
|
1495
1526
|
del: typeof api.fetchDelete;
|
|
1527
|
+
/**
|
|
1528
|
+
* Deletes all key-value pairs from the user's storage
|
|
1529
|
+
* @returns A promise resolving when the deletion is complete
|
|
1530
|
+
* @throws {Error} If the deletion fails
|
|
1531
|
+
*/
|
|
1532
|
+
delAll: typeof api.fetchDeleteAllKV;
|
|
1496
1533
|
verifyEmail: typeof api.verifyEmail;
|
|
1497
1534
|
requestNewVerificationCode: typeof api.requestNewVerificationCode;
|
|
1498
1535
|
requestNewVerificationEmail: typeof api.requestNewVerificationCode;
|
|
@@ -2012,6 +2049,11 @@ export declare type OpenSecretContextType = {
|
|
|
2012
2049
|
after?: string;
|
|
2013
2050
|
before?: string;
|
|
2014
2051
|
}) => Promise<api.ConversationsListResponse>;
|
|
2052
|
+
/**
|
|
2053
|
+
* Deletes all conversations
|
|
2054
|
+
* @returns A promise resolving to deletion confirmation
|
|
2055
|
+
*/
|
|
2056
|
+
deleteConversations: typeof api.deleteConversations;
|
|
2015
2057
|
/**
|
|
2016
2058
|
* Creates a new instruction
|
|
2017
2059
|
* @param request - The instruction creation parameters
|
|
@@ -2809,7 +2851,7 @@ export declare type ResponsesRetrieveResponse = {
|
|
|
2809
2851
|
};
|
|
2810
2852
|
total_tokens: number;
|
|
2811
2853
|
};
|
|
2812
|
-
output?: string;
|
|
2854
|
+
output?: string | any[];
|
|
2813
2855
|
};
|
|
2814
2856
|
|
|
2815
2857
|
declare function setApiUrl(url: string): void;
|