diff --git a/.yarn/cache/@standardnotes-common-npm-1.32.0-9a02bcfd46-52d33f385e.zip b/.yarn/cache/@standardnotes-common-npm-1.36.1-8fadd25f7f-4f2367d461.zip similarity index 66% rename from .yarn/cache/@standardnotes-common-npm-1.32.0-9a02bcfd46-52d33f385e.zip rename to .yarn/cache/@standardnotes-common-npm-1.36.1-8fadd25f7f-4f2367d461.zip index b53a63432..b806c765e 100644 Binary files a/.yarn/cache/@standardnotes-common-npm-1.32.0-9a02bcfd46-52d33f385e.zip and b/.yarn/cache/@standardnotes-common-npm-1.36.1-8fadd25f7f-4f2367d461.zip differ diff --git a/packages/api/package.json b/packages/api/package.json index c606befa4..ad9213772 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -36,7 +36,7 @@ "typescript": "*" }, "dependencies": { - "@standardnotes/common": "^1.32.0", + "@standardnotes/common": "^1.36.1", "@standardnotes/encryption": "workspace:*", "@standardnotes/models": "workspace:*", "@standardnotes/responses": "workspace:*", diff --git a/packages/api/src/Domain/Client/Workspace/WorkspaceApiService.spec.ts b/packages/api/src/Domain/Client/Workspace/WorkspaceApiService.spec.ts index 0cfeab6f3..d8dd50940 100644 --- a/packages/api/src/Domain/Client/Workspace/WorkspaceApiService.spec.ts +++ b/packages/api/src/Domain/Client/Workspace/WorkspaceApiService.spec.ts @@ -1,3 +1,4 @@ +import { WorkspaceType } from '@standardnotes/common' import { WorkspaceCreationResponse } from '../../Response/Workspace/WorkspaceCreationResponse' import { WorkspaceServerInterface } from '../../Server/Workspace/WorkspaceServerInterface' @@ -18,6 +19,7 @@ describe('WorkspaceApiService', () => { it('should create a workspace', async () => { const response = await createService().createWorkspace({ + workspaceType: WorkspaceType.Private, encryptedPrivateKey: 'foo', encryptedWorkspaceKey: 'bar', publicKey: 'buzz', @@ -44,6 +46,7 @@ describe('WorkspaceApiService', () => { let error = null try { await service.createWorkspace({ + workspaceType: WorkspaceType.Private, encryptedPrivateKey: 'foo', encryptedWorkspaceKey: 'bar', publicKey: 'buzz', @@ -63,6 +66,7 @@ describe('WorkspaceApiService', () => { let error = null try { await createService().createWorkspace({ + workspaceType: WorkspaceType.Private, encryptedPrivateKey: 'foo', encryptedWorkspaceKey: 'bar', publicKey: 'buzz', diff --git a/packages/api/src/Domain/Client/Workspace/WorkspaceApiService.ts b/packages/api/src/Domain/Client/Workspace/WorkspaceApiService.ts index 24be4e16d..c96b21e8a 100644 --- a/packages/api/src/Domain/Client/Workspace/WorkspaceApiService.ts +++ b/packages/api/src/Domain/Client/Workspace/WorkspaceApiService.ts @@ -6,6 +6,8 @@ import { WorkspaceServerInterface } from '../../Server/Workspace/WorkspaceServer import { WorkspaceApiServiceInterface } from './WorkspaceApiServiceInterface' import { WorkspaceApiOperations } from './WorkspaceApiOperations' +import { WorkspaceType } from '@standardnotes/common' + export class WorkspaceApiService implements WorkspaceApiServiceInterface { private operationsInProgress: Map @@ -14,9 +16,10 @@ export class WorkspaceApiService implements WorkspaceApiServiceInterface { } async createWorkspace(dto: { - encryptedWorkspaceKey: string - encryptedPrivateKey: string - publicKey: string + workspaceType: WorkspaceType, + encryptedWorkspaceKey?: string + encryptedPrivateKey?: string + publicKey?: string workspaceName?: string }): Promise { if (this.operationsInProgress.get(WorkspaceApiOperations.Creating)) { @@ -27,6 +30,7 @@ export class WorkspaceApiService implements WorkspaceApiServiceInterface { try { const response = await this.workspaceServer.createWorkspace({ + workspaceType: dto.workspaceType, encryptedPrivateKey: dto.encryptedPrivateKey, encryptedWorkspaceKey: dto.encryptedWorkspaceKey, publicKey: dto.publicKey, diff --git a/packages/api/src/Domain/Client/Workspace/WorkspaceApiServiceInterface.ts b/packages/api/src/Domain/Client/Workspace/WorkspaceApiServiceInterface.ts index 3c3ce5cfc..ef598dc5f 100644 --- a/packages/api/src/Domain/Client/Workspace/WorkspaceApiServiceInterface.ts +++ b/packages/api/src/Domain/Client/Workspace/WorkspaceApiServiceInterface.ts @@ -1,10 +1,13 @@ +import { WorkspaceType } from '@standardnotes/common' + import { WorkspaceCreationResponse } from '../../Response' export interface WorkspaceApiServiceInterface { createWorkspace(dto: { - encryptedWorkspaceKey: string - encryptedPrivateKey: string - publicKey: string + workspaceType: WorkspaceType + encryptedWorkspaceKey?: string + encryptedPrivateKey?: string + publicKey?: string workspaceName?: string }): Promise } diff --git a/packages/api/src/Domain/Request/Workspace/WorkspaceCreationRequestParams.ts b/packages/api/src/Domain/Request/Workspace/WorkspaceCreationRequestParams.ts index 94ed0b93a..b44a10b46 100644 --- a/packages/api/src/Domain/Request/Workspace/WorkspaceCreationRequestParams.ts +++ b/packages/api/src/Domain/Request/Workspace/WorkspaceCreationRequestParams.ts @@ -1,7 +1,10 @@ +import { WorkspaceType } from '@standardnotes/common' + export type WorkspaceCreationRequestParams = { - encryptedWorkspaceKey: string - encryptedPrivateKey: string - publicKey: string + workspaceType: WorkspaceType + encryptedWorkspaceKey?: string + encryptedPrivateKey?: string + publicKey?: string workspaceName?: string [additionalParam: string]: unknown } diff --git a/packages/encryption/package.json b/packages/encryption/package.json index a5b496972..a45242e31 100644 --- a/packages/encryption/package.json +++ b/packages/encryption/package.json @@ -35,7 +35,7 @@ "typescript": "*" }, "dependencies": { - "@standardnotes/common": "^1.32.0", + "@standardnotes/common": "^1.36.1", "@standardnotes/models": "workspace:*", "@standardnotes/responses": "workspace:*", "@standardnotes/sncrypto-common": "workspace:*", diff --git a/packages/features/package.json b/packages/features/package.json index 857611ef8..327964642 100644 --- a/packages/features/package.json +++ b/packages/features/package.json @@ -26,7 +26,7 @@ }, "dependencies": { "@standardnotes/auth": "^3.19.4", - "@standardnotes/common": "^1.32.0", + "@standardnotes/common": "^1.36.1", "@standardnotes/security": "^1.2.0", "reflect-metadata": "^0.1.13" }, diff --git a/packages/filepicker/package.json b/packages/filepicker/package.json index 2b4cd3d77..7a6345ae8 100644 --- a/packages/filepicker/package.json +++ b/packages/filepicker/package.json @@ -31,7 +31,7 @@ "ts-node": "^10.5.0" }, "dependencies": { - "@standardnotes/common": "^1.32.0", + "@standardnotes/common": "^1.36.1", "@standardnotes/files": "workspace:*", "@standardnotes/utils": "workspace:*", "@types/wicg-file-system-access": "^2020.9.5", diff --git a/packages/files/package.json b/packages/files/package.json index 8a6b5195c..4c685c657 100644 --- a/packages/files/package.json +++ b/packages/files/package.json @@ -30,7 +30,7 @@ "ts-jest": "^28.0.5" }, "dependencies": { - "@standardnotes/common": "^1.32.0", + "@standardnotes/common": "^1.36.1", "@standardnotes/encryption": "workspace:*", "@standardnotes/models": "workspace:*", "@standardnotes/responses": "workspace:*", diff --git a/packages/models/package.json b/packages/models/package.json index 8a61ceca5..80cd5e586 100644 --- a/packages/models/package.json +++ b/packages/models/package.json @@ -31,7 +31,7 @@ "typescript": "*" }, "dependencies": { - "@standardnotes/common": "^1.32.0", + "@standardnotes/common": "^1.36.1", "@standardnotes/features": "workspace:*", "@standardnotes/responses": "workspace:*", "@standardnotes/utils": "workspace:*", diff --git a/packages/responses/package.json b/packages/responses/package.json index 47c5c5852..7e85c9208 100644 --- a/packages/responses/package.json +++ b/packages/responses/package.json @@ -31,7 +31,7 @@ "ts-jest": "^28.0.5" }, "dependencies": { - "@standardnotes/common": "^1.32.0", + "@standardnotes/common": "^1.36.1", "@standardnotes/features": "workspace:*", "@standardnotes/security": "^1.1.0", "reflect-metadata": "^0.1.13" diff --git a/packages/services/package.json b/packages/services/package.json index e6f0e7363..b665dd49c 100644 --- a/packages/services/package.json +++ b/packages/services/package.json @@ -26,7 +26,7 @@ "dependencies": { "@standardnotes/api": "workspace:^", "@standardnotes/auth": "^3.19.4", - "@standardnotes/common": "^1.32.0", + "@standardnotes/common": "^1.36.1", "@standardnotes/encryption": "workspace:^", "@standardnotes/files": "workspace:^", "@standardnotes/models": "workspace:^", diff --git a/packages/services/src/Domain/Workspace/WorkspaceClientInterface.ts b/packages/services/src/Domain/Workspace/WorkspaceClientInterface.ts index b1036912b..3ff2b8c76 100644 --- a/packages/services/src/Domain/Workspace/WorkspaceClientInterface.ts +++ b/packages/services/src/Domain/Workspace/WorkspaceClientInterface.ts @@ -1,8 +1,11 @@ +import { WorkspaceType } from '@standardnotes/common' + export interface WorkspaceClientInterface { createWorkspace(dto: { - encryptedWorkspaceKey: string - encryptedPrivateKey: string - publicKey: string + workspaceType: WorkspaceType + encryptedWorkspaceKey?: string + encryptedPrivateKey?: string + publicKey?: string workspaceName?: string }): Promise<{ uuid: string } | null> } diff --git a/packages/services/src/Domain/Workspace/WorkspaceManager.ts b/packages/services/src/Domain/Workspace/WorkspaceManager.ts index 460c5a7ec..6889476b7 100644 --- a/packages/services/src/Domain/Workspace/WorkspaceManager.ts +++ b/packages/services/src/Domain/Workspace/WorkspaceManager.ts @@ -1,4 +1,6 @@ import { WorkspaceApiServiceInterface } from '@standardnotes/api' +import { WorkspaceType } from '@standardnotes/common' + import { InternalEventBusInterface } from '../Internal/InternalEventBusInterface' import { AbstractService } from '../Service/AbstractService' import { WorkspaceClientInterface } from './WorkspaceClientInterface' @@ -12,9 +14,10 @@ export class WorkspaceManager extends AbstractService implements WorkspaceClient } async createWorkspace(dto: { - encryptedWorkspaceKey: string - encryptedPrivateKey: string - publicKey: string + workspaceType: WorkspaceType, + encryptedWorkspaceKey?: string + encryptedPrivateKey?: string + publicKey?: string workspaceName?: string }): Promise<{ uuid: string } | null> { try { diff --git a/packages/snjs/package.json b/packages/snjs/package.json index 0f778e885..2f63a77a3 100644 --- a/packages/snjs/package.json +++ b/packages/snjs/package.json @@ -68,7 +68,7 @@ }, "dependencies": { "@standardnotes/api": "workspace:*", - "@standardnotes/common": "^1.32.0", + "@standardnotes/common": "^1.36.1", "@standardnotes/domain-events": "^2.39.0", "@standardnotes/encryption": "workspace:*", "@standardnotes/features": "workspace:*", diff --git a/packages/ui-services/package.json b/packages/ui-services/package.json index e828056c8..b64ae894d 100644 --- a/packages/ui-services/package.json +++ b/packages/ui-services/package.json @@ -23,7 +23,7 @@ "test": "jest spec --coverage --passWithNoTests" }, "dependencies": { - "@standardnotes/common": "^1.32.0", + "@standardnotes/common": "^1.36.1", "@standardnotes/filepicker": "workspace:^", "@standardnotes/services": "workspace:^", "@standardnotes/styles": "workspace:^", diff --git a/packages/utils/package.json b/packages/utils/package.json index 5bc27c571..284c7e9d8 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -25,7 +25,7 @@ "test": "jest spec" }, "dependencies": { - "@standardnotes/common": "^1.32.0", + "@standardnotes/common": "^1.36.1", "dompurify": "^2.3.8", "lodash": "^4.17.21", "reflect-metadata": "^0.1.13" diff --git a/yarn.lock b/yarn.lock index 0bac0babb..30c134afe 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6068,7 +6068,7 @@ __metadata: version: 0.0.0-use.local resolution: "@standardnotes/api@workspace:packages/api" dependencies: - "@standardnotes/common": ^1.32.0 + "@standardnotes/common": ^1.36.1 "@standardnotes/encryption": "workspace:*" "@standardnotes/models": "workspace:*" "@standardnotes/responses": "workspace:*" @@ -6251,12 +6251,12 @@ __metadata: languageName: node linkType: hard -"@standardnotes/common@npm:^1.32.0": - version: 1.32.0 - resolution: "@standardnotes/common@npm:1.32.0" +"@standardnotes/common@npm:^1.36.1": + version: 1.36.1 + resolution: "@standardnotes/common@npm:1.36.1" dependencies: reflect-metadata: ^0.1.13 - checksum: 52d33f385e4cc26ac8d2f723c3a5e12bb8a2c4a17f08700ca5843810583ca722475a83b71f86bb1402fda7c7c66e8149beb3f70848efc90da4aafef663d7ffbe + checksum: 4f2367d461aa1cd4e3ec132520310773183c3c9f8e423565aec315f5e5dffdce79f9704307a32fbfec17157f99d37d49982ad4272eee5aac0dbe37da34be054c languageName: node linkType: hard @@ -6443,7 +6443,7 @@ __metadata: version: 0.0.0-use.local resolution: "@standardnotes/encryption@workspace:packages/encryption" dependencies: - "@standardnotes/common": ^1.32.0 + "@standardnotes/common": ^1.36.1 "@standardnotes/config": 2.4.3 "@standardnotes/models": "workspace:*" "@standardnotes/responses": "workspace:*" @@ -6485,7 +6485,7 @@ __metadata: resolution: "@standardnotes/features@workspace:packages/features" dependencies: "@standardnotes/auth": ^3.19.4 - "@standardnotes/common": ^1.32.0 + "@standardnotes/common": ^1.36.1 "@standardnotes/security": ^1.2.0 "@types/jest": ^28.1.5 "@typescript-eslint/eslint-plugin": ^5.30.0 @@ -6501,7 +6501,7 @@ __metadata: version: 0.0.0-use.local resolution: "@standardnotes/filepicker@workspace:packages/filepicker" dependencies: - "@standardnotes/common": ^1.32.0 + "@standardnotes/common": ^1.36.1 "@standardnotes/files": "workspace:*" "@standardnotes/utils": "workspace:*" "@types/jest": ^28.1.5 @@ -6519,7 +6519,7 @@ __metadata: version: 0.0.0-use.local resolution: "@standardnotes/files@workspace:packages/files" dependencies: - "@standardnotes/common": ^1.32.0 + "@standardnotes/common": ^1.36.1 "@standardnotes/encryption": "workspace:*" "@standardnotes/models": "workspace:*" "@standardnotes/responses": "workspace:*" @@ -6905,7 +6905,7 @@ __metadata: version: 0.0.0-use.local resolution: "@standardnotes/models@workspace:packages/models" dependencies: - "@standardnotes/common": ^1.32.0 + "@standardnotes/common": ^1.36.1 "@standardnotes/features": "workspace:*" "@standardnotes/responses": "workspace:*" "@standardnotes/utils": "workspace:*" @@ -6972,7 +6972,7 @@ __metadata: version: 0.0.0-use.local resolution: "@standardnotes/responses@workspace:packages/responses" dependencies: - "@standardnotes/common": ^1.32.0 + "@standardnotes/common": ^1.36.1 "@standardnotes/features": "workspace:*" "@standardnotes/security": ^1.1.0 "@types/jest": ^28.1.5 @@ -7041,7 +7041,7 @@ __metadata: dependencies: "@standardnotes/api": "workspace:^" "@standardnotes/auth": ^3.19.4 - "@standardnotes/common": ^1.32.0 + "@standardnotes/common": ^1.36.1 "@standardnotes/encryption": "workspace:^" "@standardnotes/files": "workspace:^" "@standardnotes/models": "workspace:^" @@ -7156,7 +7156,7 @@ __metadata: "@babel/core": "*" "@babel/preset-env": "*" "@standardnotes/api": "workspace:*" - "@standardnotes/common": ^1.32.0 + "@standardnotes/common": ^1.36.1 "@standardnotes/domain-events": ^2.39.0 "@standardnotes/encryption": "workspace:*" "@standardnotes/features": "workspace:*" @@ -7309,7 +7309,7 @@ __metadata: version: 0.0.0-use.local resolution: "@standardnotes/ui-services@workspace:packages/ui-services" dependencies: - "@standardnotes/common": ^1.32.0 + "@standardnotes/common": ^1.36.1 "@standardnotes/filepicker": "workspace:^" "@standardnotes/services": "workspace:^" "@standardnotes/styles": "workspace:^" @@ -7329,7 +7329,7 @@ __metadata: version: 0.0.0-use.local resolution: "@standardnotes/utils@workspace:packages/utils" dependencies: - "@standardnotes/common": ^1.32.0 + "@standardnotes/common": ^1.36.1 "@types/dompurify": ^2.3.3 "@types/jest": ^28.1.5 "@types/jsdom": ^16.2.14