@sprucelabs/spruce-invite-utils 3.5.1 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/__tests__/support/LoginAndConfirmTestFixture.js +2 -5
- package/build/esm/__tests__/support/LoginAndConfirmTestFixture.js +2 -2
- package/build/esm/index-module.d.ts +1 -1
- package/build/esm/index-module.js +1 -1
- package/build/esm/loggingInAndConfirmingJoin/LoginAndConfirmJoinController.d.ts +6 -4
- package/build/esm/loggingInAndConfirmingJoin/LoginAndConfirmJoinController.js +13 -11
- package/build/index-module.d.ts +1 -1
- package/build/index-module.js +2 -2
- package/build/loggingInAndConfirmingJoin/LoginAndConfirmJoinController.d.ts +6 -4
- package/build/loggingInAndConfirmingJoin/LoginAndConfirmJoinController.js +15 -11
- package/package.json +1 -1
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
const test_1 = require("@sprucelabs/test");
|
|
7
|
-
const LoginAndConfirmJoinController_1 =
|
|
4
|
+
const LoginAndConfirmJoinController_1 = require("../../loggingInAndConfirmingJoin/LoginAndConfirmJoinController");
|
|
8
5
|
class LoginAndConfirmTestFixture {
|
|
9
6
|
static beforeEach() {
|
|
10
7
|
this.setClass(CountingLoginAndConfirmController);
|
|
@@ -26,7 +23,7 @@ class LoginAndConfirmTestFixture {
|
|
|
26
23
|
this.setClass(Class);
|
|
27
24
|
}
|
|
28
25
|
static setClass(Class) {
|
|
29
|
-
LoginAndConfirmJoinController_1.
|
|
26
|
+
LoginAndConfirmJoinController_1.LoginAndConfirmJoinControllerFactory.setClass(Class);
|
|
30
27
|
}
|
|
31
28
|
}
|
|
32
29
|
exports.default = LoginAndConfirmTestFixture;
|
|
@@ -8,7 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import { assert } from '@sprucelabs/test';
|
|
11
|
-
import
|
|
11
|
+
import { LoginAndConfirmJoinControllerFactory, } from '../../loggingInAndConfirmingJoin/LoginAndConfirmJoinController.js';
|
|
12
12
|
export default class LoginAndConfirmTestFixture {
|
|
13
13
|
static beforeEach() {
|
|
14
14
|
this.setClass(CountingLoginAndConfirmController);
|
|
@@ -30,7 +30,7 @@ export default class LoginAndConfirmTestFixture {
|
|
|
30
30
|
this.setClass(Class);
|
|
31
31
|
}
|
|
32
32
|
static setClass(Class) {
|
|
33
|
-
|
|
33
|
+
LoginAndConfirmJoinControllerFactory.setClass(Class);
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
LoginAndConfirmTestFixture.hitCount = 0;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { default as buildRouteToCreateInvite } from './sending/buildRouteToCreateInvite';
|
|
2
|
-
export { default as
|
|
2
|
+
export { default as LoginAndConfirmJoinControllerImpl } from './loggingInAndConfirmingJoin/LoginAndConfirmJoinController';
|
|
3
3
|
export * from './loggingInAndConfirmingJoin/LoginAndConfirmJoinController';
|
|
4
4
|
export { default as LoginAndConfirmTestFixture } from './__tests__/support/LoginAndConfirmTestFixture';
|
|
5
5
|
export * from './__tests__/support/LoginAndConfirmTestFixture';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { default as buildRouteToCreateInvite } from './sending/buildRouteToCreateInvite.js';
|
|
2
|
-
export { default as
|
|
2
|
+
export { default as LoginAndConfirmJoinControllerImpl } from './loggingInAndConfirmingJoin/LoginAndConfirmJoinController.js';
|
|
3
3
|
export * from './loggingInAndConfirmingJoin/LoginAndConfirmJoinController.js';
|
|
4
4
|
export { default as LoginAndConfirmTestFixture } from './__tests__/support/LoginAndConfirmTestFixture.js';
|
|
5
5
|
export * from './__tests__/support/LoginAndConfirmTestFixture.js';
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
import { Authenticator, CardViewControllerImpl, ViewControllerFactory } from '@sprucelabs/heartwood-view-controllers';
|
|
2
2
|
import { MercuryClient } from '@sprucelabs/mercury-client';
|
|
3
|
+
export declare class LoginAndConfirmJoinControllerFactory {
|
|
4
|
+
private static Class?;
|
|
5
|
+
static setClass(Class?: LoginAndConfirmJoinConstructor): void;
|
|
6
|
+
static Controller(options: LoginAndConfirmJoinOptions): LoginAndConfirmJoinController;
|
|
7
|
+
}
|
|
3
8
|
export default class LoginAndConfirmJoinControllerImpl implements LoginAndConfirmJoinController {
|
|
4
9
|
private views;
|
|
5
10
|
protected vc: CardViewControllerImpl;
|
|
6
11
|
private authenticator;
|
|
7
12
|
private dialog?;
|
|
8
|
-
private static Class?;
|
|
9
13
|
private organizationId;
|
|
10
14
|
private connectToApi;
|
|
11
15
|
private client;
|
|
12
16
|
private locationId?;
|
|
13
17
|
private confirmJoinContext?;
|
|
14
|
-
|
|
15
|
-
static setClass(Class?: LoginAndConfirmJoinConstructor): void;
|
|
16
|
-
static Controller(options: LoginAndConfirmJoinOptions): LoginAndConfirmJoinController;
|
|
18
|
+
constructor(options: LoginAndConfirmJoinOptions);
|
|
17
19
|
promptForLoginAndConfirmJoin(options?: PromptForLoginAndConfirmOptions): Promise<boolean>;
|
|
18
20
|
private listRoles;
|
|
19
21
|
private confirmTheJoin;
|
|
@@ -9,16 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
};
|
|
10
10
|
import { assertOptions } from '@sprucelabs/schema';
|
|
11
11
|
import ConfirmJoinCardViewController from '../accepting/ConfirmJoinCard.vc.js';
|
|
12
|
-
export
|
|
13
|
-
constructor(options) {
|
|
14
|
-
const { views, authenticator, organizationId, connectToApi, locationId } = options;
|
|
15
|
-
this.views = views;
|
|
16
|
-
this.authenticator = authenticator;
|
|
17
|
-
this.organizationId = organizationId;
|
|
18
|
-
this.connectToApi = connectToApi;
|
|
19
|
-
this.locationId = locationId;
|
|
20
|
-
this.vc = this.views.Controller('card', {});
|
|
21
|
-
}
|
|
12
|
+
export class LoginAndConfirmJoinControllerFactory {
|
|
22
13
|
static setClass(Class) {
|
|
23
14
|
this.Class = Class;
|
|
24
15
|
}
|
|
@@ -33,7 +24,18 @@ export default class LoginAndConfirmJoinControllerImpl {
|
|
|
33
24
|
if (!views.hasController('invite.confirm-join-card')) {
|
|
34
25
|
views.setController('invite.confirm-join-card', ConfirmJoinCardViewController);
|
|
35
26
|
}
|
|
36
|
-
return new ((_a = this.Class) !== null && _a !== void 0 ? _a :
|
|
27
|
+
return new ((_a = this.Class) !== null && _a !== void 0 ? _a : LoginAndConfirmJoinControllerImpl)(options);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
export default class LoginAndConfirmJoinControllerImpl {
|
|
31
|
+
constructor(options) {
|
|
32
|
+
const { views, authenticator, organizationId, connectToApi, locationId } = options;
|
|
33
|
+
this.views = views;
|
|
34
|
+
this.authenticator = authenticator;
|
|
35
|
+
this.organizationId = organizationId;
|
|
36
|
+
this.connectToApi = connectToApi;
|
|
37
|
+
this.locationId = locationId;
|
|
38
|
+
this.vc = this.views.Controller('card', {});
|
|
37
39
|
}
|
|
38
40
|
promptForLoginAndConfirmJoin(options) {
|
|
39
41
|
return __awaiter(this, void 0, void 0, function* () {
|
package/build/index-module.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { default as buildRouteToCreateInvite } from './sending/buildRouteToCreateInvite';
|
|
2
|
-
export { default as
|
|
2
|
+
export { default as LoginAndConfirmJoinControllerImpl } from './loggingInAndConfirmingJoin/LoginAndConfirmJoinController';
|
|
3
3
|
export * from './loggingInAndConfirmingJoin/LoginAndConfirmJoinController';
|
|
4
4
|
export { default as LoginAndConfirmTestFixture } from './__tests__/support/LoginAndConfirmTestFixture';
|
|
5
5
|
export * from './__tests__/support/LoginAndConfirmTestFixture';
|
package/build/index-module.js
CHANGED
|
@@ -17,11 +17,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
17
17
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
18
|
};
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.LoginAndConfirmTestFixture = exports.
|
|
20
|
+
exports.LoginAndConfirmTestFixture = exports.LoginAndConfirmJoinControllerImpl = exports.buildRouteToCreateInvite = void 0;
|
|
21
21
|
var buildRouteToCreateInvite_1 = require("./sending/buildRouteToCreateInvite");
|
|
22
22
|
Object.defineProperty(exports, "buildRouteToCreateInvite", { enumerable: true, get: function () { return __importDefault(buildRouteToCreateInvite_1).default; } });
|
|
23
23
|
var LoginAndConfirmJoinController_1 = require("./loggingInAndConfirmingJoin/LoginAndConfirmJoinController");
|
|
24
|
-
Object.defineProperty(exports, "
|
|
24
|
+
Object.defineProperty(exports, "LoginAndConfirmJoinControllerImpl", { enumerable: true, get: function () { return __importDefault(LoginAndConfirmJoinController_1).default; } });
|
|
25
25
|
__exportStar(require("./loggingInAndConfirmingJoin/LoginAndConfirmJoinController"), exports);
|
|
26
26
|
var LoginAndConfirmTestFixture_1 = require("./__tests__/support/LoginAndConfirmTestFixture");
|
|
27
27
|
Object.defineProperty(exports, "LoginAndConfirmTestFixture", { enumerable: true, get: function () { return __importDefault(LoginAndConfirmTestFixture_1).default; } });
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
import { Authenticator, CardViewControllerImpl, ViewControllerFactory } from '@sprucelabs/heartwood-view-controllers';
|
|
2
2
|
import { MercuryClient } from '@sprucelabs/mercury-client';
|
|
3
|
+
export declare class LoginAndConfirmJoinControllerFactory {
|
|
4
|
+
private static Class?;
|
|
5
|
+
static setClass(Class?: LoginAndConfirmJoinConstructor): void;
|
|
6
|
+
static Controller(options: LoginAndConfirmJoinOptions): LoginAndConfirmJoinController;
|
|
7
|
+
}
|
|
3
8
|
export default class LoginAndConfirmJoinControllerImpl implements LoginAndConfirmJoinController {
|
|
4
9
|
private views;
|
|
5
10
|
protected vc: CardViewControllerImpl;
|
|
6
11
|
private authenticator;
|
|
7
12
|
private dialog?;
|
|
8
|
-
private static Class?;
|
|
9
13
|
private organizationId;
|
|
10
14
|
private connectToApi;
|
|
11
15
|
private client;
|
|
12
16
|
private locationId?;
|
|
13
17
|
private confirmJoinContext?;
|
|
14
|
-
|
|
15
|
-
static setClass(Class?: LoginAndConfirmJoinConstructor): void;
|
|
16
|
-
static Controller(options: LoginAndConfirmJoinOptions): LoginAndConfirmJoinController;
|
|
18
|
+
constructor(options: LoginAndConfirmJoinOptions);
|
|
17
19
|
promptForLoginAndConfirmJoin(options?: PromptForLoginAndConfirmOptions): Promise<boolean>;
|
|
18
20
|
private listRoles;
|
|
19
21
|
private confirmTheJoin;
|
|
@@ -3,18 +3,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.LoginAndConfirmJoinControllerFactory = void 0;
|
|
6
7
|
const schema_1 = require("@sprucelabs/schema");
|
|
7
8
|
const ConfirmJoinCard_vc_1 = __importDefault(require("../accepting/ConfirmJoinCard.vc"));
|
|
8
|
-
class
|
|
9
|
-
constructor(options) {
|
|
10
|
-
const { views, authenticator, organizationId, connectToApi, locationId } = options;
|
|
11
|
-
this.views = views;
|
|
12
|
-
this.authenticator = authenticator;
|
|
13
|
-
this.organizationId = organizationId;
|
|
14
|
-
this.connectToApi = connectToApi;
|
|
15
|
-
this.locationId = locationId;
|
|
16
|
-
this.vc = this.views.Controller('card', {});
|
|
17
|
-
}
|
|
9
|
+
class LoginAndConfirmJoinControllerFactory {
|
|
18
10
|
static setClass(Class) {
|
|
19
11
|
this.Class = Class;
|
|
20
12
|
}
|
|
@@ -29,7 +21,19 @@ class LoginAndConfirmJoinControllerImpl {
|
|
|
29
21
|
if (!views.hasController('invite.confirm-join-card')) {
|
|
30
22
|
views.setController('invite.confirm-join-card', ConfirmJoinCard_vc_1.default);
|
|
31
23
|
}
|
|
32
|
-
return new ((_a = this.Class) !== null && _a !== void 0 ? _a :
|
|
24
|
+
return new ((_a = this.Class) !== null && _a !== void 0 ? _a : LoginAndConfirmJoinControllerImpl)(options);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.LoginAndConfirmJoinControllerFactory = LoginAndConfirmJoinControllerFactory;
|
|
28
|
+
class LoginAndConfirmJoinControllerImpl {
|
|
29
|
+
constructor(options) {
|
|
30
|
+
const { views, authenticator, organizationId, connectToApi, locationId } = options;
|
|
31
|
+
this.views = views;
|
|
32
|
+
this.authenticator = authenticator;
|
|
33
|
+
this.organizationId = organizationId;
|
|
34
|
+
this.connectToApi = connectToApi;
|
|
35
|
+
this.locationId = locationId;
|
|
36
|
+
this.vc = this.views.Controller('card', {});
|
|
33
37
|
}
|
|
34
38
|
async promptForLoginAndConfirmJoin(options) {
|
|
35
39
|
this.client = await this.connectToApi();
|