@fluidframework/datastore-definitions 0.52.0-44610 → 0.53.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/.eslintrc.js CHANGED
@@ -4,6 +4,9 @@
4
4
  */
5
5
 
6
6
  module.exports = {
7
+ "parserOptions": {
8
+ "project": ["./tsconfig.json", "./src/test/tsconfig.json"]
9
+ },
7
10
  "extends": [
8
11
  "@fluidframework/eslint-config-fluid/eslint7"
9
12
  ]
@@ -19,6 +19,9 @@ export interface IFluidDataStoreRuntimeEvents extends IEvent {
19
19
  */
20
20
  export interface IFluidDataStoreRuntime extends IFluidRouter, IEventProvider<IFluidDataStoreRuntimeEvents>, IDisposable, Partial<IProvideFluidDataStoreRegistry> {
21
21
  readonly id: string;
22
+ /**
23
+ * @deprecated - FluidSerializer is not required as DDSs are the only ones that serialize data.
24
+ */
22
25
  readonly IFluidSerializer: IFluidSerializer;
23
26
  readonly IFluidHandleContext: IFluidHandleContext;
24
27
  readonly rootRoutingContext: IFluidHandleContext;
@@ -1 +1 @@
1
- {"version":3,"file":"dataStoreRuntime.d.ts","sourceRoot":"","sources":["../src/dataStoreRuntime.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAC3G,OAAO,EACH,mBAAmB,EACnB,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACf,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACH,SAAS,EACT,aAAa,EACb,gBAAgB,EAChB,WAAW,EACX,cAAc,EACjB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EACH,gBAAgB,EAChB,OAAO,EACP,yBAAyB,EAC5B,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,qBAAqB,EAAE,8BAA8B,EAAE,MAAM,qCAAqC,CAAC;AAC5G,OAAO,EAAE,QAAQ,EAAE,MAAM,GAA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H,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IAE1C;;;;OAIG;IACH,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,EAAE,IAAI,EAAE,MAAM,GAAG,QAAQ,CAAC;IAE9D;;;OAGG;IACH,WAAW,CAAC,OAAO,EAAE,QAAQ,GAAG,IAAI,CAAC;IAGrC;;;OAGG;IACH,UAAU,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC,CAAC;IAE1E;;;;OAIG;IACH,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,GAAG,IAAI,CAAC;IAE/C;;OAEG;IACH,SAAS,IAAI,OAAO,CAAC;IAErB;;OAEG;IACH,WAAW,IAAI,SAAS,CAAC;IAEzB;;OAEG;IACH,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAE9B;;;OAGG;IACH,qBAAqB,CAAC,OAAO,EAAE,gBAAgB,GAAG,IAAI,CAAC;CAC1D"}
@@ -1 +1 @@
1
- {"version":3,"file":"dataStoreRuntime.js","sourceRoot":"","sources":["../src/dataStoreRuntime.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IDisposable, IEvent, IEventProvider, ITelemetryLogger } from \"@fluidframework/common-definitions\";\nimport {\n IFluidHandleContext,\n IFluidSerializer,\n IFluidRouter,\n IFluidHandle,\n} from \"@fluidframework/core-interfaces\";\nimport {\n IAudience,\n IDeltaManager,\n ContainerWarning,\n AttachState,\n ILoaderOptions,\n} from \"@fluidframework/container-definitions\";\nimport {\n IDocumentMessage,\n IQuorum,\n ISequencedDocumentMessage,\n} from \"@fluidframework/protocol-definitions\";\nimport { IInboundSignalMessage, IProvideFluidDataStoreRegistry } from \"@fluidframework/runtime-definitions\";\nimport { IChannel } from \".\";\n\nexport interface IFluidDataStoreRuntimeEvents extends IEvent {\n (\n // eslint-disable-next-line @typescript-eslint/unified-signatures\n event: \"disconnected\" | \"dispose\" | \"attaching\" | \"attached\",\n listener: () => void,\n );\n (event: \"op\", listener: (message: ISequencedDocumentMessage) => void);\n (event: \"signal\", listener: (message: IInboundSignalMessage, local: boolean) => void);\n (event: \"connected\", listener: (clientId: string) => void);\n}\n\n/**\n * Represents the runtime for the data store. Contains helper functions/state of the data store.\n */\nexport interface IFluidDataStoreRuntime extends\n IFluidRouter,\n IEventProvider<IFluidDataStoreRuntimeEvents>,\n IDisposable,\n Partial<IProvideFluidDataStoreRegistry> {\n\n readonly id: string;\n\n readonly IFluidSerializer: IFluidSerializer;\n\n readonly IFluidHandleContext: IFluidHandleContext;\n\n readonly rootRoutingContext: IFluidHandleContext;\n readonly channelsRoutingContext: IFluidHandleContext;\n readonly objectsRoutingContext: IFluidHandleContext;\n\n readonly options: ILoaderOptions;\n\n readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;\n\n readonly clientId: string | undefined;\n\n readonly connected: boolean;\n\n readonly logger: ITelemetryLogger;\n\n /**\n * Indicates the attachment state of the data store to a host service.\n */\n readonly attachState: AttachState;\n\n /**\n * Returns the channel with the given id\n */\n getChannel(id: string): Promise<IChannel>;\n\n /**\n * Creates a new channel of the given type.\n * @param id - ID of the channel to be created. A unique ID will be generated if left undefined.\n * @param type - Type of the channel.\n */\n createChannel(id: string | undefined, type: string): IChannel;\n\n /**\n * Bind the channel with the data store runtime. If the runtime\n * is attached then we attach the channel to make it live.\n */\n bindChannel(channel: IChannel): void;\n\n // Blob related calls\n /**\n * Api to upload a blob of data.\n * @param blob - blob to be uploaded.\n */\n uploadBlob(blob: ArrayBufferLike): Promise<IFluidHandle<ArrayBufferLike>>;\n\n /**\n * Submits the signal to be sent to other clients.\n * @param type - Type of the signal.\n * @param content - Content of the signal.\n */\n submitSignal(type: string, content: any): void;\n\n /**\n * Returns the current quorum.\n */\n getQuorum(): IQuorum;\n\n /**\n * Returns the current audience.\n */\n getAudience(): IAudience;\n\n /**\n * Resolves when a local data store is attached.\n */\n waitAttached(): Promise<void>;\n\n /**\n * Errors raised by distributed data structures\n * @deprecated Warnings are being deprecated\n */\n raiseContainerWarning(warning: ContainerWarning): void;\n}\n"]}
1
+ {"version":3,"file":"dataStoreRuntime.js","sourceRoot":"","sources":["../src/dataStoreRuntime.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IDisposable, IEvent, IEventProvider, ITelemetryLogger } from \"@fluidframework/common-definitions\";\nimport {\n IFluidHandleContext,\n IFluidSerializer,\n IFluidRouter,\n IFluidHandle,\n} from \"@fluidframework/core-interfaces\";\nimport {\n IAudience,\n IDeltaManager,\n ContainerWarning,\n AttachState,\n ILoaderOptions,\n} from \"@fluidframework/container-definitions\";\nimport {\n IDocumentMessage,\n IQuorum,\n ISequencedDocumentMessage,\n} from \"@fluidframework/protocol-definitions\";\nimport { IInboundSignalMessage, IProvideFluidDataStoreRegistry } from \"@fluidframework/runtime-definitions\";\nimport { IChannel } from \".\";\n\nexport interface IFluidDataStoreRuntimeEvents extends IEvent {\n (\n // eslint-disable-next-line @typescript-eslint/unified-signatures\n event: \"disconnected\" | \"dispose\" | \"attaching\" | \"attached\",\n listener: () => void,\n );\n (event: \"op\", listener: (message: ISequencedDocumentMessage) => void);\n (event: \"signal\", listener: (message: IInboundSignalMessage, local: boolean) => void);\n (event: \"connected\", listener: (clientId: string) => void);\n}\n\n/**\n * Represents the runtime for the data store. Contains helper functions/state of the data store.\n */\nexport interface IFluidDataStoreRuntime extends\n IFluidRouter,\n IEventProvider<IFluidDataStoreRuntimeEvents>,\n IDisposable,\n Partial<IProvideFluidDataStoreRegistry> {\n\n readonly id: string;\n\n /**\n * @deprecated - FluidSerializer is not required as DDSs are the only ones that serialize data.\n */\n readonly IFluidSerializer: IFluidSerializer;\n\n readonly IFluidHandleContext: IFluidHandleContext;\n\n readonly rootRoutingContext: IFluidHandleContext;\n readonly channelsRoutingContext: IFluidHandleContext;\n readonly objectsRoutingContext: IFluidHandleContext;\n\n readonly options: ILoaderOptions;\n\n readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;\n\n readonly clientId: string | undefined;\n\n readonly connected: boolean;\n\n readonly logger: ITelemetryLogger;\n\n /**\n * Indicates the attachment state of the data store to a host service.\n */\n readonly attachState: AttachState;\n\n /**\n * Returns the channel with the given id\n */\n getChannel(id: string): Promise<IChannel>;\n\n /**\n * Creates a new channel of the given type.\n * @param id - ID of the channel to be created. A unique ID will be generated if left undefined.\n * @param type - Type of the channel.\n */\n createChannel(id: string | undefined, type: string): IChannel;\n\n /**\n * Bind the channel with the data store runtime. If the runtime\n * is attached then we attach the channel to make it live.\n */\n bindChannel(channel: IChannel): void;\n\n // Blob related calls\n /**\n * Api to upload a blob of data.\n * @param blob - blob to be uploaded.\n */\n uploadBlob(blob: ArrayBufferLike): Promise<IFluidHandle<ArrayBufferLike>>;\n\n /**\n * Submits the signal to be sent to other clients.\n * @param type - Type of the signal.\n * @param content - Content of the signal.\n */\n submitSignal(type: string, content: any): void;\n\n /**\n * Returns the current quorum.\n */\n getQuorum(): IQuorum;\n\n /**\n * Returns the current audience.\n */\n getAudience(): IAudience;\n\n /**\n * Resolves when a local data store is attached.\n */\n waitAttached(): Promise<void>;\n\n /**\n * Errors raised by distributed data structures\n * @deprecated Warnings are being deprecated\n */\n raiseContainerWarning(warning: ContainerWarning): void;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/datastore-definitions",
3
- "version": "0.52.0-44610",
3
+ "version": "0.53.0",
4
4
  "description": "Fluid data store definitions",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": "https://github.com/microsoft/FluidFramework",
@@ -11,7 +11,7 @@
11
11
  "types": "dist/index.d.ts",
12
12
  "scripts": {
13
13
  "build": "npm run build:gen && concurrently npm:build:compile npm:lint && npm run build:docs",
14
- "build:compile": "npm run tsc",
14
+ "build:compile": "npm run tsc && npm run build:test",
15
15
  "build:docs": "api-extractor run --local --typescript-compiler-folder ../../../node_modules/typescript && copyfiles -u 1 ./_api-extractor-temp/doc-models/* ../../../_api-extractor-temp/",
16
16
  "build:full": "npm run build",
17
17
  "build:full:compile": "npm run build:compile",
@@ -19,13 +19,13 @@
19
19
  "build:gen:bump": "npm run build:gen:typetests:prepare",
20
20
  "build:gen:typetests": "fluid-type-validator -d .",
21
21
  "build:gen:typetests:prepare": "fluid-type-validator -d . -p",
22
+ "build:test": "tsc --project ./src/test/tsconfig.json",
22
23
  "ci:build:docs": "api-extractor run --typescript-compiler-folder ../../../node_modules/typescript && copyfiles -u 1 ./_api-extractor-temp/* ../../../_api-extractor-temp/",
23
24
  "clean": "rimraf dist *.tsbuildinfo *.build.log",
24
25
  "eslint": "eslint --format stylish src",
25
26
  "eslint:fix": "eslint --format stylish src --fix",
26
27
  "lint": "npm run eslint",
27
28
  "lint:fix": "npm run eslint:fix",
28
- "test:types": "tsd",
29
29
  "tsc": "tsc",
30
30
  "tsfmt": "tsfmt --verify",
31
31
  "tsfmt:fix": "tsfmt --replace"
@@ -33,16 +33,17 @@
33
33
  "dependencies": {
34
34
  "@fluidframework/common-definitions": "^0.20.1",
35
35
  "@fluidframework/common-utils": "^0.32.1",
36
- "@fluidframework/container-definitions": "^0.42.0-0",
37
- "@fluidframework/core-interfaces": "^0.41.0-0",
38
- "@fluidframework/protocol-definitions": "^0.1026.0-0",
39
- "@fluidframework/runtime-definitions": "0.52.0-44610",
36
+ "@fluidframework/container-definitions": "^0.43.0",
37
+ "@fluidframework/core-interfaces": "^0.41.0",
38
+ "@fluidframework/protocol-definitions": "^0.1026.0",
39
+ "@fluidframework/runtime-definitions": "^0.53.0",
40
40
  "@types/node": "^12.19.0"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@fluidframework/build-common": "^0.23.0",
44
- "@fluidframework/build-tools": "^0.2.44421",
44
+ "@fluidframework/build-tools": "^0.2.44827",
45
45
  "@fluidframework/datastore-definitions-0.51.1": "npm:@fluidframework/datastore-definitions@0.51.1",
46
+ "@fluidframework/datastore-definitions-0.52.0": "npm:@fluidframework/datastore-definitions@0.52.0",
46
47
  "@fluidframework/eslint-config-fluid": "^0.24.0",
47
48
  "@microsoft/api-extractor": "^7.16.1",
48
49
  "@typescript-eslint/eslint-plugin": "~4.14.0",
@@ -57,29 +58,28 @@
57
58
  "eslint-plugin-react": "~7.22.0",
58
59
  "eslint-plugin-unicorn": "~26.0.1",
59
60
  "rimraf": "^2.6.2",
60
- "tsd": "^0.11.0",
61
61
  "typescript": "~4.1.3",
62
62
  "typescript-formatter": "7.1.0"
63
63
  },
64
- "tsd": {
65
- "directory": "test-d",
66
- "compilerOptions": {
67
- "rootDir": "test-d",
68
- "include": [
69
- "test-d/*"
70
- ],
71
- "lib": [
72
- "es2015"
73
- ],
74
- "types": [],
75
- "exclude": [
76
- "dist",
77
- "node_modules"
78
- ]
79
- }
80
- },
81
64
  "typeValidation": {
82
- "version": "0.52.0",
83
- "broken": {}
65
+ "version": "0.53.0",
66
+ "broken": {
67
+ "0.51.1": {
68
+ "InterfaceDeclaration_IChannel": {
69
+ "backCompat": false
70
+ },
71
+ "InterfaceDeclaration_IChannelFactory": {
72
+ "backCompat": false
73
+ },
74
+ "InterfaceDeclaration_IFluidDataStoreRuntime": {
75
+ "backCompat": false
76
+ }
77
+ },
78
+ "0.52.0": {
79
+ "InterfaceDeclaration_IFluidDataStoreRuntime": {
80
+ "backCompat": false
81
+ }
82
+ }
83
+ }
84
84
  }
85
85
  }
@@ -47,6 +47,9 @@ export interface IFluidDataStoreRuntime extends
47
47
 
48
48
  readonly id: string;
49
49
 
50
+ /**
51
+ * @deprecated - FluidSerializer is not required as DDSs are the only ones that serialize data.
52
+ */
50
53
  readonly IFluidSerializer: IFluidSerializer;
51
54
 
52
55
  readonly IFluidHandleContext: IFluidHandleContext;
package/tsconfig.json CHANGED
@@ -3,13 +3,14 @@
3
3
  "exclude": [
4
4
  "dist",
5
5
  "node_modules",
6
- "test-d"
6
+ "src/test/**/*"
7
7
  ],
8
8
  "compilerOptions": {
9
9
  "rootDir": "./src",
10
- "outDir": "./dist"
10
+ "outDir": "./dist",
11
+ "composite": true,
11
12
  },
12
13
  "include": [
13
14
  "src/**/*"
14
15
  ]
15
- }
16
+ }
@@ -1,170 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
-
6
- import {expectError} from 'tsd';
7
- import { Jsonable } from '../dist/jsonable';
8
-
9
- declare function foo<T>(a: Jsonable<T>): void;
10
-
11
- // --- ideally wouldn't work but do as we don't know how to just exclude classes
12
-
13
- // test simple class.
14
- class Z {
15
- public a = "a";
16
- }
17
-
18
- foo<Z>(new Z())
19
-
20
- //test class with getter
21
- class getter {
22
- public get baz(): number {
23
- return 0;
24
- }
25
- }
26
-
27
- foo(new getter());
28
-
29
- // --- should work
30
-
31
- // test plain types
32
- foo(1);
33
- foo("");
34
- foo(undefined);
35
- foo(null);
36
- foo(true);
37
- foo([]);
38
- foo([0]);
39
- foo([""]);
40
- foo({});
41
- foo({ a:"a" });
42
-
43
- // test simple interface
44
- interface IA {
45
- a: "a";
46
- }
47
- declare const a: IA;
48
- foo(a)
49
-
50
- // test simple indexed interface
51
- interface IA2 {
52
- ["a"]: "a";
53
- }
54
- declare const a2: IA2;
55
- foo(a2);
56
-
57
- // text complex indexed interface
58
- declare const a3: { [key: string]: Jsonable<string> };
59
- foo(a3);
60
-
61
- // test interface with multiple properties
62
- interface A5 {
63
- a: "a",
64
- b: "b",
65
- };
66
- declare const a5: A5;
67
- foo(a5);
68
-
69
- // test interface with optional property
70
- interface A6 {
71
- a?: "a",
72
- };
73
- declare const a6: A6;
74
- foo(a6);
75
-
76
- // test simple type
77
- type A7 = {
78
- a: "a",
79
- };
80
-
81
- declare const a7: A7;
82
- foo(a7);
83
-
84
-
85
- // test nested interface
86
- interface IBN {
87
- b2: string;
88
- }
89
-
90
- interface INested {
91
- a: string;
92
- b: IBN;
93
- }
94
-
95
- const nested: INested = {
96
- a: "a",
97
- b: {
98
- b2:"foo",
99
- },
100
- }
101
- foo(nested);
102
-
103
- // --- should not work
104
-
105
- // test interface with method, and member
106
- interface IA11 {
107
- ["a"]: "a";
108
- foo: () => void;
109
- }
110
- declare const a11: IA11;
111
- expectError(foo(a11));
112
-
113
-
114
- // test interface with optional method
115
- interface A12 {
116
- foo?: () => void,
117
- };
118
- declare const a12: A12;
119
- expectError(foo(a12));
120
-
121
- // test type with method
122
- type A13 = {
123
- foo: () => void,
124
- };
125
- declare const a13: A13;
126
- expectError(foo(a13));
127
-
128
- // test type with primative and object with classes union
129
- interface IA14 {
130
- a: number | Date;
131
- }
132
- declare const a14: IA14;
133
- expectError(foo(a14));
134
-
135
- //test class with function
136
- class bar {
137
- public baz() {
138
- }
139
- }
140
-
141
- expectError(foo(new bar()));
142
-
143
-
144
- // test class with complex property
145
- interface MapProp{
146
- m: Map<string,string>
147
- }
148
- const mt: MapProp = {
149
- m: new Map(),
150
- }
151
- expectError(foo(mt));
152
-
153
- //test nested interface with complex property
154
- interface NestedMapProp{
155
- n: MapProp;
156
- }
157
- const nmt: NestedMapProp = {
158
- n: mt,
159
- };
160
- expectError(foo(nmt));
161
-
162
- // test class with symbol indexer for property
163
- const sym = Symbol.for("test");
164
- interface ISymbol{
165
- [sym]:string,
166
- }
167
- const isym: ISymbol ={
168
- [sym]:"foo",
169
- }
170
- expectError(foo(isym));