@fluidframework/tool-utils 2.0.0-rc.2.0.2 → 2.0.0-rc.3.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.
Files changed (52) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/dist/debug.d.ts.map +1 -1
  3. package/dist/debug.js.map +1 -1
  4. package/dist/fluidToolRC.d.ts.map +1 -1
  5. package/dist/fluidToolRC.js.map +1 -1
  6. package/dist/odspTokenManager.d.ts +1 -1
  7. package/dist/odspTokenManager.d.ts.map +1 -1
  8. package/dist/odspTokenManager.js +9 -9
  9. package/dist/odspTokenManager.js.map +1 -1
  10. package/dist/packageVersion.d.ts +1 -1
  11. package/dist/packageVersion.js +1 -1
  12. package/dist/packageVersion.js.map +1 -1
  13. package/dist/public.d.ts +12 -0
  14. package/dist/snapshotNormalizer.d.ts.map +1 -1
  15. package/dist/snapshotNormalizer.js +8 -8
  16. package/dist/snapshotNormalizer.js.map +1 -1
  17. package/internal.d.ts +11 -0
  18. package/lib/debug.d.ts.map +1 -1
  19. package/lib/debug.js.map +1 -1
  20. package/lib/fluidToolRC.d.ts.map +1 -1
  21. package/lib/fluidToolRC.js.map +1 -1
  22. package/lib/odspTokenManager.d.ts +1 -1
  23. package/lib/odspTokenManager.d.ts.map +1 -1
  24. package/lib/odspTokenManager.js +5 -5
  25. package/lib/odspTokenManager.js.map +1 -1
  26. package/lib/packageVersion.d.ts +1 -1
  27. package/lib/packageVersion.js +1 -1
  28. package/lib/packageVersion.js.map +1 -1
  29. package/lib/public.d.ts +12 -0
  30. package/lib/snapshotNormalizer.d.ts.map +1 -1
  31. package/lib/snapshotNormalizer.js +3 -3
  32. package/lib/snapshotNormalizer.js.map +1 -1
  33. package/package.json +24 -45
  34. package/src/debug.ts +1 -0
  35. package/src/fluidToolRC.ts +2 -1
  36. package/src/odspTokenManager.ts +9 -8
  37. package/src/packageVersion.ts +1 -1
  38. package/src/snapshotNormalizer.ts +8 -4
  39. package/api-extractor-cjs.json +0 -8
  40. package/dist/tool-utils-alpha.d.ts +0 -35
  41. package/dist/tool-utils-beta.d.ts +0 -35
  42. package/dist/tool-utils-public.d.ts +0 -35
  43. package/dist/tool-utils-untrimmed.d.ts +0 -130
  44. package/lib/test/snapshotNormalizer.spec.js +0 -140
  45. package/lib/test/snapshotNormalizer.spec.js.map +0 -1
  46. package/lib/test/types/validateToolUtilsPrevious.generated.js +0 -28
  47. package/lib/test/types/validateToolUtilsPrevious.generated.js.map +0 -1
  48. package/lib/tool-utils-alpha.d.ts +0 -35
  49. package/lib/tool-utils-beta.d.ts +0 -35
  50. package/lib/tool-utils-public.d.ts +0 -35
  51. package/lib/tool-utils-untrimmed.d.ts +0 -130
  52. /package/{dist → lib}/tsdoc-metadata.json +0 -0
