@ fluid-tools/ fach-tool (英语)
使用 ODSP 或路由驱动器连接,将信件或快照信息丢入服务器 .
要连接到 ODSP, 必须将客户端ID 设定为环境变量 fetch__tool__clientId。如果您可以访问密钥断层,可以通过运行实现 此工具。 。 。 .
当心在微软租户的文档上使用取取工具时,需要遵循取取工具在内部Fluid wiki"调试工具"页面上的取取工具使用指令.
注: 此软件包是用于 微软/流体框架 仓库. 不要将此套件作为公共依赖. 我们不保证这一一揽子计划或其API的稳定.
安装
运行此命令以安装软件包 :
npm i @fluid-tools/fetch-tool -D
使用量
Usage: fluid-fetch [options] "URL"
URL: <ODSP joinSession URL>|<Routerlicious URL>
Options:
--dump:rawmessage : dump all messages
--dump:rawmessage:overwrite : dump all messages and overwrite existing messages.json
--dump:snapshotVersion : dump a list of snapshot version
--dump:snapshotTree : dump the snapshot trees
--dump:snapshotBlob : dump the contents of snapshot blobs
--stat:message : show a table of message type counts and size
--stat:snapshot : show a table of snapshot path and blob size
--stat:dataType : show a table of data type
--stat:channel : show a table of channel
--filter:messageType <type> : filter message by <type>
--jwt <token> : token to be used for routerlicious URLs
--numSnapshotVersions <number> : Number of versions to load (default:10)
--snapshotVersionIndex <number> : Index of the version to dump
--saveDir <outdir> : Save data of the snapshots and messages
--loginHint <user> : Username to prefill for interactive authentication against ODSP
提示
- 如果还没有完成运行
npm run build - 示例命令 - 运行
node lib/fluidFetch.js --saveDir example 'get-versions-fetch-url'输入fetch-tool目录- 看这个
getVersions调用相关的驱动程序以构建右侧的 url - 如果您可以访问文档,也可以查看标准浏览器的devtools,也可以在那里查看url.
- 此命令创建
example目录( 如果不存在)fetch-tool文件夹. - 如果多次运行而不清除
example目录,快照将覆盖任何旧文件夹或文件.
- 看这个
- 看着
example目录 :- 转到
1-XYZ/decoded/tree.json看那棵快照树. - 每个
'#-XYZ'字符串在tree.json与解码文件夹中的文件相关。 这些文件基本上是杂碎的. 0-XYZ/decoded/tree.json是一个更古老的快照树.- 这个
messages.json是存储的操作/消息列表.
- 转到
- 如上所述,401个认证错误请检查: 钥匙 已经运行.
示例输出
信件显示
--stat:消息
105 total messages (103 delta storage, 2 initial ws messages, 0 dup)
Message Type (All) | Count Bytes
----------------------------------------------------------------------------------------------------
join | 19 7588
propose | 1 269
noop | 15 2806
attach | 1 278
op | 53 23854
leave | 16 3810
----------------------------------------------------------------------------------------------------
Total | 105 38605
--stat:数据类型
107 total messages (105 delta storage, 2 initial ws messages, 0 dup)
Data Type (Operations only) | Count Bytes
----------------------------------------------------------------------------------------------------
map | 28 13172
mergeTree | 20 7450
----------------------------------------------------------------------------------------------------
Total | 48 20622
--stat:频道
109 total messages (107 delta storage, 2 initial ws messages, 0 dup)
Channel name (Operations only) | Count Bytes
----------------------------------------------------------------------------------------------------
[defaultDataStore]/root (map) | 3 1232
[defaultDataStore]/0fb26504-369f-4234-ad97-0a303d3ec81f (map) | 0 0
[defaultDataStore]/74577601-3af5-49a1-9ca5-db5d9ee128a8 (mergeTree) | 20 7450
[defaultDataStore]/91ac6df2-dda6-409a-b5e3-be84ce9ab138 (map) | 25 11940
[defaultDataStore]/92ebb388-68a0-4fc2-859e-5c01f12e992d (map) | 0 0
----------------------------------------------------------------------------------------------------
Total | 48 20622
抓图
--stat: snapshot (英语)
Blob Path | Bytes
----------------------------------------------------------------------------------------------------
!CONTAINER!/.attributes | 156
!CONTAINER!/.blobs | 4
!CONTAINER!/.gitmodules | 140
!CONTAINER!/deltas | 872
!CONTAINER!/quorumMembers | 220
!CONTAINER!/quorumProposals | 4
!CONTAINER!/quorumValues | 184
[defaultDataStore]/.component | 32
[defaultDataStore]/0fb26504-369f-4234-ad97-0a303d3ec81f/.attributes | 64
[defaultDataStore]/0fb26504-369f-4234-ad97-0a303d3ec81f/header | 4
[defaultDataStore]/74577601-3af5-49a1-9ca5-db5d9ee128a8/.attributes | 72
[defaultDataStore]/74577601-3af5-49a1-9ca5-db5d9ee128a8/content/header | 448
[defaultDataStore]/74577601-3af5-49a1-9ca5-db5d9ee128a8/content/catchupOps | 4
[defaultDataStore]/74577601-3af5-49a1-9ca5-db5d9ee128a8/header | 180
[defaultDataStore]/91ac6df2-dda6-409a-b5e3-be84ce9ab138/.attributes | 64
[defaultDataStore]/91ac6df2-dda6-409a-b5e3-be84ce9ab138/header | 168
[defaultDataStore]/92ebb388-68a0-4fc2-859e-5c01f12e992d/.attributes | 64
[defaultDataStore]/92ebb388-68a0-4fc2-859e-5c01f12e992d/header | 4
[defaultDataStore]/root/.attributes | 64
[defaultDataStore]/root/header | 300
----------------------------------------------------------------------------------------------------
Total snapshot size | 3048
调试
如果您想要调试取取工具,可以创建单位测试. 记住要添加 tsconfig.json 并在 devdependents 中列出摩查.
在单位测试中,可以使用 setArguments() 从流体FetchArgs到通过您想要测试的参数。 然后调用您想要运行的方法, 您可以在 vscode 中设置断点 .
示例
describe("fetch tool", () => {
it("can fetch messages", async () => {
fluidFetchArgs.setArguments(your_args);
const documentService = await fluidFetchInit(your_paramURL);
await fluidFetchMessages(documentService, your_saveDir);
});
});
贡献准则
你们可以 贡献 通过这些方式实现流体框架:
详细指示改为: repo 文档。 。 。 .
本项目遵循 Microsoft 开源行为守则。 。 。 . 更多信息,改为: 《行为守则》经常被问到的问题。 。 。 . 问题或评论,联系 打开码@ microsoft.com。 。 。 .
这个项目可能包含微软项目的商标或标志,产品,或服务. 这些商标或标志的使用必须遵循微软 商标和品牌准则。 。 。 . 在这个项目的修改后版本中使用微软商标或标志不得造成混淆或暗示微软赞助.
帮助
读取 流体框架文件 用于了解流体框架概念和API.
要求提供文件未载列的资料, 创建问题。 。 。 .
商标
这个项目可能包含微软项目的商标或标志,产品,或服务.
这些商标或标志的使用必须遵循微软的 商标和品牌准则。 。 。 .
在这个项目的修改后版本中使用微软商标或标志不得造成混淆或暗示微软赞助.