epicenter-libs 3.12.0 → 3.13.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 (42) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +35 -9
  3. package/dist/browser/{AckExtension-abba571e.js → AckExtension-60e398ac.js} +3 -3
  4. package/dist/{module/AckExtension-9fc856b6.js.map → browser/AckExtension-60e398ac.js.map} +1 -1
  5. package/dist/{module/ReloadExtension-6e2c5b28.js → browser/ReloadExtension-be517740.js} +3 -3
  6. package/dist/{module/ReloadExtension-6e2c5b28.js.map → browser/ReloadExtension-be517740.js.map} +1 -1
  7. package/dist/browser/{cometd-666222f2.js → cometd-7931e124.js} +2 -2
  8. package/dist/browser/{cometd-666222f2.js.map → cometd-7931e124.js.map} +1 -1
  9. package/dist/browser/{epicenter-20715e7d.js → epicenter-c91acff3.js} +60 -13
  10. package/dist/browser/epicenter-c91acff3.js.map +1 -0
  11. package/dist/browser/epicenter.js +1 -1
  12. package/dist/cjs/{AckExtension-bd9806d5.js → AckExtension-bab2d756.js} +3 -3
  13. package/dist/cjs/{AckExtension-bd9806d5.js.map → AckExtension-bab2d756.js.map} +1 -1
  14. package/dist/cjs/{ReloadExtension-2c2f6204.js → ReloadExtension-a20c95d6.js} +3 -3
  15. package/dist/cjs/{ReloadExtension-2c2f6204.js.map → ReloadExtension-a20c95d6.js.map} +1 -1
  16. package/dist/cjs/{cometd-9d07c2e7.js → cometd-4d3c3ab9.js} +2 -2
  17. package/dist/cjs/{cometd-9d07c2e7.js.map → cometd-4d3c3ab9.js.map} +1 -1
  18. package/dist/cjs/{epicenter-6dcfde95.js → epicenter-db27db78.js} +60 -13
  19. package/dist/cjs/epicenter-db27db78.js.map +1 -0
  20. package/dist/cjs/epicenter.js +1 -1
  21. package/dist/epicenter.js +56 -9
  22. package/dist/epicenter.js.map +1 -1
  23. package/dist/epicenter.min.js +1 -1
  24. package/dist/epicenter.min.js.map +1 -1
  25. package/dist/module/{AckExtension-9fc856b6.js → AckExtension-8b28cd0e.js} +3 -3
  26. package/dist/{browser/AckExtension-abba571e.js.map → module/AckExtension-8b28cd0e.js.map} +1 -1
  27. package/dist/{browser/ReloadExtension-0faa22b2.js → module/ReloadExtension-c3365c45.js} +3 -3
  28. package/dist/{browser/ReloadExtension-0faa22b2.js.map → module/ReloadExtension-c3365c45.js.map} +1 -1
  29. package/dist/module/{cometd-c2377379.js → cometd-1fcdcd0d.js} +2 -2
  30. package/dist/module/{cometd-c2377379.js.map → cometd-1fcdcd0d.js.map} +1 -1
  31. package/dist/module/{epicenter-ae43d3c6.js → epicenter-e3bbbbd5.js} +60 -13
  32. package/dist/module/epicenter-e3bbbbd5.js.map +1 -0
  33. package/dist/module/epicenter.js +1 -1
  34. package/dist/types/adapters/cometd.d.ts +2 -0
  35. package/dist/types/adapters/project.d.ts +1 -1
  36. package/package.json +1 -1
  37. package/src/adapters/channel.ts +5 -6
  38. package/src/adapters/cometd.ts +45 -0
  39. package/src/adapters/project.ts +3 -2
  40. package/dist/browser/epicenter-20715e7d.js.map +0 -1
  41. package/dist/cjs/epicenter-6dcfde95.js.map +0 -1
  42. package/dist/module/epicenter-ae43d3c6.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ # [3.13.0](https://github.com/forio/epicenter-libs/compare/v3.12.0...v3.13.0) (2022-05-12)