@@ -1,130 +0,0 @@
1
- import { IClientConfig } from '@fluidframework/odsp-doclib-utils/internal';
2
- import { IOdspTokens } from '@fluidframework/odsp-doclib-utils/internal';
3
- import { ITree } from '@fluidframework/protocol-definitions';
4
-
5
- /**
6
- * The prefix that all GC blob names start with.
7
- *
8
- * @internal
9
- */
10
- export declare const gcBlobPrefix = "__gc";
11
-
12
- /**
13
- * @internal
14
- */
15
- export declare const getMicrosoftConfiguration: () => IClientConfig;
16
-
17
- /**
18
- * Helper function that normalizes the given snapshot tree. It sorts objects and arrays in the snapshot. It also
19
- * normalizes certain blob contents for which the order of content does not matter. For example, garbage collection
20
- * blobs contains objects / arrays whose element order do not matter.
21
- * @param snapshot - The snapshot tree to normalize.
22
- * @param config - Configs to use when normalizing snapshot. For example, it can contain paths of blobs whose contents
23
- * should be normalized as well.
24
- * @returns a copy of the normalized snapshot tree.
25
- * @internal
26
- */
27
- export declare function getNormalizedSnapshot(snapshot: ITree, config?: ISnapshotNormalizerConfig): ITree;
28
-
29
- /**
30
- * @internal
31
- */
32
- export declare interface IAsyncCache<TKey, TValue> {
33
- get(key: TKey): Promise<TValue | undefined>;
34
- save(key: TKey, value: TValue): Promise<void>;
35
- lock<T>(callback: () => Promise<T>): Promise<T>;
36
- }
37
-
38
- /**
39
- * @internal
40
- */
41
- export declare interface IOdspTokenManagerCacheKey {
42
- readonly isPush: boolean;
43
- readonly userOrServer: string;
44
- }
45
-
46
- /**
47
- * @internal
48
- */
49
- export declare interface IResources {
50
- tokens?: {
51
- version?: number;
52
- data: {
53
- [key: string]: {
54
- storage?: IOdspTokens;
55
- push?: IOdspTokens;
56
- };
57
- };
58
- };
59
- }
60
-
61
- /**
62
- * @internal
63
- */
64
- export declare interface ISnapshotNormalizerConfig {
65
- blobsToNormalize?: string[];
66
- /**
67
- * channel types who's content (non-attribute) blobs will be excluded.
68
- * this is used to exclude the content of channels who's content cannot be compared
69
- * as the content is non-deterministic between snapshot at the same sequence number.
70
- */
71
- excludedChannelContentTypes?: string[];
72
- }
73
-
74
- /**
75
- * @internal
76
- */
77
- export declare function loadRC(): Promise<IResources>;
78
-
79
- /**
80
- * @internal
81
- */
82
- export declare function lockRC(): Promise<any>;
83
-
84
- /**
85
- * @internal
86
- */
87
- export declare type OdspTokenConfig = {
88
- type: "password";
89
- username: string;
90
- password: string;
91
- } | {
92
- type: "browserLogin";
93
- navigator: (url: string) => void;
94
- redirectUriCallback?: (tokens: IOdspTokens) => Promise<string>;
95
- };
96
-
97
- /**
98
- * @internal
99
- */
100
- export declare class OdspTokenManager {
101
- private readonly tokenCache?;
102
- private readonly storageCache;
103
- private readonly pushCache;
104
- private readonly cacheMutex;
105
- constructor(tokenCache?: IAsyncCache<IOdspTokenManagerCacheKey, IOdspTokens> | undefined);
106
- updateTokensCache(key: IOdspTokenManagerCacheKey, value: IOdspTokens): Promise<void>;
107
- private updateTokensCacheWithoutLock;
108
- getOdspTokens(server: string, clientConfig: IClientConfig, tokenConfig: OdspTokenConfig, forceRefresh?: boolean, forceReauth?: boolean): Promise<IOdspTokens>;
109
- getPushTokens(server: string, clientConfig: IClientConfig, tokenConfig: OdspTokenConfig, forceRefresh?: boolean, forceReauth?: boolean): Promise<IOdspTokens>;
110
- private getTokenFromCache;
111
- private static getCacheKey;
112
- private getTokens;
113
- private getTokensCore;
114
- private acquireTokensWithPassword;
115
- private acquireTokensViaBrowserLogin;
116
- private onTokenRetrievalFromCache;
117
- private extractAuthorizationCode;
118
- }
119
-
120
- /**
121
- * @internal
122
- */
123
- export declare const odspTokensCache: IAsyncCache<IOdspTokenManagerCacheKey, IOdspTokens>;
124
-
125
- /**
126
- * @internal
127
- */
128
- export declare function saveRC(rc: IResources): Promise<void>;
129
-
130
- export { }
@@ -1,140 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
- import { strict as assert } from "assert";
6
- import { BlobTreeEntry, TreeTreeEntry } from "@fluidframework/driver-utils";
7
- import { gcBlobPrefix, getNormalizedSnapshot, } from "../snapshotNormalizer.js";
8
- describe("Snapshot Normalizer", () => {
9
- it("can normalize tree entries", () => {
10
- // Snapshot tree with entries whose paths are not sorted.
11
- const snapshot = {
12
- id: "root",
13
- entries: [
14
- new TreeTreeEntry("entry2", {
15
- id: "subTree",
16
- entries: [],
17
- }),
18
- new BlobTreeEntry("entry3", "blob3"),
19
- new BlobTreeEntry("entry1", "blob1"),
20
- ],
21
- };
22
- const normalizedSnapshot = getNormalizedSnapshot(snapshot);
23
- assert.strictEqual(normalizedSnapshot.entries[0].path, "entry1", "Snapshot tree entries not sorted");
24
- assert.strictEqual(normalizedSnapshot.entries[1].path, "entry2", "Snapshot tree entries not sorted");
25
- assert.strictEqual(normalizedSnapshot.entries[2].path, "entry3", "Snapshot tree entries not sorted");
26
- });
27
- it("can normalize GC blobs", () => {
28
- const gcDetails = {
29
- isRootNode: true,
30
- gcNodes: {
31
- node2: ["node1", "/"],
32
- node1: ["node2", "/"],
33
- },
34
- };
35
- const normalizedGCDetails = {
36
- isRootNode: true,
37
- gcNodes: {
38
- node1: ["/", "node2"],
39
- node2: ["/", "node1"],
40
- },
41
- };
42
- const gcBlobName1 = `${gcBlobPrefix}_1`;
43
- const gcBlobName2 = `${gcBlobPrefix}_2`;
44
- // Snapshot with couple of GC blobs at different layers.
45
- const snapshot = {
46
- id: "root",
47
- entries: [
48
- new TreeTreeEntry("tree", {
49
- id: "subTree",
50
- entries: [new BlobTreeEntry(gcBlobName1, JSON.stringify(gcDetails))],
51
- }),
52
- new BlobTreeEntry(gcBlobName2, JSON.stringify(gcDetails)),
53
- ],
54
- };
55
- const normalizedSnapshot = getNormalizedSnapshot(snapshot);
56
- assert.strictEqual(normalizedSnapshot.entries[0].path, gcBlobName2, "Snapshot tree entries not sorted");
57
- const gcBlob = normalizedSnapshot.entries[0].value;
58
- assert.deepStrictEqual(JSON.parse(gcBlob.contents), normalizedGCDetails, "GC blob not normalized");
59
- const innerGCBlob = normalizedSnapshot.entries[1].value.entries[0]
60
- .value;
61
- assert.deepStrictEqual(JSON.parse(innerGCBlob.contents), normalizedGCDetails, "Inner blob not normalized");
62
- });
63
- it("can normalize custom blobs with array of objects", () => {
64
- // Blob content which is an array of objects within objects.
65
- const blobContents = [
66
- { id: "2", content: { key: "2", value: "two" } },
67
- { id: "1", content: { key: "1", value: "one" } },
68
- { id: "3", content: { key: "3", value: "three" } },
69
- ];
70
- const normalizedBlobContents = [
71
- { id: "1", content: { key: "1", value: "one" } },
72
- { id: "2", content: { key: "2", value: "two" } },
73
- { id: "3", content: { key: "3", value: "three" } },
74
- ];
75
- const snapshot = {
76
- id: "root",
77
- entries: [
78
- // Create a blob entry with normalized blob contents to make sure it remains normalized.
79
- new BlobTreeEntry("normalized", JSON.stringify(normalizedBlobContents)),
80
- new BlobTreeEntry("custom", JSON.stringify(blobContents)),
81
- ],
82
- };
83
- // Config to normalize the above blobs.
84
- const config = { blobsToNormalize: ["custom", "normalized"] };
85
- const normalizedSnapshot = getNormalizedSnapshot(snapshot, config);
86
- assert.strictEqual(normalizedSnapshot.entries[0].path, "custom", "Snapshot tree entries not sorted");
87
- const customBlob = normalizedSnapshot.entries[0].value;
88
- assert.deepStrictEqual(JSON.parse(customBlob.contents), normalizedBlobContents, "Custom blob not normalized");
89
- assert.strictEqual(normalizedSnapshot.entries[1].path, "normalized");
90
- const normalizedBlob = normalizedSnapshot.entries[0].value;
91
- assert.deepStrictEqual(JSON.parse(normalizedBlob.contents), normalizedBlobContents, "Normalized blob changed");
92
- });
93
- it("can normalize custom blobs with object of arrays", () => {
94
- // Blob content which is an object whose properties are arrays.
95
- const blobContents = {
96
- array2: ["2", "1", "3", "4"],
97
- array1: ["c", "a", "d", "b"],
98
- };
99
- const normalizedBlobContents = {
100
- array1: ["a", "b", "c", "d"],
101
- array2: ["1", "2", "3", "4"],
102
- };
103
- const snapshot = {
104
- id: "root",
105
- entries: [
106
- // Create a blob entry with normalized blob contents to make sure it remains normalized.
107
- new BlobTreeEntry("normalized", JSON.stringify(normalizedBlobContents)),
108
- new BlobTreeEntry("custom", JSON.stringify(blobContents)),
109
- ],
110
- };
111
- // Config to normalize the above blobs.
112
- const config = { blobsToNormalize: ["custom", "normalized"] };
113
- const normalizedSnapshot = getNormalizedSnapshot(snapshot, config);
114
- assert.strictEqual(normalizedSnapshot.entries[0].path, "custom", "Snapshot tree entries not sorted");
115
- const customBlob = normalizedSnapshot.entries[0].value;
116
- assert.deepStrictEqual(JSON.parse(customBlob.contents), normalizedBlobContents, "Custom blob not normalized");
117
- assert.strictEqual(normalizedSnapshot.entries[1].path, "normalized");
118
- const normalizedBlob = normalizedSnapshot.entries[0].value;
119
- assert.deepStrictEqual(JSON.parse(normalizedBlob.contents), normalizedBlobContents, "Normalized blob changed");
120
- });
121
- it("can normalize blob whose contents are not objects", () => {
122
- const snapshot = {
123
- id: "root",
124
- entries: [
125
- // Create blob entry whose content is a string so that it cannot be JSON parsed.
126
- new BlobTreeEntry("custom1", "contents"),
127
- // Create another blob whose content is a JSON stringified string which is already normalized.
128
- new BlobTreeEntry("custom2", JSON.stringify("contents")),
129
- ],
130
- };
131
- // Config to normalize the above blobs.
132
- const config = { blobsToNormalize: ["custom1", "custom2"] };
133
- const normalizedSnapshot = getNormalizedSnapshot(snapshot, config);
134
- const customBlob1 = normalizedSnapshot.entries[0].value;
135
- assert.strictEqual(customBlob1.contents, "contents", "Blob with string not as expected");
136
- const customBlob2 = normalizedSnapshot.entries[1].value;
137
- assert.strictEqual(customBlob2.contents, JSON.stringify("contents"), "Blob with JSON strigified string not as expected");
138
- });
139
- });
140
- //# sourceMappingURL=snapshotNormalizer.spec.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"snapshotNormalizer.spec.js","sourceRoot":"","sources":["../../src/test/snapshotNormalizer.spec.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAE5E,OAAO,EACN,YAAY,EACZ,qBAAqB,GAErB,MAAM,0BAA0B,CAAC;AAElC,QAAQ,CAAC,qBAAqB,EAAE,GAAG,EAAE;IACpC,EAAE,CAAC,4BAA4B,EAAE,GAAG,EAAE;QACrC,yDAAyD;QACzD,MAAM,QAAQ,GAAU;YACvB,EAAE,EAAE,MAAM;YACV,OAAO,EAAE;gBACR,IAAI,aAAa,CAAC,QAAQ,EAAE;oBAC3B,EAAE,EAAE,SAAS;oBACb,OAAO,EAAE,EAAE;iBACX,CAAC;gBACF,IAAI,aAAa,CAAC,QAAQ,EAAE,OAAO,CAAC;gBACpC,IAAI,aAAa,CAAC,QAAQ,EAAE,OAAO,CAAC;aACpC;SACD,CAAC;QACF,MAAM,kBAAkB,GAAG,qBAAqB,CAAC,QAAQ,CAAC,CAAC;QAC3D,MAAM,CAAC,WAAW,CACjB,kBAAkB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,EAClC,QAAQ,EACR,kCAAkC,CAClC,CAAC;QACF,MAAM,CAAC,WAAW,CACjB,kBAAkB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC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c,CAAC;QACpE,MAAM,CAAC,eAAe,CACrB,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,EACnC,sBAAsB,EACtB,yBAAyB,CACzB,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,mDAAmD,EAAE,GAAG,EAAE;QAC5D,MAAM,QAAQ,GAAU;YACvB,EAAE,EAAE,MAAM;YACV,OAAO,EAAE;gBACR,gFAAgF;gBAChF,IAAI,aAAa,CAAC,SAAS,EAAE,UAAU,CAAC;gBACxC,8FAA8F;gBAC9F,IAAI,aAAa,CAAC,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;aACxD;SACD,CAAC;QAEF,uCAAuC;QACvC,MAAM,MAAM,GAA8B,EAAE,gBAAgB,EAAE,CAAC,SAAS,EAAE,SAAS,CAAC,EAAE,CAAC;QACvF,MAAM,kBAAkB,GAAG,qBAAqB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QACnE,MAAM,WAAW,GAAG,kBAAkB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,KAAc,CAAC;QACjE,MAAM,CAAC,WAAW,CAAC,WAAW,CAAC,QAAQ,EAAE,UAAU,EAAE,kCAAkC,CAAC,CAAC;QAEzF,MAAM,WAAW,GAAG,kBAAkB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,KAAc,CAAC;QACjE,MAAM,CAAC,WAAW,CACjB,WAAW,CAAC,QAAQ,EACpB,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,EAC1B,kDAAkD,CAClD,CAAC;IACH,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { strict as assert } from \"assert\";\nimport { BlobTreeEntry, TreeTreeEntry } from \"@fluidframework/driver-utils\";\nimport { IBlob, ITree } from \"@fluidframework/protocol-definitions\";\nimport {\n\tgcBlobPrefix,\n\tgetNormalizedSnapshot,\n\tISnapshotNormalizerConfig,\n} from \"../snapshotNormalizer.js\";\n\ndescribe(\"Snapshot Normalizer\", () => {\n\tit(\"can normalize tree entries\", () => {\n\t\t// Snapshot tree with entries whose paths are not sorted.\n\t\tconst snapshot: ITree = {\n\t\t\tid: \"root\",\n\t\t\tentries: [\n\t\t\t\tnew TreeTreeEntry(\"entry2\", {\n\t\t\t\t\tid: \"subTree\",\n\t\t\t\t\tentries: [],\n\t\t\t\t}),\n\t\t\t\tnew BlobTreeEntry(\"entry3\", \"blob3\"),\n\t\t\t\tnew BlobTreeEntry(\"entry1\", \"blob1\"),\n\t\t\t],\n\t\t};\n\t\tconst normalizedSnapshot = getNormalizedSnapshot(snapshot);\n\t\tassert.strictEqual(\n\t\t\tnormalizedSnapshot.entries[0].path,\n\t\t\t\"entry1\",\n\t\t\t\"Snapshot tree entries not sorted\",\n\t\t);\n\t\tassert.strictEqual(\n\t\t\tnormalizedSnapshot.entries[1].path,\n\t\t\t\"entry2\",\n\t\t\t\"Snapshot tree entries not sorted\",\n\t\t);\n\t\tassert.strictEqual(\n\t\t\tnormalizedSnapshot.entries[2].path,\n\t\t\t\"entry3\",\n\t\t\t\"Snapshot tree entries not sorted\",\n\t\t);\n\t});\n\n\tit(\"can normalize GC blobs\", () => {\n\t\tconst gcDetails = {\n\t\t\tisRootNode: true,\n\t\t\tgcNodes: {\n\t\t\t\tnode2: [\"node1\", \"/\"],\n\t\t\t\tnode1: [\"node2\", \"/\"],\n\t\t\t},\n\t\t};\n\t\tconst normalizedGCDetails = {\n\t\t\tisRootNode: true,\n\t\t\tgcNodes: {\n\t\t\t\tnode1: [\"/\", \"node2\"],\n\t\t\t\tnode2: [\"/\", \"node1\"],\n\t\t\t},\n\t\t};\n\t\tconst gcBlobName1 = `${gcBlobPrefix}_1`;\n\t\tconst gcBlobName2 = `${gcBlobPrefix}_2`;\n\t\t// Snapshot with couple of GC blobs at different layers.\n\t\tconst snapshot: ITree = {\n\t\t\tid: \"root\",\n\t\t\tentries: [\n\t\t\t\tnew TreeTreeEntry(\"tree\", {\n\t\t\t\t\tid: \"subTree\",\n\t\t\t\t\tentries: [new BlobTreeEntry(gcBlobName1, JSON.stringify(gcDetails))],\n\t\t\t\t}),\n\t\t\t\tnew BlobTreeEntry(gcBlobName2, JSON.stringify(gcDetails)),\n\t\t\t],\n\t\t};\n\n\t\tconst normalizedSnapshot = getNormalizedSnapshot(snapshot);\n\t\tassert.strictEqual(\n\t\t\tnormalizedSnapshot.entries[0].path,\n\t\t\tgcBlobName2,\n\t\t\t\"Snapshot tree entries not sorted\",\n\t\t);\n\t\tconst gcBlob = normalizedSnapshot.entries[0].value as IBlob;\n\t\tassert.deepStrictEqual(\n\t\t\tJSON.parse(gcBlob.contents),\n\t\t\tnormalizedGCDetails,\n\t\t\t\"GC blob not normalized\",\n\t\t);\n\n\t\tconst innerGCBlob = (normalizedSnapshot.entries[1].value as ITree).entries[0]\n\t\t\t.value as IBlob;\n\t\tassert.deepStrictEqual(\n\t\t\tJSON.parse(innerGCBlob.contents),\n\t\t\tnormalizedGCDetails,\n\t\t\t\"Inner blob not normalized\",\n\t\t);\n\t});\n\n\tit(\"can normalize custom blobs with array of objects\", () => {\n\t\t// Blob content which is an array of objects within objects.\n\t\tconst blobContents = [\n\t\t\t{ id: \"2\", content: { key: \"2\", value: \"two\" } },\n\t\t\t{ id: \"1\", content: { key: \"1\", value: \"one\" } },\n\t\t\t{ id: \"3\", content: { key: \"3\", value: \"three\" } },\n\t\t];\n\t\tconst normalizedBlobContents = [\n\t\t\t{ id: \"1\", content: { key: \"1\", value: \"one\" } },\n\t\t\t{ id: \"2\", content: { key: \"2\", value: \"two\" } },\n\t\t\t{ id: \"3\", content: { key: \"3\", value: \"three\" } },\n\t\t];\n\n\t\tconst snapshot: ITree = {\n\t\t\tid: \"root\",\n\t\t\tentries: [\n\t\t\t\t// Create a blob entry with normalized blob contents to make sure it remains normalized.\n\t\t\t\tnew BlobTreeEntry(\"normalized\", JSON.stringify(normalizedBlobContents)),\n\t\t\t\tnew BlobTreeEntry(\"custom\", JSON.stringify(blobContents)),\n\t\t\t],\n\t\t};\n\n\t\t// Config to normalize the above blobs.\n\t\tconst config: ISnapshotNormalizerConfig = { blobsToNormalize: [\"custom\", \"normalized\"] };\n\t\tconst normalizedSnapshot = getNormalizedSnapshot(snapshot, config);\n\n\t\tassert.strictEqual(\n\t\t\tnormalizedSnapshot.entries[0].path,\n\t\t\t\"custom\",\n\t\t\t\"Snapshot tree entries not sorted\",\n\t\t);\n\t\tconst customBlob = normalizedSnapshot.entries[0].value as IBlob;\n\t\tassert.deepStrictEqual(\n\t\t\tJSON.parse(customBlob.contents),\n\t\t\tnormalizedBlobContents,\n\t\t\t\"Custom blob not normalized\",\n\t\t);\n\n\t\tassert.strictEqual(normalizedSnapshot.entries[1].path, \"normalized\");\n\t\tconst normalizedBlob = normalizedSnapshot.entries[0].value as IBlob;\n\t\tassert.deepStrictEqual(\n\t\t\tJSON.parse(normalizedBlob.contents),\n\t\t\tnormalizedBlobContents,\n\t\t\t\"Normalized blob changed\",\n\t\t);\n\t});\n\n\tit(\"can normalize custom blobs with object of arrays\", () => {\n\t\t// Blob content which is an object whose properties are arrays.\n\t\tconst blobContents = {\n\t\t\tarray2: [\"2\", \"1\", \"3\", \"4\"],\n\t\t\tarray1: [\"c\", \"a\", \"d\", \"b\"],\n\t\t};\n\t\tconst normalizedBlobContents = {\n\t\t\tarray1: [\"a\", \"b\", \"c\", \"d\"],\n\t\t\tarray2: [\"1\", \"2\", \"3\", \"4\"],\n\t\t};\n\n\t\tconst snapshot: ITree = {\n\t\t\tid: \"root\",\n\t\t\tentries: [\n\t\t\t\t// Create a blob entry with normalized blob contents to make sure it remains normalized.\n\t\t\t\tnew BlobTreeEntry(\"normalized\", JSON.stringify(normalizedBlobContents)),\n\t\t\t\tnew BlobTreeEntry(\"custom\", JSON.stringify(blobContents)),\n\t\t\t],\n\t\t};\n\n\t\t// Config to normalize the above blobs.\n\t\tconst config: ISnapshotNormalizerConfig = { blobsToNormalize: [\"custom\", \"normalized\"] };\n\t\tconst normalizedSnapshot = getNormalizedSnapshot(snapshot, config);\n\n\t\tassert.strictEqual(\n\t\t\tnormalizedSnapshot.entries[0].path,\n\t\t\t\"custom\",\n\t\t\t\"Snapshot tree entries not sorted\",\n\t\t);\n\t\tconst customBlob = normalizedSnapshot.entries[0].value as IBlob;\n\t\tassert.deepStrictEqual(\n\t\t\tJSON.parse(customBlob.contents),\n\t\t\tnormalizedBlobContents,\n\t\t\t\"Custom blob not normalized\",\n\t\t);\n\n\t\tassert.strictEqual(normalizedSnapshot.entries[1].path, \"normalized\");\n\t\tconst normalizedBlob = normalizedSnapshot.entries[0].value as IBlob;\n\t\tassert.deepStrictEqual(\n\t\t\tJSON.parse(normalizedBlob.contents),\n\t\t\tnormalizedBlobContents,\n\t\t\t\"Normalized blob changed\",\n\t\t);\n\t});\n\n\tit(\"can normalize blob whose contents are not objects\", () => {\n\t\tconst snapshot: ITree = {\n\t\t\tid: \"root\",\n\t\t\tentries: [\n\t\t\t\t// Create blob entry whose content is a string so that it cannot be JSON parsed.\n\t\t\t\tnew BlobTreeEntry(\"custom1\", \"contents\"),\n\t\t\t\t// Create another blob whose content is a JSON stringified string which is already normalized.\n\t\t\t\tnew BlobTreeEntry(\"custom2\", JSON.stringify(\"contents\")),\n\t\t\t],\n\t\t};\n\n\t\t// Config to normalize the above blobs.\n\t\tconst config: ISnapshotNormalizerConfig = { blobsToNormalize: [\"custom1\", \"custom2\"] };\n\t\tconst normalizedSnapshot = getNormalizedSnapshot(snapshot, config);\n\t\tconst customBlob1 = normalizedSnapshot.entries[0].value as IBlob;\n\t\tassert.strictEqual(customBlob1.contents, \"contents\", \"Blob with string not as expected\");\n\n\t\tconst customBlob2 = normalizedSnapshot.entries[1].value as IBlob;\n\t\tassert.strictEqual(\n\t\t\tcustomBlob2.contents,\n\t\t\tJSON.stringify(\"contents\"),\n\t\t\t\"Blob with JSON strigified string not as expected\",\n\t\t);\n\t});\n});\n"]}
@@ -1,28 +0,0 @@
1
- use_current_InterfaceDeclaration_IAsyncCache(get_old_InterfaceDeclaration_IAsyncCache());
2
- use_old_InterfaceDeclaration_IAsyncCache(get_current_InterfaceDeclaration_IAsyncCache());
3
- use_current_InterfaceDeclaration_IOdspTokenManagerCacheKey(get_old_InterfaceDeclaration_IOdspTokenManagerCacheKey());
4
- use_old_InterfaceDeclaration_IOdspTokenManagerCacheKey(get_current_InterfaceDeclaration_IOdspTokenManagerCacheKey());
5
- use_current_InterfaceDeclaration_IResources(get_old_InterfaceDeclaration_IResources());
6
- use_old_InterfaceDeclaration_IResources(get_current_InterfaceDeclaration_IResources());
7
- use_current_InterfaceDeclaration_ISnapshotNormalizerConfig(get_old_InterfaceDeclaration_ISnapshotNormalizerConfig());
8
- use_old_InterfaceDeclaration_ISnapshotNormalizerConfig(get_current_InterfaceDeclaration_ISnapshotNormalizerConfig());
9
- use_current_TypeAliasDeclaration_OdspTokenConfig(get_old_TypeAliasDeclaration_OdspTokenConfig());
10
- use_old_TypeAliasDeclaration_OdspTokenConfig(get_current_TypeAliasDeclaration_OdspTokenConfig());
11
- use_current_ClassDeclaration_OdspTokenManager(get_old_ClassDeclaration_OdspTokenManager());
12
- use_old_ClassDeclaration_OdspTokenManager(get_current_ClassDeclaration_OdspTokenManager());
13
- use_current_VariableDeclaration_gcBlobPrefix(get_old_VariableDeclaration_gcBlobPrefix());
14
- use_old_VariableDeclaration_gcBlobPrefix(get_current_VariableDeclaration_gcBlobPrefix());
15
- use_current_VariableDeclaration_getMicrosoftConfiguration(get_old_VariableDeclaration_getMicrosoftConfiguration());
16
- use_old_VariableDeclaration_getMicrosoftConfiguration(get_current_VariableDeclaration_getMicrosoftConfiguration());
17
- use_current_FunctionDeclaration_getNormalizedSnapshot(get_old_FunctionDeclaration_getNormalizedSnapshot());
18
- use_old_FunctionDeclaration_getNormalizedSnapshot(get_current_FunctionDeclaration_getNormalizedSnapshot());
19
- use_current_FunctionDeclaration_loadRC(get_old_FunctionDeclaration_loadRC());
20
- use_old_FunctionDeclaration_loadRC(get_current_FunctionDeclaration_loadRC());
21
- use_current_FunctionDeclaration_lockRC(get_old_FunctionDeclaration_lockRC());
22
- use_old_FunctionDeclaration_lockRC(get_current_FunctionDeclaration_lockRC());
23
- use_current_VariableDeclaration_odspTokensCache(get_old_VariableDeclaration_odspTokensCache());
24
- use_old_VariableDeclaration_odspTokensCache(get_current_VariableDeclaration_odspTokensCache());
25
- use_current_FunctionDeclaration_saveRC(get_old_FunctionDeclaration_saveRC());
26
- use_old_FunctionDeclaration_saveRC(get_current_FunctionDeclaration_saveRC());
27
- export {};
28
- //# sourceMappingURL=validateToolUtilsPrevious.generated.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"validateToolUtilsPrevious.generated.js","sourceRoot":"","sources":["../../../src/test/types/validateToolUtilsPrevious.generated.ts"],"names":[],"mappings":"AAgCA,4CAA4C,CACxC,wCAAwC,EAAE,CAAC,CAAC;AAWhD,wCAAwC,CACpC,4CAA4C,EAAE,CAAC,CAAC;AAWpD,0DAA0D,CACtD,sDAAsD,EAAE,CAAC,CAAC;AAW9D,sDAAsD,CAClD,0DAA0D,EAAE,CAAC,CAAC;AAWlE,2CAA2C,CACvC,uCAAuC,EAAE,CAAC,CAAC;AAW/C,uCAAuC,CACnC,2CAA2C,EAAE,CAAC,CAAC;AAWnD,0DAA0D,CACtD,sDAAsD,EAAE,CAAC,CAAC;AAW9D,sDAAsD,CAClD,0DAA0D,EAAE,CAAC,CAAC;AAWlE,gDAAgD,CAC5C,4CAA4C,EAAE,CAAC,CAAC;AAWpD,4CAA4C,CACxC,gDAAgD,EAAE,CAAC,CAAC;AAWxD,6CAA6C,CACzC,yCAAyC,EAAE,CAAC,CAAC;AAWjD,yCAAyC,CACrC,6CAA6C,EAAE,CAAC,CAAC;AAWrD,4CAA4C,CACxC,wCAAwC,EAAE,CAAC,CAAC;AAWhD,wCAAwC,CACpC,4CAA4C,EAAE,CAAC,CAAC;AAWpD,yDAAyD,CACrD,qDAAqD,EAAE,CAAC,CAAC;AAW7D,qDAAqD,CACjD,yDAAyD,EAAE,CAAC,CAAC;AAWjE,qDAAqD,CACjD,iDAAiD,EAAE,CAAC,CAAC;AAWzD,iDAAiD,CAC7C,qDAAqD,EAAE,CAAC,CAAC;AAW7D,sCAAsC,CAClC,kCAAkC,EAAE,CAAC,CAAC;AAW1C,kCAAkC,CAC9B,sCAAsC,EAAE,CAAC,CAAC;AAW9C,sCAAsC,CAClC,kCAAkC,EAAE,CAAC,CAAC;AAW1C,kCAAkC,CAC9B,sCAAsC,EAAE,CAAC,CAAC;AAW9C,+CAA+C,CAC3C,2CAA2C,EAAE,CAAC,CAAC;AAWnD,2CAA2C,CACvC,+CAA+C,EAAE,CAAC,CAAC;AAWvD,sCAAsC,CAClC,kCAAkC,EAAE,CAAC,CAAC;AAW1C,kCAAkC,CAC9B,sCAAsC,EAAE,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n/*\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.\n * Generated by fluid-type-test-generator in @fluidframework/build-tools.\n */\nimport type * as old from \"@fluidframework/tool-utils-previous\";\nimport type * as current from \"../../index.js\";\n\n\n// See 'build-tools/src/type-test-generator/compatibility.ts' for more information.\ntype TypeOnly<T> = T extends number\n\t? number\n\t: T extends string\n\t? string\n\t: T extends boolean | bigint | symbol\n\t? T\n\t: {\n\t\t\t[P in keyof T]: TypeOnly<T[P]>;\n\t };\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"InterfaceDeclaration_IAsyncCache\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_InterfaceDeclaration_IAsyncCache():\n TypeOnly<old.IAsyncCache<any,any>>;\ndeclare function use_current_InterfaceDeclaration_IAsyncCache(\n use: TypeOnly<current.IAsyncCache<any,any>>): void;\nuse_current_InterfaceDeclaration_IAsyncCache(\n get_old_InterfaceDeclaration_IAsyncCache());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"InterfaceDeclaration_IAsyncCache\": {\"backCompat\": false}\n*/\ndeclare function get_current_InterfaceDeclaration_IAsyncCache():\n TypeOnly<current.IAsyncCache<any,any>>;\ndeclare function use_old_InterfaceDeclaration_IAsyncCache(\n use: TypeOnly<old.IAsyncCache<any,any>>): void;\nuse_old_InterfaceDeclaration_IAsyncCache(\n get_current_InterfaceDeclaration_IAsyncCache());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"InterfaceDeclaration_IOdspTokenManagerCacheKey\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_InterfaceDeclaration_IOdspTokenManagerCacheKey():\n TypeOnly<old.IOdspTokenManagerCacheKey>;\ndeclare function use_current_InterfaceDeclaration_IOdspTokenManagerCacheKey(\n use: TypeOnly<current.IOdspTokenManagerCacheKey>): void;\nuse_current_InterfaceDeclaration_IOdspTokenManagerCacheKey(\n get_old_InterfaceDeclaration_IOdspTokenManagerCacheKey());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"InterfaceDeclaration_IOdspTokenManagerCacheKey\": {\"backCompat\": false}\n*/\ndeclare function get_current_InterfaceDeclaration_IOdspTokenManagerCacheKey():\n TypeOnly<current.IOdspTokenManagerCacheKey>;\ndeclare function use_old_InterfaceDeclaration_IOdspTokenManagerCacheKey(\n use: TypeOnly<old.IOdspTokenManagerCacheKey>): void;\nuse_old_InterfaceDeclaration_IOdspTokenManagerCacheKey(\n get_current_InterfaceDeclaration_IOdspTokenManagerCacheKey());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"InterfaceDeclaration_IResources\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_InterfaceDeclaration_IResources():\n TypeOnly<old.IResources>;\ndeclare function use_current_InterfaceDeclaration_IResources(\n use: TypeOnly<current.IResources>): void;\nuse_current_InterfaceDeclaration_IResources(\n get_old_InterfaceDeclaration_IResources());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"InterfaceDeclaration_IResources\": {\"backCompat\": false}\n*/\ndeclare function get_current_InterfaceDeclaration_IResources():\n TypeOnly<current.IResources>;\ndeclare function use_old_InterfaceDeclaration_IResources(\n use: TypeOnly<old.IResources>): void;\nuse_old_InterfaceDeclaration_IResources(\n get_current_InterfaceDeclaration_IResources());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"InterfaceDeclaration_ISnapshotNormalizerConfig\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_InterfaceDeclaration_ISnapshotNormalizerConfig():\n TypeOnly<old.ISnapshotNormalizerConfig>;\ndeclare function use_current_InterfaceDeclaration_ISnapshotNormalizerConfig(\n use: TypeOnly<current.ISnapshotNormalizerConfig>): void;\nuse_current_InterfaceDeclaration_ISnapshotNormalizerConfig(\n get_old_InterfaceDeclaration_ISnapshotNormalizerConfig());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"InterfaceDeclaration_ISnapshotNormalizerConfig\": {\"backCompat\": false}\n*/\ndeclare function get_current_InterfaceDeclaration_ISnapshotNormalizerConfig():\n TypeOnly<current.ISnapshotNormalizerConfig>;\ndeclare function use_old_InterfaceDeclaration_ISnapshotNormalizerConfig(\n use: TypeOnly<old.ISnapshotNormalizerConfig>): void;\nuse_old_InterfaceDeclaration_ISnapshotNormalizerConfig(\n get_current_InterfaceDeclaration_ISnapshotNormalizerConfig());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"TypeAliasDeclaration_OdspTokenConfig\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_TypeAliasDeclaration_OdspTokenConfig():\n TypeOnly<old.OdspTokenConfig>;\ndeclare function use_current_TypeAliasDeclaration_OdspTokenConfig(\n use: TypeOnly<current.OdspTokenConfig>): void;\nuse_current_TypeAliasDeclaration_OdspTokenConfig(\n get_old_TypeAliasDeclaration_OdspTokenConfig());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"TypeAliasDeclaration_OdspTokenConfig\": {\"backCompat\": false}\n*/\ndeclare function get_current_TypeAliasDeclaration_OdspTokenConfig():\n TypeOnly<current.OdspTokenConfig>;\ndeclare function use_old_TypeAliasDeclaration_OdspTokenConfig(\n use: TypeOnly<old.OdspTokenConfig>): void;\nuse_old_TypeAliasDeclaration_OdspTokenConfig(\n get_current_TypeAliasDeclaration_OdspTokenConfig());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_OdspTokenManager\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_OdspTokenManager():\n TypeOnly<old.OdspTokenManager>;\ndeclare function use_current_ClassDeclaration_OdspTokenManager(\n use: TypeOnly<current.OdspTokenManager>): void;\nuse_current_ClassDeclaration_OdspTokenManager(\n get_old_ClassDeclaration_OdspTokenManager());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_OdspTokenManager\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_OdspTokenManager():\n TypeOnly<current.OdspTokenManager>;\ndeclare function use_old_ClassDeclaration_OdspTokenManager(\n use: TypeOnly<old.OdspTokenManager>): void;\nuse_old_ClassDeclaration_OdspTokenManager(\n get_current_ClassDeclaration_OdspTokenManager());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"VariableDeclaration_gcBlobPrefix\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_VariableDeclaration_gcBlobPrefix():\n TypeOnly<typeof old.gcBlobPrefix>;\ndeclare function use_current_VariableDeclaration_gcBlobPrefix(\n use: TypeOnly<typeof current.gcBlobPrefix>): void;\nuse_current_VariableDeclaration_gcBlobPrefix(\n get_old_VariableDeclaration_gcBlobPrefix());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"VariableDeclaration_gcBlobPrefix\": {\"backCompat\": false}\n*/\ndeclare function get_current_VariableDeclaration_gcBlobPrefix():\n TypeOnly<typeof current.gcBlobPrefix>;\ndeclare function use_old_VariableDeclaration_gcBlobPrefix(\n use: TypeOnly<typeof old.gcBlobPrefix>): void;\nuse_old_VariableDeclaration_gcBlobPrefix(\n get_current_VariableDeclaration_gcBlobPrefix());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"VariableDeclaration_getMicrosoftConfiguration\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_VariableDeclaration_getMicrosoftConfiguration():\n TypeOnly<typeof old.getMicrosoftConfiguration>;\ndeclare function use_current_VariableDeclaration_getMicrosoftConfiguration(\n use: TypeOnly<typeof current.getMicrosoftConfiguration>): void;\nuse_current_VariableDeclaration_getMicrosoftConfiguration(\n get_old_VariableDeclaration_getMicrosoftConfiguration());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"VariableDeclaration_getMicrosoftConfiguration\": {\"backCompat\": false}\n*/\ndeclare function get_current_VariableDeclaration_getMicrosoftConfiguration():\n TypeOnly<typeof current.getMicrosoftConfiguration>;\ndeclare function use_old_VariableDeclaration_getMicrosoftConfiguration(\n use: TypeOnly<typeof old.getMicrosoftConfiguration>): void;\nuse_old_VariableDeclaration_getMicrosoftConfiguration(\n get_current_VariableDeclaration_getMicrosoftConfiguration());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_getNormalizedSnapshot\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_FunctionDeclaration_getNormalizedSnapshot():\n TypeOnly<typeof old.getNormalizedSnapshot>;\ndeclare function use_current_FunctionDeclaration_getNormalizedSnapshot(\n use: TypeOnly<typeof current.getNormalizedSnapshot>): void;\nuse_current_FunctionDeclaration_getNormalizedSnapshot(\n get_old_FunctionDeclaration_getNormalizedSnapshot());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_getNormalizedSnapshot\": {\"backCompat\": false}\n*/\ndeclare function get_current_FunctionDeclaration_getNormalizedSnapshot():\n TypeOnly<typeof current.getNormalizedSnapshot>;\ndeclare function use_old_FunctionDeclaration_getNormalizedSnapshot(\n use: TypeOnly<typeof old.getNormalizedSnapshot>): void;\nuse_old_FunctionDeclaration_getNormalizedSnapshot(\n get_current_FunctionDeclaration_getNormalizedSnapshot());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_loadRC\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_FunctionDeclaration_loadRC():\n TypeOnly<typeof old.loadRC>;\ndeclare function use_current_FunctionDeclaration_loadRC(\n use: TypeOnly<typeof current.loadRC>): void;\nuse_current_FunctionDeclaration_loadRC(\n get_old_FunctionDeclaration_loadRC());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_loadRC\": {\"backCompat\": false}\n*/\ndeclare function get_current_FunctionDeclaration_loadRC():\n TypeOnly<typeof current.loadRC>;\ndeclare function use_old_FunctionDeclaration_loadRC(\n use: TypeOnly<typeof old.loadRC>): void;\nuse_old_FunctionDeclaration_loadRC(\n get_current_FunctionDeclaration_loadRC());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_lockRC\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_FunctionDeclaration_lockRC():\n TypeOnly<typeof old.lockRC>;\ndeclare function use_current_FunctionDeclaration_lockRC(\n use: TypeOnly<typeof current.lockRC>): void;\nuse_current_FunctionDeclaration_lockRC(\n get_old_FunctionDeclaration_lockRC());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_lockRC\": {\"backCompat\": false}\n*/\ndeclare function get_current_FunctionDeclaration_lockRC():\n TypeOnly<typeof current.lockRC>;\ndeclare function use_old_FunctionDeclaration_lockRC(\n use: TypeOnly<typeof old.lockRC>): void;\nuse_old_FunctionDeclaration_lockRC(\n get_current_FunctionDeclaration_lockRC());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"VariableDeclaration_odspTokensCache\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_VariableDeclaration_odspTokensCache():\n TypeOnly<typeof old.odspTokensCache>;\ndeclare function use_current_VariableDeclaration_odspTokensCache(\n use: TypeOnly<typeof current.odspTokensCache>): void;\nuse_current_VariableDeclaration_odspTokensCache(\n get_old_VariableDeclaration_odspTokensCache());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"VariableDeclaration_odspTokensCache\": {\"backCompat\": false}\n*/\ndeclare function get_current_VariableDeclaration_odspTokensCache():\n TypeOnly<typeof current.odspTokensCache>;\ndeclare function use_old_VariableDeclaration_odspTokensCache(\n use: TypeOnly<typeof old.odspTokensCache>): void;\nuse_old_VariableDeclaration_odspTokensCache(\n get_current_VariableDeclaration_odspTokensCache());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_saveRC\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_FunctionDeclaration_saveRC():\n TypeOnly<typeof old.saveRC>;\ndeclare function use_current_FunctionDeclaration_saveRC(\n use: TypeOnly<typeof current.saveRC>): void;\nuse_current_FunctionDeclaration_saveRC(\n get_old_FunctionDeclaration_saveRC());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_saveRC\": {\"backCompat\": false}\n*/\ndeclare function get_current_FunctionDeclaration_saveRC():\n TypeOnly<typeof current.saveRC>;\ndeclare function use_old_FunctionDeclaration_saveRC(\n use: TypeOnly<typeof old.saveRC>): void;\nuse_old_FunctionDeclaration_saveRC(\n get_current_FunctionDeclaration_saveRC());\n"]}
@@ -1,35 +0,0 @@
1
- import { IClientConfig } from '@fluidframework/odsp-doclib-utils/internal';
2
- import { IOdspTokens } from '@fluidframework/odsp-doclib-utils/internal';
3
- import { ITree } from '@fluidframework/protocol-definitions';
4
-
5
- /* Excluded from this release type: gcBlobPrefix */
6
-
7
- /* Excluded from this release type: getMicrosoftConfiguration */
8
-
9
- /* Excluded from this release type: getNormalizedSnapshot */
10
-
11
- /* Excluded from this release type: IAsyncCache */
12
-
13
- /* Excluded from this release type: IClientConfig */
14
-
15
- /* Excluded from this release type: IOdspTokenManagerCacheKey */
16
-
17
- /* Excluded from this release type: IOdspTokens */
18
-
19
- /* Excluded from this release type: IResources */
20
-
21
- /* Excluded from this release type: ISnapshotNormalizerConfig */
22
-
23
- /* Excluded from this release type: loadRC */
24
-
25
- /* Excluded from this release type: lockRC */
26
-
27
- /* Excluded from this release type: OdspTokenConfig */
28
-
29
- /* Excluded from this release type: OdspTokenManager */
30
-
31
- /* Excluded from this release type: odspTokensCache */
32
-
33
- /* Excluded from this release type: saveRC */
34
-
35
- export { }
@@ -1,35 +0,0 @@
1
- import { IClientConfig } from '@fluidframework/odsp-doclib-utils/internal';
2
- import { IOdspTokens } from '@fluidframework/odsp-doclib-utils/internal';
3
- import { ITree } from '@fluidframework/protocol-definitions';
4
-
5
- /* Excluded from this release type: gcBlobPrefix */
6
-
7
- /* Excluded from this release type: getMicrosoftConfiguration */
8
-
9
- /* Excluded from this release type: getNormalizedSnapshot */
10
-
11
- /* Excluded from this release type: IAsyncCache */
12
-
13
- /* Excluded from this release type: IClientConfig */
14
-
15
- /* Excluded from this release type: IOdspTokenManagerCacheKey */
16
-
17
- /* Excluded from this release type: IOdspTokens */
18
-
19
- /* Excluded from this release type: IResources */
20
-
21
- /* Excluded from this release type: ISnapshotNormalizerConfig */
22
-
23
- /* Excluded from this release type: loadRC */
24
-
25
- /* Excluded from this release type: lockRC */
26
-
27
- /* Excluded from this release type: OdspTokenConfig */
28
-
29
- /* Excluded from this release type: OdspTokenManager */
30
-
31
- /* Excluded from this release type: odspTokensCache */
32
-
33
- /* Excluded from this release type: saveRC */
34
-
35
- export { }
@@ -1,35 +0,0 @@
1
- import { IClientConfig } from '@fluidframework/odsp-doclib-utils/internal';
2
- import { IOdspTokens } from '@fluidframework/odsp-doclib-utils/internal';
3
- import { ITree } from '@fluidframework/protocol-definitions';
4
-
5
- /* Excluded from this release type: gcBlobPrefix */
6
-
7
- /* Excluded from this release type: getMicrosoftConfiguration */
8
-
9
- /* Excluded from this release type: getNormalizedSnapshot */
10
-
11
- /* Excluded from this release type: IAsyncCache */
12
-
13
- /* Excluded from this release type: IClientConfig */
14
-
15
- /* Excluded from this release type: IOdspTokenManagerCacheKey */
16
-
17
- /* Excluded from this release type: IOdspTokens */
18
-
19
- /* Excluded from this release type: IResources */
20
-
21
- /* Excluded from this release type: ISnapshotNormalizerConfig */
22
-
23
- /* Excluded from this release type: loadRC */
24
-
25
- /* Excluded from this release type: lockRC */
26
-
27
- /* Excluded from this release type: OdspTokenConfig */
28
-
29
- /* Excluded from this release type: OdspTokenManager */
30
-
31
- /* Excluded from this release type: odspTokensCache */
32
-
33
- /* Excluded from this release type: saveRC */
34
-
35
- export { }
@@ -1,130 +0,0 @@
1
- import { IClientConfig } from '@fluidframework/odsp-doclib-utils/internal';
2
- import { IOdspTokens } from '@fluidframework/odsp-doclib-utils/internal';
3
- import { ITree } from '@fluidframework/protocol-definitions';
4
-
5
- /**
6
- * The prefix that all GC blob names start with.
7
- *
8
- * @internal
9
- */
10
- export declare const gcBlobPrefix = "__gc";
11
-
12
- /**
13
- * @internal
14
- */
15
- export declare const getMicrosoftConfiguration: () => IClientConfig;
16
-
17
- /**
18
- * Helper function that normalizes the given snapshot tree. It sorts objects and arrays in the snapshot. It also
19
- * normalizes certain blob contents for which the order of content does not matter. For example, garbage collection
20
- * blobs contains objects / arrays whose element order do not matter.
21
- * @param snapshot - The snapshot tree to normalize.
22
- * @param config - Configs to use when normalizing snapshot. For example, it can contain paths of blobs whose contents
23
- * should be normalized as well.
24
- * @returns a copy of the normalized snapshot tree.
25
- * @internal
26
- */
27
- export declare function getNormalizedSnapshot(snapshot: ITree, config?: ISnapshotNormalizerConfig): ITree;
28
-
29
- /**
30
- * @internal
31
- */
32
- export declare interface IAsyncCache<TKey, TValue> {
33
- get(key: TKey): Promise<TValue | undefined>;
34
- save(key: TKey, value: TValue): Promise<void>;
35
- lock<T>(callback: () => Promise<T>): Promise<T>;
36
- }
37
-
38
- /**
39
- * @internal
40
- */
41
- export declare interface IOdspTokenManagerCacheKey {
42
- readonly isPush: boolean;
43
- readonly userOrServer: string;
44
- }
45
-
46
- /**
47
- * @internal
48
- */
49
- export declare interface IResources {
50
- tokens?: {
51
- version?: number;
52
- data: {
53
- [key: string]: {
54
- storage?: IOdspTokens;
55
- push?: IOdspTokens;
56
- };
57
- };
58
- };
59
- }
60
-
61
- /**
62
- * @internal
63
- */
64
- export declare interface ISnapshotNormalizerConfig {
65
- blobsToNormalize?: string[];
66
- /**
67
- * channel types who's content (non-attribute) blobs will be excluded.
68
- * this is used to exclude the content of channels who's content cannot be compared
69
- * as the content is non-deterministic between snapshot at the same sequence number.
70
- */
71
- excludedChannelContentTypes?: string[];
72
- }
73
-
74
- /**
75
- * @internal
76
- */
77
- export declare function loadRC(): Promise<IResources>;
78
-
79
- /**
80
- * @internal
81
- */
82
- export declare function lockRC(): Promise<any>;
83
-
84
- /**
85
- * @internal
86
- */
87
- export declare type OdspTokenConfig = {
88
- type: "password";
89
- username: string;
90
- password: string;
91
- } | {
92
- type: "browserLogin";
93
- navigator: (url: string) => void;
94
- redirectUriCallback?: (tokens: IOdspTokens) => Promise<string>;
95
- };
96
-
97
- /**
98
- * @internal
99
- */
100
- export declare class OdspTokenManager {
101
- private readonly tokenCache?;
102
- private readonly storageCache;
103
- private readonly pushCache;
104
- private readonly cacheMutex;
105
- constructor(tokenCache?: IAsyncCache<IOdspTokenManagerCacheKey, IOdspTokens> | undefined);
106
- updateTokensCache(key: IOdspTokenManagerCacheKey, value: IOdspTokens): Promise<void>;
107
- private updateTokensCacheWithoutLock;
108
- getOdspTokens(server: string, clientConfig: IClientConfig, tokenConfig: OdspTokenConfig, forceRefresh?: boolean, forceReauth?: boolean): Promise<IOdspTokens>;
109
- getPushTokens(server: string, clientConfig: IClientConfig, tokenConfig: OdspTokenConfig, forceRefresh?: boolean, forceReauth?: boolean): Promise<IOdspTokens>;
110
- private getTokenFromCache;
111
- private static getCacheKey;
112
- private getTokens;
113
- private getTokensCore;
114
- private acquireTokensWithPassword;
115
- private acquireTokensViaBrowserLogin;
116
- private onTokenRetrievalFromCache;
117
- private extractAuthorizationCode;
118
- }
119
-
120
- /**
121
- * @internal
122
- */
123
- export declare const odspTokensCache: IAsyncCache<IOdspTokenManagerCacheKey, IOdspTokens>;
124
-
125
- /**
126
- * @internal
127
- */
128
- export declare function saveRC(rc: IResources): Promise<void>;
129
-
130
- export { }
File without changes