@fluidframework/tinylicious-driver 2.0.0-internal.8.0.0 → 2.0.0-rc.1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/README.md +1 -7
  3. package/api-extractor-esm.json +4 -0
  4. package/api-extractor-lint.json +1 -10
  5. package/api-extractor.json +1 -9
  6. package/dist/{index.cjs → index.js} +3 -3
  7. package/dist/index.js.map +1 -0
  8. package/dist/{insecureTinyliciousTokenProvider.cjs → insecureTinyliciousTokenProvider.js} +1 -1
  9. package/dist/insecureTinyliciousTokenProvider.js.map +1 -0
  10. package/dist/{insecureTinyliciousUrlResolver.cjs → insecureTinyliciousUrlResolver.js} +1 -1
  11. package/dist/insecureTinyliciousUrlResolver.js.map +1 -0
  12. package/dist/tinylicious-driver-beta.d.ts +0 -6
  13. package/dist/tinylicious-driver-public.d.ts +0 -6
  14. package/lib/{index.d.ts → index.d.mts} +1 -1
  15. package/lib/index.d.mts.map +1 -0
  16. package/lib/{insecureTinyliciousTokenProvider.d.ts → insecureTinyliciousTokenProvider.d.mts} +1 -1
  17. package/lib/insecureTinyliciousTokenProvider.d.mts.map +1 -0
  18. package/lib/{insecureTinyliciousUrlResolver.d.ts → insecureTinyliciousUrlResolver.d.mts} +1 -1
  19. package/lib/insecureTinyliciousUrlResolver.d.mts.map +1 -0
  20. package/lib/{tinylicious-driver-beta.d.ts → tinylicious-driver-beta.d.mts} +0 -6
  21. package/lib/{tinylicious-driver-public.d.ts → tinylicious-driver-public.d.mts} +0 -6
  22. package/package.json +68 -16
  23. package/dist/index.cjs.map +0 -1
  24. package/dist/insecureTinyliciousTokenProvider.cjs.map +0 -1
  25. package/dist/insecureTinyliciousUrlResolver.cjs.map +0 -1
  26. package/lib/index.d.ts.map +0 -1
  27. package/lib/insecureTinyliciousTokenProvider.d.ts.map +0 -1
  28. package/lib/insecureTinyliciousUrlResolver.d.ts.map +0 -1
  29. package/tsc-multi.test.json +0 -4
  30. /package/lib/{tinylicious-driver-alpha.d.ts → tinylicious-driver-alpha.d.mts} +0 -0
  31. /package/lib/{tinylicious-driver-untrimmed.d.ts → tinylicious-driver-untrimmed.d.mts} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,39 @@
1
1
  # @fluidframework/tinylicious-driver
2
2
 
