@fluidframework/tinylicious-driver 1.4.0-121020 → 2.0.0-dev-rc.1.0.0.224419

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 (60) hide show
  1. package/.eslintrc.js +8 -10
  2. package/.mocharc.js +12 -0
  3. package/CHANGELOG.md +117 -0
  4. package/README.md +69 -0
  5. package/api-extractor-lint.json +4 -0
  6. package/api-extractor.json +4 -0
  7. package/api-report/tinylicious-driver.api.md +44 -0
  8. package/dist/index.cjs +15 -0
  9. package/dist/index.cjs.map +1 -0
  10. package/dist/index.d.ts +2 -2
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/{insecureTinyliciousTokenProvider.js → insecureTinyliciousTokenProvider.cjs} +14 -13
  13. package/dist/insecureTinyliciousTokenProvider.cjs.map +1 -0
  14. package/dist/insecureTinyliciousTokenProvider.d.ts +3 -2
  15. package/dist/insecureTinyliciousTokenProvider.d.ts.map +1 -1
  16. package/dist/{insecureTinyliciousUrlResolver.js → insecureTinyliciousUrlResolver.cjs} +31 -33
  17. package/dist/insecureTinyliciousUrlResolver.cjs.map +1 -0
  18. package/dist/insecureTinyliciousUrlResolver.d.ts +10 -3
  19. package/dist/insecureTinyliciousUrlResolver.d.ts.map +1 -1
  20. package/dist/tinylicious-driver-alpha.d.ts +18 -0
  21. package/dist/tinylicious-driver-beta.d.ts +22 -0
  22. package/dist/tinylicious-driver-public.d.ts +22 -0
  23. package/dist/tinylicious-driver-untrimmed.d.ts +71 -0
  24. package/dist/tsdoc-metadata.json +11 -0
  25. package/lib/index.d.mts +7 -0
  26. package/lib/index.d.mts.map +1 -0
  27. package/lib/index.mjs +7 -0
  28. package/lib/index.mjs.map +1 -0
  29. package/lib/{insecureTinyliciousTokenProvider.d.ts → insecureTinyliciousTokenProvider.d.mts} +3 -2
  30. package/lib/insecureTinyliciousTokenProvider.d.mts.map +1 -0
  31. package/lib/{insecureTinyliciousTokenProvider.js → insecureTinyliciousTokenProvider.mjs} +14 -13
  32. package/lib/insecureTinyliciousTokenProvider.mjs.map +1 -0
  33. package/lib/{insecureTinyliciousUrlResolver.d.ts → insecureTinyliciousUrlResolver.d.mts} +10 -3
  34. package/lib/insecureTinyliciousUrlResolver.d.mts.map +1 -0
  35. package/lib/{insecureTinyliciousUrlResolver.js → insecureTinyliciousUrlResolver.mjs} +32 -34
  36. package/lib/insecureTinyliciousUrlResolver.mjs.map +1 -0
  37. package/lib/tinylicious-driver-alpha.d.mts +18 -0
  38. package/lib/tinylicious-driver-beta.d.mts +22 -0
  39. package/lib/tinylicious-driver-public.d.mts +22 -0
  40. package/lib/tinylicious-driver-untrimmed.d.mts +71 -0
  41. package/package.json +83 -44
  42. package/prettier.config.cjs +8 -0
  43. package/src/index.ts +7 -2
  44. package/src/insecureTinyliciousTokenProvider.ts +57 -64
  45. package/src/insecureTinyliciousUrlResolver.ts +68 -83
  46. package/tsc-multi.test.json +4 -0
  47. package/tsconfig.json +11 -13
  48. package/dist/index.js +0 -19
  49. package/dist/index.js.map +0 -1
  50. package/dist/insecureTinyliciousTokenProvider.js.map +0 -1
  51. package/dist/insecureTinyliciousUrlResolver.js.map +0 -1
  52. package/lib/index.d.ts +0 -7
  53. package/lib/index.d.ts.map +0 -1
  54. package/lib/index.js +0 -7
  55. package/lib/index.js.map +0 -1
  56. package/lib/insecureTinyliciousTokenProvider.d.ts.map +0 -1
  57. package/lib/insecureTinyliciousTokenProvider.js.map +0 -1
  58. package/lib/insecureTinyliciousUrlResolver.d.ts.map +0 -1
  59. package/lib/insecureTinyliciousUrlResolver.js.map +0 -1
  60. package/tsconfig.esnext.json +0 -7
