@fluidframework/tinylicious-driver 2.0.0-dev-rc.3.0.0.250606 → 2.0.0-dev-rc.3.0.0.253463

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.
@@ -5,10 +5,10 @@
5
5
  ```ts
6
6
 
7
7
  import { IRequest } from '@fluidframework/core-interfaces';
8
- import { IResolvedUrl } from '@fluidframework/driver-definitions';
8
+ import { IResolvedUrl } from '@fluidframework/driver-definitions/internal';
9
9
  import { ITokenProvider } from '@fluidframework/routerlicious-driver';
10
10
  import { ITokenResponse } from '@fluidframework/routerlicious-driver';
11
- import { IUrlResolver } from '@fluidframework/driver-definitions';
11
+ import { IUrlResolver } from '@fluidframework/driver-definitions/internal';
12
12
  import { ScopeType } from '@fluidframework/protocol-definitions';
13
13
 
14
14
  // @internal
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import { IRequest } from "@fluidframework/core-interfaces";
6
- import { IResolvedUrl, IUrlResolver } from "@fluidframework/driver-definitions";
6
+ import { IResolvedUrl, IUrlResolver } from "@fluidframework/driver-definitions/internal";
7
7
  /**
8
8
  * Default endpoint port. Will be used by the service if the consumer does not specify a port.
9
9
  * @internal
@@ -1 +1 @@
1
- {"version":3,"file":"insecureTinyliciousUrlResolver.d.ts","sourceRoot":"","sources":["../src/insecureTinyliciousUrlResolver.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EAAgB,YAAY,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAE9F;;;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,mBAAmB,CAAS;gBAC1B,IAAI,SAAyB,EAAE,QAAQ,SAA6B;IAI1E,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
+ {"version":3,"file":"insecureTinyliciousUrlResolver.d.ts","sourceRoot":"","sources":["../src/insecureTinyliciousUrlResolver.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EAEN,YAAY,EACZ,YAAY,EACZ,MAAM,6CAA6C,CAAC;AAErD;;;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,mBAAmB,CAAS;gBAC1B,IAAI,SAAyB,EAAE,QAAQ,SAA6B;IAI1E,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"}
@@ -5,7 +5,7 @@
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.createTinyliciousCreateNewRequest = exports.InsecureTinyliciousUrlResolver = exports.defaultTinyliciousEndpoint = exports.defaultTinyliciousPort = void 0;
8
- const driver_definitions_1 = require("@fluidframework/driver-definitions");
8
+ const internal_1 = require("@fluidframework/driver-definitions/internal");
9
9
  /**
10
10
  * Default endpoint port. Will be used by the service if the consumer does not specify a port.
11
11
  * @internal
@@ -34,7 +34,7 @@ class InsecureTinyliciousUrlResolver {
34
34
  let documentUrl;
35
35
  let finalDocumentId = documentIdFromRequest;
36
36
  // Special handling if the request is to create a new container
37
- if (request.headers && request.headers[driver_definitions_1.DriverHeader.createNew] === true) {
37
+ if (request.headers && request.headers[internal_1.DriverHeader.createNew] === true) {
38
38
  // Use the document ID passed by the application via the create request;
39
39
  // if none was passed, use the reserved keyword to let the driver generate the ID.
40
40
  // TODO: deprecate this capability for tinylicious as the r11s driver will stop using the document ID
@@ -82,7 +82,7 @@ exports.InsecureTinyliciousUrlResolver = InsecureTinyliciousUrlResolver;
82
82
  const createTinyliciousCreateNewRequest = (documentId) => ({
83
83
  url: documentId ?? "",
84
84
  headers: {
85
- [driver_definitions_1.DriverHeader.createNew]: true,
85
+ [internal_1.DriverHeader.createNew]: true,
86
86
  },
87
87
  });
88
88
  exports.createTinyliciousCreateNewRequest = createTinyliciousCreateNewRequest;
@@ -1 +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;IAE1C,YAAmB,IAAI,GAAG,8BAAsB,EAAE,QAAQ,GAAG,kCAA0B;QACtF,IAAI,CAAC,mBAAmB,GAAG,GAAG,QAAQ,IAAI,IAAI,EAAE,CAAC;IAClD,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,MAA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,GAAG,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,mBAAmB,eAAe,EAAE,EAAE,CAAC,CACvE,CAAC;QACF;;;;;WAKG;QACH,OAAO,GAAG,UAAU,IAAI,WAAW,EAAE,CAAC;IACvC,CAAC;CACD;AAzDD,wEAyDC;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 tinyliciousEndpoint: string;\n\tpublic constructor(port = defaultTinyliciousPort, endpoint = defaultTinyliciousEndpoint) {\n\t\tthis.tinyliciousEndpoint = `${endpoint}:${port}`;\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.tinyliciousEndpoint}/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.tinyliciousEndpoint}/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.tinyliciousEndpoint}/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
+ {"version":3,"file":"insecureTinyliciousUrlResolver.js","sourceRoot":"","sources":["../src/insecureTinyliciousUrlResolver.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,0EAIqD;AAErD;;;GAGG;AACU,QAAA,sBAAsB,GAAG,IAAI,CAAC;AAE3C;;;GAGG;AACU,QAAA,0BAA0B,GAAG,kBAAkB,CAAC;AAE7D;;;;;;GAMG;AACH,MAAa,8BAA8B;IAE1C,YAAmB,IAAI,GAAG,8BAAsB,EAAE,QAAQ,GAAG,kCAA0B;QACtF,IAAI,CAAC,mBAAmB,GAAG,GAAG,QAAQ,IAAI,IAAI,EAAE,CAAC;IAClD,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,uBAAY,CAAC,SAAS,CAAC,KAAK,IAAI,EAAE;YACxE,wEAAwE;YACxE,kFAAkF;YAClF,qGAAqG;YACrG,sBAAsB;YACtB,IAAI,eAAe,KA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B;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 {\n\tDriverHeader,\n\tIResolvedUrl,\n\tIUrlResolver,\n} from \"@fluidframework/driver-definitions/internal\";\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 tinyliciousEndpoint: string;\n\tpublic constructor(port = defaultTinyliciousPort, endpoint = defaultTinyliciousEndpoint) {\n\t\tthis.tinyliciousEndpoint = `${endpoint}:${port}`;\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.tinyliciousEndpoint}/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.tinyliciousEndpoint}/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.tinyliciousEndpoint}/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,8 +1,8 @@
1
1
  import { IRequest } from '@fluidframework/core-interfaces';
2
- import { IResolvedUrl } from '@fluidframework/driver-definitions';
2
+ import { IResolvedUrl } from '@fluidframework/driver-definitions/internal';
3
3
  import { ITokenProvider } from '@fluidframework/routerlicious-driver';
4
4
  import { ITokenResponse } from '@fluidframework/routerlicious-driver';
5
- import { IUrlResolver } from '@fluidframework/driver-definitions';
5
+ import { IUrlResolver } from '@fluidframework/driver-definitions/internal';
6
6
  import { ScopeType } from '@fluidframework/protocol-definitions';
7
7
 
8
8
  /* Excluded from this release type: createTinyliciousCreateNewRequest */
@@ -1,8 +1,8 @@
1
1
  import { IRequest } from '@fluidframework/core-interfaces';
2
- import { IResolvedUrl } from '@fluidframework/driver-definitions';
2
+ import { IResolvedUrl } from '@fluidframework/driver-definitions/internal';
3
3
  import { ITokenProvider } from '@fluidframework/routerlicious-driver';
4
4
  import { ITokenResponse } from '@fluidframework/routerlicious-driver';
5
- import { IUrlResolver } from '@fluidframework/driver-definitions';
5
+ import { IUrlResolver } from '@fluidframework/driver-definitions/internal';
6
6
  import { ScopeType } from '@fluidframework/protocol-definitions';
7
7
 
8
8
  /* Excluded from this release type: createTinyliciousCreateNewRequest */
@@ -1,8 +1,8 @@
1
1
  import { IRequest } from '@fluidframework/core-interfaces';
2
- import { IResolvedUrl } from '@fluidframework/driver-definitions';
2
+ import { IResolvedUrl } from '@fluidframework/driver-definitions/internal';
3
3
  import { ITokenProvider } from '@fluidframework/routerlicious-driver';
4
4
  import { ITokenResponse } from '@fluidframework/routerlicious-driver';
5
- import { IUrlResolver } from '@fluidframework/driver-definitions';
5
+ import { IUrlResolver } from '@fluidframework/driver-definitions/internal';
6
6
  import { ScopeType } from '@fluidframework/protocol-definitions';
7
7
 
8
8
  /* Excluded from this release type: createTinyliciousCreateNewRequest */
@@ -1,8 +1,8 @@
1
1
  import { IRequest } from '@fluidframework/core-interfaces';
2
- import { IResolvedUrl } from '@fluidframework/driver-definitions';
2
+ import { IResolvedUrl } from '@fluidframework/driver-definitions/internal';
3
3
  import { ITokenProvider } from '@fluidframework/routerlicious-driver';
4
4
  import { ITokenResponse } from '@fluidframework/routerlicious-driver';
5
- import { IUrlResolver } from '@fluidframework/driver-definitions';
5
+ import { IUrlResolver } from '@fluidframework/driver-definitions/internal';
6
6
  import { ScopeType } from '@fluidframework/protocol-definitions';
7
7
 
8
8
  /**
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import { IRequest } from "@fluidframework/core-interfaces";
6
- import { IResolvedUrl, IUrlResolver } from "@fluidframework/driver-definitions";
6
+ import { IResolvedUrl, IUrlResolver } from "@fluidframework/driver-definitions/internal";
7
7
  /**
8
8
  * Default endpoint port. Will be used by the service if the consumer does not specify a port.
9
9
  * @internal
@@ -1 +1 @@
1
- {"version":3,"file":"insecureTinyliciousUrlResolver.d.ts","sourceRoot":"","sources":["../src/insecureTinyliciousUrlResolver.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EAAgB,YAAY,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAE9F;;;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,mBAAmB,CAAS;gBAC1B,IAAI,SAAyB,EAAE,QAAQ,SAA6B;IAI1E,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
+ {"version":3,"file":"insecureTinyliciousUrlResolver.d.ts","sourceRoot":"","sources":["../src/insecureTinyliciousUrlResolver.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EAEN,YAAY,EACZ,YAAY,EACZ,MAAM,6CAA6C,CAAC;AAErD;;;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,mBAAmB,CAAS;gBAC1B,IAAI,SAAyB,EAAE,QAAQ,SAA6B;IAI1E,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"}
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { DriverHeader } from "@fluidframework/driver-definitions";
5
+ import { DriverHeader, } from "@fluidframework/driver-definitions/internal";
6
6
  /**
7
7
  * Default endpoint port. Will be used by the service if the consumer does not specify a port.
8
8
  * @internal
@@ -1 +1 @@
1
- {"version":3,"file":"insecureTinyliciousUrlResolver.js","sourceRoot":"","sources":["../src/insecureTinyliciousUrlResolver.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,YAAY,EAA8B,MAAM,oCAAoC,CAAC;AAE9F;;;GAGG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,CAAC;AAE3C;;;GAGG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,kBAAkB,CAAC;AAE7D;;;;;;GAMG;AACH,MAAM,OAAO,8BAA8B;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AAU,EAAE,IAAI,CAAC,mBAAmB;gBACpC,UAAU,EAAE,GAAG,IAAI,CAAC,mBAAmB,oBAAoB;aAC3D;YACD,EAAE,EAAE,eAAe;YACnB,MAAM,EAAE,EAAE;YACV,IAAI,EAAE,OAAO;YACb,GAAG,EAAE,WAAW;SAChB,CAAC;IACH,CAAC;IAEM,KAAK,CAAC,cAAc,CAAC,WAAyB,EAAE,WAAmB;QACzE,MAAM,UAAU,GAAG,kBAAkB,CACpC,WAAW,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,mBAAmB,eAAe,EAAE,EAAE,CAAC,CACvE,CAAC;QACF;;;;;WAKG;QACH,OAAO,GAAG,UAAU,IAAI,WAAW,EAAE,CAAC;IACvC,CAAC;CACD;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC,UAAmB,EAAY,EAAE,CAAC,CAAC;IACpF,GAAG,EAAE,UAAU,IAAI,EAAE;IACrB,OAAO,EAAE;QACR,CAAC,YAAY,CAAC,SAAS,CAAC,EAAE,IAAI;KAC9B;CACD,CAAC,CAAC","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 tinyliciousEndpoint: string;\n\tpublic constructor(port = defaultTinyliciousPort, endpoint = defaultTinyliciousEndpoint) {\n\t\tthis.tinyliciousEndpoint = `${endpoint}:${port}`;\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.tinyliciousEndpoint}/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.tinyliciousEndpoint}/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.tinyliciousEndpoint}/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
+ {"version":3,"file":"insecureTinyliciousUrlResolver.js","sourceRoot":"","sources":["../src/insecureTinyliciousUrlResolver.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACN,YAAY,GAGZ,MAAM,6CAA6C,CAAC;AAErD;;;GAGG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,CAAC;AAE3C;;;GAGG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,kBAAkB,CAAC;AAE7D;;;;;;GAMG;AACH,MAAM,OAAO,8BAA8B;IAE1C,YAAmB,IAAI,GAAG,sBAAsB,EAAE,QAAQ,GAAG,0BAA0B;QACtF,IAAI,CAAC,mBAAmB,GAAG,GAAG,QAAQ,IAAI,IAAI,EAAE,CAAC;IAClD,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,CAA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AG,IAAI,CAAC,mBAAmB,eAAe,EAAE,EAAE,CAAC,CACvE,CAAC;QACF;;;;;WAKG;QACH,OAAO,GAAG,UAAU,IAAI,WAAW,EAAE,CAAC;IACvC,CAAC;CACD;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC,UAAmB,EAAY,EAAE,CAAC,CAAC;IACpF,GAAG,EAAE,UAAU,IAAI,EAAE;IACrB,OAAO,EAAE;QACR,CAAC,YAAY,CAAC,SAAS,CAAC,EAAE,IAAI;KAC9B;CACD,CAAC,CAAC","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 {\n\tDriverHeader,\n\tIResolvedUrl,\n\tIUrlResolver,\n} from \"@fluidframework/driver-definitions/internal\";\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 tinyliciousEndpoint: string;\n\tpublic constructor(port = defaultTinyliciousPort, endpoint = defaultTinyliciousEndpoint) {\n\t\tthis.tinyliciousEndpoint = `${endpoint}:${port}`;\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.tinyliciousEndpoint}/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.tinyliciousEndpoint}/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.tinyliciousEndpoint}/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,8 +1,8 @@
1
1
  import { IRequest } from '@fluidframework/core-interfaces';
2
- import { IResolvedUrl } from '@fluidframework/driver-definitions';
2
+ import { IResolvedUrl } from '@fluidframework/driver-definitions/internal';
3
3
  import { ITokenProvider } from '@fluidframework/routerlicious-driver';
4
4
  import { ITokenResponse } from '@fluidframework/routerlicious-driver';
5
- import { IUrlResolver } from '@fluidframework/driver-definitions';
5
+ import { IUrlResolver } from '@fluidframework/driver-definitions/internal';
6
6
  import { ScopeType } from '@fluidframework/protocol-definitions';
7
7
 
8
8
  /* Excluded from this release type: createTinyliciousCreateNewRequest */
@@ -1,8 +1,8 @@
1
1
  import { IRequest } from '@fluidframework/core-interfaces';
2
- import { IResolvedUrl } from '@fluidframework/driver-definitions';
2
+ import { IResolvedUrl } from '@fluidframework/driver-definitions/internal';
3
3
  import { ITokenProvider } from '@fluidframework/routerlicious-driver';
4
4
  import { ITokenResponse } from '@fluidframework/routerlicious-driver';
5
- import { IUrlResolver } from '@fluidframework/driver-definitions';
5
+ import { IUrlResolver } from '@fluidframework/driver-definitions/internal';
6
6
  import { ScopeType } from '@fluidframework/protocol-definitions';
7
7
 
8
8
  /* Excluded from this release type: createTinyliciousCreateNewRequest */
@@ -1,8 +1,8 @@
1
1
  import { IRequest } from '@fluidframework/core-interfaces';
2
- import { IResolvedUrl } from '@fluidframework/driver-definitions';
2
+ import { IResolvedUrl } from '@fluidframework/driver-definitions/internal';
3
3
  import { ITokenProvider } from '@fluidframework/routerlicious-driver';
4
4
  import { ITokenResponse } from '@fluidframework/routerlicious-driver';
5
- import { IUrlResolver } from '@fluidframework/driver-definitions';
5
+ import { IUrlResolver } from '@fluidframework/driver-definitions/internal';
6
6
  import { ScopeType } from '@fluidframework/protocol-definitions';
7
7
 
8
8
  /* Excluded from this release type: createTinyliciousCreateNewRequest */
@@ -1,8 +1,8 @@
1
1
  import { IRequest } from '@fluidframework/core-interfaces';
2
- import { IResolvedUrl } from '@fluidframework/driver-definitions';
2
+ import { IResolvedUrl } from '@fluidframework/driver-definitions/internal';
3
3
  import { ITokenProvider } from '@fluidframework/routerlicious-driver';
4
4
  import { ITokenResponse } from '@fluidframework/routerlicious-driver';
5
- import { IUrlResolver } from '@fluidframework/driver-definitions';
5
+ import { IUrlResolver } from '@fluidframework/driver-definitions/internal';
6
6
  import { ScopeType } from '@fluidframework/protocol-definitions';
7
7
 
8
8
  /**
@@ -0,0 +1,11 @@
1
+ // This file is read by tools that parse documentation comments conforming to the TSDoc standard.
2
+ // It should be published with your NPM package. It should not be tracked by Git.
3
+ {
4
+ "tsdocVersion": "0.12",
5
+ "toolPackages": [
6
+ {
7
+ "packageName": "@microsoft/api-extractor",
8
+ "packageVersion": "7.42.3"
9
+ }
10
+ ]
11
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/tinylicious-driver",
3
- "version": "2.0.0-dev-rc.3.0.0.250606",
3
+ "version": "2.0.0-dev-rc.3.0.0.253463",
4
4
  "description": "Driver for tinylicious",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -13,16 +13,6 @@
13
13
  "type": "module",
14
14
  "exports": {
15
15
  ".": {
16
- "import": {
17
- "types": "./lib/index.d.ts",
18
- "default": "./lib/index.js"
19
- },
20
- "require": {
21
- "types": "./dist/index.d.ts",
22
- "default": "./dist/index.js"
23
- }
24
- },
25
- "./public": {
26
16
  "import": {
27
17
  "types": "./lib/tinylicious-driver-public.d.ts",
28
18
  "default": "./lib/index.js"
@@ -46,18 +36,18 @@
46
36
  "main": "dist/index.js",
47
37
  "types": "dist/index.d.ts",
48
38
  "dependencies": {
49
- "@fluidframework/core-interfaces": "2.0.0-dev-rc.3.0.0.250606",
50
- "@fluidframework/driver-definitions": "2.0.0-dev-rc.3.0.0.250606",
51
- "@fluidframework/driver-utils": "2.0.0-dev-rc.3.0.0.250606",
39
+ "@fluidframework/core-interfaces": "2.0.0-dev-rc.3.0.0.253463",
40
+ "@fluidframework/driver-definitions": "2.0.0-dev-rc.3.0.0.253463",
41
+ "@fluidframework/driver-utils": "2.0.0-dev-rc.3.0.0.253463",
52
42
  "@fluidframework/protocol-definitions": "^3.2.0",
53
- "@fluidframework/routerlicious-driver": "2.0.0-dev-rc.3.0.0.250606",
43
+ "@fluidframework/routerlicious-driver": "2.0.0-dev-rc.3.0.0.253463",
54
44
  "jsrsasign": "^11.0.0",
55
45
  "uuid": "^9.0.0"
56
46
  },
57
47
  "devDependencies": {
58
- "@arethetypeswrong/cli": "^0.13.3",
48
+ "@arethetypeswrong/cli": "^0.15.2",
59
49
  "@biomejs/biome": "^1.6.2",
60
- "@fluid-internal/mocha-test-setup": "2.0.0-dev-rc.3.0.0.250606",
50
+ "@fluid-internal/mocha-test-setup": "2.0.0-dev-rc.3.0.0.253463",
61
51
  "@fluid-tools/build-cli": "^0.34.0",
62
52
  "@fluidframework/build-common": "^2.0.3",
63
53
  "@fluidframework/build-tools": "^0.34.0",
@@ -104,7 +94,6 @@
104
94
  "build:test:cjs": "fluid-tsc commonjs --project ./src/test/tsconfig.cjs.json",
105
95
  "build:test:esm": "tsc --project ./src/test/tsconfig.json",
106
96
  "check:are-the-types-wrong": "attw --pack . --entrypoints .",
107
- "check:biome": "biome check .",
108
97
  "check:prettier": "prettier --check . --cache --ignore-path ../../../.prettierignore",
109
98
  "check:release-tags": "api-extractor run --local --config ./api-extractor-lint.json",
110
99
  "ci:build:docs": "api-extractor run",
@@ -112,7 +101,6 @@
112
101
  "eslint": "eslint --format stylish src",
113
102
  "eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
114
103
  "format": "fluid-build --task format .",
115
- "format:biome": "biome check --apply .",
116
104
  "format:prettier": "prettier --write . --cache --ignore-path ../../../.prettierignore",
117
105
  "lint": "fluid-build . --task lint",
118
106
  "lint:fix": "fluid-build . --task eslint:fix --task format",
@@ -4,7 +4,11 @@
4
4
  */
5
5
 
6
6
  import { IRequest } from "@fluidframework/core-interfaces";
7
- import { DriverHeader, IResolvedUrl, IUrlResolver } from "@fluidframework/driver-definitions";
7
+ import {
8
+ DriverHeader,
9
+ IResolvedUrl,
10
+ IUrlResolver,
11
+ } from "@fluidframework/driver-definitions/internal";
8
12
 
9
13
  /**
10
14
  * Default endpoint port. Will be used by the service if the consumer does not specify a port.
@@ -1,117 +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 "node:assert";
6
- import { DriverHeader } from "@fluidframework/driver-definitions";
7
- import { InsecureTinyliciousUrlResolver } from "../insecureTinyliciousUrlResolver.js";
8
- describe("Insecure Url Resolver Test", () => {
9
- const documentId = "fileName";
10
- const hostUrl = "http://localhost:7070";
11
- const tinyliciousEndpoint = "http://localhost:7070";
12
- let resolver;
13
- beforeEach(() => {
14
- resolver = new InsecureTinyliciousUrlResolver();
15
- });
16
- it("Should resolve url with only document id", async () => {
17
- const testRequest = {
18
- url: `${documentId}`,
19
- headers: {},
20
- };
21
- const resolvedUrl = await resolver.resolve(testRequest);
22
- const expectedResolvedUrl = `${hostUrl}/tinylicious/${documentId}`;
23
- assert.strictEqual(resolvedUrl.url, expectedResolvedUrl, "resolved url is wrong");
24
- });
25
- it("Should resolve url with custom domain and port", async () => {
26
- const customEndpoint = "http://custom-endpoint.io";
27
- const customFluidEndpoint = "http://custom-endpoint.io";
28
- const customPort = 1234;
29
- const customResolver = new InsecureTinyliciousUrlResolver(customPort, customEndpoint);
30
- const testRequest = {
31
- url: `${documentId}`,
32
- headers: {},
33
- };
34
- const resolvedUrl = await customResolver.resolve(testRequest);
35
- const expectedResolvedUrl = `${customFluidEndpoint}:${customPort}/tinylicious/${documentId}`;
36
- assert.strictEqual(resolvedUrl.url, expectedResolvedUrl, "resolved url is wrong");
37
- });
38
- it("Should resolve url with data object ids", async () => {
39
- const path = "dataObject1/dataObject2";
40
- const testRequest = {
41
- url: `${documentId}/${path}`,
42
- };
43
- const resolvedUrl = await resolver.resolve(testRequest);
44
- const expectedResolvedUrl = `${hostUrl}/tinylicious/${documentId}/${path}`;
45
- assert.strictEqual(resolvedUrl.url, expectedResolvedUrl, "resolved url is wrong");
46
- });
47
- it("Should resolve url with a slash at the end", async () => {
48
- const testRequest = {
49
- url: `${documentId}/`,
50
- };
51
- const resolvedUrl = await resolver.resolve(testRequest);
52
- const expectedResolvedUrl = `${hostUrl}/tinylicious/${documentId}/`;
53
- assert.strictEqual(resolvedUrl.url, expectedResolvedUrl, "resolved url is wrong");
54
- });
55
- it("Should resolve url with 2 slashes at the end", async () => {
56
- const testRequest = {
57
- url: `${documentId}//`,
58
- };
59
- const resolvedUrl = await resolver.resolve(testRequest);
60
- const expectedResolvedUrl = `${hostUrl}/tinylicious/${documentId}//`;
61
- assert.strictEqual(resolvedUrl.url, expectedResolvedUrl, "resolved url is wrong");
62
- });
63
- it("Should resolve url with special characters", async () => {
64
- const path = "dataObject!@$";
65
- const testDocumentId = "fileName!@$";
66
- const testRequest = {
67
- url: `${testDocumentId}/${path}`,
68
- };
69
- const resolvedUrl = await resolver.resolve(testRequest);
70
- const expectedResolvedUrl = `${hostUrl}/tinylicious/${encodeURIComponent(testDocumentId)}/${path}`;
71
- assert.strictEqual(resolvedUrl.url, expectedResolvedUrl, "resolved url is wrong");
72
- });
73
- it("Should correctly resolve url for a create-new request with a non-empty URL", async () => {
74
- const testDocumentId = "fileName!@$";
75
- const testRequest = {
76
- url: `${testDocumentId}`,
77
- headers: {
78
- [DriverHeader.createNew]: true,
79
- },
80
- };
81
- const resolvedUrl = await resolver.resolve(testRequest);
82
- const expectedResolvedUrl = {
83
- endpoints: {
84
- deltaStorageUrl: `${tinyliciousEndpoint}/deltas/tinylicious/${testDocumentId}`,
85
- ordererUrl: tinyliciousEndpoint,
86
- storageUrl: `${tinyliciousEndpoint}/repos/tinylicious`,
87
- },
88
- id: testDocumentId,
89
- tokens: {},
90
- type: "fluid",
91
- url: `${hostUrl}/tinylicious/${testDocumentId}`,
92
- };
93
- assert.deepStrictEqual(resolvedUrl, expectedResolvedUrl);
94
- });
95
- it("Should correctly resolve url for a create-new request with an empty URL", async () => {
96
- const testRequest = {
97
- url: "",
98
- headers: {
99
- [DriverHeader.createNew]: true,
100
- },
101
- };
102
- const resolvedUrl = await resolver.resolve(testRequest);
103
- const expectedResolvedUrl = {
104
- endpoints: {
105
- deltaStorageUrl: `${tinyliciousEndpoint}/deltas/tinylicious/new`,
106
- ordererUrl: tinyliciousEndpoint,
107
- storageUrl: `${tinyliciousEndpoint}/repos/tinylicious`,
108
- },
109
- id: "new",
110
- tokens: {},
111
- type: "fluid",
112
- url: `${hostUrl}/tinylicious/new`,
113
- };
114
- assert.deepStrictEqual(resolvedUrl, expectedResolvedUrl);
115
- });
116
- });
117
- //# sourceMappingURL=insecureTinyliciousUrlResolverTest.spec.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"insecureTinyliciousUrlResolverTest.spec.js","sourceRoot":"","sources":["../../src/test/insecureTinyliciousUrlResolverTest.spec.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAClE,OAAO,EAAE,8BAA8B,EAAE,MAAM,sCAAsC,CAAC;AAEtF,QAAQ,CAAC,4BAA4B,EAAE,GAAG,EAAE;IAC3C,MAAM,UAAU,GAAG,UAAU,CAAC;IAC9B,MAAM,OAAO,GAAG,uBAAuB,CAAC;IACxC,MAAM,mBAAmB,GAAG,uBAAuB,CAAC;IACpD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QAEF,MAAM,WAAW,GAAG,MAAM,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;QAExD,MAAM,mBAAmB,GAAG;YAC3B,SAAS,EAAE;gBACV,eAAe,EAAE,GAAG,mBAAmB,yBAAyB;gBAChE,UAAU,EAAE,mBAAmB;gBAC/B,UAAU,EAAE,GAAG,mBAAmB,oBAAoB;aACtD;YACD,EAAE,EAAE,KAAK;YACT,MAAM,EAAE,EAAE;YACV,IAAI,EAAE,OAAO;YACb,GAAG,EAAE,GAAG,OAAO,kBAAkB;SACjC,CAAC;QACF,MAAM,CAAC,eAAe,CAAC,WAAW,EAAE,mBAAmB,CAAC,CAAC;IAC1D,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 \"node:assert\";\nimport { IRequest } from \"@fluidframework/core-interfaces\";\nimport { DriverHeader } from \"@fluidframework/driver-definitions\";\nimport { InsecureTinyliciousUrlResolver } from \"../insecureTinyliciousUrlResolver.js\";\n\ndescribe(\"Insecure Url Resolver Test\", () => {\n\tconst documentId = \"fileName\";\n\tconst hostUrl = \"http://localhost:7070\";\n\tconst tinyliciousEndpoint = \"http://localhost:7070\";\n\tlet resolver: InsecureTinyliciousUrlResolver;\n\n\tbeforeEach(() => {\n\t\tresolver = new InsecureTinyliciousUrlResolver();\n\t});\n\n\tit(\"Should resolve url with only document id\", async () => {\n\t\tconst testRequest: IRequest = {\n\t\t\turl: `${documentId}`,\n\t\t\theaders: {},\n\t\t};\n\n\t\tconst resolvedUrl = await resolver.resolve(testRequest);\n\n\t\tconst expectedResolvedUrl = `${hostUrl}/tinylicious/${documentId}`;\n\t\tassert.strictEqual(resolvedUrl.url, expectedResolvedUrl, \"resolved url is wrong\");\n\t});\n\n\tit(\"Should resolve url with custom domain and port\", async () => {\n\t\tconst customEndpoint = \"http://custom-endpoint.io\";\n\t\tconst customFluidEndpoint = \"http://custom-endpoint.io\";\n\t\tconst customPort = 1234;\n\t\tconst customResolver = new InsecureTinyliciousUrlResolver(customPort, customEndpoint);\n\t\tconst testRequest: IRequest = {\n\t\t\turl: `${documentId}`,\n\t\t\theaders: {},\n\t\t};\n\n\t\tconst resolvedUrl = await customResolver.resolve(testRequest);\n\n\t\tconst expectedResolvedUrl = `${customFluidEndpoint}:${customPort}/tinylicious/${documentId}`;\n\t\tassert.strictEqual(resolvedUrl.url, expectedResolvedUrl, \"resolved url is wrong\");\n\t});\n\n\tit(\"Should resolve url with data object ids\", async () => {\n\t\tconst path = \"dataObject1/dataObject2\";\n\t\tconst testRequest: IRequest = {\n\t\t\turl: `${documentId}/${path}`,\n\t\t};\n\n\t\tconst resolvedUrl = await resolver.resolve(testRequest);\n\n\t\tconst expectedResolvedUrl = `${hostUrl}/tinylicious/${documentId}/${path}`;\n\t\tassert.strictEqual(resolvedUrl.url, expectedResolvedUrl, \"resolved url is wrong\");\n\t});\n\n\tit(\"Should resolve url with a slash at the end\", async () => {\n\t\tconst testRequest: IRequest = {\n\t\t\turl: `${documentId}/`,\n\t\t};\n\n\t\tconst resolvedUrl = await resolver.resolve(testRequest);\n\n\t\tconst expectedResolvedUrl = `${hostUrl}/tinylicious/${documentId}/`;\n\t\tassert.strictEqual(resolvedUrl.url, expectedResolvedUrl, \"resolved url is wrong\");\n\t});\n\n\tit(\"Should resolve url with 2 slashes at the end\", async () => {\n\t\tconst testRequest: IRequest = {\n\t\t\turl: `${documentId}//`,\n\t\t};\n\n\t\tconst resolvedUrl = await resolver.resolve(testRequest);\n\n\t\tconst expectedResolvedUrl = `${hostUrl}/tinylicious/${documentId}//`;\n\t\tassert.strictEqual(resolvedUrl.url, expectedResolvedUrl, \"resolved url is wrong\");\n\t});\n\n\tit(\"Should resolve url with special characters\", async () => {\n\t\tconst path = \"dataObject!@$\";\n\t\tconst testDocumentId = \"fileName!@$\";\n\t\tconst testRequest: IRequest = {\n\t\t\turl: `${testDocumentId}/${path}`,\n\t\t};\n\n\t\tconst resolvedUrl = await resolver.resolve(testRequest);\n\n\t\tconst expectedResolvedUrl = `${hostUrl}/tinylicious/${encodeURIComponent(\n\t\t\ttestDocumentId,\n\t\t)}/${path}`;\n\t\tassert.strictEqual(resolvedUrl.url, expectedResolvedUrl, \"resolved url is wrong\");\n\t});\n\n\tit(\"Should correctly resolve url for a create-new request with a non-empty URL\", async () => {\n\t\tconst testDocumentId = \"fileName!@$\";\n\t\tconst testRequest: IRequest = {\n\t\t\turl: `${testDocumentId}`,\n\t\t\theaders: {\n\t\t\t\t[DriverHeader.createNew]: true,\n\t\t\t},\n\t\t};\n\n\t\tconst resolvedUrl = await resolver.resolve(testRequest);\n\n\t\tconst expectedResolvedUrl = {\n\t\t\tendpoints: {\n\t\t\t\tdeltaStorageUrl: `${tinyliciousEndpoint}/deltas/tinylicious/${testDocumentId}`,\n\t\t\t\tordererUrl: tinyliciousEndpoint,\n\t\t\t\tstorageUrl: `${tinyliciousEndpoint}/repos/tinylicious`,\n\t\t\t},\n\t\t\tid: testDocumentId,\n\t\t\ttokens: {},\n\t\t\ttype: \"fluid\",\n\t\t\turl: `${hostUrl}/tinylicious/${testDocumentId}`,\n\t\t};\n\t\tassert.deepStrictEqual(resolvedUrl, expectedResolvedUrl);\n\t});\n\n\tit(\"Should correctly resolve url for a create-new request with an empty URL\", async () => {\n\t\tconst testRequest: IRequest = {\n\t\t\turl: \"\",\n\t\t\theaders: {\n\t\t\t\t[DriverHeader.createNew]: true,\n\t\t\t},\n\t\t};\n\n\t\tconst resolvedUrl = await resolver.resolve(testRequest);\n\n\t\tconst expectedResolvedUrl = {\n\t\t\tendpoints: {\n\t\t\t\tdeltaStorageUrl: `${tinyliciousEndpoint}/deltas/tinylicious/new`,\n\t\t\t\tordererUrl: tinyliciousEndpoint,\n\t\t\t\tstorageUrl: `${tinyliciousEndpoint}/repos/tinylicious`,\n\t\t\t},\n\t\t\tid: \"new\",\n\t\t\ttokens: {},\n\t\t\ttype: \"fluid\",\n\t\t\turl: `${hostUrl}/tinylicious/new`,\n\t\t};\n\t\tassert.deepStrictEqual(resolvedUrl, expectedResolvedUrl);\n\t});\n});\n"]}
@@ -1,12 +0,0 @@
1
- use_current_ClassDeclaration_InsecureTinyliciousTokenProvider(get_old_ClassDeclaration_InsecureTinyliciousTokenProvider());
2
- use_old_ClassDeclaration_InsecureTinyliciousTokenProvider(get_current_ClassDeclaration_InsecureTinyliciousTokenProvider());
3
- use_current_ClassDeclaration_InsecureTinyliciousUrlResolver(get_old_ClassDeclaration_InsecureTinyliciousUrlResolver());
4
- use_old_ClassDeclaration_InsecureTinyliciousUrlResolver(get_current_ClassDeclaration_InsecureTinyliciousUrlResolver());
5
- use_current_VariableDeclaration_createTinyliciousCreateNewRequest(get_old_VariableDeclaration_createTinyliciousCreateNewRequest());
6
- use_old_VariableDeclaration_createTinyliciousCreateNewRequest(get_current_VariableDeclaration_createTinyliciousCreateNewRequest());
7
- use_current_VariableDeclaration_defaultTinyliciousEndpoint(get_old_VariableDeclaration_defaultTinyliciousEndpoint());
8
- use_old_VariableDeclaration_defaultTinyliciousEndpoint(get_current_VariableDeclaration_defaultTinyliciousEndpoint());
9
- use_current_VariableDeclaration_defaultTinyliciousPort(get_old_VariableDeclaration_defaultTinyliciousPort());
10
- use_old_VariableDeclaration_defaultTinyliciousPort(get_current_VariableDeclaration_defaultTinyliciousPort());
11
- export {};
12
- //# sourceMappingURL=validateTinyliciousDriverPrevious.generated.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"validateTinyliciousDriverPrevious.generated.js","sourceRoot":"","sources":["../../../src/test/types/validateTinyliciousDriverPrevious.generated.ts"],"names":[],"mappings":"AAgCA,6DAA6D,CACzD,yDAAyD,EAAE,CAAC,CAAC;AAWjE,yDAAyD,CACrD,6DAA6D,EAAE,CAAC,CAAC;AAWrE,2DAA2D,CACvD,uDAAuD,EAAE,CAAC,CAAC;AAW/D,uDAAuD,CACnD,2DAA2D,EAAE,CAAC,CAAC;AAWnE,iEAAiE,CAC7D,6DAA6D,EAAE,CAAC,CAAC;AAWrE,6DAA6D,CACzD,iEAAiE,EAAE,CAAC,CAAC;AAWzE,0DAA0D,CACtD,sDAAsD,EAAE,CAAC,CAAC;AAW9D,sDAAsD,CAClD,0DAA0D,EAAE,CAAC,CAAC;AAWlE,sDAAsD,CAClD,kDAAkD,EAAE,CAAC,CAAC;AAW1D,kDAAkD,CAC9C,sDAAsD,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/tinylicious-driver-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* \"ClassDeclaration_InsecureTinyliciousTokenProvider\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_InsecureTinyliciousTokenProvider():\n TypeOnly<old.InsecureTinyliciousTokenProvider>;\ndeclare function use_current_ClassDeclaration_InsecureTinyliciousTokenProvider(\n use: TypeOnly<current.InsecureTinyliciousTokenProvider>): void;\nuse_current_ClassDeclaration_InsecureTinyliciousTokenProvider(\n get_old_ClassDeclaration_InsecureTinyliciousTokenProvider());\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_InsecureTinyliciousTokenProvider\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_InsecureTinyliciousTokenProvider():\n TypeOnly<current.InsecureTinyliciousTokenProvider>;\ndeclare function use_old_ClassDeclaration_InsecureTinyliciousTokenProvider(\n use: TypeOnly<old.InsecureTinyliciousTokenProvider>): void;\nuse_old_ClassDeclaration_InsecureTinyliciousTokenProvider(\n get_current_ClassDeclaration_InsecureTinyliciousTokenProvider());\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_InsecureTinyliciousUrlResolver\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_InsecureTinyliciousUrlResolver():\n TypeOnly<old.InsecureTinyliciousUrlResolver>;\ndeclare function use_current_ClassDeclaration_InsecureTinyliciousUrlResolver(\n use: TypeOnly<current.InsecureTinyliciousUrlResolver>): void;\nuse_current_ClassDeclaration_InsecureTinyliciousUrlResolver(\n get_old_ClassDeclaration_InsecureTinyliciousUrlResolver());\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_InsecureTinyliciousUrlResolver\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_InsecureTinyliciousUrlResolver():\n TypeOnly<current.InsecureTinyliciousUrlResolver>;\ndeclare function use_old_ClassDeclaration_InsecureTinyliciousUrlResolver(\n use: TypeOnly<old.InsecureTinyliciousUrlResolver>): void;\nuse_old_ClassDeclaration_InsecureTinyliciousUrlResolver(\n get_current_ClassDeclaration_InsecureTinyliciousUrlResolver());\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_createTinyliciousCreateNewRequest\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_VariableDeclaration_createTinyliciousCreateNewRequest():\n TypeOnly<typeof old.createTinyliciousCreateNewRequest>;\ndeclare function use_current_VariableDeclaration_createTinyliciousCreateNewRequest(\n use: TypeOnly<typeof current.createTinyliciousCreateNewRequest>): void;\nuse_current_VariableDeclaration_createTinyliciousCreateNewRequest(\n get_old_VariableDeclaration_createTinyliciousCreateNewRequest());\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_createTinyliciousCreateNewRequest\": {\"backCompat\": false}\n*/\ndeclare function get_current_VariableDeclaration_createTinyliciousCreateNewRequest():\n TypeOnly<typeof current.createTinyliciousCreateNewRequest>;\ndeclare function use_old_VariableDeclaration_createTinyliciousCreateNewRequest(\n use: TypeOnly<typeof old.createTinyliciousCreateNewRequest>): void;\nuse_old_VariableDeclaration_createTinyliciousCreateNewRequest(\n get_current_VariableDeclaration_createTinyliciousCreateNewRequest());\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_defaultTinyliciousEndpoint\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_VariableDeclaration_defaultTinyliciousEndpoint():\n TypeOnly<typeof old.defaultTinyliciousEndpoint>;\ndeclare function use_current_VariableDeclaration_defaultTinyliciousEndpoint(\n use: TypeOnly<typeof current.defaultTinyliciousEndpoint>): void;\nuse_current_VariableDeclaration_defaultTinyliciousEndpoint(\n get_old_VariableDeclaration_defaultTinyliciousEndpoint());\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_defaultTinyliciousEndpoint\": {\"backCompat\": false}\n*/\ndeclare function get_current_VariableDeclaration_defaultTinyliciousEndpoint():\n TypeOnly<typeof current.defaultTinyliciousEndpoint>;\ndeclare function use_old_VariableDeclaration_defaultTinyliciousEndpoint(\n use: TypeOnly<typeof old.defaultTinyliciousEndpoint>): void;\nuse_old_VariableDeclaration_defaultTinyliciousEndpoint(\n get_current_VariableDeclaration_defaultTinyliciousEndpoint());\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_defaultTinyliciousPort\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_VariableDeclaration_defaultTinyliciousPort():\n TypeOnly<typeof old.defaultTinyliciousPort>;\ndeclare function use_current_VariableDeclaration_defaultTinyliciousPort(\n use: TypeOnly<typeof current.defaultTinyliciousPort>): void;\nuse_current_VariableDeclaration_defaultTinyliciousPort(\n get_old_VariableDeclaration_defaultTinyliciousPort());\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_defaultTinyliciousPort\": {\"backCompat\": false}\n*/\ndeclare function get_current_VariableDeclaration_defaultTinyliciousPort():\n TypeOnly<typeof current.defaultTinyliciousPort>;\ndeclare function use_old_VariableDeclaration_defaultTinyliciousPort(\n use: TypeOnly<typeof old.defaultTinyliciousPort>): void;\nuse_old_VariableDeclaration_defaultTinyliciousPort(\n get_current_VariableDeclaration_defaultTinyliciousPort());\n"]}