2
+
3
+
4
+ ### Features
5
+
6
+ * add optionals for projectAdapter.list ([a944b1c](https://github.com/forio/epicenter-libs/commit/a944b1cb0c2de7e5b50790a0b1c5ec0935898b8a))
7
+ * listen for cometd disconnect/reconnect ([f857332](https://github.com/forio/epicenter-libs/commit/f857332425ea958bbe42c9baebca7d887c9cf37d))
8
+
9
+
10
+
1
11
  # [3.12.0](https://github.com/forio/epicenter-libs/compare/v3.11.0...v3.12.0) (2022-02-01)
2
12
 
3
13
 
package/README.md CHANGED
@@ -21,6 +21,12 @@ Table of Contents
21
21
  - [Tenets for Development](#tenets-for-development)
22
22
  - [How to Contribute](#how-to-contribute)
23
23
  - [How to Prepare a Release](#how-to-prepare-a-release)
24
+ - [Publishing on NPM](#publishing-on-npm)
25
+ - [npm publish --dry-run](#npm-publish---dry-run)
26
+ - [npm publish --tag next](#npm-publish---tag-next)
27
+ - [npm unpublish epicenter-libs@{{version}}](#npm-unpublish-epicenter-libsversion)
28
+ - [npm dist-tag add | rm | ls](#npm-dist-tag-add--rm--ls)
29
+ - [Versioning](#versioning)
24
30
  - [How to Test](#how-to-test)
25
31
  - [How to Use Examples (Local)](#how-to-use-examples-local)
26
32
  - [Vanilla JavaScript](#vanilla-javascript)
@@ -79,23 +85,43 @@ Prequisite Node version: 12+
79
85
  1. Create a new branch for your change; if there's a JIRA ticket associated use that, e.g., `git checkout -b EPILIBS-42`
80
86
  2. Make your changes
81
87
  3. Create a [conventional commit](https://www.conventionalcommits.org/en/v1.0.0/) describing your changes
82
- * If you feel your change breaks the existing usage of the library be sure to indicate this in the commit message by adding a note in the commit footer starting with: `BREAKING CHANGE: `
88
+ * If you feel your change breaks the existing usage of the library be sure to indicate this in the commit message by adding a note in the commit footer starting with: `BREAKING CHANGE: `, and this will be automatically reflected in the changelog when it's generated.
83
89
  4. Push up your branch and make sure it passes the tests in the pre-push hook
84
90
  5. Make a pull request on github, or if you're confident: merge your branch into `master`
85
91
 
86
92
  # How to Prepare a Release
87
93
  1. Build to the `dist/` folder: `npm run build`
88
94
  2. Test to make sure there are no breaking changes: `npm run single-test`
89
- 3. Make sure you have the latest tags from master: `git fetch origin`
90
- 4. Update version in the `package.json` file; suffix your version with `-breaking` if it contains a breaking change
91
- 5. Update the change log: `npm run changelog` to generate the diff between versions
92
- 6. Commit `package.json` and `CHANGELOG.md` files to `master`
93
- 7. Tag `master` with the same version you used in step 4 (prefix with 'v')
94
- 8. Visit Jenkins: https://build.forio.com/job/deploy-epicenter-js-v3--epicenter--/
95
+ 3. Update the version in the `package.json` to the value you'd like to release
96
+ 4. Generate a changelog entry using `conventional-changelog`
97
+ - Entries are created based on the most recent git tag compared to the the version value in `package.json`
98
+ - For this reason, make sure sure you have the latest tags: `git fetch origin`
99
+ - Run: `npm run changelog` -- which will append to the CHANGELOG.md file an automated text translation of the commits created between the most recent git tag, and the current HEAD.
100
+ - Commit your updated CHANGELOG.md: `git add CHANGELOG.md && git commit -m "chore: update CHANGELOG"`
101
+ 5. Tag `master` with the same version you used in step 3 (prefix with 'v')
102
+ 6. Visit Jenkins to deploy to `forio.com/tools/js-libs`: https://build.forio.com/job/deploy-epicenter-js-v3--epicenter--/
103
+ 7. Publish the files in `dist/` folder to NPM: `npm publish`
104
+
105
+ ## Publishing on NPM
106
+ In order to publish to NPM, you have to be logged into the Forio NPM account. To do this, you'll need perform a one-time login with `npm adduser`. You will be prompted for a one-time password, which will be sent to `tech@forio.com`. Afterwhich, you'll be able to run `npm publish`. Below are other helpful commands to consider.
107
+
108
+ ### npm publish --dry-run
109
+ For doing a test run before actually publishing
110
+
111
+ ### npm publish --tag next
112
+ For when you want to publish an alpha version of the libs for testing. Normal installations will not pick up versions tagged as "next". This way, you can publish on a change you want to test, and then go to an external project and run `npm install -i epicenter-libs@next` to go and play around with your changes.
113
+
114
+ ### npm unpublish epicenter-libs@{{version}}
115
+ For when you accidentally publish an incorrect version (this removes the package version from the registry, as well as deletes its entry, removign the tarball).
116
+
117
+ ### npm dist-tag add | rm | ls
118
+ Manages distribution tags, for when you make a typo spelling "--tag next" and you end up publishing `epicenter-libs@name`.
119
+
120
+
121
+ ## Versioning
122
+ The web development team isn't planning on incrementing the number that correlates to the major version, that space is reserved for major platform changes (i.e., Epicenter v4 and beyond). Instead, starting in `v3.8.0` -- we will opt to track breaking changes with a suffix `-breaking` and increment the minor number instead.
95
123
 
96
- \*The web development team isn't planning on incrementing the number that correlates to the major version, that space is reserved for major platform changes (i.e., Epicenter v4 and beyond). Instead, starting in `v3.8.0` -- we will opt to track breaking changes with a suffix `-breaking` and increment the minor number instead.
97
124
 
98
- E.g., `3.10.0-breaking` indicates a breaking change to `3.9.x`. **Beware of these changes when incrementing versions; do not jump minor versions without looking at the tags in between.** You can utilize the CHANGELOG.md to review what has changed between versions and tags.
99
125
 
100
126
  # How to Test
101
127
  Tests are written to preserve behavior across releases. These are unit tests and are not intended for testing Epicenter features themselves.
@@ -1,5 +1,5 @@
1
- import { c as createCommonjsModule, a as commonjsGlobal } from './epicenter-20715e7d.js';
2
- import { a as cometd } from './cometd-666222f2.js';
1
+ import { c as createCommonjsModule, a as commonjsGlobal } from './epicenter-c91acff3.js';
2
+ import { a as cometd } from './cometd-7931e124.js';
3
3
 
4
4
  function _mergeNamespaces(n, m) {
5
5
  m.forEach(function (e) {
@@ -126,4 +126,4 @@ var AckExtension$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({
126
126
  }, [AckExtension]));
127
127
 
128
128
  export { AckExtension$1 as A };
129
- //# sourceMappingURL=AckExtension-abba571e.js.map
129
+ //# sourceMappingURL=AckExtension-60e398ac.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AckExtension-9fc856b6.js","sources":["../../node_modules/cometd/AckExtension.js"],"sourcesContent":["/*\n * Copyright (c) 2008-2020 the original author or authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n(function(root, factory){\n if (typeof exports === 'object') {\n module.exports = factory(require('./cometd'));\n } else if (typeof define === 'function' && define.amd) {\n define(['./cometd'], factory);\n } else {\n factory(root.org.cometd);\n }\n}(this, function(cometdModule) {\n /**\n * This client-side extension enables the client to acknowledge to the server\n * the messages that the client has received.\n * For the acknowledgement to work, the server must be configured with the\n * correspondent server-side ack extension. If both client and server support\n * the ack extension, then the ack functionality will take place automatically.\n * By enabling this extension, all messages arriving from the server will arrive\n * via /meta/connect, so the comet communication will be slightly chattier.\n * The fact that all messages will return via /meta/connect means also that the\n * messages will arrive with total order, which is not guaranteed if messages\n * can arrive via both /meta/connect and normal response.\n * Messages are not acknowledged one by one, but instead a batch of messages is\n * acknowledged when the /meta/connect returns.\n */\n return cometdModule.AckExtension = function() {\n var _cometd;\n var _serverSupportsAcks = false;\n var _batch;\n\n function _debug(text, args) {\n _cometd._debug(text, args);\n }\n\n this.registered = function(name, cometd) {\n _cometd = cometd;\n _debug('AckExtension: executing registration callback');\n };\n\n this.unregistered = function() {\n _debug('AckExtension: executing unregistration callback');\n _cometd = null;\n };\n\n this.incoming = function(message) {\n var channel = message.channel;\n var ext = message.ext;\n if (channel === '/meta/handshake') {\n if (ext) {\n var ackField = ext.ack;\n if (typeof ackField === 'object') {\n // New format.\n _serverSupportsAcks = ackField.enabled === true;\n var batch = ackField.batch;\n if (typeof batch === 'number') {\n _batch = batch;\n }\n } else {\n // Old format.\n _serverSupportsAcks = ackField === true;\n }\n }\n _debug('AckExtension: server supports acknowledgements', _serverSupportsAcks);\n } else if (channel === '/meta/connect' && message.successful && _serverSupportsAcks) {\n if (ext && typeof ext.ack === 'number') {\n _batch = ext.ack;\n _debug('AckExtension: server sent batch', _batch);\n }\n }\n return message;\n };\n\n this.outgoing = function(message) {\n var channel = message.channel;\n if (!message.ext) {\n message.ext = {};\n }\n if (channel === '/meta/handshake') {\n message.ext.ack = _cometd && _cometd.ackEnabled !== false;\n _serverSupportsAcks = false;\n _batch = 0;\n } else if (channel === '/meta/connect') {\n if (_serverSupportsAcks) {\n message.ext.ack = _batch;\n _debug('AckExtension: client sending batch', _batch);\n }\n }\n return message;\n };\n };\n}));\n"],"names":["require$$0","this"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,C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pD,gBAAgB,IAAI,mBAAmB,EAAE;AACzC,oBAAoB,OAAO,CAAC,GAAG,CAAC,GAAG,GAAG,MAAM,CAAC;AAC7C,oBAAoB,MAAM,CAAC,oCAAoC,EAAE,MAAM,CAAC,CAAC;AACzE,iBAAiB;AACjB,aAAa;AACb,YAAY,OAAO,OAAO,CAAC;AAC3B,SAAS,CAAC;AACV,KAAK,CAAC;AACN,CAAC,CAAC;;;;;;;;;;"}
1
+ {"version":3,"file":"AckExtension-60e398ac.js","sources":["../../node_modules/cometd/AckExtension.js"],"sourcesContent":["/*\n * Copyright (c) 2008-2020 the original author or authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n(function(root, factory){\n if (typeof exports === 'object') {\n module.exports = factory(require('./cometd'));\n } else if (typeof define === 'function' && define.amd) {\n define(['./cometd'], factory);\n } else {\n factory(root.org.cometd);\n }\n}(this, function(cometdModule) {\n /**\n * This client-side extension enables the client to acknowledge to the server\n * the messages that the client has received.\n * For the acknowledgement to work, the server must be configured with the\n * correspondent server-side ack extension. If both client and server support\n * the ack extension, then the ack functionality will take place automatically.\n * By enabling this extension, all messages arriving from the server will arrive\n * via /meta/connect, so the comet communication will be slightly chattier.\n * The fact that all messages will return via /meta/connect means also that the\n * messages will arrive with total order, which is not guaranteed if messages\n * can arrive via both /meta/connect and normal response.\n * Messages are not acknowledged one by one, but instead a batch of messages is\n * acknowledged when the /meta/connect returns.\n */\n return cometdModule.AckExtension = function() {\n var _cometd;\n var _serverSupportsAcks = false;\n var _batch;\n\n function _debug(text, args) {\n _cometd._debug(text, args);\n }\n\n this.registered = function(name, cometd) {\n _cometd = cometd;\n _debug('AckExtension: executing registration callback');\n };\n\n this.unregistered = function() {\n _debug('AckExtension: executing unregistration callback');\n _cometd = null;\n };\n\n this.incoming = function(message) {\n var channel = message.channel;\n var ext = message.ext;\n if (channel === '/meta/handshake') {\n if (ext) {\n var ackField = ext.ack;\n if (typeof ackField === 'object') {\n // New format.\n _serverSupportsAcks = ackField.enabled === true;\n var batch = ackField.batch;\n if (typeof batch === 'number') {\n _batch = batch;\n }\n } else {\n // Old format.\n _serverSupportsAcks = ackField === true;\n }\n }\n _debug('AckExtension: server supports acknowledgements', _serverSupportsAcks);\n } else if (channel === '/meta/connect' && message.successful && _serverSupportsAcks) {\n if (ext && typeof ext.ack === 'number') {\n _batch = ext.ack;\n _debug('AckExtension: server sent batch', _batch);\n }\n }\n return message;\n };\n\n this.outgoing = function(message) {\n var channel = message.channel;\n if (!message.ext) {\n message.ext = {};\n }\n if (channel === '/meta/handshake') {\n message.ext.ack = _cometd && _cometd.ackEnabled !== false;\n _serverSupportsAcks = false;\n _batch = 0;\n } else if (channel === '/meta/connect') {\n if (_serverSupportsAcks) {\n message.ext.ack = _batch;\n _debug('AckExtension: client sending batch', _batch);\n }\n }\n return message;\n };\n };\n}));\n"],"names":["require$$0","this"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,SAAS,IAAI,EAAE,OAAO,CAAC;AACxB,IAAqC;AACrC,QAAQ,cAAc,GAAG,OAAO,CAACA,MAAmB,CAAC,CAAC;AACtD,KAIK;AACL,CAAC,CAACC,cAAI,EAAE,SAAS,YAAY,EAAE;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,YAAY,CAAC,YAAY,GAAG,WAAW;AAClD,QAAQ,IAAI,OAAO,CAAC;AACpB,QAAQ,IAAI,mBAAmB,GAAG,KAAK,CA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- import { a as cometd } from './cometd-c2377379.js';
1
+ import { c as createCommonjsModule, a as commonjsGlobal } from './epicenter-c91acff3.js';
2
+ import { a as cometd } from './cometd-7931e124.js';
3
3
 
4
4
  function _mergeNamespaces(n, m) {
5
5
  m.forEach(function (e) {
@@ -250,4 +250,4 @@ var ReloadExtension$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/_mergeNamespaces
250
250
  }, [ReloadExtension]));
251
251
 
252
252
  export { ReloadExtension$1 as R };
253
- //# sourceMappingURL=ReloadExtension-6e2c5b28.js.map
253
+ //# sourceMappingURL=ReloadExtension-be517740.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ReloadExtension-6e2c5b28.js","sources":["../../node_modules/cometd/ReloadExtension.js"],"sourcesContent":["/*\n * Copyright (c) 2008-2020 the original author or authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n(function(root, factory) {\n if (typeof exports === 'object') {\n module.exports = factory(require('./cometd'));\n } else if (typeof define === 'function' && define.amd) {\n define(['./cometd'], factory);\n } else {\n factory(root.org.cometd);\n }\n}(this, function(cometdModule) {\n /**\n * The reload extension allows a page to be loaded (or reloaded)\n * without having to re-handshake in the new (or reloaded) page,\n * therefore resuming the existing CometD connection.\n *\n * When the reload() method is called, the state of the CometD\n * connection is stored in the window.sessionStorage object.\n * The reload() method must therefore be called by page unload\n * handlers, often provided by JavaScript toolkits.\n *\n * When the page is (re)loaded, this extension checks the\n * window.sessionStorage and restores the CometD connection,\n * maintaining the same CometD clientId.\n */\n return cometdModule.ReloadExtension = function(configuration) {\n var _cometd;\n var _debug;\n var _state = {};\n var _name = 'org.cometd.reload';\n var _batch = false;\n var _reloading = false;\n\n function _reload(config) {\n if (_state.handshakeResponse) {\n _reloading = true;\n var transport = _cometd.getTransport();\n if (transport) {\n transport.abort();\n }\n _configure(config);\n var state = JSON.stringify(_state);\n _debug('Reload extension saving state', state);\n window.sessionStorage.setItem(_name, state);\n }\n }\n\n function _similarState(oldState) {\n // We want to check here that the CometD object\n // did not change much between reloads.\n // We just check the URL for now, but in future\n // further checks may involve the transport type\n // and other configuration parameters.\n return _state.url === oldState.url;\n }\n\n function _configure(config) {\n if (config) {\n if (typeof config.name === 'string') {\n _name = config.name;\n }\n }\n }\n\n function _receive(response) {\n _cometd.receive(response);\n }\n\n this.configure = _configure;\n\n this._receive = _receive;\n\n this.registered = function(name, cometd) {\n _cometd = cometd;\n _cometd.reload = _reload;\n _debug = _cometd._debug;\n };\n\n this.unregistered = function() {\n delete _cometd.reload;\n _cometd = null;\n };\n\n this.outgoing = function(message) {\n switch (message.channel) {\n case '/meta/handshake':\n {\n _state = {};\n _state.url = _cometd.getURL();\n\n var state = window.sessionStorage.getItem(_name);\n _debug('Reload extension found state', state);\n // Is there a saved handshake response from a prior load ?\n if (state) {\n try {\n var oldState = JSON.parse(state);\n\n // Remove the state, not needed anymore\n window.sessionStorage.removeItem(_name);\n\n if (oldState.handshakeResponse && _similarState(oldState)) {\n _debug('Reload extension restoring state', oldState);\n\n // Since we are going to abort this message,\n // we must save an eventual callback to restore\n // it when we replay the handshake response.\n var callback = _cometd._getCallback(message.id);\n\n var self = this;\n setTimeout(function() {\n _debug('Reload extension replaying handshake response', oldState.handshakeResponse);\n _state.handshakeResponse = oldState.handshakeResponse;\n _state.transportType = oldState.transportType;\n\n // Restore the callback.\n _cometd._putCallback(message.id, callback);\n\n var response = _cometd._mixin(true, {}, _state.handshakeResponse, {\n // Keep the response message id the same as the request.\n id: message.id,\n // Tells applications this is a handshake replayed by the reload extension.\n ext: {\n reload: true\n }\n });\n // Use the same transport as before.\n response.supportedConnectionTypes = [_state.transportType];\n\n self._receive(response);\n _debug('Reload extension replayed handshake response', response);\n }, 0);\n\n // Delay any sends until first connect is complete.\n // This avoids that there is an old /meta/connect pending on server\n // that will be resumed to send messages to the client, when the\n // client has already closed the connection, thereby losing the messages.\n if (!_batch) {\n _batch = true;\n _cometd.startBatch();\n }\n\n // This handshake is aborted, as we will replay the prior handshake response\n return null;\n } else {\n _debug('Reload extension could not restore state', oldState);\n }\n } catch (x) {\n _debug('Reload extension error while trying to restore state', x);\n }\n }\n break;\n }\n case '/meta/connect':\n {\n if (_reloading === true) {\n // The reload causes the failure of the outstanding /meta/connect,\n // which CometD will react to by sending another. Here we avoid\n // that /meta/connect messages are sent between the reload and\n // the destruction of the JavaScript context, so that we are sure\n // that the first /meta/connect is the one triggered after the\n // replay of the /meta/handshake by this extension.\n _debug('Reload extension aborting /meta/connect during reload');\n return null;\n }\n\n if (!_state.transportType) {\n _state.transportType = message.connectionType;\n _debug('Reload extension tracked transport type', _state.transportType);\n }\n break;\n }\n case '/meta/disconnect':\n {\n _state = {};\n break;\n }\n default:\n {\n break;\n }\n }\n return message;\n };\n\n this.incoming = function(message) {\n if (message.successful) {\n switch (message.channel) {\n case '/meta/handshake':\n {\n // If the handshake response is already present, then we're replaying it.\n // Since the replay may have modified the handshake response, do not record it here.\n if (!_state.handshakeResponse) {\n // Save successful handshake response\n _state.handshakeResponse = message;\n _debug('Reload extension tracked handshake response', message);\n }\n break;\n }\n case '/meta/connect':\n {\n if (_batch) {\n _batch = false;\n _cometd.endBatch();\n }\n break;\n }\n case '/meta/disconnect':\n {\n _state = {};\n break;\n }\n default:\n {\n break;\n }\n }\n }\n return message;\n };\n\n _configure(configuration);\n };\n}));\n"],"names":["require$$0","this"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,SAAS,IAAI,EAAE,OAAO,EAAE;AACzB,IAAqC;AACrC,QAAQ,cAA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,EAAE;AAC1C,YAAY,IAAI,OAAO,CAAC,UAAU,EAAE;AACpC,gBAAgB,QAAQ,OAAO,CAAC,OAAO;AACvC,oBAAoB,KAAK,iBAAiB;AAC1C,oBAAoB;AACpB;AACA;AACA,wBAAwB,IAAI,CAAC,MAAM,CAAC,iBAAiB,EAAE;AACvD;AACA,4BAA4B,MAAM,CAAC,iBAAiB,GAAG,OAAO,CAAC;AAC/D,4BAA4B,MAAM,CAAC,6CAA6C,EAAE,OAAO,CAAC,CAAC;AAC3F,yBAAyB;AACzB,wBAAwB,MAAM;AAC9B,qBAAqB;AACrB,oBAAoB,KAAK,eAAe;AACxC,oBAAoB;AACpB,wBAAwB,IAAI,MAAM,EAAE;AACpC,4BAA4B,MAAM,GAAG,KAAK,CAAC;AAC3C,4BAA4B,OAAO,CAAC,QAAQ,EAAE,CAAC;AAC/C,yBAAyB;AACzB,wBAAwB,MAAM;AAC9B,qBAAqB;AACrB,oBAAoB,KAAK,kBAAkB;AAC3C,oBAAoB;AACpB,wBAAwB,MAAM,GAAG,EAAE,CAAC;AACpC,wBAAwB,MAAM;AAC9B,qBAAqB;AAKrB,iBAAiB;AACjB,aAAa;AACb,YAAY,OAAO,OAAO,CAAC;AAC3B,SAAS,CAAC;AACV;AACA,QAAQ,UAAU,CAAC,aAAa,CAAC,CAAC;AAClC,KAAK,CAAC;AACN,CAAC,CAAC;;;;;;;;;;"}
1
+ {"version":3,"file":"ReloadExtension-be517740.js","sources":["../../node_modules/cometd/ReloadExtension.js"],"sourcesContent":["/*\n * Copyright (c) 2008-2020 the original author or authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n(function(root, factory) {\n if (typeof exports === 'object') {\n module.exports = factory(require('./cometd'));\n } else if (typeof define === 'function' && define.amd) {\n define(['./cometd'], factory);\n } else {\n factory(root.org.cometd);\n }\n}(this, function(cometdModule) {\n /**\n * The reload extension allows a page to be loaded (or reloaded)\n * without having to re-handshake in the new (or reloaded) page,\n * therefore resuming the existing CometD connection.\n *\n * When the reload() method is called, the state of the CometD\n * connection is stored in the window.sessionStorage object.\n * The reload() method must therefore be called by page unload\n * handlers, often provided by JavaScript toolkits.\n *\n * When the page is (re)loaded, this extension checks the\n * window.sessionStorage and restores the CometD connection,\n * maintaining the same CometD clientId.\n */\n return cometdModule.ReloadExtension = function(configuration) {\n var _cometd;\n var _debug;\n var _state = {};\n var _name = 'org.cometd.reload';\n var _batch = false;\n var _reloading = false;\n\n function _reload(config) {\n if (_state.handshakeResponse) {\n _reloading = true;\n var transport = _cometd.getTransport();\n if (transport) {\n transport.abort();\n }\n _configure(config);\n var state = JSON.stringify(_state);\n _debug('Reload extension saving state', state);\n window.sessionStorage.setItem(_name, state);\n }\n }\n\n function _similarState(oldState) {\n // We want to check here that the CometD object\n // did not change much between reloads.\n // We just check the URL for now, but in future\n // further checks may involve the transport type\n // and other configuration parameters.\n return _state.url === oldState.url;\n }\n\n function _configure(config) {\n if (config) {\n if (typeof config.name === 'string') {\n _name = config.name;\n }\n }\n }\n\n function _receive(response) {\n _cometd.receive(response);\n }\n\n this.configure = _configure;\n\n this._receive = _receive;\n\n this.registered = function(name, cometd) {\n _cometd = cometd;\n _cometd.reload = _reload;\n _debug = _cometd._debug;\n };\n\n this.unregistered = function() {\n delete _cometd.reload;\n _cometd = null;\n };\n\n this.outgoing = function(message) {\n switch (message.channel) {\n case '/meta/handshake':\n {\n _state = {};\n _state.url = _cometd.getURL();\n\n var state = window.sessionStorage.getItem(_name);\n _debug('Reload extension found state', state);\n // Is there a saved handshake response from a prior load ?\n if (state) {\n try {\n var oldState = JSON.parse(state);\n\n // Remove the state, not needed anymore\n window.sessionStorage.removeItem(_name);\n\n if (oldState.handshakeResponse && _similarState(oldState)) {\n _debug('Reload extension restoring state', oldState);\n\n // Since we are going to abort this message,\n // we must save an eventual callback to restore\n // it when we replay the handshake response.\n var callback = _cometd._getCallback(message.id);\n\n var self = this;\n setTimeout(function() {\n _debug('Reload extension replaying handshake response', oldState.handshakeResponse);\n _state.handshakeResponse = oldState.handshakeResponse;\n _state.transportType = oldState.transportType;\n\n // Restore the callback.\n _cometd._putCallback(message.id, callback);\n\n var response = _cometd._mixin(true, {}, _state.handshakeResponse, {\n // Keep the response message id the same as the request.\n id: message.id,\n // Tells applications this is a handshake replayed by the reload extension.\n ext: {\n reload: true\n }\n });\n // Use the same transport as before.\n response.supportedConnectionTypes = [_state.transportType];\n\n self._receive(response);\n _debug('Reload extension replayed handshake response', response);\n }, 0);\n\n // Delay any sends until first connect is complete.\n // This avoids that there is an old /meta/connect pending on server\n // that will be resumed to send messages to the client, when the\n // client has already closed the connection, thereby losing the messages.\n if (!_batch) {\n _batch = true;\n _cometd.startBatch();\n }\n\n // This handshake is aborted, as we will replay the prior handshake response\n return null;\n } else {\n _debug('Reload extension could not restore state', oldState);\n }\n } catch (x) {\n _debug('Reload extension error while trying to restore state', x);\n }\n }\n break;\n }\n case '/meta/connect':\n {\n if (_reloading === true) {\n // The reload causes the failure of the outstanding /meta/connect,\n // which CometD will react to by sending another. Here we avoid\n // that /meta/connect messages are sent between the reload and\n // the destruction of the JavaScript context, so that we are sure\n // that the first /meta/connect is the one triggered after the\n // replay of the /meta/handshake by this extension.\n _debug('Reload extension aborting /meta/connect during reload');\n return null;\n }\n\n if (!_state.transportType) {\n _state.transportType = message.connectionType;\n _debug('Reload extension tracked transport type', _state.transportType);\n }\n break;\n }\n case '/meta/disconnect':\n {\n _state = {};\n break;\n }\n default:\n {\n break;\n }\n }\n return message;\n };\n\n this.incoming = function(message) {\n if (message.successful) {\n switch (message.channel) {\n case '/meta/handshake':\n {\n // If the handshake response is already present, then we're replaying it.\n // Since the replay may have modified the handshake response, do not record it here.\n if (!_state.handshakeResponse) {\n // Save successful handshake response\n _state.handshakeResponse = message;\n _debug('Reload extension tracked handshake response', message);\n }\n break;\n }\n case '/meta/connect':\n {\n if (_batch) {\n _batch = false;\n _cometd.endBatch();\n }\n break;\n }\n case '/meta/disconnect':\n {\n _state = {};\n break;\n }\n default:\n {\n break;\n }\n }\n }\n return message;\n };\n\n _configure(configuration);\n };\n}));\n"],"names":["require$$0","this"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,SAAS,IAAI,EAAE,OAAO,EAAE;AACzB,IAAqC;AACrC,QAAQ,cAAc,GAAG,OAAO,CAACA,MAAmB,CAAC,CAAC;AACtD,KAIK;AACL,CAAC,CAACC,cAAI,EAAE,SAAS,YAAY,EAAE;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,YAAY,CAAC,eAAe,GAAG,SAAS,aAAa,EAAE;AAClE,QAAQ,IAAI,OAAO,CAAC;AACpB,QAAQ,IAAI,MAAM,CAAC;AACnB,QAAQ,IAAI,MAAM,GAAG,EAAE,CAAC;AACxB,QAAQ,IAAI,KAAK,GAAG,mBAAmB,CAAC;AACxC,QAAQ,IAAI,MAAM,GAAG,KAAK,CAAC;AAC3B,QAAQ,IAAI,UAAU,GAAG,KAAK,CAAC;AAC/B;AACA,QAAQ,SAAS,OAAO,CAAC,MAAM,EAAE;AACjC,YAAY,IAAI,MAAM,CAAC,iBAAiB,EAAE;AAC1C,gBAAgB,UAAU,GAAG,IAAI,CAAC;AAClC,gBAAgB,IAAI,SAAS,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;AACvD,gBAAgB,IAAI,SAAS,EAAE;AAC/B,oBAAoB,SAAS,CAAC,KAAK,EAAE,CAAC;AACtC,iBAAiB;AAC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B,SAAS,CAAC;AACV;AACA,QAAQ,UAAU,CAAC,aAAa,CAAC,CAAC;AAClC,KAAK,CAAC;AACN,CAAC,CAAC;;;;;;;;;;"}
@@ -1,4 +1,4 @@
1
- import { c as createCommonjsModule, a as commonjsGlobal } from './epicenter-20715e7d.js';
1
+ import { c as createCommonjsModule, a as commonjsGlobal } from './epicenter-c91acff3.js';
2
2
 
3
3
  function _mergeNamespaces(n, m) {
4
4
  m.forEach(function (e) {
@@ -3435,4 +3435,4 @@ var cometd$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({
3435
3435
  }, [cometd]));
3436
3436
 
3437
3437
  export { cometd as a, cometd$1 as c };
3438
- //# sourceMappingURL=cometd-666222f2.js.map
3438
+ //# sourceMappingURL=cometd-7931e124.js.map