@shaxpir/duiduidui-models 1.0.0
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/README.md +1 -0
- package/decs.d.ts +87 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +20 -0
- package/dist/models/OutboundMessage.d.ts +18 -0
- package/dist/models/OutboundMessage.js +25 -0
- package/dist/models/content/Activity.d.ts +10 -0
- package/dist/models/content/Activity.js +2 -0
- package/dist/models/content/ArrayView.d.ts +26 -0
- package/dist/models/content/ArrayView.js +174 -0
- package/dist/models/content/Billing.d.ts +144 -0
- package/dist/models/content/Billing.js +418 -0
- package/dist/models/content/Book.d.ts +77 -0
- package/dist/models/content/Book.js +407 -0
- package/dist/models/content/Category.d.ts +16 -0
- package/dist/models/content/Category.js +20 -0
- package/dist/models/content/Checkpointable.d.ts +21 -0
- package/dist/models/content/Checkpointable.js +156 -0
- package/dist/models/content/Comment.d.ts +19 -0
- package/dist/models/content/Comment.js +53 -0
- package/dist/models/content/ConceptArt.d.ts +31 -0
- package/dist/models/content/ConceptArt.js +84 -0
- package/dist/models/content/Content.d.ts +52 -0
- package/dist/models/content/Content.js +61 -0
- package/dist/models/content/ContentKind.d.ts +10 -0
- package/dist/models/content/ContentKind.js +16 -0
- package/dist/models/content/Context.d.ts +28 -0
- package/dist/models/content/Context.js +162 -0
- package/dist/models/content/DevEnv.d.ts +5 -0
- package/dist/models/content/DevEnv.js +9 -0
- package/dist/models/content/Device.d.ts +24 -0
- package/dist/models/content/Device.js +62 -0
- package/dist/models/content/Dictionary.d.ts +31 -0
- package/dist/models/content/Dictionary.js +5 -0
- package/dist/models/content/DictionaryEntry.d.ts +20 -0
- package/dist/models/content/DictionaryEntry.js +2 -0
- package/dist/models/content/ElasticModel.d.ts +149 -0
- package/dist/models/content/ElasticModel.js +179 -0
- package/dist/models/content/Environment.d.ts +61 -0
- package/dist/models/content/Environment.js +124 -0
- package/dist/models/content/ExportOptions.d.ts +64 -0
- package/dist/models/content/ExportOptions.js +213 -0
- package/dist/models/content/Folder.d.ts +16 -0
- package/dist/models/content/Folder.js +33 -0
- package/dist/models/content/Fragment.d.ts +54 -0
- package/dist/models/content/Fragment.js +181 -0
- package/dist/models/content/GeoLocation.d.ts +4 -0
- package/dist/models/content/GeoLocation.js +2 -0
- package/dist/models/content/Hanzi.d.ts +21 -0
- package/dist/models/content/Hanzi.js +2 -0
- package/dist/models/content/HighlightRule.d.ts +9 -0
- package/dist/models/content/HighlightRule.js +2 -0
- package/dist/models/content/Manifest.d.ts +42 -0
- package/dist/models/content/Manifest.js +114 -0
- package/dist/models/content/Media.d.ts +32 -0
- package/dist/models/content/Media.js +98 -0
- package/dist/models/content/Metric.d.ts +46 -0
- package/dist/models/content/Metric.js +183 -0
- package/dist/models/content/Migration.d.ts +68 -0
- package/dist/models/content/Migration.js +155 -0
- package/dist/models/content/Model.d.ts +45 -0
- package/dist/models/content/Model.js +280 -0
- package/dist/models/content/Permissions.d.ts +7 -0
- package/dist/models/content/Permissions.js +20 -0
- package/dist/models/content/Phrase.d.ts +8 -0
- package/dist/models/content/Phrase.js +2 -0
- package/dist/models/content/Placeholder.d.ts +8 -0
- package/dist/models/content/Placeholder.js +36 -0
- package/dist/models/content/Profile.d.ts +30 -0
- package/dist/models/content/Profile.js +95 -0
- package/dist/models/content/RichText.d.ts +58 -0
- package/dist/models/content/RichText.js +79 -0
- package/dist/models/content/Session.d.ts +39 -0
- package/dist/models/content/Session.js +173 -0
- package/dist/models/content/Speech.d.ts +67 -0
- package/dist/models/content/Speech.js +97 -0
- package/dist/models/content/Stub.d.ts +24 -0
- package/dist/models/content/Stub.js +179 -0
- package/dist/models/content/Time.d.ts +56 -0
- package/dist/models/content/Time.js +295 -0
- package/dist/models/content/User.d.ts +36 -0
- package/dist/models/content/User.js +95 -0
- package/dist/models/content/Workspace.d.ts +71 -0
- package/dist/models/content/Workspace.js +237 -0
- package/dist/models/content/index.d.ts +36 -0
- package/dist/models/content/index.js +53 -0
- package/dist/models/index.d.ts +4 -0
- package/dist/models/index.js +21 -0
- package/dist/models/legacy/LegacyBodyFormat.d.ts +9 -0
- package/dist/models/legacy/LegacyBodyFormat.js +2 -0
- package/dist/models/legacy/LegacyComment.d.ts +12 -0
- package/dist/models/legacy/LegacyComment.js +2 -0
- package/dist/models/legacy/LegacyContent.d.ts +53 -0
- package/dist/models/legacy/LegacyContent.js +55 -0
- package/dist/models/legacy/LegacyConversion.d.ts +55 -0
- package/dist/models/legacy/LegacyConversion.js +401 -0
- package/dist/models/legacy/LegacyFragment.d.ts +21 -0
- package/dist/models/legacy/LegacyFragment.js +2 -0
- package/dist/models/legacy/LegacyLocator.d.ts +8 -0
- package/dist/models/legacy/LegacyLocator.js +31 -0
- package/dist/models/legacy/LegacyOutboundMessage.d.ts +16 -0
- package/dist/models/legacy/LegacyOutboundMessage.js +13 -0
- package/dist/models/legacy/LegacyPicture.d.ts +14 -0
- package/dist/models/legacy/LegacyPicture.js +2 -0
- package/dist/models/legacy/LegacyProfile.d.ts +9 -0
- package/dist/models/legacy/LegacyProfile.js +2 -0
- package/dist/models/legacy/LegacySession.d.ts +41 -0
- package/dist/models/legacy/LegacySession.js +35 -0
- package/dist/models/legacy/LegacyStory.d.ts +23 -0
- package/dist/models/legacy/LegacyStory.js +2 -0
- package/dist/models/legacy/LegacyStub.d.ts +15 -0
- package/dist/models/legacy/LegacyStub.js +2 -0
- package/dist/models/legacy/LegacyTransaction.d.ts +14 -0
- package/dist/models/legacy/LegacyTransaction.js +49 -0
- package/dist/models/legacy/LegacyUser.d.ts +28 -0
- package/dist/models/legacy/LegacyUser.js +32 -0
- package/dist/models/legacy/LegacyWorkspace.d.ts +23 -0
- package/dist/models/legacy/LegacyWorkspace.js +6 -0
- package/dist/models/legacy/index.d.ts +15 -0
- package/dist/models/legacy/index.js +32 -0
- package/dist/models/markup/BodyFormat.d.ts +14 -0
- package/dist/models/markup/BodyFormat.js +190 -0
- package/dist/models/markup/ChangeModel.d.ts +22 -0
- package/dist/models/markup/ChangeModel.js +107 -0
- package/dist/models/markup/DeltaOps.d.ts +5 -0
- package/dist/models/markup/DeltaOps.js +74 -0
- package/dist/models/markup/HtmlMarkup.d.ts +4 -0
- package/dist/models/markup/HtmlMarkup.js +21 -0
- package/dist/models/markup/Operation.d.ts +32 -0
- package/dist/models/markup/Operation.js +194 -0
- package/dist/models/markup/TextEditOps.d.ts +9 -0
- package/dist/models/markup/TextEditOps.js +50 -0
- package/dist/models/markup/index.d.ts +6 -0
- package/dist/models/markup/index.js +23 -0
- package/dist/repo/ConnectionListener.d.ts +9 -0
- package/dist/repo/ConnectionListener.js +21 -0
- package/dist/repo/PermissiveJson1.d.ts +58 -0
- package/dist/repo/PermissiveJson1.js +39 -0
- package/dist/repo/ShareSync.d.ts +60 -0
- package/dist/repo/ShareSync.js +348 -0
- package/dist/repo/index.d.ts +3 -0
- package/dist/repo/index.js +20 -0
- package/dist/util/Async.d.ts +8 -0
- package/dist/util/Async.js +18 -0
- package/dist/util/Base62.d.ts +6 -0
- package/dist/util/Base62.js +47 -0
- package/dist/util/BinarySearch.d.ts +7 -0
- package/dist/util/BinarySearch.js +46 -0
- package/dist/util/CachingHasher.d.ts +8 -0
- package/dist/util/CachingHasher.js +41 -0
- package/dist/util/Color.d.ts +32 -0
- package/dist/util/Color.js +204 -0
- package/dist/util/Dispatch.d.ts +15 -0
- package/dist/util/Dispatch.js +79 -0
- package/dist/util/EditDistance.d.ts +13 -0
- package/dist/util/EditDistance.js +184 -0
- package/dist/util/Encryption.d.ts +5 -0
- package/dist/util/Encryption.js +2 -0
- package/dist/util/Logging.d.ts +108 -0
- package/dist/util/Logging.js +412 -0
- package/dist/util/NumberFormat.d.ts +14 -0
- package/dist/util/NumberFormat.js +224 -0
- package/dist/util/Struct.d.ts +4 -0
- package/dist/util/Struct.js +15 -0
- package/dist/util/Template.d.ts +16 -0
- package/dist/util/Template.js +128 -0
- package/dist/util/Text.d.ts +45 -0
- package/dist/util/Text.js +243 -0
- package/dist/util/Tuples.d.ts +9 -0
- package/dist/util/Tuples.js +135 -0
- package/dist/util/Validate.d.ts +4 -0
- package/dist/util/Validate.js +11 -0
- package/dist/util/Vocabulary.d.ts +3 -0
- package/dist/util/Vocabulary.js +35 -0
- package/dist/util/index.d.ts +16 -0
- package/dist/util/index.js +33 -0
- package/lib/models/content/ArrayView.ts +203 -0
- package/lib/models/content/Billing.ts +558 -0
- package/lib/models/content/Content.ts +110 -0
- package/lib/models/content/ContentKind.ts +14 -0
- package/lib/models/content/DevEnv.ts +5 -0
- package/lib/models/content/Device.ts +86 -0
- package/lib/models/content/DictionaryEntry.ts +22 -0
- package/lib/models/content/GeoLocation.ts +4 -0
- package/lib/models/content/Hanzi.ts +25 -0
- package/lib/models/content/Manifest.ts +162 -0
- package/lib/models/content/Media.ts +126 -0
- package/lib/models/content/Model.ts +327 -0
- package/lib/models/content/Permissions.ts +21 -0
- package/lib/models/content/Phrase.ts +10 -0
- package/lib/models/content/Profile.ts +119 -0
- package/lib/models/content/Time.ts +328 -0
- package/lib/models/content/User.ts +130 -0
- package/lib/models/markup/ChangeModel.ts +95 -0
- package/lib/models/markup/DeltaOps.ts +71 -0
- package/lib/models/markup/Operation.ts +215 -0
- package/lib/models/markup/TextEditOps.ts +50 -0
- package/lib/repo/ConnectionListener.ts +25 -0
- package/lib/repo/PermissiveJson1.ts +14 -0
- package/lib/repo/ShareSync.ts +390 -0
- package/lib/util/Base62.ts +47 -0
- package/lib/util/CachingHasher.ts +38 -0
- package/lib/util/Dispatch.ts +92 -0
- package/lib/util/Encryption.ts +5 -0
- package/lib/util/Logging.ts +568 -0
- package/lib/util/NumberFormat.ts +194 -0
- package/lib/util/Struct.ts +14 -0
- package/lib/util/Tuples.ts +131 -0
- package/package.json +41 -0
- package/tsconfig.json +25 -0
- package/tslint.json +46 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/// <reference path="../../../decs.d.ts" />
|
|
2
|
+
import { Doc } from '@shaxpir/sharedb/lib/client';
|
|
3
|
+
import { ShareSync } from "../../repo/ShareSync";
|
|
4
|
+
import { ArrayView } from './ArrayView';
|
|
5
|
+
import { Book } from "./Book";
|
|
6
|
+
import { ContentBody, ContentId, ContentMeta } from './Content';
|
|
7
|
+
import { Context } from './Context';
|
|
8
|
+
import { Fragment } from "./Fragment";
|
|
9
|
+
import { Session } from "./Session";
|
|
10
|
+
import { Stub } from "./Stub";
|
|
11
|
+
import { CompactDate, CompactDateTime, MultiTime } from './Time';
|
|
12
|
+
export interface JourneyEntry {
|
|
13
|
+
key: string;
|
|
14
|
+
at_utc_time: CompactDateTime;
|
|
15
|
+
}
|
|
16
|
+
export interface WorkspacePayload {
|
|
17
|
+
devices: ContentId[];
|
|
18
|
+
books: Stub[];
|
|
19
|
+
shorts: Stub[];
|
|
20
|
+
articles: Stub[];
|
|
21
|
+
poems: Stub[];
|
|
22
|
+
ideas: Stub[];
|
|
23
|
+
trash: Stub[];
|
|
24
|
+
sessions: MultiTime[];
|
|
25
|
+
journey?: {
|
|
26
|
+
[key: string]: CompactDateTime;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export interface WorkspaceBody extends ContentBody {
|
|
30
|
+
meta: ContentMeta;
|
|
31
|
+
payload: WorkspacePayload;
|
|
32
|
+
}
|
|
33
|
+
export declare enum WorkspaceStubArrayKey {
|
|
34
|
+
BOOKS = "books",
|
|
35
|
+
SHORTS = "shorts",
|
|
36
|
+
ARTICLES = "articles",
|
|
37
|
+
POEMS = "poems",
|
|
38
|
+
IDEAS = "ideas",
|
|
39
|
+
TRASH = "trash"
|
|
40
|
+
}
|
|
41
|
+
export declare class Workspace extends Context {
|
|
42
|
+
private _articlesView;
|
|
43
|
+
private _booksView;
|
|
44
|
+
private _ideasView;
|
|
45
|
+
private _poemsView;
|
|
46
|
+
private _shortsView;
|
|
47
|
+
private _devicesView;
|
|
48
|
+
private _sessionsView;
|
|
49
|
+
constructor(doc: Doc, shouldAcquire: boolean, shareSync: ShareSync);
|
|
50
|
+
get payload(): WorkspacePayload;
|
|
51
|
+
static makeWorkspaceId(userId: ContentId): ContentId;
|
|
52
|
+
static create(userId: ContentId, deviceId: ContentId): Workspace;
|
|
53
|
+
ensureLatestSchema(): Workspace;
|
|
54
|
+
get articles(): ArrayView<Stub>;
|
|
55
|
+
get books(): ArrayView<Stub>;
|
|
56
|
+
get ideas(): ArrayView<Stub>;
|
|
57
|
+
get poems(): ArrayView<Stub>;
|
|
58
|
+
get shorts(): ArrayView<Stub>;
|
|
59
|
+
get sessions(): ArrayView<MultiTime>;
|
|
60
|
+
getStubArrayKeys(): WorkspaceStubArrayKey[];
|
|
61
|
+
getStubArrayView(key: WorkspaceStubArrayKey): ArrayView<Stub>;
|
|
62
|
+
get devices(): ArrayView<ContentId>;
|
|
63
|
+
addBook(book: Book, activeId: ContentId): void;
|
|
64
|
+
addFragment(fragment: Fragment, stubArrayKey: WorkspaceStubArrayKey, activeId: ContentId): void;
|
|
65
|
+
acquireSessionsFromDate(sessionId: ContentId, localDate: CompactDate): Promise<Session[]>;
|
|
66
|
+
isBookFolderId(id: ContentId): boolean;
|
|
67
|
+
hasJourneyDate(journeyKey: string): boolean;
|
|
68
|
+
getJourneyDate(journeyKey: string): CompactDateTime;
|
|
69
|
+
setJourneyDate(journeyKey: string, journeyDate: CompactDateTime): void;
|
|
70
|
+
mergeIncomingContext(incomingWorkspace: WorkspaceBody): boolean;
|
|
71
|
+
}
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Workspace = exports.WorkspaceStubArrayKey = void 0;
|
|
4
|
+
const ShareSync_1 = require("../../repo/ShareSync");
|
|
5
|
+
const CachingHasher_1 = require("../../util/CachingHasher");
|
|
6
|
+
const Operation_1 = require("../markup/Operation");
|
|
7
|
+
const ArrayView_1 = require("./ArrayView");
|
|
8
|
+
const Content_1 = require("./Content");
|
|
9
|
+
const ContentKind_1 = require("./ContentKind");
|
|
10
|
+
const Context_1 = require("./Context");
|
|
11
|
+
const Stub_1 = require("./Stub");
|
|
12
|
+
const Time_1 = require("./Time");
|
|
13
|
+
var WorkspaceStubArrayKey;
|
|
14
|
+
(function (WorkspaceStubArrayKey) {
|
|
15
|
+
WorkspaceStubArrayKey["BOOKS"] = "books";
|
|
16
|
+
WorkspaceStubArrayKey["SHORTS"] = "shorts";
|
|
17
|
+
WorkspaceStubArrayKey["ARTICLES"] = "articles";
|
|
18
|
+
WorkspaceStubArrayKey["POEMS"] = "poems";
|
|
19
|
+
WorkspaceStubArrayKey["IDEAS"] = "ideas";
|
|
20
|
+
WorkspaceStubArrayKey["TRASH"] = "trash";
|
|
21
|
+
})(WorkspaceStubArrayKey || (exports.WorkspaceStubArrayKey = WorkspaceStubArrayKey = {}));
|
|
22
|
+
class Workspace extends Context_1.Context {
|
|
23
|
+
constructor(doc, shouldAcquire, shareSync) {
|
|
24
|
+
super(doc, shouldAcquire, shareSync);
|
|
25
|
+
this._articlesView = new ArrayView_1.ArrayView(this, ['payload', 'articles']);
|
|
26
|
+
this._booksView = new ArrayView_1.ArrayView(this, ['payload', 'books']);
|
|
27
|
+
this._ideasView = new ArrayView_1.ArrayView(this, ['payload', 'ideas']);
|
|
28
|
+
this._poemsView = new ArrayView_1.ArrayView(this, ['payload', 'poems']);
|
|
29
|
+
this._shortsView = new ArrayView_1.ArrayView(this, ['payload', 'shorts']);
|
|
30
|
+
this._devicesView = new ArrayView_1.ArrayView(this, ['payload', 'devices']);
|
|
31
|
+
this._sessionsView = new ArrayView_1.ArrayView(this, ['payload', 'sessions']);
|
|
32
|
+
}
|
|
33
|
+
get payload() {
|
|
34
|
+
return this.doc.data.payload;
|
|
35
|
+
}
|
|
36
|
+
static makeWorkspaceId(userId) {
|
|
37
|
+
return CachingHasher_1.CachingHasher.makeMd5ContentId(userId + "-" + ContentKind_1.ContentKind.WORKSPACE);
|
|
38
|
+
}
|
|
39
|
+
static create(userId, deviceId) {
|
|
40
|
+
const now = Time_1.MultiClock.now();
|
|
41
|
+
const workspaceId = Workspace.makeWorkspaceId(userId);
|
|
42
|
+
return ShareSync_1.ShareSyncFactory.get().createContent({
|
|
43
|
+
meta: {
|
|
44
|
+
ref: workspaceId,
|
|
45
|
+
is_head: true,
|
|
46
|
+
kind: ContentKind_1.ContentKind.WORKSPACE,
|
|
47
|
+
id: workspaceId,
|
|
48
|
+
owner: userId,
|
|
49
|
+
created_at: now,
|
|
50
|
+
updated_at: now
|
|
51
|
+
},
|
|
52
|
+
payload: {
|
|
53
|
+
devices: [deviceId],
|
|
54
|
+
journey: {},
|
|
55
|
+
books: [],
|
|
56
|
+
shorts: [],
|
|
57
|
+
articles: [],
|
|
58
|
+
poems: [],
|
|
59
|
+
ideas: [],
|
|
60
|
+
sessions: [],
|
|
61
|
+
trash: []
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
ensureLatestSchema() {
|
|
66
|
+
let batch = null;
|
|
67
|
+
if (this.payload.hasOwnProperty('primary_device')) {
|
|
68
|
+
if (!batch) {
|
|
69
|
+
batch = new Operation_1.BatchOperation(this);
|
|
70
|
+
}
|
|
71
|
+
batch.removeValueAtPath(['payload', 'primary_device']);
|
|
72
|
+
}
|
|
73
|
+
if (this.payload.hasOwnProperty('primary_device_last_update')) {
|
|
74
|
+
if (!batch) {
|
|
75
|
+
batch = new Operation_1.BatchOperation(this);
|
|
76
|
+
}
|
|
77
|
+
batch.removeValueAtPath(['payload', 'primary_device_last_update']);
|
|
78
|
+
}
|
|
79
|
+
if (!this.payload.hasOwnProperty('journey')) {
|
|
80
|
+
if (!batch) {
|
|
81
|
+
batch = new Operation_1.BatchOperation(this);
|
|
82
|
+
}
|
|
83
|
+
batch.setPathValue(['payload', 'journey'], {});
|
|
84
|
+
}
|
|
85
|
+
if (batch != null) {
|
|
86
|
+
batch.commit();
|
|
87
|
+
}
|
|
88
|
+
return this;
|
|
89
|
+
}
|
|
90
|
+
get articles() {
|
|
91
|
+
this.checkDisposed("Workspace.articles");
|
|
92
|
+
return this._articlesView;
|
|
93
|
+
}
|
|
94
|
+
get books() {
|
|
95
|
+
this.checkDisposed("Workspace.books");
|
|
96
|
+
return this._booksView;
|
|
97
|
+
}
|
|
98
|
+
get ideas() {
|
|
99
|
+
this.checkDisposed("Workspace.ideas");
|
|
100
|
+
return this._ideasView;
|
|
101
|
+
}
|
|
102
|
+
get poems() {
|
|
103
|
+
this.checkDisposed("Workspace.poems");
|
|
104
|
+
return this._poemsView;
|
|
105
|
+
}
|
|
106
|
+
get shorts() {
|
|
107
|
+
this.checkDisposed("Workspace.shorts");
|
|
108
|
+
return this._shortsView;
|
|
109
|
+
}
|
|
110
|
+
get sessions() {
|
|
111
|
+
this.checkDisposed("Workspace.sessions");
|
|
112
|
+
return this._sessionsView;
|
|
113
|
+
}
|
|
114
|
+
getStubArrayKeys() {
|
|
115
|
+
return [
|
|
116
|
+
WorkspaceStubArrayKey.ARTICLES,
|
|
117
|
+
WorkspaceStubArrayKey.BOOKS,
|
|
118
|
+
WorkspaceStubArrayKey.IDEAS,
|
|
119
|
+
WorkspaceStubArrayKey.POEMS,
|
|
120
|
+
WorkspaceStubArrayKey.SHORTS,
|
|
121
|
+
WorkspaceStubArrayKey.TRASH
|
|
122
|
+
];
|
|
123
|
+
}
|
|
124
|
+
getStubArrayView(key) {
|
|
125
|
+
this.checkDisposed("Workspace.getStubArrayView");
|
|
126
|
+
if (key === WorkspaceStubArrayKey.ARTICLES) {
|
|
127
|
+
return this.articles;
|
|
128
|
+
}
|
|
129
|
+
else if (key === WorkspaceStubArrayKey.BOOKS) {
|
|
130
|
+
return this.books;
|
|
131
|
+
}
|
|
132
|
+
else if (key === WorkspaceStubArrayKey.IDEAS) {
|
|
133
|
+
return this.ideas;
|
|
134
|
+
}
|
|
135
|
+
else if (key === WorkspaceStubArrayKey.POEMS) {
|
|
136
|
+
return this.poems;
|
|
137
|
+
}
|
|
138
|
+
else if (key === WorkspaceStubArrayKey.SHORTS) {
|
|
139
|
+
return this.shorts;
|
|
140
|
+
}
|
|
141
|
+
else if (key === WorkspaceStubArrayKey.TRASH) {
|
|
142
|
+
return this.trash;
|
|
143
|
+
}
|
|
144
|
+
return null;
|
|
145
|
+
}
|
|
146
|
+
// NOTE: As the user adds devices, we will always add new devices to the end of the array.
|
|
147
|
+
// So the most-recently-added device will always be at the end.
|
|
148
|
+
get devices() {
|
|
149
|
+
this.checkDisposed("Workspace.devices");
|
|
150
|
+
return this._devicesView;
|
|
151
|
+
}
|
|
152
|
+
addBook(book, activeId) {
|
|
153
|
+
this.checkDisposed("Workspace.addBook");
|
|
154
|
+
Stub_1.Stubs.insertStubAtActivePoint(book.asStub(), this._booksView, null, activeId, true);
|
|
155
|
+
}
|
|
156
|
+
addFragment(fragment, stubArrayKey, activeId) {
|
|
157
|
+
this.checkDisposed("Workspace.addFragment");
|
|
158
|
+
const stubArrayView = this.getStubArrayView(stubArrayKey);
|
|
159
|
+
const stub = fragment.asStub();
|
|
160
|
+
Stub_1.Stubs.insertStubAtActivePoint(stub, stubArrayView, fragment.category, activeId, true);
|
|
161
|
+
}
|
|
162
|
+
async acquireSessionsFromDate(sessionId, localDate) {
|
|
163
|
+
this.checkDisposed("Workspace.loadSessionsFromDate");
|
|
164
|
+
const shareSync = ShareSync_1.ShareSyncFactory.get();
|
|
165
|
+
const sessions = [];
|
|
166
|
+
for (let i = 0, len = this.sessions.length; i < len; i++) {
|
|
167
|
+
const sessionCreatedAt = this.sessions.get(i);
|
|
168
|
+
const sessionCreatedLocalDate = Time_1.Time.dateFrom(sessionCreatedAt.local_time);
|
|
169
|
+
if (localDate == sessionCreatedLocalDate) {
|
|
170
|
+
const sessionRef = Content_1.Content.makeContentRef(sessionId, sessionCreatedAt.utc_time);
|
|
171
|
+
const session = await shareSync.acquire(ContentKind_1.ContentKind.SESSION, sessionRef);
|
|
172
|
+
sessions.push(session);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
return sessions;
|
|
176
|
+
}
|
|
177
|
+
isBookFolderId(id) {
|
|
178
|
+
this.checkDisposed("Workspace.isBookFolderId");
|
|
179
|
+
for (let i = 0, len = this.books.length; i < len; i++) {
|
|
180
|
+
const stub = this.books.get(i);
|
|
181
|
+
if (Stub_1.Stubs.isFolderStub(stub) && stub.id === id) {
|
|
182
|
+
return true;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
return false;
|
|
186
|
+
}
|
|
187
|
+
hasJourneyDate(journeyKey) {
|
|
188
|
+
this.checkDisposed("Workspace.hasJourneyDate");
|
|
189
|
+
return this.payload.hasOwnProperty('journey') && this.payload.journey.hasOwnProperty(journeyKey);
|
|
190
|
+
}
|
|
191
|
+
getJourneyDate(journeyKey) {
|
|
192
|
+
this.checkDisposed("Workspace.getJourneyDate");
|
|
193
|
+
if (this.payload.hasOwnProperty('journey')) {
|
|
194
|
+
if (this.payload.journey.hasOwnProperty(journeyKey)) {
|
|
195
|
+
return this.payload.journey[journeyKey];
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
return null;
|
|
199
|
+
}
|
|
200
|
+
setJourneyDate(journeyKey, journeyDate) {
|
|
201
|
+
this.checkDisposed("Workspace.setJourneyDate");
|
|
202
|
+
const batch = new Operation_1.BatchOperation(this);
|
|
203
|
+
if (this.payload.hasOwnProperty('journey')) {
|
|
204
|
+
batch.setPathValue(['payload', 'journey', journeyKey], journeyDate);
|
|
205
|
+
}
|
|
206
|
+
else {
|
|
207
|
+
const journey = {};
|
|
208
|
+
journey[journeyKey] = journeyDate;
|
|
209
|
+
batch.setPathValue(['payload', 'journey'], journey);
|
|
210
|
+
}
|
|
211
|
+
batch.commit();
|
|
212
|
+
}
|
|
213
|
+
mergeIncomingContext(incomingWorkspace) {
|
|
214
|
+
let madeChanges = super.mergeIncomingContext(incomingWorkspace);
|
|
215
|
+
// Collect all the session timestamps already in this workspace.
|
|
216
|
+
const sessionUtcTimes = new Set();
|
|
217
|
+
this.sessions.forEach((idx, sessionAt) => {
|
|
218
|
+
sessionUtcTimes.add(sessionAt.utc_time);
|
|
219
|
+
});
|
|
220
|
+
// Now add any new session timestamps from the incoming workspace.
|
|
221
|
+
const incomingSessions = incomingWorkspace.payload.sessions;
|
|
222
|
+
for (let i = 0, len = incomingSessions.length; i < len; i++) {
|
|
223
|
+
const incomingSessionAt = incomingSessions[i];
|
|
224
|
+
if (!sessionUtcTimes.has(incomingSessionAt.utc_time)) {
|
|
225
|
+
if (i < this.sessions.length) {
|
|
226
|
+
this.sessions.insert(i, incomingSessionAt);
|
|
227
|
+
}
|
|
228
|
+
else {
|
|
229
|
+
this.sessions.push(incomingSessionAt);
|
|
230
|
+
}
|
|
231
|
+
madeChanges = true;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
return madeChanges;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
exports.Workspace = Workspace;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export * from './Activity';
|
|
2
|
+
export * from './ArrayView';
|
|
3
|
+
export * from './Billing';
|
|
4
|
+
export * from './Book';
|
|
5
|
+
export * from './Category';
|
|
6
|
+
export * from './Checkpointable';
|
|
7
|
+
export * from './Comment';
|
|
8
|
+
export * from './ConceptArt';
|
|
9
|
+
export * from './Content';
|
|
10
|
+
export * from './ContentKind';
|
|
11
|
+
export * from './Context';
|
|
12
|
+
export * from './DevEnv';
|
|
13
|
+
export * from './Device';
|
|
14
|
+
export * from './Dictionary';
|
|
15
|
+
export * from './ElasticModel';
|
|
16
|
+
export * from './Environment';
|
|
17
|
+
export * from './ExportOptions';
|
|
18
|
+
export * from './Folder';
|
|
19
|
+
export * from './Fragment';
|
|
20
|
+
export * from './GeoLocation';
|
|
21
|
+
export * from './HighlightRule';
|
|
22
|
+
export * from './Manifest';
|
|
23
|
+
export * from './Media';
|
|
24
|
+
export * from './Metric';
|
|
25
|
+
export * from './Migration';
|
|
26
|
+
export * from './Model';
|
|
27
|
+
export * from './Permissions';
|
|
28
|
+
export * from './Placeholder';
|
|
29
|
+
export * from './Profile';
|
|
30
|
+
export * from './RichText';
|
|
31
|
+
export * from './Session';
|
|
32
|
+
export * from './Speech';
|
|
33
|
+
export * from './Stub';
|
|
34
|
+
export * from './Time';
|
|
35
|
+
export * from './User';
|
|
36
|
+
export * from './Workspace';
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// created from 'create-ts-index'
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
15
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
16
|
+
};
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
__exportStar(require("./Activity"), exports);
|
|
19
|
+
__exportStar(require("./ArrayView"), exports);
|
|
20
|
+
__exportStar(require("./Billing"), exports);
|
|
21
|
+
__exportStar(require("./Book"), exports);
|
|
22
|
+
__exportStar(require("./Category"), exports);
|
|
23
|
+
__exportStar(require("./Checkpointable"), exports);
|
|
24
|
+
__exportStar(require("./Comment"), exports);
|
|
25
|
+
__exportStar(require("./ConceptArt"), exports);
|
|
26
|
+
__exportStar(require("./Content"), exports);
|
|
27
|
+
__exportStar(require("./ContentKind"), exports);
|
|
28
|
+
__exportStar(require("./Context"), exports);
|
|
29
|
+
__exportStar(require("./DevEnv"), exports);
|
|
30
|
+
__exportStar(require("./Device"), exports);
|
|
31
|
+
__exportStar(require("./Dictionary"), exports);
|
|
32
|
+
__exportStar(require("./ElasticModel"), exports);
|
|
33
|
+
__exportStar(require("./Environment"), exports);
|
|
34
|
+
__exportStar(require("./ExportOptions"), exports);
|
|
35
|
+
__exportStar(require("./Folder"), exports);
|
|
36
|
+
__exportStar(require("./Fragment"), exports);
|
|
37
|
+
__exportStar(require("./GeoLocation"), exports);
|
|
38
|
+
__exportStar(require("./HighlightRule"), exports);
|
|
39
|
+
__exportStar(require("./Manifest"), exports);
|
|
40
|
+
__exportStar(require("./Media"), exports);
|
|
41
|
+
__exportStar(require("./Metric"), exports);
|
|
42
|
+
__exportStar(require("./Migration"), exports);
|
|
43
|
+
__exportStar(require("./Model"), exports);
|
|
44
|
+
__exportStar(require("./Permissions"), exports);
|
|
45
|
+
__exportStar(require("./Placeholder"), exports);
|
|
46
|
+
__exportStar(require("./Profile"), exports);
|
|
47
|
+
__exportStar(require("./RichText"), exports);
|
|
48
|
+
__exportStar(require("./Session"), exports);
|
|
49
|
+
__exportStar(require("./Speech"), exports);
|
|
50
|
+
__exportStar(require("./Stub"), exports);
|
|
51
|
+
__exportStar(require("./Time"), exports);
|
|
52
|
+
__exportStar(require("./User"), exports);
|
|
53
|
+
__exportStar(require("./Workspace"), exports);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// created from 'create-ts-index'
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
15
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
16
|
+
};
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
__exportStar(require("./content"), exports);
|
|
19
|
+
__exportStar(require("./legacy"), exports);
|
|
20
|
+
__exportStar(require("./markup"), exports);
|
|
21
|
+
__exportStar(require("./OutboundMessage"), exports);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Format } from "../content/RichText";
|
|
2
|
+
import { LegacyContent } from "./LegacyContent";
|
|
3
|
+
export interface LegacyBodyFormatPayload {
|
|
4
|
+
body: string;
|
|
5
|
+
format: Format[];
|
|
6
|
+
}
|
|
7
|
+
export interface LegacyBodyFormat extends LegacyContent {
|
|
8
|
+
payload: LegacyBodyFormatPayload;
|
|
9
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { MultiTime } from "../content/Time";
|
|
2
|
+
import { LegacyBodyFormat, LegacyBodyFormatPayload } from "./LegacyBodyFormat";
|
|
3
|
+
import { LegacyHeadLocator, LegacyLocator } from "./LegacyLocator";
|
|
4
|
+
export interface LegacyCommentPayload extends LegacyBodyFormatPayload {
|
|
5
|
+
anchor: LegacyLocator | null;
|
|
6
|
+
word_count: number;
|
|
7
|
+
by: LegacyHeadLocator;
|
|
8
|
+
at: MultiTime;
|
|
9
|
+
}
|
|
10
|
+
export interface LegacyComment extends LegacyBodyFormat {
|
|
11
|
+
payload: LegacyCommentPayload;
|
|
12
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { CompactDateTime, MultiTime } from "../content/Time";
|
|
2
|
+
import { LegacyBodyFormatPayload } from "./LegacyBodyFormat";
|
|
3
|
+
import { LegacyCommentPayload } from "./LegacyComment";
|
|
4
|
+
import { LegacyFragmentPayload } from "./LegacyFragment";
|
|
5
|
+
import { LegacyHeadLocator, LegacyLocator } from "./LegacyLocator";
|
|
6
|
+
import { LegacyPicturePayload } from "./LegacyPicture";
|
|
7
|
+
import { LegacyProfilePayload } from "./LegacyProfile";
|
|
8
|
+
import { LegacySessionPayload } from "./LegacySession";
|
|
9
|
+
import { LegacyStoryPayload } from "./LegacyStory";
|
|
10
|
+
import { LegacyTransactionPayload } from "./LegacyTransaction";
|
|
11
|
+
import { LegacyUserPayload } from "./LegacyUser";
|
|
12
|
+
import { LegacyWorkspacePayload } from "./LegacyWorkspace";
|
|
13
|
+
export type LegacyDateTime = string;
|
|
14
|
+
export declare class LegacyClock {
|
|
15
|
+
static utcNow(): LegacyDateTime;
|
|
16
|
+
static fromCompact(value: CompactDateTime): LegacyDateTime;
|
|
17
|
+
}
|
|
18
|
+
export declare class LegacyMultiClock {
|
|
19
|
+
static utcNow(): LegacyMultiTime;
|
|
20
|
+
static fromModern(multiTime: MultiTime): LegacyMultiTime;
|
|
21
|
+
}
|
|
22
|
+
export interface LegacyMultiTime {
|
|
23
|
+
utc_time: LegacyDateTime;
|
|
24
|
+
local_time: LegacyDateTime;
|
|
25
|
+
}
|
|
26
|
+
export type LegacyPayload = LegacyBodyFormatPayload | LegacyCommentPayload | LegacyFragmentPayload | LegacyPicturePayload | LegacyStoryPayload | LegacyWorkspacePayload | LegacyProfilePayload | LegacySessionPayload | LegacyTransactionPayload | LegacyUserPayload;
|
|
27
|
+
export declare enum LegacyContentKind {
|
|
28
|
+
COMMENT = "comment",
|
|
29
|
+
FOLDER = "folder",
|
|
30
|
+
FRAGMENT = "fragment",
|
|
31
|
+
PICTURE = "picture",
|
|
32
|
+
PROFILE = "profile",
|
|
33
|
+
SESSION = "session",
|
|
34
|
+
STORY = "story",
|
|
35
|
+
TRANSACTION = "transaction",
|
|
36
|
+
USER = "user",
|
|
37
|
+
WORKSPACE = "workspace"
|
|
38
|
+
}
|
|
39
|
+
export interface LegacyContent {
|
|
40
|
+
locator: LegacyLocator;
|
|
41
|
+
parent: LegacyLocator | null;
|
|
42
|
+
is_head: boolean;
|
|
43
|
+
sync_time: string | null;
|
|
44
|
+
kind: LegacyContentKind;
|
|
45
|
+
id: LegacyHeadLocator;
|
|
46
|
+
seq: number;
|
|
47
|
+
by: LegacyHeadLocator;
|
|
48
|
+
at: LegacyMultiTime;
|
|
49
|
+
model_version: number;
|
|
50
|
+
session: LegacyLocator | null;
|
|
51
|
+
permissions: string[];
|
|
52
|
+
payload: LegacyPayload;
|
|
53
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
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
|
+
exports.LegacyContentKind = exports.LegacyMultiClock = exports.LegacyClock = void 0;
|
|
7
|
+
const dayjs_1 = __importDefault(require("dayjs"));
|
|
8
|
+
const utc_1 = __importDefault(require("dayjs/plugin/utc"));
|
|
9
|
+
dayjs_1.default.extend(utc_1.default);
|
|
10
|
+
const Time_1 = require("../content/Time");
|
|
11
|
+
class LegacyClock {
|
|
12
|
+
static utcNow() {
|
|
13
|
+
return dayjs_1.default.utc().format(Time_1.Time.DATETIME_FORMAT_LEGACY);
|
|
14
|
+
}
|
|
15
|
+
static fromCompact(value) {
|
|
16
|
+
return dayjs_1.default.utc(value, Time_1.Time.DATETIME_FORMAT_COMPACT).format(Time_1.Time.DATETIME_FORMAT_LEGACY);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.LegacyClock = LegacyClock;
|
|
20
|
+
class LegacyMultiClock {
|
|
21
|
+
static utcNow() {
|
|
22
|
+
let nowUtc = dayjs_1.default.utc().format(Time_1.Time.DATETIME_FORMAT_LEGACY);
|
|
23
|
+
const timestamp = dayjs_1.default.utc(nowUtc, Time_1.Time.DATETIME_FORMAT_LEGACY)
|
|
24
|
+
.local();
|
|
25
|
+
let nowLocal = timestamp.format(Time_1.Time.DATETIME_FORMAT_LEGACY);
|
|
26
|
+
return {
|
|
27
|
+
local_time: nowLocal,
|
|
28
|
+
utc_time: nowUtc
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
// TODO: Is this correct? It's going to return zero-offset (UTC zone)
|
|
32
|
+
// timestamps for both utc_time and local_time, no matter what the inputs
|
|
33
|
+
// are... Perhaps we can just delete this method, it is not even being used,
|
|
34
|
+
// as far as I can tell
|
|
35
|
+
static fromModern(multiTime) {
|
|
36
|
+
return {
|
|
37
|
+
utc_time: LegacyClock.fromCompact(multiTime.utc_time),
|
|
38
|
+
local_time: LegacyClock.fromCompact(multiTime.local_time),
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
exports.LegacyMultiClock = LegacyMultiClock;
|
|
43
|
+
var LegacyContentKind;
|
|
44
|
+
(function (LegacyContentKind) {
|
|
45
|
+
LegacyContentKind["COMMENT"] = "comment";
|
|
46
|
+
LegacyContentKind["FOLDER"] = "folder";
|
|
47
|
+
LegacyContentKind["FRAGMENT"] = "fragment";
|
|
48
|
+
LegacyContentKind["PICTURE"] = "picture";
|
|
49
|
+
LegacyContentKind["PROFILE"] = "profile";
|
|
50
|
+
LegacyContentKind["SESSION"] = "session";
|
|
51
|
+
LegacyContentKind["STORY"] = "story";
|
|
52
|
+
LegacyContentKind["TRANSACTION"] = "transaction";
|
|
53
|
+
LegacyContentKind["USER"] = "user";
|
|
54
|
+
LegacyContentKind["WORKSPACE"] = "workspace";
|
|
55
|
+
})(LegacyContentKind || (exports.LegacyContentKind = LegacyContentKind = {}));
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { BillingPayload, TransactionPayload } from '../content/Billing';
|
|
2
|
+
import { BookBody } from '../content/Book';
|
|
3
|
+
import { CommentBody } from '../content/Comment';
|
|
4
|
+
import { ConceptArtBody } from "../content/ConceptArt";
|
|
5
|
+
import { ContentBody, ContentId } from '../content/Content';
|
|
6
|
+
import { ContentKind } from '../content/ContentKind';
|
|
7
|
+
import { FragmentBody } from '../content/Fragment';
|
|
8
|
+
import { MediaBody } from "../content/Media";
|
|
9
|
+
import { ProfileBody } from '../content/Profile';
|
|
10
|
+
import { SessionBody } from '../content/Session';
|
|
11
|
+
import { Stub } from '../content/Stub';
|
|
12
|
+
import { CompactDateTime, MultiTime } from "../content/Time";
|
|
13
|
+
import { ModernUserPayload } from "../content/User";
|
|
14
|
+
import { WorkspaceBody } from '../content/Workspace';
|
|
15
|
+
import { OutboundMessage } from "../OutboundMessage";
|
|
16
|
+
import { LegacyComment } from './LegacyComment';
|
|
17
|
+
import { LegacyContent, LegacyContentKind, LegacyDateTime, LegacyMultiTime } from './LegacyContent';
|
|
18
|
+
import { LegacyFragment } from './LegacyFragment';
|
|
19
|
+
import { LegacyLocator } from "./LegacyLocator";
|
|
20
|
+
import { LegacyOutboundMessage } from "./LegacyOutboundMessage";
|
|
21
|
+
import { LegacyPicture } from './LegacyPicture';
|
|
22
|
+
import { LegacyProfile } from './LegacyProfile';
|
|
23
|
+
import { LegacySession } from './LegacySession';
|
|
24
|
+
import { LegacyStory } from './LegacyStory';
|
|
25
|
+
import { LegacyTransaction } from './LegacyTransaction';
|
|
26
|
+
import { LegacyUser } from './LegacyUser';
|
|
27
|
+
import { LegacyWorkspace } from './LegacyWorkspace';
|
|
28
|
+
export declare class LegacyConversion {
|
|
29
|
+
private userId;
|
|
30
|
+
constructor(userId: ContentId);
|
|
31
|
+
static convertDateTime(timestamp: LegacyDateTime): CompactDateTime;
|
|
32
|
+
static convertOutboundMessage(message: LegacyOutboundMessage): OutboundMessage;
|
|
33
|
+
convertKind(legacyKind: LegacyContentKind): ContentKind;
|
|
34
|
+
convertId(record: LegacyContent): ContentId;
|
|
35
|
+
private convertMeta;
|
|
36
|
+
convertMetaAt(legacyRecord: LegacyContent): MultiTime;
|
|
37
|
+
convertMultiTime(at: LegacyMultiTime, extraMillis: number): MultiTime;
|
|
38
|
+
private convertLegacyPayload;
|
|
39
|
+
private convertRichTextPayload;
|
|
40
|
+
convertUser(legacyUser: LegacyUser): ModernUserPayload;
|
|
41
|
+
convertBilling(legacyUser: LegacyUser, convertedTransactions: TransactionPayload[]): BillingPayload;
|
|
42
|
+
convertProfile(legacyProfile: LegacyProfile, createdAt: MultiTime, legacyAvatar: LegacyPicture): ProfileBody;
|
|
43
|
+
convertWorkspace(legacyWorkspace: LegacyWorkspace, createdAt: MultiTime, newSessionTimetsamps: MultiTime[], contentHeadStubsById?: Map<ContentId, Stub>): WorkspaceBody;
|
|
44
|
+
convertSession(legacySession: LegacySession, checkpointTable: Map<LegacyLocator, CompactDateTime>): SessionBody;
|
|
45
|
+
convertTransactionPayload(legacyTransaction: LegacyTransaction): TransactionPayload;
|
|
46
|
+
convertBook(legacyStory: LegacyStory, createdAt: MultiTime, contentHeadStubsById?: Map<ContentId, Stub>): BookBody;
|
|
47
|
+
convertCheckpoints(legacyCheckpoints: LegacyContent[]): ContentBody[];
|
|
48
|
+
convertFragment(legacyFragment: LegacyFragment, createdAt: MultiTime, isHead: boolean): FragmentBody;
|
|
49
|
+
convertPictureToMedia(legacyPicture: LegacyPicture, createdAt: MultiTime): MediaBody;
|
|
50
|
+
convertPictureToConceptArt(legacyPicture: LegacyPicture, createdAt: MultiTime, isHead: boolean): ConceptArtBody;
|
|
51
|
+
convertComment(legacyComment: LegacyComment, createdAt: MultiTime, isHead: boolean): CommentBody;
|
|
52
|
+
private convertArrayOfLocators;
|
|
53
|
+
private convertActivityArray;
|
|
54
|
+
private convertStubArray;
|
|
55
|
+
}
|