@fluid-experimental/pact-map 2.0.0-internal.2.4.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 +26 -0
- package/.mocharc.js +12 -0
- package/LICENSE +21 -0
- package/README.md +55 -0
- package/api-extractor.json +4 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -0
- package/dist/interfaces.d.ts +55 -0
- package/dist/interfaces.d.ts.map +1 -0
- package/dist/interfaces.js +7 -0
- package/dist/interfaces.js.map +1 -0
- package/dist/packageVersion.d.ts +9 -0
- package/dist/packageVersion.d.ts.map +1 -0
- package/dist/packageVersion.js +12 -0
- package/dist/packageVersion.js.map +1 -0
- package/dist/pactMap.d.ts +162 -0
- package/dist/pactMap.d.ts.map +1 -0
- package/dist/pactMap.js +353 -0
- package/dist/pactMap.js.map +1 -0
- package/dist/pactMapFactory.d.ts +21 -0
- package/dist/pactMapFactory.d.ts.map +1 -0
- package/dist/pactMapFactory.js +41 -0
- package/dist/pactMapFactory.js.map +1 -0
- package/lib/index.d.ts +7 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +6 -0
- package/lib/index.js.map +1 -0
- package/lib/interfaces.d.ts +55 -0
- package/lib/interfaces.d.ts.map +1 -0
- package/lib/interfaces.js +6 -0
- package/lib/interfaces.js.map +1 -0
- package/lib/packageVersion.d.ts +9 -0
- package/lib/packageVersion.d.ts.map +1 -0
- package/lib/packageVersion.js +9 -0
- package/lib/packageVersion.js.map +1 -0
- package/lib/pactMap.d.ts +162 -0
- package/lib/pactMap.d.ts.map +1 -0
- package/lib/pactMap.js +349 -0
- package/lib/pactMap.js.map +1 -0
- package/lib/pactMapFactory.d.ts +21 -0
- package/lib/pactMapFactory.d.ts.map +1 -0
- package/lib/pactMapFactory.js +37 -0
- package/lib/pactMapFactory.js.map +1 -0
- package/package.json +98 -0
- package/prettier.config.cjs +8 -0
- package/src/index.ts +7 -0
- package/src/interfaces.ts +61 -0
- package/src/packageVersion.ts +9 -0
- package/src/pactMap.ts +493 -0
- package/src/pactMapFactory.ts +54 -0
- package/tsconfig.esnext.json +7 -0
- package/tsconfig.json +14 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
IChannelAttributes,
|
|
8
|
+
IFluidDataStoreRuntime,
|
|
9
|
+
IChannelServices,
|
|
10
|
+
IChannelFactory,
|
|
11
|
+
} from "@fluidframework/datastore-definitions";
|
|
12
|
+
import { PactMap } from "./pactMap";
|
|
13
|
+
import { IPactMap } from "./interfaces";
|
|
14
|
+
import { pkgVersion } from "./packageVersion";
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* The factory that produces the PactMap
|
|
18
|
+
*/
|
|
19
|
+
export class PactMapFactory implements IChannelFactory {
|
|
20
|
+
public static readonly Type = "https://graph.microsoft.com/types/pact-map";
|
|
21
|
+
|
|
22
|
+
public static readonly Attributes: IChannelAttributes = {
|
|
23
|
+
type: PactMapFactory.Type,
|
|
24
|
+
snapshotFormatVersion: "0.1",
|
|
25
|
+
packageVersion: pkgVersion,
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
public get type(): string {
|
|
29
|
+
return PactMapFactory.Type;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
public get attributes(): IChannelAttributes {
|
|
33
|
+
return PactMapFactory.Attributes;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.load}
|
|
38
|
+
*/
|
|
39
|
+
public async load(
|
|
40
|
+
runtime: IFluidDataStoreRuntime,
|
|
41
|
+
id: string,
|
|
42
|
+
services: IChannelServices,
|
|
43
|
+
attributes: IChannelAttributes): Promise<IPactMap> {
|
|
44
|
+
const pactMap = new PactMap(id, runtime, attributes);
|
|
45
|
+
await pactMap.load(services);
|
|
46
|
+
return pactMap;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
public create(document: IFluidDataStoreRuntime, id: string): IPactMap {
|
|
50
|
+
const pactMap = new PactMap(id, document, this.attributes);
|
|
51
|
+
pactMap.initializeLocal();
|
|
52
|
+
return pactMap;
|
|
53
|
+
}
|
|
54
|
+
}
|
package/tsconfig.json
ADDED