UNPKG

@sprucelabs/spruce-cli

Version:

Command line interface for building Spruce skills.

33 lines 1.2 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); class OrganizationFixture { storeFactory; personFixture; constructor(personFixture, storeFactory) { this.storeFactory = storeFactory; this.personFixture = personFixture; } async seedDemoOrg(options) { await this.personFixture.loginAsDemoPerson(); return this.storeFactory.Store('organization').create({ slug: `my-org-${new Date().getTime()}`, ...options, }); } async clearAllOrgs() { await this.personFixture.loginAsDemoPerson(); const orgStore = this.storeFactory.Store('organization'); const orgs = await orgStore.fetchMyOrganizations(); for (const org of orgs) { await orgStore.deleteOrganization(org.id); } return orgs.length; } async installSkillAtOrganization(skillId, orgId) { await this.personFixture.loginAsDemoPerson(); const orgStore = this.storeFactory.Store('organization'); await orgStore.installSkillAtOrganization(skillId, orgId); } } exports.default = OrganizationFixture; //# sourceMappingURL=OrganizationFixture.js.map