@sprucelabs/spruce-test-fixtures 62.2.19 → 62.2.21

Sign up to get free protection for your applications and to get access to all the features.
@@ -72,12 +72,12 @@ export default class ViewFixtureTest extends AbstractSpruceFixtureTest {
72
72
  isAuthenticated(): boolean;
73
73
  getIsTestClient(): boolean;
74
74
  authenticate(options: {
75
- skillId?: string | undefined;
76
- apiKey?: string | undefined;
77
- token?: string | undefined;
75
+ skillId?: string;
76
+ apiKey?: string;
77
+ token?: string;
78
78
  }): Promise<{
79
- skill?: SpruceSchemas.Spruce.v2020_07_22.Skill | undefined;
80
- person?: SpruceSchemas.Spruce.v2020_07_22.Person | undefined;
79
+ skill?: SpruceSchemas.Spruce.v2020_07_22.Skill;
80
+ person?: SpruceSchemas.Spruce.v2020_07_22.Person;
81
81
  }>;
82
82
  }>;
83
83
  private static loginAndGetProxy;
@@ -72,12 +72,12 @@ export default class ViewFixtureTest extends AbstractSpruceFixtureTest {
72
72
  isAuthenticated(): boolean;
73
73
  getIsTestClient(): boolean;
74
74
  authenticate(options: {
75
- skillId?: string | undefined;
76
- apiKey?: string | undefined;
77
- token?: string | undefined;
75
+ skillId?: string;
76
+ apiKey?: string;
77
+ token?: string;
78
78
  }): Promise<{
79
- skill?: SpruceSchemas.Spruce.v2020_07_22.Skill | undefined;
80
- person?: SpruceSchemas.Spruce.v2020_07_22.Person | undefined;
79
+ skill?: SpruceSchemas.Spruce.v2020_07_22.Skill;
80
+ person?: SpruceSchemas.Spruce.v2020_07_22.Person;
81
81
  }>;
82
82
  }>;
83
83
  private static loginAndGetProxy;
@@ -61,12 +61,12 @@ export default abstract class AbstractSpruceFixtureTest extends AbstractSkillTes
61
61
  isAuthenticated(): boolean;
62
62
  getIsTestClient(): boolean;
63
63
  authenticate(options: {
64
- skillId?: string | undefined;
65
- apiKey?: string | undefined;
66
- token?: string | undefined;
64
+ skillId?: string;
65
+ apiKey?: string;
66
+ token?: string;
67
67
  }): Promise<{
68
- skill?: import("@sprucelabs/spruce-core-schemas").SpruceSchemas.Spruce.v2020_07_22.Skill | undefined;
69
- person?: import("@sprucelabs/spruce-core-schemas").SpruceSchemas.Spruce.v2020_07_22.Person | undefined;
68
+ skill?: import("@sprucelabs/spruce-core-schemas").SpruceSchemas.Spruce.v2020_07_22.Skill;
69
+ person?: import("@sprucelabs/spruce-core-schemas").SpruceSchemas.Spruce.v2020_07_22.Person;
70
70
  }>;
71
71
  };
72
72
  executionPromise: Promise<void>;
@@ -18,7 +18,7 @@ declare function fake(target: CoreSeedTarget, total: number): (TestClass: any, _
18
18
  declare namespace fake {
19
19
  var login: (phone?: string) => (TestClass: any, shouldPassHookCalls?: boolean) => void;
20
20
  var getClient: () => Client;
21
- var getPerson: () => SpruceSchemas.Spruce.v2020_07_22.Person;
21
+ var getPerson: () => Person;
22
22
  }
23
23
  export default fake;
24
24
  export declare function fakeTargetToPropName(target: CoreSeedTarget): keyof ClassWithFakes;
@@ -128,7 +128,7 @@ fake.login = (phone = '555-000-0000') => {
128
128
  //@ts-ignore
129
129
  Class.fakedClient.auth.token, Class.fakedPerson);
130
130
  }
