@shaxpir/duiduidui-models 1.9.14 → 1.9.16

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.
@@ -21,6 +21,7 @@ export interface ManifestEntry {
21
21
  }
22
22
  export interface ManifestPayload {
23
23
  billing: any;
24
+ collection: any;
24
25
  device: any;
25
26
  image: any;
26
27
  metric: any;
@@ -27,6 +27,7 @@ class Manifest extends Model_1.Model {
27
27
  },
28
28
  payload: {
29
29
  billing: {},
30
+ collection: {},
30
31
  device: {},
31
32
  image: {},
32
33
  metric: {},
@@ -13,6 +13,7 @@ export type VoicePreference = 'onyx' | 'sage' | 'random';
13
13
  export interface WorkspacePayload {
14
14
  devices: ContentId[];
15
15
  sessions: MultiTime[];
16
+ collections: string[];
16
17
  journey: {
17
18
  [key: string]: CompactDateTime;
18
19
  };
@@ -27,6 +28,7 @@ export interface WorkspaceBody extends ContentBody {
27
28
  export declare class Workspace extends Content {
28
29
  private _devicesView;
29
30
  private _sessionsView;
31
+ private _collectionsView;
30
32
  private _uploadedAvatarsView;
31
33
  constructor(doc: Doc, shouldAcquire: boolean, shareSync: ShareSync);
32
34
  get payload(): WorkspacePayload;
@@ -39,6 +41,7 @@ export declare class Workspace extends Content {
39
41
  static validatePayload(payload: WorkspacePayload): void;
40
42
  static create(userId: ContentId, payload: WorkspacePayload): Workspace;
41
43
  get sessions(): ArrayView<MultiTime>;
44
+ get collections(): ArrayView<string>;
42
45
  get devices(): ArrayView<ContentId>;
43
46
  get uploadedAvatars(): ArrayView<ContentId>;
44
47
  acquireSessionForUtcTime(utcTime: CompactDateTime): Promise<Session | null>;
@@ -13,6 +13,7 @@ class Workspace extends Content_1.Content {
13
13
  super(doc, shouldAcquire, shareSync);
14
14
  this._devicesView = new ArrayView_1.ArrayView(this, ['payload', 'devices']);
15
15
  this._sessionsView = new ArrayView_1.ArrayView(this, ['payload', 'sessions']);
16
+ this._collectionsView = new ArrayView_1.ArrayView(this, ['payload', 'collections']);
16
17
  this._uploadedAvatarsView = new ArrayView_1.ArrayView(this, ['payload', 'uploaded_avatars']);
17
18
  }
18
19
  get payload() {
@@ -39,6 +40,9 @@ class Workspace extends Content_1.Content {
39
40
  if (!Array.isArray(payload.sessions)) {
40
41
  throw new Error('Workspace.create: payload.sessions must be an array');
41
42
  }
43
+ if (!Array.isArray(payload.collections)) {
44
+ throw new Error('Workspace.create: payload.collections must be an array');
45
+ }
42
46
  if (!payload.journey || typeof payload.journey !== 'object' || Array.isArray(payload.journey)) {
43
47
  throw new Error('Workspace.create: payload.journey must be an object');
44
48
  }
@@ -69,6 +73,10 @@ class Workspace extends Content_1.Content {
69
73
  this.checkDisposed("Workspace.sessions");
70
74
  return this._sessionsView;
71
75
  }
76
+ get collections() {
77
+ this.checkDisposed("Workspace.collections");
78
+ return this._collectionsView;
79
+ }
72
80
  // NOTE: As the user adds devices, we will always add new devices to the end of the array.
73
81
  // So the most-recently-added device will always be at the end.
74
82
  get devices() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shaxpir/duiduidui-models",
3
- "version": "1.9.14",
3
+ "version": "1.9.16",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/shaxpir/duiduidui-models"