@@ -0,0 +1,22 @@
1
+ import { IRequest } from '@fluidframework/core-interfaces';
2
+ import { IResolvedUrl } from '@fluidframework/driver-definitions';
3
+ import { ITokenProvider } from '@fluidframework/routerlicious-driver';
4
+ import { ITokenResponse } from '@fluidframework/routerlicious-driver';
5
+ import { IUrlResolver } from '@fluidframework/driver-definitions';
6
+ import { ScopeType } from '@fluidframework/protocol-definitions';
7
+
8
+ /* Excluded from this release type: createTinyliciousCreateNewRequest */
9
+
10
+ /* Excluded from this release type: defaultTinyliciousEndpoint */
11
+
12
+ /* Excluded from this release type: defaultTinyliciousPort */
13
+
14
+ /* Excluded from this release type: InsecureTinyliciousTokenProvider */
15
+
16
+ /* Excluded from this release type: InsecureTinyliciousUrlResolver */
17
+
18
+ /* Excluded from this release type: IResolvedUrl */
19
+
20
+ /* Excluded from this release type: IUrlResolver */
21
+
22
+ export { }
@@ -0,0 +1,71 @@
1
+ import { IRequest } from '@fluidframework/core-interfaces';
2
+ import { IResolvedUrl } from '@fluidframework/driver-definitions';
3
+ import { ITokenProvider } from '@fluidframework/routerlicious-driver';
4
+ import { ITokenResponse } from '@fluidframework/routerlicious-driver';
5
+ import { IUrlResolver } from '@fluidframework/driver-definitions';
6
+ import { ScopeType } from '@fluidframework/protocol-definitions';
7
+
8
+ /**
9
+ * Creates a Routerlicious {@link @fluidframework/core-interfaces#IRequest}.
10
+ * @internal
11
+ */
12
+ export declare const createTinyliciousCreateNewRequest: (documentId?: string) => IRequest;
13
+
14
+ /**
15
+ * Default endpoint URL base. Will be used by the service if the consumer does not specify an endpoint.
16
+ * @internal
17
+ */
18
+ export declare const defaultTinyliciousEndpoint = "http://localhost";
19
+
20
+ /**
21
+ * Default endpoint port. Will be used by the service if the consumer does not specify a port.
22
+ * @internal
23
+ */
24
+ export declare const defaultTinyliciousPort = 7070;
25
+
26
+ /**
27
+ * As the name implies this is not secure and should not be used in production. It simply makes the example easier
28
+ * to get up and running.
29
+ * @internal
30
+ */
31
+ export declare class InsecureTinyliciousTokenProvider implements ITokenProvider {
32
+ /**
33
+ * Optional. Override of scopes. If a param is not provided, InsecureTinyliciousTokenProvider
34
+ * will use the default scopes which are document read, write and summarizer write.
35
+ *
36
+ * @param scopes - See {@link @fluidframework/protocol-definitions#ITokenClaims.scopes}
37
+ *
38
+ * @defaultValue [ ScopeType.DocRead, ScopeType.DocWrite, ScopeType.SummaryWrite ]
39
+ */
40
+ private readonly scopes?;
41
+ constructor(
42
+ /**
43
+ * Optional. Override of scopes. If a param is not provided, InsecureTinyliciousTokenProvider
44
+ * will use the default scopes which are document read, write and summarizer write.
45
+ *
46
+ * @param scopes - See {@link @fluidframework/protocol-definitions#ITokenClaims.scopes}
47
+ *
48
+ * @defaultValue [ ScopeType.DocRead, ScopeType.DocWrite, ScopeType.SummaryWrite ]
49
+ */
50
+ scopes?: ScopeType[] | undefined);
51
+ fetchOrdererToken(tenantId: string, documentId?: string): Promise<ITokenResponse>;
52
+ fetchStorageToken(tenantId: string, documentId: string): Promise<ITokenResponse>;
53
+ private getSignedToken;
54
+ }
55
+
56
+ /**
57
+ * InsecureTinyliciousUrlResolver knows how to get the URLs to the service (in this case Tinylicious) to use
58
+ * for a given request. This particular implementation has a goal to avoid imposing requirements on the app's
59
+ * URL shape, so it expects the request url to have this format (as opposed to a more traditional URL):
60
+ * documentId/containerRelativePathing
61
+ * @internal
62
+ */
63
+ export declare class InsecureTinyliciousUrlResolver implements IUrlResolver {
64
+ private readonly fluidProtocolEndpoint;
65
+ private readonly tinyliciousEndpoint;
66
+ constructor(port?: number, endpoint?: string);
67
+ resolve(request: IRequest): Promise<IResolvedUrl>;
68
+ getAbsoluteUrl(resolvedUrl: IResolvedUrl, relativeUrl: string): Promise<string>;
69
+ }
70
+
71
+ export { }
@@ -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.38.3"
9
+ }
10
+ ]
11
+ }
@@ -0,0 +1,7 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ export { InsecureTinyliciousTokenProvider } from "./insecureTinyliciousTokenProvider.mjs";
6
+ export { createTinyliciousCreateNewRequest, defaultTinyliciousEndpoint, defaultTinyliciousPort, InsecureTinyliciousUrlResolver, } from "./insecureTinyliciousUrlResolver.mjs";
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
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"}
package/lib/index.mjs ADDED
@@ -0,0 +1,7 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ export { InsecureTinyliciousTokenProvider } from "./insecureTinyliciousTokenProvider.mjs";
6
+ export { createTinyliciousCreateNewRequest, defaultTinyliciousEndpoint, defaultTinyliciousPort, InsecureTinyliciousUrlResolver, } from "./insecureTinyliciousUrlResolver.mjs";
7
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EAAE,gCAAgC,EAAE;OACpC,EACN,iCAAiC,EACjC,0BAA0B,EAC1B,sBAAsB,EACtB,8BAA8B,GAC9B","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"]}
@@ -7,6 +7,7 @@ import { ITokenProvider, ITokenResponse } from "@fluidframework/routerlicious-dr
7
7
  /**
8
8
  * As the name implies this is not secure and should not be used in production. It simply makes the example easier
9
9
  * to get up and running.
10
+ * @internal
10
11
  */
