mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 08:13:42 +00:00
Setup Webpack & TypeScript (#316)
* TypeScript and WebPack. * Minor cleanup. * Add background.js as entry point to webpack. * Use downloaded fonts for better performance. Remove google-fonts-webpack-plugin. * Add the remaining entry points and setup notification bar. * Update readme for webpack. * Convert CipherItems to TypeScript to demonstrate how a component looks in TS. * Fix edge requirering a custom angular version. * Rewrite gulp tasks for packaging releases. * Re-add the webpack gulp plugin. * Remove unessesary line in analytics.
This commit is contained in:
committed by
Kyle Spearrin
parent
e57f3fe5f0
commit
59754cd530
@@ -1,4 +1,4 @@
|
||||
var CipherRequest = function (cipher) {
|
||||
window.CipherRequest = function (cipher) {
|
||||
this.type = cipher.type;
|
||||
this.folderId = cipher.folderId;
|
||||
this.organizationId = cipher.organizationId;
|
||||
@@ -69,11 +69,11 @@
|
||||
}
|
||||
};
|
||||
|
||||
var FolderRequest = function (folder) {
|
||||
window.FolderRequest = function (folder) {
|
||||
this.name = folder.name ? folder.name.encryptedString : null;
|
||||
};
|
||||
|
||||
var TokenRequest = function (email, masterPasswordHash, provider, token, remember, device) {
|
||||
window.TokenRequest = function (email, masterPasswordHash, provider, token, remember, device) {
|
||||
this.email = email;
|
||||
this.masterPasswordHash = masterPasswordHash;
|
||||
this.token = token;
|
||||
@@ -85,7 +85,7 @@ var TokenRequest = function (email, masterPasswordHash, provider, token, remembe
|
||||
}
|
||||
};
|
||||
|
||||
TokenRequest.prototype.toIdentityToken = function () {
|
||||
window.TokenRequest.prototype.toIdentityToken = function () {
|
||||
var obj = {
|
||||
grant_type: 'password',
|
||||
username: this.email,
|
||||
@@ -110,7 +110,7 @@ TokenRequest.prototype.toIdentityToken = function () {
|
||||
return obj;
|
||||
};
|
||||
|
||||
var RegisterRequest = function (email, masterPasswordHash, masterPasswordHint, key) {
|
||||
window.RegisterRequest = function (email, masterPasswordHash, masterPasswordHint, key) {
|
||||
this.name = null;
|
||||
this.email = email;
|
||||
this.masterPasswordHash = masterPasswordHash;
|
||||
@@ -118,20 +118,20 @@ var RegisterRequest = function (email, masterPasswordHash, masterPasswordHint, k
|
||||
this.key = key;
|
||||
};
|
||||
|
||||
var PasswordHintRequest = function (email) {
|
||||
window.PasswordHintRequest = function (email) {
|
||||
this.email = email;
|
||||
};
|
||||
|
||||
var TwoFactorEmailRequest = function (email, masterPasswordHash) {
|
||||
window.TwoFactorEmailRequest = function (email, masterPasswordHash) {
|
||||
this.email = email;
|
||||
this.masterPasswordHash = masterPasswordHash;
|
||||
};
|
||||
|
||||
var DeviceTokenRequest = function () {
|
||||
window.DeviceTokenRequest = function () {
|
||||
this.pushToken = null;
|
||||
};
|
||||
|
||||
var DeviceRequest = function (appId, utilsService) {
|
||||
window.DeviceRequest = function (appId, utilsService) {
|
||||
this.type = utilsService.getDeviceType();
|
||||
this.name = utilsService.getBrowser();
|
||||
this.identifier = appId;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
var CipherResponse = function (response) {
|
||||
window.CipherResponse = function (response) {
|
||||
this.id = response.Id;
|
||||
this.organizationId = response.OrganizationId;
|
||||
this.folderId = response.FolderId;
|
||||
@@ -17,13 +17,13 @@ var CipherResponse = function (response) {
|
||||
}
|
||||
};
|
||||
|
||||
var FolderResponse = function (response) {
|
||||
window.FolderResponse = function (response) {
|
||||
this.id = response.Id;
|
||||
this.name = response.Name;
|
||||
this.revisionDate = response.RevisionDate;
|
||||
};
|
||||
|
||||
var ProfileResponse = function (response) {
|
||||
window.ProfileResponse = function (response) {
|
||||
this.id = response.Id;
|
||||
this.name = response.Name;
|
||||
this.email = response.Email;
|
||||
@@ -44,12 +44,12 @@ var ProfileResponse = function (response) {
|
||||
}
|
||||
};
|
||||
|
||||
var KeysResponse = function (response) {
|
||||
window.KeysResponse = function (response) {
|
||||
this.privateKey = response.PrivateKey;
|
||||
this.publicKey = response.PublicKey;
|
||||
};
|
||||
|
||||
var ProfileOrganizationResponse = function (response) {
|
||||
window.ProfileOrganizationResponse = function (response) {
|
||||
this.id = response.Id;
|
||||
this.name = response.Name;
|
||||
this.useGroups = response.UseGroups;
|
||||
@@ -63,7 +63,7 @@ var ProfileOrganizationResponse = function (response) {
|
||||
this.type = response.Type;
|
||||
};
|
||||
|
||||
var AttachmentResponse = function (response) {
|
||||
window.AttachmentResponse = function (response) {
|
||||
this.id = response.Id;
|
||||
this.url = response.Url;
|
||||
this.fileName = response.FileName;
|
||||
@@ -71,7 +71,7 @@ var AttachmentResponse = function (response) {
|
||||
this.sizeName = response.SizeName;
|
||||
};
|
||||
|
||||
var IdentityTokenResponse = function (response) {
|
||||
window.IdentityTokenResponse = function (response) {
|
||||
this.accessToken = response.access_token;
|
||||
this.expiresIn = response.expires_in;
|
||||
this.refreshToken = response.refresh_token;
|
||||
@@ -82,11 +82,11 @@ var IdentityTokenResponse = function (response) {
|
||||
this.twoFactorToken = response.TwoFactorToken;
|
||||
};
|
||||
|
||||
var ListResponse = function (data) {
|
||||
window.ListResponse = function (data) {
|
||||
this.data = data;
|
||||
};
|
||||
|
||||
var ErrorResponse = function (response, identityResponse) {
|
||||
window.ErrorResponse = function (response, identityResponse) {
|
||||
var errorModel = null;
|
||||
if (identityResponse && identityResponse === true && response.responseJSON && response.responseJSON.ErrorModel) {
|
||||
errorModel = response.responseJSON.ErrorModel;
|
||||
@@ -105,7 +105,7 @@ var ErrorResponse = function (response, identityResponse) {
|
||||
this.statusCode = response.status;
|
||||
};
|
||||
|
||||
var DeviceResponse = function (response) {
|
||||
window.DeviceResponse = function (response) {
|
||||
this.id = response.Id;
|
||||
this.name = response.Name;
|
||||
this.identifier = response.Identifier;
|
||||
@@ -113,7 +113,7 @@ var DeviceResponse = function (response) {
|
||||
this.creationDate = response.CreationDate;
|
||||
};
|
||||
|
||||
var CipherHistoryResponse = function (response) {
|
||||
window.CipherHistoryResponse = function (response) {
|
||||
this.revised = [];
|
||||
|
||||
var revised = response.Revised;
|
||||
@@ -124,7 +124,7 @@ var CipherHistoryResponse = function (response) {
|
||||
this.deleted = response.Deleted;
|
||||
};
|
||||
|
||||
var DomainsResponse = function (response) {
|
||||
window.DomainsResponse = function (response) {
|
||||
var GlobalDomainResponse = function (response) {
|
||||
this.type = response.Type;
|
||||
this.domains = response.Domains;
|
||||
@@ -143,7 +143,7 @@ var DomainsResponse = function (response) {
|
||||
}
|
||||
};
|
||||
|
||||
var SyncResponse = function (response) {
|
||||
window.SyncResponse = function (response) {
|
||||
if (response.Profile) {
|
||||
this.profile = new ProfileResponse(response.Profile);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user