stanza 12.21.0 → 12.22.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 (130) hide show
  1. package/CLAUDE.md +1 -0
  2. package/Client.d.ts +1 -2
  3. package/Client.js +67 -21
  4. package/Constants.d.ts +22 -22
  5. package/Constants.js +4 -4
  6. package/JID.d.ts +1 -1
  7. package/JID.js +21 -20
  8. package/Namespaces.d.ts +1 -0
  9. package/Namespaces.js +3 -1
  10. package/Utils.d.ts +1 -1
  11. package/Utils.js +7 -8
  12. package/helpers/DataForms.js +1 -2
  13. package/helpers/DiscoManager.js +40 -3
  14. package/helpers/LegacyEntityCapabilities.js +2 -3
  15. package/helpers/NetworkDiscovery.js +11 -9
  16. package/helpers/RSM.d.ts +1 -1
  17. package/helpers/RSM.js +15 -11
  18. package/helpers/RTT.d.ts +1 -1
  19. package/helpers/RTT.js +27 -16
  20. package/helpers/StreamManagement.d.ts +1 -2
  21. package/helpers/StreamManagement.js +10 -8
  22. package/index.d.ts +0 -1
  23. package/index.js +57 -19
  24. package/jingle/FileTransferSession.d.ts +0 -1
  25. package/jingle/FileTransferSession.js +54 -3
  26. package/jingle/ICESession.js +48 -8
  27. package/jingle/MediaSession.js +8 -5
  28. package/jingle/Session.d.ts +2 -2
  29. package/jingle/Session.js +11 -2
  30. package/jingle/SessionManager.d.ts +0 -1
  31. package/jingle/SessionManager.js +14 -4
  32. package/jingle/index.js +8 -6
  33. package/jingle/sdp/Intermediate.d.ts +1 -1
  34. package/jingle/sdp/Intermediate.js +36 -5
  35. package/jingle/sdp/Protocol.js +7 -8
  36. package/jxt/Definitions.d.ts +10 -10
  37. package/jxt/Definitions.js +8 -7
  38. package/jxt/Element.d.ts +1 -1
  39. package/jxt/Element.js +5 -0
  40. package/jxt/Error.js +9 -7
  41. package/jxt/Helpers.d.ts +1 -1
  42. package/jxt/Helpers.js +8 -8
  43. package/jxt/Parser.d.ts +0 -1
  44. package/jxt/Parser.js +146 -144
  45. package/jxt/Registry.js +8 -3
  46. package/jxt/StreamParser.d.ts +0 -1
  47. package/jxt/StreamParser.js +15 -6
  48. package/jxt/Translator.js +16 -2
  49. package/jxt/Types.d.ts +5 -6
  50. package/jxt/Types.js +31 -30
  51. package/jxt/index.js +27 -11
  52. package/lib/AsyncPriorityQueue.d.ts +10 -0
  53. package/lib/AsyncPriorityQueue.js +157 -0
  54. package/lib/StrictEventEmitter.d.ts +13 -13
  55. package/lib/sasl/index.d.ts +2 -2
  56. package/lib/sasl/index.js +34 -12
  57. package/lib/stringprep/index.js +14 -11
  58. package/package.json +4 -31
  59. package/platform/browser/buffer/base64-js/index.d.ts +1 -1
  60. package/platform/browser/buffer/index.d.ts +14 -14
  61. package/platform/browser/crypto/Hash.d.ts +0 -1
  62. package/platform/browser/crypto/Hash.js +5 -0
  63. package/platform/browser/crypto/Hmac.d.ts +0 -1
  64. package/platform/browser/crypto/Hmac.js +8 -2
  65. package/platform/browser/crypto/MD5.js +9 -7
  66. package/platform/browser/crypto/SHA-1.js +10 -8
  67. package/platform/browser/crypto/SHA-256.js +13 -11
  68. package/platform/browser/crypto/SHA-512.js +21 -19
  69. package/platform/browser/crypto/createHash.js +9 -7
  70. package/platform/browser/index.d.ts +6 -6
  71. package/platform/browser/index.js +43 -8
  72. package/platform/browser/process.js +1 -2
  73. package/platform/browser/stream/index.d.ts +5 -5
  74. package/platform/browser/stream/lib/_stream_duplex.d.ts +1 -1
  75. package/platform/browser/stream/lib/_stream_readable.d.ts +8 -8
  76. package/platform/browser/stream/lib/_stream_writable.d.ts +2 -2
  77. package/platform/browser/stream/string_decoder.d.ts +10 -2
  78. package/platform/index.js +15 -2
  79. package/platform/node/index.d.ts +3 -4
  80. package/platform/node/index.js +46 -11
  81. package/platform/react-native/index.js +15 -2
  82. package/plugins/account.js +1 -1
  83. package/plugins/avatar.d.ts +0 -1
  84. package/plugins/avatar.js +2 -2
  85. package/plugins/bind.js +1 -1
  86. package/plugins/command.js +1 -1
  87. package/plugins/connection.js +1 -1
  88. package/plugins/disco.js +39 -4
  89. package/plugins/entity.js +35 -3
  90. package/plugins/features.d.ts +1 -1
  91. package/plugins/features.js +1 -1
  92. package/plugins/hostmeta.js +2 -3
  93. package/plugins/index.js +55 -40
  94. package/plugins/jingle.js +35 -3
  95. package/plugins/mam.js +35 -3
  96. package/plugins/messaging.d.ts +8 -8
  97. package/plugins/messaging.js +39 -10
  98. package/plugins/muc.js +35 -3
  99. package/plugins/pep.js +1 -1
  100. package/plugins/pubsub.d.ts +5 -5
  101. package/plugins/pubsub.js +35 -3
  102. package/plugins/roster.js +35 -3
  103. package/plugins/sasl.js +1 -1
  104. package/plugins/sharing.js +35 -3
  105. package/protocol/index.d.ts +1 -0
  106. package/protocol/index.js +182 -163
  107. package/protocol/rfc6120.d.ts +2 -2
  108. package/protocol/xep0004.d.ts +2 -2
  109. package/protocol/xep0030.d.ts +1 -1
  110. package/protocol/xep0047.d.ts +2 -2
  111. package/protocol/xep0050.d.ts +1 -1
  112. package/protocol/xep0054.d.ts +7 -7
  113. package/protocol/xep0060.d.ts +1 -1
  114. package/protocol/xep0080.js +1 -1
  115. package/protocol/xep0084.d.ts +1 -1
  116. package/protocol/xep0124.d.ts +1 -1
  117. package/protocol/xep0138.d.ts +1 -1
  118. package/protocol/xep0141.d.ts +1 -1
  119. package/protocol/xep0167.d.ts +1 -1
  120. package/protocol/xep0198.d.ts +1 -1
  121. package/protocol/xep0231.d.ts +0 -1
  122. package/protocol/xep0300.d.ts +1 -1
  123. package/protocol/xep0301.d.ts +1 -1
  124. package/protocol/xep0384.d.ts +1 -1
  125. package/protocol/xep0421.d.ts +11 -0
  126. package/protocol/xep0421.js +19 -0
  127. package/transports/bosh.d.ts +0 -1
  128. package/transports/bosh.js +24 -13
  129. package/transports/websocket.d.ts +0 -1
  130. package/transports/websocket.js +11 -2
