document-drive 4.1.0-dev.8 → 4.1.0-staging.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.
- package/dist/index.d.ts +5 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/prisma/schema.prisma +1 -0
- package/dist/src/cache/types.d.ts.map +1 -1
- package/dist/src/drive-document-model/gen/object.d.ts +2 -2
- package/dist/src/drive-document-model/gen/object.d.ts.map +1 -1
- package/dist/src/drive-document-model/gen/types.d.ts +2 -2
- package/dist/src/drive-document-model/gen/types.d.ts.map +1 -1
- package/dist/src/drive-document-model/gen/utils.d.ts +1 -2
- package/dist/src/drive-document-model/gen/utils.d.ts.map +1 -1
- package/dist/src/drive-document-model/gen/utils.js +3 -6
- package/dist/src/drive-document-model/gen/utils.js.map +1 -1
- package/dist/src/drive-document-model/ph-factories.d.ts +27 -0
- package/dist/src/drive-document-model/ph-factories.d.ts.map +1 -0
- package/dist/src/drive-document-model/ph-factories.js +56 -0
- package/dist/src/drive-document-model/ph-factories.js.map +1 -0
- package/dist/src/drive-document-model/src/reducers/node.d.ts.map +1 -1
- package/dist/src/drive-document-model/src/reducers/node.js +13 -1
- package/dist/src/drive-document-model/src/reducers/node.js.map +1 -1
- package/dist/src/drive-document-model/src/tests/drive.test.js +7 -7
- package/dist/src/drive-document-model/src/tests/drive.test.js.map +1 -1
- package/dist/src/drive-document-model/src/tests/generate-mock.d.ts +4 -0
- package/dist/src/drive-document-model/src/tests/generate-mock.d.ts.map +1 -0
- package/dist/src/drive-document-model/src/tests/generate-mock.js +5 -0
- package/dist/src/drive-document-model/src/tests/generate-mock.js.map +1 -0
- package/dist/src/drive-document-model/src/tests/node.test.js +44 -78
- package/dist/src/drive-document-model/src/tests/node.test.js.map +1 -1
- package/dist/src/drive-document-model/src/tests/test-factories.d.ts +14 -0
- package/dist/src/drive-document-model/src/tests/test-factories.d.ts.map +1 -0
- package/dist/src/drive-document-model/src/tests/test-factories.js +24 -0
- package/dist/src/drive-document-model/src/tests/test-factories.js.map +1 -0
- package/dist/src/drive-document-model/src/utils.d.ts +1 -0
- package/dist/src/drive-document-model/src/utils.d.ts.map +1 -1
- package/dist/src/drive-document-model/src/utils.js +4 -0
- package/dist/src/drive-document-model/src/utils.js.map +1 -1
- package/dist/src/processors/processor-manager.d.ts.map +1 -1
- package/dist/src/processors/processor-manager.js +2 -1
- package/dist/src/processors/processor-manager.js.map +1 -1
- package/dist/src/processors/types.d.ts +3 -3
- package/dist/src/processors/types.d.ts.map +1 -1
- package/dist/src/queue/event.d.ts +1 -1
- package/dist/src/queue/event.d.ts.map +1 -1
- package/dist/src/queue/event.js +8 -3
- package/dist/src/queue/event.js.map +1 -1
- package/dist/src/server/base-server.d.ts +1 -0
- package/dist/src/server/base-server.d.ts.map +1 -1
- package/dist/src/server/base-server.js +45 -37
- package/dist/src/server/base-server.js.map +1 -1
- package/dist/src/server/error.d.ts +5 -1
- package/dist/src/server/error.d.ts.map +1 -1
- package/dist/src/server/error.js +7 -2
- package/dist/src/server/error.js.map +1 -1
- package/dist/src/server/listener/listener-manager.d.ts.map +1 -1
- package/dist/src/server/listener/listener-manager.js +5 -4
- package/dist/src/server/listener/listener-manager.js.map +1 -1
- package/dist/src/server/listener/transmitter/internal.d.ts.map +1 -1
- package/dist/src/server/listener/transmitter/internal.js +10 -1
- package/dist/src/server/listener/transmitter/internal.js.map +1 -1
- package/dist/src/server/listener/transmitter/pull-responder.js +2 -2
- package/dist/src/server/listener/transmitter/switchboard-push.d.ts.map +1 -1
- package/dist/src/server/listener/transmitter/switchboard-push.js +1 -0
- package/dist/src/server/listener/transmitter/switchboard-push.js.map +1 -1
- package/dist/src/server/sync-manager.d.ts.map +1 -1
- package/dist/src/server/sync-manager.js +9 -8
- package/dist/src/server/sync-manager.js.map +1 -1
- package/dist/src/server/types.d.ts +6 -3
- package/dist/src/server/types.d.ts.map +1 -1
- package/dist/src/server/types.js.map +1 -1
- package/dist/src/storage/browser.d.ts.map +1 -1
- package/dist/src/storage/browser.js +5 -4
- package/dist/src/storage/browser.js.map +1 -1
- package/dist/src/storage/filesystem.d.ts.map +1 -1
- package/dist/src/storage/filesystem.js +5 -4
- package/dist/src/storage/filesystem.js.map +1 -1
- package/dist/src/storage/ipfs.d.ts.map +1 -1
- package/dist/src/storage/ipfs.js +3 -3
- package/dist/src/storage/ipfs.js.map +1 -1
- package/dist/src/storage/memory.d.ts.map +1 -1
- package/dist/src/storage/memory.js +5 -4
- package/dist/src/storage/memory.js.map +1 -1
- package/dist/src/storage/prisma/client/edge.js +4 -3
- package/dist/src/storage/prisma/client/index-browser.js +1 -0
- package/dist/src/storage/prisma/client/index.d.ts +45 -0
- package/dist/src/storage/prisma/client/index.js +4 -3
- package/dist/src/storage/prisma/client/package.json +1 -1
- package/dist/src/storage/prisma/client/schema.prisma +1 -0
- package/dist/src/storage/prisma/client/wasm.js +1 -0
- package/dist/src/storage/prisma/prisma.d.ts.map +1 -1
- package/dist/src/storage/prisma/prisma.js +46 -25
- package/dist/src/storage/prisma/prisma.js.map +1 -1
- package/dist/src/utils/gql-transformations.d.ts.map +1 -1
- package/dist/src/utils/gql-transformations.js +4 -2
- package/dist/src/utils/gql-transformations.js.map +1 -1
- package/dist/src/utils/graphql.d.ts.map +1 -1
- package/dist/src/utils/graphql.js +3 -8
- package/dist/src/utils/graphql.js.map +1 -1
- package/dist/src/utils/migrations.d.ts.map +1 -1
- package/dist/src/utils/migrations.js +82 -17
- package/dist/src/utils/migrations.js.map +1 -1
- package/dist/src/utils/misc.d.ts +1 -1
- package/dist/src/utils/misc.d.ts.map +1 -1
- package/dist/src/utils/misc.js +6 -6
- package/dist/src/utils/misc.js.map +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/package.json +5 -4
package/dist/index.d.ts
CHANGED
|
@@ -4,11 +4,12 @@ import { type CreateState } from "document-model";
|
|
|
4
4
|
export type { DocumentDriveAction } from "#drive-document-model/gen/actions";
|
|
5
5
|
export { addFile, addFolder, addListener, addTrigger, copyNode, deleteNode, moveNode, removeTrigger, setAvailableOffline, setDriveIcon, setDriveName, setSharingType, updateFile, updateNode, } from "#drive-document-model/gen/creators";
|
|
6
6
|
export { reducer as documentDriveReducer } from "#drive-document-model/gen/reducer";
|
|
7
|
-
export type { AddListenerInput, FileNode, FolderNode,
|
|
7
|
+
export type { AddListenerInput, FileNode, FolderNode, ListenerFilter, PullResponderTriggerData, TransmitterType, Trigger, } from "#drive-document-model/gen/schema/types";
|
|
8
8
|
export type { DocumentDriveDocument, DocumentDriveLocalState, DocumentDriveState, Node, } from "#drive-document-model/gen/types";
|
|
9
9
|
export { module as driveDocumentModelModule } from "#drive-document-model/module";
|
|
10
|
-
export { generateNodesCopy, isFileNode, isFolderNode, } from "#drive-document-model/src/utils";
|
|
11
|
-
export
|
|
10
|
+
export { generateNodesCopy, isFileNode, isFolderNode, isValidName, } from "#drive-document-model/src/utils";
|
|
11
|
+
export { ProcessorManager } from "#processors/processor-manager";
|
|
12
|
+
export type { IProcessor, IRelationalDb, ProcessorRecord, } from "#processors/types";
|
|
12
13
|
export { EventQueueManager as BaseQueueManager } from "#queue/event";
|
|
13
14
|
export { ReadDocumentNotFoundError, ReadDriveNotFoundError, ReadDriveSlugNotFoundError, } from "#read-mode/errors";
|
|
14
15
|
export type { IReadModeDriveServer, ReadDrive, ReadDriveContext, ReadDrivesListener, ReadDrivesListenerUnsubscribe, } from "#read-mode/types";
|
|
@@ -20,7 +21,7 @@ export type { InternalTransmitterUpdate } from "#server/listener/transmitter/int
|
|
|
20
21
|
export { PullResponderTransmitter } from "#server/listener/transmitter/pull-responder";
|
|
21
22
|
export type { StrandUpdateGraphQL } from "#server/listener/transmitter/pull-responder";
|
|
22
23
|
export type { PullResponderTrigger } from "#server/listener/transmitter/types";
|
|
23
|
-
export type { DefaultRemoteDriveInput, DocumentDriveServerOptions, DriveInput, GetDocumentOptions, IDocumentDriveServer, ListenerRevision, RemoteDriveOptions, StrandUpdate, SyncStatus, } from "#server/types";
|
|
24
|
+
export type { DefaultRemoteDriveInput, DocumentDriveServerOptions, DriveInput, GetDocumentOptions, IDocumentDriveServer, Listener, ListenerRevision, RemoteDriveOptions, SharingType, StrandUpdate, SyncStatus, } from "#server/types";
|
|
24
25
|
export { MemoryStorage } from "#storage/memory";
|
|
25
26
|
export { requestPublicDrive, requestPublicDriveWithTokenFromReactor, } from "#utils/graphql";
|
|
26
27
|
export { childLogger, logger, setErrorHandler, setLogLevel, } from "#utils/logger";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,eAAe,CAAC;AAE1C,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,YAAY,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EACL,OAAO,EACP,SAAS,EACT,WAAW,EACX,UAAU,EACV,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,aAAa,EACb,mBAAmB,EACnB,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,UAAU,EACV,UAAU,GACX,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACpF,YAAY,EACV,gBAAgB,EAChB,QAAQ,EACR,UAAU,EACV,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,eAAe,CAAC;AAE1C,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,YAAY,EAAE,mBAAm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CAAC;AACvB,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAC5E,YAAY,EAAE,yBAAyB,EAAE,MAAM,uCAAuC,CAAC;AACvF,OAAO,EAAE,wBAAwB,EAAE,MAAM,6CAA6C,CAAC;AACvF,YAAY,EAAE,mBAAmB,EAAE,MAAM,6CAA6C,CAAC;AACvF,YAAY,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC/E,YAAY,EACV,uBAAuB,EACvB,0BAA0B,EAC1B,UAAU,EACV,kBAAkB,EAClB,oBAAoB,EACpB,QAAQ,EACR,gBAAgB,EAChB,kBAAkB,EAClB,WAAW,EACX,YAAY,EACZ,UAAU,GACX,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EACL,kBAAkB,EAClB,sCAAsC,GACvC,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,WAAW,EACX,MAAM,EACN,eAAe,EACf,WAAW,GACZ,MAAM,eAAe,CAAC;AACvB,YAAY,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,CAAC;AACzB,eAAO,MAAM,gBAAgB,EAAE,WAAW,CAAC,qBAAqB,CACxC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,8 @@ import DriveUtils from "#drive-document-model/gen/utils";
|
|
|
3
3
|
export { addFile, addFolder, addListener, addTrigger, copyNode, deleteNode, moveNode, removeTrigger, setAvailableOffline, setDriveIcon, setDriveName, setSharingType, updateFile, updateNode, } from "#drive-document-model/gen/creators";
|
|
4
4
|
export { reducer as documentDriveReducer } from "#drive-document-model/gen/reducer";
|
|
5
5
|
export { module as driveDocumentModelModule } from "#drive-document-model/module";
|
|
6
|
-
export { generateNodesCopy, isFileNode, isFolderNode, } from "#drive-document-model/src/utils";
|
|
6
|
+
export { generateNodesCopy, isFileNode, isFolderNode, isValidName, } from "#drive-document-model/src/utils";
|
|
7
|
+
export { ProcessorManager } from "#processors/processor-manager";
|
|
7
8
|
export { EventQueueManager as BaseQueueManager } from "#queue/event";
|
|
8
9
|
export { ReadDocumentNotFoundError, ReadDriveNotFoundError, ReadDriveSlugNotFoundError, } from "#read-mode/errors";
|
|
9
10
|
export { BaseDocumentDriveServer, DocumentDriveServer, } from "#server/base-server";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,eAAe,CAAC;AAC1C,OAAO,UAAU,MAAM,iCAAiC,CAAC;AAIzD,OAAO,EACL,OAAO,EACP,SAAS,EACT,WAAW,EACX,UAAU,EACV,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,aAAa,EACb,mBAAmB,EACnB,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,UAAU,EACV,UAAU,GACX,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,eAAe,CAAC;AAC1C,OAAO,UAAU,MAAM,iCAAiC,CAAC;AAIzD,OAAO,EACL,OAAO,EACP,SAAS,EACT,WAAW,EACX,UAAU,EACV,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,aAAa,EACb,mBAAmB,EACnB,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,UAAU,EACV,UAAU,GACX,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAgBpF,OAAO,EAAE,MAAM,IAAI,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAClF,OAAO,EACL,iBAAiB,EACjB,UAAU,EACV,YAAY,EACZ,WAAW,GACZ,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAMjE,OAAO,EAAE,iBAAiB,IAAI,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACrE,OAAO,EACL,yBAAyB,EACzB,sBAAsB,EACtB,0BAA0B,GAC3B,MAAM,mBAAmB,CAAC;AAQ3B,OAAO,EACL,uBAAuB,EACvB,mBAAmB,GACpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EACL,0BAA0B,EAC1B,0BAA0B,EAC1B,gCAAgC,GACjC,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAE5E,OAAO,EAAE,wBAAwB,EAAE,MAAM,6CAA6C,CAAC;AAgBvF,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EACL,kBAAkB,EAClB,sCAAsC,GACvC,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,WAAW,EACX,MAAM,EACN,eAAe,EACf,WAAW,GACZ,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,CAAC;AACzB,MAAM,CAAC,MAAM,gBAAgB,GAC3B,UAAU,CAAC,WAAW,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/cache/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAC7E,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/cache/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAC7E,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAGjD,MAAM,WAAW,cAAc;CAAG;AAElC,MAAM,WAAW,MAAM;IAGrB,WAAW,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAGrE,WAAW,CAAC,SAAS,SAAS,UAAU,EACtC,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC,CAAC;IAGlC,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAIrD,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAIvE,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAG1E,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAAC,CAAC;IAGtE,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAAC,CAAC;IAEzE,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC/C,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACnD"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseDocumentClass, type
|
|
1
|
+
import { BaseDocumentClass, type BaseState, type PartialState, type SignalDispatch } from "document-model";
|
|
2
2
|
import { type DocumentDriveState, type DocumentDriveLocalState } from "./types.js";
|
|
3
3
|
import { type DocumentDriveAction } from "./actions.js";
|
|
4
4
|
import DocumentDrive_Node from "./node/object.js";
|
|
@@ -9,7 +9,7 @@ interface DocumentDrive extends DocumentDrive_Node, DocumentDrive_Drive {
|
|
|
9
9
|
}
|
|
10
10
|
declare class DocumentDrive extends BaseDocumentClass<DocumentDriveState, DocumentDriveLocalState, DocumentDriveAction> {
|
|
11
11
|
static fileExtension: string;
|
|
12
|
-
constructor(initialState?: Partial<
|
|
12
|
+
constructor(initialState?: Partial<BaseState<PartialState<DocumentDriveState>, PartialState<DocumentDriveLocalState>>>, dispatch?: SignalDispatch);
|
|
13
13
|
saveToFile(path: string, name?: string): Promise<string>;
|
|
14
14
|
loadFromFile(path: string): Promise<void>;
|
|
15
15
|
static fromFile(path: string): Promise<DocumentDrive>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"object.d.ts","sourceRoot":"","sources":["../../../../src/drive-document-model/gen/object.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,KAAK,
|
|
1
|
+
{"version":3,"file":"object.d.ts","sourceRoot":"","sources":["../../../../src/drive-document-model/gen/object.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,KAAK,SAAS,EACd,KAAK,YAAY,EAEjB,KAAK,cAAc,EACpB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAC7B,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAGxD,OAAO,kBAAkB,MAAM,kBAAkB,CAAC;AAClD,OAAO,mBAAmB,MAAM,mBAAmB,CAAC;AAEpD,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAGlC,UAAU,aAAc,SAAQ,kBAAkB,EAAE,mBAAmB;CAAG;AAG1E,cAAM,aAAc,SAAQ,iBAAiB,CAC3C,kBAAkB,EAClB,uBAAuB,EACvB,mBAAmB,CACpB;IACC,MAAM,CAAC,aAAa,SAAU;gBAG5B,YAAY,CAAC,EAAE,OAAO,CACpB,SAAS,CACP,YAAY,CAAC,kBAAkB,CAAC,EAChC,YAAY,CAAC,uBAAuB,CAAC,CACtC,CACF,EACD,QAAQ,CAAC,EAAE,cAAc;IAKpB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM;IAItC,YAAY,CAAC,IAAI,EAAE,MAAM;WAInB,QAAQ,CAAC,IAAI,EAAE,MAAM;CAKnC;AAID,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { Action,
|
|
1
|
+
import type { Action, BaseState, PHDocument } from "document-model";
|
|
2
2
|
import type { DocumentDriveAction } from "./actions.js";
|
|
3
3
|
import type { AddFileInput, DocumentDriveLocalState, DocumentDriveState, InputMaybe, Scalars } from "./schema/types.js";
|
|
4
4
|
export { z } from "./schema/index.js";
|
|
5
5
|
export type * from "./schema/types.js";
|
|
6
6
|
export type { DocumentDriveAction, DocumentDriveLocalState, DocumentDriveState, };
|
|
7
|
-
export type ExtendedDocumentDriveState =
|
|
7
|
+
export type ExtendedDocumentDriveState = BaseState<DocumentDriveState, DocumentDriveLocalState>;
|
|
8
8
|
export type DocumentDriveDocument = PHDocument<DocumentDriveState, DocumentDriveLocalState>;
|
|
9
9
|
export type LegacySynchronizationUnit = {
|
|
10
10
|
branch: Scalars["String"]["output"];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/drive-document-model/gen/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/drive-document-model/gen/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACpE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,KAAK,EACV,YAAY,EACZ,uBAAuB,EACvB,kBAAkB,EAClB,UAAU,EACV,OAAO,EACR,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AACtC,mBAAmB,mBAAmB,CAAC;AACvC,YAAY,EACV,mBAAmB,EACnB,uBAAuB,EACvB,kBAAkB,GACnB,CAAC;AACF,MAAM,MAAM,0BAA0B,GAAG,SAAS,CAChD,kBAAkB,EAClB,uBAAuB,CACxB,CAAC;AACF,MAAM,MAAM,qBAAqB,GAAG,UAAU,CAC5C,kBAAkB,EAClB,uBAAuB,CACxB,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACtC,MAAM,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAC;IACpC,KAAK,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAC;IACnC,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC;CACjC,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,YAAY,GAAG;IAC9C,QAAQ,CAAC,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC;IAClC,oBAAoB,EAAE,KAAK,CAAC,yBAAyB,CAAC,CAAC;CACxD,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,KAAK,EAAE,kBAAkB,CAAC;CAAE,CAAC"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { CreateDocument,
|
|
1
|
+
import { CreateDocument, CreateState, type DocumentModelUtils } from "document-model";
|
|
2
2
|
import { type DocumentDriveDocument, type DocumentDriveLocalState, type DocumentDriveState } from "./types.js";
|
|
3
3
|
export declare const initialGlobalState: DocumentDriveState;
|
|
4
4
|
export declare const initialLocalState: DocumentDriveLocalState;
|
|
5
5
|
export type DocumentDriveUtils = DocumentModelUtils<DocumentDriveDocument>;
|
|
6
6
|
declare const utils: DocumentDriveUtils;
|
|
7
7
|
export declare const createDocument: CreateDocument<DocumentDriveDocument>;
|
|
8
|
-
export declare const createExtendedState: CreateExtendedState<DocumentDriveDocument>;
|
|
9
8
|
export declare const createState: CreateState<DocumentDriveDocument>;
|
|
10
9
|
export default utils;
|
|
11
10
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/drive-document-model/gen/utils.ts"],"names":[],"mappings":"AACA,OAAO,EACL,cAAc,EACd,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/drive-document-model/gen/utils.ts"],"names":[],"mappings":"AACA,OAAO,EACL,cAAc,EACd,WAAW,EACX,KAAK,kBAAkB,EAQxB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,EACxB,MAAM,YAAY,CAAC;AAEpB,eAAO,MAAM,kBAAkB,EAAE,kBAIhC,CAAC;AACF,eAAO,MAAM,iBAAiB,EAAE,uBAK/B,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,kBAAkB,CAAC,qBAAqB,CAAC,CAAC;AAE3E,QAAA,MAAM,KAAK,EAAE,kBAkCZ,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,cAAc,CAAC,qBAAqB,CAC3C,CAAC;AACvB,eAAO,MAAM,WAAW,EAAE,WAAW,CAAC,qBAAqB,CACxC,CAAC;AAEpB,eAAe,KAAK,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { driveDocumentType } from "#drive-document-model/constants";
|
|
2
|
-
import { baseCreateDocument,
|
|
2
|
+
import { baseCreateDocument, baseLoadFromFile, baseLoadFromInput, baseSaveToFile, baseSaveToFileHandle, defaultBaseState, generateId, } from "document-model";
|
|
3
3
|
import { reducer } from "./reducer.js";
|
|
4
4
|
export const initialGlobalState = {
|
|
5
5
|
name: "",
|
|
@@ -16,15 +16,13 @@ const utils = {
|
|
|
16
16
|
fileExtension: "phdd",
|
|
17
17
|
createState(state) {
|
|
18
18
|
return {
|
|
19
|
+
...defaultBaseState(),
|
|
19
20
|
global: { ...initialGlobalState, ...state?.global },
|
|
20
21
|
local: { ...initialLocalState, ...state?.local },
|
|
21
22
|
};
|
|
22
23
|
},
|
|
23
|
-
createExtendedState(extendedState) {
|
|
24
|
-
return baseCreateExtendedState({ ...extendedState }, utils.createState);
|
|
25
|
-
},
|
|
26
24
|
createDocument(state) {
|
|
27
|
-
const document = baseCreateDocument(utils.
|
|
25
|
+
const document = baseCreateDocument(utils.createState, state);
|
|
28
26
|
document.header.documentType = driveDocumentType;
|
|
29
27
|
// for backward compatibility -- but this is NOT a valid document id
|
|
30
28
|
document.header.id = generateId();
|
|
@@ -44,7 +42,6 @@ const utils = {
|
|
|
44
42
|
},
|
|
45
43
|
};
|
|
46
44
|
export const createDocument = utils.createDocument;
|
|
47
|
-
export const createExtendedState = utils.createExtendedState;
|
|
48
45
|
export const createState = utils.createState;
|
|
49
46
|
export default utils;
|
|
50
47
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/drive-document-model/gen/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/drive-document-model/gen/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAIL,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,oBAAoB,EACpB,gBAAgB,EAChB,UAAU,GACX,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAOvC,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AAC,CAAC;IAC3C,CAAC;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GACzB,KAAK,CAAC,cAAc,CAAC;AACvB,MAAM,CAAC,MAAM,WAAW,GACtB,KAAK,CAAC,WAAW,CAAC;AAEpB,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Factory methods for creating DocumentDriveDocument instances
|
|
3
|
+
*/
|
|
4
|
+
import { type PHAuthState, type PHDocumentState, type PHBaseState } from "document-model";
|
|
5
|
+
import type { DocumentDriveDocument, DocumentDriveLocalState, DocumentDriveState } from "./gen/types.js";
|
|
6
|
+
export declare function defaultGlobalState(): DocumentDriveState;
|
|
7
|
+
export declare function defaultLocalState(): DocumentDriveLocalState;
|
|
8
|
+
export declare function defaultPHState(): DocumentDrivePHState;
|
|
9
|
+
export declare function createGlobalState(state?: Partial<DocumentDriveState>): DocumentDriveState;
|
|
10
|
+
export declare function createLocalState(state?: Partial<DocumentDriveLocalState>): DocumentDriveLocalState;
|
|
11
|
+
export declare function createState(baseState?: Partial<PHBaseState>, globalState?: Partial<DocumentDriveState>, localState?: Partial<DocumentDriveLocalState>): DocumentDrivePHState;
|
|
12
|
+
export type DocumentDrivePHState = PHBaseState & {
|
|
13
|
+
global: DocumentDriveState;
|
|
14
|
+
local: DocumentDriveLocalState;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Creates a DocumentDriveDocument with custom global and local state
|
|
18
|
+
* This properly handles the PHBaseState requirements while allowing
|
|
19
|
+
* document-specific state to be set.
|
|
20
|
+
*/
|
|
21
|
+
export declare function createDriveDocument(state: Partial<{
|
|
22
|
+
auth?: Partial<PHAuthState>;
|
|
23
|
+
document?: Partial<PHDocumentState>;
|
|
24
|
+
global?: Partial<DocumentDriveState>;
|
|
25
|
+
local?: Partial<DocumentDriveLocalState>;
|
|
26
|
+
}>): DocumentDriveDocument;
|
|
27
|
+
//# sourceMappingURL=ph-factories.d.ts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AAC;CAC1C,CAAC,GACD,qBAAqB,CAUvB"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Factory methods for creating DocumentDriveDocument instances
|
|
3
|
+
*/
|
|
4
|
+
import { createBaseState, defaultBaseState, } from "document-model";
|
|
5
|
+
import { createDocument } from "./gen/utils.js";
|
|
6
|
+
export function defaultGlobalState() {
|
|
7
|
+
return {
|
|
8
|
+
icon: null,
|
|
9
|
+
name: "",
|
|
10
|
+
nodes: [],
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export function defaultLocalState() {
|
|
14
|
+
return {
|
|
15
|
+
availableOffline: false,
|
|
16
|
+
listeners: [],
|
|
17
|
+
sharingType: null,
|
|
18
|
+
triggers: [],
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export function defaultPHState() {
|
|
22
|
+
return {
|
|
23
|
+
...defaultBaseState(),
|
|
24
|
+
global: defaultGlobalState(),
|
|
25
|
+
local: defaultLocalState(),
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
export function createGlobalState(state) {
|
|
29
|
+
return {
|
|
30
|
+
...defaultGlobalState(),
|
|
31
|
+
...state,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
export function createLocalState(state) {
|
|
35
|
+
return {
|
|
36
|
+
...defaultLocalState(),
|
|
37
|
+
...state,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
export function createState(baseState, globalState, localState) {
|
|
41
|
+
return {
|
|
42
|
+
...createBaseState(baseState),
|
|
43
|
+
global: createGlobalState(globalState),
|
|
44
|
+
local: createLocalState(localState),
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Creates a DocumentDriveDocument with custom global and local state
|
|
49
|
+
* This properly handles the PHBaseState requirements while allowing
|
|
50
|
+
* document-specific state to be set.
|
|
51
|
+
*/
|
|
52
|
+
export function createDriveDocument(state) {
|
|
53
|
+
const document = createDocument(createState(createBaseState(state.auth, state.document), state.global, state.local));
|
|
54
|
+
return document;
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=ph-factories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ph-factories.js","sourceRoot":"","sources":["../../../src/drive-document-model/ph-factories.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,eAAe,EACf,gBAAgB,GAIjB,MAAM,gBAAgB,CAAC;AAMxB,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEhD,MAAM,UAAU,kBAAkB;IAChC,OAAO;QACL,IAAI,EAAE,IAAI;QACV,IAAI,EAAE,EAAE;QACR,KAAK,EAAE,EAAE;KACV,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,iBAAiB;IAC/B,OAAO;QACL,gBAAgB,EAAE,KAAK;QACvB,SAAS,EAAE,EAAE;QACb,WAAW,EAAE,IAAI;QACjB,QAAQ,EAAE,EAAE;KACb,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,cAAc;IAC5B,OAAO;QACL,GAAG,gBAAgB,EAAE;QACrB,MAAM,EAAE,kBAAkB,EAAE;QAC5B,KAAK,EAAE,iBAAiB,EAAE;KAC3B,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,iBAAiB,CAC/B,KAAmC;IAEnC,OAAO;QACL,GAAG,kBAAkB,EAAE;QACvB,GAAG,KAAK;KACT,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,gBAAgB,CAC9B,KAAwC;IAExC,OAAO;QACL,GAAG,iBAAiB,EAAE;QACtB,GAAG,KAAK;KACT,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,WAAW,CACzB,SAAgC,EAChC,WAAyC,EACzC,UAA6C;IAE7C,OAAO;QACL,GAAG,eAAe,CAAC,SAAS,CAAC;QAC7B,MAAM,EAAE,iBAAiB,CAAC,WAAW,CAAC;QACtC,KAAK,EAAE,gBAAgB,CAAC,UAAU,CAAC;KACpC,CAAC;AACJ,CAAC;AAOD;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CACjC,KAKE;IAEF,MAAM,QAAQ,GAAG,cAAc,CAC7B,WAAW,CACT,eAAe,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,QAAQ,CAAC,EAC3C,KAAK,CAAC,MAAM,EACZ,KAAK,CAAC,KAAK,CACZ,CACF,CAAC;IAEF,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../../../../src/drive-document-model/src/reducers/node.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EAAE,KAAK,2BAA2B,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../../../../src/drive-document-model/src/reducers/node.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EAAE,KAAK,2BAA2B,EAAE,MAAM,8BAA8B,CAAC;AAUhF,eAAO,MAAM,OAAO,EAAE,2BAiOrB,CAAC"}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { DocumentIdValidationError } from "#server/error";
|
|
7
7
|
import { isValidDocumentId } from "#storage/utils";
|
|
8
|
-
import { getDescendants, handleTargetNameCollisions, isFileNode, isFolderNode, } from "../utils.js";
|
|
8
|
+
import { getDescendants, handleTargetNameCollisions, isFileNode, isFolderNode, isValidName, } from "../utils.js";
|
|
9
9
|
export const reducer = {
|
|
10
10
|
addFileOperation(state, action, dispatch) {
|
|
11
11
|
if (state.nodes.find((node) => node.id === action.input.id)) {
|
|
@@ -14,6 +14,9 @@ export const reducer = {
|
|
|
14
14
|
if (!isValidDocumentId(action.input.id)) {
|
|
15
15
|
throw new DocumentIdValidationError(action.input.id);
|
|
16
16
|
}
|
|
17
|
+
if (!isValidName(action.input.name)) {
|
|
18
|
+
throw new Error(`Invalid name: '${action.input.name}'. Names must be valid URL characters.`);
|
|
19
|
+
}
|
|
17
20
|
const name = handleTargetNameCollisions({
|
|
18
21
|
nodes: state.nodes,
|
|
19
22
|
srcName: action.input.name,
|
|
@@ -39,6 +42,9 @@ export const reducer = {
|
|
|
39
42
|
if (state.nodes.find((node) => node.id === action.input.id)) {
|
|
40
43
|
throw new Error(`Node with id ${action.input.id} already exists!`);
|
|
41
44
|
}
|
|
45
|
+
if (!isValidName(action.input.name)) {
|
|
46
|
+
throw new Error(`Invalid name: '${action.input.name}'. Names must be valid URL characters.`);
|
|
47
|
+
}
|
|
42
48
|
const name = handleTargetNameCollisions({
|
|
43
49
|
nodes: state.nodes,
|
|
44
50
|
srcName: action.input.name,
|
|
@@ -71,6 +77,9 @@ export const reducer = {
|
|
|
71
77
|
});
|
|
72
78
|
},
|
|
73
79
|
updateFileOperation(state, action) {
|
|
80
|
+
if (action.input.name && !isValidName(action.input.name)) {
|
|
81
|
+
throw new Error(`Invalid name: '${action.input.name}'. Names must be valid URL characters.`);
|
|
82
|
+
}
|
|
74
83
|
state.nodes = state.nodes.map((node) => node.id === action.input.id
|
|
75
84
|
? {
|
|
76
85
|
...node,
|
|
@@ -86,6 +95,9 @@ export const reducer = {
|
|
|
86
95
|
: node);
|
|
87
96
|
},
|
|
88
97
|
updateNodeOperation(state, action) {
|
|
98
|
+
if (action.input.name && !isValidName(action.input.name)) {
|
|
99
|
+
throw new Error(`Invalid name: '${action.input.name}'. Names must be valid URL characters.`);
|
|
100
|
+
}
|
|
89
101
|
state.nodes = state.nodes.map((node) => node.id === action.input.id
|
|
90
102
|
? {
|
|
91
103
|
...node,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.js","sourceRoot":"","sources":["../../../../../src/drive-document-model/src/reducers/node.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAG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E,CAAC;QAED,MAAM,IAAI,GAAG,0BAA0B,CAAC;YACtC,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,OAAO,EAAE,IAAI,CAAC,IAAI;YAClB,kBAAkB,EAAE,MAAM,CAAC,KAAK,CAAC,kBAAkB,IAAI,IAAI;SAC5D,CAAC,CAAC;QAEH,IAAI,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC;YACvB,MAAM,WAAW,GAAG,cAAc,CAAC,IAAI,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;YACtD,2DAA2D;YAC3D,IACE,WAAW,CAAC,IAAI,CACd,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,EAAE,KAAK,MAAM,CAAC,KAAK,CAAC,kBAAkB,CAClE,EACD,CAAC;gBACD,MAAM,IAAI,KAAK,CACb,0EAA0E,CAC3E,CAAC;YACJ,CAAC;QACH,CAAC;QAED,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;YACrC,IAAI,IAAI,CAAC,EAAE,KAAK,MAAM,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC;gBACvC,OAAO;oBACL,GAAG,IAAI;oBACP,IAAI;oBACJ,YAAY,EAAE,MAAM,CAAC,KAAK,CAAC,kBAAkB,IAAI,IAAI;iBACtD,CAAC;YACJ,CAAC;YAED,OAAO,IAAI,CAAC;QACd,CAAC,CAAC,CAAC;IACL,CAAC;CACF,CAAC"}
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
* This is a scaffold file meant for customization:
|
|
3
3
|
* - change it by adding new tests or modifying the existing ones
|
|
4
4
|
*/
|
|
5
|
-
import { generateMock } from "@powerhousedao/codegen";
|
|
6
5
|
import { beforeEach, describe, expect, it } from "vitest";
|
|
7
6
|
import * as creators from "../../gen/drive/creators.js";
|
|
8
7
|
import { reducer } from "../../gen/reducer.js";
|
|
9
8
|
import { SetAvailableOfflineInputSchema, SetDriveNameInputSchema, SetSharingTypeInputSchema, } from "../../gen/schema/zod.js";
|
|
10
9
|
import { createDocument } from "../../gen/utils.js";
|
|
10
|
+
import { generateMock } from "./generate-mock.js";
|
|
11
11
|
describe("Drive Operations", () => {
|
|
12
12
|
let document;
|
|
13
13
|
beforeEach(() => {
|
|
@@ -17,24 +17,24 @@ describe("Drive Operations", () => {
|
|
|
17
17
|
const input = generateMock(SetDriveNameInputSchema());
|
|
18
18
|
const updatedDocument = reducer(document, creators.setDriveName(input));
|
|
19
19
|
expect(updatedDocument.operations.global).toHaveLength(1);
|
|
20
|
-
expect(updatedDocument.operations.global[0].type).toBe("SET_DRIVE_NAME");
|
|
21
|
-
expect(updatedDocument.operations.global[0].input).toStrictEqual(input);
|
|
20
|
+
expect(updatedDocument.operations.global[0].action.type).toBe("SET_DRIVE_NAME");
|
|
21
|
+
expect(updatedDocument.operations.global[0].action.input).toStrictEqual(input);
|
|
22
22
|
expect(updatedDocument.operations.global[0].index).toEqual(0);
|
|
23
23
|
});
|
|
24
24
|
it("should handle setSharingType operation", () => {
|
|
25
25
|
const input = generateMock(SetSharingTypeInputSchema());
|
|
26
26
|
const updatedDocument = reducer(document, creators.setSharingType(input));
|
|
27
27
|
expect(updatedDocument.operations.local).toHaveLength(1);
|
|
28
|
-
expect(updatedDocument.operations.local[0].type).toBe("SET_SHARING_TYPE");
|
|
29
|
-
expect(updatedDocument.operations.local[0].input).toStrictEqual(input);
|
|
28
|
+
expect(updatedDocument.operations.local[0].action.type).toBe("SET_SHARING_TYPE");
|
|
29
|
+
expect(updatedDocument.operations.local[0].action.input).toStrictEqual(input);
|
|
30
30
|
expect(updatedDocument.operations.local[0].index).toEqual(0);
|
|
31
31
|
});
|
|
32
32
|
it("should handle setAvailableOffline operation", () => {
|
|
33
33
|
const input = generateMock(SetAvailableOfflineInputSchema());
|
|
34
34
|
const updatedDocument = reducer(document, creators.setAvailableOffline(input));
|
|
35
35
|
expect(updatedDocument.operations.local).toHaveLength(1);
|
|
36
|
-
expect(updatedDocument.operations.local[0].type).toBe("SET_AVAILABLE_OFFLINE");
|
|
37
|
-
expect(updatedDocument.operations.local[0].input).toStrictEqual(input);
|
|
36
|
+
expect(updatedDocument.operations.local[0].action.type).toBe("SET_AVAILABLE_OFFLINE");
|
|
37
|
+
expect(updatedDocument.operations.local[0].action.input).toStrictEqual(input);
|
|
38
38
|
expect(updatedDocument.operations.local[0].index).toEqual(0);
|
|
39
39
|
});
|
|
40
40
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drive.test.js","sourceRoot":"","sources":["../../../../../src/drive-document-model/src/tests/drive.test.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"drive.test.js","sourceRoot":"","sources":["../../../../../src/drive-document-model/src/tests/drive.test.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC1D,OAAO,KAAK,QAAQ,MAAM,6BAA6B,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EACL,8BAA8B,EAC9B,uBAAuB,EACvB,yBAAyB,GAC1B,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;IAChC,IAAI,QAA+B,CAAC;IAEpC,UAAU,CAAC,GAAG,EAAE;QACd,QAAQ,GAAG,cAAc,EAAE,CAAC;IAC9B,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,sCAAsC,EAAE,GAAG,EAAE;QAC9C,MAAM,KAAK,GAAG,YAAY,CAAC,uBAAuB,EAAE,CAAC,CAAC;QACtD,MAAM,eAAe,GAAG,OAAO,CAAC,QAAQ,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CAAC;IAC/D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,6CAA6C,EAAE,GAAG,EAAE;QACrD,MAAM,KAAK,GAAG,YAAY,CAAC,8BAA8B,EAAE,CAAC,CAAC;QAC7D,MAAM,eAAe,GAAG,OAAO,CAC7B,QAAQ,EACR,QAAQ,CAAC,mBAAmB,CAAC,KAAK,CAAC,CACpC,CAAC;QAEF,MAAM,CAAC,eAAe,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;QACzD,MAAM,CAAC,eAAe,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAC1D,uBAAuB,CACxB,CAAC;QACF,MAAM,CAAC,eAAe,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,aAAa,CACpE,KAAK,CACN,CAAC;QACF,MAAM,CAAC,eAAe,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC/D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-mock.d.ts","sourceRoot":"","sources":["../../../../../src/drive-document-model/src/tests/generate-mock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpE,MAAM,MAAM,kBAAkB,GAAG,OAAO,eAAe,CAAC;AAExD,eAAO,MAAM,YAAY,EAAE,kBAE1B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-mock.js","sourceRoot":"","sources":["../../../../../src/drive-document-model/src/tests/generate-mock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAGpE,MAAM,CAAC,MAAM,YAAY,GAAuB,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE;IAClE,OAAO,eAAe,CAAC,MAAM,EAAE,OAAO,CAAuB,CAAC;AAChE,CAAC,CAAC"}
|