amule-ec-client 0.5.2 → 0.6.1

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 (44) hide show
  1. package/README.md +4 -0
  2. package/dist/AddLinkRequest-D2IME4eb.js +15 -0
  3. package/dist/ClientQueueRequest-DFfCiNcz.js +15 -0
  4. package/dist/ClientQueueResponse-JTrBqrr1.js +63 -0
  5. package/dist/Codes-CjiW7Pdl.js +409 -0
  6. package/dist/CreateCategoryRequest-CRUMcPo5.js +22 -0
  7. package/dist/DeleteCategoryRequest-C8v9oGZ-.js +15 -0
  8. package/dist/DownloadCommandRequest-B3KV_bvm.js +29 -0
  9. package/dist/DownloadFileRequest-BjrroO3h.js +18 -0
  10. package/dist/DownloadQueueRequest-Dil5hl3D.js +15 -0
  11. package/dist/DownloadQueueResponse-DUam_zNf.js +259 -0
  12. package/dist/GetPreferencesRequest-DsxlghqT.js +16 -0
  13. package/dist/PreferencesDetailsResponse-DapscVQi.js +94 -0
  14. package/dist/PreferencesResponse-8n1STWUZ.js +37 -0
  15. package/dist/ReloadSharedFilesRequest-kt0Pxs8A.js +13 -0
  16. package/dist/Request-C0UUuQIX.js +158 -0
  17. package/dist/SearchProgressResponse-C1CdzKnz.js +15 -0
  18. package/dist/SearchRequest-DQnKfA5Z.js +55 -0
  19. package/dist/SearchResultsRequest-2ejFGQmQ.js +13 -0
  20. package/dist/SearchResultsResponse-DwmvbQop.js +29 -0
  21. package/dist/SearchStatusRequest-B_xr4-72.js +13 -0
  22. package/dist/SearchStopRequest-8hwXobty.js +13 -0
  23. package/dist/ServerConnectRequest-BhNpGiEJ.js +18 -0
  24. package/dist/ServerDisconnectRequest-BjCitLtU.js +13 -0
  25. package/dist/ServerListRequest-BWXLGJib.js +13 -0
  26. package/dist/ServerListResponse-BUJ7sz5p.js +50 -0
  27. package/dist/ServerUpdateFromUrlRequest-K8C_d0UQ.js +12 -0
  28. package/dist/SetFileCategoryRequest-VwroLBTV.js +15 -0
  29. package/dist/SetPreferencesRequest-KZ23VaBY.js +64 -0
  30. package/dist/SharedFilePriorityRequest-7BriqAcr.js +13 -0
  31. package/dist/SharedFilesRequest-B72XyRcA.js +15 -0
  32. package/dist/SharedFilesResponse-CkqvYd3N.js +39 -0
  33. package/dist/StatsRequest-CGGumOOx.js +15 -0
  34. package/dist/StatsResponse-DxQk686g.js +76 -0
  35. package/dist/Tag-CZF6BRMY.js +260 -0
  36. package/dist/UpdateCategoryRequest-CzKJa_rC.js +22 -0
  37. package/dist/UpdateRequest-g2ReOQ5m.js +15 -0
  38. package/dist/UpdateResponse-CGwVjn0Y.js +45 -0
  39. package/dist/download-details-OM0FJUhZ.js +10 -0
  40. package/dist/index.d.ts +1042 -933
  41. package/dist/index.js +1041 -3123
  42. package/dist/utils-DBnUQnZ-.js +24 -0
  43. package/package.json +5 -5
  44. package/dist/index.js.map +0 -1
