├── .editorconfig ├── .github ├── ISSUE_TEMPLATE │ └── issue---feature-request.md └── workflows │ └── docs-refresh.yml ├── .gitignore ├── .npmignore ├── .prettierignore ├── .prettierrc.json ├── .travis.yml ├── Changelog.md ├── Contributing.md ├── LICENSE ├── README.MD ├── angular.json ├── bin ├── pre-publish.js └── release.sh ├── dist ├── LICENSE ├── README.MD ├── bundles │ ├── stomp-ng2-stompjs.umd.js │ ├── stomp-ng2-stompjs.umd.js.map │ ├── stomp-ng2-stompjs.umd.min.js │ └── stomp-ng2-stompjs.umd.min.js.map ├── esm2015 │ ├── index.js │ ├── src │ │ └── app │ │ │ ├── compatibility │ │ │ ├── stomp-headers.js │ │ │ ├── stomp-r.service.js │ │ │ ├── stomp-state.js │ │ │ ├── stomp.config.js │ │ │ └── stomp.service.js │ │ │ ├── injectable-rx-stomp-config.js │ │ │ ├── injectable-rx-stomp-rpc-config.js │ │ │ ├── rx-stomp-rpc.service.js │ │ │ ├── rx-stomp-service-factory.js │ │ │ └── rx-stomp.service.js │ └── stomp-ng2-stompjs.js ├── esm5 │ ├── index.js │ ├── src │ │ └── app │ │ │ ├── compatibility │ │ │ ├── stomp-headers.js │ │ │ ├── stomp-r.service.js │ │ │ ├── stomp-state.js │ │ │ ├── stomp.config.js │ │ │ └── stomp.service.js │ │ │ ├── injectable-rx-stomp-config.js │ │ │ ├── injectable-rx-stomp-rpc-config.js │ │ │ ├── rx-stomp-rpc.service.js │ │ │ ├── rx-stomp-service-factory.js │ │ │ └── rx-stomp.service.js │ └── stomp-ng2-stompjs.js ├── fesm2015 │ ├── stomp-ng2-stompjs.js │ └── stomp-ng2-stompjs.js.map ├── fesm5 │ ├── stomp-ng2-stompjs.js │ └── stomp-ng2-stompjs.js.map ├── index.d.ts ├── package.json ├── src │ └── app │ │ ├── compatibility │ │ ├── stomp-headers.d.ts │ │ ├── stomp-r.service.d.ts │ │ ├── stomp-state.d.ts │ │ ├── stomp.config.d.ts │ │ └── stomp.service.d.ts │ │ ├── injectable-rx-stomp-config.d.ts │ │ ├── injectable-rx-stomp-rpc-config.d.ts │ │ ├── rx-stomp-rpc.service.d.ts │ │ ├── rx-stomp-service-factory.d.ts │ │ └── rx-stomp.service.d.ts ├── stomp-ng2-stompjs.d.ts └── stomp-ng2-stompjs.metadata.json ├── index.ts ├── ng-package.json ├── package-lock.json ├── package.json ├── rabbitmq └── Dockerfile ├── src ├── app │ ├── compatibility │ │ ├── stomp-headers.ts │ │ ├── stomp-r.service.ts │ │ ├── stomp-state.ts │ │ ├── stomp.config.ts │ │ └── stomp.service.ts │ ├── injectable-rx-stomp-config.ts │ ├── injectable-rx-stomp-rpc-config.ts │ ├── rx-stomp-rpc.service.ts │ ├── rx-stomp-service-factory.ts │ └── rx-stomp.service.ts ├── environments │ ├── environment.prod.ts │ └── environment.ts ├── karma.conf.js ├── polyfills.ts ├── specs │ ├── app │ │ └── services │ │ │ ├── compatibility │ │ │ ├── helpers.ts │ │ │ ├── stomp-queue.operations.spec.ts │ │ │ ├── stomp-r.service.spec.ts │ │ │ ├── stomp.service.factory.ts │ │ │ └── stomp.service.spec.ts │ │ │ ├── rx-helpers.ts │ │ │ ├── rx-stomp-rpc.service.spec.ts │ │ │ └── rx-stomp-service.spec.ts │ └── polyfills.ts ├── test.ts ├── tsconfig.app.json ├── tsconfig.spec.json └── tslint.json ├── tsconfig.json └── tslint.json /.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/issue---feature-request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: issue / feature request 3 | about: Report an issue / feature request 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | --- 8 | 9 | Please see FAQs at https://stomp-js.github.io/faqs/2019/05/20/faqs.html before reporting. 10 | -------------------------------------------------------------------------------- /.github/workflows/docs-refresh.yml: -------------------------------------------------------------------------------- 1 | # This is a basic workflow that is manually triggered 2 | 3 | name: API docs refresh 4 | 5 | on: 6 | push: 7 | branches: 8 | - master 9 | - develop 10 | 11 | jobs: 12 | build: 13 | # The type of runner that the job will run on 14 | runs-on: ubuntu-latest 15 | 16 | # Steps represent a sequence of tasks that will be executed as part of the job 17 | steps: 18 | - name: Trigger workflow to update Github pages 19 | uses: benc-uk/workflow-dispatch@v1 20 | with: 21 | workflow: API docs refresh 22 | repo: stomp-js/stomp-js.github.io 23 | ref: master 24 | token: ${{ secrets.WORKLOW_TOKEN }} 25 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Node 2 | node_modules/* 3 | npm-debug.log 4 | 5 | # TypeScript 6 | # *.js 7 | #*.map 8 | #*.d.ts 9 | 10 | # JetBrains 11 | .idea 12 | .project 13 | .settings 14 | .idea/* 15 | *.iml 16 | 17 | # VS Code 18 | .vscode/* 19 | 20 | # Windows 21 | Thumbs.db 22 | Desktop.ini 23 | 24 | # Mac 25 | .DS_Store 26 | **/.DS_Store 27 | 28 | # Ngc generated files 29 | #**/*.ngfactory.ts 30 | #*.metadata.json 31 | #*.ngsummary.json 32 | 33 | # bin/npm-publish 34 | 35 | # ng-packagr 36 | .ng_pkg_build 37 | dist.tgz 38 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | # Need only source .ts files - needed for source only distribution 2 | * 3 | 4 | !index.ts 5 | !src/*.ts 6 | !src/**/*.ts 7 | 8 | src/environments 9 | src/specs 10 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | 2 | node_modules 3 | 4 | dist 5 | -------------------------------------------------------------------------------- /.prettierrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "arrowParens": "avoid", 3 | "singleQuote": true 4 | } 5 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - '10' 4 | - '12' 5 | - '14' 6 | 7 | before_install: 8 | - docker build -t rabbitmq:official-alpine-with-webstomp rabbitmq/ 9 | - docker run -d --hostname rabbitmq --name rabbitmq -p 15674:15674 rabbitmq:official-alpine-with-webstomp 10 | 11 | before_script: 12 | - docker exec rabbitmq rabbitmqctl status 13 | 14 | script: 15 | - ng lint && ng test 16 | -------------------------------------------------------------------------------- /Changelog.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | # 8.0.0 (2020-20-22) 4 | 5 | - Use `es2015` as target to avoid Angular issues. 6 | - rx-stomp@1. 7 | - Start using prettier. 8 | - Configure Travis to use Node 10, 12 and 14. 9 | 10 | # 7.2.0-beta.1 2019-01-18 11 | 12 | - rx-stomp@0.3.0-beta.1 13 | - stompjs@5.2.0 14 | - Send ping only if WebSocket is connected. 15 | - Concept of splitLargeFrames flag. 16 | Working towards [ng2-stompjs#120](https://github.com/stomp-js/ng2-stompjs/issues/120) 17 | - Concept of forceBinaryWSFrames. 18 | 19 | # 7.1.0 2019-01-10 20 | 21 | - rx-stomp@0.2.0 22 | 23 | # 7.1.0-beta.1 2018-12-24 24 | 25 | - rx-stomp@0.2.0-beta.1 26 | - Message -> IMessage, InjectableRxStompRpcConfig -> InjectableRxStompRPCConfig 27 | 28 | # 7.0.1 2018-11-26 29 | 30 | - Updated @stomp/rx-stomp and @stomp/stompjs 31 | 32 | # 7.0.0 2018-11-12 33 | 34 | - Document restructuring and cleanups. 35 | 36 | # 7.0.0-beta.4 2018-11-05 37 | 38 | - Updated API documentation. 39 | - Moved some of the guides to https://stomp-js.github.io 40 | - Updated "@stomp/rx-stomp@0.1.0-beta.5" fixes 41 | [#103](https://github.com/stomp-js/ng2-stompjs/issues/103) 42 | 43 | # 7.0.0-beta.3 2018-11-04 44 | 45 | - Fix error in `src/rx-stomp-service-factory.ts` 46 | 47 | # 7.0.0-beta.2 2018-11-04 48 | 49 | - Test cases and documentation updates, lint clean 50 | - Update @stomp/rx-stomp to 0.1.0-beta.4 51 | 52 | # 7.0.0-beta.1 2018-10-31 53 | 54 | - Based on @stompjs/rx-stomp 55 | - Compatibility mode working 56 | 57 | # 6.1.0.beta.4 2018-09-24 58 | 59 | - Correct packaging error 60 | 61 | # 6.1.0.beta.3 2018-09-23 62 | 63 | - RPC support 64 | 65 | # 4.0.1 & 6.0.1 2018-07-20 66 | 67 | - Fix issue with disconnect [#77](https://github.com/stomp-js/ng2-stompjs/issues/77) 68 | 69 | ## Angular 6 70 | 71 | - It will have version numbers in 6.x.x format. 72 | 73 | ## Angular 2/4/5 74 | 75 | - It will have version numbers in 4.x.x format. 76 | 77 | ### 0.6.4 78 | 79 | - Updates in test cases. 80 | - Documentation update. 81 | - Updated dependency of @stomp/stompjs to >= 4.0.2 82 | - [waitForReceipt](https://stomp-js.github.io/ng2-stompjs/injectables/StompRService.html#waitForReceipt) now passes the frame to the callback. 83 | 84 | ### 0.6.3 85 | 86 | - Switched to [Compodoc](https://github.com/compodoc/compodoc) from TypeDoc. 87 | - Changed StompHeaders types to allow any type (instead of string) as value. 88 | - Documentation changes. 89 | 90 | ### 0.6.2 91 | 92 | - Added ability to get server headers from CONNECTED Frame 93 | https://stomp-js.github.io/ng2-stompjs/injectables/StompRService.html#serverHeadersObservable 94 | - Enabled Travis 95 | 96 | ### 0.6.1 97 | 98 | - Updated dependencies 99 | 100 | ### 0.6.0 101 | 102 | - Jump in version number to indicate compiled JS release 103 | - Improved Angular 5 support 104 | 105 | ### 0.4.3 106 | 107 | - Ability to delay initialization 108 | - Angular 5 compatibility 109 | 110 | ### 0.4.2 111 | 112 | - Initial [SockJS Support](https://stomp-js.github.io/ng2-stompjs/additional-documentation/sock-js.html). 113 | Sample at https://github.com/stomp-js/ng4-stompjs-demo/tree/sockjs 114 | 115 | ### 0.4.0 116 | 117 | - Updated to make it compliant to possible use of APP_INITIALIZER. The way to initiate the service has changed and it no longer uses StompConfigService. 118 | StompConfig is directly injected as dependency into StompService 119 | 120 | ### 0.3.8 121 | 122 | - Switched to source distribution. The npm bundle now only has .ts files 123 | 124 | ### 0.3.5 125 | 126 | - Test case at https://github.com/stomp-js/ng2-stompjs-testbed these 127 | will be merged into main repository in future. Currently unable 128 | to configure Karma correctly in the main project. Any help appreciated 129 | 130 | ### 0.3.4 131 | 132 | - Added references to GitHub pages 133 | 134 | ### 0.3.0 135 | 136 | - Configuration structure has changed, user/password are not part of header 137 | - Support for headers in connect, subscribe, and publish 138 | - Typedoc for API documentation 139 | -------------------------------------------------------------------------------- /Contributing.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | ## How to contribute 4 | 5 | - File issues. 6 | - Edit/write documentation. 7 | - Submit pull requests. 8 | - Test in different environments. 9 | - Raise awareness. 10 | 11 | ## Summary of tools 12 | 13 | Following tools are getting used: 14 | 15 | - `Angular` as primary target framework http://angular.io/ 16 | - `TypeScript` as primary language - https://www.typescriptlang.org/ 17 | - `ng-packagr` to generate Angular specific package format - https://github.com/dherges/ng-packagr 18 | - `compodoc` for API documentation - https://compodoc.app/ 19 | - `Jasmine` for test cases - https://jasmine.github.io/ 20 | - `Karma` for running test cases in browsers - http://karma-runner.github.io/ 21 | - `nodejs` during development - https://nodejs.org/ 22 | - `npm` for dependency management, packaging and distribution - https://www.npmjs.com/ 23 | - `git` for version control - https://git-scm.com/ 24 | 25 | ## Initial setup 26 | 27 | Instructions on setting up development environment: 28 | 29 | - Install `node` and `npm` - https://nodejs.org/ 30 | - Checkout code from GitHub - you may fork the code first into your GitHub account. 31 | - Use `npm i` to install dependencies: 32 | ```bash 33 | $ npm i 34 | ``` 35 | 36 | ## Project structure 37 | 38 | The project was originally generated by angular-cli (at Angular 2). 39 | In those days there was no clear guideline on how to create and organize an 40 | Angular library. 41 | Later it switched to `ng-packagr` which brought quite a lot of sanity. 42 | The source code is in `src` folder. 43 | All the test case files are within `specs` which is not what typically Angular 44 | projects do. 45 | 46 | Because of compatibility reasons paths of specific files have been kept same. 47 | While doing v8 - when v6 compatibility would be dropped, the source code is 48 | likely to be rearranged. 49 | 50 | ## Setup a Stomp broker 51 | 52 | - A Stomp broker is used for running the tests. I have been using RabbitMQ. 53 | - Edit `spec/config/browser-config.js` and `spec/config/node-config.js` as per 54 | your setup. Defaults should work for as RabbitMQ default setup on localhost. 55 | - Please note that in RabbitMQ you will need to enable Stomp and WebStomp plugins. 56 | - By default RabbitMQ WebStomp will treat messages a text, you will need to tell 57 | it is use binary frames: 58 | ```bash 59 | $ echo 'web_stomp.ws_frame = binary' >> /etc/rabbitmq/rabbitmq.conf 60 | ``` 61 | - A RabbitMQ Dockerfile is provided with necessary plugins and configuration. To use it, run: 62 | ```bash 63 | $ docker build -t myrabbitmq rabbitmq/ # Needed only once 64 | $ docker run -d -p 15674:15674 myrabbitmq # to start the broker 65 | ``` 66 | 67 | ## Building and testing 68 | 69 | Key npm tasks: 70 | 71 | ```text 72 | cleanup - Remove generated built artifacts 73 | doc - Generate docs 74 | doc-serve - Generate docs and watch for changes 75 | test - Run tests 76 | lint - run lint on soucres 77 | ``` 78 | 79 | ### Basic development workflow 80 | 81 | 1. Checkout a new branch. 82 | 1. Make code changes (src/specs) 83 | 1. Run tests: 84 | ```bash 85 | $ npm run test 86 | ``` 87 | 1. Lint: 88 | ```bash 89 | $ npm run lint 90 | ``` 91 | 1. Update documentation - do update the docs-src/Changelog.md 92 | 1. Regenerate documentation: 93 | ```bash 94 | $ npm run doc 95 | ``` 96 | 1. Please follow GitHub guidelines. Raise an issue if you are unclear. 97 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS 178 | 179 | APPENDIX: How to apply the Apache License to your work. 180 | 181 | To apply the Apache License to your work, attach the following 182 | boilerplate notice, with the fields enclosed by brackets "[]" 183 | replaced with your own identifying information. (Don't include 184 | the brackets!) The text should be enclosed in the appropriate 185 | comment syntax for the file format. We also recommend that a 186 | file or class name and description of purpose be included on the 187 | same "printed page" as the copyright notice for easier 188 | identification within third-party archives. 189 | 190 | Copyright 2018-2020 Deepak Kumar 191 | 192 | Licensed under the Apache License, Version 2.0 (the "License"); 193 | you may not use this file except in compliance with the License. 194 | You may obtain a copy of the License at 195 | 196 | http://www.apache.org/licenses/LICENSE-2.0 197 | 198 | Unless required by applicable law or agreed to in writing, software 199 | distributed under the License is distributed on an "AS IS" BASIS, 200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 201 | See the License for the specific language governing permissions and 202 | limitations under the License. 203 | -------------------------------------------------------------------------------- /README.MD: -------------------------------------------------------------------------------- 1 | # Deprecated - @stomp/ng2-stompjs 2 | 3 | **This library is deprecated. It is not likely to work with Angular 10+. 4 | Please migrate to [rx-stomp](https://github.com/stomp-js/rx-stomp). 5 | Follow the [migration guide](https://stomp-js.github.io/guide/rx-stomp/ng2-stompjs/ng2-stompjs-to-rx-stomp.html) 6 | and [using rx-stomp with Angular](https://stomp-js.github.io/guide/rx-stomp/rx-stomp-with-angular.html).** 7 | 8 | Angular 6/7/8/9/10 [![Build Status](https://travis-ci.org/stomp-js/ng2-stompjs.svg?branch=master)](https://travis-ci.org/stomp-js/ng2-stompjs) 9 | 10 | An Angular (Angular6+) style wrapper for [@stomp/stompjs]. 11 | 12 | ## Version Compatibility 13 | 14 | The current version is 8.x.x. 15 | The underlying [@stomp/stompjs] has been bottom rewritten bringing strict compatibility 16 | with [STOMP standards]. 17 | This is the first-ever STOMP JS client library that reliably supports binary payloads. 18 | 19 | This version is recommended for Angular6 and higher. 20 | 21 | It has been reported to work with ionic projects as well. 22 | 23 | ## Getting started 24 | 25 | [https://stomp-js.github.io/](https://stomp-js.github.io/) has tutorials and documentation. 26 | 27 | ## Upgrading 28 | 29 | Please follow [migration guides]. 30 | 31 | ## Documentation 32 | 33 | - **Highly recommended** step by step guide at [ng2-stompjs with Angular 7] 34 | - Upgrade instructions at [migration guides] 35 | - API documentation is located at: [API Docs] 36 | - [Using STOMP with SockJS] 37 | - [Change Log](Changelog.md) 38 | - [Contributing](Contributing.md) 39 | 40 | ## Samples 41 | 42 | - [stomp-js/ng2-stompjs-angular7] - final output of [ng2-stompjs with Angular 7]. 43 | This has been tested for Angular 10 as well. 44 | - The original Angular 6 demo upgraded as per [migration guides]. 45 | at [Angular 6 ng2stompjs 7]. 46 | 47 | ## Older Angular versions 48 | 49 | Version 4.x.x may be used with Angular 2/4/5 - use dependency like "^4.0.0". 50 | Documentation for 4.x.x can be accessed at 51 | [https://stomp-js.github.io/ng2-stompjs/](https://stomp-js.github.io/ng2-stompjs/). 52 | 53 | ## Contributors 54 | 55 | - [Sam Finnigan](https://github.com/sjmf) 56 | - [Jimi (Dimitris) Charalampidis](https://github.com/JimiC) 57 | - [Deepak Kumar](https://github.com/kum-deepak) 58 | - Astha Deep 59 | - [Michel Promonet](https://github.com/mpromonet) 60 | - Everyone involved at https://github.com/stomp-js/stomp-websocket 61 | 62 | ## License 63 | 64 | Apache-2.0 65 | 66 | [@stomp/stompjs]: https://github.com/stomp-js/stompjs 67 | [STOMP standards]: https://stomp.github.io/stomp-specification-1.2.html 68 | [API Docs]: https://stomp-js.github.io/api-docs/latest/ 69 | [ng2-stompjs with Angular 7]: https://stomp-js.github.io/guide/ng2-stompjs/ng2-stomp-with-angular7.html 70 | [migration guides]: https://stomp-js.github.io/#upgrading 71 | [Using STOMP with SockJS]: https://stomp-js.github.io/guide/stompjs/rx-stomp/ng2-stompjs/using-stomp-with-sockjs.html 72 | [stomp-js/ng2-stompjs-angular7]: https://github.com/stomp-js/ng2-stompjs-angular7 73 | [Angular 6 ng2stompjs 7]: https://github.com/stomp-js/ng6-stompjs-demo/tree/ng2-stompjs-v7 74 | -------------------------------------------------------------------------------- /angular.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json", 3 | "version": 1, 4 | "newProjectRoot": "projects", 5 | "projects": { 6 | "ng2-stompjs": { 7 | "root": "", 8 | "sourceRoot": "src", 9 | "projectType": "application", 10 | "prefix": "app", 11 | "schematics": {}, 12 | "architect": { 13 | "build": { 14 | "builder": "@angular-devkit/build-angular:browser", 15 | "options": { 16 | "outputPath": "dist/ng2-stompjs", 17 | "index": "src/index.html", 18 | "main": "src/main.ts", 19 | "polyfills": "src/polyfills.ts", 20 | "tsConfig": "src/tsconfig.app.json", 21 | "assets": ["src/favicon.ico", "src/assets"], 22 | "styles": [], 23 | "scripts": [] 24 | }, 25 | "configurations": { 26 | "production": { 27 | "fileReplacements": [ 28 | { 29 | "replace": "src/environments/environment.ts", 30 | "with": "src/environments/environment.prod.ts" 31 | } 32 | ], 33 | "optimization": true, 34 | "outputHashing": "all", 35 | "sourceMap": false, 36 | "extractCss": true, 37 | "namedChunks": false, 38 | "aot": true, 39 | "extractLicenses": true, 40 | "vendorChunk": false, 41 | "buildOptimizer": true 42 | } 43 | } 44 | }, 45 | "serve": { 46 | "builder": "@angular-devkit/build-angular:dev-server", 47 | "options": { 48 | "browserTarget": "ng2-stompjs:build" 49 | }, 50 | "configurations": { 51 | "production": { 52 | "browserTarget": "ng2-stompjs:build:production" 53 | } 54 | } 55 | }, 56 | "extract-i18n": { 57 | "builder": "@angular-devkit/build-angular:extract-i18n", 58 | "options": { 59 | "browserTarget": "ng2-stompjs:build" 60 | } 61 | }, 62 | "test": { 63 | "builder": "@angular-devkit/build-angular:karma", 64 | "options": { 65 | "main": "src/test.ts", 66 | "polyfills": "src/polyfills.ts", 67 | "tsConfig": "src/tsconfig.spec.json", 68 | "karmaConfig": "src/karma.conf.js", 69 | "styles": [], 70 | "scripts": [], 71 | "assets": ["src/favicon.ico", "src/assets"] 72 | } 73 | }, 74 | "lint": { 75 | "builder": "@angular-devkit/build-angular:tslint", 76 | "options": { 77 | "tsConfig": ["src/tsconfig.app.json", "src/tsconfig.spec.json"], 78 | "exclude": ["**/node_modules/**"] 79 | } 80 | } 81 | } 82 | } 83 | }, 84 | "defaultProject": "ng2-stompjs" 85 | } 86 | -------------------------------------------------------------------------------- /bin/pre-publish.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | const pkg = require('../dist/package.json'); 3 | 4 | pkg.module = pkg.fesm2015; 5 | 6 | const data = JSON.stringify(pkg, null, 2); 7 | fs.writeFileSync('dist/package.json', data); 8 | -------------------------------------------------------------------------------- /bin/release.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ng lint && ng test \ 4 | && npm run dist \ 5 | && node bin/pre-publish.js \ 6 | && cp README.MD dist/ \ 7 | && cd dist \ 8 | && npm publish "$@" 9 | -------------------------------------------------------------------------------- /dist/LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS 178 | 179 | APPENDIX: How to apply the Apache License to your work. 180 | 181 | To apply the Apache License to your work, attach the following 182 | boilerplate notice, with the fields enclosed by brackets "[]" 183 | replaced with your own identifying information. (Don't include 184 | the brackets!) The text should be enclosed in the appropriate 185 | comment syntax for the file format. We also recommend that a 186 | file or class name and description of purpose be included on the 187 | same "printed page" as the copyright notice for easier 188 | identification within third-party archives. 189 | 190 | Copyright 2018-2020 Deepak Kumar 191 | 192 | Licensed under the Apache License, Version 2.0 (the "License"); 193 | you may not use this file except in compliance with the License. 194 | You may obtain a copy of the License at 195 | 196 | http://www.apache.org/licenses/LICENSE-2.0 197 | 198 | Unless required by applicable law or agreed to in writing, software 199 | distributed under the License is distributed on an "AS IS" BASIS, 200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 201 | See the License for the specific language governing permissions and 202 | limitations under the License. 203 | -------------------------------------------------------------------------------- /dist/README.MD: -------------------------------------------------------------------------------- 1 | # @stomp/ng2-stompjs 2 | 3 | Angular 6/7/8/9/10 [![Build Status](https://travis-ci.org/stomp-js/ng2-stompjs.svg?branch=master)](https://travis-ci.org/stomp-js/ng2-stompjs) 4 | 5 | An Angular (Angular6+) style wrapper for [@stomp/stompjs]. 6 | 7 | ## Version Compatibility 8 | 9 | The current version is 8.x.x. 10 | The underlying [@stomp/stompjs] has been bottom rewritten bringing strict compatibility 11 | with [STOMP standards]. 12 | This is the first-ever STOMP JS client library that reliably supports binary payloads. 13 | 14 | This version is recommended for Angular6 and higher. 15 | 16 | It has been reported to work with ionic projects as well. 17 | 18 | ## Getting started 19 | 20 | [https://stomp-js.github.io/](https://stomp-js.github.io/) has tutorials and documentation. 21 | 22 | ## Upgrading 23 | 24 | Please follow [migration guides]. 25 | 26 | ## Documentation 27 | 28 | - **Highly recommended** step by step guide at [ng2-stompjs with Angular 7] 29 | - Upgrade instructions at [migration guides] 30 | - API documentation is located at: [API Docs] 31 | - [Using STOMP with SockJS] 32 | - [Change Log](Changelog.md) 33 | - [Contributing](Contributing.md) 34 | 35 | ## Samples 36 | 37 | - [stomp-js/ng2-stompjs-angular7] - final output of [ng2-stompjs with Angular 7]. 38 | This has been tested for Angular 10 as well. 39 | - The original Angular 6 demo upgraded as per [migration guides]. 40 | at [Angular 6 ng2stompjs 7]. 41 | 42 | ## Older Angular versions 43 | 44 | Version 4.x.x may be used with Angular 2/4/5 - use dependency like "^4.0.0". 45 | Documentation for 4.x.x can be accessed at 46 | [https://stomp-js.github.io/ng2-stompjs/](https://stomp-js.github.io/ng2-stompjs/). 47 | 48 | ## Contributors 49 | 50 | - [Sam Finnigan](https://github.com/sjmf) 51 | - [Jimi (Dimitris) Charalampidis](https://github.com/JimiC) 52 | - [Deepak Kumar](https://github.com/kum-deepak) 53 | - Astha Deep 54 | - [Michel Promonet](https://github.com/mpromonet) 55 | - Everyone involved at https://github.com/stomp-js/stomp-websocket 56 | 57 | ## License 58 | 59 | Apache-2.0 60 | 61 | [@stomp/stompjs]: https://github.com/stomp-js/stompjs 62 | [STOMP standards]: https://stomp.github.io/stomp-specification-1.2.html 63 | [API Docs]: https://stomp-js.github.io/api-docs/latest/ 64 | [ng2-stompjs with Angular 7]: https://stomp-js.github.io/guide/ng2-stompjs/ng2-stomp-with-angular7.html 65 | [migration guides]: https://stomp-js.github.io/#upgrading 66 | [Using STOMP with SockJS]: https://stomp-js.github.io/guide/stompjs/rx-stomp/ng2-stompjs/using-stomp-with-sockjs.html 67 | [stomp-js/ng2-stompjs-angular7]: https://github.com/stomp-js/ng2-stompjs-angular7 68 | [Angular 6 ng2stompjs 7]: https://github.com/stomp-js/ng6-stompjs-demo/tree/ng2-stompjs-v7 69 | -------------------------------------------------------------------------------- /dist/bundles/stomp-ng2-stompjs.umd.min.js: -------------------------------------------------------------------------------- 1 | !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@stomp/rx-stomp"),require("rxjs"),require("rxjs/operators"),require("@stomp/stompjs")):"function"==typeof define&&define.amd?define("@stomp/ng2-stompjs",["exports","@angular/core","@stomp/rx-stomp","rxjs","rxjs/operators","@stomp/stompjs"],e):e((t.stomp=t.stomp||{},t.stomp["ng2-stompjs"]={}),t.ng.core,t.RxStomp,t.rxjs,t.rxjs.operators,t.stompjs)}(this,function(t,o,e,i,c,r){"use strict";var n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};function p(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var a={CLOSED:0,TRYING:1,CONNECTED:2,DISCONNECTING:3};a[a.CLOSED]="CLOSED",a[a.TRYING]="TRYING",a[a.CONNECTED]="CONNECTED",a[a.DISCONNECTING]="DISCONNECTING";var u=function(n){function r(){var e=n.call(this)||this;return e.state=new i.BehaviorSubject(a.CLOSED),e.connectionState$.subscribe(function(t){e.state.next(r._mapStompState(t))}),e}return p(r,n),r._mapStompState=function(t){return t===e.RxStompState.CONNECTING?a.TRYING:t===e.RxStompState.OPEN?a.CONNECTED:t===e.RxStompState.CLOSING?a.DISCONNECTING:t===e.RxStompState.CLOSED?a.CLOSED:void 0},Object.defineProperty(r.prototype,"connectObservable",{get:function(){return this.connected$.pipe(c.map(function(t){return r._mapStompState(t)}))},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"serverHeadersObservable",{get:function(){return this.serverHeaders$},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"defaultMessagesObservable",{get:function(){return this.unhandledMessage$},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"receiptsObservable",{get:function(){return this.unhandledReceipts$},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"errorSubject",{get:function(){return this.stompErrors$},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"config",{set:function(t){var e={};"string"==typeof t.url?e.brokerURL=t.url:e.webSocketFactory=t.url,e.heartbeatIncoming=t.heartbeat_in,e.heartbeatOutgoing=t.heartbeat_out,e.reconnectDelay=t.reconnect_delay,t.debug&&(e.debug=function(t){console.log(new Date,t)}),e.connectHeaders=t.headers,this.configure(e)},enumerable:!0,configurable:!0}),r.prototype.initAndConnect=function(){this.deactivate(),this.activate()},r.prototype.disconnect=function(){this.deactivate()},r.prototype.publish=function(t,e,r){if(void 0===r&&(r={}),"string"==typeof t)n.prototype.publish.call(this,{destination:t,body:e,headers:r});else{var o=t;n.prototype.publish.call(this,o)}},r.prototype.subscribe=function(t,e){return void 0===e&&(e={}),this.watch(t,e)},r.prototype.waitForReceipt=function(t,e){n.prototype.watchForReceipt.call(this,t,e)},Object.defineProperty(r.prototype,"client",{get:function(){return this._stompClient},enumerable:!0,configurable:!0}),r.decorators=[{type:o.Injectable}],r.ctorParameters=function(){return[]},r}(e.RxStomp),s=function(){function t(){}return t.decorators=[{type:o.Injectable}],t}(),f=function(r){function t(t){var e=r.call(this)||this;return e.config=t,e.initAndConnect(),e}return p(t,r),t.decorators=[{type:o.Injectable}],t.ctorParameters=function(){return[{type:s}]},t}(u),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return p(e,t),e.decorators=[{type:o.Injectable}],e}(e.RxStomp),b=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return p(e,t),e.decorators=[{type:o.Injectable}],e}(e.RxStompRPCConfig),m=b,y=function(r){function t(t,e){return r.call(this,t,e)||this}return p(t,r),t.decorators=[{type:o.Injectable}],t.ctorParameters=function(){return[{type:l},{type:b,decorators:[{type:o.Optional}]}]},t}(e.RxStompRPC),S=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return p(e,t),e.decorators=[{type:o.Injectable}],e}(e.RxStompConfig);t.StompHeaders=r.StompHeaders,t.StompRService=u,t.StompService=f,t.StompState=a,t.StompConfig=s,t.RxStompRPCService=y,t.RxStompService=l,t.InjectableRxStompConfig=S,t.InjectableRxStompRPCConfig=b,t.InjectableRxStompRpcConfig=m,t.rxStompServiceFactory=function d(t){var e=new l;return e.configure(t),e.activate(),e},Object.defineProperty(t,"__esModule",{value:!0})}); 2 | //# sourceMappingURL=stomp-ng2-stompjs.umd.min.js.map -------------------------------------------------------------------------------- /dist/esm2015/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileoverview added by tsickle 3 | * @suppress {checkTypes} checked by tsc 4 | */ 5 | export { StompRService } from './src/app/compatibility/stomp-r.service'; 6 | export { StompService } from './src/app/compatibility/stomp.service'; 7 | export { StompHeaders } from './src/app/compatibility/stomp-headers'; 8 | export { StompState } from './src/app/compatibility/stomp-state'; 9 | export { StompConfig } from './src/app/compatibility/stomp.config'; 10 | export { RxStompRPCService } from './src/app/rx-stomp-rpc.service'; 11 | export { RxStompService } from './src/app/rx-stomp.service'; 12 | export { InjectableRxStompConfig } from './src/app/injectable-rx-stomp-config'; 13 | export { InjectableRxStompRPCConfig } from './src/app/injectable-rx-stomp-rpc-config'; 14 | export { InjectableRxStompRpcConfig } from './src/app/injectable-rx-stomp-rpc-config'; 15 | export { rxStompServiceFactory } from './src/app/rx-stomp-service-factory'; 16 | 17 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290Ijoibmc6Ly9Ac3RvbXAvbmcyLXN0b21wanMvIiwic291cmNlcyI6WyJpbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7O0FBQUEsT0FBTyxFQUFFLGFBQWEsRUFBRSxNQUFNLHlDQUF5QyxDQUFDO0FBQ3hFLE9BQU8sR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tcC5jb25maWcnO1xuXG5leHBvcnQgeyBSeFN0b21wUlBDU2VydmljZSB9IGZyb20gJy4vc3JjL2FwcC9yeC1zdG9tcC1ycGMuc2VydmljZSc7XG5leHBvcnQgeyBSeFN0b21wU2VydmljZSB9IGZyb20gJy4vc3JjL2FwcC9yeC1zdG9tcC5zZXJ2aWNlJztcbmV4cG9ydCB7IEluamVjdGFibGVSeFN0b21wQ29uZmlnIH0gZnJvbSAnLi9zcmMvYXBwL2luamVjdGFibGUtcngtc3RvbXAtY29uZmlnJztcbmV4cG9ydCB7IEluamVjdGFibGVSeFN0b21wUlBDQ29uZmlnIH0gZnJvbSAnLi9zcmMvYXBwL2luamVjdGFibGUtcngtc3RvbXAtcnBjLWNvbmZpZyc7XG5leHBvcnQgeyBJbmplY3RhYmxlUnhTdG9tcFJwY0NvbmZpZyB9IGZyb20gJy4vc3JjL2FwcC9pbmplY3RhYmxlLXJ4LXN0b21wLXJwYy1jb25maWcnO1xuZXhwb3J0IHsgcnhTdG9tcFNlcnZpY2VGYWN0b3J5IH0gZnJvbSAnLi9zcmMvYXBwL3J4LXN0b21wLXNlcnZpY2UtZmFjdG9yeSc7XG4iXX0= -------------------------------------------------------------------------------- /dist/esm2015/src/app/compatibility/stomp-headers.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileoverview added by tsickle 3 | * @suppress {checkTypes} checked by tsc 4 | */ 5 | export { StompHeaders } from '@stomp/stompjs'; 6 | 7 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RvbXAtaGVhZGVycy5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0BzdG9tcC9uZzItc3RvbXBqcy8iLCJzb3VyY2VzIjpbInNyYy9hcHAvY29tcGF0aWJpbGl0eS9zdG9tcC1oZWFkZXJzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7QUFBQSxPQUFPLEVBQUUsWUFBWSxFQUFFLE1BQU0sZ0JBQWdCLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgeyBTdG9tcEhlYWRlcnMgfSBmcm9tICdAc3RvbXAvc3RvbXBqcyc7XG4iXX0= -------------------------------------------------------------------------------- /dist/esm2015/src/app/compatibility/stomp-state.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileoverview added by tsickle 3 | * @suppress {checkTypes} checked by tsc 4 | */ 5 | /** @enum {number} */ 6 | const StompState = { 7 | CLOSED: 0, 8 | TRYING: 1, 9 | CONNECTED: 2, 10 | DISCONNECTING: 3, 11 | }; 12 | export { StompState }; 13 | StompState[StompState.CLOSED] = "CLOSED"; 14 | StompState[StompState.TRYING] = "TRYING"; 15 | StompState[StompState.CONNECTED] = "CONNECTED"; 16 | StompState[StompState.DISCONNECTING] = "DISCONNECTING"; 17 | 18 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RvbXAtc3RhdGUuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9Ac3RvbXAvbmcyLXN0b21wanMvIiwic291cmNlcyI6WyJzcmMvYXBwL2NvbXBhdGliaWxpdHkvc3RvbXAtc3RhdGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogUGFydCBvZiBgQHN0b21wL25nMi1zdG9tcGpzYC5cbiAqXG4gKiAqKlRoaXMgY2xhc3MgaGFzIGJlZW4gZGVwcmVjYXRlZCBpbiBmYXZvciBvZiBgUnhTdG9tcFN0YXRlYC5cbiAqIEl0IHdpbGwgYmUgZHJvcHBlZCBgQHN0b21wL25nMi1zdG9tcGpzQDgueC54YC4qKlxuICpcbiAqIFBvc3NpYmxlIHN0YXRlcyBmb3IgdGhlIFNUT01QIHNlcnZpY2VcbiAqL1xuZXhwb3J0IGVudW0gU3RvbXBTdGF0ZSB7XG4gIENMT1NFRCxcbiAgVFJZSU5HLFxuICBDT05ORUNURUQsXG4gIERJU0NPTk5FQ1RJTkcsXG59XG4iXX0= -------------------------------------------------------------------------------- /dist/esm2015/src/app/compatibility/stomp.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileoverview added by tsickle 3 | * @suppress {checkTypes} checked by tsc 4 | */ 5 | import { Injectable } from '@angular/core'; 6 | /** 7 | * Part of `\@stomp/ng2-stompjs`. 8 | * 9 | * **This class has been deprecated in favor of {\@link InjectableRxStompConfig}. 10 | * It will be dropped `\@stomp/ng2-stompjs\@8.x.x`.** 11 | * 12 | * Represents a configuration object for the 13 | * STOMPService to connect to. 14 | * 15 | * This name conflicts with a class of the same name in \@stomp/stompjs, excluding this from the documentation. 16 | * 17 | * \@internal 18 | */ 19 | export class StompConfig { 20 | } 21 | StompConfig.decorators = [ 22 | { type: Injectable } 23 | ]; 24 | function StompConfig_tsickle_Closure_declarations() { 25 | /** @type {!Array<{type: !Function, args: (undefined|!Array)}>} */ 26 | StompConfig.decorators; 27 | /** 28 | * @nocollapse 29 | * @type {function(): !Array<(null|{type: ?, decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array)}>)})>} 30 | */ 31 | StompConfig.ctorParameters; 32 | /** 33 | * Server URL to connect to. Please refer to your STOMP broker documentation for details. 34 | * 35 | * Example: ws://127.0.0.1:15674/ws (for a RabbitMQ default setup running on localhost) 36 | * 37 | * Alternatively this parameter can be a function that returns an object similar to WebSocket 38 | * (typically SockJS instance). 39 | * 40 | * Example: 41 | * 42 | * () => { 43 | * return new SockJS('http://127.0.0.1:15674/stomp'); 44 | * } 45 | * @type {?} 46 | */ 47 | StompConfig.prototype.url; 48 | /** 49 | * Headers 50 | * Typical keys: login: string, passcode: string. 51 | * host:string will neeed to be passed for virtual hosts in RabbitMQ 52 | * @type {?} 53 | */ 54 | StompConfig.prototype.headers; 55 | /** 56 | * How often to incoming heartbeat? 57 | * Interval in milliseconds, set to 0 to disable 58 | * 59 | * Typical value 0 - disabled 60 | * @type {?} 61 | */ 62 | StompConfig.prototype.heartbeat_in; 63 | /** 64 | * How often to outgoing heartbeat? 65 | * Interval in milliseconds, set to 0 to disable 66 | * 67 | * Typical value 20000 - every 20 seconds 68 | * @type {?} 69 | */ 70 | StompConfig.prototype.heartbeat_out; 71 | /** 72 | * Wait in milliseconds before attempting auto reconnect 73 | * Set to 0 to disable 74 | * 75 | * Typical value 5000 (5 seconds) 76 | * @type {?} 77 | */ 78 | StompConfig.prototype.reconnect_delay; 79 | /** 80 | * Enable client debugging? 81 | * @type {?} 82 | */ 83 | StompConfig.prototype.debug; 84 | } 85 | 86 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RvbXAuY29uZmlnLmpzIiwic291cmNlUm9vdCI6Im5nOi8vQHN0b21wL25nMi1zdG9tcGpzLyIsInNvdXJjZXMiOlsic3JjL2FwcC9jb21wYXRpYmlsaXR5L3N0b21wLmNvbmZpZy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7O0FBQUEsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLGVBQWUsQ0FBQzs7Ozs7Ozs7Ozs7Ozs7QUFpQjNDLE1BQU07OztZQURMLFVBQVUiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBJbmplY3RhYmxlIH0gZnJvbSAnQGFuZ3VsYXIvY29yZSc7XG5pbXBvcnQgeyBTdG9tcEhlYWRlcnMgfSBmcm9tICdAc3RvbXAvc3RvbXBqcyc7XG5cbi8qKlxuICogUGFydCBvZiBgQHN0b21wL25nMi1zdG9tcGpzYC5cbiAqXG4gKiAqKlRoaXMgY2xhc3MgaGFzIGJlZW4gZGVwcmVjYXRlZCBpbiBmYXZvciBvZiB7QGxpbmsgSW5qZWN0YWJsZVJ4U3RvbXBDb25maWd9LlxuICogSXQgd2lsbCBiZSBkcm9wcGVkIGBAc3RvbXAvbmcyLXN0b21wanNAOC54LnhgLioqXG4gKlxuICogUmVwcmVzZW50cyBhIGNvbmZpZ3VyYXRpb24gb2JqZWN0IGZvci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VhbCBob3N0cyBpbiBSYWJiaXRNUVxuICAgKi9cbiAgaGVhZGVyczogU3RvbXBIZWFkZXJzO1xuXG4gIC8qKiBIb3cgb2Z0ZW4gdG8gaW5jb21pbmcgaGVhcnRiZWF0P1xuICAgKiBJbnRlcnZhbCBpbiBtaWxsaXNlY29uZHMsIHNldCB0byAwIHRvIGRpc2FibGVcbiAgICpcbiAgICogVHlwaWNhbCB2YWx1ZSAwIC0gZGlzYWJsZWRcbiAgICovXG4gIGhlYXJ0YmVhdF9pbjogbnVtYmVyO1xuXG4gIC8qKlxuICAgKiBIb3cgb2Z0ZW4gdG8gb3V0Z29pbmcgaGVhcnRiZWF0P1xuICAgKiBJbnRlcnZhbCBpbiBtaWxsaXNlY29uZHMsIHNldCB0byAwIHRvIGRpc2FibGVcbiAgICpcbiAgICogVHlwaWNhbCB2YWx1ZSAyMDAwMCAtIGV2ZXJ5IDIwIHNlY29uZHNcbiAgICovXG4gIGhlYXJ0YmVhdF9vdXQ6IG51bWJlcjtcblxuICAvKipcbiAgICogV2FpdCBpbiBtaWxsaXNlY29uZHMgYmVmb3JlIGF0dGVtcHRpbmcgYXV0byByZWNvbm5lY3RcbiAgICogU2V0IHRvIDAgdG8gZGlzYWJsZVxuICAgKlxuICAgKiBUeXBpY2FsIHZhbHVlIDUwMDAgKDUgc2Vjb25kcylcbiAgICovXG4gIHJlY29ubmVjdF9kZWxheTogbnVtYmVyO1xuXG4gIC8qKiBFbmFibGUgY2xpZW50IGRlYnVnZ2luZz8gKi9cbiAgZGVidWc6IGJvb2xlYW47XG59XG4iXX0= -------------------------------------------------------------------------------- /dist/esm2015/src/app/compatibility/stomp.service.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileoverview added by tsickle 3 | * @suppress {checkTypes} checked by tsc 4 | */ 5 | import { Injectable } from '@angular/core'; 6 | import { StompConfig } from './stomp.config'; 7 | import { StompRService } from './stomp-r.service'; 8 | /** 9 | * Part of `\@stomp/ng2-stompjs`. 10 | * 11 | * **This class has been deprecated in favor of {\@link RxStompService} with {\@link rxStompServiceFactory}. 12 | * It will be dropped `\@stomp/ng2-stompjs\@8.x.x`.** 13 | * 14 | * Angular2 STOMP Service using \@stomp/stomp.js 15 | * 16 | * \@description This service handles subscribing to a 17 | * message queue using the stomp.js library, and returns 18 | * values via the ES6 Observable specification for 19 | * asynchronous value streaming by wiring the STOMP 20 | * messages into an observable. 21 | * 22 | * If you want to manually configure and initialize the service 23 | * please use StompRService 24 | */ 25 | export class StompService extends StompRService { 26 | /** 27 | * Constructor 28 | * 29 | * See README and samples for configuration examples 30 | * @param {?} config 31 | */ 32 | constructor(config) { 33 | super(); 34 | this.config = config; 35 | this.initAndConnect(); 36 | } 37 | } 38 | StompService.decorators = [ 39 | { type: Injectable } 40 | ]; 41 | /** @nocollapse */ 42 | StompService.ctorParameters = () => [ 43 | { type: StompConfig, }, 44 | ]; 45 | function StompService_tsickle_Closure_declarations() { 46 | /** @type {!Array<{type: !Function, args: (undefined|!Array)}>} */ 47 | StompService.decorators; 48 | /** 49 | * @nocollapse 50 | * @type {function(): !Array<(null|{type: ?, decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array)}>)})>} 51 | */ 52 | StompService.ctorParameters; 53 | } 54 | 55 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RvbXAuc2VydmljZS5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0BzdG9tcC9uZzItc3RvbXBqcy8iLCJzb3VyY2VzIjpbInNyYy9hcHAvY29tcGF0aWJpbGl0eS9zdG9tcC5zZXJ2aWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7QUFBQSxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBRTNDLE9BQU8sRUFBRSxXQUFXLEVBQUUsTUFBTSxnQkFBZ0IsQ0FBQztBQUU3QyxPQUFPLEVBQUUsYUFBYSxFQUFFLE1BQU0sbUJBQW1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vdXMgdmFsdWUgc3RyZWFtaW5nIGJ5IHdpcmluZyB0aGUgU1RPTVBcbiAqIG1lc3NhZ2VzIGludG8gYW4gb2JzZXJ2YWJsZS5cbiAqXG4gKiBJZiB5b3Ugd2FudCB0byBtYW51YWxseSBjb25maWd1cmUgYW5kIGluaXRpYWxpemUgdGhlIHNlcnZpY2VcbiAqIHBsZWFzZSB1c2UgU3RvbXBSU2VydmljZVxuICovXG5ASW5qZWN0YWJsZSgpXG5leHBvcnQgY2xhc3MgU3RvbXBTZXJ2aWNlIGV4dGVuZHMgU3RvbXBSU2VydmljZSB7XG4gIC8qKlxuICAgKiBDb25zdHJ1Y3RvclxuICAgKlxuICAgKiBTZWUgUkVBRE1FIGFuZCBzYW1wbGVzIGZvciBjb25maWd1cmF0aW9uIGV4YW1wbGVzXG4gICAqL1xuICBwdWJsaWMgY29uc3RydWN0b3IoY29uZmlnOiBTdG9tcENvbmZpZykge1xuICAgIHN1cGVyKCk7XG5cbiAgICB0aGlzLmNvbmZpZyA9IGNvbmZpZztcbiAgICB0aGlzLmluaXRBbmRDb25uZWN0KCk7XG4gIH1cbn1cbiJdfQ== -------------------------------------------------------------------------------- /dist/esm2015/src/app/injectable-rx-stomp-config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileoverview added by tsickle 3 | * @suppress {checkTypes} checked by tsc 4 | */ 5 | import { Injectable } from '@angular/core'; 6 | import { RxStompConfig } from '@stomp/rx-stomp'; 7 | /** 8 | * Part of `\@stomp/ng2-stompjs`. 9 | * 10 | * This class is Injectable version of {\@link RxStompConfig} with exactly same functionality. 11 | * Please see {\@link RxStompConfig} for details. 12 | * 13 | * See: {\@link /guide/ng2-stompjs/ng2-stomp-with-angular7.html} 14 | * for a step-by-step guide. 15 | * 16 | * If all fields of configuration are fixed and known in advance you would typically define 17 | * a `const` and inject it using value. 18 | * 19 | * If some fields will be known by later, it can be injected using a factory function. 20 | * 21 | * Occasionally it may need to be combined with Angular's APP_INITIALIZER mechanism. 22 | */ 23 | export class InjectableRxStompConfig extends RxStompConfig { 24 | } 25 | InjectableRxStompConfig.decorators = [ 26 | { type: Injectable } 27 | ]; 28 | function InjectableRxStompConfig_tsickle_Closure_declarations() { 29 | /** @type {!Array<{type: !Function, args: (undefined|!Array)}>} */ 30 | InjectableRxStompConfig.decorators; 31 | /** 32 | * @nocollapse 33 | * @type {function(): !Array<(null|{type: ?, decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array)}>)})>} 34 | */ 35 | InjectableRxStompConfig.ctorParameters; 36 | } 37 | 38 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5qZWN0YWJsZS1yeC1zdG9tcC1jb25maWcuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9Ac3RvbXAvbmcyLXN0b21wanMvIiwic291cmNlcyI6WyJzcmMvYXBwL2luamVjdGFibGUtcngtc3RvbXAtY29uZmlnLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7QUFBQSxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQzNDLE9BQU8sRUFBRSxhQUFhLEVBQUUsTUFBTSxpQkFBaUIsQ0FBQzs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFtQmhELE1BQU0sOEJBQStCLFNBQVEsYUFBYTs7O1lBRHpELFVBQVUiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBJbmplY3RhYmxlIH0gZnJvbSAnQGFuZ3VsYXIvY29yZSc7XG5pbXBvcnQgeyBSeFN0b21wQ29uZmlnIH0gZnJvbSAnQHN0b21wL3J4LXN0b21wJztcblxuLyoqXG4gKiBQYXJ0IG9mIGBAc3RvbXAvbmcyLXN0b21wanNgLlxuICpcbiAqIFRoaXMgY2xhc3MgaXMgSW5qZWN0YWJsZSB2ZXJzaW9uIG9mIHtAbGluayBSeFN0b21wQ29uZmlnfSB3aXRoIGV4YWN0bHkgc2FtZSBmdW5jdGlvbmFsaXR5LlxuICogUGxlYXNlIHNlZSB7QGxpbmsgUnhTdG9tcENvbmZpZ30gZm9yIGRldGFpbHMuXG4gKlxuICogU2VlOiB7QGxpbmsgL2d1aWRlL25nMi1zdG9tcGpzL25nMi1zdG9tcC13aXRoLWFuZ3VsYXI3Lmh0bWx9XG4gKiBmb3IgYSBzdGVwLWJ5LXN0ZXAgZ3VpZGUuXG4gKlxuICogSWYgYWxsIGZpZWxkcyBvZiBjb25maWd1cmF0aW9uIGFyZSBmaXhlZCBhbmQga25vd24gaW4gYWR2YW5jZSB5b3Ugd291bGQgdHlwaWNhbGx5IGRlZmluZVxuICogYSBgY29uc3RgIGFuZCBpbmplY3QgaXQgdXNpbmcgdmFsdWUuXG4gKlxuICogSWYgc29tZSBmaWVsZHMgd2lsbCBiZSBrbm93biBieSBsYXRlciwgaXQgY2FuIGJlIGluamVjdGVkIHVzaW5nIGEgZmFjdG9yeSBmdW5jdGlvbi5cbiAqXG4gKiBPY2Nhc2lvbmFsbHkgaXQgbWF5IG5lZWQgdG8gYmUgY29tYmluZWQgd2l0aCBBbmd1bGFyJ3MgQVBQX0lOSVRJQUxJWkVSIG1lY2hhbmlzbS5cbiAqL1xuQEluamVjdGFibGUoKVxuZXhwb3J0IGNsYXNzIEluamVjdGFibGVSeFN0b21wQ29uZmlnIGV4dGVuZHMgUnhTdG9tcENvbmZpZyB7fVxuIl19 -------------------------------------------------------------------------------- /dist/esm2015/src/app/injectable-rx-stomp-rpc-config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileoverview added by tsickle 3 | * @suppress {checkTypes} checked by tsc 4 | */ 5 | import { Injectable } from '@angular/core'; 6 | import { RxStompRPCConfig } from '@stomp/rx-stomp'; 7 | /** 8 | * Part of `\@stomp/ng2-stompjs`. 9 | * 10 | * Injectable version of {\@link RxStompRPCConfig}. 11 | * 12 | * See guide at {\@link /guide/rx-stomp/ng2-stompjs/remote-procedure-call.html} 13 | */ 14 | export class InjectableRxStompRPCConfig extends RxStompRPCConfig { 15 | } 16 | InjectableRxStompRPCConfig.decorators = [ 17 | { type: Injectable } 18 | ]; 19 | function InjectableRxStompRPCConfig_tsickle_Closure_declarations() { 20 | /** @type {!Array<{type: !Function, args: (undefined|!Array)}>} */ 21 | InjectableRxStompRPCConfig.decorators; 22 | /** 23 | * @nocollapse 24 | * @type {function(): !Array<(null|{type: ?, decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array)}>)})>} 25 | */ 26 | InjectableRxStompRPCConfig.ctorParameters; 27 | } 28 | /** 29 | * Deprecated, use {\@link InjectableRxStompRPCConfig} instead 30 | */ 31 | export const /** @type {?} */ InjectableRxStompRpcConfig = InjectableRxStompRPCConfig; 32 | 33 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5qZWN0YWJsZS1yeC1zdG9tcC1ycGMtY29uZmlnLmpzIiwic291cmNlUm9vdCI6Im5nOi8vQHN0b21wL25nMi1zdG9tcGpzLyIsInNvdXJjZXMiOlsic3JjL2FwcC9pbmplY3RhYmxlLXJ4LXN0b21wLXJwYy1jb25maWcudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7OztBQUFBLE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDM0MsT0FBTyxFQUFFLGdCQUFnQixFQUFFLE1BQU0saUJBQWlCLENBQUM7Ozs7Ozs7O0FBVW5ELE1BQU0saUNBQWtDLFNBQVEsZ0JBQWdCOzs7WUFEL0QsVUFBVTs7Ozs7Ozs7Ozs7Ozs7QUFPWCxNQUFNLENBQUMsdUJBQU0sMEJBQTBCLEdBQUcsMEJBQTBCLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBJbmplY3RhYmxlIH0gZnJvbSAnQGFuZ3VsYXIvY29yZSc7XG5pbXBvcnQgeyBSeFN0b21wUlBDQ29uZmlnIH0gZnJvbSAnQHN0b21wL3J4LXN0b21wJztcblxuLyoqXG4gKiBQYXJ0IG9mIGBAc3RvbXAvbmcyLXN0b21wanNgLlxuICpcbiAqIEluamVjdGFibGUgdmVyc2lvbiBvZiB7QGxpbmsgUnhTdG9tcFJQQ0NvbmZpZ30uXG4gKlxuICogU2VlIGd1aWRlIGF0IHtAbGluayAvZ3VpZGUvcngtc3RvbXAvbmcyLXN0b21wanMvcmVtb3RlLXByb2NlZHVyZS1jYWxsLmh0bWx9XG4gKi9cbkBJbmplY3RhYmxlKClcbmV4cG9ydCBjbGFzcyBJbmplY3RhYmxlUnhTdG9tcFJQQ0NvbmZpZyBleHRlbmRzIFJ4U3RvbXBSUENDb25maWcge31cblxuLy8gQmFja3dhcmQgY29tcGF0aWJpbGl0eVxuLyoqXG4gKiBEZXByZWNhdGVkLCB1c2Uge0BsaW5rIEluamVjdGFibGVSeFN0b21wUlBDQ29uZmlnfSBpbnN0ZWFkXG4gKi9cbmV4cG9ydCBjb25zdCBJbmplY3RhYmxlUnhTdG9tcFJwY0NvbmZpZyA9IEluamVjdGFibGVSeFN0b21wUlBDQ29uZmlnO1xuIl19 -------------------------------------------------------------------------------- /dist/esm2015/src/app/rx-stomp-rpc.service.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileoverview added by tsickle 3 | * @suppress {checkTypes} checked by tsc 4 | */ 5 | import { Injectable, Optional } from '@angular/core'; 6 | import { RxStompRPC } from '@stomp/rx-stomp'; 7 | import { RxStompService } from './rx-stomp.service'; 8 | import { InjectableRxStompRPCConfig } from './injectable-rx-stomp-rpc-config'; 9 | /** 10 | * Part of `\@stomp/ng2-stompjs`. 11 | * 12 | * Injectable version of {\@link RxStompRPC}. 13 | * 14 | * See guide at {\@link /guide/rx-stomp/ng2-stompjs/remote-procedure-call.html} 15 | */ 16 | export class RxStompRPCService extends RxStompRPC { 17 | /** 18 | * Create an instance, typically called by Angular Dependency Injection framework. 19 | * 20 | * @param {?} rxStomp 21 | * @param {?=} stompRPCConfig 22 | */ 23 | constructor(rxStomp, stompRPCConfig) { 24 | super(rxStomp, stompRPCConfig); 25 | } 26 | } 27 | RxStompRPCService.decorators = [ 28 | { type: Injectable } 29 | ]; 30 | /** @nocollapse */ 31 | RxStompRPCService.ctorParameters = () => [ 32 | { type: RxStompService, }, 33 | { type: InjectableRxStompRPCConfig, decorators: [{ type: Optional },] }, 34 | ]; 35 | function RxStompRPCService_tsickle_Closure_declarations() { 36 | /** @type {!Array<{type: !Function, args: (undefined|!Array)}>} */ 37 | RxStompRPCService.decorators; 38 | /** 39 | * @nocollapse 40 | * @type {function(): !Array<(null|{type: ?, decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array)}>)})>} 41 | */ 42 | RxStompRPCService.ctorParameters; 43 | } 44 | 45 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicngtc3RvbXAtcnBjLnNlcnZpY2UuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9Ac3RvbXAvbmcyLXN0b21wanMvIiwic291cmNlcyI6WyJzcmMvYXBwL3J4LXN0b21wLXJwYy5zZXJ2aWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7QUFBQSxPQUFPLEVBQUUsVUFBVSxFQUFFLFFBQVEsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUVyRCxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0saUJBQWlCLENBQUM7QUFDN0MsT0FBTyxFQUFFLGNBQWMsRUFBRSxNQUFNLG9CQUFvQixDQUFDO0FBQ3BELE9BQU8sRUFBRSwwQkFBMEIsRUFBRSxNQUFNLGtDQUFrQyxDQUFDOzs7Ozs7OztBQVU5RSxNQUFNLHdCQUF5QixTQUFRLFVBQVU7Ozs7Ozs7SUFPL0MsWUFDRSxPQUF1QixFQUNYO1FBRVosS0FBSyxDQUFDLE9BQU8sRUFBRSxjQUFjLENBQUMsQ0FBQztLQUNoQzs7O1lBYkYsVUFBVTs7OztZQVZGLGNBQWM7WUFDZCwwQkFBMEIs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RvbXBSUENDb25maWcpO1xuICB9XG59XG4iXX0= -------------------------------------------------------------------------------- /dist/esm2015/src/app/rx-stomp-service-factory.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileoverview added by tsickle 3 | * @suppress {checkTypes} checked by tsc 4 | */ 5 | import { RxStompService } from './rx-stomp.service'; 6 | /** 7 | * Part of `\@stomp/ng2-stompjs`. 8 | * 9 | * This is factory function that can create {\@link RxStompService} 10 | * when configuration is already known. 11 | * You can use this function for defining provider for {\@link RxStompService}. 12 | * {\@link RxStompService} created using this function is configured and activated. 13 | * This provides the simplest mechanism to define {\@link RxStompService} for Dependency Injection. 14 | * 15 | * See: {\@link /guide/ng2-stompjs/ng2-stomp-with-angular7.html} 16 | * for a step-by-step guide. 17 | * @param {?} rxStompConfig 18 | * @return {?} 19 | */ 20 | export function rxStompServiceFactory(rxStompConfig) { 21 | const /** @type {?} */ rxStompService = new RxStompService(); 22 | rxStompService.configure(rxStompConfig); 23 | rxStompService.activate(); 24 | return rxStompService; 25 | } 26 | 27 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicngtc3RvbXAtc2VydmljZS1mYWN0b3J5LmpzIiwic291cmNlUm9vdCI6Im5nOi8vQHN0b21wL25nMi1zdG9tcGpzLyIsInNvdXJjZXMiOlsic3JjL2FwcC9yeC1zdG9tcC1zZXJ2aWNlLWZhY3RvcnkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7OztBQUNBLE9BQU8sRUFBRSxjQUFjLEVBQUUsTUFBTSxvQkFBb0IsQ0FBQzs7Ozs7Ozs7Ozs7Ozs7O0FBY3BELE1BQU0sZ0NBQ0osYUFBc0M7SUFFdEMsdUJBQU0sY0FBYyxHQUFHLElBQUksY0FBYyxFQUFFLENBQUM7SUFFNUMsY0FBYyxDQUFDLFNBQVMsQ0FBQyxhQUFhLENBQUMsQ0FBQztJQUN4QyxjQUFjLENBQUMsUUFBUSxFQUFFLENBQUM7SUF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2VydmljZSA9IG5ldyBSeFN0b21wU2VydmljZSgpO1xuXG4gIHJ4U3RvbXBTZXJ2aWNlLmNvbmZpZ3VyZShyeFN0b21wQ29uZmlnKTtcbiAgcnhTdG9tcFNlcnZpY2UuYWN0aXZhdGUoKTtcblxuICByZXR1cm4gcnhTdG9tcFNlcnZpY2U7XG59XG4iXX0= -------------------------------------------------------------------------------- /dist/esm2015/src/app/rx-stomp.service.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileoverview added by tsickle 3 | * @suppress {checkTypes} checked by tsc 4 | */ 5 | import { Injectable } from '@angular/core'; 6 | import { RxStomp } from '@stomp/rx-stomp'; 7 | /** 8 | * Part of `\@stomp/ng2-stompjs`. 9 | * 10 | * This class is Injectable version of {\@link RxStomp} with exactly same functionality. 11 | * Please see {\@link RxStomp} for details. 12 | * 13 | * See: {\@link /guide/ng2-stompjs/ng2-stomp-with-angular7.html} 14 | * for a step-by-step guide. 15 | * 16 | * See also {\@link rxStompServiceFactory}. 17 | */ 18 | export class RxStompService extends RxStomp { 19 | } 20 | RxStompService.decorators = [ 21 | { type: Injectable } 22 | ]; 23 | function RxStompService_tsickle_Closure_declarations() { 24 | /** @type {!Array<{type: !Function, args: (undefined|!Array)}>} */ 25 | RxStompService.decorators; 26 | /** 27 | * @nocollapse 28 | * @type {function(): !Array<(null|{type: ?, decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array)}>)})>} 29 | */ 30 | RxStompService.ctorParameters; 31 | } 32 | 33 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicngtc3RvbXAuc2VydmljZS5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0BzdG9tcC9uZzItc3RvbXBqcy8iLCJzb3VyY2VzIjpbInNyYy9hcHAvcngtc3RvbXAuc2VydmljZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7O0FBQUEsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUMzQyxPQUFPLEVBQUUsT0FBTyxFQUFFLE1BQU0saUJBQWlCLENBQUM7Ozs7Ozs7Ozs7OztBQWMxQyxNQUFNLHFCQUFzQixTQUFRLE9BQU87OztZQUQxQyxVQUFVIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgSW5qZWN0YWJsZSB9IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xuaW1wb3J0IHsgUnhTdG9tcCB9IGZyb20gJ0BzdG9tcC9yeC1zdG9tcCc7XG5cbi8qKlxuICogUGFydCBvZiBgQHN0b21wL25nMi1zdG9tcGpzYC5cbiAqXG4gKiBUaGlzIGNsYXNzIGlzIEluamVjdGFibGUgdmVyc2lvbiBvZiB7QGxpbmsgUnhTdG9tcH0gd2l0aCBleGFjdGx5IHNhbWUgZnVuY3Rpb25hbGl0eS5cbiAqIFBsZWFzZSBzZWUge0BsaW5rIFJ4U3RvbXB9IGZvciBkZXRhaWxzLlxuICpcbiAqIFNlZToge0BsaW5rIC9ndWlkZS9uZzItc3RvbXBqcy9uZzItc3RvbXAtd2l0aC1hbmd1bGFyNy5odG1sfVxuICogZm9yIGEgc3RlcC1ieS1zdGVwIGd1aWRlLlxuICpcbiAqIFNlZSBhbHNvIHtAbGluayByeFN0b21wU2VydmljZUZhY3Rvcnl9LlxuICovXG5ASW5qZWN0YWJsZSgpXG5leHBvcnQgY2xhc3MgUnhTdG9tcFNlcnZpY2UgZXh0ZW5kcyBSeFN0b21wIHt9XG4iXX0= -------------------------------------------------------------------------------- /dist/esm2015/stomp-ng2-stompjs.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileoverview added by tsickle 3 | * @suppress {checkTypes} checked by tsc 4 | */ 5 | /** 6 | * Generated bundle index. Do not edit. 7 | */ 8 | export { StompRService, StompService, StompHeaders, StompState, StompConfig, RxStompRPCService, RxStompService, InjectableRxStompConfig, InjectableRxStompRPCConfig, InjectableRxStompRpcConfig, rxStompServiceFactory } from './index'; 9 | 10 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RvbXAtbmcyLXN0b21wanMuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9Ac3RvbXAvbmcyLXN0b21wanMvIiwic291cmNlcyI6WyJzdG9tcC1uZzItc3RvbXBqcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7O0FBSUEsOE5BQWMsU0FBUyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBHZW5lcmF0ZWQgYnVuZGxlIGluZGV4LiBEbyBub3QgZWRpdC5cbiAqL1xuXG5leHBvcnQgKiBmcm9tICcuL2luZGV4JztcbiJdfQ== -------------------------------------------------------------------------------- /dist/esm5/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileoverview added by tsickle 3 | * @suppress {checkTypes} checked by tsc 4 | */ 5 | export { StompRService } from './src/app/compatibility/stomp-r.service'; 6 | export { StompService } from './src/app/compatibility/stomp.service'; 7 | export { StompHeaders } from './src/app/compatibility/stomp-headers'; 8 | export { StompState } from './src/app/compatibility/stomp-state'; 9 | export { StompConfig } from './src/app/compatibility/stomp.config'; 10 | export { RxStompRPCService } from './src/app/rx-stomp-rpc.service'; 11 | export { RxStompService } from './src/app/rx-stomp.service'; 12 | export { InjectableRxStompConfig } from './src/app/injectable-rx-stomp-config'; 13 | export { InjectableRxStompRPCConfig } from './src/app/injectable-rx-stomp-rpc-config'; 14 | export { InjectableRxStompRpcConfig } from './src/app/injectable-rx-stomp-rpc-config'; 15 | export { rxStompServiceFactory } from './src/app/rx-stomp-service-factory'; 16 | 17 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290Ijoibmc6Ly9Ac3RvbXAvbmcyLXN0b21wanMvIiwic291cmNlcyI6WyJpbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7O0FBQUEsT0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0IHsgU3RvbXBDb25maWcgfSBmcm9tICcuL3NyYy9hcHAvY29tcGF0aWJpbGl0eS9zdG9tcC5jb25maWcnO1xuXG5leHBvcnQgeyBSeFN0b21wUlBDU2VydmljZSB9IGZyb20gJy4vc3JjL2FwcC9yeC1zdG9tcC1ycGMuc2VydmljZSc7XG5leHBvcnQgeyBSeFN0b21wU2VydmljZSB9IGZyb20gJy4vc3JjL2FwcC9yeC1zdG9tcC5zZXJ2aWNlJztcbmV4cG9ydCB7IEluamVjdGFibGVSeFN0b21wQ29uZmlnIH0gZnJvbSAnLi9zcmMvYXBwL2luamVjdGFibGUtcngtc3RvbXAtY29uZmlnJztcbmV4cG9ydCB7IEluamVjdGFibGVSeFN0b21wUlBDQ29uZmlnIH0gZnJvbSAnLi9zcmMvYXBwL2luamVjdGFibGUtcngtc3RvbXAtcnBjLWNvbmZpZyc7XG5leHBvcnQgeyBJbmplY3RhYmxlUnhTdG9tcFJwY0NvbmZpZyB9IGZyb20gJy4vc3JjL2FwcC9pbmplY3RhYmxlLXJ4LXN0b21wLXJwYy1jb25maWcnO1xuZXhwb3J0IHsgcnhTdG9tcFNlcnZpY2VGYWN0b3J5IH0gZnJvbSAnLi9zcmMvYXBwL3J4LXN0b21wLXNlcnZpY2UtZmFjdG9yeSc7XG4iXX0= -------------------------------------------------------------------------------- /dist/esm5/src/app/compatibility/stomp-headers.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileoverview added by tsickle 3 | * @suppress {checkTypes} checked by tsc 4 | */ 5 | export { StompHeaders } from '@stomp/stompjs'; 6 | 7 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RvbXAtaGVhZGVycy5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0BzdG9tcC9uZzItc3RvbXBqcy8iLCJzb3VyY2VzIjpbInNyYy9hcHAvY29tcGF0aWJpbGl0eS9zdG9tcC1oZWFkZXJzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7QUFBQSxPQUFPLEVBQUUsWUFBWSxFQUFFLE1BQU0sZ0JBQWdCLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgeyBTdG9tcEhlYWRlcnMgfSBmcm9tICdAc3RvbXAvc3RvbXBqcyc7XG4iXX0= -------------------------------------------------------------------------------- /dist/esm5/src/app/compatibility/stomp-state.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileoverview added by tsickle 3 | * @suppress {checkTypes} checked by tsc 4 | */ 5 | /** @enum {number} */ 6 | var StompState = { 7 | CLOSED: 0, 8 | TRYING: 1, 9 | CONNECTED: 2, 10 | DISCONNECTING: 3, 11 | }; 12 | export { StompState }; 13 | StompState[StompState.CLOSED] = "CLOSED"; 14 | StompState[StompState.TRYING] = "TRYING"; 15 | StompState[StompState.CONNECTED] = "CONNECTED"; 16 | StompState[StompState.DISCONNECTING] = "DISCONNECTING"; 17 | 18 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RvbXAtc3RhdGUuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9Ac3RvbXAvbmcyLXN0b21wanMvIiwic291cmNlcyI6WyJzcmMvYXBwL2NvbXBhdGliaWxpdHkvc3RvbXAtc3RhdGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogUGFydCBvZiBgQHN0b21wL25nMi1zdG9tcGpzYC5cbiAqXG4gKiAqKlRoaXMgY2xhc3MgaGFzIGJlZW4gZGVwcmVjYXRlZCBpbiBmYXZvciBvZiBgUnhTdG9tcFN0YXRlYC5cbiAqIEl0IHdpbGwgYmUgZHJvcHBlZCBgQHN0b21wL25nMi1zdG9tcGpzQDgueC54YC4qKlxuICpcbiAqIFBvc3NpYmxlIHN0YXRlcyBmb3IgdGhlIFNUT01QIHNlcnZpY2VcbiAqL1xuZXhwb3J0IGVudW0gU3RvbXBTdGF0ZSB7XG4gIENMT1NFRCxcbiAgVFJZSU5HLFxuICBDT05ORUNURUQsXG4gIERJU0NPTk5FQ1RJTkcsXG59XG4iXX0= -------------------------------------------------------------------------------- /dist/esm5/src/app/compatibility/stomp.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileoverview added by tsickle 3 | * @suppress {checkTypes} checked by tsc 4 | */ 5 | import { Injectable } from '@angular/core'; 6 | /** 7 | * Part of `\@stomp/ng2-stompjs`. 8 | * 9 | * **This class has been deprecated in favor of {\@link InjectableRxStompConfig}. 10 | * It will be dropped `\@stomp/ng2-stompjs\@8.x.x`.** 11 | * 12 | * Represents a configuration object for the 13 | * STOMPService to connect to. 14 | * 15 | * This name conflicts with a class of the same name in \@stomp/stompjs, excluding this from the documentation. 16 | * 17 | * \@internal 18 | */ 19 | var StompConfig = /** @class */ (function () { 20 | function StompConfig() { 21 | } 22 | StompConfig.decorators = [ 23 | { type: Injectable } 24 | ]; 25 | return StompConfig; 26 | }()); 27 | export { StompConfig }; 28 | function StompConfig_tsickle_Closure_declarations() { 29 | /** @type {!Array<{type: !Function, args: (undefined|!Array)}>} */ 30 | StompConfig.decorators; 31 | /** 32 | * @nocollapse 33 | * @type {function(): !Array<(null|{type: ?, decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array)}>)})>} 34 | */ 35 | StompConfig.ctorParameters; 36 | /** 37 | * Server URL to connect to. Please refer to your STOMP broker documentation for details. 38 | * 39 | * Example: ws://127.0.0.1:15674/ws (for a RabbitMQ default setup running on localhost) 40 | * 41 | * Alternatively this parameter can be a function that returns an object similar to WebSocket 42 | * (typically SockJS instance). 43 | * 44 | * Example: 45 | * 46 | * () => { 47 | * return new SockJS('http://127.0.0.1:15674/stomp'); 48 | * } 49 | * @type {?} 50 | */ 51 | StompConfig.prototype.url; 52 | /** 53 | * Headers 54 | * Typical keys: login: string, passcode: string. 55 | * host:string will neeed to be passed for virtual hosts in RabbitMQ 56 | * @type {?} 57 | */ 58 | StompConfig.prototype.headers; 59 | /** 60 | * How often to incoming heartbeat? 61 | * Interval in milliseconds, set to 0 to disable 62 | * 63 | * Typical value 0 - disabled 64 | * @type {?} 65 | */ 66 | StompConfig.prototype.heartbeat_in; 67 | /** 68 | * How often to outgoing heartbeat? 69 | * Interval in milliseconds, set to 0 to disable 70 | * 71 | * Typical value 20000 - every 20 seconds 72 | * @type {?} 73 | */ 74 | StompConfig.prototype.heartbeat_out; 75 | /** 76 | * Wait in milliseconds before attempting auto reconnect 77 | * Set to 0 to disable 78 | * 79 | * Typical value 5000 (5 seconds) 80 | * @type {?} 81 | */ 82 | StompConfig.prototype.reconnect_delay; 83 | /** 84 | * Enable client debugging? 85 | * @type {?} 86 | */ 87 | StompConfig.prototype.debug; 88 | } 89 | 90 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RvbXAuY29uZmlnLmpzIiwic291cmNlUm9vdCI6Im5nOi8vQHN0b21wL25nMi1zdG9tcGpzLyIsInNvdXJjZXMiOlsic3JjL2FwcC9jb21wYXRpYmlsaXR5L3N0b21wLmNvbmZpZy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7O0FBQUEsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLGVBQWUsQ0FBQzs7Ozs7Ozs7Ozs7Ozs7Ozs7O2dCQWdCMUMsVUFBVTs7c0JBaEJYOztTQWlCYSxXQUFXIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgSW5qZWN0YWJsZSB9IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xuaW1wb3J0IHsgU3RvbXBIZWFkZXJzIH0gZnJvbSAnQHN0b21wL3N0b21wanMnO1xuXG4vKipcbiAqIFBhcnQgb2YgYEBzdG9tcC9uZzItc3RvbXBqc2AuXG4gKlxuICogKipUaGlzIGNsYXNzIGhhcyBiZWVuIGRlcHJlY2F0ZWQgaW4gZmF2b3Igb2Yge0BsaW5rIEluamVjdGFibGVSeFN0b21wQ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gKiBIZWFkZXJzXG4gICAqIFR5cGljYWwga2V5czogbG9naW46IHN0cmluZywgcGFzc2NvZGU6IHN0cmluZy5cbiAgICogaG9zdDpzdHJpbmcgd2lsbCBuZWVlZCB0byBiZSBwYXNzZWQgZm9yIHZpcnR1YWwgaG9zdHMgaW4gUmFiYml0TVFcbiAgICovXG4gIGhlYWRlcnM6IFN0b21wSGVhZGVycztcblxuICAvKiogSG93IG9mdGVuIHRvIGluY29taW5nIGhlYXJ0YmVhdD9cbiAgICogSW50ZXJ2YWwgaW4gbWlsbGlzZWNvbmRzLCBzZXQgdG8gMCB0byBkaXNhYmxlXG4gICAqXG4gICAqIFR5cGljYWwgdmFsdWUgMCAtIGRpc2FibGVkXG4gICAqL1xuICBoZWFydGJlYXRfaW46IG51bWJlcjtcblxuICAvKipcbiAgICogSG93IG9mdGVuIHRvIG91dGdvaW5nIGhlYXJ0YmVhdD9cbiAgICogSW50ZXJ2YWwgaW4gbWlsbGlzZWNvbmRzLCBzZXQgdG8gMCB0byBkaXNhYmxlXG4gICAqXG4gICAqIFR5cGljYWwgdmFsdWUgMjAwMDAgLSBldmVyeSAyMCBzZWNvbmRzXG4gICAqL1xuICBoZWFydGJlYXRfb3V0OiBudW1iZXI7XG5cbiAgLyoqXG4gICAqIFdhaXQgaW4gbWlsbGlzZWNvbmRzIGJlZm9yZSBhdHRlbXB0aW5nIGF1dG8gcmVjb25uZWN0XG4gICAqIFNldCB0byAwIHRvIGRpc2FibGVcbiAgICpcbiAgICogVHlwaWNhbCB2YWx1ZSA1MDAwICg1IHNlY29uZHMpXG4gICAqL1xuICByZWNvbm5lY3RfZGVsYXk6IG51bWJlcjtcblxuICAvKiogRW5hYmxlIGNsaWVudCBkZWJ1Z2dpbmc/ICovXG4gIGRlYnVnOiBib29sZWFuO1xufVxuIl19 -------------------------------------------------------------------------------- /dist/esm5/src/app/compatibility/stomp.service.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileoverview added by tsickle 3 | * @suppress {checkTypes} checked by tsc 4 | */ 5 | import * as tslib_1 from "tslib"; 6 | import { Injectable } from '@angular/core'; 7 | import { StompConfig } from './stomp.config'; 8 | import { StompRService } from './stomp-r.service'; 9 | /** 10 | * Part of `\@stomp/ng2-stompjs`. 11 | * 12 | * **This class has been deprecated in favor of {\@link RxStompService} with {\@link rxStompServiceFactory}. 13 | * It will be dropped `\@stomp/ng2-stompjs\@8.x.x`.** 14 | * 15 | * Angular2 STOMP Service using \@stomp/stomp.js 16 | * 17 | * \@description This service handles subscribing to a 18 | * message queue using the stomp.js library, and returns 19 | * values via the ES6 Observable specification for 20 | * asynchronous value streaming by wiring the STOMP 21 | * messages into an observable. 22 | * 23 | * If you want to manually configure and initialize the service 24 | * please use StompRService 25 | */ 26 | var StompService = /** @class */ (function (_super) { 27 | tslib_1.__extends(StompService, _super); 28 | function StompService(config) { 29 | var _this = _super.call(this) || this; 30 | _this.config = config; 31 | _this.initAndConnect(); 32 | return _this; 33 | } 34 | StompService.decorators = [ 35 | { type: Injectable } 36 | ]; 37 | /** @nocollapse */ 38 | StompService.ctorParameters = function () { return [ 39 | { type: StompConfig, }, 40 | ]; }; 41 | return StompService; 42 | }(StompRService)); 43 | export { StompService }; 44 | function StompService_tsickle_Closure_declarations() { 45 | /** @type {!Array<{type: !Function, args: (undefined|!Array)}>} */ 46 | StompService.decorators; 47 | /** 48 | * @nocollapse 49 | * @type {function(): !Array<(null|{type: ?, decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array)}>)})>} 50 | */ 51 | StompService.ctorParameters; 52 | } 53 | 54 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RvbXAuc2VydmljZS5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0BzdG9tcC9uZzItc3RvbXBqcy8iLCJzb3VyY2VzIjpbInNyYy9hcHAvY29tcGF0aWJpbGl0eS9zdG9tcC5zZXJ2aWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI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mluZyB0byBhXG4gKiBtZXNzYWdlIHF1ZXVlIHVzaW5nIHRoZSBzdG9tcC5qcyBsaWJyYXJ5LCBhbmQgcmV0dXJuc1xuICogdmFsdWVzIHZpYSB0aGUgRVM2IE9ic2VydmFibGUgc3BlY2lmaWNhdGlvbiBmb3JcbiAqIGFzeW5jaHJvbm91cyB2YWx1ZSBzdHJlYW1pbmcgYnkgd2lyaW5nIHRoZSBTVE9NUFxuICogbWVzc2FnZXMgaW50byBhbiBvYnNlcnZhYmxlLlxuICpcbiAqIElmIHlvdSB3YW50IHRvIG1hbnVhbGx5IGNvbmZpZ3VyZSBhbmQgaW5pdGlhbGl6ZSB0aGUgc2VydmljZVxuICogcGxlYXNlIHVzZSBTdG9tcFJTZXJ2aWNlXG4gKi9cbkBJbmplY3RhYmxlKClcbmV4cG9ydCBjbGFzcyBTdG9tcFNlcnZpY2UgZXh0ZW5kcyBTdG9tcFJTZXJ2aWNlIHtcbiAgLyoqXG4gICAqIENvbnN0cnVjdG9yXG4gICAqXG4gICAqIFNlZSBSRUFETUUgYW5kIHNhbXBsZXMgZm9yIGNvbmZpZ3VyYXRpb24gZXhhbXBsZXNcbiAgICovXG4gIHB1YmxpYyBjb25zdHJ1Y3Rvcihjb25maWc6IFN0b21wQ29uZmlnKSB7XG4gICAgc3VwZXIoKTtcblxuICAgIHRoaXMuY29uZmlnID0gY29uZmlnO1xuICAgIHRoaXMuaW5pdEFuZENvbm5lY3QoKTtcbiAgfVxufVxuIl19 -------------------------------------------------------------------------------- /dist/esm5/src/app/injectable-rx-stomp-config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileoverview added by tsickle 3 | * @suppress {checkTypes} checked by tsc 4 | */ 5 | import * as tslib_1 from "tslib"; 6 | import { Injectable } from '@angular/core'; 7 | import { RxStompConfig } from '@stomp/rx-stomp'; 8 | /** 9 | * Part of `\@stomp/ng2-stompjs`. 10 | * 11 | * This class is Injectable version of {\@link RxStompConfig} with exactly same functionality. 12 | * Please see {\@link RxStompConfig} for details. 13 | * 14 | * See: {\@link /guide/ng2-stompjs/ng2-stomp-with-angular7.html} 15 | * for a step-by-step guide. 16 | * 17 | * If all fields of configuration are fixed and known in advance you would typically define 18 | * a `const` and inject it using value. 19 | * 20 | * If some fields will be known by later, it can be injected using a factory function. 21 | * 22 | * Occasionally it may need to be combined with Angular's APP_INITIALIZER mechanism. 23 | */ 24 | var InjectableRxStompConfig = /** @class */ (function (_super) { 25 | tslib_1.__extends(InjectableRxStompConfig, _super); 26 | function InjectableRxStompConfig() { 27 | return _super !== null && _super.apply(this, arguments) || this; 28 | } 29 | InjectableRxStompConfig.decorators = [ 30 | { type: Injectable } 31 | ]; 32 | return InjectableRxStompConfig; 33 | }(RxStompConfig)); 34 | export { InjectableRxStompConfig }; 35 | function InjectableRxStompConfig_tsickle_Closure_declarations() { 36 | /** @type {!Array<{type: !Function, args: (undefined|!Array)}>} */ 37 | InjectableRxStompConfig.decorators; 38 | /** 39 | * @nocollapse 40 | * @type {function(): !Array<(null|{type: ?, decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array)}>)})>} 41 | */ 42 | InjectableRxStompConfig.ctorParameters; 43 | } 44 | 45 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5qZWN0YWJsZS1yeC1zdG9tcC1jb25maWcuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9Ac3RvbXAvbmcyLXN0b21wanMvIiwic291cmNlcyI6WyJzcmMvYXBwL2luamVjdGFibGUtcngtc3RvbXAtY29uZmlnLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O0FBQUEsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUMzQyxPQUFPLEVBQUUsYUFBYSxFQUFFLE1BQU0saUJBQWlCLENBQUM7Ozs7Ozs7Ozs7Ozs7Ozs7OztJQW1CSCxtREFBYTs7Ozs7Z0JBRHpELFVBQVU7O2tDQW5C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Q29uZmlnIGV4dGVuZHMgUnhTdG9tcENvbmZpZyB7fVxuIl19 -------------------------------------------------------------------------------- /dist/esm5/src/app/injectable-rx-stomp-rpc-config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileoverview added by tsickle 3 | * @suppress {checkTypes} checked by tsc 4 | */ 5 | import * as tslib_1 from "tslib"; 6 | import { Injectable } from '@angular/core'; 7 | import { RxStompRPCConfig } from '@stomp/rx-stomp'; 8 | /** 9 | * Part of `\@stomp/ng2-stompjs`. 10 | * 11 | * Injectable version of {\@link RxStompRPCConfig}. 12 | * 13 | * See guide at {\@link /guide/rx-stomp/ng2-stompjs/remote-procedure-call.html} 14 | */ 15 | var InjectableRxStompRPCConfig = /** @class */ (function (_super) { 16 | tslib_1.__extends(InjectableRxStompRPCConfig, _super); 17 | function InjectableRxStompRPCConfig() { 18 | return _super !== null && _super.apply(this, arguments) || this; 19 | } 20 | InjectableRxStompRPCConfig.decorators = [ 21 | { type: Injectable } 22 | ]; 23 | return InjectableRxStompRPCConfig; 24 | }(RxStompRPCConfig)); 25 | export { InjectableRxStompRPCConfig }; 26 | function InjectableRxStompRPCConfig_tsickle_Closure_declarations() { 27 | /** @type {!Array<{type: !Function, args: (undefined|!Array)}>} */ 28 | InjectableRxStompRPCConfig.decorators; 29 | /** 30 | * @nocollapse 31 | * @type {function(): !Array<(null|{type: ?, decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array)}>)})>} 32 | */ 33 | InjectableRxStompRPCConfig.ctorParameters; 34 | } 35 | /** 36 | * Deprecated, use {\@link InjectableRxStompRPCConfig} instead 37 | */ 38 | export var /** @type {?} */ InjectableRxStompRpcConfig = InjectableRxStompRPCConfig; 39 | 40 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5qZWN0YWJsZS1yeC1zdG9tcC1ycGMtY29uZmlnLmpzIiwic291cmNlUm9vdCI6Im5nOi8vQHN0b21wL25nMi1zdG9tcGpzLyIsInNvdX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nN0IEluamVjdGFibGVSeFN0b21wUnBjQ29uZmlnID0gSW5qZWN0YWJsZVJ4U3RvbXBSUENDb25maWc7XG4iXX0= -------------------------------------------------------------------------------- /dist/esm5/src/app/rx-stomp-rpc.service.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileoverview added by tsickle 3 | * @suppress {checkTypes} checked by tsc 4 | */ 5 | import * as tslib_1 from "tslib"; 6 | import { Injectable, Optional } from '@angular/core'; 7 | import { RxStompRPC } from '@stomp/rx-stomp'; 8 | import { RxStompService } from './rx-stomp.service'; 9 | import { InjectableRxStompRPCConfig } from './injectable-rx-stomp-rpc-config'; 10 | /** 11 | * Part of `\@stomp/ng2-stompjs`. 12 | * 13 | * Injectable version of {\@link RxStompRPC}. 14 | * 15 | * See guide at {\@link /guide/rx-stomp/ng2-stompjs/remote-procedure-call.html} 16 | */ 17 | var RxStompRPCService = /** @class */ (function (_super) { 18 | tslib_1.__extends(RxStompRPCService, _super); 19 | /** 20 | * Create an instance, typically called by Angular Dependency Injection framework. 21 | * 22 | * @param rxStomp 23 | * @param stompRPCConfig 24 | */ 25 | function RxStompRPCService(rxStomp, stompRPCConfig) { 26 | return _super.call(this, rxStomp, stompRPCConfig) || this; 27 | } 28 | RxStompRPCService.decorators = [ 29 | { type: Injectable } 30 | ]; 31 | /** @nocollapse */ 32 | RxStompRPCService.ctorParameters = function () { return [ 33 | { type: RxStompService, }, 34 | { type: InjectableRxStompRPCConfig, decorators: [{ type: Optional },] }, 35 | ]; }; 36 | return RxStompRPCService; 37 | }(RxStompRPC)); 38 | export { RxStompRPCService }; 39 | function RxStompRPCService_tsickle_Closure_declarations() { 40 | /** @type {!Array<{type: !Function, args: (undefined|!Array)}>} */ 41 | RxStompRPCService.decorators; 42 | /** 43 | * @nocollapse 44 | * @type {function(): !Array<(null|{type: ?, decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array)}>)})>} 45 | */ 46 | RxStompRPCService.ctorParameters; 47 | } 48 | 49 | //# sourceMappingURL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uXG4vKipcbiAqIFBhcnQgb2YgYEBzdG9tcC9uZzItc3RvbXBqc2AuXG4gKlxuICogSW5qZWN0YWJsZSB2ZXJzaW9uIG9mIHtAbGluayBSeFN0b21wUlBDfS5cbiAqXG4gKiBTZWUgZ3VpZGUgYXQge0BsaW5rIC9ndWlkZS9yeC1zdG9tcC9uZzItc3RvbXBqcy9yZW1vdGUtcHJvY2VkdXJlLWNhbGwuaHRtbH1cbiAqL1xuQEluamVjdGFibGUoKVxuZXhwb3J0IGNsYXNzIFJ4U3RvbXBSUENTZXJ2aWNlIGV4dGVuZHMgUnhTdG9tcFJQQyB7XG4gIC8qKlxuICAgKiBDcmVhdGUgYW4gaW5zdGFuY2UsIHR5cGljYWxseSBjYWxsZWQgYnkgQW5ndWxhciBEZXBlbmRlbmN5IEluamVjdGlvbiBmcmFtZXdvcmsuXG4gICAqXG4gICAqIEBwYXJhbSByeFN0b21wXG4gICAqIEBwYXJhbSBzdG9tcFJQQ0NvbmZpZ1xuICAgKi9cbiAgY29uc3RydWN0b3IoXG4gICAgcnhTdG9tcDogUnhTdG9tcFNlcnZpY2UsXG4gICAgQE9wdGlvbmFsKCkgc3RvbXBSUENDb25maWc/OiBJbmplY3RhYmxlUnhTdG9tcFJQQ0NvbmZpZ1xuICApIHtcbiAgICBzdXBlcihyeFN0b21wLCBzdG9tcFJQQ0NvbmZpZyk7XG4gIH1cbn1cbiJdfQ== -------------------------------------------------------------------------------- /dist/esm5/src/app/rx-stomp-service-factory.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileoverview added by tsickle 3 | * @suppress {checkTypes} checked by tsc 4 | */ 5 | import { RxStompService } from './rx-stomp.service'; 6 | /** 7 | * Part of `\@stomp/ng2-stompjs`. 8 | * 9 | * This is factory function that can create {\@link RxStompService} 10 | * when configuration is already known. 11 | * You can use this function for defining provider for {\@link RxStompService}. 12 | * {\@link RxStompService} created using this function is configured and activated. 13 | * This provides the simplest mechanism to define {\@link RxStompService} for Dependency Injection. 14 | * 15 | * See: {\@link /guide/ng2-stompjs/ng2-stomp-with-angular7.html} 16 | * for a step-by-step guide. 17 | * @param {?} rxStompConfig 18 | * @return {?} 19 | */ 20 | export function rxStompServiceFactory(rxStompConfig) { 21 | var /** @type {?} */ rxStompService = new RxStompService(); 22 | rxStompService.configure(rxStompConfig); 23 | rxStompService.activate(); 24 | return rxStompService; 25 | } 26 | 27 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicngtc3RvbXAtc2VydmljZS1mYWN0b3J5LmpzIiwic291cmNlUm9vdCI6Im5nOi8vQHN0b21wL25nMi1zdG9tcGpzLyIsInNvdXJjZXMiOlsic3JjL2FwcC9yeC1zdG9tcC1zZXJ2aWNlLWZhY3RvcnkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7OztBQUNBLE9BQU8sRUFBRSxjQUFjLEVBQUUsTUFBTSxvQkFBb0IsQ0FBQzs7Ozs7Ozs7Ozs7Ozs7O0FBY3BELE1BQU0sZ0NBQ0osYUFBc0M7SUFFdEMscUJBQU0sY0FBYyxHQUFHLElBQUksY0FBYyxFQUFFLENBQUM7SUFFNUMsY0FBYyxDQUFDLFNBQVMsQ0FBQyxhQUFhLENBQUMsQ0FBQztJQUN4QyxjQUFjLENBQUMsUUFBUSxFQUFFLENBQUM7SUFFMUIsTUFBTSxDQUFDLGNBQWMsQ0FBQztDQUN2QiIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IEluamVjdGFibGVSeFN0b21wQ29uZmlnIH0gZnJvbSAnLi9pbmplY3RhYmxlLXJ4LXN0b21wLWNvbmZpZyc7XG5pbXBvcnQgeyBSeFN0b21wU2VydmljZSB9IGZyb20gJy4vcngtc3RvbXAuc2VydmljZSc7XG5cbi8qKlxuICogUGFydCBvZiBgQHN0b21wL25nMi1zdG9tcGpzYC5cbiAqXG4gKiBUaGlzIGlzIGZhY3RvcnkgZnVuY3Rpb24gdGhhdCBjYW4gY3JlYXRlIHtAbGluayBSeFN0b21wU2VydmljZX1cbiAqIHdoZW4gY29uZmlndXJhdGlvbiBpcyBhbHJlYWR5IGtub3duLlxuICogWW91IGNhbiB1c2UgdGhpcyBmdW5jdGlvbiBmb3IgZGVmaW5pbmcgcHJvdmlkZXIgZm9yIHtAbGluayBSeFN0b21wU2VydmljZX0uXG4gKiB7QGxpbmsgUnhTdG9tcFNlcnZpY2V9IGNyZWF0ZWQgdXNpbmcgdGhpcyBmdW5jdGlvbiBpcyBjb25maWd1cmVkIGFuZCBhY3RpdmF0ZWQuXG4gKiBUaGlzIHByb3ZpZGVzIHRoZSBzaW1wbGVzdCBtZWNoYW5pc20gdG8gZGVmaW5lIHtAbGluayBSeFN0b21wU2VydmljZX0gZm9yIERlcGVuZGVuY3kgSW5qZWN0aW9uLlxuICpcbiAqIFNlZToge0BsaW5rIC9ndWlkZS9uZzItc3RvbXBqcy9uZzItc3RvbXAtd2l0aC1hbmd1bGFyNy5odG1sfVxuICogZm9yIGEgc3RlcC1ieS1zdGVwIGd1aWRlLlxuICovXG5leHBvcnQgZnVuY3Rpb24gcnhTdG9tcFNlcnZpY2VGYWN0b3J5KFxuICByeFN0b21wQ29uZmlnOiBJbmplY3RhYmxlUnhTdG9tcENvbmZpZ1xuKTogUnhTdG9tcFNlcnZpY2Uge1xuICBjb25zdCByeFN0b21wU2VydmljZSA9IG5ldyBSeFN0b21wU2VydmljZSgpO1xuXG4gIHJ4U3RvbXBTZXJ2aWNlLmNvbmZpZ3VyZShyeFN0b21wQ29uZmlnKTtcbiAgcnhTdG9tcFNlcnZpY2UuYWN0aXZhdGUoKTtcblxuICByZXR1cm4gcnhTdG9tcFNlcnZpY2U7XG59XG4iXX0= -------------------------------------------------------------------------------- /dist/esm5/src/app/rx-stomp.service.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileoverview added by tsickle 3 | * @suppress {checkTypes} checked by tsc 4 | */ 5 | import * as tslib_1 from "tslib"; 6 | import { Injectable } from '@angular/core'; 7 | import { RxStomp } from '@stomp/rx-stomp'; 8 | /** 9 | * Part of `\@stomp/ng2-stompjs`. 10 | * 11 | * This class is Injectable version of {\@link RxStomp} with exactly same functionality. 12 | * Please see {\@link RxStomp} for details. 13 | * 14 | * See: {\@link /guide/ng2-stompjs/ng2-stomp-with-angular7.html} 15 | * for a step-by-step guide. 16 | * 17 | * See also {\@link rxStompServiceFactory}. 18 | */ 19 | var RxStompService = /** @class */ (function (_super) { 20 | tslib_1.__extends(RxStompService, _super); 21 | function RxStompService() { 22 | return _super !== null && _super.apply(this, arguments) || this; 23 | } 24 | RxStompService.decorators = [ 25 | { type: Injectable } 26 | ]; 27 | return RxStompService; 28 | }(RxStomp)); 29 | export { RxStompService }; 30 | function RxStompService_tsickle_Closure_declarations() { 31 | /** @type {!Array<{type: !Function, args: (undefined|!Array)}>} */ 32 | RxStompService.decorators; 33 | /** 34 | * @nocollapse 35 | * @type {function(): !Array<(null|{type: ?, decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array)}>)})>} 36 | */ 37 | RxStompService.ctorParameters; 38 | } 39 | 40 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicngtc3RvbXAuc2VydmljZS5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0BzdG9tcC9uZzItc3RvbXBqcy8iLCJzb3VyY2VzIjpbInNyYy9hcHAvcngtc3RvbXAuc2VydmljZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQUFBLE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDM0MsT0FBTyxFQUFFLE9BQU8sRUFBRSxNQUFNLGlCQUFpQixDQUFDOzs7Ozs7Ozs7Ozs7O0lBY04sMENBQU87Ozs7O2dCQUQxQyxVQUFVOzt5QkFkWDtFQWVvQyxPQUFPO1NBQTlCLGNBQWMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBJbmplY3RhYmxlIH0gZnJvbSAnQGFuZ3VsYXIvY29yZSc7XG5pbXBvcnQgeyBSeFN0b21wIH0gZnJvbSAnQHN0b21wL3J4LXN0b21wJztcblxuLyoqXG4gKiBQYXJ0IG9mIGBAc3RvbXAvbmcyLXN0b21wanNgLlxuICpcbiAqIFRoaXMgY2xhc3MgaXMgSW5qZWN0YWJsZSB2ZXJzaW9uIG9mIHtAbGluayBSeFN0b21wfSB3aXRoIGV4YWN0bHkgc2FtZSBmdW5jdGlvbmFsaXR5LlxuICogUGxlYXNlIHNlZSB7QGxpbmsgUnhTdG9tcH0gZm9yIGRldGFpbHMuXG4gKlxuICogU2VlOiB7QGxpbmsgL2d1aWRlL25nMi1zdG9tcGpzL25nMi1zdG9tcC13aXRoLWFuZ3VsYXI3Lmh0bWx9XG4gKiBmb3IgYSBzdGVwLWJ5LXN0ZXAgZ3VpZGUuXG4gKlxuICogU2VlIGFsc28ge0BsaW5rIHJ4U3RvbXBTZXJ2aWNlRmFjdG9yeX0uXG4gKi9cbkBJbmplY3RhYmxlKClcbmV4cG9ydCBjbGFzcyBSeFN0b21wU2VydmljZSBleHRlbmRzIFJ4U3RvbXAge31cbiJdfQ== -------------------------------------------------------------------------------- /dist/esm5/stomp-ng2-stompjs.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileoverview added by tsickle 3 | * @suppress {checkTypes} checked by tsc 4 | */ 5 | /** 6 | * Generated bundle index. Do not edit. 7 | */ 8 | export { StompRService, StompService, StompHeaders, StompState, StompConfig, RxStompRPCService, RxStompService, InjectableRxStompConfig, InjectableRxStompRPCConfig, InjectableRxStompRpcConfig, rxStompServiceFactory } from './index'; 9 | 10 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RvbXAtbmcyLXN0b21wanMuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9Ac3RvbXAvbmcyLXN0b21wanMvIiwic291cmNlcyI6WyJzdG9tcC1uZzItc3RvbXBqcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7O0FBSUEsOE5BQWMsU0FBUyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBHZW5lcmF0ZWQgYnVuZGxlIGluZGV4LiBEbyBub3QgZWRpdC5cbiAqL1xuXG5leHBvcnQgKiBmcm9tICcuL2luZGV4JztcbiJdfQ== -------------------------------------------------------------------------------- /dist/fesm2015/stomp-ng2-stompjs.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"stomp-ng2-stompjs.js.map","sources":["ng://@stomp/ng2-stompjs/src/app/compatibility/stomp-r.service.ts","ng://@stomp/ng2-stompjs/src/app/compatibility/stomp.config.ts","ng://@stomp/ng2-stompjs/src/app/compatibility/stomp.service.ts","ng://@stomp/ng2-stompjs/src/app/rx-stomp.service.ts","ng://@stomp/ng2-stompjs/src/app/injectable-rx-stomp-rpc-config.ts","ng://@stomp/ng2-stompjs/src/app/rx-stomp-rpc.service.ts","ng://@stomp/ng2-stompjs/src/app/injectable-rx-stomp-config.ts","ng://@stomp/ng2-stompjs/src/app/rx-stomp-service-factory.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\n\nimport { RxStomp, RxStompConfig, RxStompState } from '@stomp/rx-stomp';\n\nimport { publishParams, Client, Message, Frame } from '@stomp/stompjs';\n\nimport { BehaviorSubject, Observable, Subject } from 'rxjs';\nimport { map } from 'rxjs/operators';\n\nimport { StompState } from './stomp-state';\nimport { StompHeaders } from './stomp-headers';\nimport { StompConfig } from './stomp.config';\n\n/**\n * Part of `@stomp/ng2-stompjs`.\n *\n * **This class has been deprecated in favor of {@link RxStompService}.\n * It will be dropped `@stomp/ng2-stompjs@8.x.x`.**\n *\n * Angular2 STOMP Raw Service using @stomp/stomp.js\n *\n * You will only need the public properties and\n * methods listed unless you are an advanced user. This service handles subscribing to a\n * message queue using the stomp.js library, and returns\n * values via the ES6 Observable specification for\n * asynchronous value streaming by wiring the STOMP\n * messages into an observable.\n *\n * If you will like to pass the configuration as a dependency,\n * please use StompService class.\n */\n@Injectable()\nexport class StompRService extends RxStomp {\n /**\n * State of the STOMPService\n *\n * It is a BehaviorSubject and will emit current status immediately. This will typically get\n * used to show current status to the end user.\n */\n public state: BehaviorSubject;\n\n private static _mapStompState(st: RxStompState): StompState {\n if (st === RxStompState.CONNECTING) {\n return StompState.TRYING;\n }\n if (st === RxStompState.OPEN) {\n return StompState.CONNECTED;\n }\n if (st === RxStompState.CLOSING) {\n return StompState.DISCONNECTING;\n }\n if (st === RxStompState.CLOSED) {\n return StompState.CLOSED;\n }\n }\n\n /**\n * Will trigger when connection is established. Use this to carry out initialization.\n * It will trigger every time a (re)connection occurs. If it is already connected\n * it will trigger immediately. You can safely ignore the value, as it will always be\n * StompState.CONNECTED\n */\n get connectObservable(): Observable {\n return this.connected$.pipe(\n map(\n (st: RxStompState): StompState => {\n return StompRService._mapStompState(st);\n }\n )\n );\n }\n\n /**\n * Provides headers from most recent connection to the server as return by the CONNECTED\n * frame.\n * If the STOMP connection has already been established it will trigger immediately.\n * It will additionally trigger in event of reconnection, the value will be set of headers from\n * the recent server response.\n */\n get serverHeadersObservable(): Observable {\n return this.serverHeaders$;\n }\n\n /**\n * Will emit all messages to the default queue (any message that are not handled by a subscription)\n */\n get defaultMessagesObservable(): Subject {\n return this.unhandledMessage$;\n }\n\n /**\n * Will emit all receipts\n */\n get receiptsObservable(): Subject {\n return this.unhandledReceipts$;\n }\n\n /**\n * Will trigger when an error occurs. This Subject can be used to handle errors from\n * the stomp broker.\n */\n get errorSubject(): Subject {\n return this.stompErrors$;\n }\n\n /** Set configuration */\n set config(config: StompConfig) {\n const rxStompConfig: RxStompConfig = {};\n\n if (typeof config.url === 'string') {\n rxStompConfig.brokerURL = config.url;\n } else {\n rxStompConfig.webSocketFactory = config.url;\n }\n\n // Configure client heart-beating\n rxStompConfig.heartbeatIncoming = config.heartbeat_in;\n rxStompConfig.heartbeatOutgoing = config.heartbeat_out;\n\n // Auto reconnect\n rxStompConfig.reconnectDelay = config.reconnect_delay;\n\n if (config.debug) {\n rxStompConfig.debug = (str: string): void => {\n console.log(new Date(), str);\n };\n }\n\n rxStompConfig.connectHeaders = config.headers;\n\n this.configure(rxStompConfig);\n }\n /**\n * It will connect to the STOMP broker.\n */\n public initAndConnect(): void {\n // disconnect if connected\n this.deactivate();\n\n // Attempt connection, passing in a callback\n this.activate();\n }\n\n /**\n * It will disconnect from the STOMP broker.\n */\n public disconnect(): void {\n this.deactivate();\n }\n\n /**\n * It will send a message to a named destination. The message must be `string`.\n *\n * The message will get locally queued if the STOMP broker is not connected. It will attempt to\n * publish queued messages as soon as the broker gets connected.\n *\n * @param queueName\n * @param message\n * @param headers\n */\n public publish(\n queueName: string | publishParams,\n message?: string,\n headers: StompHeaders = {}\n ): void {\n if (typeof queueName === 'string') {\n super.publish({\n destination: queueName as string,\n body: message,\n headers,\n });\n } else {\n const pubParams: publishParams = queueName;\n super.publish(pubParams);\n }\n }\n\n /**\n * It will subscribe to server message queues\n *\n * This method can be safely called even if the STOMP broker is not connected.\n * If the underlying STOMP connection drops and reconnects, it will resubscribe automatically.\n *\n * If a header field 'ack' is not explicitly passed, 'ack' will be set to 'auto'. If you\n * do not understand what it means, please leave it as is.\n *\n * Note that when working with temporary queues where the subscription request\n * creates the\n * underlying queue, messages might be missed during reconnect. This issue is not specific\n * to this library but the way STOMP brokers are designed to work.\n *\n * @param queueName\n * @param headers\n */\n public subscribe(\n queueName: string,\n headers: StompHeaders = {}\n ): Observable {\n return this.watch(queueName, headers);\n }\n\n /**\n * STOMP brokers may carry out operation asynchronously and allow requesting for acknowledgement.\n * To request an acknowledgement, a `receipt` header needs to be sent with the actual request.\n * The value (say receipt-id) for this header needs to be unique for each use. Typically a sequence, a UUID, a\n * random number or a combination may be used.\n *\n * A complaint broker will send a RECEIPT frame when an operation has actually been completed.\n * The operation needs to be matched based in the value of the receipt-id.\n *\n * This method allow watching for a receipt and invoke the callback\n * when corresponding receipt has been received.\n *\n * The actual {@link Frame}\n * will be passed as parameter to the callback.\n *\n * Example:\n * ```javascript\n * // Publishing with acknowledgement\n * let receiptId = randomText();\n *\n * rxStomp.waitForReceipt(receiptId, function() {\n * // Will be called after server acknowledges\n * });\n * rxStomp.publish({destination: TEST.destination, headers: {receipt: receiptId}, body: msg});\n * ```\n *\n * Maps to: [Client#watchForReceipt]{@link Client#watchForReceipt}\n */\n public waitForReceipt(\n receiptId: string,\n callback: (frame: Frame) => void\n ): void {\n super.watchForReceipt(receiptId, callback);\n }\n\n get client(): Client {\n return this._stompClient;\n }\n\n public constructor() {\n super();\n\n this.state = new BehaviorSubject(StompState.CLOSED);\n\n this.connectionState$.subscribe((st: RxStompState) => {\n this.state.next(StompRService._mapStompState(st));\n });\n }\n}\n","import { Injectable } from '@angular/core';\nimport { StompHeaders } from '@stomp/stompjs';\n\n/**\n * Part of `@stomp/ng2-stompjs`.\n *\n * **This class has been deprecated in favor of {@link InjectableRxStompConfig}.\n * It will be dropped `@stomp/ng2-stompjs@8.x.x`.**\n *\n * Represents a configuration object for the\n * STOMPService to connect to.\n *\n * This name conflicts with a class of the same name in @stomp/stompjs, excluding this from the documentation.\n *\n * @internal\n */\n@Injectable()\nexport class StompConfig {\n /**\n * Server URL to connect to. Please refer to your STOMP broker documentation for details.\n *\n * Example: ws://127.0.0.1:15674/ws (for a RabbitMQ default setup running on localhost)\n *\n * Alternatively this parameter can be a function that returns an object similar to WebSocket\n * (typically SockJS instance).\n *\n * Example:\n *\n * () => {\n * return new SockJS('http://127.0.0.1:15674/stomp');\n * }\n */\n url: string | (() => any);\n\n /**\n * Headers\n * Typical keys: login: string, passcode: string.\n * host:string will neeed to be passed for virtual hosts in RabbitMQ\n */\n headers: StompHeaders;\n\n /** How often to incoming heartbeat?\n * Interval in milliseconds, set to 0 to disable\n *\n * Typical value 0 - disabled\n */\n heartbeat_in: number;\n\n /**\n * How often to outgoing heartbeat?\n * Interval in milliseconds, set to 0 to disable\n *\n * Typical value 20000 - every 20 seconds\n */\n heartbeat_out: number;\n\n /**\n * Wait in milliseconds before attempting auto reconnect\n * Set to 0 to disable\n *\n * Typical value 5000 (5 seconds)\n */\n reconnect_delay: number;\n\n /** Enable client debugging? */\n debug: boolean;\n}\n","import { Injectable } from '@angular/core';\n\nimport { StompConfig } from './stomp.config';\n\nimport { StompRService } from './stomp-r.service';\n\n/**\n * Part of `@stomp/ng2-stompjs`.\n *\n * **This class has been deprecated in favor of {@link RxStompService} with {@link rxStompServiceFactory}.\n * It will be dropped `@stomp/ng2-stompjs@8.x.x`.**\n *\n * Angular2 STOMP Service using @stomp/stomp.js\n *\n * @description This service handles subscribing to a\n * message queue using the stomp.js library, and returns\n * values via the ES6 Observable specification for\n * asynchronous value streaming by wiring the STOMP\n * messages into an observable.\n *\n * If you want to manually configure and initialize the service\n * please use StompRService\n */\n@Injectable()\nexport class StompService extends StompRService {\n /**\n * Constructor\n *\n * See README and samples for configuration examples\n */\n public constructor(config: StompConfig) {\n super();\n\n this.config = config;\n this.initAndConnect();\n }\n}\n","import { Injectable } from '@angular/core';\nimport { RxStomp } from '@stomp/rx-stomp';\n\n/**\n * Part of `@stomp/ng2-stompjs`.\n *\n * This class is Injectable version of {@link RxStomp} with exactly same functionality.\n * Please see {@link RxStomp} for details.\n *\n * See: {@link /guide/ng2-stompjs/ng2-stomp-with-angular7.html}\n * for a step-by-step guide.\n *\n * See also {@link rxStompServiceFactory}.\n */\n@Injectable()\nexport class RxStompService extends RxStomp {}\n","import { Injectable } from '@angular/core';\nimport { RxStompRPCConfig } from '@stomp/rx-stomp';\n\n/**\n * Part of `@stomp/ng2-stompjs`.\n *\n * Injectable version of {@link RxStompRPCConfig}.\n *\n * See guide at {@link /guide/rx-stomp/ng2-stompjs/remote-procedure-call.html}\n */\n@Injectable()\nexport class InjectableRxStompRPCConfig extends RxStompRPCConfig {}\n\n// Backward compatibility\n/**\n * Deprecated, use {@link InjectableRxStompRPCConfig} instead\n */\nexport const InjectableRxStompRpcConfig = InjectableRxStompRPCConfig;\n","import { Injectable, Optional } from '@angular/core';\n\nimport { RxStompRPC } from '@stomp/rx-stomp';\nimport { RxStompService } from './rx-stomp.service';\nimport { InjectableRxStompRPCConfig } from './injectable-rx-stomp-rpc-config';\n\n/**\n * Part of `@stomp/ng2-stompjs`.\n *\n * Injectable version of {@link RxStompRPC}.\n *\n * See guide at {@link /guide/rx-stomp/ng2-stompjs/remote-procedure-call.html}\n */\n@Injectable()\nexport class RxStompRPCService extends RxStompRPC {\n /**\n * Create an instance, typically called by Angular Dependency Injection framework.\n *\n * @param rxStomp\n * @param stompRPCConfig\n */\n constructor(\n rxStomp: RxStompService,\n @Optional() stompRPCConfig?: InjectableRxStompRPCConfig\n ) {\n super(rxStomp, stompRPCConfig);\n }\n}\n","import { Injectable } from '@angular/core';\nimport { RxStompConfig } from '@stomp/rx-stomp';\n\n/**\n * Part of `@stomp/ng2-stompjs`.\n *\n * This class is Injectable version of {@link RxStompConfig} with exactly same functionality.\n * Please see {@link RxStompConfig} for details.\n *\n * See: {@link /guide/ng2-stompjs/ng2-stomp-with-angular7.html}\n * for a step-by-step guide.\n *\n * If all fields of configuration are fixed and known in advance you would typically define\n * a `const` and inject it using value.\n *\n * If some fields will be known by later, it can be injected using a factory function.\n *\n * Occasionally it may need to be combined with Angular's APP_INITIALIZER mechanism.\n */\n@Injectable()\nexport class InjectableRxStompConfig extends RxStompConfig {}\n","import { InjectableRxStompConfig } from './injectable-rx-stomp-config';\nimport { RxStompService } from './rx-stomp.service';\n\n/**\n * Part of `@stomp/ng2-stompjs`.\n *\n * This is factory function that can create {@link RxStompService}\n * when configuration is already known.\n * You can use this function for defining provider for {@link RxStompService}.\n * {@link RxStompService} created using this function is configured and activated.\n * This provides the simplest mechanism to define {@link RxStompService} for Dependency Injection.\n *\n * See: {@link /guide/ng2-stompjs/ng2-stomp-with-angular7.html}\n * for a step-by-step guide.\n */\nexport function rxStompServiceFactory(\n rxStompConfig: InjectableRxStompConfig\n): RxStompService {\n const rxStompService = new RxStompService();\n\n rxStompService.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,aAAa,CAAC,CAAC;IACxC,cAAc,CAAC,QAAQ,EAAE,CAAC;IAE1B,OAAO,cAAc,CAAC;CACvB;;;;;;;;;;;;;;"} 2 | -------------------------------------------------------------------------------- /dist/fesm5/stomp-ng2-stompjs.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"stomp-ng2-stompjs.js.map","sources":["ng://@stomp/ng2-stompjs/src/app/compatibility/stomp-r.service.ts","ng://@stomp/ng2-stompjs/src/app/compatibility/stomp.config.ts","ng://@stomp/ng2-stompjs/src/app/compatibility/stomp.service.ts","ng://@stomp/ng2-stompjs/src/app/rx-stomp.service.ts","ng://@stomp/ng2-stompjs/src/app/injectable-rx-stomp-rpc-config.ts","ng://@stomp/ng2-stompjs/src/app/rx-stomp-rpc.service.ts","ng://@stomp/ng2-stompjs/src/app/injectable-rx-stomp-config.ts","ng://@stomp/ng2-stompjs/src/app/rx-stomp-service-factory.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\n\nimport { RxStomp, RxStompConfig, RxStompState } from '@stomp/rx-stomp';\n\nimport { publishParams, Client, Message, Frame } from '@stomp/stompjs';\n\nimport { BehaviorSubject, Observable, Subject } from 'rxjs';\nimport { map } from 'rxjs/operators';\n\nimport { StompState } from './stomp-state';\nimport { StompHeaders } from './stomp-headers';\nimport { StompConfig } from './stomp.config';\n\n/**\n * Part of `@stomp/ng2-stompjs`.\n *\n * **This class has been deprecated in favor of {@link RxStompService}.\n * It will be dropped `@stomp/ng2-stompjs@8.x.x`.**\n *\n * Angular2 STOMP Raw Service using @stomp/stomp.js\n *\n * You will only need the public properties and\n * methods listed unless you are an advanced user. This service handles subscribing to a\n * message queue using the stomp.js library, and returns\n * values via the ES6 Observable specification for\n * asynchronous value streaming by wiring the STOMP\n * messages into an observable.\n *\n * If you will like to pass the configuration as a dependency,\n * please use StompService class.\n */\n@Injectable()\nexport class StompRService extends RxStomp {\n /**\n * State of the STOMPService\n *\n * It is a BehaviorSubject and will emit current status immediately. This will typically get\n * used to show current status to the end user.\n */\n public state: BehaviorSubject;\n\n private static _mapStompState(st: RxStompState): StompState {\n if (st === RxStompState.CONNECTING) {\n return StompState.TRYING;\n }\n if (st === RxStompState.OPEN) {\n return StompState.CONNECTED;\n }\n if (st === RxStompState.CLOSING) {\n return StompState.DISCONNECTING;\n }\n if (st === RxStompState.CLOSED) {\n return StompState.CLOSED;\n }\n }\n\n /**\n * Will trigger when connection is established. Use this to carry out initialization.\n * It will trigger every time a (re)connection occurs. If it is already connected\n * it will trigger immediately. You can safely ignore the value, as it will always be\n * StompState.CONNECTED\n */\n get connectObservable(): Observable {\n return this.connected$.pipe(\n map(\n (st: RxStompState): StompState => {\n return StompRService._mapStompState(st);\n }\n )\n );\n }\n\n /**\n * Provides headers from most recent connection to the server as return by the CONNECTED\n * frame.\n * If the STOMP connection has already been established it will trigger immediately.\n * It will additionally trigger in event of reconnection, the value will be set of headers from\n * the recent server response.\n */\n get serverHeadersObservable(): Observable {\n return this.serverHeaders$;\n }\n\n /**\n * Will emit all messages to the default queue (any message that are not handled by a subscription)\n */\n get defaultMessagesObservable(): Subject {\n return this.unhandledMessage$;\n }\n\n /**\n * Will emit all receipts\n */\n get receiptsObservable(): Subject {\n return this.unhandledReceipts$;\n }\n\n /**\n * Will trigger when an error occurs. This Subject can be used to handle errors from\n * the stomp broker.\n */\n get errorSubject(): Subject {\n return this.stompErrors$;\n }\n\n /** Set configuration */\n set config(config: StompConfig) {\n const rxStompConfig: RxStompConfig = {};\n\n if (typeof config.url === 'string') {\n rxStompConfig.brokerURL = config.url;\n } else {\n rxStompConfig.webSocketFactory = config.url;\n }\n\n // Configure client heart-beating\n rxStompConfig.heartbeatIncoming = config.heartbeat_in;\n rxStompConfig.heartbeatOutgoing = config.heartbeat_out;\n\n // Auto reconnect\n rxStompConfig.reconnectDelay = config.reconnect_delay;\n\n if (config.debug) {\n rxStompConfig.debug = (str: string): void => {\n console.log(new Date(), str);\n };\n }\n\n rxStompConfig.connectHeaders = config.headers;\n\n this.configure(rxStompConfig);\n }\n /**\n * It will connect to the STOMP broker.\n */\n public initAndConnect(): void {\n // disconnect if connected\n this.deactivate();\n\n // Attempt connection, passing in a callback\n this.activate();\n }\n\n /**\n * It will disconnect from the STOMP broker.\n */\n public disconnect(): void {\n this.deactivate();\n }\n\n /**\n * It will send a message to a named destination. The message must be `string`.\n *\n * The message will get locally queued if the STOMP broker is not connected. It will attempt to\n * publish queued messages as soon as the broker gets connected.\n *\n * @param queueName\n * @param message\n * @param headers\n */\n public publish(\n queueName: string | publishParams,\n message?: string,\n headers: StompHeaders = {}\n ): void {\n if (typeof queueName === 'string') {\n super.publish({\n destination: queueName as string,\n body: message,\n headers,\n });\n } else {\n const pubParams: publishParams = queueName;\n super.publish(pubParams);\n }\n }\n\n /**\n * It will subscribe to server message queues\n *\n * This method can be safely called even if the STOMP broker is not connected.\n * If the underlying STOMP connection drops and reconnects, it will resubscribe automatically.\n *\n * If a header field 'ack' is not explicitly passed, 'ack' will be set to 'auto'. If you\n * do not understand what it means, please leave it as is.\n *\n * Note that when working with temporary queues where the subscription request\n * creates the\n * underlying queue, messages might be missed during reconnect. This issue is not specific\n * to this library but the way STOMP brokers are designed to work.\n *\n * @param queueName\n * @param headers\n */\n public subscribe(\n queueName: string,\n headers: StompHeaders = {}\n ): Observable {\n return this.watch(queueName, headers);\n }\n\n /**\n * STOMP brokers may carry out operation asynchronously and allow requesting for acknowledgement.\n * To request an acknowledgement, a `receipt` header needs to be sent with the actual request.\n * The value (say receipt-id) for this header needs to be unique for each use. Typically a sequence, a UUID, a\n * random number or a combination may be used.\n *\n * A complaint broker will send a RECEIPT frame when an operation has actually been completed.\n * The operation needs to be matched based in the value of the receipt-id.\n *\n * This method allow watching for a receipt and invoke the callback\n * when corresponding receipt has been received.\n *\n * The actual {@link Frame}\n * will be passed as parameter to the callback.\n *\n * Example:\n * ```javascript\n * // Publishing with acknowledgement\n * let receiptId = randomText();\n *\n * rxStomp.waitForReceipt(receiptId, function() {\n * // Will be called after server acknowledges\n * });\n * rxStomp.publish({destination: TEST.destination, headers: {receipt: receiptId}, body: msg});\n * ```\n *\n * Maps to: [Client#watchForReceipt]{@link Client#watchForReceipt}\n */\n public waitForReceipt(\n receiptId: string,\n callback: (frame: Frame) => void\n ): void {\n super.watchForReceipt(receiptId, callback);\n }\n\n get client(): Client {\n return this._stompClient;\n }\n\n public constructor() {\n super();\n\n this.state = new BehaviorSubject(StompState.CLOSED);\n\n this.connectionState$.subscribe((st: RxStompState) => {\n this.state.next(StompRService._mapStompState(st));\n });\n }\n}\n","import { Injectable } from '@angular/core';\nimport { StompHeaders } from '@stomp/stompjs';\n\n/**\n * Part of `@stomp/ng2-stompjs`.\n *\n * **This class has been deprecated in favor of {@link InjectableRxStompConfig}.\n * It will be dropped `@stomp/ng2-stompjs@8.x.x`.**\n *\n * Represents a configuration object for the\n * STOMPService to connect to.\n *\n * This name conflicts with a class of the same name in @stomp/stompjs, excluding this from the documentation.\n *\n * @internal\n */\n@Injectable()\nexport class StompConfig {\n /**\n * Server URL to connect to. Please refer to your STOMP broker documentation for details.\n *\n * Example: ws://127.0.0.1:15674/ws (for a RabbitMQ default setup running on localhost)\n *\n * Alternatively this parameter can be a function that returns an object similar to WebSocket\n * (typically SockJS instance).\n *\n * Example:\n *\n * () => {\n * return new SockJS('http://127.0.0.1:15674/stomp');\n * }\n */\n url: string | (() => any);\n\n /**\n * Headers\n * Typical keys: login: string, passcode: string.\n * host:string will neeed to be passed for virtual hosts in RabbitMQ\n */\n headers: StompHeaders;\n\n /** How often to incoming heartbeat?\n * Interval in milliseconds, set to 0 to disable\n *\n * Typical value 0 - disabled\n */\n heartbeat_in: number;\n\n /**\n * How often to outgoing heartbeat?\n * Interval in milliseconds, set to 0 to disable\n *\n * Typical value 20000 - every 20 seconds\n */\n heartbeat_out: number;\n\n /**\n * Wait in milliseconds before attempting auto reconnect\n * Set to 0 to disable\n *\n * Typical value 5000 (5 seconds)\n */\n reconnect_delay: number;\n\n /** Enable client debugging? */\n debug: boolean;\n}\n","import { Injectable } from '@angular/core';\n\nimport { StompConfig } from './stomp.config';\n\nimport { StompRService } from './stomp-r.service';\n\n/**\n * Part of `@stomp/ng2-stompjs`.\n *\n * **This class has been deprecated in favor of {@link RxStompService} with {@link rxStompServiceFactory}.\n * It will be dropped `@stomp/ng2-stompjs@8.x.x`.**\n *\n * Angular2 STOMP Service using @stomp/stomp.js\n *\n * @description This service handles subscribing to a\n * message queue using the stomp.js library, and returns\n * values via the ES6 Observable specification for\n * asynchronous value streaming by wiring the STOMP\n * messages into an observable.\n *\n * If you want to manually configure and initialize the service\n * please use StompRService\n */\n@Injectable()\nexport class StompService extends StompRService {\n /**\n * Constructor\n *\n * See README and samples for configuration examples\n */\n public constructor(config: StompConfig) {\n super();\n\n this.config = config;\n this.initAndConnect();\n }\n}\n","import { Injectable } from '@angular/core';\nimport { RxStomp } from '@stomp/rx-stomp';\n\n/**\n * Part of `@stomp/ng2-stompjs`.\n *\n * This class is Injectable version of {@link RxStomp} with exactly same functionality.\n * Please see {@link RxStomp} for details.\n *\n * See: {@link /guide/ng2-stompjs/ng2-stomp-with-angular7.html}\n * for a step-by-step guide.\n *\n * See also {@link rxStompServiceFactory}.\n */\n@Injectable()\nexport class RxStompService extends RxStomp {}\n","import { Injectable } from '@angular/core';\nimport { RxStompRPCConfig } from '@stomp/rx-stomp';\n\n/**\n * Part of `@stomp/ng2-stompjs`.\n *\n * Injectable version of {@link RxStompRPCConfig}.\n *\n * See guide at {@link /guide/rx-stomp/ng2-stompjs/remote-procedure-call.html}\n */\n@Injectable()\nexport class InjectableRxStompRPCConfig extends RxStompRPCConfig {}\n\n// Backward compatibility\n/**\n * Deprecated, use {@link InjectableRxStompRPCConfig} instead\n */\nexport const InjectableRxStompRpcConfig = InjectableRxStompRPCConfig;\n","import { Injectable, Optional } from '@angular/core';\n\nimport { RxStompRPC } from '@stomp/rx-stomp';\nimport { RxStompService } from './rx-stomp.service';\nimport { InjectableRxStompRPCConfig } from './injectable-rx-stomp-rpc-config';\n\n/**\n * Part of `@stomp/ng2-stompjs`.\n *\n * Injectable version of {@link RxStompRPC}.\n *\n * See guide at {@link /guide/rx-stomp/ng2-stompjs/remote-procedure-call.html}\n */\n@Injectable()\nexport class RxStompRPCService extends RxStompRPC {\n /**\n * Create an instance, typically called by Angular Dependency Injection framework.\n *\n * @param rxStomp\n * @param stompRPCConfig\n */\n constructor(\n rxStomp: RxStompService,\n @Optional() stompRPCConfig?: InjectableRxStompRPCConfig\n ) {\n super(rxStomp, stompRPCConfig);\n }\n}\n","import { Injectable } from '@angular/core';\nimport { RxStompConfig } from '@stomp/rx-stomp';\n\n/**\n * Part of `@stomp/ng2-stompjs`.\n *\n * This class is Injectable version of {@link RxStompConfig} with exactly same functionality.\n * Please see {@link RxStompConfig} for details.\n *\n * See: {@link /guide/ng2-stompjs/ng2-stomp-with-angular7.html}\n * for a step-by-step guide.\n *\n * If all fields of configuration are fixed and known in advance you would typically define\n * a `const` and inject it using value.\n *\n * If some fields will be known by later, it can be injected using a factory function.\n *\n * Occasionally it may need to be combined with Angular's APP_INITIALIZER mechanism.\n */\n@Injectable()\nexport class InjectableRxStompConfig extends RxStompConfig {}\n","import { InjectableRxStompConfig } from './injectable-rx-stomp-config';\nimport { RxStompService } from './rx-stomp.service';\n\n/**\n * Part of `@stomp/ng2-stompjs`.\n *\n * This is factory function that can create {@link RxStompService}\n * when configuration is already known.\n * You can use this function for defining provider for {@link RxStompService}.\n * {@link RxStompService} created using this function is configured and activated.\n * This provides the simplest mechanism to define {@link RxStompService} for Dependency Injection.\n *\n * See: {@link /guide/ng2-stompjs/ng2-stomp-with-angular7.html}\n * for a step-by-step guide.\n */\nexport function rxStompServiceFactory(\n rxStompConfig: InjectableRxStompConfig\n): RxStompService {\n const rxStompService = new RxStompService();\n\n rxStompService.configure(rxStompConfig);\n rxStompService.activate();\n\n return rxStompService;\n}\n"],"names":["tslib_1.__extends"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;ICMJA,2CAAa;;;;;gBADzD,UAAU;;kCAnBX;EAoB6C,aAAa;;;;;;ACnB1D;;;;;;;;;;;;;;AAcA,+BACE,aAAsC;IAEtC,qBAAM,cAAc,GAAG,IAAI,cAAc,EAAE,CAAC;IAE5C,cAAc,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC;IACxC,cAAc,CAAC,QAAQ,EAAE,CAAC;IAE1B,OAAO,cAAc,CAAC;CACvB;;;;;;;;;;;;;;"} 2 | -------------------------------------------------------------------------------- /dist/index.d.ts: -------------------------------------------------------------------------------- 1 | export { StompRService } from './src/app/compatibility/stomp-r.service'; 2 | export { StompService } from './src/app/compatibility/stomp.service'; 3 | export { StompHeaders } from './src/app/compatibility/stomp-headers'; 4 | export { StompState } from './src/app/compatibility/stomp-state'; 5 | export { StompConfig } from './src/app/compatibility/stomp.config'; 6 | export { RxStompRPCService } from './src/app/rx-stomp-rpc.service'; 7 | export { RxStompService } from './src/app/rx-stomp.service'; 8 | export { InjectableRxStompConfig } from './src/app/injectable-rx-stomp-config'; 9 | export { InjectableRxStompRPCConfig } from './src/app/injectable-rx-stomp-rpc-config'; 10 | export { InjectableRxStompRpcConfig } from './src/app/injectable-rx-stomp-rpc-config'; 11 | export { rxStompServiceFactory } from './src/app/rx-stomp-service-factory'; 12 | -------------------------------------------------------------------------------- /dist/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@stomp/ng2-stompjs", 3 | "version": "8.0.0", 4 | "repository": { 5 | "type": "git", 6 | "url": "https://github.com/stomp-js/ng2-stompjs" 7 | }, 8 | "author": { 9 | "name": "Deepak Kumar", 10 | "email": "deepak@kreatio.com" 11 | }, 12 | "keywords": [ 13 | "stompjs", 14 | "angular2", 15 | "angular4", 16 | "angular5", 17 | "rabbitmq", 18 | "websocket", 19 | "angular", 20 | "stomp" 21 | ], 22 | "license": "Apache-2.0", 23 | "bugs": { 24 | "url": "https://github.com/stomp-js/ng2-stompjs/issues" 25 | }, 26 | "main": "bundles/stomp-ng2-stompjs.umd.js", 27 | "dependencies": { 28 | "@stomp/rx-stomp": "^1.0.0 >=1.0.1", 29 | "tslib": "^1.9.0" 30 | }, 31 | "devDependencies": { 32 | "@angular-devkit/build-angular": "~0.6.0", 33 | "@angular/animations": "^6.0.0", 34 | "@angular/cli": "~6.0.0", 35 | "@angular/common": "^6.0.0", 36 | "@angular/compiler": "^6.0.0", 37 | "@angular/compiler-cli": "^6.0.0", 38 | "@angular/core": "^6.0.0", 39 | "@angular/forms": "^6.0.0", 40 | "@angular/http": "^6.0.0", 41 | "@angular/language-service": "^6.0.0", 42 | "@angular/platform-browser": "^6.0.0", 43 | "@angular/platform-browser-dynamic": "^6.0.0", 44 | "@angular/router": "^6.0.0", 45 | "@types/jasmine": "~2.8.6", 46 | "@types/jasminewd2": "~2.0.3", 47 | "@types/node": "~8.9.4", 48 | "codelyzer": "~4.2.1", 49 | "core-js": "^2.5.4", 50 | "jasmine-core": "~2.99.1", 51 | "jasmine-spec-reporter": "~4.2.1", 52 | "karma": "^3.0.0", 53 | "karma-chrome-launcher": "~2.2.0", 54 | "karma-coverage-istanbul-reporter": "~1.4.2", 55 | "karma-jasmine": "~1.1.1", 56 | "karma-jasmine-html-reporter": "^0.2.2", 57 | "karma-summary-reporter": "^1.5.1", 58 | "ng-packagr": "^4.1.1", 59 | "prettier": "^2.1.2", 60 | "protractor": "^5.4.1", 61 | "rxjs": "^6.0.0", 62 | "ts-node": "~5.0.1", 63 | "tslint": "~5.9.1", 64 | "tslint-config-prettier": "^1.18.0", 65 | "typescript": "~2.7.2", 66 | "zone.js": "^0.8.26" 67 | }, 68 | "module": "fesm2015/stomp-ng2-stompjs.js", 69 | "es2015": "fesm2015/stomp-ng2-stompjs.js", 70 | "esm5": "esm5/stomp-ng2-stompjs.js", 71 | "esm2015": "esm2015/stomp-ng2-stompjs.js", 72 | "fesm5": "fesm5/stomp-ng2-stompjs.js", 73 | "fesm2015": "fesm2015/stomp-ng2-stompjs.js", 74 | "typings": "stomp-ng2-stompjs.d.ts", 75 | "metadata": "stomp-ng2-stompjs.metadata.json", 76 | "sideEffects": false 77 | } -------------------------------------------------------------------------------- /dist/src/app/compatibility/stomp-headers.d.ts: -------------------------------------------------------------------------------- 1 | export { StompHeaders } from '@stomp/stompjs'; 2 | -------------------------------------------------------------------------------- /dist/src/app/compatibility/stomp-r.service.d.ts: -------------------------------------------------------------------------------- 1 | import { RxStomp } from '@stomp/rx-stomp'; 2 | import { publishParams, Client, Message, Frame } from '@stomp/stompjs'; 3 | import { BehaviorSubject, Observable, Subject } from 'rxjs'; 4 | import { StompState } from './stomp-state'; 5 | import { StompHeaders } from './stomp-headers'; 6 | import { StompConfig } from './stomp.config'; 7 | /** 8 | * Part of `@stomp/ng2-stompjs`. 9 | * 10 | * **This class has been deprecated in favor of {@link RxStompService}. 11 | * It will be dropped `@stomp/ng2-stompjs@8.x.x`.** 12 | * 13 | * Angular2 STOMP Raw Service using @stomp/stomp.js 14 | * 15 | * You will only need the public properties and 16 | * methods listed unless you are an advanced user. This service handles subscribing to a 17 | * message queue using the stomp.js library, and returns 18 | * values via the ES6 Observable specification for 19 | * asynchronous value streaming by wiring the STOMP 20 | * messages into an observable. 21 | * 22 | * If you will like to pass the configuration as a dependency, 23 | * please use StompService class. 24 | */ 25 | export declare class StompRService extends RxStomp { 26 | /** 27 | * State of the STOMPService 28 | * 29 | * It is a BehaviorSubject and will emit current status immediately. This will typically get 30 | * used to show current status to the end user. 31 | */ 32 | state: BehaviorSubject; 33 | private static _mapStompState(st); 34 | /** 35 | * Will trigger when connection is established. Use this to carry out initialization. 36 | * It will trigger every time a (re)connection occurs. If it is already connected 37 | * it will trigger immediately. You can safely ignore the value, as it will always be 38 | * StompState.CONNECTED 39 | */ 40 | readonly connectObservable: Observable; 41 | /** 42 | * Provides headers from most recent connection to the server as return by the CONNECTED 43 | * frame. 44 | * If the STOMP connection has already been established it will trigger immediately. 45 | * It will additionally trigger in event of reconnection, the value will be set of headers from 46 | * the recent server response. 47 | */ 48 | readonly serverHeadersObservable: Observable; 49 | /** 50 | * Will emit all messages to the default queue (any message that are not handled by a subscription) 51 | */ 52 | readonly defaultMessagesObservable: Subject; 53 | /** 54 | * Will emit all receipts 55 | */ 56 | readonly receiptsObservable: Subject; 57 | /** 58 | * Will trigger when an error occurs. This Subject can be used to handle errors from 59 | * the stomp broker. 60 | */ 61 | readonly errorSubject: Subject; 62 | /** Set configuration */ 63 | config: StompConfig; 64 | /** 65 | * It will connect to the STOMP broker. 66 | */ 67 | initAndConnect(): void; 68 | /** 69 | * It will disconnect from the STOMP broker. 70 | */ 71 | disconnect(): void; 72 | /** 73 | * It will send a message to a named destination. The message must be `string`. 74 | * 75 | * The message will get locally queued if the STOMP broker is not connected. It will attempt to 76 | * publish queued messages as soon as the broker gets connected. 77 | * 78 | * @param queueName 79 | * @param message 80 | * @param headers 81 | */ 82 | publish(queueName: string | publishParams, message?: string, headers?: StompHeaders): void; 83 | /** 84 | * It will subscribe to server message queues 85 | * 86 | * This method can be safely called even if the STOMP broker is not connected. 87 | * If the underlying STOMP connection drops and reconnects, it will resubscribe automatically. 88 | * 89 | * If a header field 'ack' is not explicitly passed, 'ack' will be set to 'auto'. If you 90 | * do not understand what it means, please leave it as is. 91 | * 92 | * Note that when working with temporary queues where the subscription request 93 | * creates the 94 | * underlying queue, messages might be missed during reconnect. This issue is not specific 95 | * to this library but the way STOMP brokers are designed to work. 96 | * 97 | * @param queueName 98 | * @param headers 99 | */ 100 | subscribe(queueName: string, headers?: StompHeaders): Observable; 101 | /** 102 | * STOMP brokers may carry out operation asynchronously and allow requesting for acknowledgement. 103 | * To request an acknowledgement, a `receipt` header needs to be sent with the actual request. 104 | * The value (say receipt-id) for this header needs to be unique for each use. Typically a sequence, a UUID, a 105 | * random number or a combination may be used. 106 | * 107 | * A complaint broker will send a RECEIPT frame when an operation has actually been completed. 108 | * The operation needs to be matched based in the value of the receipt-id. 109 | * 110 | * This method allow watching for a receipt and invoke the callback 111 | * when corresponding receipt has been received. 112 | * 113 | * The actual {@link Frame} 114 | * will be passed as parameter to the callback. 115 | * 116 | * Example: 117 | * ```javascript 118 | * // Publishing with acknowledgement 119 | * let receiptId = randomText(); 120 | * 121 | * rxStomp.waitForReceipt(receiptId, function() { 122 | * // Will be called after server acknowledges 123 | * }); 124 | * rxStomp.publish({destination: TEST.destination, headers: {receipt: receiptId}, body: msg}); 125 | * ``` 126 | * 127 | * Maps to: [Client#watchForReceipt]{@link Client#watchForReceipt} 128 | */ 129 | waitForReceipt(receiptId: string, callback: (frame: Frame) => void): void; 130 | readonly client: Client; 131 | constructor(); 132 | } 133 | -------------------------------------------------------------------------------- /dist/src/app/compatibility/stomp-state.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Part of `@stomp/ng2-stompjs`. 3 | * 4 | * **This class has been deprecated in favor of `RxStompState`. 5 | * It will be dropped `@stomp/ng2-stompjs@8.x.x`.** 6 | * 7 | * Possible states for the STOMP service 8 | */ 9 | export declare enum StompState { 10 | CLOSED = 0, 11 | TRYING = 1, 12 | CONNECTED = 2, 13 | DISCONNECTING = 3, 14 | } 15 | -------------------------------------------------------------------------------- /dist/src/app/compatibility/stomp.config.d.ts: -------------------------------------------------------------------------------- 1 | import { StompHeaders } from '@stomp/stompjs'; 2 | /** 3 | * Part of `@stomp/ng2-stompjs`. 4 | * 5 | * **This class has been deprecated in favor of {@link InjectableRxStompConfig}. 6 | * It will be dropped `@stomp/ng2-stompjs@8.x.x`.** 7 | * 8 | * Represents a configuration object for the 9 | * STOMPService to connect to. 10 | * 11 | * This name conflicts with a class of the same name in @stomp/stompjs, excluding this from the documentation. 12 | * 13 | * @internal 14 | */ 15 | export declare class StompConfig { 16 | /** 17 | * Server URL to connect to. Please refer to your STOMP broker documentation for details. 18 | * 19 | * Example: ws://127.0.0.1:15674/ws (for a RabbitMQ default setup running on localhost) 20 | * 21 | * Alternatively this parameter can be a function that returns an object similar to WebSocket 22 | * (typically SockJS instance). 23 | * 24 | * Example: 25 | * 26 | * () => { 27 | * return new SockJS('http://127.0.0.1:15674/stomp'); 28 | * } 29 | */ 30 | url: string | (() => any); 31 | /** 32 | * Headers 33 | * Typical keys: login: string, passcode: string. 34 | * host:string will neeed to be passed for virtual hosts in RabbitMQ 35 | */ 36 | headers: StompHeaders; 37 | /** How often to incoming heartbeat? 38 | * Interval in milliseconds, set to 0 to disable 39 | * 40 | * Typical value 0 - disabled 41 | */ 42 | heartbeat_in: number; 43 | /** 44 | * How often to outgoing heartbeat? 45 | * Interval in milliseconds, set to 0 to disable 46 | * 47 | * Typical value 20000 - every 20 seconds 48 | */ 49 | heartbeat_out: number; 50 | /** 51 | * Wait in milliseconds before attempting auto reconnect 52 | * Set to 0 to disable 53 | * 54 | * Typical value 5000 (5 seconds) 55 | */ 56 | reconnect_delay: number; 57 | /** Enable client debugging? */ 58 | debug: boolean; 59 | } 60 | -------------------------------------------------------------------------------- /dist/src/app/compatibility/stomp.service.d.ts: -------------------------------------------------------------------------------- 1 | import { StompConfig } from './stomp.config'; 2 | import { StompRService } from './stomp-r.service'; 3 | /** 4 | * Part of `@stomp/ng2-stompjs`. 5 | * 6 | * **This class has been deprecated in favor of {@link RxStompService} with {@link rxStompServiceFactory}. 7 | * It will be dropped `@stomp/ng2-stompjs@8.x.x`.** 8 | * 9 | * Angular2 STOMP Service using @stomp/stomp.js 10 | * 11 | * @description This service handles subscribing to a 12 | * message queue using the stomp.js library, and returns 13 | * values via the ES6 Observable specification for 14 | * asynchronous value streaming by wiring the STOMP 15 | * messages into an observable. 16 | * 17 | * If you want to manually configure and initialize the service 18 | * please use StompRService 19 | */ 20 | export declare class StompService extends StompRService { 21 | /** 22 | * Constructor 23 | * 24 | * See README and samples for configuration examples 25 | */ 26 | constructor(config: StompConfig); 27 | } 28 | -------------------------------------------------------------------------------- /dist/src/app/injectable-rx-stomp-config.d.ts: -------------------------------------------------------------------------------- 1 | import { RxStompConfig } from '@stomp/rx-stomp'; 2 | /** 3 | * Part of `@stomp/ng2-stompjs`. 4 | * 5 | * This class is Injectable version of {@link RxStompConfig} with exactly same functionality. 6 | * Please see {@link RxStompConfig} for details. 7 | * 8 | * See: {@link /guide/ng2-stompjs/ng2-stomp-with-angular7.html} 9 | * for a step-by-step guide. 10 | * 11 | * If all fields of configuration are fixed and known in advance you would typically define 12 | * a `const` and inject it using value. 13 | * 14 | * If some fields will be known by later, it can be injected using a factory function. 15 | * 16 | * Occasionally it may need to be combined with Angular's APP_INITIALIZER mechanism. 17 | */ 18 | export declare class InjectableRxStompConfig extends RxStompConfig { 19 | } 20 | -------------------------------------------------------------------------------- /dist/src/app/injectable-rx-stomp-rpc-config.d.ts: -------------------------------------------------------------------------------- 1 | import { RxStompRPCConfig } from '@stomp/rx-stomp'; 2 | /** 3 | * Part of `@stomp/ng2-stompjs`. 4 | * 5 | * Injectable version of {@link RxStompRPCConfig}. 6 | * 7 | * See guide at {@link /guide/rx-stomp/ng2-stompjs/remote-procedure-call.html} 8 | */ 9 | export declare class InjectableRxStompRPCConfig extends RxStompRPCConfig { 10 | } 11 | /** 12 | * Deprecated, use {@link InjectableRxStompRPCConfig} instead 13 | */ 14 | export declare const InjectableRxStompRpcConfig: typeof InjectableRxStompRPCConfig; 15 | -------------------------------------------------------------------------------- /dist/src/app/rx-stomp-rpc.service.d.ts: -------------------------------------------------------------------------------- 1 | import { RxStompRPC } from '@stomp/rx-stomp'; 2 | import { RxStompService } from './rx-stomp.service'; 3 | import { InjectableRxStompRPCConfig } from './injectable-rx-stomp-rpc-config'; 4 | /** 5 | * Part of `@stomp/ng2-stompjs`. 6 | * 7 | * Injectable version of {@link RxStompRPC}. 8 | * 9 | * See guide at {@link /guide/rx-stomp/ng2-stompjs/remote-procedure-call.html} 10 | */ 11 | export declare class RxStompRPCService extends RxStompRPC { 12 | /** 13 | * Create an instance, typically called by Angular Dependency Injection framework. 14 | * 15 | * @param rxStomp 16 | * @param stompRPCConfig 17 | */ 18 | constructor(rxStomp: RxStompService, stompRPCConfig?: InjectableRxStompRPCConfig); 19 | } 20 | -------------------------------------------------------------------------------- /dist/src/app/rx-stomp-service-factory.d.ts: -------------------------------------------------------------------------------- 1 | import { InjectableRxStompConfig } from './injectable-rx-stomp-config'; 2 | import { RxStompService } from './rx-stomp.service'; 3 | /** 4 | * Part of `@stomp/ng2-stompjs`. 5 | * 6 | * This is factory function that can create {@link RxStompService} 7 | * when configuration is already known. 8 | * You can use this function for defining provider for {@link RxStompService}. 9 | * {@link RxStompService} created using this function is configured and activated. 10 | * This provides the simplest mechanism to define {@link RxStompService} for Dependency Injection. 11 | * 12 | * See: {@link /guide/ng2-stompjs/ng2-stomp-with-angular7.html} 13 | * for a step-by-step guide. 14 | */ 15 | export declare function rxStompServiceFactory(rxStompConfig: InjectableRxStompConfig): RxStompService; 16 | -------------------------------------------------------------------------------- /dist/src/app/rx-stomp.service.d.ts: -------------------------------------------------------------------------------- 1 | import { RxStomp } from '@stomp/rx-stomp'; 2 | /** 3 | * Part of `@stomp/ng2-stompjs`. 4 | * 5 | * This class is Injectable version of {@link RxStomp} with exactly same functionality. 6 | * Please see {@link RxStomp} for details. 7 | * 8 | * See: {@link /guide/ng2-stompjs/ng2-stomp-with-angular7.html} 9 | * for a step-by-step guide. 10 | * 11 | * See also {@link rxStompServiceFactory}. 12 | */ 13 | export declare class RxStompService extends RxStomp { 14 | } 15 | -------------------------------------------------------------------------------- /dist/stomp-ng2-stompjs.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated bundle index. Do not edit. 3 | */ 4 | export * from './index'; 5 | -------------------------------------------------------------------------------- /dist/stomp-ng2-stompjs.metadata.json: -------------------------------------------------------------------------------- 1 | {"__symbolic":"module","version":4,"exports":[{"export":[{"name":"StompHeaders","as":"StompHeaders"}],"from":"@stomp/stompjs"}],"metadata":{"StompRService":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"@stomp/rx-stomp","name":"RxStomp","line":32,"character":35},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":31,"character":1}}],"members":{"initAndConnect":[{"__symbolic":"method"}],"disconnect":[{"__symbolic":"method"}],"publish":[{"__symbolic":"method"}],"subscribe":[{"__symbolic":"method"}],"waitForReceipt":[{"__symbolic":"method"}],"__ctor__":[{"__symbolic":"constructor"}]}},"StompService":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"StompRService"},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":23,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"StompConfig"}]}]}},"StompState":{"CLOSED":0,"TRYING":1,"CONNECTED":2,"DISCONNECTING":3},"StompConfig":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":16,"character":1}}],"members":{}},"RxStompRPCService":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"@stomp/rx-stomp","name":"RxStompRPC","line":14,"character":39},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":13,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":23,"character":5}}]],"parameters":[{"__symbolic":"reference","name":"RxStompService"},{"__symbolic":"reference","name":"InjectableRxStompRPCConfig"}]}]}},"RxStompService":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"@stomp/rx-stomp","name":"RxStomp","line":15,"character":36},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":14,"character":1}}],"members":{}},"InjectableRxStompConfig":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"@stomp/rx-stomp","name":"RxStompConfig","line":20,"character":45},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":19,"character":1}}],"members":{}},"InjectableRxStompRPCConfig":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"@stomp/rx-stomp","name":"RxStompRPCConfig","line":11,"character":48},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":10,"character":1}}],"members":{}},"InjectableRxStompRpcConfig":{"__symbolic":"reference","name":"InjectableRxStompRPCConfig"},"rxStompServiceFactory":{"__symbolic":"function"}},"origins":{"StompRService":"./src/app/compatibility/stomp-r.service","StompService":"./src/app/compatibility/stomp.service","StompState":"./src/app/compatibility/stomp-state","StompConfig":"./src/app/compatibility/stomp.config","RxStompRPCService":"./src/app/rx-stomp-rpc.service","RxStompService":"./src/app/rx-stomp.service","InjectableRxStompConfig":"./src/app/injectable-rx-stomp-config","InjectableRxStompRPCConfig":"./src/app/injectable-rx-stomp-rpc-config","InjectableRxStompRpcConfig":"./src/app/injectable-rx-stomp-rpc-config","rxStompServiceFactory":"./src/app/rx-stomp-service-factory"},"importAs":"@stomp/ng2-stompjs"} -------------------------------------------------------------------------------- /index.ts: -------------------------------------------------------------------------------- 1 | export { StompRService } from './src/app/compatibility/stomp-r.service'; 2 | export { StompService } from './src/app/compatibility/stomp.service'; 3 | export { StompHeaders } from './src/app/compatibility/stomp-headers'; 4 | export { StompState } from './src/app/compatibility/stomp-state'; 5 | export { StompConfig } from './src/app/compatibility/stomp.config'; 6 | 7 | export { RxStompRPCService } from './src/app/rx-stomp-rpc.service'; 8 | export { RxStompService } from './src/app/rx-stomp.service'; 9 | export { InjectableRxStompConfig } from './src/app/injectable-rx-stomp-config'; 10 | export { InjectableRxStompRPCConfig } from './src/app/injectable-rx-stomp-rpc-config'; 11 | export { InjectableRxStompRpcConfig } from './src/app/injectable-rx-stomp-rpc-config'; 12 | export { rxStompServiceFactory } from './src/app/rx-stomp-service-factory'; 13 | -------------------------------------------------------------------------------- /ng-package.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./node_modules/ng-packagr/ng-package.schema.json", 3 | "lib": { 4 | "entryFile": "index.ts", 5 | "umdModuleIds": { 6 | "@stomp/rx-stomp": "RxStomp" 7 | } 8 | }, 9 | "whitelistedNonPeerDependencies": ["@stomp/rx-stomp"] 10 | } 11 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@stomp/ng2-stompjs", 3 | "version": "8.0.0", 4 | "scripts": { 5 | "dist": "ng-packagr -p ng-package.json", 6 | "test": "ng test", 7 | "cleanup": "rm -rf dist docs", 8 | "lint": "ng lint", 9 | "prettier": "prettier --write ." 10 | }, 11 | "repository": { 12 | "type": "git", 13 | "url": "https://github.com/stomp-js/ng2-stompjs" 14 | }, 15 | "author": { 16 | "name": "Deepak Kumar", 17 | "email": "deepak@kreatio.com" 18 | }, 19 | "keywords": [ 20 | "stompjs", 21 | "angular2", 22 | "angular4", 23 | "angular5", 24 | "rabbitmq", 25 | "websocket", 26 | "angular", 27 | "stomp" 28 | ], 29 | "license": "Apache-2.0", 30 | "bugs": { 31 | "url": "https://github.com/stomp-js/ng2-stompjs/issues" 32 | }, 33 | "main": "./index.ts", 34 | "dependencies": { 35 | "@stomp/rx-stomp": "^1.0.0 >=1.0.1" 36 | }, 37 | "devDependencies": { 38 | "@angular-devkit/build-angular": "~0.6.0", 39 | "@angular/animations": "^6.0.0", 40 | "@angular/cli": "~6.0.0", 41 | "@angular/common": "^6.0.0", 42 | "@angular/compiler": "^6.0.0", 43 | "@angular/compiler-cli": "^6.0.0", 44 | "@angular/core": "^6.0.0", 45 | "@angular/forms": "^6.0.0", 46 | "@angular/http": "^6.0.0", 47 | "@angular/language-service": "^6.0.0", 48 | "@angular/platform-browser": "^6.0.0", 49 | "@angular/platform-browser-dynamic": "^6.0.0", 50 | "@angular/router": "^6.0.0", 51 | "@types/jasmine": "~2.8.6", 52 | "@types/jasminewd2": "~2.0.3", 53 | "@types/node": "~8.9.4", 54 | "codelyzer": "~4.2.1", 55 | "core-js": "^2.5.4", 56 | "jasmine-core": "~2.99.1", 57 | "jasmine-spec-reporter": "~4.2.1", 58 | "karma": "^3.0.0", 59 | "karma-chrome-launcher": "~2.2.0", 60 | "karma-coverage-istanbul-reporter": "~1.4.2", 61 | "karma-jasmine": "~1.1.1", 62 | "karma-jasmine-html-reporter": "^0.2.2", 63 | "karma-summary-reporter": "^1.5.1", 64 | "ng-packagr": "^4.1.1", 65 | "prettier": "^2.1.2", 66 | "protractor": "^5.4.1", 67 | "rxjs": "^6.0.0", 68 | "ts-node": "~5.0.1", 69 | "tslint": "~5.9.1", 70 | "tslint-config-prettier": "^1.18.0", 71 | "typescript": "~2.7.2", 72 | "zone.js": "^0.8.26" 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /rabbitmq/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM rabbitmq:3.7.7-alpine 2 | 3 | run rabbitmq-plugins enable --offline rabbitmq_web_stomp 4 | 5 | run \ 6 | echo 'loopback_users.guest = false' >> /etc/rabbitmq/rabbitmq.conf && \ 7 | echo 'web_stomp.ws_frame = binary' >> /etc/rabbitmq/rabbitmq.conf 8 | 9 | EXPOSE 15674 10 | -------------------------------------------------------------------------------- /src/app/compatibility/stomp-headers.ts: -------------------------------------------------------------------------------- 1 | export { StompHeaders } from '@stomp/stompjs'; 2 | -------------------------------------------------------------------------------- /src/app/compatibility/stomp-r.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | 3 | import { RxStomp, RxStompConfig, RxStompState } from '@stomp/rx-stomp'; 4 | 5 | import { publishParams, Client, Message, Frame } from '@stomp/stompjs'; 6 | 7 | import { BehaviorSubject, Observable, Subject } from 'rxjs'; 8 | import { map } from 'rxjs/operators'; 9 | 10 | import { StompState } from './stomp-state'; 11 | import { StompHeaders } from './stomp-headers'; 12 | import { StompConfig } from './stomp.config'; 13 | 14 | /** 15 | * Part of `@stomp/ng2-stompjs`. 16 | * 17 | * **This class has been deprecated in favor of {@link RxStompService}. 18 | * It will be dropped `@stomp/ng2-stompjs@8.x.x`.** 19 | * 20 | * Angular2 STOMP Raw Service using @stomp/stomp.js 21 | * 22 | * You will only need the public properties and 23 | * methods listed unless you are an advanced user. This service handles subscribing to a 24 | * message queue using the stomp.js library, and returns 25 | * values via the ES6 Observable specification for 26 | * asynchronous value streaming by wiring the STOMP 27 | * messages into an observable. 28 | * 29 | * If you will like to pass the configuration as a dependency, 30 | * please use StompService class. 31 | */ 32 | @Injectable() 33 | export class StompRService extends RxStomp { 34 | /** 35 | * State of the STOMPService 36 | * 37 | * It is a BehaviorSubject and will emit current status immediately. This will typically get 38 | * used to show current status to the end user. 39 | */ 40 | public state: BehaviorSubject; 41 | 42 | private static _mapStompState(st: RxStompState): StompState { 43 | if (st === RxStompState.CONNECTING) { 44 | return StompState.TRYING; 45 | } 46 | if (st === RxStompState.OPEN) { 47 | return StompState.CONNECTED; 48 | } 49 | if (st === RxStompState.CLOSING) { 50 | return StompState.DISCONNECTING; 51 | } 52 | if (st === RxStompState.CLOSED) { 53 | return StompState.CLOSED; 54 | } 55 | } 56 | 57 | /** 58 | * Will trigger when connection is established. Use this to carry out initialization. 59 | * It will trigger every time a (re)connection occurs. If it is already connected 60 | * it will trigger immediately. You can safely ignore the value, as it will always be 61 | * StompState.CONNECTED 62 | */ 63 | get connectObservable(): Observable { 64 | return this.connected$.pipe( 65 | map( 66 | (st: RxStompState): StompState => { 67 | return StompRService._mapStompState(st); 68 | } 69 | ) 70 | ); 71 | } 72 | 73 | /** 74 | * Provides headers from most recent connection to the server as return by the CONNECTED 75 | * frame. 76 | * If the STOMP connection has already been established it will trigger immediately. 77 | * It will additionally trigger in event of reconnection, the value will be set of headers from 78 | * the recent server response. 79 | */ 80 | get serverHeadersObservable(): Observable { 81 | return this.serverHeaders$; 82 | } 83 | 84 | /** 85 | * Will emit all messages to the default queue (any message that are not handled by a subscription) 86 | */ 87 | get defaultMessagesObservable(): Subject { 88 | return this.unhandledMessage$; 89 | } 90 | 91 | /** 92 | * Will emit all receipts 93 | */ 94 | get receiptsObservable(): Subject { 95 | return this.unhandledReceipts$; 96 | } 97 | 98 | /** 99 | * Will trigger when an error occurs. This Subject can be used to handle errors from 100 | * the stomp broker. 101 | */ 102 | get errorSubject(): Subject { 103 | return this.stompErrors$; 104 | } 105 | 106 | /** Set configuration */ 107 | set config(config: StompConfig) { 108 | const rxStompConfig: RxStompConfig = {}; 109 | 110 | if (typeof config.url === 'string') { 111 | rxStompConfig.brokerURL = config.url; 112 | } else { 113 | rxStompConfig.webSocketFactory = config.url; 114 | } 115 | 116 | // Configure client heart-beating 117 | rxStompConfig.heartbeatIncoming = config.heartbeat_in; 118 | rxStompConfig.heartbeatOutgoing = config.heartbeat_out; 119 | 120 | // Auto reconnect 121 | rxStompConfig.reconnectDelay = config.reconnect_delay; 122 | 123 | if (config.debug) { 124 | rxStompConfig.debug = (str: string): void => { 125 | console.log(new Date(), str); 126 | }; 127 | } 128 | 129 | rxStompConfig.connectHeaders = config.headers; 130 | 131 | this.configure(rxStompConfig); 132 | } 133 | /** 134 | * It will connect to the STOMP broker. 135 | */ 136 | public initAndConnect(): void { 137 | // disconnect if connected 138 | this.deactivate(); 139 | 140 | // Attempt connection, passing in a callback 141 | this.activate(); 142 | } 143 | 144 | /** 145 | * It will disconnect from the STOMP broker. 146 | */ 147 | public disconnect(): void { 148 | this.deactivate(); 149 | } 150 | 151 | /** 152 | * It will send a message to a named destination. The message must be `string`. 153 | * 154 | * The message will get locally queued if the STOMP broker is not connected. It will attempt to 155 | * publish queued messages as soon as the broker gets connected. 156 | * 157 | * @param queueName 158 | * @param message 159 | * @param headers 160 | */ 161 | public publish( 162 | queueName: string | publishParams, 163 | message?: string, 164 | headers: StompHeaders = {} 165 | ): void { 166 | if (typeof queueName === 'string') { 167 | super.publish({ 168 | destination: queueName as string, 169 | body: message, 170 | headers, 171 | }); 172 | } else { 173 | const pubParams: publishParams = queueName; 174 | super.publish(pubParams); 175 | } 176 | } 177 | 178 | /** 179 | * It will subscribe to server message queues 180 | * 181 | * This method can be safely called even if the STOMP broker is not connected. 182 | * If the underlying STOMP connection drops and reconnects, it will resubscribe automatically. 183 | * 184 | * If a header field 'ack' is not explicitly passed, 'ack' will be set to 'auto'. If you 185 | * do not understand what it means, please leave it as is. 186 | * 187 | * Note that when working with temporary queues where the subscription request 188 | * creates the 189 | * underlying queue, messages might be missed during reconnect. This issue is not specific 190 | * to this library but the way STOMP brokers are designed to work. 191 | * 192 | * @param queueName 193 | * @param headers 194 | */ 195 | public subscribe( 196 | queueName: string, 197 | headers: StompHeaders = {} 198 | ): Observable { 199 | return this.watch(queueName, headers); 200 | } 201 | 202 | /** 203 | * STOMP brokers may carry out operation asynchronously and allow requesting for acknowledgement. 204 | * To request an acknowledgement, a `receipt` header needs to be sent with the actual request. 205 | * The value (say receipt-id) for this header needs to be unique for each use. Typically a sequence, a UUID, a 206 | * random number or a combination may be used. 207 | * 208 | * A complaint broker will send a RECEIPT frame when an operation has actually been completed. 209 | * The operation needs to be matched based in the value of the receipt-id. 210 | * 211 | * This method allow watching for a receipt and invoke the callback 212 | * when corresponding receipt has been received. 213 | * 214 | * The actual {@link Frame} 215 | * will be passed as parameter to the callback. 216 | * 217 | * Example: 218 | * ```javascript 219 | * // Publishing with acknowledgement 220 | * let receiptId = randomText(); 221 | * 222 | * rxStomp.waitForReceipt(receiptId, function() { 223 | * // Will be called after server acknowledges 224 | * }); 225 | * rxStomp.publish({destination: TEST.destination, headers: {receipt: receiptId}, body: msg}); 226 | * ``` 227 | * 228 | * Maps to: [Client#watchForReceipt]{@link Client#watchForReceipt} 229 | */ 230 | public waitForReceipt( 231 | receiptId: string, 232 | callback: (frame: Frame) => void 233 | ): void { 234 | super.watchForReceipt(receiptId, callback); 235 | } 236 | 237 | get client(): Client { 238 | return this._stompClient; 239 | } 240 | 241 | public constructor() { 242 | super(); 243 | 244 | this.state = new BehaviorSubject(StompState.CLOSED); 245 | 246 | this.connectionState$.subscribe((st: RxStompState) => { 247 | this.state.next(StompRService._mapStompState(st)); 248 | }); 249 | } 250 | } 251 | -------------------------------------------------------------------------------- /src/app/compatibility/stomp-state.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Part of `@stomp/ng2-stompjs`. 3 | * 4 | * **This class has been deprecated in favor of `RxStompState`. 5 | * It will be dropped `@stomp/ng2-stompjs@8.x.x`.** 6 | * 7 | * Possible states for the STOMP service 8 | */ 9 | export enum StompState { 10 | CLOSED, 11 | TRYING, 12 | CONNECTED, 13 | DISCONNECTING, 14 | } 15 | -------------------------------------------------------------------------------- /src/app/compatibility/stomp.config.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { StompHeaders } from '@stomp/stompjs'; 3 | 4 | /** 5 | * Part of `@stomp/ng2-stompjs`. 6 | * 7 | * **This class has been deprecated in favor of {@link InjectableRxStompConfig}. 8 | * It will be dropped `@stomp/ng2-stompjs@8.x.x`.** 9 | * 10 | * Represents a configuration object for the 11 | * STOMPService to connect to. 12 | * 13 | * This name conflicts with a class of the same name in @stomp/stompjs, excluding this from the documentation. 14 | * 15 | * @internal 16 | */ 17 | @Injectable() 18 | export class StompConfig { 19 | /** 20 | * Server URL to connect to. Please refer to your STOMP broker documentation for details. 21 | * 22 | * Example: ws://127.0.0.1:15674/ws (for a RabbitMQ default setup running on localhost) 23 | * 24 | * Alternatively this parameter can be a function that returns an object similar to WebSocket 25 | * (typically SockJS instance). 26 | * 27 | * Example: 28 | * 29 | * () => { 30 | * return new SockJS('http://127.0.0.1:15674/stomp'); 31 | * } 32 | */ 33 | url: string | (() => any); 34 | 35 | /** 36 | * Headers 37 | * Typical keys: login: string, passcode: string. 38 | * host:string will neeed to be passed for virtual hosts in RabbitMQ 39 | */ 40 | headers: StompHeaders; 41 | 42 | /** How often to incoming heartbeat? 43 | * Interval in milliseconds, set to 0 to disable 44 | * 45 | * Typical value 0 - disabled 46 | */ 47 | heartbeat_in: number; 48 | 49 | /** 50 | * How often to outgoing heartbeat? 51 | * Interval in milliseconds, set to 0 to disable 52 | * 53 | * Typical value 20000 - every 20 seconds 54 | */ 55 | heartbeat_out: number; 56 | 57 | /** 58 | * Wait in milliseconds before attempting auto reconnect 59 | * Set to 0 to disable 60 | * 61 | * Typical value 5000 (5 seconds) 62 | */ 63 | reconnect_delay: number; 64 | 65 | /** Enable client debugging? */ 66 | debug: boolean; 67 | } 68 | -------------------------------------------------------------------------------- /src/app/compatibility/stomp.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | 3 | import { StompConfig } from './stomp.config'; 4 | 5 | import { StompRService } from './stomp-r.service'; 6 | 7 | /** 8 | * Part of `@stomp/ng2-stompjs`. 9 | * 10 | * **This class has been deprecated in favor of {@link RxStompService} with {@link rxStompServiceFactory}. 11 | * It will be dropped `@stomp/ng2-stompjs@8.x.x`.** 12 | * 13 | * Angular2 STOMP Service using @stomp/stomp.js 14 | * 15 | * @description This service handles subscribing to a 16 | * message queue using the stomp.js library, and returns 17 | * values via the ES6 Observable specification for 18 | * asynchronous value streaming by wiring the STOMP 19 | * messages into an observable. 20 | * 21 | * If you want to manually configure and initialize the service 22 | * please use StompRService 23 | */ 24 | @Injectable() 25 | export class StompService extends StompRService { 26 | /** 27 | * Constructor 28 | * 29 | * See README and samples for configuration examples 30 | */ 31 | public constructor(config: StompConfig) { 32 | super(); 33 | 34 | this.config = config; 35 | this.initAndConnect(); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/app/injectable-rx-stomp-config.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { RxStompConfig } from '@stomp/rx-stomp'; 3 | 4 | /** 5 | * Part of `@stomp/ng2-stompjs`. 6 | * 7 | * This class is Injectable version of {@link RxStompConfig} with exactly same functionality. 8 | * Please see {@link RxStompConfig} for details. 9 | * 10 | * See: {@link /guide/ng2-stompjs/ng2-stomp-with-angular7.html} 11 | * for a step-by-step guide. 12 | * 13 | * If all fields of configuration are fixed and known in advance you would typically define 14 | * a `const` and inject it using value. 15 | * 16 | * If some fields will be known by later, it can be injected using a factory function. 17 | * 18 | * Occasionally it may need to be combined with Angular's APP_INITIALIZER mechanism. 19 | */ 20 | @Injectable() 21 | export class InjectableRxStompConfig extends RxStompConfig {} 22 | -------------------------------------------------------------------------------- /src/app/injectable-rx-stomp-rpc-config.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { RxStompRPCConfig } from '@stomp/rx-stomp'; 3 | 4 | /** 5 | * Part of `@stomp/ng2-stompjs`. 6 | * 7 | * Injectable version of {@link RxStompRPCConfig}. 8 | * 9 | * See guide at {@link /guide/rx-stomp/ng2-stompjs/remote-procedure-call.html} 10 | */ 11 | @Injectable() 12 | export class InjectableRxStompRPCConfig extends RxStompRPCConfig {} 13 | 14 | // Backward compatibility 15 | /** 16 | * Deprecated, use {@link InjectableRxStompRPCConfig} instead 17 | */ 18 | export const InjectableRxStompRpcConfig = InjectableRxStompRPCConfig; 19 | -------------------------------------------------------------------------------- /src/app/rx-stomp-rpc.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable, Optional } from '@angular/core'; 2 | 3 | import { RxStompRPC } from '@stomp/rx-stomp'; 4 | import { RxStompService } from './rx-stomp.service'; 5 | import { InjectableRxStompRPCConfig } from './injectable-rx-stomp-rpc-config'; 6 | 7 | /** 8 | * Part of `@stomp/ng2-stompjs`. 9 | * 10 | * Injectable version of {@link RxStompRPC}. 11 | * 12 | * See guide at {@link /guide/rx-stomp/ng2-stompjs/remote-procedure-call.html} 13 | */ 14 | @Injectable() 15 | export class RxStompRPCService extends RxStompRPC { 16 | /** 17 | * Create an instance, typically called by Angular Dependency Injection framework. 18 | * 19 | * @param rxStomp 20 | * @param stompRPCConfig 21 | */ 22 | constructor( 23 | rxStomp: RxStompService, 24 | @Optional() stompRPCConfig?: InjectableRxStompRPCConfig 25 | ) { 26 | super(rxStomp, stompRPCConfig); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/app/rx-stomp-service-factory.ts: -------------------------------------------------------------------------------- 1 | import { InjectableRxStompConfig } from './injectable-rx-stomp-config'; 2 | import { RxStompService } from './rx-stomp.service'; 3 | 4 | /** 5 | * Part of `@stomp/ng2-stompjs`. 6 | * 7 | * This is factory function that can create {@link RxStompService} 8 | * when configuration is already known. 9 | * You can use this function for defining provider for {@link RxStompService}. 10 | * {@link RxStompService} created using this function is configured and activated. 11 | * This provides the simplest mechanism to define {@link RxStompService} for Dependency Injection. 12 | * 13 | * See: {@link /guide/ng2-stompjs/ng2-stomp-with-angular7.html} 14 | * for a step-by-step guide. 15 | */ 16 | export function rxStompServiceFactory( 17 | rxStompConfig: InjectableRxStompConfig 18 | ): RxStompService { 19 | const rxStompService = new RxStompService(); 20 | 21 | rxStompService.configure(rxStompConfig); 22 | rxStompService.activate(); 23 | 24 | return rxStompService; 25 | } 26 | -------------------------------------------------------------------------------- /src/app/rx-stomp.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { RxStomp } from '@stomp/rx-stomp'; 3 | 4 | /** 5 | * Part of `@stomp/ng2-stompjs`. 6 | * 7 | * This class is Injectable version of {@link RxStomp} with exactly same functionality. 8 | * Please see {@link RxStomp} for details. 9 | * 10 | * See: {@link /guide/ng2-stompjs/ng2-stomp-with-angular7.html} 11 | * for a step-by-step guide. 12 | * 13 | * See also {@link rxStompServiceFactory}. 14 | */ 15 | @Injectable() 16 | export class RxStompService extends RxStomp {} 17 | -------------------------------------------------------------------------------- /src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true, 3 | }; 4 | -------------------------------------------------------------------------------- /src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build ---prod` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false, 7 | }; 8 | 9 | /* 10 | * In development mode, to ignore zone related error stack frames such as 11 | * `zone.run`, `zoneDelegate.invokeTask` for easier debugging, you can 12 | * import the following file, but please comment it out in production mode 13 | * because it will have performance impact when throw error 14 | */ 15 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI. 16 | -------------------------------------------------------------------------------- /src/karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration file, see link for more information 2 | // https://karma-runner.github.io/1.0/config/configuration-file.html 3 | 4 | module.exports = function (config) { 5 | config.set({ 6 | basePath: '', 7 | frameworks: ['jasmine', '@angular-devkit/build-angular'], 8 | plugins: [ 9 | require('karma-jasmine'), 10 | require('karma-chrome-launcher'), 11 | require('karma-jasmine-html-reporter'), 12 | require('karma-coverage-istanbul-reporter'), 13 | require('karma-summary-reporter'), 14 | require('@angular-devkit/build-angular/plugins/karma'), 15 | ], 16 | client: { 17 | clearContext: false, // leave Jasmine Spec Runner output visible in browser 18 | }, 19 | coverageIstanbulReporter: { 20 | dir: require('path').join(__dirname, '../coverage'), 21 | reports: ['html', 'lcovonly'], 22 | fixWebpackSourcePaths: true, 23 | }, 24 | reporters: ['progress', 'kjhtml', 'summary'], 25 | port: 9876, 26 | colors: true, 27 | logLevel: config.LOG_INFO, 28 | autoWatch: true, 29 | // start these browsers 30 | // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher 31 | browsers: ['ChromeNoSandboxHeadless'], 32 | 33 | customLaunchers: { 34 | // See https://github.com/karma-runner/karma/issues/2603 35 | ChromeNoSandboxHeadless: { 36 | base: 'Chrome', 37 | flags: [ 38 | '--no-sandbox', 39 | // See https://chromium.googlesource.com/chromium/src/+/lkgr/headless/README.md 40 | '--headless', 41 | '--disable-gpu', 42 | // Without a remote debugging port, Google Chrome exits immediately. 43 | ' --remote-debugging-port=9222', 44 | ], 45 | }, 46 | }, 47 | singleRun: true, 48 | }); 49 | }; 50 | -------------------------------------------------------------------------------- /src/polyfills.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This file includes polyfills needed by Angular and is loaded before the app. 3 | * You can add your own extra polyfills to this file. 4 | * 5 | * This file is divided into 2 sections: 6 | * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. 7 | * 2. Application imports. Files imported after ZoneJS that should be loaded before your main 8 | * file. 9 | * 10 | * The current setup is for so-called "evergreen" browsers; the last versions of browsers that 11 | * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), 12 | * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. 13 | * 14 | * Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html 15 | */ 16 | 17 | /*************************************************************************************************** 18 | * BROWSER POLYFILLS 19 | */ 20 | 21 | /** IE9, IE10 and IE11 requires all of the following polyfills. **/ 22 | // import 'core-js/es6/symbol'; 23 | // import 'core-js/es6/object'; 24 | // import 'core-js/es6/function'; 25 | // import 'core-js/es6/parse-int'; 26 | // import 'core-js/es6/parse-float'; 27 | // import 'core-js/es6/number'; 28 | // import 'core-js/es6/math'; 29 | // import 'core-js/es6/string'; 30 | // import 'core-js/es6/date'; 31 | // import 'core-js/es6/array'; 32 | // import 'core-js/es6/regexp'; 33 | // import 'core-js/es6/map'; 34 | // import 'core-js/es6/weak-map'; 35 | // import 'core-js/es6/set'; 36 | 37 | /** IE10 and IE11 requires the following for NgClass support on SVG elements */ 38 | // import 'classlist.js'; // Run `npm install --save classlist.js`. 39 | 40 | /** IE10 and IE11 requires the following for the Reflect API. */ 41 | // import 'core-js/es6/reflect'; 42 | 43 | /** Evergreen browsers require these. **/ 44 | // Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove. 45 | import 'core-js/es7/reflect'; 46 | 47 | /** 48 | * Web Animations `@angular/platform-browser/animations` 49 | * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari. 50 | * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0). 51 | **/ 52 | // import 'web-animations-js'; // Run `npm install --save web-animations-js`. 53 | 54 | /** 55 | * By default, zone.js will patch all possible macroTask and DomEvents 56 | * user can disable parts of macroTask/DomEvents patch by setting following flags 57 | */ 58 | 59 | // (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame 60 | // (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick 61 | // (window as any).__zone_symbol__BLACK_LISTED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames 62 | 63 | /* 64 | * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js 65 | * with the following flag, it will bypass `zone.js` patch for IE/Edge 66 | */ 67 | // (window as any).__Zone_enable_cross_context_check = true; 68 | 69 | /*************************************************************************************************** 70 | * Zone JS is required by default for Angular itself. 71 | */ 72 | import 'zone.js/dist/zone'; // Included with Angular CLI. 73 | 74 | /*************************************************************************************************** 75 | * APPLICATION IMPORTS 76 | */ 77 | -------------------------------------------------------------------------------- /src/specs/app/services/compatibility/helpers.ts: -------------------------------------------------------------------------------- 1 | /* tslint:disable:no-unused-variable */ 2 | 3 | // Helper functions 4 | import { StompRService, StompState } from '../../../../../'; 5 | 6 | export function ensureStompConnected(stompService: StompRService, done) { 7 | stompService.connectObservable.subscribe((state: StompState) => { 8 | done(); 9 | }); 10 | } 11 | 12 | export function ensureStompRDisconnected(stompService: StompRService, done) { 13 | stompService.state.subscribe((state: StompState) => { 14 | if (state === StompState.CLOSED) { 15 | done(); 16 | } 17 | }); 18 | } 19 | 20 | export function disconnetStompRAndEnsure(stompService: StompRService, done) { 21 | stompService.disconnect(); 22 | ensureStompRDisconnected(stompService, done); 23 | } 24 | -------------------------------------------------------------------------------- /src/specs/app/services/compatibility/stomp-queue.operations.spec.ts: -------------------------------------------------------------------------------- 1 | /* tslint:disable:no-unused-variable */ 2 | 3 | import { map } from 'rxjs/operators'; 4 | import { StompService } from '../../../../../'; 5 | import { defaultConfig, stompServiceFactory } from './stomp.service.factory'; 6 | import { ensureStompConnected, disconnetStompRAndEnsure } from './helpers'; 7 | import { Subscription } from 'rxjs'; 8 | 9 | describe('StompService Queues', () => { 10 | let stompService: StompService; 11 | const stompConfig = defaultConfig(); 12 | 13 | // Wait till STOMP Service is actually connected 14 | beforeEach(done => { 15 | jasmine.DEFAULT_TIMEOUT_INTERVAL = 5000; 16 | 17 | stompService = stompServiceFactory(stompConfig); 18 | ensureStompConnected(stompService, done); 19 | }); 20 | 21 | // Disconnect and wait till it actually disconnects 22 | afterEach(done => { 23 | disconnetStompRAndEnsure(stompService, done); 24 | stompService = null; 25 | }); 26 | 27 | describe('should handle two simultaneous subscriptions', () => { 28 | const queueName1 = '/topic/ng-demo-sub01'; 29 | const queueName2 = '/topic/ng-demo-sub02'; 30 | 31 | let queSubscription1: Subscription; 32 | let queSubscription2: Subscription; 33 | 34 | const handlers = { 35 | handler1: () => {}, 36 | handler2: () => {}, 37 | }; 38 | 39 | let spyHandler1: jasmine.Spy; 40 | let spyHandler2: jasmine.Spy; 41 | 42 | beforeEach(() => { 43 | spyHandler1 = spyOn(handlers, 'handler1'); 44 | spyHandler2 = spyOn(handlers, 'handler2'); 45 | }); 46 | 47 | // Subscribe to both queues 48 | beforeEach(done => { 49 | queSubscription1 = stompService 50 | .subscribe(queueName1) 51 | .pipe(map(message => message.body)) 52 | .subscribe(spyHandler1); 53 | 54 | queSubscription2 = stompService 55 | .subscribe(queueName2) 56 | .pipe(map(message => message.body)) 57 | .subscribe(spyHandler2); 58 | 59 | setTimeout(() => { 60 | done(); 61 | }, 100); 62 | }); 63 | 64 | // Send one message to each queue and verify that these are received in respective subscriptions 65 | beforeEach(done => { 66 | stompService.publish(queueName1, 'Message 01-01'); 67 | stompService.publish(queueName2, 'Message 02-01'); 68 | 69 | setTimeout(() => { 70 | expect(spyHandler1).toHaveBeenCalledWith('Message 01-01'); 71 | expect(spyHandler2).toHaveBeenCalledWith('Message 02-01'); 72 | 73 | done(); 74 | }, 100); 75 | }); 76 | 77 | it('should receive message in correct queue', () => { 78 | // It is ensured by all beforeEach blocks 79 | expect(true).toBe(true); 80 | }); 81 | 82 | describe('unsubscribe both queues', () => { 83 | beforeEach(done => { 84 | queSubscription1.unsubscribe(); 85 | queSubscription2.unsubscribe(); 86 | setTimeout(() => { 87 | done(); 88 | }, 100); 89 | }); 90 | 91 | it('should not receive message in any of the queues', done => { 92 | stompService.publish(queueName1, 'Message 01-02'); 93 | stompService.publish(queueName2, 'Message 02-02'); 94 | 95 | setTimeout(() => { 96 | expect(spyHandler1.calls.count()).toBe(1); 97 | expect(spyHandler2.calls.count()).toBe(1); 98 | 99 | done(); 100 | }, 100); 101 | }); 102 | }); 103 | }); 104 | }); 105 | -------------------------------------------------------------------------------- /src/specs/app/services/compatibility/stomp-r.service.spec.ts: -------------------------------------------------------------------------------- 1 | /* tslint:disable:no-unused-variable */ 2 | 3 | import { StompRService, StompState, StompConfig } from '../../../../../'; 4 | 5 | import { defaultConfig, MyStompRService } from './stomp.service.factory'; 6 | import { 7 | ensureStompConnected, 8 | disconnetStompRAndEnsure, 9 | ensureStompRDisconnected, 10 | } from './helpers'; 11 | 12 | describe('StompRService', () => { 13 | let stompService: MyStompRService; 14 | const stompConfig: StompConfig = defaultConfig(); 15 | 16 | beforeEach(() => { 17 | jasmine.DEFAULT_TIMEOUT_INTERVAL = 5000; 18 | }); 19 | 20 | // Wait till STOMP Service is actually connected 21 | beforeEach(done => { 22 | stompService = new MyStompRService(); 23 | stompService.config = stompConfig; 24 | stompService.initAndConnect(); 25 | ensureStompConnected(stompService, done); 26 | }); 27 | 28 | // Disconnect and wait till it actually disconnects 29 | afterEach(done => { 30 | ensureStompRDisconnected(stompService, done); 31 | stompService = null; 32 | }); 33 | 34 | describe('should disconnect', () => { 35 | // Ask service to disconnect and wait for 500 ms (more than double 36 | // of reconnect delay) 37 | beforeEach(done => { 38 | stompService.disconnect(); 39 | setTimeout(() => { 40 | done(); 41 | }, 500); 42 | }); 43 | 44 | it('and not reconnect', () => { 45 | expect(stompService.state.getValue()).toEqual(StompState.CLOSED); 46 | }); 47 | }); 48 | 49 | describe('should disconnect even when underlying connection is not there', () => { 50 | // Simulate error on Websocket and wait for while and call disconnect 51 | beforeEach(done => { 52 | disconnetStompRAndEnsure(stompService, done); 53 | }); 54 | 55 | // Ask service to disconnect and wait for 500 ms (more than double 56 | // of reconnect delay) 57 | beforeEach(done => { 58 | stompService.disconnect(); 59 | setTimeout(() => { 60 | done(); 61 | }, 500); 62 | }); 63 | 64 | it('and not reconnect', () => { 65 | expect(stompService.state.getValue()).not.toEqual(StompState.CONNECTED); 66 | }); 67 | }); 68 | }); 69 | -------------------------------------------------------------------------------- /src/specs/app/services/compatibility/stomp.service.factory.ts: -------------------------------------------------------------------------------- 1 | /* tslint:disable:no-unused-variable */ 2 | 3 | import { StompRService, StompService, StompConfig } from '../../../../../'; 4 | import * as SockJS from 'sockjs-client'; 5 | 6 | export function socketProvider() { 7 | // See below (url property of defaultConfig) 8 | return new SockJS('http://127.0.0.1:15674/stomp'); 9 | } 10 | 11 | export function defaultConfig(): StompConfig { 12 | return { 13 | // Which server? 14 | url: 'ws://127.0.0.1:15674/ws', 15 | 16 | // Comment above and uncomment below to test with SockJS 17 | // url: socketProvider, 18 | 19 | // Headers 20 | // Typical keys: login, passcode, host 21 | headers: { 22 | login: 'guest', 23 | passcode: 'guest', 24 | }, 25 | 26 | // How often to heartbeat? 27 | // Interval in milliseconds, set to 0 to disable 28 | heartbeat_in: 0, // Typical value 0 - disabled 29 | heartbeat_out: 0, // Typical value 20000 - every 20 seconds 30 | 31 | // Wait in milliseconds before attempting auto reconnect 32 | // Set to 0 to disable 33 | // Typical value 5000 (5 seconds) 34 | reconnect_delay: 200, 35 | 36 | // Will log diagnostics on console 37 | debug: true, 38 | }; 39 | } 40 | 41 | export class MyStompService extends StompService { 42 | constructor(private _conf: StompConfig) { 43 | super(_conf); 44 | } 45 | 46 | /** 47 | * This method closes the underlying WebSocket, simulating a close due to an error 48 | */ 49 | public forceDisconnect(): void { 50 | this.client.forceDisconnect(); 51 | } 52 | } 53 | 54 | export function stompServiceFactory(_conf: StompConfig) { 55 | return new MyStompService(_conf); 56 | } 57 | 58 | export class MyStompRService extends StompRService { 59 | /** 60 | * This method closes the underlying WebSocket, simulating a close due to an error 61 | */ 62 | public forceDisconnect(): void { 63 | this.client.forceDisconnect(); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /src/specs/app/services/compatibility/stomp.service.spec.ts: -------------------------------------------------------------------------------- 1 | /* tslint:disable:no-unused-variable */ 2 | 3 | import { filter } from 'rxjs/operators'; 4 | import { StompService, StompState, StompHeaders } from '../../../../../'; 5 | 6 | import { 7 | defaultConfig, 8 | MyStompService, 9 | stompServiceFactory, 10 | } from './stomp.service.factory'; 11 | import { Message } from '@stomp/stompjs'; 12 | import { ensureStompConnected, disconnetStompRAndEnsure } from './helpers'; 13 | 14 | describe('StompService', () => { 15 | let stompService: StompService; 16 | const stompConfig = defaultConfig(); 17 | 18 | // Wait till STOMP Service is actually connected 19 | beforeEach(() => { 20 | stompService = stompServiceFactory(stompConfig); 21 | jasmine.DEFAULT_TIMEOUT_INTERVAL = 5000; 22 | }); 23 | 24 | // Disconnect and wait till it actually disconnects 25 | afterEach(done => { 26 | disconnetStompRAndEnsure(stompService, done); 27 | stompService = null; 28 | }); 29 | 30 | describe('Simple operations', () => { 31 | // Wait till STOMP Service is actually connected 32 | beforeEach(done => { 33 | ensureStompConnected(stompService, done); 34 | }); 35 | 36 | it('should already be connected', () => { 37 | expect(stompService.connected()).toBe(true); 38 | }); 39 | 40 | it('send and receive a message', done => { 41 | const queueName = '/topic/ng-demo-sub'; 42 | const msg = 'My very special message'; 43 | 44 | // Subscribe and set up the Observable 45 | stompService.subscribe(queueName).subscribe((message: Message) => { 46 | expect(message.body).toBe(msg); 47 | done(); 48 | }); 49 | 50 | // Now publish to the same queue 51 | stompService.publish(queueName, msg); 52 | }); 53 | }); 54 | 55 | describe('Common Operations', () => { 56 | it('should be able to subscribe even before STOMP is connected', done => { 57 | const queueName = '/topic/ng-demo-sub01'; 58 | const msg = 'My very special message 01'; 59 | 60 | // Subscribe and set up the Observable, the underlying STOMP Service may not have been connected 61 | stompService.subscribe(queueName).subscribe((message: Message) => { 62 | expect(message.body).toBe(msg); 63 | done(); 64 | }); 65 | 66 | stompService.connectObservable.subscribe((state: StompState) => { 67 | // Now publish the message when STOMP Broker is connected 68 | stompService.publish(queueName, msg); 69 | }); 70 | }); 71 | 72 | it('should be able to publish/subscribe even before STOMP is connected', done => { 73 | // Queue is a durable queue 74 | const queueName = '/queue/ng-demo-sub02'; 75 | const msg = 'My very special message 02' + Math.random(); 76 | 77 | // Subscribe and set up the Observable, the underlying STOMP Service may not have been connected 78 | stompService 79 | .subscribe(queueName) 80 | .pipe( 81 | filter((message: Message) => { 82 | // Since the queue is durable, we may receive older messages as well, discard those 83 | return message.body === msg; 84 | }) 85 | ) 86 | .subscribe((message: Message) => { 87 | expect(message.body).toBe(msg); 88 | done(); 89 | }); 90 | 91 | stompService.publish(queueName, msg); 92 | }); 93 | 94 | it('should be able to publish/subscribe when STOMP is disconnected', done => { 95 | // Queue is a durable queue 96 | const queueName = '/queue/ng-demo-sub02'; 97 | const msg = 'My very special message 03' + Math.random(); 98 | 99 | let firstTime = true; 100 | 101 | // Subscribe and set up the Observable, the underlying STOMP Service may not have been connected 102 | stompService 103 | .subscribe(queueName) 104 | .pipe( 105 | filter((message: Message) => { 106 | // Since the queue is durable, we may receive older messages as well, discard those 107 | return message.body === msg; 108 | }) 109 | ) 110 | .subscribe((message: Message) => { 111 | expect(message.body).toBe(msg); 112 | done(); 113 | }); 114 | 115 | // Actively disconnect simulating error after STOMP connects, then publish the message 116 | stompService.connectObservable.subscribe((state: StompState) => { 117 | if (firstTime) { 118 | firstTime = false; 119 | 120 | (stompService).forceDisconnect(); 121 | 122 | setTimeout(() => { 123 | // Now publish the message when STOMP Broker has been disconnected 124 | stompService.publish(queueName, msg); 125 | }, 500); 126 | } 127 | }); 128 | }); 129 | 130 | it('should receive server headers', done => { 131 | stompService.serverHeadersObservable.subscribe( 132 | (headers: StompHeaders) => { 133 | // Check that we have received at least one key in header 134 | expect(Object.keys(headers).length).toBeGreaterThan(0); 135 | 136 | // Subscribe again, we should get the same set of headers 137 | // (as per specifications, if STOMP has already connected it should immediately trigger) 138 | stompService.serverHeadersObservable.subscribe( 139 | (headers1: StompHeaders) => { 140 | expect(headers1).toEqual(headers); 141 | done(); 142 | } 143 | ); 144 | } 145 | ); 146 | }); 147 | }); 148 | }); 149 | -------------------------------------------------------------------------------- /src/specs/app/services/rx-helpers.ts: -------------------------------------------------------------------------------- 1 | /* tslint:disable:no-unused-variable */ 2 | 3 | // Helper functions 4 | import { RxStomp, RxStompState } from '@stomp/rx-stomp'; 5 | 6 | export const defaultRxStompConfig = { 7 | // Which server? 8 | brokerURL: 'ws://127.0.0.1:15674/ws', 9 | 10 | // Headers 11 | // Typical keys: login, passcode, host 12 | connectHeaders: { 13 | login: 'guest', 14 | passcode: 'guest', 15 | }, 16 | 17 | // How often to heartbeat? 18 | // Interval in milliseconds, set to 0 to disable 19 | heartbeatIncoming: 0, // Typical value 0 - disabled 20 | heartbeatOutgoing: 0, // Typical value 20000 - every 20 seconds 21 | 22 | // Wait in milliseconds before attempting auto reconnect 23 | // Set to 0 to disable 24 | // Typical value 5000 (5 seconds) 25 | reconnectDelay: 200, 26 | 27 | // Will log diagnostics on console 28 | debug: (msg: string): void => { 29 | console.log(new Date(), msg); 30 | }, 31 | }; 32 | 33 | export function ensureRxStompConnected(rxStomp: RxStomp, done: any) { 34 | rxStomp.connected$.subscribe((state: RxStompState) => { 35 | done(); 36 | }); 37 | } 38 | 39 | export function ensureRxStompDisconnected(rxStomp: RxStomp, done: any) { 40 | rxStomp.connectionState$.subscribe((state: RxStompState) => { 41 | if (state === RxStompState.CLOSED) { 42 | done(); 43 | } 44 | }); 45 | } 46 | 47 | export function disconnectRxStompAndEnsure(rxStomp: RxStomp, done: any) { 48 | rxStomp.deactivate(); 49 | ensureRxStompDisconnected(rxStomp, done); 50 | } 51 | -------------------------------------------------------------------------------- /src/specs/app/services/rx-stomp-rpc.service.spec.ts: -------------------------------------------------------------------------------- 1 | // These are likely to fail on any broker other than RabbitMQ 2 | import { IMessage } from '@stomp/stompjs'; 3 | import { 4 | InjectableRxStompConfig, 5 | RxStompRPCService, 6 | RxStompService, 7 | rxStompServiceFactory, 8 | } from '../../../..'; 9 | import { UUID } from 'angular2-uuid'; 10 | import { TestBed } from '@angular/core/testing'; 11 | import { defaultRxStompConfig } from './rx-helpers'; 12 | import { RxStomp, RxStompConfig } from '@stomp/rx-stomp'; 13 | import { take } from 'rxjs/operators'; 14 | 15 | describe('Rabbit RPC', () => { 16 | const myServiceEndPoint = '/topic/echo'; 17 | 18 | let rxStompService: RxStompService; 19 | let stompRPCService: RxStompRPCService; 20 | 21 | // To be used by the RPC server 22 | let rxStomp: RxStomp; 23 | 24 | beforeEach(() => { 25 | TestBed.configureTestingModule({ 26 | providers: [ 27 | { 28 | provide: RxStompService, 29 | useFactory: rxStompServiceFactory, 30 | deps: [InjectableRxStompConfig], 31 | }, 32 | { 33 | provide: InjectableRxStompConfig, 34 | useValue: defaultRxStompConfig, 35 | }, 36 | RxStompRPCService, 37 | ], 38 | }); 39 | 40 | stompRPCService = TestBed.get(RxStompRPCService); 41 | rxStompService = TestBed.get(RxStompService); 42 | }); 43 | 44 | beforeEach(done => { 45 | rxStomp = new RxStomp(); 46 | const rxStompConfig: RxStompConfig = (Object as any).assign( 47 | {}, 48 | defaultRxStompConfig 49 | ); 50 | // Identify log messages on the server side 51 | rxStompConfig.debug = (str: string) => { 52 | console.log('RPC Server: ', new Date(), str); 53 | }; 54 | rxStomp.configure(rxStompConfig); 55 | rxStomp.activate(); 56 | 57 | rxStomp.connected$.pipe(take(1)).subscribe(() => { 58 | const receiptId = UUID.UUID(); 59 | 60 | rxStomp 61 | .watch(myServiceEndPoint, { receipt: receiptId }) 62 | .subscribe((message: IMessage) => { 63 | const replyTo = message.headers['reply-to']; 64 | const correlationId = message.headers['correlation-id']; 65 | const incomingMessage = message.body; 66 | 67 | const outgoingMessage = 'Echoing - ' + incomingMessage; 68 | rxStomp.publish({ 69 | destination: replyTo, 70 | body: outgoingMessage, 71 | headers: { 'correlation-id': correlationId }, 72 | }); 73 | }); 74 | 75 | rxStomp.watchForReceipt(receiptId, () => { 76 | done(); 77 | }); 78 | }); 79 | }); 80 | 81 | it('Simple RPC', done => { 82 | // Watch for RPC response 83 | stompRPCService 84 | .rpc({ destination: myServiceEndPoint, body: 'Hello' }) 85 | .subscribe((message: IMessage) => { 86 | expect(message.body).toBe('Echoing - Hello'); 87 | done(); 88 | }); 89 | }); 90 | 91 | it('Should not leak', done => { 92 | const numSubscribers = () => { 93 | return rxStompService.unhandledMessage$.observers.length; 94 | }; 95 | 96 | const origNumSubcribers = numSubscribers(); 97 | 98 | // Watch for RPC response 99 | stompRPCService 100 | .rpc({ destination: myServiceEndPoint, body: 'Hello' }) 101 | .subscribe((message: IMessage) => { 102 | expect(message.body).toBe('Echoing - Hello'); 103 | setTimeout(() => { 104 | expect(numSubscribers()).toBe(origNumSubcribers); 105 | done(); 106 | }, 0); 107 | }); 108 | 109 | expect(numSubscribers()).toBe(origNumSubcribers + 1); 110 | }); 111 | }); 112 | -------------------------------------------------------------------------------- /src/specs/app/services/rx-stomp-service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | import { take } from 'rxjs/operators'; 3 | import { defaultRxStompConfig, disconnectRxStompAndEnsure } from './rx-helpers'; 4 | import { RxStompService } from '../../../app/rx-stomp.service'; 5 | import { InjectableRxStompConfig, rxStompServiceFactory } from '../../../../'; 6 | 7 | describe('RxStompService', () => { 8 | let rxStompService: RxStompService; 9 | 10 | describe('Raw', () => { 11 | beforeEach(() => { 12 | TestBed.configureTestingModule({ 13 | providers: [RxStompService], 14 | }); 15 | 16 | rxStompService = TestBed.get(RxStompService); 17 | }); 18 | 19 | afterEach(done => { 20 | disconnectRxStompAndEnsure(rxStompService, done); 21 | }); 22 | 23 | it('should be created', () => { 24 | expect(rxStompService).toBeTruthy(); 25 | }); 26 | 27 | it('should connect', done => { 28 | rxStompService.configure(defaultRxStompConfig); 29 | rxStompService.activate(); 30 | 31 | rxStompService.connected$.pipe(take(1)).subscribe(() => { 32 | done(); 33 | }); 34 | }); 35 | }); 36 | 37 | describe('Pre configured', () => { 38 | beforeEach(() => { 39 | TestBed.configureTestingModule({ 40 | providers: [ 41 | { 42 | provide: RxStompService, 43 | useFactory: rxStompServiceFactory, 44 | deps: [InjectableRxStompConfig], 45 | }, 46 | { 47 | provide: InjectableRxStompConfig, 48 | useValue: defaultRxStompConfig, 49 | }, 50 | ], 51 | }); 52 | 53 | rxStompService = TestBed.get(RxStompService); 54 | }); 55 | 56 | afterEach(done => { 57 | disconnectRxStompAndEnsure(rxStompService, done); 58 | }); 59 | 60 | it('should be created', () => { 61 | expect(rxStompService).toBeTruthy(); 62 | }); 63 | 64 | it('should connect', done => { 65 | rxStompService.connected$.pipe(take(1)).subscribe(() => { 66 | done(); 67 | }); 68 | }); 69 | }); 70 | }); 71 | -------------------------------------------------------------------------------- /src/specs/polyfills.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This file includes polyfills needed by Angular and is loaded before the app. 3 | * You can add your own extra polyfills to this file. 4 | * 5 | * This file is divided into 2 sections: 6 | * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. 7 | * 2. Application imports. Files imported after ZoneJS that should be loaded before your main 8 | * file. 9 | * 10 | * The current setup is for so-called "evergreen" browsers; the last versions of browsers that 11 | * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), 12 | * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. 13 | * 14 | * Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html 15 | */ 16 | 17 | /*************************************************************************************************** 18 | * BROWSER POLYFILLS 19 | */ 20 | 21 | /** IE9, IE10 and IE11 requires all of the following polyfills. **/ 22 | // import 'core-js/es6/symbol'; 23 | // import 'core-js/es6/object'; 24 | // import 'core-js/es6/function'; 25 | // import 'core-js/es6/parse-int'; 26 | // import 'core-js/es6/parse-float'; 27 | // import 'core-js/es6/number'; 28 | // import 'core-js/es6/math'; 29 | // import 'core-js/es6/string'; 30 | // import 'core-js/es6/date'; 31 | // import 'core-js/es6/array'; 32 | // import 'core-js/es6/regexp'; 33 | // import 'core-js/es6/map'; 34 | // import 'core-js/es6/set'; 35 | 36 | /** IE10 and IE11 requires the following for NgClass support on SVG elements */ 37 | // import 'classlist.js'; // Run `npm install --save classlist.js`. 38 | 39 | /** IE10 and IE11 requires the following to support `@angular/animation`. */ 40 | // import 'web-animations-js'; // Run `npm install --save web-animations-js`. 41 | 42 | /** Evergreen browsers require these. **/ 43 | import 'core-js/es6/reflect'; 44 | import 'core-js/es7/reflect'; 45 | 46 | /** ALL Firefox browsers require the following to support `@angular/animation`. **/ 47 | // import 'web-animations-js'; // Run `npm install --save web-animations-js`. 48 | 49 | /*************************************************************************************************** 50 | * Zone JS is required by Angular itself. 51 | */ 52 | import 'zone.js/dist/zone'; // Included with Angular CLI. 53 | 54 | /*************************************************************************************************** 55 | * APPLICATION IMPORTS 56 | */ 57 | 58 | /** 59 | * Date, currency, decimal and percent pipes. 60 | * Needed for: All but Chrome, Firefox, Edge, IE11 and Safari 10 61 | */ 62 | // import 'intl'; // Run `npm install --save intl`. 63 | -------------------------------------------------------------------------------- /src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/zone-testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting, 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | declare const require: any; 11 | 12 | // First, initialize the Angular testing environment. 13 | getTestBed().initTestEnvironment( 14 | BrowserDynamicTestingModule, 15 | platformBrowserDynamicTesting() 16 | ); 17 | // Then we find all the tests. 18 | const context = require.context('./', true, /\.spec\.ts$/); 19 | // And load the modules. 20 | context.keys().map(context); 21 | -------------------------------------------------------------------------------- /src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "module": "es2015", 6 | "types": [] 7 | }, 8 | "exclude": ["src/test.ts", "**/*.spec.ts"] 9 | } 10 | -------------------------------------------------------------------------------- /src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "module": "commonjs", 6 | "types": ["jasmine", "node"] 7 | }, 8 | "files": ["test.ts", "polyfills.ts"], 9 | "include": ["**/*.spec.ts", "**/*.d.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /src/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tslint.json", 3 | "rules": { 4 | "directive-selector": [true, "attribute", "app", "camelCase"], 5 | "component-selector": [true, "element", "app", "kebab-case"] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "baseUrl": "./", 5 | "outDir": "./dist/out-tsc", 6 | "sourceMap": true, 7 | "declaration": false, 8 | "moduleResolution": "node", 9 | "emitDecoratorMetadata": true, 10 | "experimentalDecorators": true, 11 | "target": "es2017", 12 | "typeRoots": ["node_modules/@types"], 13 | "lib": ["es2017", "dom"] 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "rulesDirectory": ["node_modules/codelyzer"], 3 | "extends": ["tslint-config-prettier"], 4 | "rules": { 5 | "arrow-return-shorthand": true, 6 | "callable-types": true, 7 | "class-name": true, 8 | "comment-format": [true, "check-space"], 9 | "curly": true, 10 | "deprecation": { 11 | "severity": "warn" 12 | }, 13 | "forin": true, 14 | "import-blacklist": [true, "rxjs/Rx"], 15 | "interface-over-type-literal": true, 16 | "label-position": true, 17 | "member-access": false, 18 | "member-ordering": [ 19 | true, 20 | { 21 | "order": [ 22 | "static-field", 23 | "instance-field", 24 | "static-method", 25 | "instance-method" 26 | ] 27 | } 28 | ], 29 | "no-arg": true, 30 | "no-bitwise": true, 31 | "no-console": [true, "debug", "info", "time", "timeEnd", "trace"], 32 | "no-construct": true, 33 | "no-debugger": true, 34 | "no-duplicate-super": true, 35 | "no-empty": false, 36 | "no-empty-interface": true, 37 | "no-eval": true, 38 | "no-inferrable-types": [true, "ignore-params"], 39 | "no-misused-new": true, 40 | "no-non-null-assertion": true, 41 | "no-shadowed-variable": true, 42 | "no-string-literal": false, 43 | "no-string-throw": true, 44 | "no-switch-case-fall-through": true, 45 | "no-unnecessary-initializer": true, 46 | "no-unused-expression": true, 47 | "no-use-before-declare": true, 48 | "no-var-keyword": true, 49 | "object-literal-sort-keys": false, 50 | "prefer-const": true, 51 | "radix": true, 52 | "triple-equals": [true, "allow-null-check"], 53 | "unified-signatures": true, 54 | "variable-name": false, 55 | "no-output-on-prefix": true, 56 | "use-input-property-decorator": true, 57 | "use-output-property-decorator": true, 58 | "use-host-property-decorator": true, 59 | "no-input-rename": true, 60 | "no-output-rename": true, 61 | "use-life-cycle-interface": true, 62 | "use-pipe-transform-interface": true, 63 | "component-class-suffix": true, 64 | "directive-class-suffix": true 65 | } 66 | } 67 | --------------------------------------------------------------------------------