polfan-server-js-client 0.2.3 → 0.2.7

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 (93) hide show
  1. package/.idea/copilot.data.migration.agent.xml +6 -0
  2. package/.idea/copilot.data.migration.ask.xml +6 -0
  3. package/.idea/copilot.data.migration.ask2agent.xml +6 -0
  4. package/.idea/copilot.data.migration.edit.xml +6 -0
  5. package/.idea/workspace.xml +401 -177
  6. package/README.md +22 -2
  7. package/babel.config.js +4 -5
  8. package/build/index.cjs.js +4595 -1816
  9. package/build/index.cjs.js.map +1 -1
  10. package/build/index.umd.js +1 -1
  11. package/build/index.umd.js.map +1 -1
  12. package/build/types/AbstractChatClient.d.ts +14 -2
  13. package/build/types/FilesClient.d.ts +7 -6
  14. package/build/types/IndexedObjectCollection.d.ts +4 -3
  15. package/build/types/Permissions.d.ts +4 -0
  16. package/build/types/WebSocketChatClient.d.ts +23 -0
  17. package/build/types/state-tracker/ChatStateTracker.d.ts +5 -0
  18. package/build/types/state-tracker/RelationshipsManager.d.ts +15 -0
  19. package/build/types/state-tracker/RoomMessagesHistory.d.ts +2 -0
  20. package/build/types/state-tracker/SpacesManager.d.ts +1 -0
  21. package/build/types/state-tracker/TopicHistoryWindow.d.ts +23 -6
  22. package/build/types/state-tracker/UsersManager.d.ts +3 -1
  23. package/build/types/types/src/index.d.ts +14 -3
  24. package/build/types/types/src/schemes/Emoticon.d.ts +1 -0
  25. package/build/types/types/src/schemes/Message.d.ts +1 -1
  26. package/build/types/types/src/schemes/Room.d.ts +2 -0
  27. package/build/types/types/src/schemes/RoomHistory.d.ts +5 -0
  28. package/build/types/types/src/schemes/RoomMember.d.ts +3 -0
  29. package/build/types/types/src/schemes/RoomSummary.d.ts +1 -0
  30. package/build/types/types/src/schemes/SpaceSummary.d.ts +1 -0
  31. package/build/types/types/src/schemes/User.d.ts +2 -2
  32. package/build/types/types/src/schemes/UserRelationship.d.ts +6 -0
  33. package/build/types/types/src/schemes/commands/CreateMessage.d.ts +2 -0
  34. package/build/types/types/src/schemes/commands/CreateRelationship.d.ts +5 -0
  35. package/build/types/types/src/schemes/commands/CreateTopic.d.ts +5 -2
  36. package/build/types/types/src/schemes/commands/DeleteRelationship.d.ts +5 -0
  37. package/build/types/types/src/schemes/commands/GetRelationships.d.ts +2 -0
  38. package/build/types/types/src/schemes/commands/Ping.d.ts +2 -0
  39. package/build/types/types/src/schemes/commands/UpdateRoom.d.ts +2 -0
  40. package/build/types/types/src/schemes/commands/UpdateRoomMember.d.ts +7 -0
  41. package/build/types/types/src/schemes/commands/UpdateSpaceMember.d.ts +5 -0
  42. package/build/types/types/src/schemes/events/NewRelationship.d.ts +4 -0
  43. package/build/types/types/src/schemes/events/Pong.d.ts +2 -0
  44. package/build/types/types/src/schemes/events/RelationshipDeleted.d.ts +4 -0
  45. package/build/types/types/src/schemes/events/Relationships.d.ts +4 -0
  46. package/build/types/types/src/schemes/events/RoomSummaryUpdated.d.ts +7 -0
  47. package/build/types/types/src/schemes/events/Session.d.ts +1 -0
  48. package/package.json +15 -28
  49. package/src/AbstractChatClient.ts +30 -4
  50. package/src/FilesClient.ts +26 -13
  51. package/src/IndexedObjectCollection.ts +26 -10
  52. package/src/Permissions.ts +1 -0
  53. package/src/WebSocketChatClient.ts +92 -14
  54. package/src/state-tracker/ChatStateTracker.ts +22 -6
  55. package/src/state-tracker/EmoticonsManager.ts +6 -4
  56. package/src/state-tracker/MessagesManager.ts +3 -4
  57. package/src/state-tracker/RelationshipsManager.ts +68 -0
  58. package/src/state-tracker/RoomMessagesHistory.ts +20 -3
  59. package/src/state-tracker/RoomsManager.ts +38 -8
  60. package/src/state-tracker/SpacesManager.ts +28 -1
  61. package/src/state-tracker/TopicHistoryWindow.ts +92 -32
  62. package/src/state-tracker/UsersManager.ts +16 -6
  63. package/src/types/src/index.ts +30 -5
  64. package/src/types/src/schemes/Emoticon.ts +1 -0
  65. package/src/types/src/schemes/Message.ts +1 -1
  66. package/src/types/src/schemes/Room.ts +2 -0
  67. package/src/types/src/schemes/RoomHistory.ts +6 -0
  68. package/src/types/src/schemes/RoomMember.ts +3 -0
  69. package/src/types/src/schemes/RoomSummary.ts +1 -0
  70. package/src/types/src/schemes/SpaceSummary.ts +1 -0
  71. package/src/types/src/schemes/User.ts +2 -2
  72. package/src/types/src/schemes/UserRelationship.ts +8 -0
  73. package/src/types/src/schemes/commands/CreateMessage.ts +2 -0
  74. package/src/types/src/schemes/commands/CreateRelationship.ts +6 -0
  75. package/src/types/src/schemes/commands/CreateTopic.ts +6 -2
  76. package/src/types/src/schemes/commands/DeleteRelationship.ts +6 -0
  77. package/src/types/src/schemes/commands/GetRelationships.ts +3 -0
  78. package/src/types/src/schemes/commands/Ping.ts +3 -0
  79. package/src/types/src/schemes/commands/UpdateRoom.ts +2 -0
  80. package/src/types/src/schemes/commands/UpdateRoomMember.ts +7 -0
  81. package/src/types/src/schemes/commands/UpdateSpaceMember.ts +5 -0
  82. package/src/types/src/schemes/events/NewRelationship.ts +5 -0
  83. package/src/types/src/schemes/events/Pong.ts +3 -0
  84. package/src/types/src/schemes/events/RelationshipDeleted.ts +5 -0
  85. package/src/types/src/schemes/events/Relationships.ts +5 -0
  86. package/src/types/src/schemes/events/RoomSummaryUpdated.ts +8 -0
  87. package/src/types/src/schemes/events/Session.ts +1 -0
  88. package/tests/history-window.test.ts +6 -1
  89. package/webpack.config.browser.js +2 -24
  90. package/webpack.config.node.js +2 -14
  91. package/.eslintignore +0 -0
  92. package/.eslintrc.json +0 -0
  93. package/src/types/src/schemes/commands/SetCustomNick.ts +0 -5
