@fluidframework/local-driver 2.0.0-internal.7.2.2 → 2.0.0-internal.7.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +1 -2
  3. package/api-extractor-lint.json +13 -0
  4. package/api-extractor.json +3 -3
  5. package/api-report/local-driver.api.md +9 -9
  6. package/dist/{auth.js → auth.cjs} +1 -1
  7. package/dist/auth.cjs.map +1 -0
  8. package/dist/{index.js → index.cjs} +8 -8
  9. package/dist/index.cjs.map +1 -0
  10. package/dist/local-driver-alpha.d.ts +108 -0
  11. package/dist/local-driver-beta.d.ts +81 -0
  12. package/dist/local-driver-public.d.ts +81 -0
  13. package/dist/local-driver-untrimmed.d.ts +224 -0
  14. package/dist/{localCreateDocument.js → localCreateDocument.cjs} +1 -1
  15. package/dist/localCreateDocument.cjs.map +1 -0
  16. package/dist/{localDeltaStorageService.js → localDeltaStorageService.cjs} +2 -1
  17. package/dist/localDeltaStorageService.cjs.map +1 -0
  18. package/dist/localDeltaStorageService.d.ts +1 -0
  19. package/dist/localDeltaStorageService.d.ts.map +1 -1
  20. package/dist/{localDocumentDeltaConnection.js → localDocumentDeltaConnection.cjs} +2 -1
  21. package/dist/localDocumentDeltaConnection.cjs.map +1 -0
  22. package/dist/localDocumentDeltaConnection.d.ts +1 -0
  23. package/dist/localDocumentDeltaConnection.d.ts.map +1 -1
  24. package/dist/{localDocumentService.js → localDocumentService.cjs} +6 -4
  25. package/dist/localDocumentService.cjs.map +1 -0
  26. package/dist/localDocumentService.d.ts +2 -0
  27. package/dist/localDocumentService.d.ts.map +1 -1
  28. package/dist/{localDocumentServiceFactory.js → localDocumentServiceFactory.cjs} +4 -3
  29. package/dist/localDocumentServiceFactory.cjs.map +1 -0
  30. package/dist/localDocumentServiceFactory.d.ts +1 -0
  31. package/dist/localDocumentServiceFactory.d.ts.map +1 -1
  32. package/dist/{localDocumentStorageService.js → localDocumentStorageService.cjs} +5 -2
  33. package/dist/localDocumentStorageService.cjs.map +1 -0
  34. package/dist/localDocumentStorageService.d.ts +3 -0
  35. package/dist/localDocumentStorageService.d.ts.map +1 -1
  36. package/dist/{localResolver.js → localResolver.cjs} +6 -2
  37. package/dist/localResolver.cjs.map +1 -0
  38. package/dist/localResolver.d.ts +4 -0
  39. package/dist/localResolver.d.ts.map +1 -1
  40. package/dist/{localSessionStorageDb.js → localSessionStorageDb.cjs} +2 -1
  41. package/dist/localSessionStorageDb.cjs.map +1 -0
  42. package/dist/localSessionStorageDb.d.ts +1 -0
  43. package/dist/localSessionStorageDb.d.ts.map +1 -1
  44. package/dist/tsdoc-metadata.json +1 -1
  45. package/lib/auth.d.ts.map +1 -1
  46. package/lib/{auth.js → auth.mjs} +1 -1
  47. package/lib/auth.mjs.map +1 -0
  48. package/lib/index.d.ts +7 -7
  49. package/lib/index.d.ts.map +1 -1
  50. package/lib/{index.js → index.mjs} +8 -8
  51. package/lib/index.mjs.map +1 -0
  52. package/lib/local-driver-alpha.d.ts +108 -0
  53. package/lib/local-driver-beta.d.ts +81 -0
  54. package/lib/local-driver-public.d.ts +81 -0
  55. package/lib/local-driver-untrimmed.d.ts +224 -0
  56. package/lib/localCreateDocument.d.ts.map +1 -1
  57. package/lib/{localCreateDocument.js → localCreateDocument.mjs} +1 -1
  58. package/lib/localCreateDocument.mjs.map +1 -0
  59. package/lib/localDeltaStorageService.d.ts +1 -0
  60. package/lib/localDeltaStorageService.d.ts.map +1 -1
  61. package/lib/{localDeltaStorageService.js → localDeltaStorageService.mjs} +2 -1
  62. package/lib/localDeltaStorageService.mjs.map +1 -0
  63. package/lib/localDocumentDeltaConnection.d.ts +1 -0
  64. package/lib/localDocumentDeltaConnection.d.ts.map +1 -1
  65. package/lib/{localDocumentDeltaConnection.js → localDocumentDeltaConnection.mjs} +2 -1
  66. package/lib/localDocumentDeltaConnection.mjs.map +1 -0
  67. package/lib/localDocumentService.d.ts +3 -1
  68. package/lib/localDocumentService.d.ts.map +1 -1
  69. package/lib/{localDocumentService.js → localDocumentService.mjs} +6 -4
  70. package/lib/localDocumentService.mjs.map +1 -0
  71. package/lib/localDocumentServiceFactory.d.ts +1 -0
  72. package/lib/localDocumentServiceFactory.d.ts.map +1 -1
  73. package/lib/{localDocumentServiceFactory.js → localDocumentServiceFactory.mjs} +4 -3
  74. package/lib/localDocumentServiceFactory.mjs.map +1 -0
  75. package/lib/localDocumentStorageService.d.ts +3 -0
  76. package/lib/localDocumentStorageService.d.ts.map +1 -1
  77. package/lib/{localDocumentStorageService.js → localDocumentStorageService.mjs} +5 -2
  78. package/lib/localDocumentStorageService.mjs.map +1 -0
  79. package/lib/localResolver.d.ts +4 -0
  80. package/lib/localResolver.d.ts.map +1 -1
  81. package/lib/{localResolver.js → localResolver.mjs} +6 -2
  82. package/lib/localResolver.mjs.map +1 -0
  83. package/lib/localSessionStorageDb.d.ts +1 -0
  84. package/lib/localSessionStorageDb.d.ts.map +1 -1
  85. package/lib/{localSessionStorageDb.js → localSessionStorageDb.mjs} +2 -5
  86. package/lib/localSessionStorageDb.mjs.map +1 -0
  87. package/package.json +47 -27
  88. package/src/localDeltaStorageService.ts +1 -0
  89. package/src/localDocumentDeltaConnection.ts +1 -0
  90. package/src/localDocumentService.ts +2 -0
  91. package/src/localDocumentServiceFactory.ts +1 -0
  92. package/src/localDocumentStorageService.ts +3 -0
  93. package/src/localResolver.ts +4 -0
  94. package/src/localSessionStorageDb.ts +1 -0
  95. package/tsc-multi.test.json +4 -0
  96. package/tsconfig.json +5 -3
  97. package/dist/auth.js.map +0 -1
  98. package/dist/index.js.map +0 -1
  99. package/dist/localCreateDocument.js.map +0 -1
  100. package/dist/localDeltaStorageService.js.map +0 -1
  101. package/dist/localDocumentDeltaConnection.js.map +0 -1
  102. package/dist/localDocumentService.js.map +0 -1
  103. package/dist/localDocumentServiceFactory.js.map +0 -1
  104. package/dist/localDocumentStorageService.js.map +0 -1
  105. package/dist/localResolver.js.map +0 -1
  106. package/dist/localSessionStorageDb.js.map +0 -1
  107. package/lib/auth.js.map +0 -1
  108. package/lib/index.js.map +0 -1
  109. package/lib/localCreateDocument.js.map +0 -1
  110. package/lib/localDeltaStorageService.js.map +0 -1
  111. package/lib/localDocumentDeltaConnection.js.map +0 -1
  112. package/lib/localDocumentService.js.map +0 -1
  113. package/lib/localDocumentServiceFactory.js.map +0 -1
  114. package/lib/localDocumentStorageService.js.map +0 -1
  115. package/lib/localResolver.js.map +0 -1
  116. package/lib/localSessionStorageDb.js.map +0 -1
  117. package/tsconfig.esnext.json +0 -7