3
+ ## 2.0.0-rc.1.0.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Updated server dependencies ([#19122](https://github.com/microsoft/FluidFramework/issues/19122)) [25366b4229](https://github.com/microsoft/FluidFramework/commits/25366b422918cb43685c5f328b50450749592902)
8
+
9
+ The following Fluid server dependencies have been updated to the latest version, 3.0.0. [See the full changelog.](https://github.com/microsoft/FluidFramework/releases/tag/server_v3.0.0)
10
+
11
+ - @fluidframework/gitresources
12
+ - @fluidframework/server-kafka-orderer
13
+ - @fluidframework/server-lambdas
14
+ - @fluidframework/server-lambdas-driver
15
+ - @fluidframework/server-local-server
16
+ - @fluidframework/server-memory-orderer
17
+ - @fluidframework/protocol-base
18
+ - @fluidframework/server-routerlicious
19
+ - @fluidframework/server-routerlicious-base
20
+ - @fluidframework/server-services
21
+ - @fluidframework/server-services-client
22
+ - @fluidframework/server-services-core
23
+ - @fluidframework/server-services-ordering-kafkanode
24
+ - @fluidframework/server-services-ordering-rdkafka
25
+ - @fluidframework/server-services-ordering-zookeeper
26
+ - @fluidframework/server-services-shared
27
+ - @fluidframework/server-services-telemetry
28
+ - @fluidframework/server-services-utils
29
+ - @fluidframework/server-test-utils
30
+ - tinylicious
31
+
32
+ - Updated @fluidframework/protocol-definitions ([#19122](https://github.com/microsoft/FluidFramework/issues/19122)) [25366b4229](https://github.com/microsoft/FluidFramework/commits/25366b422918cb43685c5f328b50450749592902)
33
+
34
+ The @fluidframework/protocol-definitions dependency has been upgraded to v3.1.0. [See the full
35
+ changelog.](https://github.com/microsoft/FluidFramework/blob/main/common/lib/protocol-definitions/CHANGELOG.md#310)
36
+
3
37
  ## 2.0.0-internal.8.0.0
4
38
 
5
39
  Dependency updates only.
package/README.md CHANGED
@@ -11,12 +11,6 @@ When taking a dependency on a Fluid Framework library, we recommend using a `^`
11
11
  While Fluid Framework libraries may use different ranges with interdependencies between other Fluid Framework libraries,
12
12
  library consumers should always prefer `^`.
13
13
 
14
- Note that when depending on a library version of the form `2.0.0-internal.x.y.z`, called the Fluid internal version scheme,
15
- you must use a `>= <` dependency range (such as `>=2.0.0-internal.x.y.z <2.0.0-internal.w.0.0` where `w` is `x+1`).
16
- Standard `^` and `~` ranges will not work as expected.
17
- See the [@fluid-tools/version-tools](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/version-tools/README.md)
18
- package for more information including tools to convert between version schemes.
19
-
20
14
  ## Installation
21
15
 
22
16
  To get started, install the package by running the following command:
@@ -27,7 +21,7 @@ npm i @fluidframework/tinylicious-driver
27
21
 
28
22
  ## API Documentation
29
23
 
30
- API documentation for **@fluidframework/tinylicious-driver** is available at <https://fluidframework.com/docs/apis/tinylicious-driver>.
24
+ API documentation for **@fluidframework/tinylicious-driver** is available at <https://fluidframework.com/docs/api/v1/tinylicious-driver>.
31
25
 
32
26
  ## Contribution Guidelines
33
27
 
@@ -0,0 +1,4 @@
1
+ {
2
+ "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
+ "extends": "../../../common/build/build-common/api-extractor-base-esm.json"
4
+ }
@@ -1,13 +1,4 @@
1
1
  {
2
2
  "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
- "extends": "../../../common/build/build-common/api-extractor-lint.json",
4
- "messages": {
5
- "extractorMessageReporting": {
6
- // TODO: remove once base config has this enabled as an error
7
- "ae-incompatible-release-tags": {
8
- "logLevel": "error",
9
- "addToApiReportFile": false
10
- }
11
- }
12
- }
3
+ "extends": "../../../common/build/build-common/api-extractor-lint.json"
13
4
  }
@@ -1,12 +1,4 @@
1
1
  {
2
2
  "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
- "extends": "../../../common/build/build-common/api-extractor-base.json",
4
- "messages": {
5
- "extractorMessageReporting": {
6
- // TODO: Add missing documentation and remove this rule override
7
- "ae-undocumented": {
8
- "logLevel": "none"
9
- }
10
- }
11
- }
3
+ "extends": "../../../common/build/build-common/api-extractor-base.json"
12
4
  }
@@ -5,11 +5,11 @@
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.InsecureTinyliciousUrlResolver = exports.defaultTinyliciousPort = exports.defaultTinyliciousEndpoint = exports.createTinyliciousCreateNewRequest = exports.InsecureTinyliciousTokenProvider = void 0;
8
- var insecureTinyliciousTokenProvider_1 = require("./insecureTinyliciousTokenProvider.cjs");
8
+ var insecureTinyliciousTokenProvider_1 = require("./insecureTinyliciousTokenProvider");
9
9
  Object.defineProperty(exports, "InsecureTinyliciousTokenProvider", { enumerable: true, get: function () { return insecureTinyliciousTokenProvider_1.InsecureTinyliciousTokenProvider; } });
10
- var insecureTinyliciousUrlResolver_1 = require("./insecureTinyliciousUrlResolver.cjs");
10
+ var insecureTinyliciousUrlResolver_1 = require("./insecureTinyliciousUrlResolver");
11
11
  Object.defineProperty(exports, "createTinyliciousCreateNewRequest", { enumerable: true, get: function () { return insecureTinyliciousUrlResolver_1.createTinyliciousCreateNewRequest; } });
12
12
  Object.defineProperty(exports, "defaultTinyliciousEndpoint", { enumerable: true, get: function () { return insecureTinyliciousUrlResolver_1.defaultTinyliciousEndpoint; } });
13
13
  Object.defineProperty(exports, "defaultTinyliciousPort", { enumerable: true, get: function () { return insecureTinyliciousUrlResolver_1.defaultTinyliciousPort; } });
14
14
  Object.defineProperty(exports, "InsecureTinyliciousUrlResolver", { enumerable: true, get: function () { return insecureTinyliciousUrlResolver_1.InsecureTinyliciousUrlResolver; } });
15
- //# sourceMappingURL=index.cjs.map
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,uFAAsF;AAA7E,oJAAA,gCAAgC,OAAA;AACzC,mFAK0C;AAJzC,mJAAA,iCAAiC,OAAA;AACjC,4IAAA,0BAA0B,OAAA;AAC1B,wIAAA,sBAAsB,OAAA;AACtB,gJAAA,8BAA8B,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { InsecureTinyliciousTokenProvider } from \"./insecureTinyliciousTokenProvider\";\nexport {\n\tcreateTinyliciousCreateNewRequest,\n\tdefaultTinyliciousEndpoint,\n\tdefaultTinyliciousPort,\n\tInsecureTinyliciousUrlResolver,\n} from \"./insecureTinyliciousUrlResolver\";\n"]}
@@ -62,4 +62,4 @@ class InsecureTinyliciousTokenProvider {
62
62
  }
63
63
  }
64
64
  exports.InsecureTinyliciousTokenProvider = InsecureTinyliciousTokenProvider;
65
- //# sourceMappingURL=insecureTinyliciousTokenProvider.cjs.map
65
+ //# sourceMappingURL=insecureTinyliciousTokenProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"insecureTinyliciousTokenProvider.js","sourceRoot":"","sources":["../src/insecureTinyliciousTokenProvider.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+EAA+E;AAE/E,yCAA8C;AAC9C,+BAAkC;AAElC;;;;GAIG;AACH,MAAa,gCAAgC;IAC5C;IACC;;;;;;;OAOG;IACc,MAAoB;QAApB,WAAM,GAAN,MAAM,CAAc;IACnC,CAAC;IAEG,KAAK,CAAC,iBAAiB,CAAC,QAAgB,EAAE,UAAmB;QACnE,OAAO;YACN,SAAS,EAAE,IAAI;YACf,GAAG,EAAE,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,UAAU,CAAC;SAC9C,CAAC;IACH,CAAC;IAEM,KAAK,CAAC,iBAAiB,CAAC,QAAgB,EAAE,UAAkB;QAClE,OAAO;YACN,SAAS,E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CACD;AA7DD,4EA6DC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ScopeType, ITokenClaims } from \"@fluidframework/protocol-definitions\";\nimport { ITokenProvider, ITokenResponse } from \"@fluidframework/routerlicious-driver\";\nimport { KJUR as jsrsasign } from \"jsrsasign\";\nimport { v4 as uuid } from \"uuid\";\n\n/**\n * As the name implies this is not secure and should not be used in production. It simply makes the example easier\n * to get up and running.\n * @internal\n */\nexport class InsecureTinyliciousTokenProvider implements ITokenProvider {\n\tconstructor(\n\t\t/**\n\t\t * Optional. Override of scopes. If a param is not provided, InsecureTinyliciousTokenProvider\n\t\t * will use the default scopes which are document read, write and summarizer write.\n\t\t *\n\t\t * @param scopes - See {@link @fluidframework/protocol-definitions#ITokenClaims.scopes}\n\t\t *\n\t\t * @defaultValue [ ScopeType.DocRead, ScopeType.DocWrite, ScopeType.SummaryWrite ]\n\t\t */\n\t\tprivate readonly scopes?: ScopeType[],\n\t) {}\n\n\tpublic async fetchOrdererToken(tenantId: string, documentId?: string): Promise<ITokenResponse> {\n\t\treturn {\n\t\t\tfromCache: true,\n\t\t\tjwt: this.getSignedToken(tenantId, documentId),\n\t\t};\n\t}\n\n\tpublic async fetchStorageToken(tenantId: string, documentId: string): Promise<ITokenResponse> {\n\t\treturn {\n\t\t\tfromCache: true,\n\t\t\tjwt: this.getSignedToken(tenantId, documentId),\n\t\t};\n\t}\n\n\tprivate getSignedToken(\n\t\ttenantId: string,\n\t\tdocumentId: string | undefined,\n\t\tlifetime: number = 60 * 60,\n\t\tver: string = \"1.0\",\n\t): string {\n\t\tconst userId = uuid();\n\t\tconst match = userId.match(/^([\\da-f]{8})-([\\da-f]{4})/);\n\t\tconst userName = match === null ? userId : match[0]; // Just use the first two segments of the (fake) userId as a fake name.\n\n\t\t// Current time in seconds\n\t\tconst now = Math.round(Date.now() / 1000);\n\t\tconst user = { id: userId, name: userName };\n\n\t\tconst claims: ITokenClaims = {\n\t\t\tdocumentId: documentId ?? \"\",\n\t\t\tscopes: this.scopes ?? [ScopeType.DocRead, ScopeType.DocWrite, ScopeType.SummaryWrite],\n\t\t\ttenantId,\n\t\t\tuser,\n\t\t\tiat: now,\n\t\t\texp: now + lifetime,\n\t\t\tver,\n\t\t};\n\n\t\tconst utf8Key = { utf8: \"12345\" };\n\t\treturn jsrsasign.jws.JWS.sign(\n\t\t\t// External API uses `null`\n\t\t\t// eslint-disable-next-line unicorn/no-null\n\t\t\tnull,\n\t\t\tJSON.stringify({ alg: \"HS256\", typ: \"JWT\" }),\n\t\t\tclaims,\n\t\t\tutf8Key,\n\t\t);\n\t}\n}\n"]}
@@ -87,4 +87,4 @@ const createTinyliciousCreateNewRequest = (documentId) => ({
87
87
  },
88
88
  });