@@ -0,0 +1,5 @@
1
+ import {UserRelationship} from "../UserRelationship";
2
+
3
+ export interface Relationships {
4
+ relationships: UserRelationship[];
5
+ }
@@ -0,0 +1,8 @@
1
+ import {RoomSummary} from "../RoomSummary";
2
+
3
+ export interface RoomSummaryUpdated {
4
+ /**
5
+ * Partial summary: without the `extras` field.
6
+ */
7
+ summary: RoomSummary;
8
+ }
@@ -3,6 +3,7 @@ import {User} from "../User";
3
3
 
4
4
  export interface Session {
5
5
  serverVersion: string;
6
+ protoVersion: string;
6
7
  state: UserState;
7
8
  user: User;
8
9
  }
@@ -1,4 +1,5 @@
1
- import {TraversableRemoteCollection, WindowState} from "../src/state-tracker/TopicHistoryWindow";
1
+ import { IndexedObjectCollection } from "../src";
2
+ import {TopicHistoryWindow, TraversableRemoteCollection, WindowState} from "../src/state-tracker/TopicHistoryWindow";
2
3
 
3
4
  interface SimpleMessage {
4
5
  id: number;
@@ -18,6 +19,10 @@ const messages: SimpleMessage[] = [
18
19
  ];
19
20
 
20
21
  class TestableHistoryWindow extends TraversableRemoteCollection<SimpleMessage> {
22
+ public createMirror(): TraversableRemoteCollection<SimpleMessage> {
23
+ throw new Error('Method not implemented.');
24
+ }
25
+
21
26
  public constructor() {
22
27
  super('id');
23
28
  }
@@ -1,6 +1,5 @@
1
1
  const path = require('path');
2
- const TerserPlugin = require('terser-webpack-plugin');
3
- const MiniCssExtractPlugin = require("mini-css-extract-plugin");
2
+ const TerserPlugin = require("terser-webpack-plugin");
4
3
 
5
4
  module.exports = {
6
5
  mode: "production",
@@ -27,32 +26,11 @@ module.exports = {
27
26
  test: /\.(m|j|t)s$/,
28
27
  exclude: /(node_modules|bower_components)/,
29
28
  use: {
30
- loader: 'babel-loader',
31
- options: {
32
- presets: [
33
- ['@babel/preset-env', { targets: { esmodules: true } }],
34
- '@babel/preset-typescript'
35
- ],
36
- plugins: [
37
-
38
- ]
39
- }
29
+ loader: 'babel-loader'
40
30
  }
41
31
  },
42
- {
43
- test: /\.(sa|sc|c)ss$/,
44
- use: [
45
- MiniCssExtractPlugin.loader,
46
- { loader: "css-loader", options: { sourceMap: true } },
47
- ],
48
- }
49
32
  ]
50
33
  },
51
- plugins: [
52
- new MiniCssExtractPlugin({
53
- filename: 'index.css',
54
- }),
55
- ],
56
34
  resolve: {
57
35
  extensions: ['.ts', '.js', '.json']
58
36
  }
@@ -24,24 +24,12 @@ module.exports = {
24
24
  test: /\.(m|j|t)s$/,
25
25
  exclude: /(node_modules|bower_components)/,
26
26
  use: {
27
- loader: 'babel-loader',
28
- options: {
29
- presets: [
30
- ['@babel/preset-env', { targets: { node: 'current' } }],
31
- '@babel/preset-typescript'
32
- ],
33
- plugins: [
34
-
35
- ]
36
- }
27
+ loader: 'babel-loader'
37
28
  }
38
29
  },
39
30
  ]
40
31
  },
41
32
  resolve: {
42
33
  extensions: ['.ts', '.js', '.json']
43
- },
44
- externals: [
45
-
46
- ]
34
+ }
47
35
  };
package/.eslintignore DELETED
File without changes
package/.eslintrc.json DELETED
File without changes
@@ -1,5 +0,0 @@
1
- export interface SetCustomNick {
2
- spaceId: string;
3
- userId: string;
4
- nick: string|null;
5
- }