🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@bitwarden/sdk-napi

Package Overview
Dependencies
Maintainers
3
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bitwarden/sdk-napi - npm Package Compare versions

Comparing version
0.3.1
to
1.0.0
+1
-1
binding.d.ts

@@ -13,5 +13,5 @@ /* tslint:disable */

}
export class BitwardenClient {
export declare class BitwardenClient {
constructor(settingsInput?: string | undefined | null, logLevel?: LogLevel | undefined | null);
runCommand(commandInput: string): Promise<string>;
}

@@ -1,2 +0,8 @@

const { existsSync, readFileSync } = require("fs");
/* tslint:disable */
/* eslint-disable */
/* prettier-ignore */
/* auto-generated by NAPI-RS */
const { existsSync, readFileSync } = require('fs')
const { join } = require("path");

@@ -14,3 +20,4 @@

try {
return readFileSync("/usr/bin/ldd", "utf8").includes("musl");
const lddPath = require("child_process").execSync("which ldd").toString().trim();
return readFileSync(lddPath, "utf8").includes("musl");
} catch (e) {

@@ -99,2 +106,11 @@ return true;

case "darwin":
localFileExisted = existsSync(join(__dirname, "sdk-napi.darwin-universal.node"));
try {
if (localFileExisted) {
nativeBinding = require("./sdk-napi.darwin-universal.node");
} else {
nativeBinding = require("@bitwarden/sdk-napi-darwin-universal");
}
break;
} catch {}
switch (arch) {

@@ -197,8 +213,58 @@ case "x64":

case "arm":
localFileExisted = existsSync(join(__dirname, "sdk-napi.linux-arm-gnueabihf.node"));
if (isMusl()) {
localFileExisted = existsSync(join(__dirname, "sdk-napi.linux-arm-musleabihf.node"));
try {
if (localFileExisted) {
nativeBinding = require("./sdk-napi.linux-arm-musleabihf.node");
} else {
nativeBinding = require("@bitwarden/sdk-napi-linux-arm-musleabihf");
}
} catch (e) {
loadError = e;
}
} else {
localFileExisted = existsSync(join(__dirname, "sdk-napi.linux-arm-gnueabihf.node"));
try {
if (localFileExisted) {
nativeBinding = require("./sdk-napi.linux-arm-gnueabihf.node");
} else {
nativeBinding = require("@bitwarden/sdk-napi-linux-arm-gnueabihf");
}
} catch (e) {
loadError = e;
}
}
break;
case "riscv64":
if (isMusl()) {
localFileExisted = existsSync(join(__dirname, "sdk-napi.linux-riscv64-musl.node"));
try {
if (localFileExisted) {
nativeBinding = require("./sdk-napi.linux-riscv64-musl.node");
} else {
nativeBinding = require("@bitwarden/sdk-napi-linux-riscv64-musl");
}
} catch (e) {
loadError = e;
}
} else {
localFileExisted = existsSync(join(__dirname, "sdk-napi.linux-riscv64-gnu.node"));
try {
if (localFileExisted) {
nativeBinding = require("./sdk-napi.linux-riscv64-gnu.node");
} else {
nativeBinding = require("@bitwarden/sdk-napi-linux-riscv64-gnu");
}
} catch (e) {
loadError = e;
}
}
break;
case "s390x":
localFileExisted = existsSync(join(__dirname, "sdk-napi.linux-s390x-gnu.node"));
try {
if (localFileExisted) {
nativeBinding = require("./sdk-napi.linux-arm-gnueabihf.node");
nativeBinding = require("./sdk-napi.linux-s390x-gnu.node");
} else {
nativeBinding = require("@bitwarden/sdk-napi-linux-arm-gnueabihf");
nativeBinding = require("@bitwarden/sdk-napi-linux-s390x-gnu");
}

@@ -205,0 +271,0 @@ } catch (e) {

import * as rust from "../../binding";
import { LogLevel } from "../../binding";
import { ClientSettings, ResponseForAPIKeyLoginResponse, ResponseForSecretIdentifiersResponse, ResponseForSecretResponse, ResponseForSecretsDeleteResponse, ResponseForSecretsResponse } from "./schemas";
import { ClientSettings, ProjectResponse, ProjectsDeleteResponse, ProjectsResponse, SecretIdentifiersResponse, SecretResponse, SecretsDeleteResponse, SecretsResponse, SecretsSyncResponse } from "./schemas";
export declare class BitwardenClient {
client: rust.BitwardenClient;
constructor(settings?: ClientSettings, loggingLevel?: LogLevel);
loginWithAccessToken(accessToken: string): Promise<ResponseForAPIKeyLoginResponse>;
secrets(): SecretsClient;
projects(): ProjectsClient;
auth(): AuthClient;
}

@@ -13,8 +14,23 @@ export declare class SecretsClient {

constructor(client: rust.BitwardenClient);
get(id: string): Promise<ResponseForSecretResponse>;
getByIds(ids: string[]): Promise<ResponseForSecretsResponse>;
create(key: string, note: string, organizationId: string, value: string): Promise<ResponseForSecretResponse>;
list(organizationId: string): Promise<ResponseForSecretIdentifiersResponse>;
update(id: string, key: string, note: string, organizationId: string, value: string): Promise<ResponseForSecretResponse>;
delete(ids: string[]): Promise<ResponseForSecretsDeleteResponse>;
get(id: string): Promise<SecretResponse>;
getByIds(ids: string[]): Promise<SecretsResponse>;
create(organizationId: string, key: string, value: string, note: string, projectIds: string[]): Promise<SecretResponse>;
list(organizationId: string): Promise<SecretIdentifiersResponse>;
update(organizationId: string, id: string, key: string, value: string, note: string, projectIds: string[]): Promise<SecretResponse>;
delete(ids: string[]): Promise<SecretsDeleteResponse>;
sync(organizationId: string, lastSyncedDate?: Date): Promise<SecretsSyncResponse>;
}
export declare class ProjectsClient {
client: rust.BitwardenClient;
constructor(client: rust.BitwardenClient);
get(id: string): Promise<ProjectResponse>;
create(organizationId: string, name: string): Promise<ProjectResponse>;
list(organizationId: string): Promise<ProjectsResponse>;
update(organizationId: string, id: string, name: string): Promise<ProjectResponse>;
delete(ids: string[]): Promise<ProjectsDeleteResponse>;
}
export declare class AuthClient {
client: rust.BitwardenClient;
constructor(client: rust.BitwardenClient);
loginAccessToken(accessToken: string, stateFile?: string): Promise<void>;
}

@@ -35,5 +35,14 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.SecretsClient = exports.BitwardenClient = void 0;
exports.AuthClient = exports.ProjectsClient = exports.SecretsClient = exports.BitwardenClient = void 0;
const rust = __importStar(require("../../binding"));
const schemas_1 = require("./schemas");
function handleResponse(response) {
if (!response.success) {
throw new Error(response.errorMessage || "");
}
if (response.data === null) {
throw new Error(response.errorMessage || "SDK response data is null");
}
return response.data;
}
class BitwardenClient {

@@ -44,29 +53,11 @@ constructor(settings, loggingLevel) {

}
loginWithAccessToken(accessToken) {
return __awaiter(this, void 0, void 0, function* () {
const commandInput = schemas_1.Convert.commandToJson({
accessTokenLogin: {
accessToken: accessToken,
},
});
const response = yield this.client.runCommand(commandInput);
return schemas_1.Convert.toResponseForAPIKeyLoginResponse(response);
});
}
/*
async sync(excludeSubdomains = false): Promise<ResponseForSyncResponse> {
const response = await this.client.runCommand(
Convert.commandToJson({
sync: {
excludeSubdomains,
},
})
);
return Convert.toResponseForSyncResponse(response);
}
*/
secrets() {
return new SecretsClient(this.client);
}
projects() {
return new ProjectsClient(this.client);
}
auth() {
return new AuthClient(this.client);
}
}

@@ -85,3 +76,3 @@ exports.BitwardenClient = BitwardenClient;

}));
return schemas_1.Convert.toResponseForSecretResponse(response);
return handleResponse(schemas_1.Convert.toResponseForSecretResponse(response));
});

