@sprucelabs/spruce-test-fixtures 62.4.30 → 62.4.32
Sign up to get free protection for your applications and to get access to all the features.
- package/build/esm/tests/fixtures/ViewFixture.d.ts +5 -2
- package/build/esm/tests/fixtures/ViewFixture.js +6 -0
- package/build/esm/utilities/vcDisk.utility.d.ts +3 -1
- package/build/esm/utilities/vcDisk.utility.js +4 -2
- package/build/tests/fixtures/ViewFixture.d.ts +5 -2
- package/build/tests/fixtures/ViewFixture.js +6 -0
- package/build/utilities/vcDisk.utility.d.ts +3 -1
- package/build/utilities/vcDisk.utility.js +4 -2
- package/package.json +3 -3
- package/tsconfig.json +1 -1
@@ -1,5 +1,5 @@
|
|
1
1
|
import { Locale } from '@sprucelabs/calendar-utils';
|
2
|
-
import { ControllerOptions, Scope, SkillViewController, SpyDevice,
|
2
|
+
import { ControllerOptions, Scope, SkillViewController, SpyDevice, ViewControllerId, ViewController, ViewControllerConstructor, ViewControllerPluginOptions, ViewControllerPlugin, AppControllerId } from '@sprucelabs/heartwood-view-controllers';
|
3
3
|
import { MercuryClient } from '@sprucelabs/mercury-client';
|
4
4
|
import { SpruceSchemas } from '@sprucelabs/spruce-core-schemas';
|
5
5
|
import { ClientProxyDecorator } from '../..';
|
@@ -7,6 +7,7 @@ import { TokenGenerator } from '../../ClientProxyDecorator';
|
|
7
7
|
import { TestConnectFactory } from '../../types/fixture.types';
|
8
8
|
import { ArgsFromSvc } from '../../types/view.types';
|
9
9
|
import TestRouter from '../routers/TestRouter';
|
10
|
+
import SpyViewControllerFactory from '../SpyViewControllerFactory';
|
10
11
|
import FixtureFactory from './FixtureFactory';
|
11
12
|
import PermissionFixture from './PermissionFixture';
|
12
13
|
import PersonFixture from './PersonFixture';
|
@@ -45,7 +46,7 @@ export default class ViewFixture {
|
|
45
46
|
permissions: PermissionFixture;
|
46
47
|
});
|
47
48
|
addPlugin(name: string, plugin: ViewControllerPlugin): void;
|
48
|
-
getFactory():
|
49
|
+
getFactory(): SpyViewControllerFactory;
|
49
50
|
BuildPlugin<P extends ViewControllerPlugin>(Plugin: new (options: ViewControllerPluginOptions) => P): P;
|
50
51
|
getMaps(): import("../../utilities/SpyMapUtil").SpyMapUtil;
|
51
52
|
render<VC extends ViewController<any>>(vc: VC): ReturnType<VC['render']>;
|
@@ -60,6 +61,8 @@ export default class ViewFixture {
|
|
60
61
|
static resetAuth(): void;
|
61
62
|
load<Svc extends SkillViewController = SkillViewController>(vc: Pick<Svc, 'load' | 'getScope'>, args?: ArgsFromSvc<Svc>): Promise<void>;
|
62
63
|
getThemes(): import("../FakeThemeManager").default;
|
64
|
+
hasApp(namespace: string): boolean;
|
65
|
+
App(namespace: AppControllerId): never;
|
63
66
|
private assertScopeRequirementsMet;
|
64
67
|
setScope(scope: Scope): void;
|
65
68
|
getScope(): SpyScope;
|
@@ -211,6 +211,12 @@ class ViewFixture {
|
|
211
211
|
getThemes() {
|
212
212
|
return this.getRouter().getThemes();
|
213
213
|
}
|
214
|
+
hasApp(namespace) {
|
215
|
+
return this.getFactory().hasApp(namespace);
|
216
|
+
}
|
217
|
+
App(namespace) {
|
218
|
+
return this.getFactory().App(namespace);
|
219
|
+
}
|
214
220
|
assertScopeRequirementsMet(vc) {
|
215
221
|
return __awaiter(this, void 0, void 0, function* () {
|
216
222
|
var _a, _b;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { ViewController, SkillViewController, ViewControllerMap, SpruceSchemas, ViewControllerPluginsByName } from '@sprucelabs/heartwood-view-controllers';
|
1
|
+
import { ViewController, SkillViewController, ViewControllerMap, SpruceSchemas, ViewControllerPluginsByName, AppControllerConstructor } from '@sprucelabs/heartwood-view-controllers';
|
2
2
|
import { HealthCheckView } from '../types/view.types';
|
3
3
|
declare const vcDiskUtil: {
|
4
4
|
loadViewControllers(activeDir: string, options?: {
|
@@ -12,11 +12,13 @@ declare const vcDiskUtil: {
|
|
12
12
|
} & HealthCheckView)[];
|
13
13
|
ids: string[];
|
14
14
|
theme: SpruceSchemas.HeartwoodViewControllers.v2021_02_11.Theme | undefined;
|
15
|
+
App: AppControllerConstructor | undefined;
|
15
16
|
pluginsByName: ViewControllerPluginsByName;
|
16
17
|
};
|
17
18
|
loadViewControllersAndBuildMap(namespace: string, vcDir: string): {
|
18
19
|
map: Partial<ViewControllerMap>;
|
19
20
|
pluginsByName: ViewControllerPluginsByName;
|
21
|
+
App: AppControllerConstructor | undefined;
|
20
22
|
};
|
21
23
|
resolveCombinedViewsPath(activeDir: string): string | false;
|
22
24
|
resolveThemeFile(activeDir: string): string | false;
|
@@ -10,7 +10,7 @@ const vcDiskUtil = {
|
|
10
10
|
if (!path) {
|
11
11
|
throw new Error(`Could not find path to skill views. Running \`spruce sync.views\` may help.`);
|
12
12
|
}
|
13
|
-
const { default: controllerMap, pluginsByName } = require(path);
|
13
|
+
const { default: controllerMap, pluginsByName, App } = require(path);
|
14
14
|
const controllers = Object.values(controllerMap);
|
15
15
|
const vcs = [];
|
16
16
|
const svcs = [];
|
@@ -75,11 +75,12 @@ const vcDiskUtil = {
|
|
75
75
|
vcs,
|
76
76
|
ids,
|
77
77
|
theme,
|
78
|
+
App: App,
|
78
79
|
pluginsByName: pluginsByName,
|
79
80
|
};
|
80
81
|
},
|
81
82
|
loadViewControllersAndBuildMap(namespace, vcDir) {
|
82
|
-
const { vcs, svcs, pluginsByName } = this.loadViewControllers(vcDir);
|
83
|
+
const { vcs, svcs, pluginsByName, App } = this.loadViewControllers(vcDir);
|
83
84
|
const map = {};
|
84
85
|
const all = [...vcs, ...svcs];
|
85
86
|
for (const item of all) {
|
@@ -91,6 +92,7 @@ const vcDiskUtil = {
|
|
91
92
|
return {
|
92
93
|
map,
|
93
94
|
pluginsByName,
|
95
|
+
App,
|
94
96
|
};
|
95
97
|
},
|
96
98
|
resolveCombinedViewsPath(activeDir) {
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { Locale } from '@sprucelabs/calendar-utils';
|
2
|
-
import { ControllerOptions, Scope, SkillViewController, SpyDevice,
|
2
|
+
import { ControllerOptions, Scope, SkillViewController, SpyDevice, ViewControllerId, ViewController, ViewControllerConstructor, ViewControllerPluginOptions, ViewControllerPlugin, AppControllerId } from '@sprucelabs/heartwood-view-controllers';
|
3
3
|
import { MercuryClient } from '@sprucelabs/mercury-client';
|
4
4
|
import { SpruceSchemas } from '@sprucelabs/spruce-core-schemas';
|
5
5
|
import { ClientProxyDecorator } from '../..';
|
@@ -7,6 +7,7 @@ import { TokenGenerator } from '../../ClientProxyDecorator';
|
|
7
7
|
import { TestConnectFactory } from '../../types/fixture.types';
|
8
8
|
import { ArgsFromSvc } from '../../types/view.types';
|
9
9
|
import TestRouter from '../routers/TestRouter';
|
10
|
+
import SpyViewControllerFactory from '../SpyViewControllerFactory';
|
10
11
|
import FixtureFactory from './FixtureFactory';
|
11
12
|
import PermissionFixture from './PermissionFixture';
|
12
13
|
import PersonFixture from './PersonFixture';
|
@@ -45,7 +46,7 @@ export default class ViewFixture {
|
|
45
46
|
permissions: PermissionFixture;
|
46
47
|
});
|
47
48
|
addPlugin(name: string, plugin: ViewControllerPlugin): void;
|
48
|
-
getFactory():
|
49
|
+
getFactory(): SpyViewControllerFactory;
|
49
50
|
BuildPlugin<P extends ViewControllerPlugin>(Plugin: new (options: ViewControllerPluginOptions) => P): P;
|
50
51
|
getMaps(): import("../../utilities/SpyMapUtil").SpyMapUtil;
|
51
52
|
render<VC extends ViewController<any>>(vc: VC): ReturnType<VC['render']>;
|
@@ -60,6 +61,8 @@ export default class ViewFixture {
|
|
60
61
|
static resetAuth(): void;
|
61
62
|
load<Svc extends SkillViewController = SkillViewController>(vc: Pick<Svc, 'load' | 'getScope'>, args?: ArgsFromSvc<Svc>): Promise<void>;
|
62
63
|
getThemes(): import("../FakeThemeManager").default;
|
64
|
+
hasApp(namespace: string): boolean;
|
65
|
+
App(namespace: AppControllerId): never;
|
63
66
|
private assertScopeRequirementsMet;
|
64
67
|
setScope(scope: Scope): void;
|
65
68
|
getScope(): SpyScope;
|
@@ -204,6 +204,12 @@ class ViewFixture {
|
|
204
204
|
getThemes() {
|
205
205
|
return this.getRouter().getThemes();
|
206
206
|
}
|
207
|
+
hasApp(namespace) {
|
208
|
+
return this.getFactory().hasApp(namespace);
|
209
|
+
}
|
210
|
+
App(namespace) {
|
211
|
+
return this.getFactory().App(namespace);
|
212
|
+
}
|
207
213
|
async assertScopeRequirementsMet(vc) {
|
208
214
|
if ((0, scopeUtils_1.doesScopeIncludeOrganization)(vc.getScope?.())) {
|
209
215
|
const org = await this.getScope().getCurrentOrganization();
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { ViewController, SkillViewController, ViewControllerMap, SpruceSchemas, ViewControllerPluginsByName } from '@sprucelabs/heartwood-view-controllers';
|
1
|
+
import { ViewController, SkillViewController, ViewControllerMap, SpruceSchemas, ViewControllerPluginsByName, AppControllerConstructor } from '@sprucelabs/heartwood-view-controllers';
|
2
2
|
import { HealthCheckView } from '../types/view.types';
|
3
3
|
declare const vcDiskUtil: {
|
4
4
|
loadViewControllers(activeDir: string, options?: {
|
@@ -12,11 +12,13 @@ declare const vcDiskUtil: {
|
|
12
12
|
} & HealthCheckView)[];
|
13
13
|
ids: string[];
|
14
14
|
theme: SpruceSchemas.HeartwoodViewControllers.v2021_02_11.Theme | undefined;
|
15
|
+
App: AppControllerConstructor | undefined;
|
15
16
|
pluginsByName: ViewControllerPluginsByName;
|
16
17
|
};
|
17
18
|
loadViewControllersAndBuildMap(namespace: string, vcDir: string): {
|
18
19
|
map: Partial<ViewControllerMap>;
|
19
20
|
pluginsByName: ViewControllerPluginsByName;
|
21
|
+
App: AppControllerConstructor | undefined;
|
20
22
|
};
|
21
23
|
resolveCombinedViewsPath(activeDir: string): string | false;
|
22
24
|
resolveThemeFile(activeDir: string): string | false;
|
@@ -14,7 +14,7 @@ const vcDiskUtil = {
|
|
14
14
|
if (!path) {
|
15
15
|
throw new Error(`Could not find path to skill views. Running \`spruce sync.views\` may help.`);
|
16
16
|
}
|
17
|
-
const { default: controllerMap, pluginsByName } = require(path);
|
17
|
+
const { default: controllerMap, pluginsByName, App } = require(path);
|
18
18
|
const controllers = Object.values(controllerMap);
|
19
19
|
const vcs = [];
|
20
20
|
const svcs = [];
|
@@ -79,11 +79,12 @@ const vcDiskUtil = {
|
|
79
79
|
vcs,
|
80
80
|
ids,
|
81
81
|
theme,
|
82
|
+
App: App,
|
82
83
|
pluginsByName: pluginsByName,
|
83
84
|
};
|
84
85
|
},
|
85
86
|
loadViewControllersAndBuildMap(namespace, vcDir) {
|
86
|
-
const { vcs, svcs, pluginsByName } = this.loadViewControllers(vcDir);
|
87
|
+
const { vcs, svcs, pluginsByName, App } = this.loadViewControllers(vcDir);
|
87
88
|
const map = {};
|
88
89
|
const all = [...vcs, ...svcs];
|
89
90
|
for (const item of all) {
|
@@ -95,6 +96,7 @@ const vcDiskUtil = {
|
|
95
96
|
return {
|
96
97
|
map,
|
97
98
|
pluginsByName,
|
99
|
+
App,
|
98
100
|
};
|
99
101
|
},
|
100
102
|
resolveCombinedViewsPath(activeDir) {
|
package/package.json
CHANGED
@@ -13,7 +13,7 @@
|
|
13
13
|
"@sprucelabs/spruce-test-fixtures"
|
14
14
|
]
|
15
15
|
},
|
16
|
-
"version": "62.4.
|
16
|
+
"version": "62.4.32",
|
17
17
|
"files": [
|
18
18
|
"build/**/*",
|
19
19
|
"!build/__tests__",
|
@@ -71,7 +71,7 @@
|
|
71
71
|
"@sprucelabs/spruce-core-schemas": "^40.1.550",
|
72
72
|
"@sprucelabs/spruce-event-utils": "^40.1.326",
|
73
73
|
"@sprucelabs/spruce-permission-utils": "^8.1.29",
|
74
|
-
"@sprucelabs/spruce-skill-booter": "^62.4.
|
74
|
+
"@sprucelabs/spruce-skill-booter": "^62.4.32",
|
75
75
|
"@sprucelabs/spruce-skill-utils": "^31.0.627",
|
76
76
|
"@sprucelabs/test-utils": "^5.1.504",
|
77
77
|
"dotenv": "^16.4.5",
|
@@ -114,5 +114,5 @@
|
|
114
114
|
"^#spruce/(.*)$": "<rootDir>/build/.spruce/$1"
|
115
115
|
}
|
116
116
|
},
|
117
|
-
"gitHead": "
|
117
|
+
"gitHead": "42e872e4fc0cd120df8eb5b0d4eed90124fa9523"
|
118
118
|
}
|