131
- catch (_d) {
131
+ catch (_a) {
132
132
  //hits if not in skill because cant find nameplace
133
133
  }
134
134
  shouldPassHookCalls && (yield (beforeEach === null || beforeEach === void 0 ? void 0 : beforeEach()));
@@ -8,6 +8,6 @@ declare namespace login {
8
8
  var on: (name: "did-login" | "will-logout", cb: (options: {
9
9
  client: Client;
10
10
  person: SpruceSchemas.Spruce.v2020_07_22.Person;
11
- }) => void | Promise<void>) => Promise<void>;
11
+ }) => Promise<void> | void) => Promise<void>;
12
12
  }
13
13
  export default login;
@@ -5,10 +5,10 @@ declare const vcDiskUtil: {
5
5
  shouldThrowOnError?: boolean;
6
6
  }): {
7
7
  svcs: ({
8
- Class?: SkillViewController<Record<string, any>> | undefined;
8
+ Class?: SkillViewController;
9
9
  } & HealthCheckView)[];
10
10
  vcs: ({
11
- Class?: ViewController<any> | undefined;
11
+ Class?: ViewController<any>;
12
12
  } & HealthCheckView)[];
13
13
  ids: string[];
14
14
  theme: SpruceSchemas.HeartwoodViewControllers.v2021_02_11.Theme | undefined;
@@ -61,12 +61,12 @@ export default abstract class AbstractSpruceFixtureTest extends AbstractSkillTes
61
61
  isAuthenticated(): boolean;
62
62
  getIsTestClient(): boolean;
63
63
  authenticate(options: {
64
- skillId?: string | undefined;
65
- apiKey?: string | undefined;
66
- token?: string | undefined;
64
+ skillId?: string;
65
+ apiKey?: string;
66
+ token?: string;
67
67
  }): Promise<{
68
- skill?: import("@sprucelabs/spruce-core-schemas").SpruceSchemas.Spruce.v2020_07_22.Skill | undefined;
69
- person?: import("@sprucelabs/spruce-core-schemas").SpruceSchemas.Spruce.v2020_07_22.Person | undefined;
68
+ skill?: import("@sprucelabs/spruce-core-schemas").SpruceSchemas.Spruce.v2020_07_22.Skill;
69
+ person?: import("@sprucelabs/spruce-core-schemas").SpruceSchemas.Spruce.v2020_07_22.Person;
70
70
  }>;
71
71
  };
72
72
  executionPromise: Promise<void>;
@@ -18,7 +18,7 @@ declare function fake(target: CoreSeedTarget, total: number): (TestClass: any, _
18
18
  declare namespace fake {
19
19
  var login: (phone?: string) => (TestClass: any, shouldPassHookCalls?: boolean) => void;
20
20
  var getClient: () => Client;
21
- var getPerson: () => SpruceSchemas.Spruce.v2020_07_22.Person;
21
+ var getPerson: () => Person;
22
22
  }
23
23
  export default fake;
24
24
  export declare function fakeTargetToPropName(target: CoreSeedTarget): keyof ClassWithFakes;
@@ -14,7 +14,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
14
14
  return (mod && mod.__esModule) ? mod : { "default": mod };
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.singularToPlural = exports.pluralToSingular = exports.fakeTargetToPropName = void 0;
17
+ exports.default = fake;
18
+ exports.fakeTargetToPropName = fakeTargetToPropName;
19
+ exports.pluralToSingular = pluralToSingular;
20
+ exports.singularToPlural = singularToPlural;
18
21
  const mercury_client_1 = require("@sprucelabs/mercury-client");
19
22
  const schema_1 = require("@sprucelabs/schema");
20
23
  const spruce_core_schemas_1 = require("@sprucelabs/spruce-core-schemas");
@@ -75,7 +78,6 @@ function fake(target, total) {
75
78
  };
76
79
  };
77
80
  }