@@ -96,13 +87,13 @@ }

}));
return schemas_1.Convert.toResponseForSecretsResponse(response);
return handleResponse(schemas_1.Convert.toResponseForSecretsResponse(response));
});
}
create(key, note, organizationId, value) {
create(organizationId, key, value, note, projectIds) {
return __awaiter(this, void 0, void 0, function* () {
const response = yield this.client.runCommand(schemas_1.Convert.commandToJson({
secrets: {
create: { key, note, organizationId, value },
create: { key, value, note, projectIds, organizationId },
},
}));
return schemas_1.Convert.toResponseForSecretResponse(response);
return handleResponse(schemas_1.Convert.toResponseForSecretResponse(response));
});

@@ -117,13 +108,13 @@ }

}));
return schemas_1.Convert.toResponseForSecretIdentifiersResponse(response);
return handleResponse(schemas_1.Convert.toResponseForSecretIdentifiersResponse(response));
});
}
update(id, key, note, organizationId, value) {
update(organizationId, id, key, value, note, projectIds) {
return __awaiter(this, void 0, void 0, function* () {
const response = yield this.client.runCommand(schemas_1.Convert.commandToJson({
secrets: {
update: { id, key, note, organizationId, value },
update: { id, key, value, note, projectIds, organizationId },
},
}));
return schemas_1.Convert.toResponseForSecretResponse(response);
return handleResponse(schemas_1.Convert.toResponseForSecretResponse(response));
});

@@ -138,6 +129,89 @@ }

}));
return schemas_1.Convert.toResponseForSecretsDeleteResponse(response);
return handleResponse(schemas_1.Convert.toResponseForSecretsDeleteResponse(response));
});
}
sync(organizationId, lastSyncedDate) {
return __awaiter(this, void 0, void 0, function* () {
const response = yield this.client.runCommand(schemas_1.Convert.commandToJson({
secrets: {
sync: { organizationId, lastSyncedDate },
},
}));
return handleResponse(schemas_1.Convert.toResponseForSecretsSyncResponse(response));
});
}
}
exports.SecretsClient = SecretsClient;
class ProjectsClient {
constructor(client) {
this.client = client;
}
get(id) {
return __awaiter(this, void 0, void 0, function* () {
const response = yield this.client.runCommand(schemas_1.Convert.commandToJson({
projects: {
get: { id },
},
}));
return handleResponse(schemas_1.Convert.toResponseForProjectResponse(response));
});
}
create(organizationId, name) {
return __awaiter(this, void 0, void 0, function* () {
const response = yield this.client.runCommand(schemas_1.Convert.commandToJson({
projects: {
create: { name, organizationId },
},
}));
return handleResponse(schemas_1.Convert.toResponseForProjectResponse(response));
});
}
list(organizationId) {
return __awaiter(this, void 0, void 0, function* () {
const response = yield this.client.runCommand(schemas_1.Convert.commandToJson({
projects: {
list: { organizationId },
},
}));
return handleResponse(schemas_1.Convert.toResponseForProjectsResponse(response));
});
}
update(organizationId, id, name) {
return __awaiter(this, void 0, void 0, function* () {
const response = yield this.client.runCommand(schemas_1.Convert.commandToJson({
projects: {
update: { id, name, organizationId },
},
}));
return handleResponse(schemas_1.Convert.toResponseForProjectResponse(response));
});
}
delete(ids) {
return __awaiter(this, void 0, void 0, function* () {
const response = yield this.client.runCommand(schemas_1.Convert.commandToJson({
projects: {
delete: { ids },
},
}));
return handleResponse(schemas_1.Convert.toResponseForProjectsDeleteResponse(response));
});
}
}
exports.ProjectsClient = ProjectsClient;
class AuthClient {
constructor(client) {
this.client = client;
}
loginAccessToken(accessToken, stateFile) {
return __awaiter(this, void 0, void 0, function* () {
const response = yield this.client.runCommand(schemas_1.Convert.commandToJson({
loginAccessToken: {
accessToken,
stateFile,
},
}));
handleResponse(schemas_1.Convert.toResponseForAccessTokenLoginResponse(response));
});
}
}
exports.AuthClient = AuthClient;

@@ -8,10 +8,6 @@ /**

*
* ``` # use bitwarden::client::client_settings::{ClientSettings, DeviceType}; # use
* assert_matches::assert_matches; let settings = ClientSettings { identity_url:
* "https://identity.bitwarden.com".to_string(), api_url:
* ``` # use bitwarden_core::{ClientSettings, DeviceType}; let settings = ClientSettings {
* identity_url: "https://identity.bitwarden.com".to_string(), api_url:
* "https://api.bitwarden.com".to_string(), user_agent: "Bitwarden Rust-SDK".to_string(),
* device_type: DeviceType::SDK, }; let default = ClientSettings::default();
* assert_matches!(settings, default); ```
*
* Targets `localhost:8080` for debug builds.
* device_type: DeviceType::SDK, }; let default = ClientSettings::default(); ```
*/