@@ -0,0 +1 @@
1
+ {"version":3,"file":"localSessionStorageDb.cjs","sourceRoot":"","sources":["../src/localSessionStorageDb.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,mCAAsC;AAGtC,+BAAkC;AAElC;;;GAGG;AACH,MAAM,6BAA6B;IAClC;;OAEG;IACH,YAA6B,cAAsB;QAAtB,mBAAc,GAAd,cAAc,CAAQ;IAAG,CAAC;IAEhD,SAAS,CAAC,QAAa,EAAE,OAAa;QAC5C,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;IAC3C,CAAC;IAEM,KAAK,CAAC,UAAU,CAAC,MAAW,EAAE,GAAQ,EAAE,QAAa;QAC3D,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;IAC3C,CAAC;IACM,KAAK,CAAC,QAAQ,CAAC,GAAQ,EAAE,KAAU;QACzC,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;IAC3C,CAAC;IACM,KAAK,CAAC,aAAa,CAAC,KAAU,EAAE,KAAQ;QAC9C,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC5C,CAAC;IAED;;OAEG;IACH;;;OAGG;IACI,KAAK,CAAC,IAAI,CAAC,KAAU,EAAE,IAAS;QACtC,iDAAiD;QACjD,SAAS,aAAa,CAAC,WAAW,EAAE,GAAW;YAC9C,MAAM,IAAI,GA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AAa,EAAE;oBACnB,OAAO,KAAK,CAAC;iBACb;aACD;SACD;QACD,OAAO,IAAI,CAAC;IACb,CAAC;CACD;AAED;;GAEG;AACH,MAAM,qBAAsB,SAAQ,qBAAY;IAAhD;;QACkB,gBAAW,GAAG,IAAI,GAAG,EAA8C,CAAC;IAgBtF,CAAC;IAfO,KAAK,CAAC,KAAK,KAAmB,CAAC;IAC/B,UAAU,CAAI,IAAY;QAChC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;YAChC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,6BAA6B,CAAI,IAAI,CAAC,CAAC,CAAC;SACvE;QACD,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAqC,CAAC;IACvE,CAAC;IAEM,KAAK,CAAC,cAAc,CAAC,IAAY;QACvC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;YAChC,OAAO,IAAI,CAAC;SACZ;QACD,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAC9B,OAAO,IAAI,CAAC;IACb,CAAC;CACD;AAED;;;GAGG;AACH,MAAa,4BAA4B;IAAzC;QACiB,iBAAY,GAAQ,IAAI,qBAAqB,EAAE,CAAC;IAIjE,CAAC;IAHO,KAAK,CAAC,OAAO;QACnB,OAAO,IAAI,CAAC,YAAY,CAAC;IAC1B,CAAC;CACD;AALD,oEAKC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport { EventEmitter } from \"events\";\nimport { ICollection, IDb } from \"@fluidframework/server-services-core\";\nimport { ITestDbFactory } from \"@fluidframework/server-test-utils\";\nimport { v4 as uuid } from \"uuid\";\n\n/**\n * A collection for local session storage, where data is stored in the browser\n * Functions include database operations such as queries, insertion and update.\n */\nclass LocalSessionStorageCollection<T> implements ICollection<T> {\n\t/**\n\t * @param collectionName - data type of the collection, e.g. blobs, deltas, trees, etc.\n\t */\n\tconstructor(private readonly collectionName: string) {}\n\n\tpublic aggregate(pipeline: any, options?: any): any {\n\t\tthrow new Error(\"Method Not Implemented\");\n\t}\n\n\tpublic async updateMany(filter: any, set: any, addToSet: any): Promise<void> {\n\t\tthrow new Error(\"Method Not Implemented\");\n\t}\n\tpublic async distinct(key: any, query: any): Promise<any> {\n\t\tthrow new Error(\"Method Not Implemented\");\n\t}\n\tpublic async findAndUpdate(query: any, value: T): Promise<{ value: T; existing: boolean }> {\n\t\tthrow new Error(\"Method not implemented.\");\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/server-services-core#ICollection.find}\n\t */\n\t/*\n\t * Each query key consists of several keys separated by '.' e.g: \"operation.sequenceNumber\".\n\t * The hierarchical syntax allows finding nested key patterns.\n\t */\n\tpublic async find(query: any, sort: any): Promise<any[]> {\n\t\t// split the keys and get the corresponding value\n\t\tfunction getValueByKey(propertyBag, key: string) {\n\t\t\tconst keys = key.split(\".\");\n\t\t\tlet value = propertyBag;\n\t\t\tkeys.forEach((splitKey) => {\n\t\t\t\tvalue = value[splitKey];\n\t\t\t});\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-return\n\t\t\treturn value;\n\t\t}\n\n\t\t// getting keys of the query we are trying to find\n\t\tconst queryKeys = Object.keys(query);\n\t\tlet filteredCollection = this.getAllInternal();\n\t\tqueryKeys.forEach((key) => {\n\t\t\tif (!query[key]) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (query[key].$gt > 0 || query[key].$lt > 0) {\n\t\t\t\tif (query[key].$gt > 0) {\n\t\t\t\t\tfilteredCollection = filteredCollection.filter(\n\t\t\t\t\t\t(value) => getValueByKey(value, key) > query[key].$gt,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tif (query[key].$lt > 0) {\n\t\t\t\t\tfilteredCollection = filteredCollection.filter(\n\t\t\t\t\t\t(value) => getValueByKey(value, key) < query[key].$lt,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfilteredCollection = filteredCollection.filter(\n\t\t\t\t\t(value) => getValueByKey(value, key) === query[key],\n\t\t\t\t);\n\t\t\t}\n\t\t});\n\n\t\tif (sort && Object.keys(sort).length === 1) {\n\t\t\t// eslint-disable-next-line no-inner-declarations\n\t\t\tfunction compare(a, b) {\n\t\t\t\tconst sortKey = Object.keys(sort)[0];\n\t\t\t\treturn sort[sortKey] === 1\n\t\t\t\t\t? getValueByKey(a, sortKey) - getValueByKey(b, sortKey)\n\t\t\t\t\t: getValueByKey(b, sortKey) - getValueByKey(a, sortKey);\n\t\t\t}\n\n\t\t\tfilteredCollection = filteredCollection.sort(compare);\n\t\t}\n\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-return\n\t\treturn filteredCollection;\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/server-services-core#ICollection.findAll}\n\t */\n\tpublic async findAll(): Promise<any[]> {\n\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-return\n\t\treturn this.getAllInternal();\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/server-services-core#ICollection.findOne}\n\t */\n\t/*\n\t * Query is expected to have a member \"_id\" which is a string used to find value in the database.\n\t */\n\tpublic async findOne(query: any): Promise<any> {\n\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-return\n\t\treturn this.findOneInternal(query);\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/server-services-core#ICollection.update}\n\t */\n\t/*\n\t * Query is expected to have a member \"_id\" which is a string used to find value in the database.\n\t */\n\tpublic async update(query: any, set: any, addToSet: any): Promise<void> {\n\t\tconst value = this.findOneInternal(query);\n\t\tif (!value) {\n\t\t\tthrow new Error(\"Not found\");\n\t\t} else {\n\t\t\tfor (const key of Object.keys(set)) {\n\t\t\t\tvalue[key] = set[key];\n\t\t\t}\n\t\t\tthis.insertInternal(value);\n\t\t}\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/server-services-core#ICollection.upsert}\n\t */\n\t/*\n\t * Query is expected to have a member \"_id\" which is a string used to find value in the database.\n\t */\n\tpublic async upsert(query: any, set: any, addToSet: any): Promise<void> {\n\t\tconst value = this.findOneInternal(query);\n\t\tif (!value) {\n\t\t\tthis.insertInternal(set);\n\t\t} else {\n\t\t\tfor (const key of Object.keys(set)) {\n\t\t\t\tvalue[key] = set[key];\n\t\t\t}\n\t\t\tthis.insertInternal(value);\n\t\t}\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/server-services-core#ICollection.insertOne}\n\t */\n\t/*\n\t * Value is expected to have a member \"_id\" which is a string used to search in the database.\n\t */\n\tpublic async insertOne(value: any): Promise<any> {\n\t\tconst presentVal = this.findOneInternal(value);\n\t\t// Only raise error when the object is present and the value is not equal.\n\t\tif (presentVal) {\n\t\t\tif (JSON.stringify(presentVal) === JSON.stringify(value)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthrow new Error(\"Existing Object!!\");\n\t\t}\n\n\t\treturn this.insertInternal(value);\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/server-services-core#ICollection.findOrCreate}\n\t */\n\t/*\n\t * Value and query are expected to have a member \"_id\" which is a string used to search or insert in the database.\n\t */\n\tpublic async findOrCreate(query: any, value: any): Promise<{ value: any; existing: boolean }> {\n\t\tconst existing = this.findOneInternal(query);\n\t\tif (existing) {\n\t\t\treturn { value: existing, existing: true };\n\t\t}\n\t\tthis.insertInternal(value);\n\t\treturn { value, existing: false };\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/server-services-core#ICollection.insertMany}\n\t */\n\t/*\n\t * Each element in values is expected to have a member \"_id\" which is a string used to insert in the database.\n\t */\n\tpublic async insertMany(values: any[], ordered: boolean): Promise<void> {\n\t\tthis.insertInternal(...values);\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/server-services-core#ICollection.deleteOne}\n\t */\n\tpublic async deleteOne(query: any): Promise<any> {\n\t\tthrow new Error(\"Method not implemented.\");\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/server-services-core#ICollection.deleteMany}\n\t */\n\tpublic async deleteMany(query: any): Promise<any> {\n\t\tthrow new Error(\"Method not implemented.\");\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/server-services-core#ICollection.createIndex}\n\t */\n\tpublic async createIndex(index: any, unique: boolean): Promise<void> {\n\t\tthrow new Error(\"Method not implemented.\");\n\t}\n\n\t/**\n\t * Return all values in the database\n\t */\n\tprivate getAllInternal(): any[] {\n\t\tconst values: string[] = [];\n\t\tfor (let i = 0; i < sessionStorage.length; i++) {\n\t\t\tconst key = sessionStorage.key(i);\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\tif (key!.startsWith(this.collectionName)) {\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\t\tvalues.push(JSON.parse(sessionStorage.getItem(key!)!));\n\t\t\t}\n\t\t}\n\t\treturn values;\n\t}\n\n\t/**\n\t * Inserts values into the session storge.\n\t * Values are expected to have a member \"_id\" which is a unique id, otherwise will be assigned one\n\t *\n\t * @param values - data to insert to the database\n\t */\n\tprivate insertInternal(...values: any[]) {\n\t\tfor (const value of values) {\n\t\t\tif (value) {\n\t\t\t\tif (!value._id) {\n\t\t\t\t\tvalue._id = uuid();\n\t\t\t\t}\n\t\t\t\tsessionStorage.setItem(\n\t\t\t\t\t`${this.collectionName}-${value._id}`,\n\t\t\t\t\tJSON.stringify(value),\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Finds the query in session storage and returns its value.\n\t * Returns null if query is not found.\n\t * Query is expected to have a member \"_id\" which is a unique id.\n\t *\n\t * @param query - what to find in the database\n\t */\n\tprivate findOneInternal(query: any): any {\n\t\tif (query._id) {\n\t\t\tconst json = sessionStorage.getItem(`${this.collectionName}-${query._id}`);\n\t\t\tif (json) {\n\t\t\t\treturn JSON.parse(json);\n\t\t\t}\n\t\t} else {\n\t\t\tconst queryKeys = Object.keys(query);\n\t\t\tfor (let i = 0; i < sessionStorage.length; i++) {\n\t\t\t\tconst ssKey = sessionStorage.key(i);\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\t\tif (!ssKey!.startsWith(this.collectionName)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\t\tconst value = JSON.parse(sessionStorage.getItem(ssKey!)!);\n\t\t\t\tlet foundMismatch = false;\n\t\t\t\tfor (const qk of queryKeys) {\n\t\t\t\t\tif (value[qk] !== query[qk]) {\n\t\t\t\t\t\tfoundMismatch = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!foundMismatch) {\n\t\t\t\t\treturn value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n}\n\n/**\n * A database for testing that stores data in the browsers session storage\n */\nclass LocalSessionStorageDb extends EventEmitter implements IDb {\n\tprivate readonly collections = new Map<string, LocalSessionStorageCollection<any>>();\n\tpublic async close(): Promise<void> {}\n\tpublic collection<T>(name: string): ICollection<T> {\n\t\tif (!this.collections.has(name)) {\n\t\t\tthis.collections.set(name, new LocalSessionStorageCollection<T>(name));\n\t\t}\n\t\treturn this.collections.get(name) as LocalSessionStorageCollection<T>;\n\t}\n\n\tpublic async dropCollection(name: string): Promise<boolean> {\n\t\tif (!this.collections.has(name)) {\n\t\t\treturn true;\n\t\t}\n\t\tthis.collections.delete(name);\n\t\treturn true;\n\t}\n}\n\n/**\n * A database factory for testing that stores data in the browsers session storage\n * @internal\n */\nexport class LocalSessionStorageDbFactory implements ITestDbFactory {\n\tpublic readonly testDatabase: IDb = new LocalSessionStorageDb();\n\tpublic async connect(): Promise<IDb> {\n\t\treturn this.testDatabase;\n\t}\n}\n"]}
@@ -2,6 +2,7 @@ import { IDb } from "@fluidframework/server-services-core";
2
2
  import { ITestDbFactory } from "@fluidframework/server-test-utils";