89
89
  exports.createTinyliciousCreateNewRequest = createTinyliciousCreateNewRequest;
90
- //# sourceMappingURL=insecureTinyliciousUrlResolver.cjs.map
90
+ //# sourceMappingURL=insecureTinyliciousUrlResolver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"insecureTinyliciousUrlResolver.js","sourceRoot":"","sources":["../src/insecureTinyliciousUrlResolver.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,2EAA8F;AAE9F;;;GAGG;AACU,QAAA,sBAAsB,GAAG,IAAI,CAAC;AAE3C;;;GAGG;AACU,QAAA,0BAA0B,GAAG,kBAAkB,CAAC;AAE7D;;;;;;GAMG;AACH,MAAa,8BAA8B;IAG1C,YAAmB,IAAI,GAAG,8BAAsB,EAAE,QAAQ,GAAG,kCAA0B;QACtF,IAAI,CAAC,mBAAmB,GAAG,GAAG,QAAQ,IAAI,IAAI,EAAE,CAAC;QACjD,IAAI,CAAC,qBAAqB,GAAG,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC;IAC5F,CAAC;IAEM,KAAK,CAAC,OAAO,CAAC,OAAiB;QACrC,MAAM,WAAW,GAAG,OAAO,CAAC,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K,CAAC,cAAc,CAAC,WAAyB,EAAE,WAAmB;QACzE,MAAM,UAAU,GAAG,kBAAkB,CACpC,WAAW,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,qBAAqB,eAAe,EAAE,EAAE,CAAC,CACzE,CAAC;QACF;;;;;WAKG;QACH,OAAO,GAAG,UAAU,IAAI,WAAW,EAAE,CAAC;IACvC,CAAC;CACD;AA3DD,wEA2DC;AAED;;;GAGG;AACI,MAAM,iCAAiC,GAAG,CAAC,UAAmB,EAAY,EAAE,CAAC,CAAC;IACpF,GAAG,EAAE,UAAU,IAAI,EAAE;IACrB,OAAO,EAAE;QACR,CAAC,iCAAY,CAAC,SAAS,CAAC,EAAE,IAAI;KAC9B;CACD,CAAC,CAAC;AALU,QAAA,iCAAiC,qCAK3C","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IRequest } from \"@fluidframework/core-interfaces\";\nimport { DriverHeader, IResolvedUrl, IUrlResolver } from \"@fluidframework/driver-definitions\";\n\n/**\n * Default endpoint port. Will be used by the service if the consumer does not specify a port.\n * @internal\n */\nexport const defaultTinyliciousPort = 7070;\n\n/**\n * Default endpoint URL base. Will be used by the service if the consumer does not specify an endpoint.\n * @internal\n */\nexport const defaultTinyliciousEndpoint = \"http://localhost\";\n\n/**\n * InsecureTinyliciousUrlResolver knows how to get the URLs to the service (in this case Tinylicious) to use\n * for a given request. This particular implementation has a goal to avoid imposing requirements on the app's\n * URL shape, so it expects the request url to have this format (as opposed to a more traditional URL):\n * documentId/containerRelativePathing\n * @internal\n */\nexport class InsecureTinyliciousUrlResolver implements IUrlResolver {\n\tprivate readonly fluidProtocolEndpoint: string;\n\tprivate readonly tinyliciousEndpoint: string;\n\tpublic constructor(port = defaultTinyliciousPort, endpoint = defaultTinyliciousEndpoint) {\n\t\tthis.tinyliciousEndpoint = `${endpoint}:${port}`;\n\t\tthis.fluidProtocolEndpoint = this.tinyliciousEndpoint.replace(/(^\\w+:|^)\\/\\//, \"fluid://\");\n\t}\n\n\tpublic async resolve(request: IRequest): Promise<IResolvedUrl> {\n\t\tconst relativeUrl = request.url.replace(`${this.tinyliciousEndpoint}/`, \"\");\n\t\tconst documentIdFromRequest = relativeUrl.split(\"/\")[0];\n\n\t\tlet deltaStorageUrl: string;\n\t\tlet documentUrl: string;\n\t\tlet finalDocumentId: string = documentIdFromRequest;\n\n\t\t// Special handling if the request is to create a new container\n\t\tif (request.headers && request.headers[DriverHeader.createNew] === true) {\n\t\t\t// Use the document ID passed by the application via the create request;\n\t\t\t// if none was passed, use the reserved keyword to let the driver generate the ID.\n\t\t\t// TODO: deprecate this capability for tinylicious as the r11s driver will stop using the document ID\n\t\t\t// in create requests.\n\t\t\tif (finalDocumentId === \"\") {\n\t\t\t\tfinalDocumentId = \"new\";\n\t\t\t}\n\t\t\tdeltaStorageUrl = `${this.tinyliciousEndpoint}/deltas/tinylicious/${finalDocumentId}`;\n\t\t\tdocumentUrl = `${this.fluidProtocolEndpoint}/tinylicious/${finalDocumentId}`;\n\t\t} else {\n\t\t\tconst encodedDocId = encodeURIComponent(finalDocumentId);\n\t\t\tconst documentRelativePath = relativeUrl.slice(documentIdFromRequest.length);\n\t\t\tdocumentUrl = `${this.fluidProtocolEndpoint}/tinylicious/${encodedDocId}${documentRelativePath}`;\n\t\t\tdeltaStorageUrl = `${this.tinyliciousEndpoint}/deltas/tinylicious/${encodedDocId}`;\n\t\t}\n\n\t\treturn {\n\t\t\tendpoints: {\n\t\t\t\tdeltaStorageUrl,\n\t\t\t\tordererUrl: this.tinyliciousEndpoint,\n\t\t\t\tstorageUrl: `${this.tinyliciousEndpoint}/repos/tinylicious`,\n\t\t\t},\n\t\t\tid: finalDocumentId,\n\t\t\ttokens: {},\n\t\t\ttype: \"fluid\",\n\t\t\turl: documentUrl,\n\t\t};\n\t}\n\n\tpublic async getAbsoluteUrl(resolvedUrl: IResolvedUrl, relativeUrl: string): Promise<string> {\n\t\tconst documentId = decodeURIComponent(\n\t\t\tresolvedUrl.url.replace(`${this.fluidProtocolEndpoint}/tinylicious/`, \"\"),\n\t\t);\n\t\t/*\n\t\t * The detached container flow will ultimately call getAbsoluteUrl() with the resolved.url produced by\n\t\t * resolve(). The container expects getAbsoluteUrl's return value to be a URL that can then be roundtripped\n\t\t * back through resolve() again, and get the same result again. So we'll return a \"URL\" with the same format\n\t\t * described above.\n\t\t */\n\t\treturn `${documentId}/${relativeUrl}`;\n\t}\n}\n\n/**\n * Creates a Routerlicious {@link @fluidframework/core-interfaces#IRequest}.\n * @internal\n */\nexport const createTinyliciousCreateNewRequest = (documentId?: string): IRequest => ({\n\turl: documentId ?? \"\",\n\theaders: {\n\t\t[DriverHeader.createNew]: true,\n\t},\n});\n"]}
@@ -15,14 +15,8 @@ import { ScopeType } from '@fluidframework/protocol-definitions';
15
15
 
