@sprucelabs/heartwood-view-controllers 115.0.4 → 116.0.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.
@@ -1,4 +1,4 @@
1
- import { CachedValue, Device } from '../types/heartwood.types';
1
+ import { CachedValue, Device, TheaterSettingValueTypes, TheatreSettingName } from '../types/heartwood.types';
2
2
  export default class SpyDevice implements Device {
3
3
  lastCommand?: string;
4
4
  vibrateCount: number;
@@ -7,15 +7,15 @@ export default class SpyDevice implements Device {
7
7
  openedUrl?: string;
8
8
  lastCommandPayload?: Record<string, any>;
9
9
  allCommands: TrackedCommand[];
10
- private isKioskMode;
10
+ private kioskSettings;
11
11
  setCachedValue(key: string, value: CachedValue): void;
12
12
  openUrl(url: string): void;
13
13
  getCachedValue(key: string): CachedValue;
14
14
  vibrate(): void;
15
15
  call(phoneNumber: string): void;
16
16
  sendCommand(command: string, payload?: Record<string, any>): void;
17
- getIsKioskModeEnabled(): Promise<boolean>;
18
- setIsKioskModeEnabled(isKiosk: boolean): void;
17
+ setTheatreSetting<N extends TheatreSettingName>(name: N, value: TheaterSettingValueTypes[N]): void;
18
+ getTheatreSetting<N extends TheatreSettingName>(name: N): Promise<TheaterSettingValueTypes[N] | null>;
19
19
  }
20
20
  interface TrackedCommand {
21
21
  command: string;
@@ -12,7 +12,7 @@ export default class SpyDevice {
12
12
  this.vibrateCount = 0;
13
13
  this.cachedValues = {};
14
14
  this.allCommands = [];
15
- this.isKioskMode = false;
15
+ this.kioskSettings = {};
16
16
  }
17
17
  setCachedValue(key, value) {
18
18
  this.cachedValues[key] = value;
@@ -34,12 +34,13 @@ export default class SpyDevice {
34
34
  this.lastCommandPayload = payload;
35
35
  this.allCommands.push({ command, payload });
36
36
  }
37
- getIsKioskModeEnabled() {
37
+ setTheatreSetting(name, value) {
38
+ this.kioskSettings[name] = value;
39
+ }
40
+ getTheatreSetting(name) {
38
41
  return __awaiter(this, void 0, void 0, function* () {
39
- return this.isKioskMode;
42
+ var _a;
43
+ return ((_a = this.kioskSettings[name]) !== null && _a !== void 0 ? _a : null);
40
44
  });
41
45
  }
42
- setIsKioskModeEnabled(isKiosk) {
43
- this.isKioskMode = isKiosk;
44
- }
45
46
  }
@@ -457,6 +457,12 @@ export type TimezoneName = ITimezoneName;
457
457
  */
458
458
  export type Locale = ILocale;
459
459
  export type CachedValue = string | number | Record<string, any> | boolean | null;
460
+ export type TheatreSettingName = 'kiosk-mode' | 'load-url' | 'log-destination';
461
+ export interface TheaterSettingValueTypes {
462
+ 'kiosk-mode': boolean;
463
+ 'load-url': string;
464
+ 'log-destination': 'console' | 'file';
465
+ }
460
466
  export interface Device {
461
467
  openUrl(url: string): void;
462
468
  vibrate(): void;
@@ -464,8 +470,8 @@ export interface Device {
464
470
  setCachedValue(key: string, value: CachedValue): void;
465
471
  getCachedValue(key: string): CachedValue;
466
472
  sendCommand(command: string, payload?: Record<string, any>): void;
467
- getIsKioskModeEnabled(): Promise<boolean>;
468
- setIsKioskModeEnabled(isKiosk: boolean): void;
473
+ setTheatreSetting<N extends TheatreSettingName>(name: N, value: TheaterSettingValueTypes[N]): void;
474
+ getTheatreSetting<N extends TheatreSettingName>(name: N): Promise<TheaterSettingValueTypes[N] | null>;
469
475
  }
470
476
  export interface AuthorizerCanOptions<ContractId extends PermissionContractId, Ids extends PermissionId<ContractId> = PermissionId<ContractId>> {
471
477
  contractId: ContractId;
@@ -1,4 +1,4 @@
1
- import { CachedValue, Device } from '../types/heartwood.types';
1
+ import { CachedValue, Device, TheaterSettingValueTypes, TheatreSettingName } from '../types/heartwood.types';
2
2
  export default class SpyDevice implements Device {
3
3
  lastCommand?: string;
4
4
  vibrateCount: number;
@@ -7,15 +7,15 @@ export default class SpyDevice implements Device {
7
7
  openedUrl?: string;
8
8
  lastCommandPayload?: Record<string, any>;
9
9
  allCommands: TrackedCommand[];
10
- private isKioskMode;
10
+ private kioskSettings;
11
11
  setCachedValue(key: string, value: CachedValue): void;
12
12
  openUrl(url: string): void;
13
13
  getCachedValue(key: string): CachedValue;
14
14
  vibrate(): void;
15
15
  call(phoneNumber: string): void;
16
16
  sendCommand(command: string, payload?: Record<string, any>): void;
17
- getIsKioskModeEnabled(): Promise<boolean>;
18
- setIsKioskModeEnabled(isKiosk: boolean): void;
17
+ setTheatreSetting<N extends TheatreSettingName>(name: N, value: TheaterSettingValueTypes[N]): void;
18
+ getTheatreSetting<N extends TheatreSettingName>(name: N): Promise<TheaterSettingValueTypes[N] | null>;
19
19
  }
20
20
  interface TrackedCommand {
21
21
  command: string;
@@ -5,7 +5,7 @@ class SpyDevice {
5
5
  this.vibrateCount = 0;
6
6
  this.cachedValues = {};
7
7
  this.allCommands = [];
8
- this.isKioskMode = false;
8
+ this.kioskSettings = {};
9
9
  }
10
10
  setCachedValue(key, value) {
11
11
  this.cachedValues[key] = value;
@@ -27,11 +27,12 @@ class SpyDevice {
27
27
  this.lastCommandPayload = payload;
28
28
  this.allCommands.push({ command, payload });
29
29
  }
30
- async getIsKioskModeEnabled() {
31
- return this.isKioskMode;
30
+ setTheatreSetting(name, value) {
31
+ this.kioskSettings[name] = value;
32
32
  }
33
- setIsKioskModeEnabled(isKiosk) {
34
- this.isKioskMode = isKiosk;
33
+ async getTheatreSetting(name) {
34
+ return (this.kioskSettings[name] ??
35
+ null);
35
36
  }
36
37
  }
37
38
  exports.default = SpyDevice;
@@ -457,6 +457,12 @@ export type TimezoneName = ITimezoneName;
457
457
  */
458
458
  export type Locale = ILocale;
459
459
  export type CachedValue = string | number | Record<string, any> | boolean | null;
460
+ export type TheatreSettingName = 'kiosk-mode' | 'load-url' | 'log-destination';
461
+ export interface TheaterSettingValueTypes {
462
+ 'kiosk-mode': boolean;
463
+ 'load-url': string;
464
+ 'log-destination': 'console' | 'file';
465
+ }
460
466
  export interface Device {
461
467
  openUrl(url: string): void;
462
468
  vibrate(): void;
@@ -464,8 +470,8 @@ export interface Device {
464
470
  setCachedValue(key: string, value: CachedValue): void;
465
471
  getCachedValue(key: string): CachedValue;
466
472
  sendCommand(command: string, payload?: Record<string, any>): void;
467
- getIsKioskModeEnabled(): Promise<boolean>;
468
- setIsKioskModeEnabled(isKiosk: boolean): void;
473
+ setTheatreSetting<N extends TheatreSettingName>(name: N, value: TheaterSettingValueTypes[N]): void;
474
+ getTheatreSetting<N extends TheatreSettingName>(name: N): Promise<TheaterSettingValueTypes[N] | null>;
469
475
  }
470
476
  export interface AuthorizerCanOptions<ContractId extends PermissionContractId, Ids extends PermissionId<ContractId> = PermissionId<ContractId>> {
471
477
  contractId: ContractId;
package/package.json CHANGED
@@ -13,7 +13,7 @@
13
13
  "sideEffects": false,
14
14
  "license": "MIT",
15
15
  "description": "All the power of Heartwood in one, convenient package.",
16
- "version": "115.0.4",
16
+ "version": "116.0.1",
17
17
  "skill": {
18
18
  "namespace": "HeartwoodViewControllers",
19
19
  "commandOverrides": {
@@ -77,15 +77,15 @@
77
77
  "@babel/plugin-transform-runtime": "^7.25.9",
78
78
  "@babel/preset-env": "^7.26.0",
79
79
  "@babel/preset-typescript": "^7.26.0",
80
- "@sprucelabs/calendar-utils": "^42.0.573",
80
+ "@sprucelabs/calendar-utils": "^42.0.574",
81
81
  "@sprucelabs/error": "^6.0.561",
82
82
  "@sprucelabs/globby": "^2.0.501",
83
- "@sprucelabs/mercury-core-events": "^25.0.118",
84
- "@sprucelabs/mercury-types": "^47.0.652",
85
- "@sprucelabs/schema": "^31.0.12",
86
- "@sprucelabs/spruce-core-schemas": "^40.1.597",
87
- "@sprucelabs/spruce-event-utils": "^40.1.381",
88
- "@sprucelabs/spruce-skill-utils": "^31.2.2",
83
+ "@sprucelabs/mercury-core-events": "^25.0.119",
84
+ "@sprucelabs/mercury-types": "^47.0.653",
85
+ "@sprucelabs/schema": "^31.0.13",
86
+ "@sprucelabs/spruce-core-schemas": "^40.1.598",
87
+ "@sprucelabs/spruce-event-utils": "^40.1.382",
88
+ "@sprucelabs/spruce-skill-utils": "^31.2.3",
89
89
  "@sprucelabs/test-utils": "^5.1.539",
90
90
  "@swc/core": "1.2.103",
91
91
  "babel-loader": "^9.2.1",
@@ -101,8 +101,8 @@
101
101
  "devDependencies": {
102
102
  "@sprucelabs/esm-postbuild": "^6.0.536",
103
103
  "@sprucelabs/jest-json-reporter": "^8.0.563",
104
- "@sprucelabs/mercury-client": "^42.0.673",
105
- "@sprucelabs/mercury-event-emitter": "^42.0.673",
104
+ "@sprucelabs/mercury-client": "^42.0.674",
105
+ "@sprucelabs/mercury-event-emitter": "^42.0.674",
106
106
  "@sprucelabs/resolve-path-aliases": "^2.0.525",
107
107
  "@sprucelabs/semantic-release": "^5.0.2",
108
108
  "@sprucelabs/test": "^9.0.66",