3
3
  /**
4
4
  * A database factory for testing that stores data in the browsers session storage
5
+ * @internal
5
6
  */
6
7
  export declare class LocalSessionStorageDbFactory implements ITestDbFactory {
7
8
  readonly testDatabase: IDb;
@@ -1 +1 @@
1
- {"version":3,"file":"localSessionStorageDb.d.ts","sourceRoot":"","sources":["../src/localSessionStorageDb.ts"],"names":[],"mappings":"AAKA,OAAO,EAAe,GAAG,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAgTnE;;GAEG;AACH,qBAAa,4BAA6B,YAAW,cAAc;IAClE,SAAgB,YAAY,EAAE,GAAG,CAA+B;IACnD,OAAO,IAAI,OAAO,CAAC,GAAG,CAAC;CAGpC"}
1
+ {"version":3,"file":"localSessionStorageDb.d.ts","sourceRoot":"","sources":["../src/localSessionStorageDb.ts"],"names":[],"mappings":"AAKA,OAAO,EAAe,GAAG,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAgTnE;;;GAGG;AACH,qBAAa,4BAA6B,YAAW,cAAc;IAClE,SAAgB,YAAY,EAAE,GAAG,CAA+B;IACnD,OAAO,IAAI,OAAO,CAAC,GAAG,CAAC;CAGpC"}
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.38.0"
8
+ "packageVersion": "7.38.3"
9
9
  }