16
16
  /* Excluded from this release type: InsecureTinyliciousUrlResolver */
17
17
 
18
- /* Excluded from this release type: IRequest */
19
-
20
18
  /* Excluded from this release type: IResolvedUrl */
21
19
 
22
- /* Excluded from this release type: ITokenProvider */
23
-
24
- /* Excluded from this release type: ITokenResponse */
25
-
26
20
  /* Excluded from this release type: IUrlResolver */
27
21
 
28
22
  export { }
@@ -15,14 +15,8 @@ import { ScopeType } from '@fluidframework/protocol-definitions';
15
15
 
16
16
  /* Excluded from this release type: InsecureTinyliciousUrlResolver */
17
17
 
18
- /* Excluded from this release type: IRequest */
19
-
20
18
  /* Excluded from this release type: IResolvedUrl */
21
19
 
22
- /* Excluded from this release type: ITokenProvider */
23
-
24
- /* Excluded from this release type: ITokenResponse */
25
-
26
20
  /* Excluded from this release type: IUrlResolver */
27
21
 
28
22
  export { }
@@ -4,4 +4,4 @@
4
4
  */
5
5
  export { InsecureTinyliciousTokenProvider } from "./insecureTinyliciousTokenProvider.mjs";
6
6
  export { createTinyliciousCreateNewRequest, defaultTinyliciousEndpoint, defaultTinyliciousPort, InsecureTinyliciousUrlResolver, } from "./insecureTinyliciousUrlResolver.mjs";
7
- //# sourceMappingURL=index.d.ts.map
7
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EAAE,gCAAgC,EAAE;OACpC,EACN,iCAAiC,EACjC,0BAA0B,EAC1B,sBAAsB,EACtB,8BAA8B,GAC9B"}
@@ -33,4 +33,4 @@ export declare class InsecureTinyliciousTokenProvider implements ITokenProvider
33
33
  fetchStorageToken(tenantId: string, documentId: string): Promise<ITokenResponse>;
34
34
  private getSignedToken;
35
35
  }