78
- exports.default = fake;
79
81
  fake.login = (phone = '555-000-0000') => {
80
82
  test_utils_1.assert.isTruthy(phone, `You need to pass a phone to 'faker.login(...)'`);
81
83
  test_utils_1.assert.isTrue((0, schema_1.isValidNumber)(phone), `'${phone}' is not a valid phone. Try something like: 555-000-0000`);
@@ -700,18 +702,15 @@ async function fakeInstallEvents(Class) {
700
702
  function fakeTargetToPropName(target) {
701
703
  return `faked${upperCaseFirst(target)}`;
702
704
  }
703
- exports.fakeTargetToPropName = fakeTargetToPropName;
704
705
  function upperCaseFirst(target) {
705
706
  return target[0].toUpperCase() + target.substring(1);
706
707
  }
707
708
  function pluralToSingular(target) {
708
709
  return target.substring(0, target.length - 1);
709
710
  }
710
- exports.pluralToSingular = pluralToSingular;
711
711
  function singularToPlural(target) {
712
712
  return target + 's';
713
713
  }
714
- exports.singularToPlural = singularToPlural;
715
714
  let shouldSkipNextReset = false;
716
715
  function findOrgFromTarget(Class, target) {
717
716
  const match = Class._fakedOrganizations.find((o) => o.id === target.organizationId);
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = install;
3
4
  const test_utils_1 = require("@sprucelabs/test-utils");
4
5
  function install() { }
5
- exports.default = install;
6
6
  install.skills = (...namespaces) => {
7
7
  if (namespaces.length === 0) {
8
8
  test_utils_1.assert.fail(`You must pass the skill namespaces so I can install them.`);
@@ -8,6 +8,6 @@ declare namespace login {
8
8
  var on: (name: "did-login" | "will-logout", cb: (options: {
9
9
  client: Client;
10
10
  person: SpruceSchemas.Spruce.v2020_07_22.Person;
11
- }) => void | Promise<void>) => Promise<void>;
11
+ }) => Promise<void> | void) => Promise<void>;
12
12
  }
13
13
  export default login;
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = login;
3
4
  const mercury_client_1 = require("@sprucelabs/mercury-client");
4
5
  const test_utils_1 = require("@sprucelabs/test-utils");
5
6
  const __1 = require("../..");
@@ -38,7 +39,6 @@ function login(phone) {
38
39
  };
39
40
  };
40
41
  }
41
- exports.default = login;
42
42
  login.getClient = () => {
43
43
  const client = __1.MercuryFixture.getDefaultClient();
44
44
  test_utils_1.assert.isTruthy(client, `You must @login() on your test class before getting the client!`);
@@ -3,6 +3,7 @@ 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.default = seed;
6
7
  const mercury_client_1 = require("@sprucelabs/mercury-client");
7
8
  const test_utils_1 = require("@sprucelabs/test-utils");
8
9
  const StoreFixture_1 = __importDefault(require("../fixtures/StoreFixture"));
@@ -41,7 +42,6 @@ function seed(storeName, totalToSeed, ...params) {
41
42
  };
42
43
  };
43
44
  }
44
- exports.default = seed;
45
45
  async function forceResetAccount(Class) {
46
46
  Class.__shouldResetAccount = true;
47
47
  await reset(Class);
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = generateRandomName;
3
4
  const unique_names_generator_1 = require("unique-names-generator");
4
5
  function generateRandomName() {
5
6
  var _a;
@@ -12,4 +13,3 @@ function generateRandomName() {
12
13
  };
13
14
  return values;
14
15
  }
15
- exports.default = generateRandomName;
@@ -1,11 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.doesScopeIncludeLocation = exports.doesScopeIncludeOrganization = void 0;
3
+ exports.doesScopeIncludeOrganization = doesScopeIncludeOrganization;
4
+ exports.doesScopeIncludeLocation = doesScopeIncludeLocation;
4
5
  function doesScopeIncludeOrganization(flags) {
5
6
  return flags === null || flags === void 0 ? void 0 : flags.includes('organization');
6
7
  }
7
- exports.doesScopeIncludeOrganization = doesScopeIncludeOrganization;
8
8
  function doesScopeIncludeLocation(flags) {
9
9
  return flags === null || flags === void 0 ? void 0 : flags.includes('location');
10
10
  }
11
- exports.doesScopeIncludeLocation = doesScopeIncludeLocation;
@@ -5,10 +5,10 @@ declare const vcDiskUtil: {
5
5
  shouldThrowOnError?: boolean;
6
6
  }): {
7
7
  svcs: ({
8
- Class?: SkillViewController<Record<string, any>> | undefined;
8
+ Class?: SkillViewController;
9
9
  } & HealthCheckView)[];
10
10
  vcs: ({
11
- Class?: ViewController<any> | undefined;
11
+ Class?: ViewController<any>;
12
12
  } & HealthCheckView)[];
13
13
  ids: string[];
14
14
  theme: SpruceSchemas.HeartwoodViewControllers.v2021_02_11.Theme | undefined;
package/package.json CHANGED
@@ -13,7 +13,7 @@
13
13
  "@sprucelabs/spruce-test-fixtures"
14
14
  ]