10
10
  ]
11
11
  }
package/lib/auth.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAgB,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAItF;;;GAGG;AACH,wBAAgB,aAAa,CAC5B,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,SAAS,EAAE,EACnB,IAAI,CAAC,EAAE,KAAK,EACZ,QAAQ,GAAE,MAAgB,EAC1B,GAAG,GAAE,MAAc,GACjB,MAAM,CA0BR;AAED,wBAAgB,YAAY,IAAI,KAAK,CAWpC"}
1
+ {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EAAgB,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC;AAIrF;;;GAGG;AACH,wBAAgB,aAAa,CAC5B,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,SAAS,EAAE,EACnB,IAAI,CAAC,EAAE,KAAK,EACZ,QAAQ,GAAE,MAAgB,EAC1B,GAAG,GAAE,MAAc,GACjB,MAAM,CA0BR;AAED,wBAAgB,YAAY,IAAI,KAAK,CAWpC"}
@@ -37,4 +37,4 @@ export function generateUser() {
37
37
  };
38
38
  return randomUser;
39
39
  }
40
- //# sourceMappingURL=auth.js.map
40
+ //# sourceMappingURL=auth.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.mjs","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAGI,EAAE,IAAI,IAAI,SAAS,EAAE,MAAM,WAAW;OACtC,EAAE,EAAE,IAAI,IAAI,EAAE,MAAM,MAAM;AAEjC;;;GAGG;AACH,MAAM,UAAU,aAAa,CAC5B,QAAgB,EAChB,UAAkB,EAClB,GAAW,EACX,MAAmB,EACnB,IAAY,EACZ,WAAmB,EAAE,GAAG,EAAE,EAC1B,MAAc,KAAK;IAEnB,IAAI,SAAS,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,YAAY,EAAE,CAAC;IAC7C,IAAI,SAAS,CAAC,EAAE,KAAK,EAAE,IAAI,SAAS,CAAC,EAAE,KAAK,SAAS,EAAE;QACtD,SAAS,GAAG,YAAY,EAAE,CAAC;KAC3B;IAED,0BAA0B;IAC1B,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC;IAEpD,MAAM,MAAM,GAAiB;QAC5B,UAAU;QACV,MAAM;QACN,QAAQ;QACR,IAAI,EAAE,SAAS;QACf,GAAG,EAAE,GAAG;QACR,GAAG,EAAE,GAAG,GAAG,QAAQ;QACnB,GAAG;KACH,CAAC;IAEF,MAAM,OAAO,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC;IAC9B,OAAO,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAC5B,IAAI,EACJ,IAAI,CAAC,SAAS,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,EAC5C,MAAM,EACN,OAAO,CACP,CAAC;AACH,CAAC;AAED,MAAM,UAAU,YAAY;IAC3B,MAAM,MAAM,GAAG,IAAI,EAAE,CAAC;IACtB,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,4BAA4B,CAAC,CAAC;IACzD,MAAM,QAAQ,GAAG,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,uEAAuE;IAE5H,MAAM,UAAU,GAAG;QAClB,EAAE,EAAE,MAAM;QACV,IAAI,EAAE,QAAQ;KACd,CAAC;IAEF,OAAO,UAAU,CAAC;AACnB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITokenClaims, IUser, ScopeType } from \"@fluidframework/protocol-definitions\";\nimport { KJUR as jsrsasign } from \"jsrsasign\";\nimport { v4 as uuid } from \"uuid\";\n\n/**\n * Generates a JWT token to authorize against. We do not use the implementation in\n * services-client since it cannot run in the browser without polyfills.\n */\nexport function generateToken(\n\ttenantId: string,\n\tdocumentId: string,\n\tkey: string,\n\tscopes: ScopeType[],\n\tuser?: IUser,\n\tlifetime: number = 60 * 60,\n\tver: string = \"1.0\",\n): string {\n\tlet userClaim = user ? user : generateUser();\n\tif (userClaim.id === \"\" || userClaim.id === undefined) {\n\t\tuserClaim = generateUser();\n\t}\n\n\t// Current time in seconds\n\tconst now = Math.round(new Date().getTime() / 1000);\n\n\tconst claims: ITokenClaims = {\n\t\tdocumentId,\n\t\tscopes,\n\t\ttenantId,\n\t\tuser: userClaim,\n\t\tiat: now,\n\t\texp: now + lifetime,\n\t\tver,\n\t};\n\n\tconst utf8Key = { utf8: key };\n\treturn jsrsasign.jws.JWS.sign(\n\t\tnull,\n\t\tJSON.stringify({ alg: \"HS256\", typ: \"JWT\" }),\n\t\tclaims,\n\t\tutf8Key,\n\t);\n}\n\nexport function generateUser(): IUser {\n\tconst userId = uuid();\n\tconst match = userId.match(/^([\\da-f]{8})-([\\da-f]{4})/);\n\tconst userName = match !== null ? match[0] : userId; // Just use the first two segments of the (fake) userId as a fake name.\n\n\tconst randomUser = {\n\t\tid: userId,\n\t\tname: userName,\n\t};\n\n\treturn randomUser;\n}\n"]}
package/lib/index.d.ts CHANGED
@@ -2,11 +2,11 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- export { LocalDeltaStorageService } from "./localDeltaStorageService";
6
- export { LocalDocumentDeltaConnection } from "./localDocumentDeltaConnection";
7
- export { createLocalDocumentService, LocalDocumentService } from "./localDocumentService";
8
- export { LocalDocumentServiceFactory } from "./localDocumentServiceFactory";
9
- export { LocalDocumentStorageService } from "./localDocumentStorageService";
10
- export { createLocalResolverCreateNewRequest, LocalResolver } from "./localResolver";
11
- export { LocalSessionStorageDbFactory } from "./localSessionStorageDb";
5
+ export { LocalDeltaStorageService } from "./localDeltaStorageService.mjs";
6
+ export { LocalDocumentDeltaConnection } from "./localDocumentDeltaConnection.mjs";
7
+ export { createLocalDocumentService, LocalDocumentService } from "./localDocumentService.mjs";
8
+ export { LocalDocumentServiceFactory } from "./localDocumentServiceFactory.mjs";
9
+ export { LocalDocumentStorageService } from "./localDocumentStorageService.mjs";
10
+ export { createLocalResolverCreateNewRequest, LocalResolver } from "./localResolver.mjs";
11
+ export { LocalSessionStorageDbFactory } from "./localSessionStorageDb.mjs";
12
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,EAAE,0BAA0B,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC1F,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAAE,mCAAmC,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrF,OAAO,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EAAE,wBAAwB,EAAE;OAC5B,EAAE,4BAA4B,EAAE;OAChC,EAAE,0BAA0B,EAAE,oBAAoB,EAAE;OACpD,EAAE,2BAA2B,EAAE;OAC/B,EAAE,2BAA2B,EAAE;OAC/B,EAAE,mCAAmC,EAAE,aAAa,EAAE;OACtD,EAAE,4BAA4B,EAAE"}
@@ -2,11 +2,11 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- export { LocalDeltaStorageService } from "./localDeltaStorageService";
6
- export { LocalDocumentDeltaConnection } from "./localDocumentDeltaConnection";
7
- export { createLocalDocumentService, LocalDocumentService } from "./localDocumentService";
8
- export { LocalDocumentServiceFactory } from "./localDocumentServiceFactory";
9
- export { LocalDocumentStorageService } from "./localDocumentStorageService";
10
- export { createLocalResolverCreateNewRequest, LocalResolver } from "./localResolver";
11
- export { LocalSessionStorageDbFactory } from "./localSessionStorageDb";
12
- //# sourceMappingURL=index.js.map
5
+ export { LocalDeltaStorageService } from "./localDeltaStorageService.mjs";
6
+ export { LocalDocumentDeltaConnection } from "./localDocumentDeltaConnection.mjs";
7
+ export { createLocalDocumentService, LocalDocumentService } from "./localDocumentService.mjs";
8
+ export { LocalDocumentServiceFactory } from "./localDocumentServiceFactory.mjs";
9
+ export { LocalDocumentStorageService } from "./localDocumentStorageService.mjs";
10
+ export { createLocalResolverCreateNewRequest, LocalResolver } from "./localResolver.mjs";
11
+ export { LocalSessionStorageDbFactory } from "./localSessionStorageDb.mjs";
12
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EAAE,wBAAwB,EAAE;OAC5B,EAAE,4BAA4B,EAAE;OAChC,EAAE,0BAA0B,EAAE,oBAAoB,EAAE;OACpD,EAAE,2BAA2B,EAAE;OAC/B,EAAE,2BAA2B,EAAE;OAC/B,EAAE,mCAAmC,EAAE,aAAa,EAAE;OACtD,EAAE,4BAA4B,EAAE","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { LocalDeltaStorageService } from \"./localDeltaStorageService\";\nexport { LocalDocumentDeltaConnection } from \"./localDocumentDeltaConnection\";\nexport { createLocalDocumentService, LocalDocumentService } from \"./localDocumentService\";\nexport { LocalDocumentServiceFactory } from \"./localDocumentServiceFactory\";\nexport { LocalDocumentStorageService } from \"./localDocumentStorageService\";\nexport { createLocalResolverCreateNewRequest, LocalResolver } from \"./localResolver\";\nexport { LocalSessionStorageDbFactory } from \"./localSessionStorageDb\";\n"]}
@@ -0,0 +1,108 @@
1
+ import { DocumentDeltaConnection } from '@fluidframework/driver-base';
2
+ import { GitManager } from '@fluidframework/server-services-client';
3
+ import { IClient } from '@fluidframework/protocol-definitions';
4
+ import { ICreateBlobResponse } from '@fluidframework/protocol-definitions';
5
+ import { IDatabaseManager } from '@fluidframework/server-services-core';
6
+ import { IDb } from '@fluidframework/server-services-core';
7
+ import { IDocumentDeltaConnection } from '@fluidframework/driver-definitions';
8
+ import { IDocumentDeltaStorageService } from '@fluidframework/driver-definitions';
9
+ import { IDocumentMessage } from '@fluidframework/protocol-definitions';
10
+ import { IDocumentService } from '@fluidframework/driver-definitions';
11
+ import { IDocumentServiceFactory } from '@fluidframework/driver-definitions';
12
+ import { IDocumentServicePolicies } from '@fluidframework/driver-definitions';
13
+ import { IDocumentStorageService } from '@fluidframework/driver-definitions';
14
+ import { IDocumentStorageServicePolicies } from '@fluidframework/driver-definitions';
15
+ import { ILocalDeltaConnectionServer } from '@fluidframework/server-local-server';
16
+ import { IRequest } from '@fluidframework/core-interfaces';
17
+ import { IResolvedUrl } from '@fluidframework/driver-definitions';
18
+ import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
19
+ import { ISnapshotTreeEx } from '@fluidframework/protocol-definitions';
20
+ import { IStream } from '@fluidframework/driver-definitions';
21
+ import { ISummaryContext } from '@fluidframework/driver-definitions';
22
+ import { ISummaryHandle } from '@fluidframework/protocol-definitions';
23
+ import { ISummaryTree } from '@fluidframework/protocol-definitions';
24
+ import { ITelemetryBaseLogger } from '@fluidframework/core-interfaces';
25
+ import { ITestDbFactory } from '@fluidframework/server-test-utils';
26
+ import { ITokenProvider } from '@fluidframework/routerlicious-driver';
27
+ import { IUrlResolver } from '@fluidframework/driver-definitions';
28
+ import { IVersion } from '@fluidframework/protocol-definitions';
29
+ import { IWebSocketServer } from '@fluidframework/server-services-core';
30
+ import { NackErrorType } from '@fluidframework/protocol-definitions';
31
+ import type { Socket } from 'socket.io-client';
32
+
33
+ /* Excluded from this release type: createLocalDocumentService */
34
+
35
+ /**
36
+ * @alpha
37
+ */
38
+ export declare function createLocalResolverCreateNewRequest(documentId: string): IRequest;
39
+
40
+ /* Excluded from this release type: DocumentDeltaConnection */
41
+
42
+ /* Excluded from this release type: LocalDeltaStorageService */
43
+
44
+ /* Excluded from this release type: LocalDocumentDeltaConnection */
45
+
46
+ /* Excluded from this release type: LocalDocumentService */
47
+
48
+ /**
49
+ * Implementation of document service factory for local use.
50
+ * @alpha
51
+ */
52
+ export declare class LocalDocumentServiceFactory implements IDocumentServiceFactory {
53
+ private readonly localDeltaConnectionServer;
54
+ private readonly policies?;
55
+ private readonly innerDocumentService?;
56
+ private readonly documentDeltaConnectionsMap;
57
+ /**
58
+ * @param localDeltaConnectionServer - delta connection server for ops
59
+ */
60
+ constructor(localDeltaConnectionServer: ILocalDeltaConnectionServer, policies?: IDocumentServicePolicies | undefined, innerDocumentService?: IDocumentService | undefined);
61
+ createContainer(createNewSummary: ISummaryTree | undefined, resolvedUrl: IResolvedUrl, logger?: ITelemetryBaseLogger, clientIsSummarizer?: boolean): Promise<IDocumentService>;
62
+ /**
63
+ * Creates and returns a document service for testing using the given resolved
64
+ * URL for the tenant ID, document ID, and token.
65
+ * @param resolvedUrl - resolved URL of document
66
+ */
67
+ createDocumentService(resolvedUrl: IResolvedUrl, logger?: ITelemetryBaseLogger, clientIsSummarizer?: boolean): Promise<IDocumentService>;
68
+ /**
69
+ * Gets the document delta connection for the clientId and asks it to disconnect the client.
70
+ * @param clientId - The ID of the client to be disconnected.
71
+ * @param disconnectReason - The reason of the disconnection.
72
+ */
73
+ disconnectClient(clientId: string, disconnectReason: string): void;
74
+ /**
75
+ * Gets the document delta connection for the clientId and asks it to nack the client.
76
+ * @param clientId - The ID of the client to be Nack'd.
77
+ * @param code - An error code number that represents the error. It will be a valid HTTP error code.
78
+ * @param type - Type of the Nack.
79
+ * @param message - A message about the nack for debugging/logging/telemetry purposes.
80
+ */
81
+ nackClient(clientId: string, code?: number, type?: NackErrorType, message?: any): void;
82
+ }
83
+
84
+ /* Excluded from this release type: LocalDocumentStorageService */
85
+
86
+ /**
87
+ * Resolves URLs by providing fake URLs which succeed with the other
88
+ * related local classes.
89
+ * @alpha
90
+ */
91
+ export declare class LocalResolver implements IUrlResolver {
92
+ private readonly tenantId;
93
+ private readonly tokenKey;
94
+ constructor();
95
+ /**
96
+ * Resolves URL requests by providing fake URLs with an actually generated
97
+ * token from constant test strings. The root of the URL is fake, but the
98
+ * remaining relative URL can still be parsed.
99
+ * @param request - request to handle
100
+ */
101
+ resolve(request: IRequest): Promise<IResolvedUrl>;
102
+ getAbsoluteUrl(resolvedUrl: IResolvedUrl, relativeUrl: string): Promise<string>;
103
+ createCreateNewRequest(documentId: string): IRequest;
104
+ }
105
+
106
+ /* Excluded from this release type: LocalSessionStorageDbFactory */
107
+
108
+ export { }
@@ -0,0 +1,81 @@
1
+ import { DocumentDeltaConnection } from '@fluidframework/driver-base';
2
+ import { GitManager } from '@fluidframework/server-services-client';
3
+ import { IClient } from '@fluidframework/protocol-definitions';
4
+ import { ICreateBlobResponse } from '@fluidframework/protocol-definitions';
5
+ import { IDatabaseManager } from '@fluidframework/server-services-core';
6
+ import { IDb } from '@fluidframework/server-services-core';
7
+ import { IDocumentDeltaConnection } from '@fluidframework/driver-definitions';
8
+ import { IDocumentDeltaStorageService } from '@fluidframework/driver-definitions';
9
+ import { IDocumentMessage } from '@fluidframework/protocol-definitions';
10
+ import { IDocumentService } from '@fluidframework/driver-definitions';
11
+ import { IDocumentServiceFactory } from '@fluidframework/driver-definitions';
12
+ import { IDocumentServicePolicies } from '@fluidframework/driver-definitions';
13
+ import { IDocumentStorageService } from '@fluidframework/driver-definitions';
14
+ import { IDocumentStorageServicePolicies } from '@fluidframework/driver-definitions';
15
+ import { ILocalDeltaConnectionServer } from '@fluidframework/server-local-server';
16
+ import { IRequest } from '@fluidframework/core-interfaces';
17
+ import { IResolvedUrl } from '@fluidframework/driver-definitions';
18
+ import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
19
+ import { ISnapshotTreeEx } from '@fluidframework/protocol-definitions';
20
+ import { IStream } from '@fluidframework/driver-definitions';
21
+ import { ISummaryContext } from '@fluidframework/driver-definitions';
22
+ import { ISummaryHandle } from '@fluidframework/protocol-definitions';
23
+ import { ISummaryTree } from '@fluidframework/protocol-definitions';
24
+ import { ITelemetryBaseLogger } from '@fluidframework/core-interfaces';
25
+ import { ITestDbFactory } from '@fluidframework/server-test-utils';
26
+ import { ITokenProvider } from '@fluidframework/routerlicious-driver';
27
+ import { IUrlResolver } from '@fluidframework/driver-definitions';
28
+ import { IVersion } from '@fluidframework/protocol-definitions';
29
+ import { IWebSocketServer } from '@fluidframework/server-services-core';
30
+ import { NackErrorType } from '@fluidframework/protocol-definitions';
31
+ import type { Socket } from 'socket.io-client';
32
+
33
+ /* Excluded from this release type: createLocalDocumentService */
34
+
35
+ /* Excluded from this release type: createLocalResolverCreateNewRequest */
36
+
37
+ /* Excluded from this release type: DocumentDeltaConnection */
38
+
39
+ /* Excluded from this release type: IDocumentDeltaConnection */
40
+
41
+ /* Excluded from this release type: IDocumentDeltaStorageService */
42
+
43
+ /* Excluded from this release type: IDocumentService */
44
+
45
+ /* Excluded from this release type: IDocumentServiceFactory */
46
+
47
+ /* Excluded from this release type: IDocumentServicePolicies */
48
+
49
+ /* Excluded from this release type: IDocumentStorageService */
50
+
51
+ /* Excluded from this release type: IDocumentStorageServicePolicies */
52
+
53
+ /* Excluded from this release type: IRequest */
54
+
55
+ /* Excluded from this release type: IResolvedUrl */
56
+
57
+ /* Excluded from this release type: IStream */
58
+
59
+ /* Excluded from this release type: ISummaryContext */
60
+
61
+ /* Excluded from this release type: ITelemetryBaseLogger */
62
+
63
+ /* Excluded from this release type: ITokenProvider */
64
+
65
+ /* Excluded from this release type: IUrlResolver */
66
+
67
+ /* Excluded from this release type: LocalDeltaStorageService */
68
+
69
+ /* Excluded from this release type: LocalDocumentDeltaConnection */
70
+
71
+ /* Excluded from this release type: LocalDocumentService */
72
+
73
+ /* Excluded from this release type: LocalDocumentServiceFactory */
74
+
75
+ /* Excluded from this release type: LocalDocumentStorageService */
76
+
77
+ /* Excluded from this release type: LocalResolver */
78
+
79
+ /* Excluded from this release type: LocalSessionStorageDbFactory */
80
+
81
+ export { }
@@ -0,0 +1,81 @@
1
+ import { DocumentDeltaConnection } from '@fluidframework/driver-base';
2
+ import { GitManager } from '@fluidframework/server-services-client';
3
+ import { IClient } from '@fluidframework/protocol-definitions';
4
+ import { ICreateBlobResponse } from '@fluidframework/protocol-definitions';
5
+ import { IDatabaseManager } from '@fluidframework/server-services-core';
6
+ import { IDb } from '@fluidframework/server-services-core';
7
+ import { IDocumentDeltaConnection } from '@fluidframework/driver-definitions';
8
+ import { IDocumentDeltaStorageService } from '@fluidframework/driver-definitions';
9
+ import { IDocumentMessage } from '@fluidframework/protocol-definitions';
10
+ import { IDocumentService } from '@fluidframework/driver-definitions';
11
+ import { IDocumentServiceFactory } from '@fluidframework/driver-definitions';
12
+ import { IDocumentServicePolicies } from '@fluidframework/driver-definitions';
13
+ import { IDocumentStorageService } from '@fluidframework/driver-definitions';
14
+ import { IDocumentStorageServicePolicies } from '@fluidframework/driver-definitions';
15
+ import { ILocalDeltaConnectionServer } from '@fluidframework/server-local-server';
16
+ import { IRequest } from '@fluidframework/core-interfaces';
17
+ import { IResolvedUrl } from '@fluidframework/driver-definitions';
18
+ import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
19
+ import { ISnapshotTreeEx } from '@fluidframework/protocol-definitions';
20
+ import { IStream } from '@fluidframework/driver-definitions';
21
+ import { ISummaryContext } from '@fluidframework/driver-definitions';
22
+ import { ISummaryHandle } from '@fluidframework/protocol-definitions';
23
+ import { ISummaryTree } from '@fluidframework/protocol-definitions';
24
+ import { ITelemetryBaseLogger } from '@fluidframework/core-interfaces';
25
+ import { ITestDbFactory } from '@fluidframework/server-test-utils';
26
+ import { ITokenProvider } from '@fluidframework/routerlicious-driver';
27
+ import { IUrlResolver } from '@fluidframework/driver-definitions';
28
+ import { IVersion } from '@fluidframework/protocol-definitions';
29
+ import { IWebSocketServer } from '@fluidframework/server-services-core';
30
+ import { NackErrorType } from '@fluidframework/protocol-definitions';
31
+ import type { Socket } from 'socket.io-client';
32
+
33
+ /* Excluded from this release type: createLocalDocumentService */
34
+
35
+ /* Excluded from this release type: createLocalResolverCreateNewRequest */
36
+
37
+ /* Excluded from this release type: DocumentDeltaConnection */
38
+
39
+ /* Excluded from this release type: IDocumentDeltaConnection */
40
+
41
+ /* Excluded from this release type: IDocumentDeltaStorageService */
42
+
43
+ /* Excluded from this release type: IDocumentService */
44
+
45
+ /* Excluded from this release type: IDocumentServiceFactory */
46
+
47
+ /* Excluded from this release type: IDocumentServicePolicies */
48
+
49
+ /* Excluded from this release type: IDocumentStorageService */
50
+
51
+ /* Excluded from this release type: IDocumentStorageServicePolicies */
52
+
53
+ /* Excluded from this release type: IRequest */
54
+
55
+ /* Excluded from this release type: IResolvedUrl */
56
+
57
+ /* Excluded from this release type: IStream */
58
+
59
+ /* Excluded from this release type: ISummaryContext */
60
+
61
+ /* Excluded from this release type: ITelemetryBaseLogger */
62
+
63
+ /* Excluded from this release type: ITokenProvider */
64
+
65
+ /* Excluded from this release type: IUrlResolver */
66
+
67
+ /* Excluded from this release type: LocalDeltaStorageService */
68
+
69
+ /* Excluded from this release type: LocalDocumentDeltaConnection */
70
+
71
+ /* Excluded from this release type: LocalDocumentService */
72
+
73
+ /* Excluded from this release type: LocalDocumentServiceFactory */
74
+
75
+ /* Excluded from this release type: LocalDocumentStorageService */
76
+
77
+ /* Excluded from this release type: LocalResolver */
78
+
79
+ /* Excluded from this release type: LocalSessionStorageDbFactory */
80
+
81
+ export { }
@@ -0,0 +1,224 @@
1
+ import { DocumentDeltaConnection } from '@fluidframework/driver-base';
2
+ import { GitManager } from '@fluidframework/server-services-client';
3
+ import { IClient } from '@fluidframework/protocol-definitions';
4
+ import { ICreateBlobResponse } from '@fluidframework/protocol-definitions';
5
+ import { IDatabaseManager } from '@fluidframework/server-services-core';
6
+ import { IDb } from '@fluidframework/server-services-core';
7
+ import { IDocumentDeltaConnection } from '@fluidframework/driver-definitions';
8
+ import { IDocumentDeltaStorageService } from '@fluidframework/driver-definitions';
9
+ import { IDocumentMessage } from '@fluidframework/protocol-definitions';
10
+ import { IDocumentService } from '@fluidframework/driver-definitions';
11
+ import { IDocumentServiceFactory } from '@fluidframework/driver-definitions';
12
+ import { IDocumentServicePolicies } from '@fluidframework/driver-definitions';
13
+ import { IDocumentStorageService } from '@fluidframework/driver-definitions';
14
+ import { IDocumentStorageServicePolicies } from '@fluidframework/driver-definitions';
15
+ import { ILocalDeltaConnectionServer } from '@fluidframework/server-local-server';
16
+ import { IRequest } from '@fluidframework/core-interfaces';
17
+ import { IResolvedUrl } from '@fluidframework/driver-definitions';
18
+ import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
19
+ import { ISnapshotTreeEx } from '@fluidframework/protocol-definitions';
20
+ import { IStream } from '@fluidframework/driver-definitions';
21
+ import { ISummaryContext } from '@fluidframework/driver-definitions';
22
+ import { ISummaryHandle } from '@fluidframework/protocol-definitions';
23
+ import { ISummaryTree } from '@fluidframework/protocol-definitions';
24
+ import { ITelemetryBaseLogger } from '@fluidframework/core-interfaces';
25
+ import { ITestDbFactory } from '@fluidframework/server-test-utils';
26
+ import { ITokenProvider } from '@fluidframework/routerlicious-driver';
27
+ import { IUrlResolver } from '@fluidframework/driver-definitions';
28
+ import { IVersion } from '@fluidframework/protocol-definitions';
29
+ import { IWebSocketServer } from '@fluidframework/server-services-core';
30
+ import { NackErrorType } from '@fluidframework/protocol-definitions';
31
+ import type { Socket } from 'socket.io-client';
32
+
33
+ /**
34
+ * Creates and returns a document service for local use.
35
+ * @param localDeltaConnectionServer - delta connection server for ops
36
+ * @param tokenProvider - token provider with a single token
37
+ * @param tenantId - ID of tenant
38
+ * @param documentId - ID of document
39
+ * @internal
40
+ */
41
+ export declare function createLocalDocumentService(resolvedUrl: IResolvedUrl, localDeltaConnectionServer: ILocalDeltaConnectionServer, tokenProvider: ITokenProvider, tenantId: string, documentId: string, documentDeltaConnectionsMap: Map<string, LocalDocumentDeltaConnection>, policies?: IDocumentServicePolicies, innerDocumentService?: IDocumentService, logger?: ITelemetryBaseLogger): IDocumentService;
42
+
43
+ /**
44
+ * @alpha
45
+ */
46
+ export declare function createLocalResolverCreateNewRequest(documentId: string): IRequest;
47
+
48
+ /**
49
+ * Provides access to the underlying delta storage on the server for local driver.
50
+ * @internal
51
+ */
52
+ export declare class LocalDeltaStorageService implements IDocumentDeltaStorageService {
53
+ private readonly tenantId;
54
+ private readonly id;
55
+ private readonly databaseManager;
56
+ constructor(tenantId: string, id: string, databaseManager: IDatabaseManager);
57
+ fetchMessages(from: number, to: number | undefined, abortSignal?: AbortSignal, cachedOnly?: boolean): IStream<ISequencedDocumentMessage[]>;
58
+ private getCore;
59
+ }
60
+
61
+ /**
62
+ * Represents a connection to a stream of delta updates
63
+ * @internal
64
+ */
65
+ export declare class LocalDocumentDeltaConnection extends DocumentDeltaConnection {
66
+ /**
67
+ * Create a LocalDocumentDeltaConnection
68
+ * Handle initial messages, contents or signals if they were in queue
69
+ *
70
+ * @param tenantId - the ID of the tenant
71
+ * @param id - document ID
72
+ * @param token - authorization token for storage service
73
+ * @param client - information about the client
74
+ * @param webSocketServer - web socket server to create connection
75
+ */
76
+ static create(tenantId: string, id: string, token: string, client: IClient, webSocketServer: IWebSocketServer, timeoutMs?: number, logger?: ITelemetryBaseLogger): Promise<LocalDocumentDeltaConnection>;
77
+ constructor(socket: Socket, documentId: string, logger?: ITelemetryBaseLogger);
78
+ /**
79
+ * Submits a new delta operation to the server
80
+ */
81
+ submit(messages: IDocumentMessage[]): void;
82
+ /**
83
+ * Submits a new signal to the server
84
+ */
85
+ submitSignal(message: any): void;
86
+ /**
87
+ * Send a "disconnect" message on the socket.
88
+ * @param disconnectReason - The reason of the disconnection.
89
+ */
90
+ disconnectClient(disconnectReason: string): void;
91
+ /**
92
+ * * Sends a "nack" message on the socket.
93
+ * @param code - An error code number that represents the error. It will be a valid HTTP error code.
94
+ * @param type - Type of the Nack.
95
+ * @param message - A message about the nack for debugging/logging/telemetry purposes.
96
+ */
97
+ nackClient(code: number | undefined, type: NackErrorType | undefined, message: any): void;
98
+ }
99
+
100
+ /**
101
+ * Basic implementation of a document service for local use.
102
+ * @internal
103
+ */
104
+ export declare class LocalDocumentService implements IDocumentService {
105
+ readonly resolvedUrl: IResolvedUrl;
106
+ private readonly localDeltaConnectionServer;
107
+ private readonly tokenProvider;
108
+ private readonly tenantId;
109
+ private readonly documentId;
110
+ private readonly documentDeltaConnectionsMap;
111
+ readonly policies: IDocumentServicePolicies;
112
+ private readonly innerDocumentService?;
113
+ private readonly logger?;
114
+ /**
115
+ * @param localDeltaConnectionServer - delta connection server for ops
116
+ * @param tokenProvider - token provider
117
+ * @param tenantId - ID of tenant
118
+ * @param documentId - ID of document
119
+ */
120
+ constructor(resolvedUrl: IResolvedUrl, localDeltaConnectionServer: ILocalDeltaConnectionServer, tokenProvider: ITokenProvider, tenantId: string, documentId: string, documentDeltaConnectionsMap: Map<string, LocalDocumentDeltaConnection>, policies?: IDocumentServicePolicies, innerDocumentService?: IDocumentService | undefined, logger?: ITelemetryBaseLogger | undefined);
121
+ dispose(): void;
122
+ /**
123
+ * Creates and returns a document storage service for local use.
124
+ */
125
+ connectToStorage(): Promise<IDocumentStorageService>;
126
+ /**
127
+ * Creates and returns a delta storage service for local use.
128
+ */
129
+ connectToDeltaStorage(): Promise<IDocumentDeltaStorageService>;
130
+ /**
131
+ * Creates and returns a delta stream for local use.
132
+ * @param client - client data
133
+ */
134
+ connectToDeltaStream(client: IClient): Promise<IDocumentDeltaConnection>;
135
+ }
136
+
137
+ /**
138
+ * Implementation of document service factory for local use.
139
+ * @alpha
140
+ */
141
+ export declare class LocalDocumentServiceFactory implements IDocumentServiceFactory {
142
+ private readonly localDeltaConnectionServer;
143
+ private readonly policies?;
144
+ private readonly innerDocumentService?;
145
+ private readonly documentDeltaConnectionsMap;
146
+ /**
147
+ * @param localDeltaConnectionServer - delta connection server for ops
148
+ */
149
+ constructor(localDeltaConnectionServer: ILocalDeltaConnectionServer, policies?: IDocumentServicePolicies | undefined, innerDocumentService?: IDocumentService | undefined);
150
+ createContainer(createNewSummary: ISummaryTree | undefined, resolvedUrl: IResolvedUrl, logger?: ITelemetryBaseLogger, clientIsSummarizer?: boolean): Promise<IDocumentService>;
151
+ /**
152
+ * Creates and returns a document service for testing using the given resolved
153
+ * URL for the tenant ID, document ID, and token.
154
+ * @param resolvedUrl - resolved URL of document
155
+ */
156
+ createDocumentService(resolvedUrl: IResolvedUrl, logger?: ITelemetryBaseLogger, clientIsSummarizer?: boolean): Promise<IDocumentService>;
157
+ /**
158
+ * Gets the document delta connection for the clientId and asks it to disconnect the client.
159
+ * @param clientId - The ID of the client to be disconnected.
160
+ * @param disconnectReason - The reason of the disconnection.
161
+ */
162
+ disconnectClient(clientId: string, disconnectReason: string): void;
163
+ /**
164
+ * Gets the document delta connection for the clientId and asks it to nack the client.
165
+ * @param clientId - The ID of the client to be Nack'd.
166
+ * @param code - An error code number that represents the error. It will be a valid HTTP error code.
167
+ * @param type - Type of the Nack.
168
+ * @param message - A message about the nack for debugging/logging/telemetry purposes.
169
+ */
170
+ nackClient(clientId: string, code?: number, type?: NackErrorType, message?: any): void;
171
+ }
172
+
173
+ /**
174
+ * @internal
175
+ */
176
+ export declare class LocalDocumentStorageService implements IDocumentStorageService {
177
+ private readonly id;
178
+ private readonly manager;
179
+ readonly policies: IDocumentStorageServicePolicies;
180
+ private readonly localDeltaConnectionServer?;
181
+ private readonly resolvedUrl?;
182
+ protected readonly blobsShaCache: Map<string, string>;
183
+ private readonly summaryTreeUploadManager;
184
+ get repositoryUrl(): string;
185
+ constructor(id: string, manager: GitManager, policies: IDocumentStorageServicePolicies, localDeltaConnectionServer?: ILocalDeltaConnectionServer | undefined, resolvedUrl?: IResolvedUrl | undefined);
186
+ getVersions(versionId: string | null, count: number): Promise<IVersion[]>;
187
+ getSnapshotTree(version?: IVersion): Promise<ISnapshotTreeEx | null>;
188
+ readBlob(blobId: string): Promise<ArrayBufferLike>;
189
+ uploadSummaryWithContext(summary: ISummaryTree, context: ISummaryContext): Promise<string>;
190
+ createBlob(file: ArrayBufferLike): Promise<ICreateBlobResponse>;
191
+ downloadSummary(handle: ISummaryHandle): Promise<ISummaryTree>;
192
+ private getPreviousFullSnapshot;
193
+ }
194
+
195
+ /**
196
+ * Resolves URLs by providing fake URLs which succeed with the other
197
+ * related local classes.
198
+ * @alpha
199
+ */
200
+ export declare class LocalResolver implements IUrlResolver {
201
+ private readonly tenantId;
202
+ private readonly tokenKey;
203
+ constructor();
204
+ /**
205
+ * Resolves URL requests by providing fake URLs with an actually generated
206
+ * token from constant test strings. The root of the URL is fake, but the
207
+ * remaining relative URL can still be parsed.
208
+ * @param request - request to handle
209
+ */
210
+ resolve(request: IRequest): Promise<IResolvedUrl>;
211
+ getAbsoluteUrl(resolvedUrl: IResolvedUrl, relativeUrl: string): Promise<string>;
212
+ createCreateNewRequest(documentId: string): IRequest;
213
+ }
214
+
215
+ /**
216
+ * A database factory for testing that stores data in the browsers session storage
217
+ * @internal
218
+ */
219
+ export declare class LocalSessionStorageDbFactory implements ITestDbFactory {
220
+ readonly testDatabase: IDb;
221
+ connect(): Promise<IDb>;
222
+ }
223
+
224
+ export { }
@@ -1 +1 @@
1
- {"version":3,"file":"localCreateDocument.d.ts","sourceRoot":"","sources":["../src/localCreateDocument.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAMlE,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AAIpE,wBAAsB,cAAc,CACnC,0BAA0B,KAAA,EAC1B,WAAW,EAAE,YAAY,EACzB,OAAO,EAAE,YAAY,iBA6BrB"}
1
+ {"version":3,"file":"localCreateDocument.d.ts","sourceRoot":"","sources":["../src/localCreateDocument.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EAAE,YAAY,EAAE,MAAM,oCAAoC;OAM1D,EAAE,YAAY,EAAE,MAAM,sCAAsC;AAInE,wBAAsB,cAAc,CACnC,0BAA0B,KAAA,EAC1B,WAAW,EAAE,YAAY,EACzB,OAAO,EAAE,YAAY,iBA6BrB"}