36
- //# sourceMappingURL=insecureTinyliciousTokenProvider.d.ts.map
36
+ //# sourceMappingURL=insecureTinyliciousTokenProvider.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"insecureTinyliciousTokenProvider.d.mts","sourceRoot":"","sources":["../src/insecureTinyliciousTokenProvider.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EAAE,SAAS,EAAgB,MAAM,sCAAsC;OACvE,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sCAAsC;AAIrF;;;;GAIG;AACH,qBAAa,gCAAiC,YAAW,cAAc;IAErE;;;;;;;OAOG;IACH,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC;;IARxB;;;;;;;OAOG;IACc,MAAM,CAAC,yBAAa;IAGzB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAOjF,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAO7F,OAAO,CAAC,cAAc;CAkCtB"}
@@ -33,4 +33,4 @@ export declare class InsecureTinyliciousUrlResolver implements IUrlResolver {
33
33
  * @internal
34
34
  */
35
35
  export declare const createTinyliciousCreateNewRequest: (documentId?: string) => IRequest;
36
- //# sourceMappingURL=insecureTinyliciousUrlResolver.d.ts.map
36
+ //# sourceMappingURL=insecureTinyliciousUrlResolver.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"insecureTinyliciousUrlResolver.d.mts","sourceRoot":"","sources":["../src/insecureTinyliciousUrlResolver.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EAAE,QAAQ,EAAE,MAAM,iCAAiC;OACnD,EAAgB,YAAY,EAAE,YAAY,EAAE,MAAM,oCAAoC;AAE7F;;;GAGG;AACH,eAAO,MAAM,sBAAsB,OAAO,CAAC;AAE3C;;;GAGG;AACH,eAAO,MAAM,0BAA0B,qBAAqB,CAAC;AAE7D;;;;;;GAMG;AACH,qBAAa,8BAA+B,YAAW,YAAY;IAClE,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAAS;IAC/C,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAS;gBAC1B,IAAI,SAAyB,EAAE,QAAQ,SAA6B;IAK1E,OAAO,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,YAAY,CAAC;IAuCjD,cAAc,CAAC,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAY5F;AAED;;;GAGG;AACH,eAAO,MAAM,iCAAiC,gBAAiB,MAAM,KAAG,QAKtE,CAAC"}
@@ -15,14 +15,8 @@ import { ScopeType } from '@fluidframework/protocol-definitions';
15
15
 
16
16
  /* Excluded from this release type: InsecureTinyliciousUrlResolver */
17
17
 
18
- /* Excluded from this release type: IRequest */
19
-
20
18
  /* Excluded from this release type: IResolvedUrl */
21
19
 
22
- /* Excluded from this release type: ITokenProvider */
23
-
24
- /* Excluded from this release type: ITokenResponse */
25
-
26
20
  /* Excluded from this release type: IUrlResolver */
27
21
 
28
22
  export { }
@@ -15,14 +15,8 @@ import { ScopeType } from '@fluidframework/protocol-definitions';
15
15
 
16
16
  /* Excluded from this release type: InsecureTinyliciousUrlResolver */
17
17
 
18
- /* Excluded from this release type: IRequest */
19
-
20
18
  /* Excluded from this release type: IResolvedUrl */
21
19
 
22
- /* Excluded from this release type: ITokenProvider */
23
-
24
- /* Excluded from this release type: ITokenResponse */
25
-
26
20
  /* Excluded from this release type: IUrlResolver */
27
21
 
28
22
  export { }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/tinylicious-driver",
3
- "version": "2.0.0-internal.8.0.0",
3
+ "version": "2.0.0-rc.1.0.0",
4
4
  "description": "Driver for tinylicious",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -10,27 +10,79 @@
10
10
  },
11
11
  "license": "MIT",
12
12
  "author": "Microsoft and contributors",
13
- "main": "dist/index.cjs",
13
+ "exports": {
14
+ ".": {
15
+ "import": {
16
+ "types": "./lib/index.d.mts",
17
+ "default": "./lib/index.mjs"
18
+ },
19
+ "require": {
20
+ "types": "./dist/index.d.ts",
21
+ "default": "./dist/index.js"
22
+ }
23
+ },
24
+ "./alpha": {
25
+ "import": {
26
+ "types": "./lib/tinylicious-driver-alpha.d.mts",
27
+ "default": "./lib/index.mjs"
28
+ },
29
+ "require": {
30
+ "types": "./dist/tinylicious-driver-alpha.d.ts",
31
+ "default": "./dist/index.js"
32
+ }
33
+ },
34
+ "./beta": {
35
+ "import": {
36
+ "types": "./lib/tinylicious-driver-beta.d.mts",
37
+ "default": "./lib/index.mjs"
38
+ },
39
+ "require": {
40
+ "types": "./dist/tinylicious-driver-beta.d.ts",
41
+ "default": "./dist/index.js"
42
+ }
43
+ },
44
+ "./internal": {
45
+ "import": {
46
+ "types": "./lib/index.d.mts",
47
+ "default": "./lib/index.mjs"
48
+ },
49
+ "require": {
50
+ "types": "./dist/index.d.ts",
51
+ "default": "./dist/index.js"
52
+ }
53
+ },
54
+ "./public": {
55
+ "import": {
56
+ "types": "./lib/tinylicious-driver-public.d.mts",
57
+ "default": "./lib/index.mjs"
58
+ },
59
+ "require": {
60
+ "types": "./dist/tinylicious-driver-public.d.ts",
61
+ "default": "./dist/index.js"
62
+ }
63
+ }
64
+ },
65
+ "main": "dist/index.js",
14
66
  "module": "lib/index.mjs",
15
67
  "types": "dist/index.d.ts",
16
68
  "dependencies": {
17
- "@fluidframework/core-interfaces": ">=2.0.0-internal.8.0.0 <2.0.0-internal.8.1.0",
18
- "@fluidframework/driver-definitions": ">=2.0.0-internal.8.0.0 <2.0.0-internal.8.1.0",
19
- "@fluidframework/driver-utils": ">=2.0.0-internal.8.0.0 <2.0.0-internal.8.1.0",
20
- "@fluidframework/protocol-definitions": "^3.0.0",
21
- "@fluidframework/routerlicious-driver": ">=2.0.0-internal.8.0.0 <2.0.0-internal.8.1.0",
69
+ "@fluidframework/core-interfaces": ">=2.0.0-rc.1.0.0 <2.0.0-rc.1.1.0",
70
+ "@fluidframework/driver-definitions": ">=2.0.0-rc.1.0.0 <2.0.0-rc.1.1.0",
71
+ "@fluidframework/driver-utils": ">=2.0.0-rc.1.0.0 <2.0.0-rc.1.1.0",
72
+ "@fluidframework/protocol-definitions": "^3.1.0",
73
+ "@fluidframework/routerlicious-driver": ">=2.0.0-rc.1.0.0 <2.0.0-rc.1.1.0",
22
74
  "jsrsasign": "^10.5.25",
23
75
  "uuid": "^9.0.0"
24
76
  },