@@ -98,3 +94,3 @@ export interface ClientSettings {

*
* Returns: [SyncResponse](bitwarden::platform::SyncResponse)
* Returns: [SyncResponse](bitwarden::vault::SyncResponse)
*/

@@ -104,3 +100,3 @@ export interface Command {

apiKeyLogin?: APIKeyLoginRequest;
accessTokenLogin?: AccessTokenLoginRequest;
loginAccessToken?: AccessTokenLoginRequest;
getUserApiKey?: SecretVerificationRequest;

@@ -111,13 +107,5 @@ fingerprint?: FingerprintRequest;

projects?: ProjectsCommand;
generators?: GeneratorsCommand;
}
/**
* Login to Bitwarden with access token
*/
export interface AccessTokenLoginRequest {
/**
* Bitwarden service API access token
*/
accessToken: string;
}
/**
* Login to Bitwarden with Api Key

@@ -149,2 +137,61 @@ */

}
/**
* Generate a password
*
* Returns: [String]
*/
export interface GeneratorsCommand {
generatePassword: PasswordGeneratorRequest;
}
/**
* Password generator request options.
*/
export interface PasswordGeneratorRequest {
/**
* When set to true, the generated password will not contain ambiguous characters. The
* ambiguous characters are: I, O, l, 0, 1
*/
avoidAmbiguous: boolean;
/**
* The length of the generated password. Note that the password length must be greater than
* the sum of all the minimums.
*/
length: number;
/**
* Include lowercase characters (a-z).
*/
lowercase: boolean;
/**
* The minimum number of lowercase characters in the generated password. When set, the value
* must be between 1 and 9. This value is ignored if lowercase is false.
*/
minLowercase?: number | null;
/**
* The minimum number of numbers in the generated password. When set, the value must be
* between 1 and 9. This value is ignored if numbers is false.
*/
minNumber?: number | null;
/**
* The minimum number of special characters in the generated password. When set, the value
* must be between 1 and 9. This value is ignored if special is false.
*/
minSpecial?: number | null;
/**
* The minimum number of uppercase characters in the generated password. When set, the value
* must be between 1 and 9. This value is ignored if uppercase is false.
*/
minUppercase?: number | null;
/**
* Include numbers (0-9).
*/
numbers: boolean;
/**
* Include special characters: ! @ # $ % ^ & *
*/
special: boolean;
/**
* Include uppercase characters (A-Z).
*/
uppercase: boolean;
}
export interface SecretVerificationRequest {

@@ -164,2 +211,12 @@ /**

/**
* Login to Bitwarden with access token
*/
export interface AccessTokenLoginRequest {
/**
* Bitwarden service API access token
*/
accessToken: string;
stateFile?: null | string;
}
/**
* Login to Bitwarden with Username and Password

@@ -175,3 +232,3 @@ */

*/
kdf: PasswordLoginKdf;
kdf: Kdf;
/**

@@ -185,8 +242,13 @@ * Bitwarden account master password

* Kdf from prelogin
*
* Key Derivation Function for Bitwarden Account
*
* In Bitwarden accounts can use multiple KDFs to derive their master key from their
* password. This Enum represents all the possible KDFs.
*/
export interface PasswordLoginKdf {
pBKDF2?: PurplePBKDF2;
argon2id?: PurpleArgon2ID;
export interface Kdf {
pBKDF2?: PBKDF2;
argon2id?: Argon2ID;
}
export interface PurpleArgon2ID {
export interface Argon2ID {
iterations: number;

@@ -196,3 +258,3 @@ memory: number;

}
export interface PurplePBKDF2 {
export interface PBKDF2 {
iterations: number;

@@ -330,2 +392,9 @@ }

* [SecretsDeleteResponse](bitwarden::secrets_manager::secrets::SecretsDeleteResponse)
*
* > Requires Authentication > Requires using an Access Token for login Retrieve the secrets
* accessible by the authenticated machine account Optionally, provide the last synced date
* to assess whether any changes have occurred If changes are detected, retrieves all the
* secrets accessible by the authenticated machine account
*
* Returns: [SecretsSyncResponse](bitwarden::secrets_manager::secrets::SecretsSyncResponse)
*/

@@ -339,2 +408,3 @@ export interface SecretsCommand {

delete?: SecretsDeleteRequest;
sync?: SecretsSyncRequest;
}

@@ -378,2 +448,12 @@ export interface SecretCreateRequest {

}
export interface SecretsSyncRequest {
/**
* Optional date time a sync last occurred
*/
lastSyncedDate?: Date | null;
/**
* Organization to sync secrets from
*/
organizationId: string;
}
export interface SecretPutRequest {

@@ -399,451 +479,2 @@ /**

}
export interface DocRef {
Cipher?: Cipher;
CipherView?: CipherView;
Collection?: Collection;
Folder?: Folder;
FolderView?: FolderView;
Send?: Send;
SendView?: SendView;
SendListView?: SendListView;
InitCryptoRequest?: InitCryptoRequest;
PasswordGeneratorRequest?: PasswordGeneratorRequest;
PassphraseGeneratorRequest?: PassphraseGeneratorRequest;
ExportFormat?: ExportFormatClass | ExportFormatEnum;
MasterPasswordPolicyOptions?: MasterPasswordPolicyOptions;
Kdf?: InitCryptoRequestKdf;
}
export interface Cipher {
attachments?: Attachment[] | null;
card?: Card | null;
collectionIds: string[];
creationDate: Date;
deletedDate?: Date | null;
edit: boolean;
favorite: boolean;
fields?: Field[] | null;
folderId?: null | string;
id?: null | string;
identity?: Identity | null;
localData?: LocalData | null;
login?: Login | null;
name: string;
notes?: null | string;
organizationId?: null | string;
organizationUseTotp: boolean;
passwordHistory?: PasswordHistory[] | null;
reprompt: CipherRepromptType;
revisionDate: Date;
secureNote?: SecureNote | null;
type: CipherType;
viewPassword: boolean;
}
export interface Attachment {
fileName?: null | string;
id?: null | string;
key?: null | string;
size?: null | string;
/**
* Readable size, ex: "4.2 KB" or "1.43 GB"
*/
sizeName?: null | string;
url?: null | string;
}
export interface Card {
brand?: null | string;
cardholderName?: null | string;
code?: null | string;
expMonth?: null | string;
expYear?: null | string;
number?: null | string;
}
export interface Field {
linkedId?: LinkedIDType | null;
name?: null | string;
type: FieldType;
value?: null | string;
}
export declare enum LinkedIDType {
Address1 = "Address1",
Address2 = "Address2",
Address3 = "Address3",
Brand = "Brand",
CardholderName = "CardholderName",
City = "City",
Code = "Code",
Company = "Company",
Country = "Country",
Email = "Email",
ExpMonth = "ExpMonth",
ExpYear = "ExpYear",
FirstName = "FirstName",
FullName = "FullName",
LastName = "LastName",
LicenseNumber = "LicenseNumber",
MiddleName = "MiddleName",
Number = "Number",
PassportNumber = "PassportNumber",
Password = "Password",
Phone = "Phone",
PostalCode = "PostalCode",
Ssn = "Ssn",
State = "State",
Title = "Title",
Username = "Username"
}
export declare enum FieldType {
Boolean = "Boolean",
Hidden = "Hidden",
Linked = "Linked",
Text = "Text"
}
export interface Identity {
address1?: null | string;
address2?: null | string;
address3?: null | string;
city?: null | string;
company?: null | string;
country?: null | string;
email?: null | string;
firstName?: null | string;
lastName?: null | string;
licenseNumber?: null | string;
middleName?: null | string;
passportNumber?: null | string;
phone?: null | string;
postalCode?: null | string;
ssn?: null | string;
state?: null | string;
title?: null | string;
username?: null | string;
}
export interface LocalData {
lastLaunched?: number | null;
lastUsedDate?: number | null;
}
export interface Login {
autofillOnPageLoad?: boolean | null;
password?: null | string;
passwordRevisionDate?: Date | null;
totp?: null | string;
uris?: LoginURI[] | null;
username?: null | string;
}
export interface LoginURI {
match?: URIMatchType | null;
uri?: null | string;
}
export declare enum URIMatchType {
Domain = "domain",
Exact = "exact",
Host = "host",
Never = "never",
RegularExpression = "regularExpression",
StartsWith = "startsWith"
}
export interface PasswordHistory {
lastUsedDate: Date;
password: string;
}
export declare enum CipherRepromptType {
None = "None",
Password = "Password"
}
export interface SecureNote {
type: SecureNoteType;
}
export declare enum SecureNoteType {
Generic = "Generic"
}
export declare enum CipherType {
Card = "Card",
Identity = "Identity",
Login = "Login",
SecureNote = "SecureNote"
}
export interface CipherView {
attachments?: AttachmentView[] | null;
card?: CardView | null;
collectionIds: string[];
creationDate: Date;
deletedDate?: Date | null;
edit: boolean;
favorite: boolean;
fields?: FieldView[] | null;
folderId?: null | string;
id?: null | string;
identity?: IdentityView | null;
localData?: LocalDataView | null;
login?: LoginView | null;
name: string;
notes?: null | string;
organizationId?: null | string;
organizationUseTotp: boolean;
passwordHistory?: PasswordHistoryView[] | null;
reprompt: CipherRepromptType;
revisionDate: Date;
secureNote?: SecureNoteView | null;
type: CipherType;
viewPassword: boolean;
}
export interface AttachmentView {
fileName?: null | string;
id?: null | string;
key?: null | string;
size?: null | string;
sizeName?: null | string;
url?: null | string;
}
export interface CardView {
brand?: null | string;
cardholderName?: null | string;
code?: null | string;
expMonth?: null | string;
expYear?: null | string;
number?: null | string;
}
export interface FieldView {
linkedId?: LinkedIDType | null;
name?: null | string;
type: FieldType;
value?: null | string;
}
export interface IdentityView {
address1?: null | string;
address2?: null | string;
address3?: null | string;
city?: null | string;
company?: null | string;
country?: null | string;
email?: null | string;
firstName?: null | string;
lastName?: null | string;
licenseNumber?: null | string;
middleName?: null | string;
passportNumber?: null | string;
phone?: null | string;
postalCode?: null | string;
ssn?: null | string;
state?: null | string;
title?: null | string;
username?: null | string;
}
export interface LocalDataView {
lastLaunched?: number | null;
lastUsedDate?: number | null;
}
export interface LoginView {
autofillOnPageLoad?: boolean | null;
password?: null | string;
passwordRevisionDate?: Date | null;
totp?: null | string;
uris?: LoginURIView[] | null;
username?: null | string;
}
export interface LoginURIView {
match?: URIMatchType | null;
uri?: null | string;
}
export interface PasswordHistoryView {
lastUsedDate: Date;
password: string;
}
export interface SecureNoteView {
type: SecureNoteType;
}
export interface Collection {
externalId?: null | string;
hidePasswords: boolean;
id: string;
name: string;
organizationId: string;
readOnly: boolean;
}
export interface ExportFormatClass {
EncryptedJson: EncryptedJSON;
}
export interface EncryptedJSON {
password: string;
[property: string]: any;
}
export declare enum ExportFormatEnum {
AccountEncryptedJSON = "AccountEncryptedJson",
CSV = "Csv",
JSON = "Json"
}
export interface Folder {
id: string;
name: string;
revisionDate: Date;
[property: string]: any;
}
export interface FolderView {
id: string;
name: string;
revisionDate: Date;
[property: string]: any;
}
export interface InitCryptoRequest {
/**
* The user's email address
*/
email: string;
/**
* The user's KDF parameters, as received from the prelogin request
*/
kdfParams: InitCryptoRequestKdf;
/**
* The encryption keys for all the organizations the user is a part of
*/
organizationKeys: {
[key: string]: string;
};
/**
* The user's master password
*/
password: string;
/**
* The user's encryptred private key
*/
privateKey: string;
/**
* The user's encrypted symmetric crypto key
*/
userKey: string;
}
/**
* The user's KDF parameters, as received from the prelogin request
*/
export interface InitCryptoRequestKdf {
pBKDF2?: FluffyPBKDF2;
argon2id?: FluffyArgon2ID;
}
export interface FluffyArgon2ID {
iterations: number;
memory: number;
parallelism: number;
}
export interface FluffyPBKDF2 {
iterations: number;
}
export interface MasterPasswordPolicyOptions {
/**
* Flag to indicate if the policy should be enforced on login. If true, and the user's
* password does not meet the policy requirements, the user will be forced to update their
* password.
*/
enforce_on_login: boolean;
min_complexity: number;
min_length: number;
require_lower: boolean;
require_numbers: boolean;
require_special: boolean;
require_upper: boolean;
[property: string]: any;
}
/**
* Passphrase generator request.
*
* The default separator is `-` and default number of words is 3.
*/
export interface PassphraseGeneratorRequest {
capitalize?: boolean | null;
includeNumber?: boolean | null;
numWords?: number | null;
wordSeparator?: null | string;
}
/**
* Password generator request. If all options are false, the default is to generate a
* password with: - lowercase - uppercase - numbers
*
* The default length is 16.
*/
export interface PasswordGeneratorRequest {
avoidAmbiguous?: boolean | null;
length?: number | null;
lowercase: boolean;
minLowercase?: boolean | null;
minNumber?: boolean | null;
minSpecial?: boolean | null;
minUppercase?: boolean | null;
numbers: boolean;
special: boolean;
uppercase: boolean;
}
export interface Send {
accessCount: number;
accessId: string;
deletionDate: Date;
disabled: boolean;
expirationDate?: Date | null;
file?: SendFile | null;
hideEmail: boolean;
id: string;
key: string;
maxAccessCount?: number | null;
name: string;
notes?: null | string;
password?: null | string;
revisionDate: Date;
text?: SendText | null;
type: SendType;
}
export interface SendFile {
fileName: string;
id: string;
size: string;
/**
* Readable size, ex: "4.2 KB" or "1.43 GB"
*/
sizeName: string;
}
export interface SendText {
hidden: boolean;
text?: null | string;
}
export declare enum SendType {
File = "File",
Text = "Text"
}
export interface SendListView {
accessId: string;
deletionDate: Date;
disabled: boolean;
expirationDate?: Date | null;
id: string;
name: string;
revisionDate: Date;
type: SendType;
}
export interface SendView {
accessCount: number;
accessId: string;
deletionDate: Date;
disabled: boolean;
expirationDate?: Date | null;
file?: SendFileView | null;
hideEmail: boolean;
id: string;
key: string;
maxAccessCount?: number | null;
name: string;
notes?: null | string;
password?: null | string;
revisionDate: Date;
text?: SendTextView | null;
type: SendType;
}
export interface SendFileView {
fileName: string;
id: string;
size: string;
/**
* Readable size, ex: "4.2 KB" or "1.43 GB"
*/
sizeName: string;
}
export interface SendTextView {
hidden: boolean;
text?: null | string;
}
export interface ResponseForAPIKeyLoginResponse {

@@ -873,38 +504,38 @@ /**

resetMasterPassword: boolean;
twoFactor?: APIKeyLoginResponseTwoFactorProviders | null;
twoFactor?: TwoFactorProviders | null;
}
export interface APIKeyLoginResponseTwoFactorProviders {
authenticator?: PurpleAuthenticator | null;
export interface TwoFactorProviders {
authenticator?: Authenticator | null;
/**
* Duo-backed 2fa
*/
duo?: PurpleDuo | null;
duo?: Duo | null;
/**
* Email 2fa
*/
email?: PurpleEmail | null;
email?: Email | null;
/**
* Duo-backed 2fa operated by an organization the user is a member of
*/
organizationDuo?: PurpleDuo | null;
organizationDuo?: Duo | null;
/**
* Presence indicates the user has stored this device as bypassing 2fa
*/
remember?: PurpleRemember | null;
remember?: Remember | null;
/**
* WebAuthn-backed 2fa
*/
webAuthn?: PurpleWebAuthn | null;
webAuthn?: WebAuthn | null;
/**
* Yubikey-backed 2fa
*/
yubiKey?: PurpleYubiKey | null;
yubiKey?: YubiKey | null;
}
export interface PurpleAuthenticator {
export interface Authenticator {
}
export interface PurpleDuo {
export interface Duo {
host: string;
signature: string;
}
export interface PurpleEmail {
export interface Email {
/**

@@ -915,7 +546,7 @@ * The email to request a 2fa TOTP for

}
export interface PurpleRemember {
export interface Remember {
}
export interface PurpleWebAuthn {
export interface WebAuthn {
}
export interface PurpleYubiKey {
export interface YubiKey {
/**

@@ -926,19 +557,2 @@ * Whether the stored yubikey supports near field communication

}
export interface ResponseForFingerprintResponse {
/**
* The response data. Populated if `success` is true.
*/
data?: FingerprintResponse | null;
/**
* A message for any error that may occur. Populated if `success` is false.
*/
errorMessage?: null | string;
/**
* Whether or not the SDK request succeeded.
*/
success: boolean;
}
export interface FingerprintResponse {
fingerprint: string;
}
export interface ResponseForPasswordLoginResponse {

@@ -977,3 +591,3 @@ /**

*/
twoFactor?: PasswordLoginResponseTwoFactorProviders | null;
twoFactor?: TwoFactorProviders | null;
}

@@ -986,56 +600,55 @@ export interface CAPTCHAResponse {

}
export interface PasswordLoginResponseTwoFactorProviders {
authenticator?: FluffyAuthenticator | null;
export interface ResponseForAccessTokenLoginResponse {
/**
* Duo-backed 2fa
* The response data. Populated if `success` is true.
*/
duo?: FluffyDuo | null;
data?: AccessTokenLoginResponse | null;
/**
* Email 2fa
* A message for any error that may occur. Populated if `success` is false.
*/
email?: FluffyEmail | null;
errorMessage?: null | string;
/**
* Duo-backed 2fa operated by an organization the user is a member of
* Whether or not the SDK request succeeded.
*/
organizationDuo?: FluffyDuo | null;
success: boolean;
}
export interface AccessTokenLoginResponse {
authenticated: boolean;
/**
* Presence indicates the user has stored this device as bypassing 2fa
* Whether or not the user is required to update their master password
*/
remember?: FluffyRemember | null;
forcePasswordReset: boolean;
/**
* WebAuthn-backed 2fa
* TODO: What does this do?
*/
webAuthn?: FluffyWebAuthn | null;
resetMasterPassword: boolean;
twoFactor?: TwoFactorProviders | null;
}
export interface ResponseForSecretIdentifiersResponse {
/**
* Yubikey-backed 2fa
* The response data. Populated if `success` is true.
*/
yubiKey?: FluffyYubiKey | null;
}
export interface FluffyAuthenticator {
}
export interface FluffyDuo {
host: string;
signature: string;
}
export interface FluffyEmail {
data?: SecretIdentifiersResponse | null;
/**
* The email to request a 2fa TOTP for
* A message for any error that may occur. Populated if `success` is false.
*/
email: string;
errorMessage?: null | string;
/**
* Whether or not the SDK request succeeded.
*/
success: boolean;
}
export interface FluffyRemember {
export interface SecretIdentifiersResponse {
data: SecretIdentifierResponse[];
}
export interface FluffyWebAuthn {
export interface SecretIdentifierResponse {
id: string;
key: string;
organizationId: string;
}
export interface FluffyYubiKey {
export interface ResponseForSecretResponse {
/**
* Whether the stored yubikey supports near field communication
*/
nfc: boolean;
}
export interface ResponseForProjectResponse {
/**
* The response data. Populated if `success` is true.
*/
data?: ProjectResponse | null;
data?: SecretResponse | null;
/**

@@ -1050,14 +663,17 @@ * A message for any error that may occur. Populated if `success` is false.

}
export interface ProjectResponse {
export interface SecretResponse {
creationDate: Date;
id: string;
name: string;
key: string;
note: string;
organizationId: string;
projectId?: null | string;
revisionDate: Date;
value: string;
}
export interface ResponseForProjectsDeleteResponse {
export interface ResponseForSecretsResponse {
/**
* The response data. Populated if `success` is true.
*/
data?: ProjectsDeleteResponse | null;
data?: SecretsResponse | null;
/**

@@ -1072,14 +688,10 @@ * A message for any error that may occur. Populated if `success` is false.

}
export interface ProjectsDeleteResponse {
data: ProjectDeleteResponse[];
export interface SecretsResponse {
data: SecretResponse[];
}
export interface ProjectDeleteResponse {
error?: null | string;
id: string;
}
export interface ResponseForProjectsResponse {
export interface ResponseForSecretsDeleteResponse {
/**
* The response data. Populated if `success` is true.
*/
data?: ProjectsResponse | null;
data?: SecretsDeleteResponse | null;
/**

@@ -1094,17 +706,14 @@ * A message for any error that may occur. Populated if `success` is false.

}
export interface ProjectsResponse {
data: DatumElement[];
export interface SecretsDeleteResponse {
data: SecretDeleteResponse[];
}
export interface DatumElement {
creationDate: Date;
export interface SecretDeleteResponse {
error?: null | string;
id: string;
name: string;
organizationId: string;
revisionDate: Date;
}
export interface ResponseForSecretIdentifiersResponse {
export interface ResponseForSecretsSyncResponse {
/**
* The response data. Populated if `success` is true.
*/
data?: SecretIdentifiersResponse | null;
data?: SecretsSyncResponse | null;
/**

@@ -1119,15 +728,11 @@ * A message for any error that may occur. Populated if `success` is false.

}
export interface SecretIdentifiersResponse {
data: SecretIdentifierResponse[];
export interface SecretsSyncResponse {
hasChanges: boolean;
secrets?: SecretResponse[] | null;
}
export interface SecretIdentifierResponse {
id: string;
key: string;
organizationId: string;
}
export interface ResponseForSecretResponse {
export interface ResponseForProjectResponse {
/**
* The response data. Populated if `success` is true.
*/
data?: SecretResponse | null;
data?: ProjectResponse | null;
/**

@@ -1142,17 +747,14 @@ * A message for any error that may occur. Populated if `success` is false.

}
export interface SecretResponse {
export interface ProjectResponse {
creationDate: Date;
id: string;
key: string;
note: string;
name: string;
organizationId: string;
projectId?: null | string;
revisionDate: Date;
value: string;
}
export interface ResponseForSecretsDeleteResponse {
export interface ResponseForProjectsResponse {
/**
* The response data. Populated if `success` is true.
*/
data?: SecretsDeleteResponse | null;
data?: ProjectsResponse | null;
/**

@@ -1167,14 +769,31 @@ * A message for any error that may occur. Populated if `success` is false.

}
export interface SecretsDeleteResponse {
data: SecretDeleteResponse[];
export interface ProjectsResponse {
data: ProjectResponse[];
}
export interface SecretDeleteResponse {
export interface ResponseForProjectsDeleteResponse {
/**
* The response data. Populated if `success` is true.
*/
data?: ProjectsDeleteResponse | null;
/**
* A message for any error that may occur. Populated if `success` is false.
*/
errorMessage?: null | string;
/**
* Whether or not the SDK request succeeded.
*/
success: boolean;
}
export interface ProjectsDeleteResponse {
data: ProjectDeleteResponse[];
}
export interface ProjectDeleteResponse {
error?: null | string;
id: string;
}
export interface ResponseForSecretsResponse {
export interface ResponseForString {
/**
* The response data. Populated if `success` is true.
*/
data?: SecretsResponse | null;
data?: null | string;
/**

@@ -1189,14 +808,18 @@ * A message for any error that may occur. Populated if `success` is false.

}
export interface SecretsResponse {
data: DatumClass[];
export interface ResponseForFingerprintResponse {
/**
* The response data. Populated if `success` is true.
*/
data?: FingerprintResponse | null;
/**
* A message for any error that may occur. Populated if `success` is false.
*/
errorMessage?: null | string;
/**
* Whether or not the SDK request succeeded.
*/
success: boolean;
}
export interface DatumClass {
creationDate: Date;
id: string;
key: string;
note: string;
organizationId: string;
projectId?: null | string;
revisionDate: Date;
value: string;
export interface FingerprintResponse {
fingerprint: string;
}

@@ -1219,5 +842,8 @@ export interface ResponseForSyncResponse {

/**
* List of ciphers accesible by the user
* List of ciphers accessible by the user
*/
ciphers: CipherDetailsResponse[];
ciphers: Cipher[];
collections: Collection[];
domains?: DomainResponse | null;
folders: Folder[];
/**

@@ -1229,4 +855,196 @@ * Data about the user, including their encryption keys and the organizations they are a

}
export interface CipherDetailsResponse {
export interface Cipher {
attachments?: Attachment[] | null;
card?: Card | null;
collectionIds: string[];
creationDate: Date;
deletedDate?: Date | null;
edit: boolean;
favorite: boolean;
fields?: Field[] | null;
folderId?: null | string;
id?: null | string;
identity?: Identity | null;
/**
* More recent ciphers uses individual encryption keys to encrypt the other fields of the
* Cipher.
*/
key?: null | string;
localData?: LocalData | null;
login?: Login | null;
name: string;
notes?: null | string;
organizationId?: null | string;
organizationUseTotp: boolean;
passwordHistory?: PasswordHistory[] | null;
reprompt: CipherRepromptType;
revisionDate: Date;
secureNote?: SecureNote | null;
type: CipherType;
viewPassword: boolean;
}
export interface Attachment {
fileName?: null | string;
id?: null | string;
key?: null | string;
size?: null | string;
/**
* Readable size, ex: "4.2 KB" or "1.43 GB"
*/
sizeName?: null | string;
url?: null | string;
}
export interface Card {
brand?: null | string;
cardholderName?: null | string;
code?: null | string;
expMonth?: null | string;
expYear?: null | string;
number?: null | string;
}
export interface Field {
linkedId?: LinkedIDType | null;
name?: null | string;
type: FieldType;
value?: null | string;
}
export declare enum LinkedIDType {
Address1 = "Address1",
Address2 = "Address2",
Address3 = "Address3",
Brand = "Brand",
CardholderName = "CardholderName",
City = "City",
Code = "Code",
Company = "Company",
Country = "Country",
Email = "Email",
ExpMonth = "ExpMonth",
ExpYear = "ExpYear",
FirstName = "FirstName",
FullName = "FullName",
LastName = "LastName",
LicenseNumber = "LicenseNumber",
MiddleName = "MiddleName",
Number = "Number",
PassportNumber = "PassportNumber",
Password = "Password",
Phone = "Phone",
PostalCode = "PostalCode",
Ssn = "Ssn",
State = "State",
Title = "Title",
Username = "Username"
}
export declare enum FieldType {
Boolean = "Boolean",
Hidden = "Hidden",
Linked = "Linked",
Text = "Text"
}
export interface Identity {
address1?: null | string;
address2?: null | string;
address3?: null | string;
city?: null | string;
company?: null | string;
country?: null | string;
email?: null | string;
firstName?: null | string;
lastName?: null | string;
licenseNumber?: null | string;
middleName?: null | string;
passportNumber?: null | string;
phone?: null | string;
postalCode?: null | string;
ssn?: null | string;
state?: null | string;
title?: null | string;
username?: null | string;
}
export interface LocalData {
lastLaunched?: number | null;
lastUsedDate?: number | null;
}
export interface Login {
autofillOnPageLoad?: boolean | null;
fido2Credentials?: Fido2Credential[] | null;
password?: null | string;
passwordRevisionDate?: Date | null;
totp?: null | string;
uris?: LoginURI[] | null;
username?: null | string;
}
export interface Fido2Credential {
counter: string;
creationDate: Date;
credentialId: string;
discoverable: string;
keyAlgorithm: string;
keyCurve: string;
keyType: string;
keyValue: string;
rpId: string;
rpName?: null | string;
userDisplayName?: null | string;
userHandle?: null | string;
userName?: null | string;
}
export interface LoginURI {
match?: URIMatchType | null;
uri?: null | string;
uriChecksum?: null | string;
}
export declare enum URIMatchType {
Domain = "domain",
Exact = "exact",
Host = "host",
Never = "never",
RegularExpression = "regularExpression",
StartsWith = "startsWith"
}
export interface PasswordHistory {
lastUsedDate: Date;
password: string;
}
export declare enum CipherRepromptType {
None = "None",
Password = "Password"
}
export interface SecureNote {
type: SecureNoteType;
}
export declare enum SecureNoteType {
Generic = "Generic"
}
export declare enum CipherType {
Card = "Card",
Identity = "Identity",
Login = "Login",
SecureNote = "SecureNote"
}
export interface Collection {
externalId?: null | string;
hidePasswords: boolean;
id?: null | string;
name: string;
organizationId: string;
readOnly: boolean;
}
export interface DomainResponse {
equivalentDomains: Array<string[]>;
globalEquivalentDomains: GlobalDomains[];
}
export interface GlobalDomains {
domains: string[];
excluded: boolean;
type: number;
[property: string]: any;
}
export interface Folder {
id?: null | string;
name: string;
revisionDate: Date;
[property: string]: any;
}
/**

@@ -1245,2 +1063,35 @@ * Data about the user, including their encryption keys and the organizations they are a

}
export declare enum LoginLinkedIDType {
Password = "Password",
Username = "Username"
}
export declare enum CardLinkedIDType {
Brand = "Brand",
CardholderName = "CardholderName",
Code = "Code",
ExpMonth = "ExpMonth",
ExpYear = "ExpYear",
Number = "Number"
}
export declare enum IdentityLinkedIDType {
Address1 = "Address1",
Address2 = "Address2",
Address3 = "Address3",
City = "City",
Company = "Company",
Country = "Country",
Email = "Email",
FirstName = "FirstName",
FullName = "FullName",
LastName = "LastName",
LicenseNumber = "LicenseNumber",
MiddleName = "MiddleName",
PassportNumber = "PassportNumber",
Phone = "Phone",
PostalCode = "PostalCode",
Ssn = "Ssn",
State = "State",
Title = "Title",
Username = "Username"
}
export interface ResponseForUserAPIKeyResponse {

@@ -1269,30 +1120,190 @@ /**

static clientSettingsToJson(value: ClientSettings): string;
static toDeviceType(json: string): DeviceType;
static deviceTypeToJson(value: DeviceType): string;
static toCommand(json: string): Command;
static commandToJson(value: Command): string;
static toDocRef(json: string): DocRef;
static docRefToJson(value: DocRef): string;
static toPasswordLoginRequest(json: string): PasswordLoginRequest;
static passwordLoginRequestToJson(value: PasswordLoginRequest): string;
static toTwoFactorRequest(json: string): TwoFactorRequest;
static twoFactorRequestToJson(value: TwoFactorRequest): string;
static toTwoFactorProvider(json: string): TwoFactorProvider;
static twoFactorProviderToJson(value: TwoFactorProvider): string;
static toKdf(json: string): Kdf;
static kdfToJson(value: Kdf): string;
static toAPIKeyLoginRequest(json: string): APIKeyLoginRequest;
static aPIKeyLoginRequestToJson(value: APIKeyLoginRequest): string;
static toAccessTokenLoginRequest(json: string): AccessTokenLoginRequest;
static accessTokenLoginRequestToJson(value: AccessTokenLoginRequest): string;
static toSecretVerificationRequest(json: string): SecretVerificationRequest;
static secretVerificationRequestToJson(value: SecretVerificationRequest): string;
static toFingerprintRequest(json: string): FingerprintRequest;
static fingerprintRequestToJson(value: FingerprintRequest): string;
static toSyncRequest(json: string): SyncRequest;
static syncRequestToJson(value: SyncRequest): string;
static toSecretsCommand(json: string): SecretsCommand;
static secretsCommandToJson(value: SecretsCommand): string;
static toSecretGetRequest(json: string): SecretGetRequest;
static secretGetRequestToJson(value: SecretGetRequest): string;
static toSecretsGetRequest(json: string): SecretsGetRequest;
static secretsGetRequestToJson(value: SecretsGetRequest): string;
static toSecretCreateRequest(json: string): SecretCreateRequest;
static secretCreateRequestToJson(value: SecretCreateRequest): string;
static toSecretIdentifiersRequest(json: string): SecretIdentifiersRequest;
static secretIdentifiersRequestToJson(value: SecretIdentifiersRequest): string;
static toSecretPutRequest(json: string): SecretPutRequest;
static secretPutRequestToJson(value: SecretPutRequest): string;
static toSecretsDeleteRequest(json: string): SecretsDeleteRequest;
static secretsDeleteRequestToJson(value: SecretsDeleteRequest): string;
static toSecretsSyncRequest(json: string): SecretsSyncRequest;
static secretsSyncRequestToJson(value: SecretsSyncRequest): string;
static toProjectsCommand(json: string): ProjectsCommand;
static projectsCommandToJson(value: ProjectsCommand): string;
static toProjectGetRequest(json: string): ProjectGetRequest;
static projectGetRequestToJson(value: ProjectGetRequest): string;
static toProjectCreateRequest(json: string): ProjectCreateRequest;
static projectCreateRequestToJson(value: ProjectCreateRequest): string;
static toProjectsListRequest(json: string): ProjectsListRequest;
static projectsListRequestToJson(value: ProjectsListRequest): string;
static toProjectPutRequest(json: string): ProjectPutRequest;
static projectPutRequestToJson(value: ProjectPutRequest): string;
static toProjectsDeleteRequest(json: string): ProjectsDeleteRequest;
static projectsDeleteRequestToJson(value: ProjectsDeleteRequest): string;
static toGeneratorsCommand(json: string): GeneratorsCommand;
static generatorsCommandToJson(value: GeneratorsCommand): string;
static toPasswordGeneratorRequest(json: string): PasswordGeneratorRequest;
static passwordGeneratorRequestToJson(value: PasswordGeneratorRequest): string;
static toResponseForAPIKeyLoginResponse(json: string): ResponseForAPIKeyLoginResponse;
static responseForAPIKeyLoginResponseToJson(value: ResponseForAPIKeyLoginResponse): string;
static toResponseForFingerprintResponse(json: string): ResponseForFingerprintResponse;
static responseForFingerprintResponseToJson(value: ResponseForFingerprintResponse): string;
static toAPIKeyLoginResponse(json: string): APIKeyLoginResponse;
static aPIKeyLoginResponseToJson(value: APIKeyLoginResponse): string;
static toTwoFactorProviders(json: string): TwoFactorProviders;
static twoFactorProvidersToJson(value: TwoFactorProviders): string;
static toAuthenticator(json: string): Authenticator;
static authenticatorToJson(value: Authenticator): string;
static toEmail(json: string): Email;
static emailToJson(value: Email): string;
static toDuo(json: string): Duo;
static duoToJson(value: Duo): string;
static toYubiKey(json: string): YubiKey;
static yubiKeyToJson(value: YubiKey): string;
static toRemember(json: string): Remember;
static rememberToJson(value: Remember): string;
static toWebAuthn(json: string): WebAuthn;
static webAuthnToJson(value: WebAuthn): string;
static toResponseForPasswordLoginResponse(json: string): ResponseForPasswordLoginResponse;
static responseForPasswordLoginResponseToJson(value: ResponseForPasswordLoginResponse): string;
static toResponseForProjectResponse(json: string): ResponseForProjectResponse;
static responseForProjectResponseToJson(value: ResponseForProjectResponse): string;
static toResponseForProjectsDeleteResponse(json: string): ResponseForProjectsDeleteResponse;
static responseForProjectsDeleteResponseToJson(value: ResponseForProjectsDeleteResponse): string;
static toResponseForProjectsResponse(json: string): ResponseForProjectsResponse;
static responseForProjectsResponseToJson(value: ResponseForProjectsResponse): string;
static toPasswordLoginResponse(json: string): PasswordLoginResponse;
static passwordLoginResponseToJson(value: PasswordLoginResponse): string;
static toCAPTCHAResponse(json: string): CAPTCHAResponse;
static cAPTCHAResponseToJson(value: CAPTCHAResponse): string;
static toResponseForAccessTokenLoginResponse(json: string): ResponseForAccessTokenLoginResponse;
static responseForAccessTokenLoginResponseToJson(value: ResponseForAccessTokenLoginResponse): string;
static toAccessTokenLoginResponse(json: string): AccessTokenLoginResponse;
static accessTokenLoginResponseToJson(value: AccessTokenLoginResponse): string;
static toResponseForSecretIdentifiersResponse(json: string): ResponseForSecretIdentifiersResponse;
static responseForSecretIdentifiersResponseToJson(value: ResponseForSecretIdentifiersResponse): string;
static toSecretIdentifiersResponse(json: string): SecretIdentifiersResponse;
static secretIdentifiersResponseToJson(value: SecretIdentifiersResponse): string;
static toSecretIdentifierResponse(json: string): SecretIdentifierResponse;
static secretIdentifierResponseToJson(value: SecretIdentifierResponse): string;
static toResponseForSecretResponse(json: string): ResponseForSecretResponse;
static responseForSecretResponseToJson(value: ResponseForSecretResponse): string;
static toSecretResponse(json: string): SecretResponse;
static secretResponseToJson(value: SecretResponse): string;
static toResponseForSecretsResponse(json: string): ResponseForSecretsResponse;
static responseForSecretsResponseToJson(value: ResponseForSecretsResponse): string;
static toSecretsResponse(json: string): SecretsResponse;
static secretsResponseToJson(value: SecretsResponse): string;
static toResponseForSecretsDeleteResponse(json: string): ResponseForSecretsDeleteResponse;
static responseForSecretsDeleteResponseToJson(value: ResponseForSecretsDeleteResponse): string;
static toResponseForSecretsResponse(json: string): ResponseForSecretsResponse;
static responseForSecretsResponseToJson(value: ResponseForSecretsResponse): string;
static toSecretsDeleteResponse(json: string): SecretsDeleteResponse;
static secretsDeleteResponseToJson(value: SecretsDeleteResponse): string;
static toSecretDeleteResponse(json: string): SecretDeleteResponse;
static secretDeleteResponseToJson(value: SecretDeleteResponse): string;
static toResponseForSecretsSyncResponse(json: string): ResponseForSecretsSyncResponse;
static responseForSecretsSyncResponseToJson(value: ResponseForSecretsSyncResponse): string;
static toSecretsSyncResponse(json: string): SecretsSyncResponse;
static secretsSyncResponseToJson(value: SecretsSyncResponse): string;
static toResponseForProjectResponse(json: string): ResponseForProjectResponse;
static responseForProjectResponseToJson(value: ResponseForProjectResponse): string;
static toProjectResponse(json: string): ProjectResponse;
static projectResponseToJson(value: ProjectResponse): string;
static toResponseForProjectsResponse(json: string): ResponseForProjectsResponse;
static responseForProjectsResponseToJson(value: ResponseForProjectsResponse): string;
static toProjectsResponse(json: string): ProjectsResponse;
static projectsResponseToJson(value: ProjectsResponse): string;
static toResponseForProjectsDeleteResponse(json: string): ResponseForProjectsDeleteResponse;
static responseForProjectsDeleteResponseToJson(value: ResponseForProjectsDeleteResponse): string;
static toProjectsDeleteResponse(json: string): ProjectsDeleteResponse;
static projectsDeleteResponseToJson(value: ProjectsDeleteResponse): string;
static toProjectDeleteResponse(json: string): ProjectDeleteResponse;
static projectDeleteResponseToJson(value: ProjectDeleteResponse): string;
static toResponseForString(json: string): ResponseForString;
static responseForStringToJson(value: ResponseForString): string;
static toResponseForFingerprintResponse(json: string): ResponseForFingerprintResponse;
static responseForFingerprintResponseToJson(value: ResponseForFingerprintResponse): string;
static toFingerprintResponse(json: string): FingerprintResponse;
static fingerprintResponseToJson(value: FingerprintResponse): string;
static toResponseForSyncResponse(json: string): ResponseForSyncResponse;
static responseForSyncResponseToJson(value: ResponseForSyncResponse): string;
static toSyncResponse(json: string): SyncResponse;
static syncResponseToJson(value: SyncResponse): string;
static toProfileResponse(json: string): ProfileResponse;
static profileResponseToJson(value: ProfileResponse): string;
static toProfileOrganizationResponse(json: string): ProfileOrganizationResponse;
static profileOrganizationResponseToJson(value: ProfileOrganizationResponse): string;
static toFolder(json: string): Folder;
static folderToJson(value: Folder): string;
static toEncString(json: string): string;
static encStringToJson(value: string): string;
static toCollection(json: string): Collection;
static collectionToJson(value: Collection): string;
static toCipher(json: string): Cipher;
static cipherToJson(value: Cipher): string;
static toCipherType(json: string): CipherType;
static cipherTypeToJson(value: CipherType): string;
static toLogin(json: string): Login;
static loginToJson(value: Login): string;
static toLoginURI(json: string): LoginURI;
static loginURIToJson(value: LoginURI): string;
static toURIMatchType(json: string): URIMatchType;
static uRIMatchTypeToJson(value: URIMatchType): string;
static toFido2Credential(json: string): Fido2Credential;
static fido2CredentialToJson(value: Fido2Credential): string;
static toIdentity(json: string): Identity;
static identityToJson(value: Identity): string;
static toCard(json: string): Card;
static cardToJson(value: Card): string;
static toSecureNote(json: string): SecureNote;
static secureNoteToJson(value: SecureNote): string;
static toSecureNoteType(json: string): SecureNoteType;
static secureNoteTypeToJson(value: SecureNoteType): string;
static toCipherRepromptType(json: string): CipherRepromptType;
static cipherRepromptTypeToJson(value: CipherRepromptType): string;
static toLocalData(json: string): LocalData;
static localDataToJson(value: LocalData): string;
static toAttachment(json: string): Attachment;
static attachmentToJson(value: Attachment): string;
static toField(json: string): Field;
static fieldToJson(value: Field): string;
static toFieldType(json: string): FieldType;
static fieldTypeToJson(value: FieldType): string;
static toLinkedIDType(json: string): LinkedIDType;
static linkedIDTypeToJson(value: LinkedIDType): string;
static toLoginLinkedIDType(json: string): LoginLinkedIDType;
static loginLinkedIDTypeToJson(value: LoginLinkedIDType): string;
static toCardLinkedIDType(json: string): CardLinkedIDType;
static cardLinkedIDTypeToJson(value: CardLinkedIDType): string;
static toIdentityLinkedIDType(json: string): IdentityLinkedIDType;
static identityLinkedIDTypeToJson(value: IdentityLinkedIDType): string;
static toPasswordHistory(json: string): PasswordHistory;
static passwordHistoryToJson(value: PasswordHistory): string;
static toDomainResponse(json: string): DomainResponse;
static domainResponseToJson(value: DomainResponse): string;
static toGlobalDomains(json: string): GlobalDomains;
static globalDomainsToJson(value: GlobalDomains): string;
static toResponseForUserAPIKeyResponse(json: string): ResponseForUserAPIKeyResponse;
static responseForUserAPIKeyResponseToJson(value: ResponseForUserAPIKeyResponse): string;
static toUserAPIKeyResponse(json: string): UserAPIKeyResponse;
static userAPIKeyResponseToJson(value: UserAPIKeyResponse): string;
}
{
"name": "@bitwarden/sdk-napi",
"version": "0.3.1",
"version": "1.0.0",
"homepage": "https://github.com/bitwarden/sdk#readme",

@@ -32,5 +32,4 @@ "bugs": {

"devDependencies": {
"@napi-rs/cli": "^2.13.2",
"ts-node": "10.9.1",
"typescript": "^5.0.0"
"@napi-rs/cli": "2.18.4",
"typescript": "5.5.4"
},

@@ -53,7 +52,7 @@ "engines": {

"optionalDependencies": {
"@bitwarden/sdk-napi-win32-x64-msvc": "0.3.1",
"@bitwarden/sdk-napi-darwin-x64": "0.3.1",
"@bitwarden/sdk-napi-linux-x64-gnu": "0.3.1",
"@bitwarden/sdk-napi-darwin-arm64": "0.3.1"
"@bitwarden/sdk-napi-win32-x64-msvc": "1.0.0",
"@bitwarden/sdk-napi-darwin-x64": "1.0.0",
"@bitwarden/sdk-napi-linux-x64-gnu": "1.0.0",
"@bitwarden/sdk-napi-darwin-arm64": "1.0.0"
}
}

@@ -20,10 +20,8 @@ ## Bitwarden Secrets Manager SDK

const accessToken = "-- REDACTED --";
const stateFile = "some/path/to/state/file";
const client = new BitwardenClient(settings, LogLevel.Info);
// Authenticating using a service accounts access token
const result = await client.loginWithAccessToken(accessToken);
if (!result.success) {
throw Error("Authentication failed");
}
// Authenticating using a machine account access token
await client.auth().loginAccessToken(accessToken, stateFile);

@@ -30,0 +28,0 @@ // List secrets

BITWARDEN SOFTWARE DEVELOPMENT KIT LICENSE AGREEMENT
Version 1, 17 March 2023
1. Introduction
1.1 The Bitwarden Software Development Kit (referred to in the License Agreement
as the "SDK" and available for download at the following URL
https://github.com/bitwarden/sdk) is licensed to you subject to the terms of
this License Agreement. The License Agreement forms a legally binding contract
between you and the Company in relation to your use of the SDK.
1.2 "Bitwarden" means the Bitwarden software made available by the Company,
available for download at the following URL, as updated from time to time.
1.3 A "Compatible Application" means any software program or service that (i)
connects to and interoperates with a current version of the Bitwarden server
products distributed by the Company; and (ii) complies with the Company’s
acceptable use policy available at the following URL:
https://bitwarden.com/terms/#acceptable_use.
1.4 "Company" means Bitwarden Inc., organized under the laws of the State of
Delaware.
2. Accepting this License Agreement
2.1 In order to access or use the SDK, you must first agree to the License
Agreement. You may not access or use the SDK if you do not accept the License
Agreement.
2.2 By clicking to accept and/or accessing or using the SDK, you hereby agree to
the terms of the License Agreement.
2.3 You may not access or use the SDK and may not accept the License Agreement
if you are a person barred from receiving the SDK under the laws of the United
States or other countries, including the country in which you are resident or
from which you access or use the SDK.
2.4 If you are agreeing to be bound by the License Agreement on behalf of your
employer or any other entity, you represent and warrant that you have full legal
authority to bind your employer or such other entity to the License Agreement.
If you do not have the requisite authority, you may not accept the License
Agreement or you may not access or use the SDK on behalf of your employer or
other entity.
3. SDK License from Bitwarden
3.1 Subject to the terms of this License Agreement, Bitwarden grants you a
limited, worldwide, royalty-free, non-assignable, non-exclusive, and
non-sublicensable license to use the SDK solely (a) to develop, test, and
demonstrate a Compatible Application; (b) to develop, test, and run a Compatible
Application for personal use by your family; or (c) to to develop, test, and run
a Compatible Application for the internal business operations of your
organization in connection with a paid license for a Bitwarden server product,
provided that in no case above may the Compatible Application be offered,
licensed, or sold to a third party.
3.2 You agree that Bitwarden or third parties own all legal right, title and
interest in and to the SDK, including any Intellectual Property Rights that
subsist in the SDK. "Intellectual Property Rights" means any and all rights
under patent law, copyright law, trade secret law, trademark law, and any and
all other proprietary rights. Bitwarden reserves all rights not expressly
granted to you.
3.3 You may not use this SDK to develop applications for use with software other
than Bitwarden (including non-compatible implementations of Bitwarden) or to
develop another SDK.
3.4 You may not use the SDK for any purpose not expressly permitted by the
License Agreement. Except for contributions to Bitwarden pursuant to the
Contribution License Agreement available at this URL:
https://cla-assistant.io/bitwarden/clients, or to the extent required by
applicable third party licenses, you may not copy modify, adapt, redistribute,
decompile, reverse engineer, disassemble, or create derivative works of the SDK
or any part of the SDK.
3.5 Use, reproduction, and distribution of a component of the SDK licensed under
an open source software license are governed solely by the terms of that open
source software license and not the License Agreement.
3.6 You agree that the form and nature of the SDK that the Company provides may
change without prior notice to you and that future versions of the SDK may be
incompatible with applications developed on previous versions of the SDK. You
agree that the Company may stop (permanently or temporarily) providing the SDK
or any features within the SDK to you or to users generally at the Company’s
sole discretion, without prior notice to you.
3.7 Nothing in the License Agreement gives you a right to use any of the
Company’s trade names, trademarks, service marks, logos, domain names, or other
distinctive brand features.
3.8 You agree that you will not remove, obscure, or alter any proprietary rights
notices (including copyright and trademark notices) that may be affixed to or
contained within the SDK.
4. Use of the SDK by You
4.1 The Company agrees that it obtains no right, title, or interest from you (or
your licensors) under the License Agreement in or to any software applications
that you develop using the SDK, including any Intellectual Property Rights that
subsist in those applications.
4.2 You agree to use the SDK and write applications only for purposes that are
permitted by (a) the License Agreement and (b) any applicable law, regulation or
generally accepted practices or guidelines in the relevant jurisdictions
(including any laws regarding the export of data or software to and from the
United States or other relevant countries).
4.3 You agree that if you use the SDK to develop applications for other users,
you will protect the privacy and legal rights of those users. If the users
provide you with user names, passwords, or other login information or personal
information, you must make the users aware that the information will be
available to your application, and you must provide legally adequate privacy
notice and protection for those users. If your application stores personal or
sensitive information provided by users, it must do so securely. If the user
provides your application with Bitwarden Account information, your application
may only use that information to access the user's Bitwarden Account when, and
for the limited purposes for which, the user has given you permission to do so.
4.4 You agree that you will not engage in any activity with the SDK, including
the development or distribution of an application, that interferes with,
disrupts, damages, or accesses in an unauthorized manner the servers, networks,
or other properties or services of any third party including, but not limited
to, the Company, or any mobile communications carrier or public cloud service.
4.5 If you use the SDK to retrieve a user's data from Bitwarden, you acknowledge
and agree that you shall retrieve data only with the user's explicit consent and
only when, and for the limited purposes for which, the user has given you
permission to do so.
4.6 You agree that you are solely responsible for, and that the Company has no
responsibility to you or to any third party for, any data, content, or resources
that you create, transmit or display through Bitwarden and/or applications for
Bitwarden, and for the consequences of your actions (including any loss or
damage which Bitwarden may suffer) by doing so.
4.7 You agree that you are solely responsible for, and that the Company has no
responsibility to you or to any third party for, any breach of your obligations
under the License Agreement, any applicable third party contract or Terms of
Service, or any applicable law or regulation, and for the consequences
(including any loss or damage which the Company or any third party may suffer)
of any such breach.
5. Third Party Applications
5.1 If you use the SDK to integrate or run applications developed by a third
party or that access data, content or resources provided by a third party, you
agree that the Company is not responsible for those applications, data, content,
or resources. You understand that all data, content or resources which you may
access through such third party applications are the sole responsibility of the
person from which they originated and that the Company is not liable for any
loss or damage that you may experience as a result of the use or access of any
of those third party applications, data, content, or resources.
5.2 You should be aware that the data, content, and resources presented to you
through such a third party application may be protected by intellectual property
rights which are owned by the providers (or by other persons or companies on
their behalf). You acknowledge that your use of such third party applications,
data, content, or resources may be subject to separate terms between you and the
relevant third party. In that case, the License Agreement does not affect your
legal relationship with these third parties.
6. Use of Bitwarden Server
You acknowledge and agree that the Bitwarden server products to which any
Compatible Application must connect is protected by intellectual property rights
which are owned by the Company and your use of the Bitwarden server products is
subject to additional terms not set forth in this License Agreement.
7. Terminating this License Agreement
7.1 The License Agreement will continue to apply until terminated by either you
or the Company as set out below.
7.2 If you want to terminate the License Agreement, you may do so by ceasing
your use of the SDK and any relevant developer credentials.
7.3 The Company may at any time, terminate the License Agreement with you if:
(a) you have breached any provision of the License Agreement; or
(b) the Company is required to do so by law; or
(c) a third party with whom the Company offered certain parts of the SDK to you
has terminated its relationship with the Company or ceased to offer certain
parts of the SDK to either the Company or to you; or
(d) the Company decides to no longer provide the SDK or certain parts of the SDK
to users in the country in which you are resident or from which you use the
service, or the provision of the SDK or certain SDK services to you by the
Company is, in the Company’'s sole discretion, no longer commercially viable or
technically practicable.
7.4 When the License Agreement comes to an end, all of the legal rights,
obligations and liabilities that you and the Company have benefited from, been
subject to (or which have accrued over time whilst the License Agreement has
been in force) or which are expressed to continue indefinitely, shall be
unaffected by this cessation, and the provisions of paragraph 12.8 shall
continue to apply to such rights, obligations and liabilities indefinitely.
8. NO SUPPORT
The Company is not obligated under this License Agreement to provide you any
support services for the SDK. Any support provided is at the Company’s sole
discretion and provided on an "as is" basis and without warranty of any kind.
9. DISCLAIMER OF WARRANTIES
9.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT YOUR USE OF THE SDK IS AT YOUR SOLE
RISK AND THAT THE SDK IS PROVIDED "AS IS" AND "AS AVAILABLE" WITHOUT WARRANTY OF
ANY KIND FROM Bitwarden.
9.2 YOUR USE OF THE SDK AND ANY MATERIAL DOWNLOADED OR OTHERWISE OBTAINED
THROUGH THE USE OF THE SDK IS AT YOUR OWN DISCRETION AND RISK AND YOU ARE SOLELY
RESPONSIBLE FOR ANY DAMAGE TO YOUR COMPUTER SYSTEM OR OTHER DEVICE OR LOSS OF
DATA THAT RESULTS FROM SUCH USE.
9.3 THE COMPANY FURTHER EXPRESSLY DISCLAIMS ALL WARRANTIES AND CONDITIONS OF ANY
KIND, WHETHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO THE IMPLIED
WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
AND NON-INFRINGEMENT.
10. LIMITATION OF LIABILITY
YOU EXPRESSLY UNDERSTAND AND AGREE THAT THE COMPANY, ITS SUBSIDIARIES AND
AFFILIATES, AND ITS LICENSORS SHALL NOT BE LIABLE TO YOU UNDER ANY THEORY OF
LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL,
STATUTORY, OR EXEMPLARY DAMAGES THAT MAY BE INCURRED BY YOU, INCLUDING ANY LOSS
OF DATA, WHETHER OR NOT THE COMPANY OR ITS REPRESENTATIVES HAVE BEEN ADVISED OF
OR SHOULD HAVE BEEN AWARE OF THE POSSIBILITY OF ANY SUCH LOSSES ARISING.
11. Indemnification
To the maximum extent permitted by law, you agree to defend, indemnify and hold
harmless the Company, its affiliates and their respective directors, officers,
employees and agents from and against any and all claims, actions, suits or
proceedings, as well as any and all losses, liabilities, damages, costs and
expenses (including reasonable attorneys fees) arising out of or accruing from
(a) your use of the SDK, (b) any application you develop on the SDK that
infringes any copyright, trademark, trade secret, trade dress, patent or other
intellectual property right of any person or defames any person or violates
their rights of publicity or privacy, and (c) any non-compliance by you with the
License Agreement.
12. General Legal Terms
12.1 The Company may make changes to the License Agreement as it distributes new
versions of the SDK. When these changes are made, the Company will make a new
version of the License Agreement available on the website where the SDK is made
available.
12.2 The License Agreement constitutes the whole legal agreement between you and
the Company and governs your use of the SDK (excluding any services or software
which the Company may provide to you under a separate written agreement), and
completely replaces any prior agreements between you and the Company in relation
to the SDK.
12.3 You agree that if the Company does not exercise or enforce any legal right
or remedy which is contained in the License Agreement (or which the Company has
the benefit of under any applicable law), this will not be taken to be a formal
waiver of the Company's rights and that those rights or remedies will still be
available to the Company.
12.4 If any court of law, having the jurisdiction to decide on this matter,
rules that any provision of the License Agreement is invalid, then that
provision will be removed from the License Agreement without affecting the rest
of the License Agreement. The remaining provisions of the License Agreement will
continue to be valid and enforceable.
12.5 You acknowledge and agree that each member of the group of companies of
which the Company is the parent shall be third party beneficiaries to the
License Agreement and that such other companies shall be entitled to directly
enforce, and rely upon, any provision of the License Agreement that confers a
benefit on them or rights in favor of them. Other than this, no other person or
company shall be third party beneficiaries to the License Agreement.
12.6 EXPORT RESTRICTIONS. THE SDK IS SUBJECT TO UNITED STATES EXPORT LAWS AND
REGULATIONS. YOU MUST COMPLY WITH ALL DOMESTIC AND INTERNATIONAL EXPORT LAWS AND
REGULATIONS THAT APPLY TO THE SDK. THESE LAWS INCLUDE RESTRICTIONS ON
DESTINATIONS, END USERS, AND END USE.
12.7 The rights granted in the License Agreement may not be assigned or
transferred by either you or the Company without the prior written approval of
the other party, provided that the Company may assign this License Agreement
upon notice to you in connection with an acquisition, merger, sale of assets, or
similar corporate change in control for the Company or the Intellectual Property
Rights in the SDK.
12.8 The License Agreement, and any dispute relating to or arising out of this
License Agreement, shall be governed by the laws of the State of California
without regard to its conflict of laws provisions. You and the Company agree to
submit to the exclusive jurisdiction of the courts located within the county of
Los Angeles, California to resolve any dispute or legal matter arising from the
License Agreement. Notwithstanding this, you agree that the Company shall be
allowed to apply for injunctive remedies, or any equivalent type of urgent legal
relief, in any forum or jurisdiction.

Sorry, the diff of this file is too big to display