-
-
Notifications
You must be signed in to change notification settings - Fork 392
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add subscription manager to handle subscription sharing (#1517)
* feat: add subscription manager to handle subscription sharing * fix(services): add missing methods to the interface * fix(services): add subscription manager specs * feat(snjs): add subscriptions e2e tests * fix(snjs): add wait in subscription cancelling test * fix(snjs): checking for canceled invitations in tests * fix(snjs): add e2e test for restored limit of subscription invitations * chore(lint): fix linter issues
- Loading branch information
Karol Sójko
committed
Sep 13, 2022
1 parent
2b830c0
commit 55b1409
Showing
55 changed files
with
512 additions
and
91 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file renamed
BIN
+33.1 KB
...mmon-npm-1.30.0-a603c54867-833b6e7f3e.zip → ...mmon-npm-1.32.0-9a02bcfd46-52d33f385e.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
packages/api/src/Domain/Response/Subscription/SubscriptionInviteAcceptResponse.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
import { Either } from '@standardnotes/common' | ||
|
||
import { HttpErrorResponseBody } from '../../Http/HttpErrorResponseBody' | ||
import { HttpResponse } from '../../Http/HttpResponse' | ||
import { SubscriptionInviteAcceptResponseBody } from './SubscriptionInviteAcceptResponseBody' | ||
|
||
export interface SubscriptionInviteAcceptResponse extends HttpResponse { | ||
data: SubscriptionInviteAcceptResponseBody | HttpErrorResponseBody | ||
data: Either<SubscriptionInviteAcceptResponseBody, HttpErrorResponseBody> | ||
} |
4 changes: 3 additions & 1 deletion
4
packages/api/src/Domain/Response/Subscription/SubscriptionInviteCancelResponse.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
import { Either } from '@standardnotes/common' | ||
|
||
import { HttpErrorResponseBody } from '../../Http/HttpErrorResponseBody' | ||
import { HttpResponse } from '../../Http/HttpResponse' | ||
import { SubscriptionInviteCancelResponseBody } from './SubscriptionInviteCancelResponseBody' | ||
|
||
export interface SubscriptionInviteCancelResponse extends HttpResponse { | ||
data: SubscriptionInviteCancelResponseBody | HttpErrorResponseBody | ||
data: Either<SubscriptionInviteCancelResponseBody, HttpErrorResponseBody> | ||
} |
4 changes: 3 additions & 1 deletion
4
packages/api/src/Domain/Response/Subscription/SubscriptionInviteDeclineResponse.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
import { Either } from '@standardnotes/common' | ||
|
||
import { HttpErrorResponseBody } from '../../Http/HttpErrorResponseBody' | ||
import { HttpResponse } from '../../Http/HttpResponse' | ||
import { SubscriptionInviteDeclineResponseBody } from './SubscriptionInviteDeclineResponseBody' | ||
|
||
export interface SubscriptionInviteDeclineResponse extends HttpResponse { | ||
data: SubscriptionInviteDeclineResponseBody | HttpErrorResponseBody | ||
data: Either<SubscriptionInviteDeclineResponseBody, HttpErrorResponseBody> | ||
} |
4 changes: 3 additions & 1 deletion
4
packages/api/src/Domain/Response/Subscription/SubscriptionInviteListResponse.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
import { Either } from '@standardnotes/common' | ||
|
||
import { HttpErrorResponseBody } from '../../Http/HttpErrorResponseBody' | ||
import { HttpResponse } from '../../Http/HttpResponse' | ||
import { SubscriptionInviteListResponseBody } from './SubscriptionInviteListResponseBody' | ||
|
||
export interface SubscriptionInviteListResponse extends HttpResponse { | ||
data: SubscriptionInviteListResponseBody | HttpErrorResponseBody | ||
data: Either<SubscriptionInviteListResponseBody, HttpErrorResponseBody> | ||
} |
4 changes: 3 additions & 1 deletion
4
packages/api/src/Domain/Response/Subscription/SubscriptionInviteResponse.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
import { Either } from '@standardnotes/common' | ||
|
||
import { HttpErrorResponseBody } from '../../Http/HttpErrorResponseBody' | ||
import { HttpResponse } from '../../Http/HttpResponse' | ||
import { SubscriptionInviteResponseBody } from './SubscriptionInviteResponseBody' | ||
|
||
export interface SubscriptionInviteResponse extends HttpResponse { | ||
data: SubscriptionInviteResponseBody | HttpErrorResponseBody | ||
data: Either<SubscriptionInviteResponseBody, HttpErrorResponseBody> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export * from './User/Paths' | ||
export * from './Subscription/SubscriptionServer' | ||
export * from './Subscription/SubscriptionServerInterface' | ||
export * from './User/UserServer' | ||
export * from './User/UserServerInterface' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export enum Environment { | ||
Web = 1, | ||
Desktop = 2, | ||
Mobile = 3, | ||
NativeMobileWeb = 4, | ||
} |
7 changes: 0 additions & 7 deletions
7
...ervices/src/Domain/Device/Environments.ts → ...ages/models/src/Domain/Device/Platform.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
packages/services/src/Domain/Subscription/SubscriptionClientInterface.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { Uuid } from '@standardnotes/common' | ||
import { Invitation } from '@standardnotes/models' | ||
|
||
export interface SubscriptionClientInterface { | ||
listSubscriptionInvitations(): Promise<Invitation[]> | ||
inviteToSubscription(inviteeEmail: string): Promise<boolean> | ||
cancelInvitation(inviteUuid: Uuid): Promise<boolean> | ||
} |
Oops, something went wrong.