25
77
  "devDependencies": {
26
78
  "@arethetypeswrong/cli": "^0.13.3",
27
- "@fluid-tools/build-cli": "^0.28.0",
79
+ "@fluid-tools/build-cli": "^0.29.0",
28
80
  "@fluidframework/build-common": "^2.0.3",
29
- "@fluidframework/build-tools": "^0.28.0",
30
- "@fluidframework/eslint-config-fluid": "^3.1.0",
31
- "@fluidframework/mocha-test-setup": ">=2.0.0-internal.8.0.0 <2.0.0-internal.8.1.0",
81
+ "@fluidframework/build-tools": "^0.29.0",
82
+ "@fluidframework/eslint-config-fluid": "^3.2.0",
83
+ "@fluidframework/mocha-test-setup": ">=2.0.0-rc.1.0.0 <2.0.0-rc.1.1.0",
32
84
  "@fluidframework/test-tools": "^1.0.195075",
33
- "@fluidframework/tinylicious-driver-previous": "npm:@fluidframework/tinylicious-driver@2.0.0-internal.7.2.0",
85
+ "@fluidframework/tinylicious-driver-previous": "npm:@fluidframework/tinylicious-driver@2.0.0-internal.8.0.0",
34
86
  "@microsoft/api-extractor": "^7.38.3",
35
87
  "@types/jsrsasign": "^8.0.8",
36
88
  "@types/mocha": "^9.1.1",
@@ -63,14 +115,14 @@
63
115
  "scripts": {
64
116
  "api": "fluid-build . --task api",
65
117
  "api-extractor:commonjs": "api-extractor run --local",
66
- "api-extractor:esnext": "copyfiles -u 1 \"dist/**/*-@(alpha|beta|public|untrimmed).d.ts\" lib",
118
+ "api-extractor:esnext": "api-extractor run --config ./api-extractor-esm.json",
67
119
  "build": "fluid-build . --task build",
68
120
  "build:commonjs": "fluid-build . --task commonjs",
69
121
  "build:compile": "fluid-build . --task compile",
70
122
  "build:docs": "fluid-build . --task api",
71
123
  "build:esnext": "tsc-multi --config ../../../common/build/build-common/tsc-multi.esm.json",
72
- "build:test": "tsc-multi --config ./tsc-multi.test.json",
73
- "check:are-the-types-wrong": "attw --pack",
124
+ "build:test": "tsc --project ./src/test/tsconfig.json",
125
+ "check:are-the-types-wrong": "attw --pack . --entrypoints .",
74
126
  "check:release-tags": "api-extractor run --local --config ./api-extractor-lint.json",
75
127
  "ci:build:docs": "api-extractor run",
76
128
  "clean": "rimraf --glob dist lib \"**/*.tsbuildinfo\" \"**/*.build.log\" _api-extractor-temp nyc",
@@ -84,7 +136,7 @@
84
136
  "test": "npm run test:mocha",
85
137
  "test:mocha": "mocha --ignore \"dist/test/types/*\" --recursive dist/test -r node_modules/@fluidframework/mocha-test-setup",
86
138
  "test:mocha:verbose": "cross-env FLUID_TEST_VERBOSE=1 npm run test:mocha",
87
- "tsc": "tsc-multi --config ../../../common/build/build-common/tsc-multi.cjs.json",
139
+ "tsc": "tsc",
88
140
  "typetests:gen": "fluid-type-test-generator",
89
141
  "typetests:prepare": "flub typetests --dir . --reset --previous --normalize"
90
142
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,2FAAsF;AAA7E,oJAAA,gCAAgC,OAAA;AACzC,uFAK0C;AAJzC,mJAAA,iCAAiC,OAAA;AACjC,4IAAA,0BAA0B,OAAA;AAC1B,wIAAA,sBAAsB,OAAA;AACtB,gJAAA,8BAA8B,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { InsecureTinyliciousTokenProvider } from \"./insecureTinyliciousTokenProvider\";\nexport {\n\tcreateTinyliciousCreateNewRequest,\n\tdefaultTinyliciousEndpoint,\n\tdefaultTinyliciousPort,\n\tInsecureTinyliciousUrlResolver,\n} from \"./insecureTinyliciousUrlResolver\";\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"insecureTinyliciousTokenProvider.cjs","sourceRoot":"","sources":["../src/insecureTinyliciousTokenProvider.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+EAA+E;AAE/E,yCAA8C;AAC9C,+BAAkC;AAElC;;;;GAIG;AACH,MAAa,gCAAgC;IAC5C;IACC;;;;;;;OAOG;IACc,MAAoB;QAApB,WAAM,GAAN,MAAM,CAAc;IACnC,CAAC;IAEG,KAAK,CAAC,iBAAiB,CAAC,QAAgB,EAAE,UAAmB;QACnE,OAAO;YACN,SAAS,EAAE,IAAI;YACf,GAAG,EAAE,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,UAAU,CAAC;SAC9C,CAAC;IACH,CAAC;IAEM,KAAK,CAAC,iBAAiB,CAAC,QAAgB,EAAE,UAAkB;QAClE,OAAO;YACN,SAAS,EAAE,IAAI;YACf,GAAG,EAAE,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,UAAU,CAAC;SAC9C,CAAC;IACH,CAAC;IAEO,cAAc,CACrB,QAAgB,EAChB,UAA8B,EAC9B,WAAmB,EAAE,GAAG,EAAE,EAC1B,MAAc,KAAK;QAEnB,MAAM,MAAM,GAAG,IAAA,SAAI,GAAE,CAAC;QACtB,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,4BAA4B,CAAC,CAAC;QACzD,MAAM,QAAQ,GAAG,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,uEAAuE;QAE5H,0BAA0B;QAC1B,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC;QAC1C,MAAM,IAAI,GAAG,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;QAE5C,MAAM,MAAM,GAAiB;YAC5B,UAAU,EAAE,UAAU,IAAI,EAAE;YAC5B,MAAM,EAAE,IAAI,CAAC,MAAM,IAAI,CAAC,gCAAS,CAAC,OAAO,EAAE,gCAAS,CAAC,QAAQ,EAAE,gCAAS,CAAC,YAAY,CAAC;YACtF,QAAQ;YACR,IAAI;YACJ,GAAG,EAAE,GAAG;YACR,GAAG,EAAE,GAAG,GAAG,QAAQ;YACnB,GAAG;SACH,CAAC;QAEF,MAAM,OAAO,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;QAClC,OAAO,gBAAS,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI;QAC5B,2BAA2B;QAC3B,2CAA2C;QAC3C,IAAI,EACJ,IAAI,CAAC,SAAS,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,EAC5C,MAAM,EACN,OAAO,CACP,CAAC;IACH,CAAC;CACD;AA7DD,4EA6DC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ScopeType, ITokenClaims } from \"@fluidframework/protocol-definitions\";\nimport { ITokenProvider, ITokenResponse } from \"@fluidframework/routerlicious-driver\";\nimport { KJUR as jsrsasign } from \"jsrsasign\";\nimport { v4 as uuid } from \"uuid\";\n\n/**\n * As the name implies this is not secure and should not be used in production. It simply makes the example easier\n * to get up and running.\n * @internal\n */\nexport class InsecureTinyliciousTokenProvider implements ITokenProvider {\n\tconstructor(\n\t\t/**\n\t\t * Optional. Override of scopes. If a param is not provided, InsecureTinyliciousTokenProvider\n\t\t * will use the default scopes which are document read, write and summarizer write.\n\t\t *\n\t\t * @param scopes - See {@link @fluidframework/protocol-definitions#ITokenClaims.scopes}\n\t\t *\n\t\t * @defaultValue [ ScopeType.DocRead, ScopeType.DocWrite, ScopeType.SummaryWrite ]\n\t\t */\n\t\tprivate readonly scopes?: ScopeType[],\n\t) {}\n\n\tpublic async fetchOrdererToken(tenantId: string, documentId?: string): Promise<ITokenResponse> {\n\t\treturn {\n\t\t\tfromCache: true,\n\t\t\tjwt: this.getSignedToken(tenantId, documentId),\n\t\t};\n\t}\n\n\tpublic async fetchStorageToken(tenantId: string, documentId: string): Promise<ITokenResponse> {\n\t\treturn {\n\t\t\tfromCache: true,\n\t\t\tjwt: this.getSignedToken(tenantId, documentId),\n\t\t};\n\t}\n\n\tprivate getSignedToken(\n\t\ttenantId: string,\n\t\tdocumentId: string | undefined,\n\t\tlifetime: number = 60 * 60,\n\t\tver: string = \"1.0\",\n\t): string {\n\t\tconst userId = uuid();\n\t\tconst match = userId.match(/^([\\da-f]{8})-([\\da-f]{4})/);\n\t\tconst userName = match === null ? userId : match[0]; // Just use the first two segments of the (fake) userId as a fake name.\n\n\t\t// Current time in seconds\n\t\tconst now = Math.round(Date.now() / 1000);\n\t\tconst user = { id: userId, name: userName };\n\n\t\tconst claims: ITokenClaims = {\n\t\t\tdocumentId: documentId ?? \"\",\n\t\t\tscopes: this.scopes ?? [ScopeType.DocRead, ScopeType.DocWrite, ScopeType.SummaryWrite],\n\t\t\ttenantId,\n\t\t\tuser,\n\t\t\tiat: now,\n\t\t\texp: now + lifetime,\n\t\t\tver,\n\t\t};\n\n\t\tconst utf8Key = { utf8: \"12345\" };\n\t\treturn jsrsasign.jws.JWS.sign(\n\t\t\t// External API uses `null`\n\t\t\t// eslint-disable-next-line unicorn/no-null\n\t\t\tnull,\n\t\t\tJSON.stringify({ alg: \"HS256\", typ: \"JWT\" }),\n\t\t\tclaims,\n\t\t\tutf8Key,\n\t\t);\n\t}\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"insecureTinyliciousUrlResolver.cjs","sourceRoot":"","sources":["../src/insecureTinyliciousUrlResolver.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,2EAA8F;AAE9F;;;GAGG;AACU,QAAA,sBAAsB,GAAG,IAAI,CAAC;AAE3C;;;GAGG;AACU,QAAA,0BAA0B,GAAG,kBAAkB,CAAC;AAE7D;;;;;;GAMG;AACH,MAAa,8BAA8B;IAG1C,YAAmB,IAAI,GAAG,8BAAsB,EAAE,QAAQ,GAAG,kCAA0B;QACtF,IAAI,CAAC,mBAAmB,GAAG,GAAG,QAAQ,IAAI,IAAI,EAAE,CAAC;QACjD,IAAI,CAAC,qBAAqB,GAAG,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC;IAC5F,CAAC;IAEM,KAAK,CAAC,OAAO,CAAC,OAAiB;QACrC,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,mBAAmB,GAAG,EAAE,EAAE,CAAC,CAAC;QAC5E,MAAM,qBAAqB,GAAG,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QAExD,IAAI,eAAuB,CAAC;QAC5B,IAAI,WAAmB,CAAC;QACxB,IAAI,eAAe,GAAW,qBAAqB,CAAC;QAEpD,+DAA+D;QAC/D,IAAI,OAAO,CAAC,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,iCAAY,CAAC,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IACpF,GAAG,EAAE,UAAU,IAAI,EAAE;IACrB,OAAO,EAAE;QACR,CAAC,iCAAY,CAAC,SAAS,CAAC,EAAE,IAAI;KAC9B;CACD,CAAC,CAAC;AALU,QAAA,iCAAiC,qCAK3C","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IRequest } from \"@fluidframework/core-interfaces\";\nimport { DriverHeader, IResolvedUrl, IUrlResolver } from \"@fluidframework/driver-definitions\";\n\n/**\n * Default endpoint port. Will be used by the service if the consumer does not specify a port.\n * @internal\n */\nexport const defaultTinyliciousPort = 7070;\n\n/**\n * Default endpoint URL base. Will be used by the service if the consumer does not specify an endpoint.\n * @internal\n */\nexport const defaultTinyliciousEndpoint = \"http://localhost\";\n\n/**\n * InsecureTinyliciousUrlResolver knows how to get the URLs to the service (in this case Tinylicious) to use\n * for a given request. This particular implementation has a goal to avoid imposing requirements on the app's\n * URL shape, so it expects the request url to have this format (as opposed to a more traditional URL):\n * documentId/containerRelativePathing\n * @internal\n */\nexport class InsecureTinyliciousUrlResolver implements IUrlResolver {\n\tprivate readonly fluidProtocolEndpoint: string;\n\tprivate readonly tinyliciousEndpoint: string;\n\tpublic constructor(port = defaultTinyliciousPort, endpoint = defaultTinyliciousEndpoint) {\n\t\tthis.tinyliciousEndpoint = `${endpoint}:${port}`;\n\t\tthis.fluidProtocolEndpoint = this.tinyliciousEndpoint.replace(/(^\\w+:|^)\\/\\//, \"fluid://\");\n\t}\n\n\tpublic async resolve(request: IRequest): Promise<IResolvedUrl> {\n\t\tconst relativeUrl = request.url.replace(`${this.tinyliciousEndpoint}/`, \"\");\n\t\tconst documentIdFromRequest = relativeUrl.split(\"/\")[0];\n\n\t\tlet deltaStorageUrl: string;\n\t\tlet documentUrl: string;\n\t\tlet finalDocumentId: string = documentIdFromRequest;\n\n\t\t// Special handling if the request is to create a new container\n\t\tif (request.headers && request.headers[DriverHeader.createNew] === true) {\n\t\t\t// Use the document ID passed by the application via the create request;\n\t\t\t// if none was passed, use the reserved keyword to let the driver generate the ID.\n\t\t\t// TODO: deprecate this capability for tinylicious as the r11s driver will stop using the document ID\n\t\t\t// in create requests.\n\t\t\tif (finalDocumentId === \"\") {\n\t\t\t\tfinalDocumentId = \"new\";\n\t\t\t}\n\t\t\tdeltaStorageUrl = `${this.tinyliciousEndpoint}/deltas/tinylicious/${finalDocumentId}`;\n\t\t\tdocumentUrl = `${this.fluidProtocolEndpoint}/tinylicious/${finalDocumentId}`;\n\t\t} else {\n\t\t\tconst encodedDocId = encodeURIComponent(finalDocumentId);\n\t\t\tconst documentRelativePath = relativeUrl.slice(documentIdFromRequest.length);\n\t\t\tdocumentUrl = `${this.fluidProtocolEndpoint}/tinylicious/${encodedDocId}${documentRelativePath}`;\n\t\t\tdeltaStorageUrl = `${this.tinyliciousEndpoint}/deltas/tinylicious/${encodedDocId}`;\n\t\t}\n\n\t\treturn {\n\t\t\tendpoints: {\n\t\t\t\tdeltaStorageUrl,\n\t\t\t\tordererUrl: this.tinyliciousEndpoint,\n\t\t\t\tstorageUrl: `${this.tinyliciousEndpoint}/repos/tinylicious`,\n\t\t\t},\n\t\t\tid: finalDocumentId,\n\t\t\ttokens: {},\n\t\t\ttype: \"fluid\",\n\t\t\turl: documentUrl,\n\t\t};\n\t}\n\n\tpublic async getAbsoluteUrl(resolvedUrl: IResolvedUrl, relativeUrl: string): Promise<string> {\n\t\tconst documentId = decodeURIComponent(\n\t\t\tresolvedUrl.url.replace(`${this.fluidProtocolEndpoint}/tinylicious/`, \"\"),\n\t\t);\n\t\t/*\n\t\t * The detached container flow will ultimately call getAbsoluteUrl() with the resolved.url produced by\n\t\t * resolve(). The container expects getAbsoluteUrl's return value to be a URL that can then be roundtripped\n\t\t * back through resolve() again, and get the same result again. So we'll return a \"URL\" with the same format\n\t\t * described above.\n\t\t */\n\t\treturn `${documentId}/${relativeUrl}`;\n\t}\n}\n\n/**\n * Creates a Routerlicious {@link @fluidframework/core-interfaces#IRequest}.\n * @internal\n */\nexport const createTinyliciousCreateNewRequest = (documentId?: string): IRequest => ({\n\turl: documentId ?? \"\",\n\theaders: {\n\t\t[DriverHeader.createNew]: true,\n\t},\n});\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EAAE,gCAAgC,EAAE;OACpC,EACN,iCAAiC,EACjC,0BAA0B,EAC1B,sBAAsB,EACtB,8BAA8B,GAC9B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"insecureTinyliciousTokenProvider.d.ts","sourceRoot":"","sources":["../src/insecureTinyliciousTokenProvider.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EAAE,SAAS,EAAgB,MAAM,sCAAsC;OACvE,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sCAAsC;AAIrF;;;;GAIG;AACH,qBAAa,gCAAiC,YAAW,cAAc;IAErE;;;;;;;OAOG;IACH,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC;;IARxB;;;;;;;OAOG;IACc,MAAM,CAAC,yBAAa;IAGzB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAOjF,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAO7F,OAAO,CAAC,cAAc;CAkCtB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"insecureTinyliciousUrlResolver.d.ts","sourceRoot":"","sources":["../src/insecureTinyliciousUrlResolver.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EAAE,QAAQ,EAAE,MAAM,iCAAiC;OACnD,EAAgB,YAAY,EAAE,YAAY,EAAE,MAAM,oCAAoC;AAE7F;;;GAGG;AACH,eAAO,MAAM,sBAAsB,OAAO,CAAC;AAE3C;;;GAGG;AACH,eAAO,MAAM,0BAA0B,qBAAqB,CAAC;AAE7D;;;;;;GAMG;AACH,qBAAa,8BAA+B,YAAW,YAAY;IAClE,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAAS;IAC/C,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAS;gBAC1B,IAAI,SAAyB,EAAE,QAAQ,SAA6B;IAK1E,OAAO,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,YAAY,CAAC;IAuCjD,cAAc,CAAC,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAY5F;AAED;;;GAGG;AACH,eAAO,MAAM,iCAAiC,gBAAiB,MAAM,KAAG,QAKtE,CAAC"}
@@ -1,4 +0,0 @@
1
- {
2
- "targets": [{ "extname": ".cjs", "module": "CommonJS", "moduleResolution": "Node10" }],
3
- "projects": ["./tsconfig.json", "./src/test/tsconfig.json"]
4
- }