package/CLAUDE.md ADDED
@@ -0,0 +1 @@
1
+ Never commit CLAUDE.md file. Never commit anything in .ai-agent/. Make sure to check git status and unstage these if they get added before commits
package/Client.d.ts CHANGED
@@ -1,5 +1,4 @@
1
- /// <reference types="node" />
2
- import { AsyncPriorityQueue } from 'async';
1
+ import { AsyncPriorityQueue } from './lib/AsyncPriorityQueue';
3
2
  import { EventEmitter } from 'events';
4
3
  import { Agent, AgentConfig, Transport } from './';
5
4
  import StreamManagement from './helpers/StreamManagement';
package/Client.js CHANGED
@@ -1,22 +1,71 @@
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __importDefault = (this && this.__importDefault) || function (mod) {
36
+ return (mod && mod.__esModule) ? mod : { "default": mod };
37
+ };
2
38
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- const async_1 = require("async");
39
+ const AsyncPriorityQueue_1 = require("./lib/AsyncPriorityQueue");
5
40
  const events_1 = require("events");
6
- const StreamManagement_1 = (0, tslib_1.__importDefault)(require("./helpers/StreamManagement"));
7
- const JID = (0, tslib_1.__importStar)(require("./JID"));
8
- const JXT = (0, tslib_1.__importStar)(require("./jxt"));
9
- const SASL = (0, tslib_1.__importStar)(require("./lib/sasl"));
41
+ const StreamManagement_1 = __importDefault(require("./helpers/StreamManagement"));
42
+ const JID = __importStar(require("./JID"));
43
+ const JXT = __importStar(require("./jxt"));
44
+ const SASL = __importStar(require("./lib/sasl"));
10
45
  const plugins_1 = require("./plugins");
11
- const protocol_1 = (0, tslib_1.__importDefault)(require("./protocol"));
12
- const bosh_1 = (0, tslib_1.__importDefault)(require("./transports/bosh"));
13
- const websocket_1 = (0, tslib_1.__importDefault)(require("./transports/websocket"));
46
+ const protocol_1 = __importDefault(require("./protocol"));
47
+ const bosh_1 = __importDefault(require("./transports/bosh"));
48
+ const websocket_1 = __importDefault(require("./transports/websocket"));
14
49
  const Utils_1 = require("./Utils");