@@ -0,0 +1,22 @@
1
+ import { t as Request } from "./Request-C0UUuQIX.js";
2
+ import "./Codes-CjiW7Pdl.js";
3
+ import { a as StringTag, l as UIntTag, s as UByteTag } from "./Tag-CZF6BRMY.js";
4
+ //#region src/request/UpdateCategoryRequest.ts
5
+ /**
6
+ * Update Category Request - Update an existing category
7
+ */
8
+ var UpdateCategoryRequest = class extends Request {
9
+ constructor(id, category) {
10
+ super(66);
11
+ const subtags = [
12
+ new StringTag(4354, category.name),
13
+ new StringTag(4355, category.path),
14
+ new StringTag(4356, category.comment),
15
+ new UIntTag(4357, category.color),
16
+ new UByteTag(4358, category.priority)
17
+ ];
18
+ this.addTag(new UIntTag(4353, id, subtags));
19
+ }
20
+ };
21
+ //#endregion
22
+ export { UpdateCategoryRequest };
@@ -0,0 +1,15 @@
1
+ import { t as Request } from "./Request-C0UUuQIX.js";
2
+ import "./Codes-CjiW7Pdl.js";
3
+ import { s as UByteTag } from "./Tag-CZF6BRMY.js";
4
+ //#region src/request/UpdateRequest.ts
5
+ /**
6
+ * Update Request - Get incremental updates for files, clients, and servers
7
+ */
8
+ var UpdateRequest = class extends Request {
9
+ constructor(detailLevel = 4) {
10
+ super(82);
11
+ this.addTag(new UByteTag(4, detailLevel));
12
+ }
13
+ };
14
+ //#endregion
15
+ export { UpdateRequest };
@@ -0,0 +1,45 @@
1
+ import "./Codes-CjiW7Pdl.js";
2
+ import { f as findNumericTag, p as findTag } from "./Tag-CZF6BRMY.js";
3
+ import { n as toOptionalBool, r as toOptionalIp } from "./utils-DBnUQnZ-.js";
4
+ import { ClientQueueResponseParser } from "./ClientQueueResponse-JTrBqrr1.js";
5
+ import { DownloadQueueResponseParser } from "./DownloadQueueResponse-DUam_zNf.js";
6
+ import { ServerListResponseParser } from "./ServerListResponse-BUJ7sz5p.js";
7
+ import { SharedFilesResponseParser } from "./SharedFilesResponse-CkqvYd3N.js";
8
+ //#region src/response/UpdateResponse.ts
9
+ var UpdateResponseParser = class {
10
+ static fromPacket(packet) {
11
+ const sharedFiles = SharedFilesResponseParser.fromPacket(packet).files;
12
+ const downloadQueue = DownloadQueueResponseParser.fromPacket(packet).files;
13
+ const clientContainer = findTag(packet.tags, 1536);
14
+ const clients = clientContainer && clientContainer.nestedTags ? ClientQueueResponseParser.fromTags(clientContainer.nestedTags).clients : [];
15
+ const serverContainer = findTag(packet.tags, 1280);
16
+ const servers = serverContainer && serverContainer.nestedTags ? ServerListResponseParser.fromTags(serverContainer.nestedTags).servers : [];
17
+ const friendContainer = findTag(packet.tags, 2048);
18
+ return {
19
+ sharedFiles,
20
+ downloadQueue,
21
+ clients,
22
+ servers,
23
+ friends: friendContainer && friendContainer.nestedTags ? this.parseFriends(friendContainer.nestedTags) : []
24
+ };
25
+ }
26
+ static parseFriends(tags) {
27
+ const friends = [];
28
+ const friendTags = tags.filter((t) => t.name === 2048);
29
+ for (const friendTag of friendTags) {
30
+ const nested = friendTag.nestedTags || [];
31
+ friends.push({
32
+ name: findTag(nested, 2049)?.getValue(),
33
+ userHashHexString: findTag(nested, 2050)?.getValue()?.toString("hex"),
34
+ ip: toOptionalIp(findNumericTag(nested, 2051)?.getInt()),
35
+ port: findNumericTag(nested, 2052)?.getInt(),
36
+ friendSlot: toOptionalBool(findNumericTag(nested, 2056)?.getInt()),
37
+ shared: toOptionalBool(findNumericTag(nested, 2057)?.getInt()),
38
+ client: ClientQueueResponseParser.fromTags(nested).clients[0]
39
+ });
40
+ }
41
+ return friends;
42
+ }
43
+ };
44
+ //#endregion
45
+ export { UpdateResponseParser };
@@ -0,0 +1,10 @@
1
+ //#region src/types/download-details.ts
2
+ const PARTSIZE = 9728e3;
3
+ const ChunkStatus = {
4
+ UNAVAILABLE: 0,
5
+ AVAILABLE: 1,
6
+ COMPLETE: 2,
7
+ DOWNLOADING: 3
8
+ };
9
+ //#endregion
10
+ export { PARTSIZE as n, ChunkStatus as t };