@sprucelabs/spruce-appointment-utils 8.0.1 → 8.0.4
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/capabilities/stores/RemoteRoleCapabilityStore.d.ts +16 -0
- package/build/capabilities/stores/RemoteRoleCapabilityStore.js +65 -0
- package/build/esm/capabilities/stores/RemoteRoleCapabilityStore.d.ts +16 -0
- package/build/esm/capabilities/stores/RemoteRoleCapabilityStore.js +79 -0
- package/build/esm/viewControllers/RoleCapabilitiesCard.vc.d.ts +24 -0
- package/build/esm/viewControllers/RoleCapabilitiesCard.vc.js +51 -0
- package/build/viewControllers/RoleCapabilitiesCard.vc.d.ts +24 -0
- package/build/viewControllers/RoleCapabilitiesCard.vc.js +42 -0
- package/package.json +9 -9
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { MercuryClient } from '@sprucelabs/mercury-client';
|
|
2
|
+
declare type RemoteRoleCapabilityOptions = {
|
|
3
|
+
client: MercuryClient;
|
|
4
|
+
organizationId: string;
|
|
5
|
+
};
|
|
6
|
+
export default class RemoteRoleCapabilityStore {
|
|
7
|
+
protected client: MercuryClient;
|
|
8
|
+
protected organizationId: string;
|
|
9
|
+
protected queuedCapabilities: Record<string, any>;
|
|
10
|
+
constructor(options: RemoteRoleCapabilityOptions);
|
|
11
|
+
queue(value: any): Promise<any>;
|
|
12
|
+
persist(): Promise<import("@sprucelabs/schema").SchemaStaticValues<import("@sprucelabs/mercury-types").SpruceSchemas.Appointments.v2021_06_23.UpdateRoleCapabilitySchema, false, import("@sprucelabs/schema").SchemaOptionalFieldNames<import("@sprucelabs/mercury-types").SpruceSchemas.Appointments.v2021_06_23.UpdateRoleCapabilitySchema>, import("@sprucelabs/schema").StaticSchemaAllValues<import("@sprucelabs/mercury-types").SpruceSchemas.Appointments.v2021_06_23.UpdateRoleCapabilitySchema, false>>[]>;
|
|
13
|
+
protected createCapability(roleId: any, serviceId: any, values: any): Promise<import("@sprucelabs/schema").SchemaStaticValues<import("@sprucelabs/mercury-types").SpruceSchemas.Appointments.v2021_06_23.CreateRoleCapabilitySchema, false, import("@sprucelabs/schema").SchemaOptionalFieldNames<import("@sprucelabs/mercury-types").SpruceSchemas.Appointments.v2021_06_23.CreateRoleCapabilitySchema>, import("@sprucelabs/schema").StaticSchemaAllValues<import("@sprucelabs/mercury-types").SpruceSchemas.Appointments.v2021_06_23.CreateRoleCapabilitySchema, false>>>;
|
|
14
|
+
protected updateCapability(id: any, values: any): Promise<import("@sprucelabs/schema").SchemaStaticValues<import("@sprucelabs/mercury-types").SpruceSchemas.Appointments.v2021_06_23.UpdateRoleCapabilitySchema, false, import("@sprucelabs/schema").SchemaOptionalFieldNames<import("@sprucelabs/mercury-types").SpruceSchemas.Appointments.v2021_06_23.UpdateRoleCapabilitySchema>, import("@sprucelabs/schema").StaticSchemaAllValues<import("@sprucelabs/mercury-types").SpruceSchemas.Appointments.v2021_06_23.UpdateRoleCapabilitySchema, false>>>;
|
|
15
|
+
}
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
const schema_1 = require("@sprucelabs/schema");
|
|
15
|
+
class RemoteRoleCapabilityStore {
|
|
16
|
+
constructor(options) {
|
|
17
|
+
this.queuedCapabilities = [];
|
|
18
|
+
(0, schema_1.assertOptions)(options, ['client', 'organizationId']);
|
|
19
|
+
this.client = options.client;
|
|
20
|
+
this.organizationId = options.organizationId;
|
|
21
|
+
}
|
|
22
|
+
async queue(value) {
|
|
23
|
+
(0, schema_1.assertOptions)(value, ['serviceId', 'roleId']);
|
|
24
|
+
const id = `${this.organizationId}-${value.serviceId}-${value.roleId}`;
|
|
25
|
+
this.queuedCapabilities[id] = Object.assign(Object.assign({}, this.queuedCapabilities[id]), value);
|
|
26
|
+
return value;
|
|
27
|
+
}
|
|
28
|
+
async persist() {
|
|
29
|
+
let response = [];
|
|
30
|
+
for (let key in this.queuedCapabilities) {
|
|
31
|
+
const _a = this.queuedCapabilities[key], { id, roleId, serviceId } = _a, values = __rest(_a, ["id", "roleId", "serviceId"]);
|
|
32
|
+
if (id) {
|
|
33
|
+
const capability = await this.updateCapability(id, values);
|
|
34
|
+
response.push(capability);
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
const capability = await this.createCapability(roleId, serviceId, values);
|
|
38
|
+
response.push(capability);
|
|
39
|
+
}
|
|
40
|
+
delete this.queuedCapabilities[key];
|
|
41
|
+
}
|
|
42
|
+
return response;
|
|
43
|
+
}
|
|
44
|
+
async createCapability(roleId, serviceId, values) {
|
|
45
|
+
const [{ capability }] = await this.client.emitAndFlattenResponses('appointments.create-role-capability::v2021_06_23', {
|
|
46
|
+
target: {
|
|
47
|
+
organizationId: this.organizationId,
|
|
48
|
+
roleId,
|
|
49
|
+
},
|
|
50
|
+
payload: Object.assign({ serviceId, isEnabled: false, doesOffer: false }, values),
|
|
51
|
+
});
|
|
52
|
+
return capability;
|
|
53
|
+
}
|
|
54
|
+
async updateCapability(id, values) {
|
|
55
|
+
const [{ capability }] = await this.client.emitAndFlattenResponses('appointments.update-role-capability::v2021_06_23', {
|
|
56
|
+
target: {
|
|
57
|
+
organizationId: this.organizationId,
|
|
58
|
+
capabilityId: id,
|
|
59
|
+
},
|
|
60
|
+
payload: Object.assign({}, values),
|
|
61
|
+
});
|
|
62
|
+
return capability;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
exports.default = RemoteRoleCapabilityStore;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { MercuryClient } from '@sprucelabs/mercury-client';
|
|
2
|
+
declare type RemoteRoleCapabilityOptions = {
|
|
3
|
+
client: MercuryClient;
|
|
4
|
+
organizationId: string;
|
|
5
|
+
};
|
|
6
|
+
export default class RemoteRoleCapabilityStore {
|
|
7
|
+
protected client: MercuryClient;
|
|
8
|
+
protected organizationId: string;
|
|
9
|
+
protected queuedCapabilities: Record<string, any>;
|
|
10
|
+
constructor(options: RemoteRoleCapabilityOptions);
|
|
11
|
+
queue(value: any): Promise<any>;
|
|
12
|
+
persist(): Promise<import("@sprucelabs/schema").SchemaStaticValues<import("@sprucelabs/mercury-types").SpruceSchemas.Appointments.v2021_06_23.UpdateRoleCapabilitySchema, false, import("@sprucelabs/schema").SchemaOptionalFieldNames<import("@sprucelabs/mercury-types").SpruceSchemas.Appointments.v2021_06_23.UpdateRoleCapabilitySchema>, import("@sprucelabs/schema").StaticSchemaAllValues<import("@sprucelabs/mercury-types").SpruceSchemas.Appointments.v2021_06_23.UpdateRoleCapabilitySchema, false>>[]>;
|
|
13
|
+
protected createCapability(roleId: any, serviceId: any, values: any): Promise<import("@sprucelabs/schema").SchemaStaticValues<import("@sprucelabs/mercury-types").SpruceSchemas.Appointments.v2021_06_23.CreateRoleCapabilitySchema, false, import("@sprucelabs/schema").SchemaOptionalFieldNames<import("@sprucelabs/mercury-types").SpruceSchemas.Appointments.v2021_06_23.CreateRoleCapabilitySchema>, import("@sprucelabs/schema").StaticSchemaAllValues<import("@sprucelabs/mercury-types").SpruceSchemas.Appointments.v2021_06_23.CreateRoleCapabilitySchema, false>>>;
|
|
14
|
+
protected updateCapability(id: any, values: any): Promise<import("@sprucelabs/schema").SchemaStaticValues<import("@sprucelabs/mercury-types").SpruceSchemas.Appointments.v2021_06_23.UpdateRoleCapabilitySchema, false, import("@sprucelabs/schema").SchemaOptionalFieldNames<import("@sprucelabs/mercury-types").SpruceSchemas.Appointments.v2021_06_23.UpdateRoleCapabilitySchema>, import("@sprucelabs/schema").StaticSchemaAllValues<import("@sprucelabs/mercury-types").SpruceSchemas.Appointments.v2021_06_23.UpdateRoleCapabilitySchema, false>>>;
|
|
15
|
+
}
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
11
|
+
var t = {};
|
|
12
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
13
|
+
t[p] = s[p];
|
|
14
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
15
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
16
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
17
|
+
t[p[i]] = s[p[i]];
|
|
18
|
+
}
|
|
19
|
+
return t;
|
|
20
|
+
};
|
|
21
|
+
import { assertOptions } from '@sprucelabs/schema';
|
|
22
|
+
export default class RemoteRoleCapabilityStore {
|
|
23
|
+
constructor(options) {
|
|
24
|
+
this.queuedCapabilities = [];
|
|
25
|
+
assertOptions(options, ['client', 'organizationId']);
|
|
26
|
+
this.client = options.client;
|
|
27
|
+
this.organizationId = options.organizationId;
|
|
28
|
+
}
|
|
29
|
+
queue(value) {
|
|
30
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
31
|
+
assertOptions(value, ['serviceId', 'roleId']);
|
|
32
|
+
const id = `${this.organizationId}-${value.serviceId}-${value.roleId}`;
|
|
33
|
+
this.queuedCapabilities[id] = Object.assign(Object.assign({}, this.queuedCapabilities[id]), value);
|
|
34
|
+
return value;
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
persist() {
|
|
38
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39
|
+
let response = [];
|
|
40
|
+
for (let key in this.queuedCapabilities) {
|
|
41
|
+
const _a = this.queuedCapabilities[key], { id, roleId, serviceId } = _a, values = __rest(_a, ["id", "roleId", "serviceId"]);
|
|
42
|
+
if (id) {
|
|
43
|
+
const capability = yield this.updateCapability(id, values);
|
|
44
|
+
response.push(capability);
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
const capability = yield this.createCapability(roleId, serviceId, values);
|
|
48
|
+
response.push(capability);
|
|
49
|
+
}
|
|
50
|
+
delete this.queuedCapabilities[key];
|
|
51
|
+
}
|
|
52
|
+
return response;
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
createCapability(roleId, serviceId, values) {
|
|
56
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
57
|
+
const [{ capability }] = yield this.client.emitAndFlattenResponses('appointments.create-role-capability::v2021_06_23', {
|
|
58
|
+
target: {
|
|
59
|
+
organizationId: this.organizationId,
|
|
60
|
+
roleId,
|
|
61
|
+
},
|
|
62
|
+
payload: Object.assign({ serviceId, isEnabled: false, doesOffer: false }, values),
|
|
63
|
+
});
|
|
64
|
+
return capability;
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
updateCapability(id, values) {
|
|
68
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
69
|
+
const [{ capability }] = yield this.client.emitAndFlattenResponses('appointments.update-role-capability::v2021_06_23', {
|
|
70
|
+
target: {
|
|
71
|
+
organizationId: this.organizationId,
|
|
72
|
+
capabilityId: id,
|
|
73
|
+
},
|
|
74
|
+
payload: Object.assign({}, values),
|
|
75
|
+
});
|
|
76
|
+
return capability;
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { SpruceSchemas, ViewControllerOptions } from '@sprucelabs/heartwood-view-controllers';
|
|
2
|
+
import AbstractCapabilityCardViewController from './AbstractCapabilityCardViewController';
|
|
3
|
+
declare type Role = SpruceSchemas.Spruce.v2020_07_22.Role;
|
|
4
|
+
declare type ToggleHandler = (serviceId: string, isSelected: boolean) => void;
|
|
5
|
+
export declare type RolesCardViewControllerOptions = ViewControllerOptions & {
|
|
6
|
+
role: Role;
|
|
7
|
+
onInsertOrUpdateCapability: (values: any) => void;
|
|
8
|
+
onUpdateHasCapability?: ToggleHandler;
|
|
9
|
+
onEdit?: (row: any) => void;
|
|
10
|
+
};
|
|
11
|
+
export default class RolesCardViewController extends AbstractCapabilityCardViewController {
|
|
12
|
+
static id: string;
|
|
13
|
+
protected role: Role;
|
|
14
|
+
protected onInsertOrUpdateCapability: any;
|
|
15
|
+
constructor(options: RolesCardViewControllerOptions);
|
|
16
|
+
load(options: {
|
|
17
|
+
organizationId?: string;
|
|
18
|
+
shouldIncludePrivateFields?: boolean;
|
|
19
|
+
}): Promise<void>;
|
|
20
|
+
protected loadCapabilities(): Promise<void>;
|
|
21
|
+
protected insertOrUpdateCapability(serviceId: string, values: any, serviceCapability: SpruceSchemas.Appointments.v2021_06_23.ListRoleCapability | undefined): Promise<SpruceSchemas.Appointments.v2021_06_23.ListRoleCapability | undefined>;
|
|
22
|
+
getCapabilities(): SpruceSchemas.Appointments.v2021_06_23.ListRoleCapability[];
|
|
23
|
+
}
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { assertOptions } from '@sprucelabs/schema';
|
|
11
|
+
import { eventResponseUtil } from '@sprucelabs/spruce-event-utils';
|
|
12
|
+
import AbstractCapabilityCardViewController from './AbstractCapabilityCardViewController.js';
|
|
13
|
+
export default class RolesCardViewController extends AbstractCapabilityCardViewController {
|
|
14
|
+
constructor(options) {
|
|
15
|
+
super(options);
|
|
16
|
+
assertOptions(options, ['role', 'onInsertOrUpdateCapability']);
|
|
17
|
+
this.role = options.role;
|
|
18
|
+
this.toggleDoesOfferHandler = options.onUpdateHasCapability;
|
|
19
|
+
this.onInsertOrUpdateCapability = options.onInsertOrUpdateCapability;
|
|
20
|
+
this.onEdit = options === null || options === void 0 ? void 0 : options.onEdit;
|
|
21
|
+
this.activeRecordCardVc = this.ActiveRecordCard(options.role);
|
|
22
|
+
}
|
|
23
|
+
load(options) {
|
|
24
|
+
var _a;
|
|
25
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
26
|
+
yield this.loadVc((_a = options.organizationId) !== null && _a !== void 0 ? _a : 'missing-org');
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
loadCapabilities() {
|
|
30
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
31
|
+
const client = yield this.connectToApi();
|
|
32
|
+
const results = yield client.emit('appointments.list-role-capabilities::v2021_06_23', {
|
|
33
|
+
target: {
|
|
34
|
+
organizationId: this.organizationId,
|
|
35
|
+
roleId: this.role.id,
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
const { capabilities } = eventResponseUtil.getFirstResponseOrThrow(results);
|
|
39
|
+
this.capabilities = capabilities;
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
insertOrUpdateCapability(serviceId, values, serviceCapability) {
|
|
43
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
44
|
+
return yield this.onInsertOrUpdateCapability(Object.assign(Object.assign({}, values), { serviceId, id: serviceCapability === null || serviceCapability === void 0 ? void 0 : serviceCapability.id }));
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
getCapabilities() {
|
|
48
|
+
return this.capabilities;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
RolesCardViewController.id = 'role-capabilities-card';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { SpruceSchemas, ViewControllerOptions } from '@sprucelabs/heartwood-view-controllers';
|
|
2
|
+
import AbstractCapabilityCardViewController from './AbstractCapabilityCardViewController';
|
|
3
|
+
declare type Role = SpruceSchemas.Spruce.v2020_07_22.Role;
|
|
4
|
+
declare type ToggleHandler = (serviceId: string, isSelected: boolean) => void;
|
|
5
|
+
export declare type RolesCardViewControllerOptions = ViewControllerOptions & {
|
|
6
|
+
role: Role;
|
|
7
|
+
onInsertOrUpdateCapability: (values: any) => void;
|
|
8
|
+
onUpdateHasCapability?: ToggleHandler;
|
|
9
|
+
onEdit?: (row: any) => void;
|
|
10
|
+
};
|
|
11
|
+
export default class RolesCardViewController extends AbstractCapabilityCardViewController {
|
|
12
|
+
static id: string;
|
|
13
|
+
protected role: Role;
|
|
14
|
+
protected onInsertOrUpdateCapability: any;
|
|
15
|
+
constructor(options: RolesCardViewControllerOptions);
|
|
16
|
+
load(options: {
|
|
17
|
+
organizationId?: string;
|
|
18
|
+
shouldIncludePrivateFields?: boolean;
|
|
19
|
+
}): Promise<void>;
|
|
20
|
+
protected loadCapabilities(): Promise<void>;
|
|
21
|
+
protected insertOrUpdateCapability(serviceId: string, values: any, serviceCapability: SpruceSchemas.Appointments.v2021_06_23.ListRoleCapability | undefined): Promise<SpruceSchemas.Appointments.v2021_06_23.ListRoleCapability | undefined>;
|
|
22
|
+
getCapabilities(): SpruceSchemas.Appointments.v2021_06_23.ListRoleCapability[];
|
|
23
|
+
}
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const schema_1 = require("@sprucelabs/schema");
|
|
7
|
+
const spruce_event_utils_1 = require("@sprucelabs/spruce-event-utils");
|
|
8
|
+
const AbstractCapabilityCardViewController_1 = __importDefault(require("./AbstractCapabilityCardViewController"));
|
|
9
|
+
class RolesCardViewController extends AbstractCapabilityCardViewController_1.default {
|
|
10
|
+
constructor(options) {
|
|
11
|
+
super(options);
|
|
12
|
+
(0, schema_1.assertOptions)(options, ['role', 'onInsertOrUpdateCapability']);
|
|
13
|
+
this.role = options.role;
|
|
14
|
+
this.toggleDoesOfferHandler = options.onUpdateHasCapability;
|
|
15
|
+
this.onInsertOrUpdateCapability = options.onInsertOrUpdateCapability;
|
|
16
|
+
this.onEdit = options === null || options === void 0 ? void 0 : options.onEdit;
|
|
17
|
+
this.activeRecordCardVc = this.ActiveRecordCard(options.role);
|
|
18
|
+
}
|
|
19
|
+
async load(options) {
|
|
20
|
+
var _a;
|
|
21
|
+
await this.loadVc((_a = options.organizationId) !== null && _a !== void 0 ? _a : 'missing-org');
|
|
22
|
+
}
|
|
23
|
+
async loadCapabilities() {
|
|
24
|
+
const client = await this.connectToApi();
|
|
25
|
+
const results = await client.emit('appointments.list-role-capabilities::v2021_06_23', {
|
|
26
|
+
target: {
|
|
27
|
+
organizationId: this.organizationId,
|
|
28
|
+
roleId: this.role.id,
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
const { capabilities } = spruce_event_utils_1.eventResponseUtil.getFirstResponseOrThrow(results);
|
|
32
|
+
this.capabilities = capabilities;
|
|
33
|
+
}
|
|
34
|
+
async insertOrUpdateCapability(serviceId, values, serviceCapability) {
|
|
35
|
+
return await this.onInsertOrUpdateCapability(Object.assign(Object.assign({}, values), { serviceId, id: serviceCapability === null || serviceCapability === void 0 ? void 0 : serviceCapability.id }));
|
|
36
|
+
}
|
|
37
|
+
getCapabilities() {
|
|
38
|
+
return this.capabilities;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
exports.default = RolesCardViewController;
|
|
42
|
+
RolesCardViewController.id = 'role-capabilities-card';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sprucelabs/spruce-appointment-utils",
|
|
3
3
|
"description": "Utils for working with appointments and Sprucebot.",
|
|
4
|
-
"version": "8.0.
|
|
4
|
+
"version": "8.0.4",
|
|
5
5
|
"skill": {
|
|
6
6
|
"namespace": "appointments"
|
|
7
7
|
},
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
"build/index-module.d.ts",
|
|
19
19
|
"build/types-module.js",
|
|
20
20
|
"build/types-module.d.ts",
|
|
21
|
-
"build/stores/RemoteRoleCapabilityStore.d.ts",
|
|
22
|
-
"build/stores/RemoteRoleCapabilityStore.js",
|
|
21
|
+
"build/capabilities/stores/RemoteRoleCapabilityStore.d.ts",
|
|
22
|
+
"build/capabilities/stores/RemoteRoleCapabilityStore.js",
|
|
23
23
|
"build/viewControllers/AbstractCapabilityCardViewController.js",
|
|
24
24
|
"build/viewControllers/AbstractCapabilityCardViewController.d.ts",
|
|
25
25
|
"build/viewControllers/DurationCard.vc.js",
|
|
@@ -30,14 +30,14 @@
|
|
|
30
30
|
"build/viewControllers/EditOverrideDetailsCard.vc.d.ts",
|
|
31
31
|
"build/viewControllers/EditTimeBlockTitleCard.vc.js",
|
|
32
32
|
"build/viewControllers/EditTimeBlockTitleCard.vc.d.ts",
|
|
33
|
-
"build/viewControllers/
|
|
34
|
-
"build/viewControllers/
|
|
33
|
+
"build/viewControllers/RoleCapabilitiesCard.vc.js",
|
|
34
|
+
"build/viewControllers/RoleCapabilitiesCard.vc.d.ts",
|
|
35
35
|
"build/esm/index-module.js",
|
|
36
36
|
"build/esm/index-module.d.ts",
|
|
37
37
|
"build/esm/types-module.js",
|
|
38
38
|
"build/esm/types-module.d.ts",
|
|
39
|
-
"build/esm/stores/RemoteRoleCapabilityStore.d.ts",
|
|
40
|
-
"build/esm/stores/RemoteRoleCapabilityStore.js",
|
|
39
|
+
"build/esm/capabilities/stores/RemoteRoleCapabilityStore.d.ts",
|
|
40
|
+
"build/esm/capabilities/stores/RemoteRoleCapabilityStore.js",
|
|
41
41
|
"build/esm/viewControllers/AbstractCapabilityCardViewController.js",
|
|
42
42
|
"build/esm/viewControllers/AbstractCapabilityCardViewController.d.ts",
|
|
43
43
|
"build/esm/viewControllers/DurationCard.vc.js",
|
|
@@ -48,8 +48,8 @@
|
|
|
48
48
|
"build/esm/viewControllers/EditOverrideDetailsCard.vc.d.ts",
|
|
49
49
|
"build/esm/viewControllers/EditTimeBlockTitleCard.vc.js",
|
|
50
50
|
"build/esm/viewControllers/EditTimeBlockTitleCard.vc.d.ts",
|
|
51
|
-
"build/esm/viewControllers/
|
|
52
|
-
"build/esm/viewControllers/
|
|
51
|
+
"build/esm/viewControllers/RoleCapabilitiesCard.vc.js",
|
|
52
|
+
"build/esm/viewControllers/RoleCapabilitiesCard.vc.d.ts"
|
|
53
53
|
],
|
|
54
54
|
"keywords": [],
|
|
55
55
|
"scripts": {
|