15
- const NetworkDiscovery_1 = (0, tslib_1.__importDefault)(require("./helpers/NetworkDiscovery"));
50
+ const NetworkDiscovery_1 = __importDefault(require("./helpers/NetworkDiscovery"));
16
51
  class Client extends events_1.EventEmitter {
52
+ jid;
53
+ config;
54
+ sm;
55
+ transport;
56
+ stanzas;
57
+ resolver;
58
+ sessionStarting;
59
+ sessionStarted;
60
+ sessionTerminating;
61
+ reconnectAttempts = 0;
62
+ transports;
63
+ sasl;
64
+ incomingDataQueue;
65
+ outgoingDataQueue;
66
+ reconnectTimer;
17
67
  constructor(opts = {}) {
18
68
  super();
19
- this.reconnectAttempts = 0;
20
69
  this.setMaxListeners(100);
21
70
  // Some EventEmitter shims don't include off()
22
71
  this.off = this.removeListener;
@@ -67,7 +116,7 @@ class Client extends events_1.EventEmitter {
67
116
  bosh: bosh_1.default,
68
117
  websocket: websocket_1.default
69
118
  };
70
- this.incomingDataQueue = (0, async_1.priorityQueue)(async (task, done) => {
119
+ this.incomingDataQueue = (0, AsyncPriorityQueue_1.priorityQueue)(async (task, done) => {
71
120
  const { kind, stanza } = task;
72
121
  this.emit(kind, stanza);
73
122
  if (stanza.id) {
@@ -106,8 +155,7 @@ class Client extends events_1.EventEmitter {
106
155
  }
107
156
  }
108
157
  };
109
- this.outgoingDataQueue = (0, async_1.priorityQueue)(async (task, done) => {
110
- var _a;
158
+ this.outgoingDataQueue = (0, AsyncPriorityQueue_1.priorityQueue)(async (task, done) => {
111
159
  const { kind, stanza, replay } = task;
112
160
  const ackRequest = replay || (await this.sm.track(kind, stanza));
113
161
  if (kind === 'message') {
@@ -122,7 +170,7 @@ class Client extends events_1.EventEmitter {
122
170
  try {
123
171
  await this.transport.send(kind, stanza);
124
172
  if (ackRequest) {
125
- (_a = this.transport) === null || _a === void 0 ? void 0 : _a.send('sm', { type: 'request' });
173
+ this.transport?.send('sm', { type: 'request' });
126
174
  }
127
175
  }
128
176
  catch (err) {
@@ -222,7 +270,6 @@ class Client extends events_1.EventEmitter {
222
270
  });
223
271
  }
224
272
  updateConfig(opts = {}) {
225
- var _a;
226
273
  const currConfig = this.config || {};
227
274
  this.config = {
228
275
  allowResumption: true,
@@ -245,7 +292,7 @@ class Client extends events_1.EventEmitter {
245
292
  delete this.config.password;
246
293
  }
247
294
  if (!this.config.transportPreferenceOrder) {
248
- this.config.transportPreferenceOrder = Object.keys((_a = this.config.transports) !== null && _a !== void 0 ? _a : {});
295
+ this.config.transportPreferenceOrder = Object.keys(this.config.transports ?? {});
249
296
  }
250
297
  }
251
298
  get stream() {
@@ -277,14 +324,13 @@ class Client extends events_1.EventEmitter {
277
324
  return this._getConfiguredCredentials();
278
325
  }
279
326
  async connect() {
280
- var _a, _b, _c;
281
327
  this.sessionTerminating = false;
282
328
  this.sessionStarting = true;
283
329
  this.emit('--reset-stream-features');
284
330
  if (this.transport) {
285
331
  this.transport.disconnect(false);
286
332
  }
287
- const transportPref = (_a = this.config.transportPreferenceOrder) !== null && _a !== void 0 ? _a : [];
333
+ const transportPref = this.config.transportPreferenceOrder ?? [];
288
334
  let endpoints;
289
335
  for (const name of transportPref) {
290
336
  const settings = this.config.transports[name];
@@ -292,9 +338,9 @@ class Client extends events_1.EventEmitter {
292
338
  continue;
293
339
  }
294
340
  let config = {
295
- acceptLanguages: this.config.acceptLanguages || [(_b = this.config.lang) !== null && _b !== void 0 ? _b : 'en'],
341
+ acceptLanguages: this.config.acceptLanguages || [this.config.lang ?? 'en'],
296
342
  jid: this.config.jid,
297
- lang: (_c = this.config.lang) !== null && _c !== void 0 ? _c : 'en',
343
+ lang: this.config.lang ?? 'en',
298
344
  server: this.config.server
299
345
  };
300
346
  const transport = new this.transports[name](this, this.sm, this.stanzas);
package/Constants.d.ts CHANGED
@@ -5,7 +5,7 @@ export declare const StreamType: {
5
5
  readonly Component: "jabber:component:accept";
6
6
  readonly Server: "jabber:server";
7
7
  };
8
- export declare type StreamType = typeof StreamType[keyof typeof StreamType];
8
+ export type StreamType = typeof StreamType[keyof typeof StreamType];
9
9
  export declare const SASLFailureCondition: {
10
10
  readonly AccountDisabled: "account-disabled";
11
11
  readonly CredentialsExpired: "credentials-expired";
@@ -18,7 +18,7 @@ export declare const SASLFailureCondition: {
18
18
  readonly NotAuthorized: "not-authorized";
19
19
  readonly TemporaryAuthFailure: "temporary-auth-failure";
20
20
  };
21
- export declare type SASLFailureCondition = typeof SASLFailureCondition[keyof typeof SASLFailureCondition];
21
+ export type SASLFailureCondition = typeof SASLFailureCondition[keyof typeof SASLFailureCondition];
22
22
  export declare const StreamErrorCondition: {
23
23
  readonly BadFormat: "bad-format";
24
24
  readonly BadNamespacePrefix: "bad-namespace-prefix";
@@ -46,7 +46,7 @@ export declare const StreamErrorCondition: {
46
46
  readonly UnsupportedStanzaType: "unsupported-stanza-type";
47
47
  readonly UnsupportedVersion: "unsupported-version";
48
48
  };
49
- export declare type StreamErrorCondition = typeof StreamErrorCondition[keyof typeof StreamErrorCondition];
49
+ export type StreamErrorCondition = typeof StreamErrorCondition[keyof typeof StreamErrorCondition];
50
50
  export declare const StanzaErrorCondition: {
51
51
  readonly BadRequest: "bad-request";
52
52
  readonly Conflict: "conflict";
@@ -71,7 +71,7 @@ export declare const StanzaErrorCondition: {
71
71
  readonly UndefinedCondition: "undefined-condition";
72
72
  readonly UnexpectedRequest: "unexpected-request";
73
73
  };
74
- export declare type StanzaErrorCondition = typeof StanzaErrorCondition[keyof typeof StanzaErrorCondition];
74
+ export type StanzaErrorCondition = typeof StanzaErrorCondition[keyof typeof StanzaErrorCondition];
75
75
  export declare const MessageType: {
76
76
  readonly Chat: "chat";
77
77
  readonly Error: "error";
@@ -79,7 +79,7 @@ export declare const MessageType: {
79
79
  readonly Headline: "headline";
80
80
  readonly Normal: "normal";
81
81
  };
82
- export declare type MessageType = typeof MessageType[keyof typeof MessageType];
82
+ export type MessageType = typeof MessageType[keyof typeof MessageType];
83
83
  export declare const PresenceType: {
84
84
  readonly Available: undefined;
85
85
  readonly Error: "error";
@@ -90,21 +90,21 @@ export declare const PresenceType: {
90
90
  readonly Unsubscribe: "unsubscribe";
91
91
  readonly Unsubscribed: "unsubscribed";
92
92
  };
93
- export declare type PresenceType = typeof PresenceType[keyof typeof PresenceType];
93
+ export type PresenceType = typeof PresenceType[keyof typeof PresenceType];
94
94
  export declare const IQType: {
95
95
  readonly Error: "error";
96
96
  readonly Get: "get";
97
97
  readonly Result: "result";
98
98
  readonly Set: "set";
99
99
  };
100
- export declare type IQType = typeof IQType[keyof typeof IQType];
100
+ export type IQType = typeof IQType[keyof typeof IQType];
101
101
  export declare const PresenceShow: {
102
102
  readonly Away: "away";
103
103
  readonly Chat: "chat";
104
104
  readonly DoNotDisturb: "dnd";
105
105
  readonly ExtendedAway: "xa";
106
106
  };
107
- export declare type PresenceShow = typeof PresenceShow[keyof typeof PresenceShow];
107
+ export type PresenceShow = typeof PresenceShow[keyof typeof PresenceShow];
108
108
  export declare const RosterSubscription: {
109
109
  readonly Both: "both";
110
110
  readonly From: "from";
@@ -115,14 +115,14 @@ export declare const RosterSubscription: {
115
115
  readonly SendPresenceOnly: "from";
116
116
  readonly To: "to";
117
117
  };
118
- export declare type RosterSubscription = typeof RosterSubscription[keyof typeof RosterSubscription];
118
+ export type RosterSubscription = typeof RosterSubscription[keyof typeof RosterSubscription];
119
119
  export declare const DataFormType: {
120
120
  readonly Cancel: "cancel";
121
121
  readonly Form: "form";
122
122
  readonly Result: "result";
123
123
  readonly Submit: "submit";
124
124
  };
125
- export declare type DataFormType = typeof DataFormType[keyof typeof DataFormType];
125
+ export type DataFormType = typeof DataFormType[keyof typeof DataFormType];
126
126
  export declare const DataFormFieldType: {
127
127
  readonly Boolean: "boolean";
128
128
  readonly Fixed: "fixed";
@@ -136,7 +136,7 @@ export declare const DataFormFieldType: {
136
136
  readonly TextMultiple: "text-multi";
137
137
  readonly TextPrivate: "text-private";
138
138
  };
139
- export declare type DataFormFieldType = typeof DataFormFieldType[keyof typeof DataFormFieldType];
139
+ export type DataFormFieldType = typeof DataFormFieldType[keyof typeof DataFormFieldType];
140
140
  export declare const MUCAffiliation: {
141
141
  readonly Admin: "admin";
142
142
  readonly Banned: "outcast";
@@ -145,14 +145,14 @@ export declare const MUCAffiliation: {
145
145
  readonly Outcast: "outcast";
146
146
  readonly Owner: "owner";
147
147
  };
148
- export declare type MUCAffiliation = typeof MUCAffiliation[keyof typeof MUCAffiliation];
148
+ export type MUCAffiliation = typeof MUCAffiliation[keyof typeof MUCAffiliation];
149
149
  export declare const MUCRole: {
150
150
  readonly Moderator: "moderator";
151
151
  readonly None: "none";
152
152
  readonly Participant: "participant";
153
153
  readonly Visitor: "visitor";
154
154
  };
155
- export declare type MUCRole = typeof MUCRole[keyof typeof MUCRole];
155
+ export type MUCRole = typeof MUCRole[keyof typeof MUCRole];
156
156
  export declare const MUCStatusCode: {
157
157
  readonly AffiliationChanged: "101";
158
158
  readonly AffiliationLost: "321";
@@ -174,7 +174,7 @@ export declare const MUCStatusCode: {
174
174
  readonly UnavailableMembersListed: "102";
175
175
  readonly UnavailableMembersNotListed: "103";
176
176
  };
177
- export declare type MUCStatusCode = typeof MUCStatusCode[keyof typeof MUCStatusCode];
177
+ export type MUCStatusCode = typeof MUCStatusCode[keyof typeof MUCStatusCode];
178
178
  export declare const PubsubErrorCondition: {
179
179
  readonly ClosedNode: "closed-node";
180
180
  readonly ConfigurationRequired: "configuration-required";
@@ -199,7 +199,7 @@ export declare const PubsubErrorCondition: {
199
199
  readonly Unsupported: "unsupported";
200
200
  readonly UnsupportedAccessModel: "unsupported-access-model";
201
201
  };
202
- export declare type PubsubErrorCondition = typeof PubsubErrorCondition[keyof typeof PubsubErrorCondition];
202
+ export type PubsubErrorCondition = typeof PubsubErrorCondition[keyof typeof PubsubErrorCondition];
203
203
  export declare const ChatState: {
204
204
  readonly Active: "active";
205
205
  readonly Composing: "composing";
@@ -207,26 +207,26 @@ export declare const ChatState: {
207
207
  readonly Inactive: "inactive";
208
208
  readonly Paused: "paused";
209
209
  };
210
- export declare type ChatState = typeof ChatState[keyof typeof ChatState];
210
+ export type ChatState = typeof ChatState[keyof typeof ChatState];
211
211
  export declare const JingleSessionRole: {
212
212
  readonly Initiator: "initiator";
213
213
  readonly Responder: "responder";
214
214
  };
215
- export declare type JingleSessionRole = typeof JingleSessionRole[keyof typeof JingleSessionRole];
215
+ export type JingleSessionRole = typeof JingleSessionRole[keyof typeof JingleSessionRole];
216
216
  export declare const JingleApplicationDirection: {
217
217
  readonly Inactive: "inactive";
218
218
  readonly Receive: "recvonly";
219
219
  readonly Send: "sendonly";
220
220
  readonly SendReceive: "sendrecv";
221
221
  };
222
- export declare type JingleApplicationDirection = typeof JingleApplicationDirection[keyof typeof JingleApplicationDirection];
222
+ export type JingleApplicationDirection = typeof JingleApplicationDirection[keyof typeof JingleApplicationDirection];
223
223
  export declare const JingleContentSenders: {
224
224
  readonly Both: "both";
225
225
  readonly Initiator: "initiator";
226
226
  readonly None: "none";
227
227
  readonly Responder: "responder";
228
228
  };
229
- export declare type JingleContentSenders = typeof JingleContentSenders[keyof typeof JingleContentSenders];
229
+ export type JingleContentSenders = typeof JingleContentSenders[keyof typeof JingleContentSenders];
230
230
  export declare const JingleAction: {
231
231
  readonly ContentAccept: "content-accept";
232
232
  readonly ContentAdd: "content-add";
@@ -244,7 +244,7 @@ export declare const JingleAction: {
244
244
  readonly TransportReject: "transport-reject";
245
245
  readonly TransportReplace: "transport-replace";
246
246
  };
247
- export declare type JingleAction = typeof JingleAction[keyof typeof JingleAction];
247
+ export type JingleAction = typeof JingleAction[keyof typeof JingleAction];
248
248
  export declare const JingleErrorCondition: {
249
249
  readonly OutOfOrder: "out-of-order";
250
250
  readonly TieBreak: "tie-break";
@@ -252,7 +252,7 @@ export declare const JingleErrorCondition: {
252
252
  readonly UnknownSession: "unknown-session";
253
253
  readonly UnsupportedInfo: "unsupported-info";
254
254
  };
255
- export declare type JingleErrorCondition = typeof JingleErrorCondition[keyof typeof JingleErrorCondition];
255
+ export type JingleErrorCondition = typeof JingleErrorCondition[keyof typeof JingleErrorCondition];
256
256
  export declare const JingleReasonCondition: {
257
257
  readonly AlternativeSession: "alternative-session";
258
258
  readonly Busy: "busy";
@@ -272,7 +272,7 @@ export declare const JingleReasonCondition: {
272
272
  readonly UnsupportedApplications: "unsupported-applications";
273
273
  readonly UnsupportedTransports: "unsupported-transports";
274
274
  };
275
- export declare type JingleReasonCondition = typeof JingleReasonCondition[keyof typeof JingleReasonCondition];
275
+ export type JingleReasonCondition = typeof JingleReasonCondition[keyof typeof JingleReasonCondition];
276
276
  export declare const USER_MOODS: string[];
277
277
  export declare const USER_ACTIVITY_GENERAL: string[];
278
278
  export declare const USER_ACTIVITY_SPECIFIC: string[];
package/Constants.js CHANGED
@@ -1,8 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.directionToSenders = exports.sendersToDirection = exports.JINGLE_INFO_RECEIVED_5 = exports.JINGLE_INFO_CHECKSUM_5 = exports.JINGLE_INFO_RINGING = exports.JINGLE_INFO_ACTIVE = exports.JINGLE_INFO_UNHOLD = exports.JINGLE_INFO_HOLD = exports.JINGLE_INFO_UNMUTE = exports.JINGLE_INFO_MUTE = exports.JINGLE_INFO = exports.USER_ACTIVITY_SPECIFIC = exports.USER_ACTIVITY_GENERAL = exports.USER_MOODS = exports.JingleReasonCondition = exports.JingleErrorCondition = exports.JingleAction = exports.JingleContentSenders = exports.JingleApplicationDirection = exports.JingleSessionRole = exports.ChatState = exports.PubsubErrorCondition = exports.MUCStatusCode = exports.MUCRole = exports.MUCAffiliation = exports.DataFormFieldType = exports.DataFormType = exports.RosterSubscription = exports.PresenceShow = exports.IQType = exports.PresenceType = exports.MessageType = exports.StanzaErrorCondition = exports.StreamErrorCondition = exports.SASLFailureCondition = exports.StreamType = exports.VERSION = void 0;
3
+ exports.JINGLE_INFO_RECEIVED_5 = exports.JINGLE_INFO_CHECKSUM_5 = exports.JINGLE_INFO_RINGING = exports.JINGLE_INFO_ACTIVE = exports.JINGLE_INFO_UNHOLD = exports.JINGLE_INFO_HOLD = exports.JINGLE_INFO_UNMUTE = exports.JINGLE_INFO_MUTE = exports.JINGLE_INFO = exports.USER_ACTIVITY_SPECIFIC = exports.USER_ACTIVITY_GENERAL = exports.USER_MOODS = exports.JingleReasonCondition = exports.JingleErrorCondition = exports.JingleAction = exports.JingleContentSenders = exports.JingleApplicationDirection = exports.JingleSessionRole = exports.ChatState = exports.PubsubErrorCondition = exports.MUCStatusCode = exports.MUCRole = exports.MUCAffiliation = exports.DataFormFieldType = exports.DataFormType = exports.RosterSubscription = exports.PresenceShow = exports.IQType = exports.PresenceType = exports.MessageType = exports.StanzaErrorCondition = exports.StreamErrorCondition = exports.SASLFailureCondition = exports.StreamType = exports.VERSION = void 0;
4
+ exports.sendersToDirection = sendersToDirection;
5
+ exports.directionToSenders = directionToSenders;
4
6
  const Namespaces_1 = require("./Namespaces");
5
- exports.VERSION = '12.21.0';
7
+ exports.VERSION = '12.22.0';
6
8
  // ====================================================================
7
9
  // Frequently Used Values
8
10
  // ====================================================================
@@ -464,7 +466,6 @@ function sendersToDirection(role, senders = exports.JingleContentSenders.Both) {
464
466
  }
465
467
  return exports.JingleApplicationDirection.Inactive;
466
468
  }
467
- exports.sendersToDirection = sendersToDirection;
468
469
  function directionToSenders(role, direction = exports.JingleApplicationDirection.SendReceive) {
469
470
  const isInitiator = role === exports.JingleSessionRole.Initiator;
470
471
  switch (direction) {
@@ -477,4 +478,3 @@ function directionToSenders(role, direction = exports.JingleApplicationDirection
477
478
  }
478
479
  return exports.JingleContentSenders.None;
479
480
  }
480
- exports.directionToSenders = directionToSenders;
package/JID.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export declare type JID = string;
1
+ export type JID = string;
2
2
  export interface JIDParts {
3
3
  domain: string;
4
4
  local?: string;
package/JID.js CHANGED
@@ -1,8 +1,26 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.toURI = exports.parseURI = exports.toBare = exports.getResource = exports.getDomain = exports.getLocal = exports.isBare = exports.isFull = exports.equalBare = exports.equal = exports.allowedResponders = exports.parse = exports.createFull = exports.create = exports.prepare = exports.unescapeLocal = exports.escapeLocal = void 0;
4
- const tslib_1 = require("tslib");
5
- const punycode_1 = (0, tslib_1.__importDefault)(require("punycode"));
6
+ exports.escapeLocal = escapeLocal;
7
+ exports.unescapeLocal = unescapeLocal;
8
+ exports.prepare = prepare;
9
+ exports.create = create;
10
+ exports.createFull = createFull;
11
+ exports.parse = parse;
12
+ exports.allowedResponders = allowedResponders;
13
+ exports.equal = equal;
14
+ exports.equalBare = equalBare;
15
+ exports.isFull = isFull;
16
+ exports.isBare = isBare;
17
+ exports.getLocal = getLocal;
18
+ exports.getDomain = getDomain;
19
+ exports.getResource = getResource;
20
+ exports.toBare = toBare;
21
+ exports.parseURI = parseURI;
22
+ exports.toURI = toURI;
23
+ const punycode_1 = __importDefault(require("punycode"));
6
24
  const stringprep_1 = require("./lib/stringprep");
7
25
  function escapeLocal(val = '') {
8
26
  return val
@@ -27,7 +45,6 @@ function escapeLocal(val = '') {
27
45
  .replace(/>/g, '\\3e')
28
46
  .replace(/@/g, '\\40');
29
47
  }
30
- exports.escapeLocal = escapeLocal;
31
48
  function unescapeLocal(val) {
32
49
  return val
33
50
  .replace(/\\20/g, ' ')
@@ -41,7 +58,6 @@ function unescapeLocal(val) {
41
58
  .replace(/\\40/g, '@')
42
59
  .replace(/\\5c/g, '\\');
43
60
  }
44
- exports.unescapeLocal = unescapeLocal;
45
61
  function prepare(data) {
46
62
  let local = data.local || '';
47
63
  let domain = data.domain;
@@ -62,7 +78,6 @@ function prepare(data) {
62
78
  resource
63
79
  };
64
80
  }
65
- exports.prepare = prepare;
66
81
  function create(data, opts = {}) {
67
82
  let localPart = data.local;
68
83
  if (!opts.escaped) {
@@ -77,7 +92,6 @@ function create(data, opts = {}) {
77
92
  }
78
93
  return bareJID;
79
94
  }
80
- exports.create = create;
81
95
  function createFull(bare, resource) {
82
96
  if (resource) {
83
97
  return `${toBare(bare)}/${resource}`;
@@ -86,7 +100,6 @@ function createFull(bare, resource) {
86
100
  return toBare(bare);
87
101
  }
88
102
  }
89
- exports.createFull = createFull;
90
103
  function parse(jid = '') {
91
104
  let local = '';
92
105
  let domain = '';
@@ -121,7 +134,6 @@ function parse(jid = '') {
121
134
  resource: prepped.resource
122
135
  };
123
136
  }
124
- exports.parse = parse;
125
137
  function allowedResponders(jid1, jid2) {
126
138
  const allowed = new Set();
127
139
  allowed.add(undefined);
@@ -140,7 +152,6 @@ function allowedResponders(jid1, jid2) {
140
152
  }
141
153
  return allowed;
142
154
  }
143
- exports.allowedResponders = allowedResponders;
144
155
  function equal(jid1, jid2) {
145
156
  if (!jid1 || !jid2) {
146
157
  return false;
@@ -151,7 +162,6 @@ function equal(jid1, jid2) {
151
162
  parsed1.domain === parsed2.domain &&
152
163
  parsed1.resource === parsed2.resource);
153
164
  }
154
- exports.equal = equal;
155
165
  function equalBare(jid1, jid2) {
156
166
  if (!jid1 || !jid2) {
157
167
  return false;
@@ -160,32 +170,25 @@ function equalBare(jid1, jid2) {
160
170
  const parsed2 = parse(jid2);
161
171
  return parsed1.local === parsed2.local && parsed1.domain === parsed2.domain;
162
172
  }
163
- exports.equalBare = equalBare;
164
173
  function isFull(jid) {
165
174
  const parsed = parse(jid);
166
175
  return !!parsed.resource;
167
176
  }
168
- exports.isFull = isFull;
169
177
  function isBare(jid) {
170
178
  return !isFull(jid);
171
179
  }
172
- exports.isBare = isBare;
173
180
  function getLocal(jid = '') {
174
181
  return parse(jid).local;
175
182
  }
176
- exports.getLocal = getLocal;
177
183
  function getDomain(jid = '') {
178
184
  return parse(jid).domain;
179
185
  }
180
- exports.getDomain = getDomain;
181
186
  function getResource(jid = '') {
182
187
  return parse(jid).resource;
183
188
  }
184
- exports.getResource = getResource;
185
189
  function toBare(jid = '') {
186
190
  return parse(jid).bare;
187
191
  }
188
- exports.toBare = toBare;
189
192
  function parseURI(val) {
190
193
  const parsed = new URL(val);
191
194
  if (parsed.protocol !== 'xmpp:') {
@@ -233,7 +236,6 @@ function parseURI(val) {
233
236
  parameters: params
234
237
  };
235
238
  }
236
- exports.parseURI = parseURI;
237
239
  function toURI(data) {
238
240
  const parts = ['xmpp:'];
239
241
  const pushJID = (jid, allowResource) => {
@@ -274,4 +276,3 @@ function toURI(data) {
274
276
  }
275
277
  return parts.join('');
276
278
  }
277
- exports.toURI = toURI;
package/Namespaces.d.ts CHANGED
@@ -151,6 +151,7 @@ export declare const NS_OMEMO_AXOLOTL = "eu.siacs.conversations.axolotl";
151
151
  export declare const NS_OMEMO_AXOLOTL_DEVICELIST = "eu.siacs.conversations.axolotl.devicelist";
152
152
  export declare const NS_OMEMO_AXOLOTL_BUNDLES = "eu.siacs.conversations.axolotl.bundles";
153
153
  export declare const NS_OMEMO_AXOLOTL_BUNDLE: (deviceId: string) => string;
154
+ export declare const NS_OCCUPANT_0 = "urn:xmpp:occupant-id:0";
154
155
  export declare const NS_JSON_MESSAGE_0 = "urn:xmpp:json-msg:0";
155
156
  export declare const NS_XRD = "http://docs.oasis-open.org/ns/xri/xrd-1.0";
156
157
  export declare const NS_JINGLE_RTP_MSID_0 = "urn:xmpp:jingle:apps:rtp:msid:0";
package/Namespaces.js CHANGED
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.NS_AVATAR_METADATA = exports.NS_AVATAR_DATA = exports.NS_ROSTER_DELIMITER = exports.NS_GEOLOC = exports.NS_AMP = exports.NS_INBAND_REGISTRATION = exports.NS_REGISTER = exports.NS_XHTML_IM = exports.NS_XHTML = exports.NS_HTTP_AUTH = exports.NS_OOB_TRANSFER = exports.NS_OOB = exports.NS_SOCKS5 = exports.NS_PUBSUB_OWNER = exports.NS_PUBSUB_EVENT = exports.NS_PUBSUB_ERRORS = exports.NS_PUBSUB = exports.NS_RSM = exports.NS_SEARCH = exports.NS_VCARD_TEMP = exports.NS_ADHOC_COMMANDS = exports.NS_PRIVATE = exports.NS_BOOKMARKS = exports.NS_IBB = exports.NS_MUC_USER = exports.NS_MUC_OWNER = exports.NS_MUC_ADMIN = exports.NS_MUC = exports.NS_ADDRESS = exports.NS_DISCO_ITEMS = exports.NS_DISCO_INFO = exports.NS_LEGACY_CHAT_EVENTS = exports.NS_PRIVACY = exports.NS_LAST_ACTIVITY = exports.NS_RPC = exports.NS_DATAFORM = exports.NS_FRAMING = exports.NS_SUBSCRIPTION_PREAPPROVAL = exports.NS_ROSTER_VERSIONING = exports.NS_ROSTER = exports.NS_STARTTLS = exports.NS_STREAMS = exports.NS_STREAM = exports.NS_STANZAS = exports.NS_SESSION = exports.NS_SERVER = exports.NS_SASL = exports.NS_CLIENT = exports.NS_BIND = exports.NS_ATOM = void 0;
7
7
  exports.NS_JINGLE_FILE_TRANSFER_4 = exports.NS_JINGLE_FILE_TRANSFER_3 = exports.NS_SOFTWARE_INFO = exports.NS_BOB = exports.NS_ATTENTION_0 = exports.NS_DATAFORM_MEDIA = exports.NS_DISCO_EXTERNAL_2 = exports.NS_DISCO_EXTERNAL_1 = exports.NS_BOSH_XMPP = exports.NS_DELAY = exports.NS_TIME = exports.NS_PING = exports.NS_SMACKS_3 = exports.NS_BLOCKING_ERRORS = exports.NS_BLOCKING = exports.NS_INVISIBLE_0 = exports.NS_RECEIPTS = exports.NS_JINGLE_RAW_UDP_1 = exports.NS_JINGLE_ICE_UDP_1 = exports.NS_NICK = exports.NS_LANG_TRANS_ITEMS = exports.NS_LANG_TRANS = exports.NS_JINGLE_RTP_VIDEO = exports.NS_JINGLE_RTP_AUDIO = exports.NS_JINGLE_RTP_INFO_1 = exports.NS_JINGLE_RTP_ERRORS_1 = exports.NS_JINGLE_RTP_1 = exports.NS_JINGLE_ERRORS_1 = exports.NS_JINGLE_1 = exports.NS_PEP_NOTIFY = exports.NS_CAPTCHA = exports.NS_ALT_CONNECTIONS_XBOSH = exports.NS_ALT_CONNECTIONS_WEBSOCKET = exports.NS_VCARD_TEMP_UPDATE = exports.NS_REACH_0 = exports.NS_ROSTER_NOTES = exports.NS_ROSTER_EXCHANGE = exports.NS_DATAFORM_LAYOUT = exports.NS_COMPRESSION = exports.NS_COMPRESSION_FEATURE = exports.NS_SHIM = exports.NS_BOSH = exports.NS_DATAFORM_VALIDATION = exports.NS_TUNE = exports.NS_DISCO_LEGACY_CAPS = exports.NS_COMPONENT = exports.NS_ACTIVITY = exports.NS_MOOD = exports.NS_VERSION = exports.NS_CHAT_STATES = void 0;
8
8
  exports.NS_OMEMO_AXOLOTL = exports.NS_SPOILER_0 = exports.NS_EME_0 = exports.NS_REFERENCE_0 = exports.NS_JINGLE_ICE_0 = exports.NS_JINGLE_HTTP_UPLOAD_0 = exports.NS_JINGLE_HTTP_0 = exports.NS_HTTP_UPLOAD_0 = exports.NS_SID_0 = exports.NS_JINGLE_PUB_1 = exports.NS_PUSH_0 = exports.NS_DELEGATION_1 = exports.NS_JINGLE_MSG_INITIATE_0 = exports.NS_CSI_0 = exports.NS_JINGLE_DTLS_SCTP_1 = exports.NS_JINGLE_RTP_SSMA_0 = exports.NS_JINGLE_GROUPING_0 = exports.NS_JSON_0 = exports.NS_HINTS = exports.NS_CHAT_MARKERS_0 = exports.NS_JINGLE_DTLS_0 = exports.NS_IDLE_1 = exports.NS_HATS_0 = exports.NS_MAM_2 = exports.NS_MAM_1 = exports.NS_MAM_0 = exports.NS_MAM_TMP = exports.NS_PSA = exports.NS_CORRECTION_0 = exports.NS_MUC_UNIQUE = exports.NS_RTT_0 = exports.NS_HASH_NAME = exports.NS_HASHES_2 = exports.NS_HASHES_1 = exports.NS_FORWARD_0 = exports.NS_JINGLE_RTP_HDREXT_0 = exports.NS_JINGLE_RTP_RTCP_FB_0 = exports.NS_CARBONS_2 = exports.NS_DECLOAKING_0 = exports.NS_THUMBS_1 = exports.NS_THUMBS_0 = exports.NS_JINGLE_RTP_ZRTP_1 = exports.NS_JINGLE_IBB_1 = exports.NS_JINGLE_SOCKS5_1 = exports.NS_SEC_LABEL_ESS_0 = exports.NS_SEC_LABEL_CATALOG_2 = exports.NS_SEC_LABEL_0 = exports.NS_MUC_DIRECT_INVITE = exports.NS_JINGLE_XML_0 = exports.NS_JINGLE_FILE_TRANSFER_5 = void 0;
9
- exports.NS_JINGLE_RTP_MSID_0 = exports.NS_XRD = exports.NS_JSON_MESSAGE_0 = exports.NS_OMEMO_AXOLOTL_BUNDLE = exports.NS_OMEMO_AXOLOTL_BUNDLES = exports.NS_OMEMO_AXOLOTL_DEVICELIST = void 0;
9
+ exports.NS_JINGLE_RTP_MSID_0 = exports.NS_XRD = exports.NS_JSON_MESSAGE_0 = exports.NS_OCCUPANT_0 = exports.NS_OMEMO_AXOLOTL_BUNDLE = exports.NS_OMEMO_AXOLOTL_BUNDLES = exports.NS_OMEMO_AXOLOTL_DEVICELIST = void 0;
10
10
  // RFC 4287
11
11
  exports.NS_ATOM = 'http://www.w3.org/2005/Atom';
12
12
  // RFC 6120
@@ -275,6 +275,8 @@ exports.NS_OMEMO_AXOLOTL_BUNDLES = 'eu.siacs.conversations.axolotl.bundles';
275
275
  // istanbul ignore next
276
276
  const NS_OMEMO_AXOLOTL_BUNDLE = (deviceId) => `${exports.NS_OMEMO_AXOLOTL_BUNDLES}:${deviceId}`;
277
277
  exports.NS_OMEMO_AXOLOTL_BUNDLE = NS_OMEMO_AXOLOTL_BUNDLE;
278
+ // XEP-0421
279
+ exports.NS_OCCUPANT_0 = 'urn:xmpp:occupant-id:0';
278
280
  // XEP-0432
279
281
  exports.NS_JSON_MESSAGE_0 = 'urn:xmpp:json-msg:0';
280
282
  // ================================================================
package/Utils.d.ts CHANGED
@@ -6,7 +6,7 @@
6
6
  * Derived from:
7
7
  * - uuid, Copyright (c) 2010-2016 Robert Kieffer and other contributors
8
8
  */
9
- /// <reference types="node" />
9
+ import { Buffer } from './platform';
10
10
  export declare function timeoutPromise<T>(target: Promise<T>, delay: number, rejectValue?: () => any): Promise<T>;
11
11
  export declare function promiseAny<T>(promises: Array<Promise<T>>): Promise<T>;
12
12
  export declare function shuffle<T>(array: T[]): T[];
package/Utils.js CHANGED
@@ -8,7 +8,13 @@
8
8
  * - uuid, Copyright (c) 2010-2016 Robert Kieffer and other contributors
9
9
  */
10
10
  Object.defineProperty(exports, "__esModule", { value: true });
11
- exports.reviveData = exports.uuid = exports.octetCompare = exports.sleep = exports.shuffle = exports.promiseAny = exports.timeoutPromise = void 0;
11
+ exports.timeoutPromise = timeoutPromise;
12
+ exports.promiseAny = promiseAny;
13
+ exports.shuffle = shuffle;
14
+ exports.sleep = sleep;
15
+ exports.octetCompare = octetCompare;
16
+ exports.uuid = uuid;
17
+ exports.reviveData = reviveData;
12
18
  // tslint:disable no-bitwise
13
19
  const platform_1 = require("./platform");
14
20
  const bth = [];
@@ -26,7 +32,6 @@ async function timeoutPromise(target, delay, rejectValue = () => undefined) {
26
32
  clearTimeout(timeoutRef);
27
33
  return result;
28
34
  }
29
- exports.timeoutPromise = timeoutPromise;
30
35
  async function promiseAny(promises) {
31
36
  try {
32
37
  const errors = await Promise.all(promises.map(p => {
@@ -38,7 +43,6 @@ async function promiseAny(promises) {
38
43
  return Promise.resolve(val);
39
44
  }
40
45
  }
41
- exports.promiseAny = promiseAny;
42
46
  function shuffle(array) {
43
47
  let end = array.length;
44
48
  while (end > 0) {
@@ -50,19 +54,16 @@ function shuffle(array) {
50
54
  }
51
55
  return array;
52
56
  }
53
- exports.shuffle = shuffle;
54
57
  async function sleep(time) {
55
58
  return new Promise(resolve => {
56
59
  setTimeout(() => resolve(), time);
57
60
  });
58
61
  }
59
- exports.sleep = sleep;
60
62
  function octetCompare(str1, str2) {
61
63
  const b1 = typeof str1 === 'string' ? platform_1.Buffer.from(str1, 'utf8') : str1;
62
64
  const b2 = typeof str2 === 'string' ? platform_1.Buffer.from(str2, 'utf8') : str2;
63
65
  return b1.compare(b2);
64
66
  }
65
- exports.octetCompare = octetCompare;
66
67
  function uuid() {
67
68
  const buf = (0, platform_1.randomBytes)(16);
68
69
  // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
@@ -92,7 +93,6 @@ function uuid() {
92
93
  bth[buf[i]]
93
94
  ].join('');
94
95
  }
95
- exports.uuid = uuid;
96
96
  const DATE_FIELDS = new Set([
97
97
  'date',
98
98
  'expires',
@@ -118,4 +118,3 @@ function reviveData(key, value) {
118
118
  }
119
119
  return value;
120
120
  }
121
- exports.reviveData = reviveData;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.mergeFields = void 0;
3
+ exports.mergeFields = mergeFields;
4
4
  function mergeFields(original, updated) {
5
5
  const merged = [];
6
6
  const mappedUpdates = new Map();
@@ -31,4 +31,3 @@ function mergeFields(original, updated) {
31
31
  }
32
32
  return merged;
33
33
  }
34
- exports.mergeFields = mergeFields;