@shaxpir/duiduidui-models 1.9.8 → 1.9.10

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,5 +1,9 @@
1
1
  import { MultiTime } from '@shaxpir/shaxpir-common';
2
2
  import { ContentId } from './Content';
3
+ export interface CachedAudioFile {
4
+ voice: string;
5
+ filename: string;
6
+ }
3
7
  export interface PhraseFlag {
4
8
  _id: string;
5
9
  user_id: ContentId;
@@ -14,5 +18,6 @@ export interface PhraseFlag {
14
18
  bad_notes: boolean;
15
19
  };
16
20
  details: string;
21
+ audio_files?: CachedAudioFile[];
17
22
  created_at: MultiTime;
18
23
  }
@@ -9,6 +9,7 @@ export interface JourneyEntry {
9
9
  key: string;
10
10
  at_utc_time: CompactDateTime;
11
11
  }
12
+ export type VoicePreference = 'onyx' | 'sage' | 'random';
12
13
  export interface WorkspacePayload {
13
14
  devices: ContentId[];
14
15
  sessions: MultiTime[];
@@ -17,6 +18,7 @@ export interface WorkspacePayload {
17
18
  };
18
19
  global_conditions: ConditionFilters;
19
20
  uploaded_avatars: ContentId[];
21
+ default_voice?: VoicePreference;
20
22
  }
21
23
  export interface WorkspaceBody extends ContentBody {
22
24
  meta: ContentMeta;
@@ -45,4 +47,6 @@ export declare class Workspace extends Content {
45
47
  getJourneyDate(journeyKey: string): CompactDateTime;
46
48
  setJourneyDate(journeyKey: string, journeyDate: CompactDateTime): void;
47
49
  setGlobalConditions(filters: ConditionFilters): void;
50
+ get defaultVoice(): VoicePreference;
51
+ setDefaultVoice(value: VoicePreference): void;
48
52
  }
@@ -136,5 +136,17 @@ class Workspace extends Content_1.Content {
136
136
  batch.setPathValue(['payload', 'global_conditions'], filters);
137
137
  batch.commit();
138
138
  }
139
+ get defaultVoice() {
140
+ this.checkDisposed("Workspace.defaultVoice");
141
+ return this.payload.default_voice || 'onyx';
142
+ }
143
+ setDefaultVoice(value) {
144
+ this.checkDisposed("Workspace.setDefaultVoice");
145
+ if (this.defaultVoice !== value) {
146
+ const batch = new Operation_1.BatchOperation(this);
147
+ batch.setPathValue(['payload', 'default_voice'], value);
148
+ batch.commit();
149
+ }
150
+ }
139
151
  }
140
152
  exports.Workspace = Workspace;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shaxpir/duiduidui-models",
3
- "version": "1.9.8",
3
+ "version": "1.9.10",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/shaxpir/duiduidui-models"