@sprucelabs/spruce-appointment-utils 5.2.8 → 6.1.1

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.
@@ -17,7 +17,7 @@ export default class AbstractCapabilityCardViewController extends AbstractViewCo
17
17
  ActiveRecordCard(row) {
18
18
  return this.Controller('activeRecordCard', buildActiveRecordCard({
19
19
  id: row.id,
20
- columnWidths: ['fill'],
20
+ columnWidths: ['content', 'fill'],
21
21
  shouldRenderRowDividers: true,
22
22
  header: {
23
23
  title: row.name,
@@ -29,26 +29,37 @@ export default class AbstractCapabilityCardViewController extends AbstractViewCo
29
29
  }));
30
30
  }
31
31
  buildRow(service) {
32
- var _a, _b, _c, _d;
32
+ var _a, _b, _c, _d, _e, _f;
33
33
  const serviceCapability = (_a = this.capabilities) === null || _a === void 0 ? void 0 : _a.find((r) => r.serviceId === service.id);
34
+ const rowId = service.id;
34
35
  return {
35
- id: service.id,
36
+ id: rowId,
36
37
  onClick: () => __awaiter(this, void 0, void 0, function* () {
37
38
  yield this.handleEdit(service, serviceCapability);
38
39
  }),
40
+ isEnabled: (_b = serviceCapability === null || serviceCapability === void 0 ? void 0 : serviceCapability.isEnabled) !== null && _b !== void 0 ? _b : true,
39
41
  cells: [
42
+ {
43
+ checkboxInput: {
44
+ name: 'isEnabled',
45
+ value: (_c = serviceCapability === null || serviceCapability === void 0 ? void 0 : serviceCapability.isEnabled) !== null && _c !== void 0 ? _c : true,
46
+ onChange: (value) => {
47
+ this.getListVc().getRowVc(service.id).setIsEnabled(value);
48
+ },
49
+ },
50
+ },
40
51
  {
41
52
  text: {
42
53
  content: service.name,
43
54
  },
44
55
  subText: {
45
- content: `$${(_b = serviceCapability === null || serviceCapability === void 0 ? void 0 : serviceCapability.price) !== null && _b !== void 0 ? _b : service.price} - ${this.calculateDuration((_c = serviceCapability === null || serviceCapability === void 0 ? void 0 : serviceCapability.timeBlocks) !== null && _c !== void 0 ? _c : service.timeBlocks)}`,
56
+ content: `$${(_d = serviceCapability === null || serviceCapability === void 0 ? void 0 : serviceCapability.price) !== null && _d !== void 0 ? _d : service.price} - ${this.calculateDuration((_e = serviceCapability === null || serviceCapability === void 0 ? void 0 : serviceCapability.timeBlocks) !== null && _e !== void 0 ? _e : service.timeBlocks)}`,
46
57
  },
47
58
  },
48
59
  {
49
60
  toggleInput: {
50
- name: 'isEnabled',
51
- value: (_d = serviceCapability === null || serviceCapability === void 0 ? void 0 : serviceCapability.isEnabled) !== null && _d !== void 0 ? _d : false,
61
+ name: 'doesOffer',
62
+ value: (_f = serviceCapability === null || serviceCapability === void 0 ? void 0 : serviceCapability.doesOffer) !== null && _f !== void 0 ? _f : false,
52
63
  onChange: (value) => __awaiter(this, void 0, void 0, function* () {
53
64
  yield this.handleToggleChange(service, value !== null && value !== void 0 ? value : false, serviceCapability);
54
65
  }),
@@ -64,7 +75,7 @@ export default class AbstractCapabilityCardViewController extends AbstractViewCo
64
75
  onCancel: () => { },
65
76
  onSubmit: (price, timeBlocks, serviceRow, serviceRoleCapability) => __awaiter(this, void 0, void 0, function* () {
66
77
  yield dlgVc.hide();
67
- const newServiceCapability = yield this.insertOrUpdateCapability(serviceRow.id, { price, timeBlocks, isEnabled: true }, serviceRoleCapability);
78
+ const newServiceCapability = yield this.insertOrUpdateCapability(serviceRow.id, { price, timeBlocks, isEnabled: true, doesOffer: true }, serviceRoleCapability);
68
79
  if (newServiceCapability) {
69
80
  this.upsertCapabilities(newServiceCapability, serviceRow);
70
81
  }
@@ -77,12 +88,14 @@ export default class AbstractCapabilityCardViewController extends AbstractViewCo
77
88
  });
78
89
  }
79
90
  upsertCapabilities(newServiceCapability, service) {
80
- var _a;
91
+ var _a, _b;
81
92
  const listVc = this.getListVc();
82
93
  if (newServiceCapability) {
83
- this.capabilities = (_a = this.capabilities) === null || _a === void 0 ? void 0 : _a.filter((r) => r.id !== newServiceCapability.id);
84
- this.capabilities.push(newServiceCapability);
85
- listVc.upsertRow(service.id, Object.assign({}, this.buildRow(service)));
94
+ const oldCapability = (_a = this.capabilities) === null || _a === void 0 ? void 0 : _a.find((r) => r.id === newServiceCapability.id);
95
+ this.capabilities = (_b = this.capabilities) === null || _b === void 0 ? void 0 : _b.filter((r) => r.id !== newServiceCapability.id);
96
+ const rowId = service.id;
97
+ this.capabilities.push(Object.assign(Object.assign({}, oldCapability), newServiceCapability));
98
+ listVc.upsertRow(rowId, Object.assign({}, this.buildRow(service)));
86
99
  listVc.triggerRender();
87
100
  this.getActiveRecordVc().triggerRender();
88
101
  }
@@ -91,7 +104,7 @@ export default class AbstractCapabilityCardViewController extends AbstractViewCo
91
104
  var _a;
92
105
  return __awaiter(this, void 0, void 0, function* () {
93
106
  (_a = this.onUpdateHasCapability) === null || _a === void 0 ? void 0 : _a.call(this, service, value);
94
- const newCapability = yield this.insertOrUpdateCapability(service.id, { isEnabled: value }, capability);
107
+ const newCapability = yield this.insertOrUpdateCapability(service.id, { isEnabled: true, doesOffer: value }, capability);
95
108
  if (newCapability) {
96
109
  this.upsertCapabilities(newCapability, service);
97
110
  }
@@ -34,7 +34,7 @@ export default class EditOverrideDetailsCardViewController extends AbstractViewC
34
34
  this.cardVc = this.CardVc();
35
35
  }
36
36
  FormVc() {
37
- var _a, _b, _c;
37
+ var _a, _b;
38
38
  return this.Controller('form', buildForm({
39
39
  id: 'editOverrideForm',
40
40
  schema,
@@ -48,7 +48,13 @@ export default class EditOverrideDetailsCardViewController extends AbstractViewC
48
48
  },
49
49
  sections: [
50
50
  {
51
- fields: ['price'],
51
+ fields: [
52
+ {
53
+ name: 'price',
54
+ label: 'Price',
55
+ placeholder: (_a = this.service) === null || _a === void 0 ? void 0 : _a.price,
56
+ },
57
+ ],
52
58
  },
53
59
  {
54
60
  title: 'Duration',
@@ -67,7 +73,7 @@ export default class EditOverrideDetailsCardViewController extends AbstractViewC
67
73
  ],
68
74
  },
69
75
  values: {
70
- price: (_b = (_a = this.serviceRoleCapability) === null || _a === void 0 ? void 0 : _a.price) !== null && _b !== void 0 ? _b : (_c = this.service) === null || _c === void 0 ? void 0 : _c.price,
76
+ price: (_b = this.serviceRoleCapability) === null || _b === void 0 ? void 0 : _b.price,
71
77
  },
72
78
  }));
73
79
  }
@@ -33,7 +33,9 @@ export default class EditTimeBlockTitleCardViewController extends AbstractViewCo
33
33
  },
34
34
  sections: [
35
35
  {
36
- fields: ['title'],
36
+ fields: [
37
+ { name: 'title', label: 'Title', placeholder: 'Duration' },
38
+ ],
37
39
  },
38
40
  ],
39
41
  values: { title: this.title },
@@ -4,12 +4,14 @@ declare type Role = SpruceSchemas.Spruce.v2020_07_22.Role;
4
4
  declare type ToggleHandler = (serviceId: string, isSelected: boolean) => void;
5
5
  export declare type RolesCardViewControllerOptions = ViewControllerOptions & {
6
6
  role: Role;
7
+ onInsertOrUpdateCapability: (values: any) => void;
7
8
  onUpdateHasCapability?: ToggleHandler;
8
9
  onEdit?: (row: any) => void;
9
10
  };
10
11
  export default class RolesCardViewController extends AbstractCapabilityCardViewController {
11
12
  static id: string;
12
13
  protected role: Role;
14
+ protected onInsertOrUpdateCapability: any;
13
15
  constructor(options: RolesCardViewControllerOptions);
14
16
  load(options: {
15
17
  organizationId?: string;
@@ -7,14 +7,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
+ import { assertOptions } from '@sprucelabs/schema';
10
11
  import { eventResponseUtil } from '@sprucelabs/spruce-event-utils';
11
12
  import AbstractCapabilityCardViewController from './AbstractCapabilityCardViewController.js';
12
13
  export default class RolesCardViewController extends AbstractCapabilityCardViewController {
13
14
  constructor(options) {
14
15
  super(options);
16
+ assertOptions(options, ['role', 'onInsertOrUpdateCapability']);
15
17
  this.role = options.role;
16
18
  this.onUpdateHasCapability = options.onUpdateHasCapability;
17
- this.onEdit = options.onEdit;
19
+ this.onInsertOrUpdateCapability = options.onInsertOrUpdateCapability;
20
+ this.onEdit = options === null || options === void 0 ? void 0 : options.onEdit;
18
21
  this.activeRecordCardVc = this.ActiveRecordCard(options.role);
19
22
  }
20
23
  load(options) {
@@ -37,35 +40,47 @@ export default class RolesCardViewController extends AbstractCapabilityCardViewC
37
40
  });
38
41
  }
39
42
  insertOrUpdateCapability(serviceId, values, serviceCapability) {
40
- var _a, _b;
41
43
  return __awaiter(this, void 0, void 0, function* () {
42
- const client = yield this.connectToApi();
43
- try {
44
- if (serviceCapability) {
45
- const [{ capability }] = yield client.emitAndFlattenResponses('appointments.update-role-capability::v2021_06_23', {
46
- target: {
47
- organizationId: (_a = this.organizationId) !== null && _a !== void 0 ? _a : 'org id',
48
- capabilityId: serviceCapability.id,
49
- },
50
- payload: Object.assign({}, values),
51
- });
52
- return capability;
53
- }
54
- else {
55
- const [{ capability }] = yield client.emitAndFlattenResponses('appointments.create-role-capability::v2021_06_23', {
56
- target: {
57
- organizationId: (_b = this.organizationId) !== null && _b !== void 0 ? _b : 'org id',
58
- roleId: this.role.id,
59
- },
60
- payload: Object.assign({ serviceId, isEnabled: true }, values),
61
- });
62
- return capability;
63
- }
64
- }
65
- catch (err) {
66
- yield this.alert({ message: err.message });
67
- }
68
- return;
44
+ return yield this.onInsertOrUpdateCapability(Object.assign(Object.assign({}, values), { serviceId, id: serviceCapability === null || serviceCapability === void 0 ? void 0 : serviceCapability.id }));
45
+ // else {
46
+ // try {
47
+ // if (serviceCapability) {
48
+ // const [{ capability }] = await client.emitAndFlattenResponses(
49
+ // 'appointments.update-role-capability::v2021_06_23',
50
+ // {
51
+ // target: {
52
+ // organizationId: this.organizationId ?? 'org id',
53
+ // capabilityId: serviceCapability.id,
54
+ // },
55
+ // payload: {
56
+ // ...values,
57
+ // },
58
+ // }
59
+ // )
60
+ // return capability
61
+ // } else {
62
+ // const [{ capability }] = await client.emitAndFlattenResponses(
63
+ // 'appointments.create-role-capability::v2021_06_23',
64
+ // {
65
+ // target: {
66
+ // organizationId: this.organizationId ?? 'org id',
67
+ // roleId: this.role.id,
68
+ // },
69
+ // payload: {
70
+ // serviceId,
71
+ // doesOffer: true,
72
+ // isEnabled: true,
73
+ // ...values,
74
+ // },
75
+ // }
76
+ // )
77
+ // return capability
78
+ // }
79
+ // } catch (err: any) {
80
+ // await this.alert({ message: err.message })
81
+ // }
82
+ // }
83
+ //return
69
84
  });
70
85
  }
71
86
  getCapabilities() {
@@ -10,7 +10,7 @@ class AbstractCapabilityCardViewController extends heartwood_view_controllers_1.
10
10
  ActiveRecordCard(row) {
11
11
  return this.Controller('activeRecordCard', (0, heartwood_view_controllers_1.buildActiveRecordCard)({
12
12
  id: row.id,
13
- columnWidths: ['fill'],
13
+ columnWidths: ['content', 'fill'],
14
14
  shouldRenderRowDividers: true,
15
15
  header: {
16
16
  title: row.name,
@@ -22,26 +22,37 @@ class AbstractCapabilityCardViewController extends heartwood_view_controllers_1.
22
22
  }));
23
23
  }
24
24
  buildRow(service) {
25
- var _a, _b, _c, _d;
25
+ var _a, _b, _c, _d, _e, _f;
26
26
  const serviceCapability = (_a = this.capabilities) === null || _a === void 0 ? void 0 : _a.find((r) => r.serviceId === service.id);
27
+ const rowId = service.id;
27
28
  return {
28
- id: service.id,
29
+ id: rowId,
29
30
  onClick: async () => {
30
31
  await this.handleEdit(service, serviceCapability);
31
32
  },
33
+ isEnabled: (_b = serviceCapability === null || serviceCapability === void 0 ? void 0 : serviceCapability.isEnabled) !== null && _b !== void 0 ? _b : true,
32
34
  cells: [
35
+ {
36
+ checkboxInput: {
37
+ name: 'isEnabled',
38
+ value: (_c = serviceCapability === null || serviceCapability === void 0 ? void 0 : serviceCapability.isEnabled) !== null && _c !== void 0 ? _c : true,
39
+ onChange: (value) => {
40
+ this.getListVc().getRowVc(service.id).setIsEnabled(value);
41
+ },
42
+ },
43
+ },
33
44
  {
34
45
  text: {
35
46
  content: service.name,
36
47
  },
37
48
  subText: {
38
- content: `$${(_b = serviceCapability === null || serviceCapability === void 0 ? void 0 : serviceCapability.price) !== null && _b !== void 0 ? _b : service.price} - ${this.calculateDuration((_c = serviceCapability === null || serviceCapability === void 0 ? void 0 : serviceCapability.timeBlocks) !== null && _c !== void 0 ? _c : service.timeBlocks)}`,
49
+ content: `$${(_d = serviceCapability === null || serviceCapability === void 0 ? void 0 : serviceCapability.price) !== null && _d !== void 0 ? _d : service.price} - ${this.calculateDuration((_e = serviceCapability === null || serviceCapability === void 0 ? void 0 : serviceCapability.timeBlocks) !== null && _e !== void 0 ? _e : service.timeBlocks)}`,
39
50
  },
40
51
  },
41
52
  {
42
53
  toggleInput: {
43
- name: 'isEnabled',
44
- value: (_d = serviceCapability === null || serviceCapability === void 0 ? void 0 : serviceCapability.isEnabled) !== null && _d !== void 0 ? _d : false,
54
+ name: 'doesOffer',
55
+ value: (_f = serviceCapability === null || serviceCapability === void 0 ? void 0 : serviceCapability.doesOffer) !== null && _f !== void 0 ? _f : false,
45
56
  onChange: async (value) => {
46
57
  await this.handleToggleChange(service, value !== null && value !== void 0 ? value : false, serviceCapability);
47
58
  },
@@ -56,7 +67,7 @@ class AbstractCapabilityCardViewController extends heartwood_view_controllers_1.
56
67
  onCancel: () => { },
57
68
  onSubmit: async (price, timeBlocks, serviceRow, serviceRoleCapability) => {
58
69
  await dlgVc.hide();
59
- const newServiceCapability = await this.insertOrUpdateCapability(serviceRow.id, { price, timeBlocks, isEnabled: true }, serviceRoleCapability);
70
+ const newServiceCapability = await this.insertOrUpdateCapability(serviceRow.id, { price, timeBlocks, isEnabled: true, doesOffer: true }, serviceRoleCapability);
60
71
  if (newServiceCapability) {
61
72
  this.upsertCapabilities(newServiceCapability, serviceRow);
62
73
  }
@@ -68,12 +79,14 @@ class AbstractCapabilityCardViewController extends heartwood_view_controllers_1.
68
79
  return (_a = this.onEdit) === null || _a === void 0 ? void 0 : _a.call(this, serviceRow);
69
80
  }
70
81
  upsertCapabilities(newServiceCapability, service) {
71
- var _a;
82
+ var _a, _b;
72
83
  const listVc = this.getListVc();
73
84
  if (newServiceCapability) {
74
- this.capabilities = (_a = this.capabilities) === null || _a === void 0 ? void 0 : _a.filter((r) => r.id !== newServiceCapability.id);
75
- this.capabilities.push(newServiceCapability);
76
- listVc.upsertRow(service.id, Object.assign({}, this.buildRow(service)));
85
+ const oldCapability = (_a = this.capabilities) === null || _a === void 0 ? void 0 : _a.find((r) => r.id === newServiceCapability.id);
86
+ this.capabilities = (_b = this.capabilities) === null || _b === void 0 ? void 0 : _b.filter((r) => r.id !== newServiceCapability.id);
87
+ const rowId = service.id;
88
+ this.capabilities.push(Object.assign(Object.assign({}, oldCapability), newServiceCapability));
89
+ listVc.upsertRow(rowId, Object.assign({}, this.buildRow(service)));
77
90
  listVc.triggerRender();
78
91
  this.getActiveRecordVc().triggerRender();
79
92
  }
@@ -81,7 +94,7 @@ class AbstractCapabilityCardViewController extends heartwood_view_controllers_1.
81
94
  async handleToggleChange(service, value, capability) {
82
95
  var _a;
83
96
  (_a = this.onUpdateHasCapability) === null || _a === void 0 ? void 0 : _a.call(this, service, value);
84
- const newCapability = await this.insertOrUpdateCapability(service.id, { isEnabled: value }, capability);
97
+ const newCapability = await this.insertOrUpdateCapability(service.id, { isEnabled: true, doesOffer: value }, capability);
85
98
  if (newCapability) {
86
99
  this.upsertCapabilities(newCapability, service);
87
100
  }
@@ -27,7 +27,7 @@ class EditOverrideDetailsCardViewController extends heartwood_view_controllers_1
27
27
  this.cardVc = this.CardVc();
28
28
  }
29
29
  FormVc() {
30
- var _a, _b, _c;
30
+ var _a, _b;
31
31
  return this.Controller('form', (0, heartwood_view_controllers_1.buildForm)({
32
32
  id: 'editOverrideForm',
33
33
  schema,
@@ -41,7 +41,13 @@ class EditOverrideDetailsCardViewController extends heartwood_view_controllers_1
41
41
  },
42
42
  sections: [
43
43
  {
44
- fields: ['price'],
44
+ fields: [
45
+ {
46
+ name: 'price',
47
+ label: 'Price',
48
+ placeholder: (_a = this.service) === null || _a === void 0 ? void 0 : _a.price,
49
+ },
50
+ ],
45
51
  },
46
52
  {
47
53
  title: 'Duration',
@@ -60,7 +66,7 @@ class EditOverrideDetailsCardViewController extends heartwood_view_controllers_1
60
66
  ],
61
67
  },
62
68
  values: {
63
- price: (_b = (_a = this.serviceRoleCapability) === null || _a === void 0 ? void 0 : _a.price) !== null && _b !== void 0 ? _b : (_c = this.service) === null || _c === void 0 ? void 0 : _c.price,
69
+ price: (_b = this.serviceRoleCapability) === null || _b === void 0 ? void 0 : _b.price,
64
70
  },
65
71
  }));
66
72
  }
@@ -35,7 +35,9 @@ class EditTimeBlockTitleCardViewController extends heartwood_view_controllers_1.
35
35
  },
36
36
  sections: [
37
37
  {
38
- fields: ['title'],
38
+ fields: [
39
+ { name: 'title', label: 'Title', placeholder: 'Duration' },
40
+ ],
39
41
  },
40
42
  ],
41
43
  values: { title: this.title },
@@ -4,12 +4,14 @@ declare type Role = SpruceSchemas.Spruce.v2020_07_22.Role;
4
4
  declare type ToggleHandler = (serviceId: string, isSelected: boolean) => void;
5
5
  export declare type RolesCardViewControllerOptions = ViewControllerOptions & {
6
6
  role: Role;
7
+ onInsertOrUpdateCapability: (values: any) => void;
7
8
  onUpdateHasCapability?: ToggleHandler;
8
9
  onEdit?: (row: any) => void;
9
10
  };
10
11
  export default class RolesCardViewController extends AbstractCapabilityCardViewController {
11
12
  static id: string;
12
13
  protected role: Role;
14
+ protected onInsertOrUpdateCapability: any;
13
15
  constructor(options: RolesCardViewControllerOptions);
14
16
  load(options: {
15
17
  organizationId?: string;
@@ -3,14 +3,17 @@ 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
+ const schema_1 = require("@sprucelabs/schema");
6
7
  const spruce_event_utils_1 = require("@sprucelabs/spruce-event-utils");
7
8
  const AbstractCapabilityCardViewController_1 = __importDefault(require("./AbstractCapabilityCardViewController"));
8
9
  class RolesCardViewController extends AbstractCapabilityCardViewController_1.default {
9
10
  constructor(options) {
10
11
  super(options);
12
+ (0, schema_1.assertOptions)(options, ['role', 'onInsertOrUpdateCapability']);
11
13
  this.role = options.role;
12
14
  this.onUpdateHasCapability = options.onUpdateHasCapability;
13
- this.onEdit = options.onEdit;
15
+ this.onInsertOrUpdateCapability = options.onInsertOrUpdateCapability;
16
+ this.onEdit = options === null || options === void 0 ? void 0 : options.onEdit;
14
17
  this.activeRecordCardVc = this.ActiveRecordCard(options.role);
15
18
  }
16
19
  async load(options) {
@@ -29,34 +32,46 @@ class RolesCardViewController extends AbstractCapabilityCardViewController_1.def
29
32
  this.capabilities = capabilities;
30
33
  }
31
34
  async insertOrUpdateCapability(serviceId, values, serviceCapability) {
32
- var _a, _b;
33
- const client = await this.connectToApi();
34
- try {
35
- if (serviceCapability) {
36
- const [{ capability }] = await client.emitAndFlattenResponses('appointments.update-role-capability::v2021_06_23', {
37
- target: {
38
- organizationId: (_a = this.organizationId) !== null && _a !== void 0 ? _a : 'org id',
39
- capabilityId: serviceCapability.id,
40
- },
41
- payload: Object.assign({}, values),
42
- });
43
- return capability;
44
- }
45
- else {
46
- const [{ capability }] = await client.emitAndFlattenResponses('appointments.create-role-capability::v2021_06_23', {
47
- target: {
48
- organizationId: (_b = this.organizationId) !== null && _b !== void 0 ? _b : 'org id',
49
- roleId: this.role.id,
50
- },
51
- payload: Object.assign({ serviceId, isEnabled: true }, values),
52
- });
53
- return capability;
54
- }
55
- }
56
- catch (err) {
57
- await this.alert({ message: err.message });
58
- }
59
- return;
35
+ return await this.onInsertOrUpdateCapability(Object.assign(Object.assign({}, values), { serviceId, id: serviceCapability === null || serviceCapability === void 0 ? void 0 : serviceCapability.id }));
36
+ // else {
37
+ // try {
38
+ // if (serviceCapability) {
39
+ // const [{ capability }] = await client.emitAndFlattenResponses(
40
+ // 'appointments.update-role-capability::v2021_06_23',
41
+ // {
42
+ // target: {
43
+ // organizationId: this.organizationId ?? 'org id',
44
+ // capabilityId: serviceCapability.id,
45
+ // },
46
+ // payload: {
47
+ // ...values,
48
+ // },
49
+ // }
50
+ // )
51
+ // return capability
52
+ // } else {
53
+ // const [{ capability }] = await client.emitAndFlattenResponses(
54
+ // 'appointments.create-role-capability::v2021_06_23',
55
+ // {
56
+ // target: {
57
+ // organizationId: this.organizationId ?? 'org id',
58
+ // roleId: this.role.id,
59
+ // },
60
+ // payload: {
61
+ // serviceId,
62
+ // doesOffer: true,
63
+ // isEnabled: true,
64
+ // ...values,
65
+ // },
66
+ // }
67
+ // )
68
+ // return capability
69
+ // }
70
+ // } catch (err: any) {
71
+ // await this.alert({ message: err.message })
72
+ // }
73
+ // }
74
+ //return
60
75
  }
61
76
  getCapabilities() {
62
77
  return this.capabilities;
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": "5.2.8",
4
+ "version": "6.1.1",
5
5
  "skill": {
6
6
  "namespace": "appointments"
7
7
  },