@simplex-chat/types 0.0.2 → 0.0.4

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.
@@ -319,7 +319,7 @@ export interface APIUpdateProfile {
319
319
  profile: T.Profile;
320
320
  }
321
321
  export declare namespace APIUpdateProfile {
322
- type Response = CR.UserProfileUpdated | CR.ChatCmdError;
322
+ type Response = CR.UserProfileUpdated | CR.UserProfileNoChange | CR.ChatCmdError;
323
323
  function cmdString(self: APIUpdateProfile): string;
324
324
  }
325
325
  export interface APISetContactPrefs {
package/dist/events.d.ts CHANGED
@@ -43,7 +43,7 @@ export declare namespace CEvt {
43
43
  export interface NewChatItems extends Interface {
44
44
  type: "newChatItems";
45
45
  user: T.User;
46
- chatItems: [T.AChatItem];
46
+ chatItems: T.AChatItem[];
47
47
  }
48
48
  export interface ChatItemReaction extends Interface {
49
49
  type: "chatItemReaction";
@@ -54,7 +54,7 @@ export declare namespace CEvt {
54
54
  export interface ChatItemsDeleted extends Interface {
55
55
  type: "chatItemsDeleted";
56
56
  user: T.User;
57
- chatItemDeletions: [T.ChatItemDeletion];
57
+ chatItemDeletions: T.ChatItemDeletion[];
58
58
  byUser: boolean;
59
59
  timed: boolean;
60
60
  }
@@ -67,14 +67,14 @@ export declare namespace CEvt {
67
67
  type: "groupChatItemsDeleted";
68
68
  user: T.User;
69
69
  groupInfo: T.GroupInfo;
70
- chatItemIDs: [number];
70
+ chatItemIDs: number[];
71
71
  byUser: boolean;
72
72
  member_?: T.GroupMember;
73
73
  }
74
74
  export interface ChatItemsStatusesUpdated extends Interface {
75
75
  type: "chatItemsStatusesUpdated";
76
76
  user: T.User;
77
- chatItems: [T.AChatItem];
77
+ chatItems: T.AChatItem[];
78
78
  }
79
79
  export interface ReceivedGroupInvitation extends Interface {
80
80
  type: "receivedGroupInvitation";
@@ -284,7 +284,7 @@ export declare namespace CEvt {
284
284
  }
285
285
  export interface ChatErrors extends Interface {
286
286
  type: "chatErrors";
287
- chatErrors: [T.ChatError];
287
+ chatErrors: T.ChatError[];
288
288
  }
289
289
  export {};
290
290
  }
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  export * as CC from "./commands";
2
2
  export { ChatResponse, CR } from "./responses";
3
3
  export { ChatEvent, CEvt } from "./events";
4
- export * from "./types";
4
+ export * as T from "./types";
package/dist/index.js CHANGED
@@ -1,20 +1,6 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
2
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.CC = void 0;
3
+ exports.T = exports.CC = void 0;
18
4
  exports.CC = require("./commands");
19
- __exportStar(require("./types"), exports);
5
+ exports.T = require("./types");
20
6
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,mCAAgC;AAGhC,0CAAuB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,mCAAgC;AAGhC,+BAA4B"}
@@ -1,7 +1,7 @@
1
1
  import * as T from "./types";
2
- export type ChatResponse = CR.AcceptingContactRequest | CR.ActiveUser | CR.ChatItemNotChanged | CR.ChatItemReaction | CR.ChatItemUpdated | CR.ChatItemsDeleted | CR.CmdOk | CR.ChatCmdError | CR.ConnectionPlan | CR.ContactAlreadyExists | CR.ContactConnectionDeleted | CR.ContactDeleted | CR.ContactPrefsUpdated | CR.ContactRequestRejected | CR.ContactsList | CR.GroupDeletedUser | CR.GroupLink | CR.GroupLinkCreated | CR.GroupLinkDeleted | CR.GroupCreated | CR.GroupMembers | CR.GroupUpdated | CR.GroupsList | CR.Invitation | CR.LeftMemberUser | CR.MemberAccepted | CR.MembersBlockedForAllUser | CR.MembersRoleUser | CR.NewChatItems | CR.RcvFileAccepted | CR.RcvFileAcceptedSndCancelled | CR.RcvFileCancelled | CR.SentConfirmation | CR.SentGroupInvitation | CR.SentInvitation | CR.SndFileCancelled | CR.UserAcceptedGroupSent | CR.UserContactLink | CR.UserContactLinkCreated | CR.UserContactLinkDeleted | CR.UserContactLinkUpdated | CR.UserDeletedMembers | CR.UserProfileUpdated | CR.UsersList;
2
+ export type ChatResponse = CR.AcceptingContactRequest | CR.ActiveUser | CR.ChatItemNotChanged | CR.ChatItemReaction | CR.ChatItemUpdated | CR.ChatItemsDeleted | CR.CmdOk | CR.ChatCmdError | CR.ConnectionPlan | CR.ContactAlreadyExists | CR.ContactConnectionDeleted | CR.ContactDeleted | CR.ContactPrefsUpdated | CR.ContactRequestRejected | CR.ContactsList | CR.GroupDeletedUser | CR.GroupLink | CR.GroupLinkCreated | CR.GroupLinkDeleted | CR.GroupCreated | CR.GroupMembers | CR.GroupUpdated | CR.GroupsList | CR.Invitation | CR.LeftMemberUser | CR.MemberAccepted | CR.MembersBlockedForAllUser | CR.MembersRoleUser | CR.NewChatItems | CR.RcvFileAccepted | CR.RcvFileAcceptedSndCancelled | CR.RcvFileCancelled | CR.SentConfirmation | CR.SentGroupInvitation | CR.SentInvitation | CR.SndFileCancelled | CR.UserAcceptedGroupSent | CR.UserContactLink | CR.UserContactLinkCreated | CR.UserContactLinkDeleted | CR.UserContactLinkUpdated | CR.UserDeletedMembers | CR.UserProfileUpdated | CR.UserProfileNoChange | CR.UsersList;
3
3
  export declare namespace CR {
4
- export type Tag = "acceptingContactRequest" | "activeUser" | "chatItemNotChanged" | "chatItemReaction" | "chatItemUpdated" | "chatItemsDeleted" | "cmdOk" | "chatCmdError" | "connectionPlan" | "contactAlreadyExists" | "contactConnectionDeleted" | "contactDeleted" | "contactPrefsUpdated" | "contactRequestRejected" | "contactsList" | "groupDeletedUser" | "groupLink" | "groupLinkCreated" | "groupLinkDeleted" | "groupCreated" | "groupMembers" | "groupUpdated" | "groupsList" | "invitation" | "leftMemberUser" | "memberAccepted" | "membersBlockedForAllUser" | "membersRoleUser" | "newChatItems" | "rcvFileAccepted" | "rcvFileAcceptedSndCancelled" | "rcvFileCancelled" | "sentConfirmation" | "sentGroupInvitation" | "sentInvitation" | "sndFileCancelled" | "userAcceptedGroupSent" | "userContactLink" | "userContactLinkCreated" | "userContactLinkDeleted" | "userContactLinkUpdated" | "userDeletedMembers" | "userProfileUpdated" | "usersList";
4
+ export type Tag = "acceptingContactRequest" | "activeUser" | "chatItemNotChanged" | "chatItemReaction" | "chatItemUpdated" | "chatItemsDeleted" | "cmdOk" | "chatCmdError" | "connectionPlan" | "contactAlreadyExists" | "contactConnectionDeleted" | "contactDeleted" | "contactPrefsUpdated" | "contactRequestRejected" | "contactsList" | "groupDeletedUser" | "groupLink" | "groupLinkCreated" | "groupLinkDeleted" | "groupCreated" | "groupMembers" | "groupUpdated" | "groupsList" | "invitation" | "leftMemberUser" | "memberAccepted" | "membersBlockedForAllUser" | "membersRoleUser" | "newChatItems" | "rcvFileAccepted" | "rcvFileAcceptedSndCancelled" | "rcvFileCancelled" | "sentConfirmation" | "sentGroupInvitation" | "sentInvitation" | "sndFileCancelled" | "userAcceptedGroupSent" | "userContactLink" | "userContactLinkCreated" | "userContactLinkDeleted" | "userContactLinkUpdated" | "userDeletedMembers" | "userProfileUpdated" | "userProfileNoChange" | "usersList";
5
5
  interface Interface {
6
6
  type: Tag;
7
7
  }
@@ -33,7 +33,7 @@ export declare namespace CR {
33
33
  export interface ChatItemsDeleted extends Interface {
34
34
  type: "chatItemsDeleted";
35
35
  user: T.User;
36
- chatItemDeletions: [T.ChatItemDeletion];
36
+ chatItemDeletions: T.ChatItemDeletion[];
37
37
  byUser: boolean;
38
38
  timed: boolean;
39
39
  }
@@ -81,7 +81,7 @@ export declare namespace CR {
81
81
  export interface ContactsList extends Interface {
82
82
  type: "contactsList";
83
83
  user: T.User;
84
- contacts: [T.Contact];
84
+ contacts: T.Contact[];
85
85
  }
86
86
  export interface GroupDeletedUser extends Interface {
87
87
  type: "groupDeletedUser";
@@ -125,7 +125,7 @@ export declare namespace CR {
125
125
  export interface GroupsList extends Interface {
126
126
  type: "groupsList";
127
127
  user: T.User;
128
- groups: [T.GroupInfoSummary];
128
+ groups: T.GroupInfoSummary[];
129
129
  }
130
130
  export interface Invitation extends Interface {
131
131
  type: "invitation";
@@ -148,20 +148,20 @@ export declare namespace CR {
148
148
  type: "membersBlockedForAllUser";
149
149
  user: T.User;
150
150
  groupInfo: T.GroupInfo;
151
- members: [T.GroupMember];
151
+ members: T.GroupMember[];
152
152
  blocked: boolean;
153
153
  }
154
154
  export interface MembersRoleUser extends Interface {
155
155
  type: "membersRoleUser";
156
156
  user: T.User;
157
157
  groupInfo: T.GroupInfo;
158
- members: [T.GroupMember];
158
+ members: T.GroupMember[];
159
159
  toRole: T.GroupMemberRole;
160
160
  }
161
161
  export interface NewChatItems extends Interface {
162
162
  type: "newChatItems";
163
163
  user: T.User;
164
- chatItems: [T.AChatItem];
164
+ chatItems: T.AChatItem[];
165
165
  }
166
166
  export interface RcvFileAccepted extends Interface {
167
167
  type: "rcvFileAccepted";
@@ -203,7 +203,7 @@ export declare namespace CR {
203
203
  user: T.User;
204
204
  chatItem_?: T.AChatItem;
205
205
  fileTransferMeta: T.FileTransferMeta;
206
- sndFileTransfers: [T.SndFileTransfer];
206
+ sndFileTransfers: T.SndFileTransfer[];
207
207
  }
208
208
  export interface UserAcceptedGroupSent extends Interface {
209
209
  type: "userAcceptedGroupSent";
@@ -234,7 +234,7 @@ export declare namespace CR {
234
234
  type: "userDeletedMembers";
235
235
  user: T.User;
236
236
  groupInfo: T.GroupInfo;
237
- members: [T.GroupMember];
237
+ members: T.GroupMember[];
238
238
  withMessages: boolean;
239
239
  }
240
240
  export interface UserProfileUpdated extends Interface {
@@ -244,9 +244,13 @@ export declare namespace CR {
244
244
  toProfile: T.Profile;
245
245
  updateSummary: T.UserProfileUpdateSummary;
246
246
  }
247
+ export interface UserProfileNoChange extends Interface {
248
+ type: "userProfileNoChange";
249
+ user: T.User;
250
+ }
247
251
  export interface UsersList extends Interface {
248
252
  type: "usersList";
249
- users: [T.UserInfo];
253
+ users: T.UserInfo[];
250
254
  }
251
255
  export {};
252
256
  }
package/dist/types.d.ts CHANGED
@@ -4,7 +4,7 @@ export interface ACIReaction {
4
4
  }
5
5
  export interface AChat {
6
6
  chatInfo: ChatInfo;
7
- chatItems: [ChatItem];
7
+ chatItems: ChatItem[];
8
8
  chatStats: ChatStats;
9
9
  }
10
10
  export interface AChatItem {
@@ -517,7 +517,7 @@ export interface CIQuote {
517
517
  sharedMsgId?: string;
518
518
  sentAt: string;
519
519
  content: MsgContent;
520
- formattedText?: [FormattedText];
520
+ formattedText?: FormattedText[];
521
521
  }
522
522
  export interface CIReaction {
523
523
  chatDir: CIDirection;
@@ -590,7 +590,7 @@ export declare namespace ChatBotCommand {
590
590
  export interface Menu extends Interface {
591
591
  type: "menu";
592
592
  label: string;
593
- commands: [ChatBotCommand];
593
+ commands: ChatBotCommand[];
594
594
  }
595
595
  export {};
596
596
  }
@@ -856,7 +856,7 @@ export declare namespace ChatErrorType {
856
856
  export interface FileNotApproved extends Interface {
857
857
  type: "fileNotApproved";
858
858
  fileId: number;
859
- unknownServers: [string];
859
+ unknownServers: string[];
860
860
  }
861
861
  export interface FallbackToSMPProhibited extends Interface {
862
862
  type: "fallbackToSMPProhibited";
@@ -973,9 +973,9 @@ export interface ChatItem {
973
973
  mentions: {
974
974
  [key: string]: CIMention;
975
975
  };
976
- formattedText?: [FormattedText];
976
+ formattedText?: FormattedText[];
977
977
  quotedItem?: CIQuote;
978
- reactions: [CIReactionCount];
978
+ reactions: CIReactionCount[];
979
979
  file?: CIFile;
980
980
  }
981
981
  export interface ChatItemDeletion {
@@ -1239,7 +1239,7 @@ export interface Contact {
1239
1239
  contactGroupMemberId?: number;
1240
1240
  contactGrpInvSent: boolean;
1241
1241
  groupDirectInv?: GroupDirectInvitation;
1242
- chatTags: [number];
1242
+ chatTags: number[];
1243
1243
  chatItemTTL?: number;
1244
1244
  uiThemes?: UIThemeEntityOverrides;
1245
1245
  chatDeleted: boolean;
@@ -1314,7 +1314,7 @@ export interface ContactUserPreferences {
1314
1314
  files: ContactUserPreference;
1315
1315
  calls: ContactUserPreference;
1316
1316
  sessions: ContactUserPreference;
1317
- commands?: [ChatBotCommand];
1317
+ commands?: ChatBotCommand[];
1318
1318
  }
1319
1319
  export interface CreatedConnLink {
1320
1320
  connFullLink: string;
@@ -1522,7 +1522,7 @@ export declare namespace Format {
1522
1522
  showText?: string;
1523
1523
  linkType: SimplexLinkType;
1524
1524
  simplexUri: string;
1525
- smpHosts: [string];
1525
+ smpHosts: string[];
1526
1526
  }
1527
1527
  export interface Command extends Interface {
1528
1528
  type: "command";
@@ -1555,7 +1555,7 @@ export interface FullGroupPreferences {
1555
1555
  reports: GroupPreference;
1556
1556
  history: GroupPreference;
1557
1557
  sessions: RoleGroupPreference;
1558
- commands: [ChatBotCommand];
1558
+ commands: ChatBotCommand[];
1559
1559
  }
1560
1560
  export interface FullPreferences {
1561
1561
  timedMessages: TimedMessagesPreference;
@@ -1565,11 +1565,11 @@ export interface FullPreferences {
1565
1565
  files: SimplePreference;
1566
1566
  calls: SimplePreference;
1567
1567
  sessions: SimplePreference;
1568
- commands: [ChatBotCommand];
1568
+ commands: ChatBotCommand[];
1569
1569
  }
1570
1570
  export interface Group {
1571
1571
  groupInfo: GroupInfo;
1572
- members: [GroupMember];
1572
+ members: GroupMember[];
1573
1573
  }
1574
1574
  export type GroupChatScope = GroupChatScope.MemberSupport;
1575
1575
  export declare namespace GroupChatScope {
@@ -1633,7 +1633,7 @@ export interface GroupInfo {
1633
1633
  chatTs?: string;
1634
1634
  userMemberProfileSentAt?: string;
1635
1635
  preparedGroup?: PreparedGroup;
1636
- chatTags: [number];
1636
+ chatTags: number[];
1637
1637
  chatItemTTL?: number;
1638
1638
  uiThemes?: UIThemeEntityOverrides;
1639
1639
  customData?: object;
@@ -1756,7 +1756,7 @@ export interface GroupPreferences {
1756
1756
  reports?: GroupPreference;
1757
1757
  history?: GroupPreference;
1758
1758
  sessions?: RoleGroupPreference;
1759
- commands?: [ChatBotCommand];
1759
+ commands?: ChatBotCommand[];
1760
1760
  }
1761
1761
  export interface GroupProfile {
1762
1762
  displayName: string;
@@ -2050,7 +2050,7 @@ export interface Preferences {
2050
2050
  files?: SimplePreference;
2051
2051
  calls?: SimplePreference;
2052
2052
  sessions?: SimplePreference;
2053
- commands?: [ChatBotCommand];
2053
+ commands?: ChatBotCommand[];
2054
2054
  }
2055
2055
  export interface PreparedContact {
2056
2056
  connLinkToConnect: CreatedConnLink;
@@ -2974,7 +2974,7 @@ export interface UserInfo {
2974
2974
  export interface UserProfileUpdateSummary {
2975
2975
  updateSuccesses: number;
2976
2976
  updateFailures: number;
2977
- changedContacts: [Contact];
2977
+ changedContacts: Contact[];
2978
2978
  }
2979
2979
  export interface UserPwdHash {
2980
2980
  hash: string;
package/package.json CHANGED
@@ -1,15 +1,20 @@
1
1
  {
2
2
  "name": "@simplex-chat/types",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "description": "TypeScript types for SimpleX Chat bot libraries",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "files": [
8
8
  "dist"
9
9
  ],
10
+ "publishConfig": {
11
+ "access": "public",
12
+ "registry": "https://registry.npmjs.org/"
13
+ },
10
14
  "scripts": {
11
15
  "test": "echo \"Error: no test specified\" && exit 1",
12
- "build": "tsc"
16
+ "build": "tsc",
17
+ "prepublishOnly": "tsc"
13
18
  },
14
19
  "repository": {
15
20
  "type": "git",