trieve-ts-sdk
Advanced tools
Comparing version 0.0.33 to 0.0.34
declare const _default: { | ||
createOrganizationApiKey(this: import("..").TrieveSDK, props: import("..").CreateApiKeyReqPayload, signal?: AbortSignal): Promise<import("..").CreateApiKeyResponse>; | ||
deleteOrganizationApiKey(this: import("..").TrieveSDK, apiKeyId: string, signal?: AbortSignal): Promise<void>; | ||
updateUserRole(this: import("..").TrieveSDK, props: import("..").UpdateUserOrgRoleReqPayload, signal?: AbortSignal): Promise<void>; | ||
createUserApiKey(this: import("..").TrieveSDK, props: import("..").CreateApiKeyReqPayload, signal?: AbortSignal): Promise<import("..").CreateApiKeyResponse>; | ||
deleteUserApiKey(this: import("..").TrieveSDK, apiKeyId: string, signal?: AbortSignal): Promise<void>; | ||
createDataset(this: import("..").TrieveSDK, props: import("..").CreateDatasetReqPayload, signal?: AbortSignal): Promise<import("..").Dataset>; | ||
@@ -6,0 +6,0 @@ updateDataset(this: import("..").TrieveSDK, props: import("..").UpdateDatasetReqPayload, signal?: AbortSignal): Promise<import("..").Dataset>; |
@@ -7,12 +7,6 @@ /** | ||
import { TrieveSDK } from "../../sdk"; | ||
import { CreateApiKeyReqPayload, CreateApiKeyResponse, UpdateUserOrgRoleReqPayload } from "../../types.gen"; | ||
import { UpdateUserOrgRoleReqPayload } from "../../types.gen"; | ||
export declare function updateUserRole( | ||
/** @hidden */ | ||
this: TrieveSDK, props: UpdateUserOrgRoleReqPayload, signal?: AbortSignal): Promise<void>; | ||
export declare function createUserApiKey( | ||
/** @hidden */ | ||
this: TrieveSDK, props: CreateApiKeyReqPayload, signal?: AbortSignal): Promise<CreateApiKeyResponse>; | ||
export declare function deleteUserApiKey( | ||
/** @hidden */ | ||
this: TrieveSDK, apiKeyId: string, signal?: AbortSignal): Promise<void>; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -1150,4 +1150,2 @@ var __defProp = Object.defineProperty; | ||
__export(user_exports, { | ||
createUserApiKey: () => createUserApiKey, | ||
deleteUserApiKey: () => deleteUserApiKey, | ||
updateUserRole: () => updateUserRole | ||
@@ -1169,11 +1167,21 @@ }); | ||
} | ||
async function createUserApiKey(props, signal) { | ||
// src/functions/organization/index.ts | ||
var organization_exports = {}; | ||
__export(organization_exports, { | ||
createOrganizationApiKey: () => createOrganizationApiKey, | ||
deleteOrganizationApiKey: () => deleteOrganizationApiKey | ||
}); | ||
async function createOrganizationApiKey(props, signal) { | ||
if (!this.organizationId) { | ||
throw new Error("Organization ID is required to create user API key"); | ||
throw new Error( | ||
"Organization ID is required to create Organization API key" | ||
); | ||
} | ||
return this.trieve.fetch( | ||
"/api/user/api_key", | ||
"/api/organization/api_key", | ||
"post", | ||
{ | ||
data: props | ||
data: props, | ||
organizationId: this.organizationId | ||
}, | ||
@@ -1183,8 +1191,14 @@ signal | ||
} | ||
async function deleteUserApiKey(apiKeyId, signal) { | ||
async function deleteOrganizationApiKey(apiKeyId, signal) { | ||
if (!this.organizationId) { | ||
throw new Error( | ||
"Organization ID is required to delete Organization API key" | ||
); | ||
} | ||
return this.trieve.fetch( | ||
"/api/user/api_key/{api_key_id}", | ||
"/api/organization/api_key/{api_key_id}", | ||
"delete", | ||
{ | ||
apiKeyId | ||
apiKeyId, | ||
organizationId: this.organizationId | ||
}, | ||
@@ -1205,3 +1219,4 @@ signal | ||
...datasets_exports, | ||
...user_exports | ||
...user_exports, | ||
...organization_exports | ||
}; | ||
@@ -1208,0 +1223,0 @@ |
@@ -9,3 +9,3 @@ { | ||
], | ||
"version": "0.0.33", | ||
"version": "0.0.34", | ||
"license": "MIT", | ||
@@ -12,0 +12,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
499586
58
8249