11
12
  export declare class InsecureTinyliciousTokenProvider implements ITokenProvider {
12
13
  /**
@@ -15,7 +16,7 @@ export declare class InsecureTinyliciousTokenProvider implements ITokenProvider
15
16
  *
16
17
  * @param scopes - See {@link @fluidframework/protocol-definitions#ITokenClaims.scopes}
17
18
  *
18
- * @defaultValue - [ ScopeType.DocRead, ScopeType.DocWrite, ScopeType.SummaryWrite ]
19
+ * @defaultValue [ ScopeType.DocRead, ScopeType.DocWrite, ScopeType.SummaryWrite ]
19
20
  */
20
21
  private readonly scopes?;
21
22
  constructor(
@@ -25,7 +26,7 @@ export declare class InsecureTinyliciousTokenProvider implements ITokenProvider
25
26
  *
26
27
  * @param scopes - See {@link @fluidframework/protocol-definitions#ITokenClaims.scopes}
27
28
  *
28
- * @defaultValue - [ ScopeType.DocRead, ScopeType.DocWrite, ScopeType.SummaryWrite ]
29
+ * @defaultValue [ ScopeType.DocRead, ScopeType.DocWrite, ScopeType.SummaryWrite ]
29
30
  */
30
31
  scopes?: ScopeType[] | undefined);
31
32
  fetchOrdererToken(tenantId: string, documentId?: string): Promise<ITokenResponse>;
@@ -0,0 +1 @@
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"}
@@ -3,12 +3,12 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import { ScopeType } from "@fluidframework/protocol-definitions";
6
- import { getRandomName } from "@fluidframework/server-services-client";
7
6
  import { KJUR as jsrsasign } from "jsrsasign";
8
7
  import { v4 as uuid } from "uuid";
9
8
  /**
10
9
  * As the name implies this is not secure and should not be used in production. It simply makes the example easier
11
10
  * to get up and running.
11
+ * @internal
12
12
  */
13
13
  export class InsecureTinyliciousTokenProvider {
14
14
  constructor(
@@ -18,7 +18,7 @@ export class InsecureTinyliciousTokenProvider {
18
18
  *
19
19
  * @param scopes - See {@link @fluidframework/protocol-definitions#ITokenClaims.scopes}
20
20
  *
21
- * @defaultValue - [ ScopeType.DocRead, ScopeType.DocWrite, ScopeType.SummaryWrite ]
21
+ * @defaultValue [ ScopeType.DocRead, ScopeType.DocWrite, ScopeType.SummaryWrite ]
22
22
  */
23
23
  scopes) {
24
24
  this.scopes = scopes;
@@ -36,17 +36,15 @@ export class InsecureTinyliciousTokenProvider {
36
36
  };
37
37
  }
38
38
  getSignedToken(tenantId, documentId, lifetime = 60 * 60, ver = "1.0") {
39
- var _a;
39
+ const userId = uuid();
40
+ const match = userId.match(/^([\da-f]{8})-([\da-f]{4})/);
41
+ const userName = match === null ? userId : match[0]; // Just use the first two segments of the (fake) userId as a fake name.
40
42
  // Current time in seconds
41
- const now = Math.round(new Date().getTime() / 1000);
42
- const user = { id: uuid(), name: getRandomName() };
43
+ const now = Math.round(Date.now() / 1000);
44
+ const user = { id: userId, name: userName };
43
45
  const claims = {
44
- documentId: documentId !== null && documentId !== void 0 ? documentId : "",
45
- scopes: (_a = this.scopes) !== null && _a !== void 0 ? _a : [
46
- ScopeType.DocRead,
47
- ScopeType.DocWrite,
48
- ScopeType.SummaryWrite,
49
- ],
46
+ documentId: documentId ?? "",
47
+ scopes: this.scopes ?? [ScopeType.DocRead, ScopeType.DocWrite, ScopeType.SummaryWrite],
50
48
  tenantId,
51
49
  user,
52
50
  iat: now,
@@ -54,7 +52,10 @@ export class InsecureTinyliciousTokenProvider {
54
52
  ver,
55
53
  };
56
54
  const utf8Key = { utf8: "12345" };
57
- return jsrsasign.jws.JWS.sign(null, JSON.stringify({ alg: "HS256", typ: "JWT" }), claims, utf8Key);
55
+ return jsrsasign.jws.JWS.sign(
56
+ // External API uses `null`
57
+ // eslint-disable-next-line unicorn/no-null
58
+ null, JSON.stringify({ alg: "HS256", typ: "JWT" }), claims, utf8Key);
58
59
  }
59
60
  }
60
- //# sourceMappingURL=insecureTinyliciousTokenProvider.js.map
61
+ //# sourceMappingURL=insecureTinyliciousTokenProvider.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"insecureTinyliciousTokenProvider.mjs","sourceRoot":"","sources":["../src/insecureTinyliciousTokenProvider.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EAAE,SAAS,EAAgB,MAAM,sCAAsC;OAEvE,EAAE,IAAI,IAAI,SAAS,EAAE,MAAM,WAAW;OACtC,EAAE,EAAE,IAAI,IAAI,EAAE,MAAM,MAAM;AAEjC;;;;GAIG;AACH,MAAM,OAAO,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,IAAI,EAAE,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,SAAS,CAAC,OAAO,EAAE,SAAS,CAAC,QAAQ,EAAE,SAAS,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,SAAS,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","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"]}
@@ -3,13 +3,15 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import { IRequest } from "@fluidframework/core-interfaces";
6
- import { IFluidResolvedUrl, IResolvedUrl, IUrlResolver } from "@fluidframework/driver-definitions";
6
+ import { IResolvedUrl, IUrlResolver } from "@fluidframework/driver-definitions";
7
7
  /**
8
8
  * Default endpoint port. Will be used by the service if the consumer does not specify a port.
9
+ * @internal
9
10
  */
10
11
  export declare const defaultTinyliciousPort = 7070;
11
12
  /**
12
13
  * Default endpoint URL base. Will be used by the service if the consumer does not specify an endpoint.
14
+ * @internal
13
15
  */
14
16
  export declare const defaultTinyliciousEndpoint = "http://localhost";
15
17
  /**
@@ -17,13 +19,18 @@ export declare const defaultTinyliciousEndpoint = "http://localhost";
17
19
  * for a given request. This particular implementation has a goal to avoid imposing requirements on the app's
18
20
  * URL shape, so it expects the request url to have this format (as opposed to a more traditional URL):
19
21
  * documentId/containerRelativePathing
22
+ * @internal
20
23
  */
21
24
  export declare class InsecureTinyliciousUrlResolver implements IUrlResolver {
22
25
  private readonly fluidProtocolEndpoint;
23
26
  private readonly tinyliciousEndpoint;
24
27
  constructor(port?: number, endpoint?: string);
25
28
  resolve(request: IRequest): Promise<IResolvedUrl>;
26
- getAbsoluteUrl(resolvedUrl: IFluidResolvedUrl, relativeUrl: string): Promise<string>;
29
+ getAbsoluteUrl(resolvedUrl: IResolvedUrl, relativeUrl: string): Promise<string>;
27
30
  }
28
- export declare const createTinyliciousCreateNewRequest: (documentId?: string | undefined) => IRequest;
31
+ /**
32
+ * Creates a Routerlicious {@link @fluidframework/core-interfaces#IRequest}.
33
+ * @internal
34
+ */
35
+ export declare const createTinyliciousCreateNewRequest: (documentId?: string) => IRequest;
29
36
  //# sourceMappingURL=insecureTinyliciousUrlResolver.d.ts.map
@@ -0,0 +1 @@
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"}
@@ -2,13 +2,15 @@
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";
6
6
  /**
7
7
  * Default endpoint port. Will be used by the service if the consumer does not specify a port.
8
+ * @internal
8
9
  */
9
10
  export const defaultTinyliciousPort = 7070;
10
11
  /**
11
12
  * Default endpoint URL base. Will be used by the service if the consumer does not specify an endpoint.
13
+ * @internal
12
14
  */
13
15
  export const defaultTinyliciousEndpoint = "http://localhost";
14
16
  /**
@@ -16,6 +18,7 @@ export const defaultTinyliciousEndpoint = "http://localhost";
16
18
  * for a given request. This particular implementation has a goal to avoid imposing requirements on the app's
17
19
  * URL shape, so it expects the request url to have this format (as opposed to a more traditional URL):
18
20
  * documentId/containerRelativePathing
21
+ * @internal
19
22
  */
20
23
  export class InsecureTinyliciousUrlResolver {
21
24
  constructor(port = defaultTinyliciousPort, endpoint = defaultTinyliciousEndpoint) {
@@ -23,49 +26,40 @@ export class InsecureTinyliciousUrlResolver {
23
26
  this.fluidProtocolEndpoint = this.tinyliciousEndpoint.replace(/(^\w+:|^)\/\//, "fluid://");
24
27
  }
25
28
  async resolve(request) {
26
- var _a;
27
- // determine whether the request is for creating of a new container.
28
- // such request has the `createNew` header set to true and doesn't have a container ID.
29
+ const relativeUrl = request.url.replace(`${this.tinyliciousEndpoint}/`, "");
30
+ const documentIdFromRequest = relativeUrl.split("/")[0];
31
+ let deltaStorageUrl;
32
+ let documentUrl;
33
+ let finalDocumentId = documentIdFromRequest;
34
+ // Special handling if the request is to create a new container
29
35
  if (request.headers && request.headers[DriverHeader.createNew] === true) {
30
- // honor the document ID passed by the application via the create request
31
- // otherwise use the reserved keyword to let the driver generate the ID.
36
+ // Use the document ID passed by the application via the create request;
37
+ // if none was passed, use the reserved keyword to let the driver generate the ID.
32
38
  // TODO: deprecate this capability for tinylicious as the r11s driver will stop using the document ID
33
39
  // in create requests.
34
- const newDocumentId = (_a = request.url) !== null && _a !== void 0 ? _a : "new";
35
- return {
36
- endpoints: {
37
- deltaStorageUrl: `${this.tinyliciousEndpoint}/deltas/tinylicious/${newDocumentId}`,
38
- ordererUrl: this.tinyliciousEndpoint,
39
- storageUrl: `${this.tinyliciousEndpoint}/repos/tinylicious`,
40
- },
41
- // id is a mandatory attribute, but it's ignored by the driver for new container requests.
42
- id: request.url,
43
- // tokens attribute is redundant as all tokens are generated via ITokenProvider
44
- tokens: {},
45
- type: "fluid",
46
- url: `${this.fluidProtocolEndpoint}/tinylicious/${newDocumentId}`,
47
- };
40
+ if (finalDocumentId === "") {
41
+ finalDocumentId = "new";
42
+ }
43
+ deltaStorageUrl = `${this.tinyliciousEndpoint}/deltas/tinylicious/${finalDocumentId}`;
44
+ documentUrl = `${this.fluidProtocolEndpoint}/tinylicious/${finalDocumentId}`;
48
45
  }
49
- // for an existing container we'll parse the request URL to determine the document ID.
50
- const url = request.url.replace(`${this.tinyliciousEndpoint}/`, "");
51
- const documentId = url.split("/")[0];
52
- const encodedDocId = encodeURIComponent(documentId);
53
- const documentRelativePath = url.slice(documentId.length);
54
- const documentUrl = `${this.fluidProtocolEndpoint}/tinylicious/${encodedDocId}${documentRelativePath}`;
55
- const deltaStorageUrl = `${this.tinyliciousEndpoint}/deltas/tinylicious/${encodedDocId}`;
56
- const storageUrl = `${this.tinyliciousEndpoint}/repos/tinylicious`;
57
- const response = {
46
+ else {
47
+ const encodedDocId = encodeURIComponent(finalDocumentId);
48
+ const documentRelativePath = relativeUrl.slice(documentIdFromRequest.length);
49
+ documentUrl = `${this.fluidProtocolEndpoint}/tinylicious/${encodedDocId}${documentRelativePath}`;
50
+ deltaStorageUrl = `${this.tinyliciousEndpoint}/deltas/tinylicious/${encodedDocId}`;
51
+ }
52
+ return {
58
53
  endpoints: {
59
54
  deltaStorageUrl,
60
55
  ordererUrl: this.tinyliciousEndpoint,
61
- storageUrl,
56
+ storageUrl: `${this.tinyliciousEndpoint}/repos/tinylicious`,
62
57
  },
63
- id: documentId,
58
+ id: finalDocumentId,
64
59
  tokens: {},
65
60
  type: "fluid",
66
61
  url: documentUrl,
67
62
  };
68
- return response;
69
63
  }
70
64
  async getAbsoluteUrl(resolvedUrl, relativeUrl) {
71
65
  const documentId = decodeURIComponent(resolvedUrl.url.replace(`${this.fluidProtocolEndpoint}/tinylicious/`, ""));
@@ -78,10 +72,14 @@ export class InsecureTinyliciousUrlResolver {
78
72
  return `${documentId}/${relativeUrl}`;
79
73
  }
80
74
  }
75
+ /**
76
+ * Creates a Routerlicious {@link @fluidframework/core-interfaces#IRequest}.
77
+ * @internal
78
+ */
81
79
  export const createTinyliciousCreateNewRequest = (documentId) => ({
82
- url: documentId !== null && documentId !== void 0 ? documentId : "",
80
+ url: documentId ?? "",
83
81
  headers: {
84
82
  [DriverHeader.createNew]: true,
85
83
  },
86
84
  });
87
- //# sourceMappingURL=insecureTinyliciousUrlResolver.js.map
85
+ //# sourceMappingURL=insecureTinyliciousUrlResolver.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"insecureTinyliciousUrlResolver.mjs","sourceRoot":"","sources":["../src/insecureTinyliciousUrlResolver.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAGI,EAAE,YAAY,EAA8B,MAAM,oCAAoC;AAE7F;;;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;IAG1C,YAAmB,IAAI,GAAG,sBAAsB,EAAE,QAAQ,GAAG,0BAA0B;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,YAAY,CAAC,SAAS,CAAC,KAAK,IAAI,EAAE;YACxE,wEAAwE;YACxE,kFAAkF;YAClF,qGAAqG;YACrG,sBAAsB;YACtB,IAAI,eAAe,KAAK,EAAE,EAAE;gBAC3B,eAAe,GAAG,KAAK,CAAC;aACxB;YACD,eAAe,GAAG,GAAG,IAAI,CAAC,mBAAmB,uBAAuB,eAAe,EAAE,CAAC;YACtF,WAAW,GAAG,GAAG,IAAI,CAAC,qBAAqB,gBAAgB,eAAe,EAAE,CAAC;SAC7E;aAAM;YACN,MAAM,YAAY,GAAG,kBAAkB,CAAC,eAAe,CAAC,CAAC;YACzD,MAAM,oBAAoB,GAAG,WAAW,CAAC,KAAK,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC;YAC7E,WAAW,GAAG,GAAG,IAAI,CAAC,qBAAqB,gBAAgB,YAAY,GAAG,oBAAoB,EAAE,CAAC;YACjG,eAAe,GAAG,GAAG,IAAI,CAAC,mBAAmB,uBAAuB,YAAY,EAAE,CAAC;SACnF;QAED,OAAO;YACN,SAAS,EAAE;gBACV,eAAe;gBACf,UAAU,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,qBAAqB,eAAe,EAAE,EAAE,CAAC,CACzE,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 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"]}
@@ -0,0 +1,18 @@
1
+ import { IRequest } from '@fluidframework/core-interfaces';
2
+ import { IResolvedUrl } from '@fluidframework/driver-definitions';
3
+ import { ITokenProvider } from '@fluidframework/routerlicious-driver';
4
+ import { ITokenResponse } from '@fluidframework/routerlicious-driver';
5
+ import { IUrlResolver } from '@fluidframework/driver-definitions';
6
+ import { ScopeType } from '@fluidframework/protocol-definitions';
7
+
8
+ /* Excluded from this release type: createTinyliciousCreateNewRequest */
9
+
10
+ /* Excluded from this release type: defaultTinyliciousEndpoint */
11
+
12
+ /* Excluded from this release type: defaultTinyliciousPort */
13
+
14
+ /* Excluded from this release type: InsecureTinyliciousTokenProvider */
15
+
16
+ /* Excluded from this release type: InsecureTinyliciousUrlResolver */
17
+
18
+ export { }
@@ -0,0 +1,22 @@
1
+ import { IRequest } from '@fluidframework/core-interfaces';
2
+ import { IResolvedUrl } from '@fluidframework/driver-definitions';
3
+ import { ITokenProvider } from '@fluidframework/routerlicious-driver';
4
+ import { ITokenResponse } from '@fluidframework/routerlicious-driver';
5
+ import { IUrlResolver } from '@fluidframework/driver-definitions';
6
+ import { ScopeType } from '@fluidframework/protocol-definitions';
7
+
8
+ /* Excluded from this release type: createTinyliciousCreateNewRequest */
9
+
10
+ /* Excluded from this release type: defaultTinyliciousEndpoint */
11
+
12
+ /* Excluded from this release type: defaultTinyliciousPort */
13
+
14
+ /* Excluded from this release type: InsecureTinyliciousTokenProvider */
15
+
16
+ /* Excluded from this release type: InsecureTinyliciousUrlResolver */
17
+
18
+ /* Excluded from this release type: IResolvedUrl */
19
+
20
+ /* Excluded from this release type: IUrlResolver */
21
+
22
+ export { }
@@ -0,0 +1,22 @@
1
+ import { IRequest } from '@fluidframework/core-interfaces';
2
+ import { IResolvedUrl } from '@fluidframework/driver-definitions';
3
+ import { ITokenProvider } from '@fluidframework/routerlicious-driver';
4
+ import { ITokenResponse } from '@fluidframework/routerlicious-driver';
5
+ import { IUrlResolver } from '@fluidframework/driver-definitions';
6
+ import { ScopeType } from '@fluidframework/protocol-definitions';
7
+
8
+ /* Excluded from this release type: createTinyliciousCreateNewRequest */
9
+
10
+ /* Excluded from this release type: defaultTinyliciousEndpoint */
11
+
12
+ /* Excluded from this release type: defaultTinyliciousPort */
13
+
14
+ /* Excluded from this release type: InsecureTinyliciousTokenProvider */
15
+
16
+ /* Excluded from this release type: InsecureTinyliciousUrlResolver */
17
+
18
+ /* Excluded from this release type: IResolvedUrl */
19
+
20
+ /* Excluded from this release type: IUrlResolver */
21
+
22
+ export { }
@@ -0,0 +1,71 @@
1
+ import { IRequest } from '@fluidframework/core-interfaces';
2
+ import { IResolvedUrl } from '@fluidframework/driver-definitions';
3
+ import { ITokenProvider } from '@fluidframework/routerlicious-driver';
4
+ import { ITokenResponse } from '@fluidframework/routerlicious-driver';
5
+ import { IUrlResolver } from '@fluidframework/driver-definitions';
6
+ import { ScopeType } from '@fluidframework/protocol-definitions';
7
+
8
+ /**
9
+ * Creates a Routerlicious {@link @fluidframework/core-interfaces#IRequest}.
10
+ * @internal
11
+ */
12
+ export declare const createTinyliciousCreateNewRequest: (documentId?: string) => IRequest;
13
+
14
+ /**
15
+ * Default endpoint URL base. Will be used by the service if the consumer does not specify an endpoint.
16
+ * @internal
17
+ */
18
+ export declare const defaultTinyliciousEndpoint = "http://localhost";
19
+
20
+ /**
21
+ * Default endpoint port. Will be used by the service if the consumer does not specify a port.
22
+ * @internal
23
+ */
24
+ export declare const defaultTinyliciousPort = 7070;
25
+
26
+ /**
27
+ * As the name implies this is not secure and should not be used in production. It simply makes the example easier
28
+ * to get up and running.
29
+ * @internal
30
+ */
31
+ export declare class InsecureTinyliciousTokenProvider implements ITokenProvider {
32
+ /**
33
+ * Optional. Override of scopes. If a param is not provided, InsecureTinyliciousTokenProvider
34
+ * will use the default scopes which are document read, write and summarizer write.
35
+ *
36
+ * @param scopes - See {@link @fluidframework/protocol-definitions#ITokenClaims.scopes}
37
+ *
38
+ * @defaultValue [ ScopeType.DocRead, ScopeType.DocWrite, ScopeType.SummaryWrite ]
39
+ */
40
+ private readonly scopes?;
41
+ constructor(
42
+ /**
43
+ * Optional. Override of scopes. If a param is not provided, InsecureTinyliciousTokenProvider
44
+ * will use the default scopes which are document read, write and summarizer write.
45
+ *
46
+ * @param scopes - See {@link @fluidframework/protocol-definitions#ITokenClaims.scopes}
47
+ *
48
+ * @defaultValue [ ScopeType.DocRead, ScopeType.DocWrite, ScopeType.SummaryWrite ]
49
+ */
50
+ scopes?: ScopeType[] | undefined);
51
+ fetchOrdererToken(tenantId: string, documentId?: string): Promise<ITokenResponse>;
52
+ fetchStorageToken(tenantId: string, documentId: string): Promise<ITokenResponse>;
53
+ private getSignedToken;
54
+ }
55
+
56
+ /**
57
+ * InsecureTinyliciousUrlResolver knows how to get the URLs to the service (in this case Tinylicious) to use
58
+ * for a given request. This particular implementation has a goal to avoid imposing requirements on the app's
59
+ * URL shape, so it expects the request url to have this format (as opposed to a more traditional URL):
60
+ * documentId/containerRelativePathing
61
+ * @internal
62
+ */
63
+ export declare class InsecureTinyliciousUrlResolver implements IUrlResolver {
64
+ private readonly fluidProtocolEndpoint;
65
+ private readonly tinyliciousEndpoint;
66
+ constructor(port?: number, endpoint?: string);
67
+ resolve(request: IRequest): Promise<IResolvedUrl>;
68
+ getAbsoluteUrl(resolvedUrl: IResolvedUrl, relativeUrl: string): Promise<string>;
69
+ }
70
+
71
+ export { }