15
15
  },
16
- "version": "62.2.19",
16
+ "version": "62.2.21",
17
17
  "files": [
18
18
  "build/**/*",
19
19
  "!build/__tests__",
@@ -61,29 +61,29 @@
61
61
  "lint.tsc": "tsc -p . --noEmit"
62
62
  },
63
63
  "dependencies": {
64
- "@sprucelabs/data-stores": "^28.1.59",
65
- "@sprucelabs/error": "^6.0.61",
66
- "@sprucelabs/heartwood-view-controllers": "^110.4.37",
67
- "@sprucelabs/mercury-client": "^42.0.144",
68
- "@sprucelabs/mercury-core-events": "^24.0.135",
69
- "@sprucelabs/mercury-event-emitter": "^42.0.144",
64
+ "@sprucelabs/data-stores": "^28.1.63",
65
+ "@sprucelabs/error": "^6.0.64",
66
+ "@sprucelabs/heartwood-view-controllers": "^110.4.42",
67
+ "@sprucelabs/mercury-client": "^42.0.148",
68
+ "@sprucelabs/mercury-core-events": "^24.0.139",
69
+ "@sprucelabs/mercury-event-emitter": "^42.0.148",
70
70
  "@sprucelabs/schema": "^30.0.109",
71
- "@sprucelabs/spruce-core-schemas": "^40.1.50",
72
- "@sprucelabs/spruce-event-utils": "^40.0.120",
73
- "@sprucelabs/spruce-permission-utils": "^8.0.176",
74
- "@sprucelabs/spruce-skill-booter": "^62.2.19",
75
- "@sprucelabs/spruce-skill-utils": "^31.0.121",
71
+ "@sprucelabs/spruce-core-schemas": "^40.1.54",
72
+ "@sprucelabs/spruce-event-utils": "^40.0.124",
73
+ "@sprucelabs/spruce-permission-utils": "^8.0.180",
74
+ "@sprucelabs/spruce-skill-booter": "^62.2.21",
75
+ "@sprucelabs/spruce-skill-utils": "^31.0.125",
76
76
  "@sprucelabs/test-utils": "^5.1.2",
77
77
  "dotenv": "^16.4.5",
78
78
  "unique-names-generator": "^4.7.1"
79
79
  },
80
80
  "devDependencies": {
81
- "@sprucelabs/esm-postbuild": "^6.0.48",
82
- "@sprucelabs/jest-json-reporter": "^8.0.66",
83
- "@sprucelabs/mercury-types": "^47.0.109",
84
- "@sprucelabs/resolve-path-aliases": "^2.0.43",
81
+ "@sprucelabs/esm-postbuild": "^6.0.50",
82
+ "@sprucelabs/jest-json-reporter": "^8.0.69",
83
+ "@sprucelabs/mercury-types": "^47.0.113",
84
+ "@sprucelabs/resolve-path-aliases": "^2.0.45",
85
85
  "@sprucelabs/semantic-release": "^5.0.1",
86
- "@sprucelabs/test": "^9.0.29",
86
+ "@sprucelabs/test": "^9.0.30",
87
87
  "@types/node": "17.0.5",
88
88
  "calendar-utils": "^0.10.4",
89
89
  "chokidar-cli": "^3.0.0",
@@ -95,7 +95,7 @@
95
95
  "ts-node": "^10.9.2",
96
96
  "tsc-watch": "^6.2.0",
97
97
  "tsconfig-paths": "^4.2.0",
98
- "typescript": "^5.4.5"
98
+ "typescript": "^5.5.2"
99
99
  },
100
100
  "jest": {
101
101
  "maxWorkers": 2,
@@ -114,5 +114,5 @@
114
114
  "^#spruce/(.*)$": "<rootDir>/build/.spruce/$1"
115
115
  }
116
116
  },
117
- "gitHead": "fd076103e24a3c1e257d272d4f639a1985dbec86"
117
+ "gitHead": "8b12b0bb58d66ba9cd6021c8364b9a761876f376"
118
118
  }