├── .gitignore ├── LICENSE ├── README.md ├── bower.json ├── doc ├── assets │ ├── css │ │ ├── main.css │ │ └── main.css.map │ ├── images │ │ ├── icons.png │ │ ├── icons@2x.png │ │ ├── streamdataio-logo.png │ │ ├── widgets.png │ │ └── widgets@2x.png │ └── js │ │ ├── main.js │ │ └── search.js ├── classes │ ├── eventtype.html │ ├── jsonhelper.html │ ├── listeners.html │ ├── logger.html │ ├── preconditions.html │ ├── streamdata.html │ ├── streamdataerror.html │ ├── streamdataeventsource.html │ ├── streamdataio.html │ ├── streamdataserver.html │ ├── streamdataurl.html │ └── urlhelper.html ├── enums │ └── loglevel.html ├── globals.html ├── index.html └── interfaces │ ├── dataevent.html │ ├── errorevent.html │ ├── event.html │ ├── listener.html │ ├── monitorevent.html │ ├── openevent.html │ ├── patchevent.html │ ├── streamdataauthstrategy.html │ └── streamdatawindow.html ├── stockmarket-angular ├── README.md ├── favicon.ico ├── img │ ├── angular.png │ ├── info.png │ ├── spinner.gif │ └── streamdataio-logo.svg ├── index.html ├── package-lock.json ├── package.json ├── scripts │ ├── main.js │ └── streamdataio-auth.min.js └── styles │ └── main.css ├── stockmarket-angular2 ├── .angular-cli.json ├── .editorconfig ├── .gitignore ├── README.md ├── e2e │ ├── app.e2e-spec.ts │ ├── app.po.ts │ └── tsconfig.e2e.json ├── karma.conf.js ├── package-lock.json ├── package.json ├── protractor.conf.js ├── src │ ├── app │ │ ├── app.component.css │ │ ├── app.component.html │ │ ├── app.component.spec.ts │ │ ├── app.component.ts │ │ └── app.module.ts │ ├── assets │ │ ├── .gitkeep │ │ └── streamdataio-logo.svg │ ├── environments │ │ ├── environment.prod.ts │ │ └── environment.ts │ ├── favicon.ico │ ├── index.html │ ├── main.ts │ ├── polyfills.ts │ ├── shared │ │ └── StockMarket.ts │ ├── styles.css │ ├── test.ts │ ├── tsconfig.app.json │ ├── tsconfig.spec.json │ └── typings.d.ts ├── tsconfig.json └── tslint.json ├── stockmarket-angular8 ├── .editorconfig ├── .gitignore ├── README.md ├── angular.json ├── browserslist ├── e2e │ ├── protractor.conf.js │ ├── src │ │ ├── app.e2e-spec.ts │ │ └── app.po.ts │ └── tsconfig.e2e.json ├── package-lock.json ├── package.json ├── src │ ├── app │ │ ├── app.component.css │ │ ├── app.component.html │ │ ├── app.component.spec.ts │ │ ├── app.component.ts │ │ └── app.module.ts │ ├── assets │ │ ├── .gitkeep │ │ └── streamdataio-logo.svg │ ├── environments │ │ ├── environment.prod.ts │ │ └── environment.ts │ ├── favicon.ico │ ├── index.html │ ├── karma.conf.js │ ├── main.ts │ ├── polyfills.ts │ ├── shared │ │ └── StockMarket.ts │ ├── styles.css │ ├── test.ts │ ├── tsconfig.app.json │ ├── tsconfig.spec.json │ └── tslint.json ├── tsconfig.json └── tslint.json ├── stockmarket-console ├── README.md ├── index.html ├── package-lock.json └── package.json ├── stockmarket-nodejs ├── .gitignore ├── LICENSE ├── README.md ├── package-lock.json ├── package.json └── server.js ├── stockmarket-vuejs ├── .babelrc ├── .editorconfig ├── .gitignore ├── .postcssrc.js ├── LICENSE ├── README.md ├── build │ ├── build.js │ ├── check-versions.js │ ├── dev-client.js │ ├── dev-server.js │ ├── utils.js │ ├── vue-loader.conf.js │ ├── webpack.base.conf.js │ ├── webpack.dev.conf.js │ └── webpack.prod.conf.js ├── config │ ├── dev.env.js │ ├── index.js │ └── prod.env.js ├── index.html ├── package-lock.json ├── package.json ├── src │ ├── App.vue │ ├── assets │ │ ├── streamdataio.png │ │ └── vuejs.png │ ├── components │ │ └── Streamdataio.vue │ └── main.js └── static │ └── .gitkeep └── streamdataio-auth.min.js /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by https://www.gitignore.io 2 | 3 | ### OSX ### 4 | .DS_Store 5 | .AppleDouble 6 | .LSOverride 7 | 8 | # Icon must end with two \r 9 | Icon 10 | 11 | 12 | # Thumbnails 13 | ._* 14 | 15 | # Files that might appear in the root of a volume 16 | .DocumentRevisions-V100 17 | .fseventsd 18 | .Spotlight-V100 19 | .TemporaryItems 20 | .Trashes 21 | .VolumeIcon.icns 22 | 23 | # Directories potentially created on remote AFP share 24 | .AppleDB 25 | .AppleDesktop 26 | Network Trash Folder 27 | Temporary Items 28 | .apdisk 29 | 30 | 31 | ### SublimeText ### 32 | # cache files for sublime text 33 | *.tmlanguage.cache 34 | *.tmPreferences.cache 35 | *.stTheme.cache 36 | 37 | # workspace files are user-specific 38 | *.sublime-workspace 39 | 40 | # project files should be checked into the repository, unless a significant 41 | # proportion of contributors will probably not be using SublimeText 42 | # *.sublime-project 43 | 44 | # sftp configuration file 45 | sftp-config.json 46 | 47 | 48 | ### Emacs ### 49 | # -*- mode: gitignore; -*- 50 | *~ 51 | \#*\# 52 | /.emacs.desktop 53 | /.emacs.desktop.lock 54 | *.elc 55 | auto-save-list 56 | tramp 57 | .\#* 58 | 59 | # Org-mode 60 | .org-id-locations 61 | *_archive 62 | 63 | # flymake-mode 64 | *_flymake.* 65 | 66 | # eshell files 67 | /eshell/history 68 | /eshell/lastdir 69 | 70 | # elpa packages 71 | /elpa/ 72 | 73 | # reftex files 74 | *.rel 75 | 76 | # AUCTeX auto folder 77 | /auto/ 78 | 79 | # cask packages 80 | .cask/ 81 | 82 | # Created by https://www.gitignore.io 83 | 84 | ### Intellij ### 85 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm 86 | 87 | *.iml 88 | 89 | ## Directory-based project format: 90 | .idea/ 91 | # if you remove the above rule, at least ignore the following: 92 | 93 | # User-specific stuff: 94 | # .idea/workspace.xml 95 | # .idea/tasks.xml 96 | # .idea/dictionaries 97 | 98 | # Sensitive or high-churn files: 99 | # .idea/dataSources.ids 100 | # .idea/dataSources.xml 101 | # .idea/sqlDataSources.xml 102 | # .idea/dynamic.xml 103 | # .idea/uiDesigner.xml 104 | 105 | # Gradle: 106 | # .idea/gradle.xml 107 | # .idea/libraries 108 | 109 | # Mongo Explorer plugin: 110 | # .idea/mongoSettings.xml 111 | 112 | ## File-based project format: 113 | *.ipr 114 | *.iws 115 | 116 | ## Plugin-specific files: 117 | 118 | # IntelliJ 119 | /out/ 120 | 121 | # mpeltonen/sbt-idea plugin 122 | .idea_modules/ 123 | 124 | # JIRA plugin 125 | atlassian-ide-plugin.xml 126 | 127 | # Crashlytics plugin (for Android Studio and IntelliJ) 128 | com_crashlytics_export_strings.xml 129 | crashlytics.properties 130 | crashlytics-build.properties 131 | 132 | **/node_modules 133 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | 203 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # streamdataio-js 2 | Streamdata.io by Axway (aka AMPLIFY Streams) Javascript SDK package containing SDK, documentation and sample applications. 3 | 4 | The SDK allows the use of the Streams SaaS proxy to get data pushed from various sources and to use them in your application. 5 | 6 | In this directory, you will find: 7 | - a minified version of the SDK for UI (streamdataio-web.min.js) and Node.js (streamdataio-node.min.js) 8 | - the documentation that helps you to understand how it works (doc) 9 | - several sample projects that show how to use this SDK within a Javascript application, using your favorite JS stack 10 | - stockmarket sample shows how to get data from a demo data source returning simulated market data, and bind them to a simple UI using JQuery 11 | - stockmarket-angular is another version of stockmarket projet using AngularJS 12 | 13 | To run a sample and understand how it works, clone the git repository, open the index.html of the sample in your browser (Chrome, Firefox, Safari) and browse the code! 14 | 15 | If you have any questions or feedback, feel free to ask: https://developer.axway.com/ 16 | 17 | Enjoy! 18 | -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "streamdataio-js", 3 | "version": "1.0.2-alpha.1", 4 | "main": "streamdataio.min.js", 5 | "homepage": "https://github.com/streamdataio/streamdataio-js", 6 | "authors": [ 7 | "Streamdataio support@streamdata.io" 8 | ], 9 | "description": "Javascript SDK for Streamdata.io", 10 | "keywords": [ 11 | "streamdata", 12 | "streamdata.io", 13 | "push", 14 | "sse", 15 | "server-sent-event", 16 | "api", 17 | "streaming" 18 | ], 19 | "license": "Apache 2 License", 20 | "private": false, 21 | "ignore": [ 22 | "node_modules", 23 | "bower_components", 24 | "test" 25 | ], 26 | "dependencies": {}, 27 | "devDependencies": {} 28 | } 29 | -------------------------------------------------------------------------------- /doc/assets/images/icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/axway-streams/axway-amplify-streams-js/d8ee9481907ea9e7556f3eab73224838b881276a/doc/assets/images/icons.png -------------------------------------------------------------------------------- /doc/assets/images/icons@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/axway-streams/axway-amplify-streams-js/d8ee9481907ea9e7556f3eab73224838b881276a/doc/assets/images/icons@2x.png -------------------------------------------------------------------------------- /doc/assets/images/streamdataio-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/axway-streams/axway-amplify-streams-js/d8ee9481907ea9e7556f3eab73224838b881276a/doc/assets/images/streamdataio-logo.png -------------------------------------------------------------------------------- /doc/assets/images/widgets.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/axway-streams/axway-amplify-streams-js/d8ee9481907ea9e7556f3eab73224838b881276a/doc/assets/images/widgets.png -------------------------------------------------------------------------------- /doc/assets/images/widgets@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/axway-streams/axway-amplify-streams-js/d8ee9481907ea9e7556f3eab73224838b881276a/doc/assets/images/widgets@2x.png -------------------------------------------------------------------------------- /doc/interfaces/dataevent.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | DataEvent | streamdata.io SDK 7 | 8 | 9 | 10 | 11 | 12 |
13 |
14 |
15 |
16 |
17 | 18 |
19 | 30 |
31 |
32 | Options 33 |
34 |
35 | All 36 |
    37 |
  • Public
  • 38 |
  • Public/Protected
  • 39 |
  • All
  • 40 |
41 |
42 | 43 | 44 | 45 | 46 |
47 |
48 | Menu 49 |
50 |
51 |
52 |
53 |
54 |
55 | 63 |

Interface DataEvent

64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |

Hierarchy

72 |
    73 |
  • 74 | Event 75 |
      76 |
    • 77 | DataEvent 78 |
    • 79 |
    80 |
  • 81 |
82 |
83 |
84 |

Index

85 |
86 |
87 |
88 |

Properties

89 | 92 |
93 |
94 |
95 |
96 |
97 |

Properties

98 |
99 | 100 |

data

101 |
data: string
102 | 107 |
108 |
109 |
110 | 210 |
211 |
212 | 271 |
272 | 273 | 274 | 275 | -------------------------------------------------------------------------------- /doc/interfaces/event.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Event | streamdata.io SDK 7 | 8 | 9 | 10 | 11 | 12 |
13 |
14 |
15 |
16 |
17 | 18 |
19 | 30 |
31 |
32 | Options 33 |
34 |
35 | All 36 |
    37 |
  • Public
  • 38 |
  • Public/Protected
  • 39 |
  • All
  • 40 |
41 |
42 | 43 | 44 | 45 | 46 |
47 |
48 | Menu 49 |
50 |
51 |
52 |
53 |
54 |
55 | 63 |

Interface Event

64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |

Hierarchy

72 | 94 |
95 |
96 | 191 |
192 |
193 | 252 |
253 | 254 | 255 | 256 | -------------------------------------------------------------------------------- /doc/interfaces/openevent.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | OpenEvent | streamdata.io SDK 7 | 8 | 9 | 10 | 11 | 12 |
13 |
14 |
15 |
16 |
17 | 18 |
19 | 30 |
31 |
32 | Options 33 |
34 |
35 | All 36 |
    37 |
  • Public
  • 38 |
  • Public/Protected
  • 39 |
  • All
  • 40 |
41 |
42 | 43 | 44 | 45 | 46 |
47 |
48 | Menu 49 |
50 |
51 |
52 |
53 |
54 |
55 | 63 |

Interface OpenEvent

64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |

Hierarchy

72 |
    73 |
  • 74 | Event 75 |
      76 |
    • 77 | OpenEvent 78 |
    • 79 |
    80 |
  • 81 |
82 |
83 |
84 | 179 |
180 |
181 | 240 |
241 | 242 | 243 | 244 | -------------------------------------------------------------------------------- /stockmarket-angular/README.md: -------------------------------------------------------------------------------- 1 | # streamdata-js/stockmarket-angular 2 | This sample application shows how to use the streamdata.io Javascript SDK with AngularJS. 3 | 4 | The streamdata.io JavaScript SDK allows the use of streamdata.io to get data pushed from various sources and use them in your application. 5 | 6 | In a shell terminal, run the commands: 7 | 8 | ``` 9 | cd stockmarket-angular 10 | npm install 11 | ``` 12 | 13 | This will install the streamdata.io JavaScript SDK and a Json-Patch JavaScript library. 14 | 15 | To run the sample, open the index.html in your browser (Chrome, Firefox, Safari, IE > 10). 16 | You will be asked to fill in you application Token. To get them, connect to the streamdata.io portal and follow the guidelines. 17 | 18 | If you have any questions or feedback, feel free to ask: support@streamdata.io 19 | 20 | Enjoy! 21 | -------------------------------------------------------------------------------- /stockmarket-angular/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/axway-streams/axway-amplify-streams-js/d8ee9481907ea9e7556f3eab73224838b881276a/stockmarket-angular/favicon.ico -------------------------------------------------------------------------------- /stockmarket-angular/img/angular.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/axway-streams/axway-amplify-streams-js/d8ee9481907ea9e7556f3eab73224838b881276a/stockmarket-angular/img/angular.png -------------------------------------------------------------------------------- /stockmarket-angular/img/info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/axway-streams/axway-amplify-streams-js/d8ee9481907ea9e7556f3eab73224838b881276a/stockmarket-angular/img/info.png -------------------------------------------------------------------------------- /stockmarket-angular/img/spinner.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/axway-streams/axway-amplify-streams-js/d8ee9481907ea9e7556f3eab73224838b881276a/stockmarket-angular/img/spinner.gif -------------------------------------------------------------------------------- /stockmarket-angular/index.html: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | Streamdata.io Stock-Market 24 | 25 | 26 | 27 | 28 | 29 | 33 | 34 | 35 | 36 | 38 | 39 | 40 | 45 | 46 | Fork me on GitHub 50 | 51 |
52 |
53 | 54 | 55 |

Stock-Market demo with

56 |
57 |
58 | 61 |
62 | 63 | 64 |

An application token is required for authentication. Sign Up to get yours.

66 |
67 | 68 | 69 | 75 | 76 | 77 |
78 | 79 | 81 |
82 | 84 | 85 |
86 | 87 |
88 | 90 | 91 | Authenticate with signature (HMAC) 92 | 93 |
94 |
95 | 96 | 97 | 98 | 100 | 101 | 102 | 103 | 108 | Add header 109 | 110 | 111 |
112 |
113 |
114 | 115 | 116 |
117 |
118 | 119 | 120 |
121 |
122 | 125 |
126 |
127 |
128 | 130 | play_arrow 131 | 132 | 134 | stop 135 | 136 |
137 | 138 |
139 |
140 |
141 |
142 | 143 |
144 |
145 | 146 | 147 | 148 | 150 | 151 | 152 | 156 | 157 |
155 |
158 |
159 |
160 | 161 | 170 |
171 | 172 | 173 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | -------------------------------------------------------------------------------- /stockmarket-angular/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "streamdataio-angular", 3 | "version": "1.0.0", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "core-js": { 8 | "version": "2.5.1", 9 | "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.1.tgz", 10 | "integrity": "sha1-rmh03GaTd4m4B1T/VCjfZoGcpQs=" 11 | }, 12 | "crypto-js": { 13 | "version": "3.1.9-1", 14 | "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-3.1.9-1.tgz", 15 | "integrity": "sha1-/aGedh/Ad+Af+/3G6f38WeiAbNg=" 16 | }, 17 | "deep-equal": { 18 | "version": "1.0.1", 19 | "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz", 20 | "integrity": "sha1-9dJgKStmDghO/0zbyfCK0yR0SLU=" 21 | }, 22 | "eventsource": { 23 | "version": "github:streamdataio/eventsource-js#92ceda879f6d4e6d45fd6bb6fc82ca12a0c2c5db", 24 | "from": "eventsource@github:streamdataio/eventsource-js#92ceda879f6d4e6d45fd6bb6fc82ca12a0c2c5db", 25 | "requires": { 26 | "original": "^1.0.0" 27 | } 28 | }, 29 | "eventsource-polyfill": { 30 | "version": "github:streamdataio/EventSource#bc353046d1eef182642e1d85deb442a3fd62849e", 31 | "from": "eventsource-polyfill@github:streamdataio/EventSource#bc353046d1eef182642e1d85deb442a3fd62849e" 32 | }, 33 | "fast-json-patch": { 34 | "version": "2.0.6", 35 | "resolved": "https://registry.npmjs.org/fast-json-patch/-/fast-json-patch-2.0.6.tgz", 36 | "integrity": "sha1-hv/4+GYjkaqBlyKGTWMuYD5u5gU=", 37 | "requires": { 38 | "deep-equal": "^1.0.1" 39 | } 40 | }, 41 | "original": { 42 | "version": "1.0.0", 43 | "resolved": "https://registry.npmjs.org/original/-/original-1.0.0.tgz", 44 | "integrity": "sha1-kUf5P6FpbQS+YeAb1QuurKZWvTs=", 45 | "requires": { 46 | "url-parse": "1.0.x" 47 | } 48 | }, 49 | "querystringify": { 50 | "version": "0.0.4", 51 | "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-0.0.4.tgz", 52 | "integrity": "sha1-DPf4T5Rj/wrlHExLFC2VvjdyTZw=" 53 | }, 54 | "requires-port": { 55 | "version": "1.0.0", 56 | "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", 57 | "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=" 58 | }, 59 | "streamdataio-js-sdk": { 60 | "version": "2.0.2", 61 | "resolved": "https://registry.npmjs.org/streamdataio-js-sdk/-/streamdataio-js-sdk-2.0.2.tgz", 62 | "integrity": "sha512-Fw0Y5owXy1aTEqOy1YTtZIFEDTg32PeTkAK2X3k3rVSZkLx2KHvswzbV17CvC6zzuvfXFJo4AVxo9RazzHKzbQ==", 63 | "requires": { 64 | "core-js": "^2.4.1", 65 | "eventsource": "eventsource@github:streamdataio/eventsource-js#92ceda879f6d4e6d45fd6bb6fc82ca12a0c2c5db", 66 | "eventsource-polyfill": "eventsource-polyfill@github:streamdataio/EventSource#bc353046d1eef182642e1d85deb442a3fd62849e" 67 | } 68 | }, 69 | "streamdataio-js-sdk-auth": { 70 | "version": "2.0.0", 71 | "resolved": "https://registry.npmjs.org/streamdataio-js-sdk-auth/-/streamdataio-js-sdk-auth-2.0.0.tgz", 72 | "integrity": "sha512-y89ECCkmQubmeeJq5QZWRoI03B5w47xzaS9XxlvyCecWIgeWUS5NV1tbZ8P8YCq1eMeoykeaP430gxG3pggmiA==", 73 | "requires": { 74 | "crypto-js": "^3.1.9-1", 75 | "streamdataio-js-sdk": "^2.0.1" 76 | } 77 | }, 78 | "url-parse": { 79 | "version": "1.0.5", 80 | "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.0.5.tgz", 81 | "integrity": "sha1-CFSGBCKv3P7+tsllxmLUgAFpkns=", 82 | "requires": { 83 | "querystringify": "0.0.x", 84 | "requires-port": "1.0.x" 85 | } 86 | } 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /stockmarket-angular/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "streamdataio-angular", 3 | "version": "1.0.0", 4 | "description": "AngularJS sample with web console of the Streamdata.io Javascript SDK", 5 | "keywords": [ 6 | "streamdata", 7 | "streamdata.io", 8 | "push", 9 | "sse", 10 | "server-sent-event", 11 | "api", 12 | "streaming" 13 | ], 14 | "author": "Streamdataio support@streamdata.io", 15 | "license": "Apache-2.0", 16 | "dependencies": { 17 | "fast-json-patch": "^2.0.3", 18 | "streamdataio-js-sdk": "^2.0.2", 19 | "streamdataio-js-sdk-auth": "^2.0.0" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /stockmarket-angular/scripts/main.js: -------------------------------------------------------------------------------- 1 | /* jshint devel:true */ 2 | (function () 3 | { 4 | 5 | function AppController($scope, $log, $timeout) 6 | { 7 | const appCtrl = this; 8 | appCtrl.isPatching = false; 9 | appCtrl.headers = []; 10 | appCtrl.url = 'http://stockmarket.streamdata.io/v2/prices'; 11 | appCtrl.isConnected = false; 12 | appCtrl.errorMsg = null; 13 | 14 | let streamdata = null; 15 | 16 | appCtrl.popupPk = { 17 | content: 'An application token is required for authentication. Sign Up to get yours.', 18 | options: { 19 | title : null, 20 | placement: 'left', 21 | html : true, 22 | delay : {show: 0, hide: 1500} 23 | } 24 | }; 25 | appCtrl.popupHeaders = { 26 | content: 'Add any custom HTTP Header (optional)', 27 | options: { 28 | title : null, 29 | placement: 'left', 30 | html : true, 31 | delay : {show: 0, hide: 0} 32 | } 33 | }; 34 | appCtrl.popupSignature = { 35 | content: 'Sign your request with your application private key.', 36 | options: { 37 | title : null, 38 | placement: 'left', 39 | html : true, 40 | delay : {show: 0, hide: 0} 41 | } 42 | }; 43 | 44 | appCtrl.addHeader = function () 45 | { 46 | appCtrl.headers.push({name: "", value: ""}); 47 | }; 48 | 49 | appCtrl.removeHeader = function (index) 50 | { 51 | appCtrl.headers.splice(index, 1); 52 | appCtrl.headersToArray(); 53 | }; 54 | 55 | appCtrl.headersToArray = function () 56 | { 57 | const out = []; 58 | appCtrl.headers.forEach((header) => 59 | { 60 | out.push(header.name + ":" + header.value); 61 | }); 62 | return out; 63 | }; 64 | 65 | appCtrl.connect = function () 66 | { 67 | $log.info('Opening streamdataio connection with the url: ' + appCtrl.url); 68 | 69 | // extract headers 70 | let headers = []; 71 | 72 | if (appCtrl.headers.length > 0 && appCtrl.headers[0].name !== "" && appCtrl.headers[0].value !== "") { 73 | headers = appCtrl.headersToArray(appCtrl.headers); 74 | } 75 | 76 | let signatureStrategy = null; 77 | if (typeof AuthStrategy !== 'undefined' && appCtrl.signature) { 78 | // signature checkbox is checked: setup a signatureStrategy 79 | signatureStrategy = AuthStrategy.newSignatureStrategy(appCtrl.token, appCtrl.pk); 80 | } 81 | 82 | // create the Streamdata source 83 | streamdata = streamdataio.createEventSource(appCtrl.url, appCtrl.token, headers, signatureStrategy); 84 | 85 | // add a callback when the connection is opened 86 | streamdata.onOpen(() => 87 | { 88 | $log.info('Connection is opened'); 89 | appCtrl.datas = []; 90 | appCtrl.isConnected = true; 91 | }); 92 | 93 | // add a callback when data is sent by streamdata.io 94 | streamdata.onData((datas) => 95 | { 96 | $log.info('Received datas:' + JSON.stringify(datas)); 97 | $scope.$apply(() => 98 | { 99 | appCtrl.datas = datas; 100 | }); 101 | }); 102 | 103 | // add a callback when a patch is sent by streamdata.io 104 | streamdata.onPatch((patch) => 105 | { 106 | $scope.$apply(() => 107 | { 108 | if (!appCtrl.isPatching) { 109 | $log.info('Received patch:' + JSON.stringify(patch)); 110 | appCtrl.isPatching = true; 111 | // apply the json-patch to the array of values 112 | jsonpatch.applyPatch(appCtrl.datas, patch); 113 | appCtrl.isPatching = false; 114 | } 115 | }); 116 | }); 117 | 118 | // add a callback when an error occured 119 | streamdata.onError((error) => 120 | { 121 | $scope.$apply(() => 122 | { 123 | $log.error('Received an error: ' + error.message); 124 | appCtrl.disconnect(); 125 | appCtrl.errorMsg = error.message; 126 | $timeout(function () 127 | { 128 | appCtrl.errorMsg = null; 129 | }, 3000); 130 | }); 131 | 132 | }); 133 | 134 | // open the streamdata.io connection 135 | streamdata.open(); 136 | }; 137 | 138 | appCtrl.disconnect = () => 139 | { 140 | $log.info('Closing the connection of streamdataio'); 141 | 142 | streamdata && streamdata.close(); 143 | appCtrl.isConnected = false; 144 | appCtrl.isPatching = false; 145 | }; 146 | 147 | } 148 | 149 | angular 150 | .module('app', ['ngSanitize', 'ngMaterial']) 151 | .config(function ($mdThemingProvider) 152 | { 153 | $mdThemingProvider.theme('default') 154 | .primaryPalette('deep-purple') 155 | .accentPalette('amber') 156 | .warnPalette('red') 157 | .backgroundPalette('grey'); 158 | }) 159 | .controller('AppController', ['$scope', '$log', '$timeout', AppController]) 160 | .directive('popup', function () 161 | { 162 | return { 163 | restrict: 'A', 164 | require : 'ngModel', 165 | scope : { 166 | ngModel: '=', 167 | options: '=popup' 168 | }, 169 | link : function (scope, element) 170 | { 171 | scope.$watch('ngModel', function (val) 172 | { 173 | element.attr('data-content', val); 174 | }); 175 | 176 | const options = scope.options || {}; 177 | 178 | const title = options.title || null; 179 | const placement = options.placement || 'right'; 180 | const html = options.html || false; 181 | const delay = options.delay ? angular.toJson(options.delay) : null; 182 | const trigger = options.trigger || 'hover'; 183 | 184 | element.attr('title', title); 185 | element.attr('data-placement', placement); 186 | element.attr('data-html', html); 187 | element.attr('data-delay', delay); 188 | element.popover({trigger: trigger}); 189 | } 190 | }; 191 | }); 192 | })(); 193 | -------------------------------------------------------------------------------- /stockmarket-angular/styles/main.css: -------------------------------------------------------------------------------- 1 | .container { 2 | display: flex; 3 | flex-direction: column; 4 | } 5 | 6 | /* Header */ 7 | .header { 8 | display: flex; 9 | align-items: center; 10 | flex-direction: column; 11 | border-bottom: 1px solid #e5e5e5; 12 | } 13 | 14 | .header .header-title { 15 | display: flex; 16 | align-items: center; 17 | } 18 | 19 | /* Content */ 20 | .content { 21 | display: flex; 22 | align-items: center; 23 | flex-direction: column; 24 | margin-top: 10px; 25 | } 26 | 27 | .content .form { 28 | width: 65%; 29 | padding: 30px; 30 | } 31 | 32 | .content .form .input-full { 33 | width: 100%; 34 | } 35 | 36 | .content .form .input-help-container { 37 | display: flex; 38 | flex-direction: row-reverse; 39 | justify-content: space-between; 40 | } 41 | 42 | .content .form .input-help-container label { 43 | position: relative; 44 | } 45 | 46 | .content .form .switch-help-container { 47 | display: flex; 48 | flex-direction: row-reverse; 49 | justify-content: space-between; 50 | } 51 | 52 | .content .form .link-help-container { 53 | display: flex; 54 | flex-direction: row-reverse; 55 | justify-content: space-between; 56 | } 57 | 58 | .content .form .input-help-container img, 59 | .content .form .switch-help-container img, 60 | .content .form .link-help-container img { 61 | align-self: center; 62 | } 63 | 64 | .content .form .actions { 65 | display: flex; 66 | justify-content: flex-end; 67 | } 68 | 69 | .content .table { 70 | padding: 30px; 71 | } 72 | 73 | .footer { 74 | margin-top: 20px; 75 | display: flex; 76 | justify-content: space-between; 77 | } 78 | -------------------------------------------------------------------------------- /stockmarket-angular2/.angular-cli.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json", 3 | "project": { 4 | "name": "streamdataio-angular" 5 | }, 6 | "apps": [ 7 | { 8 | "root": "src", 9 | "outDir": "dist", 10 | "assets": [ 11 | "assets", 12 | "favicon.ico" 13 | ], 14 | "index": "index.html", 15 | "main": "main.ts", 16 | "polyfills": "polyfills.ts", 17 | "test": "test.ts", 18 | "tsconfig": "tsconfig.app.json", 19 | "testTsconfig": "tsconfig.spec.json", 20 | "prefix": "app", 21 | "styles": [ 22 | "styles.css" 23 | ], 24 | "scripts": [], 25 | "environmentSource": "environments/environment.ts", 26 | "environments": { 27 | "dev": "environments/environment.ts", 28 | "prod": "environments/environment.prod.ts" 29 | } 30 | } 31 | ], 32 | "e2e": { 33 | "protractor": { 34 | "config": "./protractor.conf.js" 35 | } 36 | }, 37 | "lint": [ 38 | { 39 | "project": "src/tsconfig.app.json" 40 | }, 41 | { 42 | "project": "src/tsconfig.spec.json" 43 | }, 44 | { 45 | "project": "e2e/tsconfig.e2e.json" 46 | } 47 | ], 48 | "test": { 49 | "karma": { 50 | "config": "./karma.conf.js" 51 | } 52 | }, 53 | "defaults": { 54 | "styleExt": "css", 55 | "component": {} 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /stockmarket-angular2/.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 | -------------------------------------------------------------------------------- /stockmarket-angular2/.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /dist 5 | /tmp 6 | /out-tsc 7 | 8 | # dependencies 9 | /node_modules 10 | 11 | # IDEs and editors 12 | /.idea 13 | .project 14 | .classpath 15 | .c9/ 16 | *.launch 17 | .settings/ 18 | *.sublime-workspace 19 | 20 | # IDE - VSCode 21 | .vscode/* 22 | !.vscode/settings.json 23 | !.vscode/tasks.json 24 | !.vscode/launch.json 25 | !.vscode/extensions.json 26 | 27 | # misc 28 | /.sass-cache 29 | /connect.lock 30 | /coverage 31 | /libpeerconnection.log 32 | npm-debug.log 33 | testem.log 34 | /typings 35 | 36 | # e2e 37 | /e2e/*.js 38 | /e2e/*.map 39 | 40 | # System Files 41 | .DS_Store 42 | Thumbs.db 43 | -------------------------------------------------------------------------------- /stockmarket-angular2/README.md: -------------------------------------------------------------------------------- 1 | # Axway AMPLIFY Streams Angular 2 | 3 | This sample application shows how to use the Axway AMPLIFY Streams Javascript SDK with Angular. 4 | 5 | The Axway AMPLIFY Streams JavaScript SDK allows the use of [Axway AMPLIFY Streams](https://streamdata.io) to get data pushed from various sources and use them in your application. 6 | 7 | This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.1.1. 8 | 9 | ## Testing this project 10 | 11 | Run 12 | 13 | ```bash 14 | 15 | npm install -g @angular/cli 16 | npm install 17 | ng serve 18 | 19 | ``` 20 | 21 | Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files. 22 | 23 | In your browser, you will need to enter your Axway AMPLIFY Streams token. If you don't have one, you can get it for free at [Axway AMPLIFY Streams portal](https://portal.streamdata.io). 24 | 25 | This demo uses fake market data emulated by our public API : http://stockmarket.streamdata.io/v2/prices 26 | 27 | ## Contributing 28 | 29 | Please read [Contributing.md](https://github.com/axway-amplify-streams/Common/blob/master/Contributing.md) for details on our code of conduct, and the process for submitting pull requests to us. 30 | 31 | ## Team 32 | 33 | ![alt text][Axwaylogo] Axway Team 34 | 35 | [Axwaylogo]: https://github.com/axway-amplify-streams/Common/blob/master/img/AxwayLogoSmall.png "Axway logo" 36 | 37 | ## License 38 | 39 | [Apache License 2.0](https://github.com/axway-amplify-streams/Common/blob/master/LICENSE) 40 | -------------------------------------------------------------------------------- /stockmarket-angular2/e2e/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { StreamdataioAngularPage } from './app.po'; 2 | 3 | describe('streamdataio-angular App', () => { 4 | let page: StreamdataioAngularPage; 5 | 6 | beforeEach(() => { 7 | page = new StreamdataioAngularPage(); 8 | }); 9 | 10 | it('should display welcome message', () => { 11 | page.navigateTo(); 12 | expect(page.getParagraphText()).toEqual('Welcome to app!!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /stockmarket-angular2/e2e/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class StreamdataioAngularPage { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getParagraphText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /stockmarket-angular2/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/e2e", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types": [ 8 | "jasmine", 9 | "node" 10 | ] 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /stockmarket-angular2/karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration file, see link for more information 2 | // https://karma-runner.github.io/0.13/config/configuration-file.html 3 | 4 | module.exports = function (config) { 5 | config.set({ 6 | basePath: '', 7 | frameworks: ['jasmine', '@angular/cli'], 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('@angular/cli/plugins/karma') 14 | ], 15 | client:{ 16 | clearContext: false // leave Jasmine Spec Runner output visible in browser 17 | }, 18 | coverageIstanbulReporter: { 19 | reports: [ 'html', 'lcovonly' ], 20 | fixWebpackSourcePaths: true 21 | }, 22 | angularCli: { 23 | environment: 'dev' 24 | }, 25 | reporters: ['progress', 'kjhtml'], 26 | port: 9876, 27 | colors: true, 28 | logLevel: config.LOG_INFO, 29 | autoWatch: true, 30 | browsers: ['Chrome'], 31 | singleRun: false 32 | }); 33 | }; 34 | -------------------------------------------------------------------------------- /stockmarket-angular2/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "stockmarket-angular2", 3 | "version": "1.0.0", 4 | "license": "MIT", 5 | "scripts": { 6 | "ng": "ng", 7 | "start": "ng serve", 8 | "build": "ng build", 9 | "test": "ng test", 10 | "lint": "ng lint", 11 | "e2e": "ng e2e" 12 | }, 13 | "private": true, 14 | "dependencies": { 15 | "@angular/animations": "^4.4.7", 16 | "@angular/cdk": "2.0.0-beta.8", 17 | "@angular/common": "^4.4.7", 18 | "@angular/compiler": "^4.4.7", 19 | "@angular/core": "^4.4.7", 20 | "@angular/forms": "^4.4.7", 21 | "@angular/http": "^4.4.7", 22 | "@angular/material": "2.0.0-beta.8", 23 | "@angular/platform-browser": "^4.4.7", 24 | "@angular/platform-browser-dynamic": "^4.4.7", 25 | "@angular/router": "^4.4.7", 26 | "@ng-bootstrap/ng-bootstrap": "1.0.0-alpha.28", 27 | "bootstrap": "^3.4.1", 28 | "core-js": "^2.6.9", 29 | "fast-json-patch": "^2.1.0", 30 | "rxjs": "^5.5.12", 31 | "streamdataio-js-sdk": "^2.0.2", 32 | "zone.js": "^0.8.29" 33 | }, 34 | "devDependencies": { 35 | "@angular/cli": "1.1.1", 36 | "@angular/compiler-cli": "^4.4.7", 37 | "@angular/language-service": "^4.4.7", 38 | "@types/jasmine": "2.5.45", 39 | "@types/node": "^6.14.6", 40 | "adm-zip": "^0.4.11", 41 | "braces": "^2.3.1", 42 | "codelyzer": "~3.0.1", 43 | "fstream": "^1.0.12", 44 | "handlebars": "^4.0.14", 45 | "https-proxy-agent": "^2.2.0", 46 | "jasmine-core": "^2.99.1", 47 | "jasmine-spec-reporter": "^4.1.1", 48 | "karma": "~1.7.0", 49 | "karma-chrome-launcher": "~2.1.1", 50 | "karma-cli": "~1.0.1", 51 | "karma-coverage-istanbul-reporter": "^1.4.3", 52 | "karma-jasmine": "^1.1.2", 53 | "karma-jasmine-html-reporter": "^0.2.2", 54 | "npm": "^6.9.0", 55 | "protractor": "~5.1.2", 56 | "sshpk": "^1.13.2", 57 | "ts-node": "~3.0.4", 58 | "tslint": "~5.3.2", 59 | "typescript": "~2.3.3", 60 | "ws": "^3.3.1" 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /stockmarket-angular2/protractor.conf.js: -------------------------------------------------------------------------------- 1 | // Protractor configuration file, see link for more information 2 | // https://github.com/angular/protractor/blob/master/lib/config.ts 3 | 4 | const { SpecReporter } = require('jasmine-spec-reporter'); 5 | 6 | exports.config = { 7 | allScriptsTimeout: 11000, 8 | specs: [ 9 | './e2e/**/*.e2e-spec.ts' 10 | ], 11 | capabilities: { 12 | 'browserName': 'chrome' 13 | }, 14 | directConnect: true, 15 | baseUrl: 'http://localhost:4200/', 16 | framework: 'jasmine', 17 | jasmineNodeOpts: { 18 | showColors: true, 19 | defaultTimeoutInterval: 30000, 20 | print: function() {} 21 | }, 22 | onPrepare() { 23 | require('ts-node').register({ 24 | project: 'e2e/tsconfig.e2e.json' 25 | }); 26 | jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); 27 | } 28 | }; 29 | -------------------------------------------------------------------------------- /stockmarket-angular2/src/app/app.component.css: -------------------------------------------------------------------------------- 1 | .container { 2 | display: flex; 3 | flex-direction: column; 4 | } 5 | 6 | .progress { 7 | width:100%; 8 | margin-bottom:10px; 9 | } 10 | 11 | /* Header */ 12 | .header { 13 | display: flex; 14 | align-items: center; 15 | flex-direction: column; 16 | border-bottom: 1px solid #e5e5e5; 17 | } 18 | 19 | .header .header-title { 20 | display: flex; 21 | align-items: center; 22 | } 23 | 24 | /* Content */ 25 | .content { 26 | display: flex; 27 | align-items: center; 28 | flex-direction: column; 29 | margin-top: 10px; 30 | } 31 | 32 | .content .form { 33 | width: 50%; 34 | padding: 30px; 35 | } 36 | .content .form .input-full { 37 | width:100%; 38 | } 39 | 40 | .content .form .actions { 41 | display: flex; 42 | justify-content: flex-end; 43 | } 44 | 45 | .content .table { 46 | padding: 30px; 47 | } 48 | -------------------------------------------------------------------------------- /stockmarket-angular2/src/app/app.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 |

Stock-Market demo with 6 |

7 |
8 | 9 |
10 |

An application token is required for authentication. Sign Up to get yours.

11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 |
20 | 23 |
24 |
25 | 28 |
29 |
30 |
31 |
32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 |
titlecompanytickerpricevolume
{{item.title}}{{item.company}}{{item.ticker}}{{item.last}}{{item.volume}}
54 |
Disclaimer: data is emulated and does not reflect the actual market data.
55 |
56 |
57 |
58 | -------------------------------------------------------------------------------- /stockmarket-angular2/src/app/app.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed, async } from '@angular/core/testing'; 2 | 3 | import { AppComponent } from './app.component'; 4 | 5 | describe('AppComponent', () => { 6 | beforeEach(async(() => { 7 | TestBed.configureTestingModule({ 8 | declarations: [ 9 | AppComponent 10 | ], 11 | }).compileComponents(); 12 | })); 13 | 14 | it('should create the app', async(() => { 15 | const fixture = TestBed.createComponent(AppComponent); 16 | const app = fixture.debugElement.componentInstance; 17 | expect(app).toBeTruthy(); 18 | })); 19 | 20 | it(`should have as title 'app'`, async(() => { 21 | const fixture = TestBed.createComponent(AppComponent); 22 | const app = fixture.debugElement.componentInstance; 23 | expect(app.title).toEqual('app'); 24 | })); 25 | 26 | it('should render title in a h1 tag', async(() => { 27 | const fixture = TestBed.createComponent(AppComponent); 28 | fixture.detectChanges(); 29 | const compiled = fixture.debugElement.nativeElement; 30 | expect(compiled.querySelector('h1').textContent).toContain('Welcome to app!!'); 31 | })); 32 | }); 33 | -------------------------------------------------------------------------------- /stockmarket-angular2/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import {Component} from '@angular/core'; 2 | import {StreamData, StreamDataError, StreamDataIo} from 'streamdataio-js-sdk'; 3 | import {applyPatch} from 'fast-json-patch'; 4 | import {StockMarket} from '../shared/StockMarket'; 5 | 6 | @Component({ 7 | selector: 'app-root', 8 | templateUrl: './app.component.html', 9 | styleUrls: ['./app.component.css'] 10 | }) 11 | export class AppComponent { 12 | // Private 13 | private streamData: StreamData; 14 | // Public for bunding 15 | token: string = ""; 16 | url: string = "http://stockmarket.streamdata.io/v2/prices"; 17 | result: StockMarket[]; 18 | 19 | public connect(): void { 20 | 21 | // If ever you wish to get the whole data instead of patches: 22 | // headers = ["Accept: application/json"]; 23 | let headers = []; 24 | 25 | if (this.isConnected) { 26 | this.streamData.close(); 27 | } 28 | 29 | this.streamData = StreamDataIo.createEventSource(this.url, this.token, headers); 30 | 31 | this.streamData 32 | .onOpen(() => { 33 | // you can also add custom behavior when the stream is opened 34 | console.log('open'); 35 | this.result = []; 36 | }) 37 | .onData((data: StockMarket[]) => { 38 | // initialize your data with the initial snapshot 39 | console.log('--------------- on data ---------------'); 40 | console.log('data: ' + data); 41 | this.result = data; 42 | console.log('--------------- end on data ---------------'); 43 | 44 | }, this) 45 | .onPatch((patch) => { 46 | // update the data with the provided patch// update the data with the provided patch 47 | console.log('--------------- on patch ---------------'); 48 | // console.log('patch: %o', patch); 49 | console.log('patch:'); 50 | 51 | applyPatch(this.result, patch); 52 | 53 | console.log('result patched:'); 54 | console.log('--------------- end on patch ---------------'); 55 | 56 | }, this) 57 | .onError((error: StreamDataError) => { 58 | // do whatever you need in case of error 59 | console.log('error: %o', error); 60 | this.streamData.close(); 61 | }); 62 | 63 | this.streamData.open(); 64 | } 65 | 66 | public disconnect(): void { 67 | this.streamData && this.streamData.close(); 68 | this.streamData = null; 69 | } 70 | 71 | public get isConnected(): boolean { 72 | return !!this.streamData && this.streamData.isConnected(); 73 | } 74 | 75 | } 76 | -------------------------------------------------------------------------------- /stockmarket-angular2/src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import {BrowserModule} from '@angular/platform-browser'; 2 | import {NgModule} from '@angular/core'; 3 | import { FormsModule } from '@angular/forms'; 4 | 5 | import {BrowserAnimationsModule} from '@angular/platform-browser/animations'; 6 | import {MdButtonModule, MdIconModule, MdInputModule,MdProgressBarModule} from '@angular/material'; 7 | 8 | import {NgbModule} from '@ng-bootstrap/ng-bootstrap'; 9 | 10 | import {AppComponent} from './app.component'; 11 | 12 | @NgModule({ 13 | declarations: [ 14 | AppComponent 15 | ], 16 | imports: [ 17 | BrowserModule, 18 | NgbModule, 19 | FormsModule, 20 | BrowserAnimationsModule, 21 | MdInputModule, 22 | MdButtonModule, 23 | MdProgressBarModule, 24 | MdIconModule 25 | ], 26 | providers: [], 27 | bootstrap: [AppComponent] 28 | }) 29 | export class AppModule { 30 | } 31 | -------------------------------------------------------------------------------- /stockmarket-angular2/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/axway-streams/axway-amplify-streams-js/d8ee9481907ea9e7556f3eab73224838b881276a/stockmarket-angular2/src/assets/.gitkeep -------------------------------------------------------------------------------- /stockmarket-angular2/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /stockmarket-angular2/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // The file contents for the current environment will overwrite these during build. 2 | // The build system defaults to the dev environment which uses `environment.ts`, but if you do 3 | // `ng build --env=prod` then `environment.prod.ts` will be used instead. 4 | // The list of which env maps to which file can be found in `.angular-cli.json`. 5 | 6 | export const environment = { 7 | production: false 8 | }; 9 | -------------------------------------------------------------------------------- /stockmarket-angular2/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/axway-streams/axway-amplify-streams-js/d8ee9481907ea9e7556f3eab73224838b881276a/stockmarket-angular2/src/favicon.ico -------------------------------------------------------------------------------- /stockmarket-angular2/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Streamdata.io Stock-Market made with Angular 6 | 7 | 8 | 9 | 10 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /stockmarket-angular2/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule); 12 | -------------------------------------------------------------------------------- /stockmarket-angular2/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 to support `@angular/animation`. */ 41 | // import 'web-animations-js'; // Run `npm install --save web-animations-js`. 42 | 43 | 44 | /** Evergreen browsers require these. **/ 45 | import 'core-js/es6/reflect'; 46 | import 'core-js/es7/reflect'; 47 | 48 | 49 | /** ALL Firefox browsers require the following to support `@angular/animation`. **/ 50 | // import 'web-animations-js'; // Run `npm install --save web-animations-js`. 51 | 52 | 53 | 54 | /*************************************************************************************************** 55 | * Zone JS is required by Angular itself. 56 | */ 57 | import 'zone.js/dist/zone'; // Included with Angular CLI. 58 | 59 | 60 | 61 | /*************************************************************************************************** 62 | * APPLICATION IMPORTS 63 | */ 64 | 65 | /** 66 | * Date, currency, decimal and percent pipes. 67 | * Needed for: All but Chrome, Firefox, Edge, IE11 and Safari 10 68 | */ 69 | // import 'intl'; // Run `npm install --save intl`. 70 | /** 71 | * Need to import at least one locale-data with intl. 72 | */ 73 | // import 'intl/locale-data/jsonp/en'; 74 | -------------------------------------------------------------------------------- /stockmarket-angular2/src/shared/StockMarket.ts: -------------------------------------------------------------------------------- 1 | export interface StockMarket { 2 | 3 | title: string; 4 | price: number; 5 | param1: string; 6 | param2: string; 7 | param3: string; 8 | param4: string; 9 | param5: string; 10 | param6: string; 11 | param7: string; 12 | param8: string; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /stockmarket-angular2/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | @import '~@angular/material/prebuilt-themes/deeppurple-amber.css'; 3 | @import '~bootstrap/dist/css/bootstrap.min.css'; 4 | -------------------------------------------------------------------------------- /stockmarket-angular2/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/long-stack-trace-zone'; 4 | import 'zone.js/dist/proxy.js'; 5 | import 'zone.js/dist/sync-test'; 6 | import 'zone.js/dist/jasmine-patch'; 7 | import 'zone.js/dist/async-test'; 8 | import 'zone.js/dist/fake-async-test'; 9 | import { getTestBed } from '@angular/core/testing'; 10 | import { 11 | BrowserDynamicTestingModule, 12 | platformBrowserDynamicTesting 13 | } from '@angular/platform-browser-dynamic/testing'; 14 | 15 | // Unfortunately there's no typing for the `__karma__` variable. Just declare it as any. 16 | declare const __karma__: any; 17 | declare const require: any; 18 | 19 | // Prevent Karma from running prematurely. 20 | __karma__.loaded = function () {}; 21 | 22 | // First, initialize the Angular testing environment. 23 | getTestBed().initTestEnvironment( 24 | BrowserDynamicTestingModule, 25 | platformBrowserDynamicTesting() 26 | ); 27 | // Then we find all the tests. 28 | const context = require.context('./', true, /\.spec\.ts$/); 29 | // And load the modules. 30 | context.keys().map(context); 31 | // Finally, start Karma to run the tests. 32 | __karma__.start(); 33 | -------------------------------------------------------------------------------- /stockmarket-angular2/src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "module": "es2015", 6 | "baseUrl": "", 7 | "types": [] 8 | }, 9 | "exclude": [ 10 | "test.ts", 11 | "**/*.spec.ts" 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /stockmarket-angular2/src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "baseUrl": "", 8 | "types": [ 9 | "jasmine", 10 | "node" 11 | ] 12 | }, 13 | "files": [ 14 | "test.ts" 15 | ], 16 | "include": [ 17 | "**/*.spec.ts", 18 | "**/*.d.ts" 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /stockmarket-angular2/src/typings.d.ts: -------------------------------------------------------------------------------- 1 | /* SystemJS module definition */ 2 | declare var module: NodeModule; 3 | interface NodeModule { 4 | id: string; 5 | } 6 | -------------------------------------------------------------------------------- /stockmarket-angular2/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "outDir": "./dist/out-tsc", 5 | "baseUrl": "src", 6 | "sourceMap": true, 7 | "declaration": false, 8 | "moduleResolution": "node", 9 | "emitDecoratorMetadata": true, 10 | "experimentalDecorators": true, 11 | "target": "es5", 12 | "typeRoots": [ 13 | "node_modules/@types" 14 | ], 15 | "lib": [ 16 | "es2016", 17 | "dom" 18 | ] 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /stockmarket-angular2/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "rulesDirectory": [ 3 | "node_modules/codelyzer" 4 | ], 5 | "rules": { 6 | "arrow-return-shorthand": true, 7 | "callable-types": true, 8 | "class-name": true, 9 | "comment-format": [ 10 | true, 11 | "check-space" 12 | ], 13 | "curly": true, 14 | "eofline": true, 15 | "forin": true, 16 | "import-blacklist": [ 17 | true, 18 | "rxjs" 19 | ], 20 | "import-spacing": true, 21 | "indent": [ 22 | true, 23 | "spaces" 24 | ], 25 | "interface-over-type-literal": true, 26 | "label-position": true, 27 | "max-line-length": [ 28 | true, 29 | 140 30 | ], 31 | "member-access": false, 32 | "member-ordering": [ 33 | true, 34 | "static-before-instance", 35 | "variables-before-functions" 36 | ], 37 | "no-arg": true, 38 | "no-bitwise": true, 39 | "no-console": [ 40 | true, 41 | "debug", 42 | "info", 43 | "time", 44 | "timeEnd", 45 | "trace" 46 | ], 47 | "no-construct": true, 48 | "no-debugger": true, 49 | "no-duplicate-super": true, 50 | "no-empty": false, 51 | "no-empty-interface": true, 52 | "no-eval": true, 53 | "no-inferrable-types": [ 54 | true, 55 | "ignore-params" 56 | ], 57 | "no-misused-new": true, 58 | "no-non-null-assertion": true, 59 | "no-shadowed-variable": true, 60 | "no-string-literal": false, 61 | "no-string-throw": true, 62 | "no-switch-case-fall-through": true, 63 | "no-trailing-whitespace": true, 64 | "no-unnecessary-initializer": true, 65 | "no-unused-expression": true, 66 | "no-use-before-declare": true, 67 | "no-var-keyword": true, 68 | "object-literal-sort-keys": false, 69 | "one-line": [ 70 | true, 71 | "check-open-brace", 72 | "check-catch", 73 | "check-else", 74 | "check-whitespace" 75 | ], 76 | "prefer-const": true, 77 | "quotemark": [ 78 | true, 79 | "single" 80 | ], 81 | "radix": true, 82 | "semicolon": [ 83 | "always" 84 | ], 85 | "triple-equals": [ 86 | true, 87 | "allow-null-check" 88 | ], 89 | "typedef-whitespace": [ 90 | true, 91 | { 92 | "call-signature": "nospace", 93 | "index-signature": "nospace", 94 | "parameter": "nospace", 95 | "property-declaration": "nospace", 96 | "variable-declaration": "nospace" 97 | } 98 | ], 99 | "typeof-compare": true, 100 | "unified-signatures": true, 101 | "variable-name": false, 102 | "whitespace": [ 103 | true, 104 | "check-branch", 105 | "check-decl", 106 | "check-operator", 107 | "check-separator", 108 | "check-type" 109 | ], 110 | "directive-selector": [ 111 | true, 112 | "attribute", 113 | "app", 114 | "camelCase" 115 | ], 116 | "component-selector": [ 117 | true, 118 | "element", 119 | "app", 120 | "kebab-case" 121 | ], 122 | "use-input-property-decorator": true, 123 | "use-output-property-decorator": true, 124 | "use-host-property-decorator": true, 125 | "no-input-rename": true, 126 | "no-output-rename": true, 127 | "use-life-cycle-interface": true, 128 | "use-pipe-transform-interface": true, 129 | "component-class-suffix": true, 130 | "directive-class-suffix": true, 131 | "no-access-missing-member": true, 132 | "templates-use-public": true, 133 | "invoke-injectable": true 134 | } 135 | } 136 | -------------------------------------------------------------------------------- /stockmarket-angular8/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see https://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 | -------------------------------------------------------------------------------- /stockmarket-angular8/.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /dist 5 | /tmp 6 | /out-tsc 7 | 8 | # dependencies 9 | /node_modules 10 | 11 | # profiling files 12 | chrome-profiler-events.json 13 | speed-measure-plugin.json 14 | 15 | # IDEs and editors 16 | /.idea 17 | .project 18 | .classpath 19 | .c9/ 20 | *.launch 21 | .settings/ 22 | *.sublime-workspace 23 | 24 | # IDE - VSCode 25 | .vscode/* 26 | !.vscode/settings.json 27 | !.vscode/tasks.json 28 | !.vscode/launch.json 29 | !.vscode/extensions.json 30 | 31 | # misc 32 | /.sass-cache 33 | /connect.lock 34 | /coverage 35 | /libpeerconnection.log 36 | npm-debug.log 37 | yarn-error.log 38 | testem.log 39 | /typings 40 | 41 | # System Files 42 | .DS_Store 43 | Thumbs.db 44 | -------------------------------------------------------------------------------- /stockmarket-angular8/README.md: -------------------------------------------------------------------------------- 1 | # StockmarketAngular8 2 | 3 | This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 8.3.20. 4 | 5 | Run 6 | ``` 7 | $ npm install -g @angular/cli 8 | $ npm install 9 | $ ng serve --open 10 | ``` 11 | 12 | ## Development server 13 | 14 | Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files. 15 | 16 | ## Code scaffolding 17 | 18 | Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`. 19 | 20 | ## Build 21 | 22 | Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build. 23 | 24 | ## Running unit tests 25 | 26 | Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). 27 | 28 | ## Running end-to-end tests 29 | 30 | Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/). 31 | 32 | ## Further help 33 | 34 | To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md). 35 | -------------------------------------------------------------------------------- /stockmarket-angular8/angular.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json", 3 | "version": 1, 4 | "newProjectRoot": "projects", 5 | "projects": { 6 | "stockmarket-angular8": { 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/stockmarket-angular8", 17 | "index": "src/index.html", 18 | "main": "src/main.ts", 19 | "polyfills": "src/polyfills.ts", 20 | "tsConfig": "src/tsconfig.app.json", 21 | "assets": [ 22 | "src/favicon.ico", 23 | "src/assets" 24 | ], 25 | "styles": [ 26 | "src/styles.css" 27 | ], 28 | "scripts": [] 29 | }, 30 | "configurations": { 31 | "production": { 32 | "fileReplacements": [ 33 | { 34 | "replace": "src/environments/environment.ts", 35 | "with": "src/environments/environment.prod.ts" 36 | } 37 | ], 38 | "optimization": true, 39 | "outputHashing": "all", 40 | "sourceMap": false, 41 | "extractCss": true, 42 | "namedChunks": false, 43 | "aot": true, 44 | "extractLicenses": true, 45 | "vendorChunk": false, 46 | "buildOptimizer": true, 47 | "budgets": [ 48 | { 49 | "type": "initial", 50 | "maximumWarning": "2mb", 51 | "maximumError": "5mb" 52 | } 53 | ] 54 | } 55 | } 56 | }, 57 | "serve": { 58 | "builder": "@angular-devkit/build-angular:dev-server", 59 | "options": { 60 | "browserTarget": "stockmarket-angular8:build" 61 | }, 62 | "configurations": { 63 | "production": { 64 | "browserTarget": "stockmarket-angular8:build:production" 65 | } 66 | } 67 | }, 68 | "extract-i18n": { 69 | "builder": "@angular-devkit/build-angular:extract-i18n", 70 | "options": { 71 | "browserTarget": "stockmarket-angular8:build" 72 | } 73 | }, 74 | "test": { 75 | "builder": "@angular-devkit/build-angular:karma", 76 | "options": { 77 | "main": "src/test.ts", 78 | "polyfills": "src/polyfills.ts", 79 | "tsConfig": "src/tsconfig.spec.json", 80 | "karmaConfig": "src/karma.conf.js", 81 | "styles": [ 82 | "src/styles.css" 83 | ], 84 | "scripts": [], 85 | "assets": [ 86 | "src/favicon.ico", 87 | "src/assets" 88 | ] 89 | } 90 | }, 91 | "lint": { 92 | "builder": "@angular-devkit/build-angular:tslint", 93 | "options": { 94 | "tsConfig": [ 95 | "src/tsconfig.app.json", 96 | "src/tsconfig.spec.json" 97 | ], 98 | "exclude": [ 99 | "**/node_modules/**" 100 | ] 101 | } 102 | } 103 | } 104 | }, 105 | "stockmarket-angular8-e2e": { 106 | "root": "e2e/", 107 | "projectType": "application", 108 | "prefix": "", 109 | "architect": { 110 | "e2e": { 111 | "builder": "@angular-devkit/build-angular:protractor", 112 | "options": { 113 | "protractorConfig": "e2e/protractor.conf.js", 114 | "devServerTarget": "stockmarket-angular8:serve" 115 | }, 116 | "configurations": { 117 | "production": { 118 | "devServerTarget": "stockmarket-angular8:serve:production" 119 | } 120 | } 121 | }, 122 | "lint": { 123 | "builder": "@angular-devkit/build-angular:tslint", 124 | "options": { 125 | "tsConfig": "e2e/tsconfig.e2e.json", 126 | "exclude": [ 127 | "**/node_modules/**" 128 | ] 129 | } 130 | } 131 | } 132 | } 133 | }, 134 | "defaultProject": "stockmarket-angular8" 135 | } 136 | -------------------------------------------------------------------------------- /stockmarket-angular8/browserslist: -------------------------------------------------------------------------------- 1 | # This file is currently used by autoprefixer to adjust CSS to support the below specified browsers 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | # 5 | # For IE 9-11 support, please remove 'not' from the last line of the file and adjust as needed 6 | 7 | > 0.5% 8 | last 2 versions 9 | Firefox ESR 10 | not dead 11 | not IE 9-11 -------------------------------------------------------------------------------- /stockmarket-angular8/e2e/protractor.conf.js: -------------------------------------------------------------------------------- 1 | // Protractor configuration file, see link for more information 2 | // https://github.com/angular/protractor/blob/master/lib/config.ts 3 | 4 | const { SpecReporter } = require('jasmine-spec-reporter'); 5 | 6 | exports.config = { 7 | allScriptsTimeout: 11000, 8 | specs: [ 9 | './src/**/*.e2e-spec.ts' 10 | ], 11 | capabilities: { 12 | 'browserName': 'chrome' 13 | }, 14 | directConnect: true, 15 | baseUrl: 'http://localhost:4200/', 16 | framework: 'jasmine', 17 | jasmineNodeOpts: { 18 | showColors: true, 19 | defaultTimeoutInterval: 30000, 20 | print: function() {} 21 | }, 22 | onPrepare() { 23 | require('ts-node').register({ 24 | project: require('path').join(__dirname, './tsconfig.e2e.json') 25 | }); 26 | jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); 27 | } 28 | }; -------------------------------------------------------------------------------- /stockmarket-angular8/e2e/src/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | 3 | describe('workspace-project App', () => { 4 | let page: AppPage; 5 | 6 | beforeEach(() => { 7 | page = new AppPage(); 8 | }); 9 | 10 | it('should display title message', () => { 11 | page.navigateTo(); 12 | expect(page.getTitleText()).toContain('Stock Market demo'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /stockmarket-angular8/e2e/src/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getTitleText() { 9 | return element(by.css('app-root h3')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /stockmarket-angular8/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types": [ 8 | "jasmine", 9 | "jasminewd2", 10 | "node" 11 | ] 12 | } 13 | } -------------------------------------------------------------------------------- /stockmarket-angular8/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "stockmarket-angular8", 3 | "version": "0.0.0", 4 | "scripts": { 5 | "ng": "ng", 6 | "start": "ng serve", 7 | "build": "ng build", 8 | "test": "ng test", 9 | "lint": "ng lint", 10 | "e2e": "ng e2e" 11 | }, 12 | "private": true, 13 | "dependencies": { 14 | "@angular/animations": "^8.2.14", 15 | "@angular/cdk": "^8.2.3", 16 | "@angular/common": "~8.2.14", 17 | "@angular/compiler": "~8.2.14", 18 | "@angular/core": "~8.2.14", 19 | "@angular/forms": "~8.2.14", 20 | "@angular/material": "^8.2.3", 21 | "@angular/platform-browser": "~8.2.14", 22 | "@angular/platform-browser-dynamic": "~8.2.14", 23 | "@angular/router": "~8.2.14", 24 | "core-js": "^2.5.4", 25 | "fast-json-patch": "^2.0.3", 26 | "rxjs": "~6.5.3", 27 | "streamdataio-js-sdk": "^2.0.2", 28 | "tslib": "^1.9.0", 29 | "zone.js": "~0.9.1", 30 | "lodash": "^4.17.15" 31 | }, 32 | "devDependencies": { 33 | "@angular-devkit/build-angular": "~0.803.20", 34 | "@angular/cli": "~8.3.20", 35 | "@angular/compiler-cli": "~8.2.14", 36 | "@angular/language-service": "~8.2.14", 37 | "@types/jasmine": "~2.8.8", 38 | "@types/jasminewd2": "~2.0.3", 39 | "@types/node": "~8.9.4", 40 | "axobject-query": "^2.1.1", 41 | "codelyzer": "^5.0.1", 42 | "eslint": "^5.16.0", 43 | "jasmine-core": "~2.99.1", 44 | "jasmine-spec-reporter": "~4.2.1", 45 | "karma": "^4.4.1", 46 | "karma-chrome-launcher": "~2.2.0", 47 | "karma-coverage-istanbul-reporter": "~2.0.1", 48 | "karma-jasmine": "~1.1.2", 49 | "karma-jasmine-html-reporter": "^0.2.2", 50 | "protractor": "~5.4.0", 51 | "ts-node": "~7.0.0", 52 | "tslint": "~5.11.0", 53 | "typescript": "~3.5.3" 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /stockmarket-angular8/src/app/app.component.css: -------------------------------------------------------------------------------- 1 | .container { 2 | display: flex; 3 | flex-direction: column; 4 | font-family: Roboto,"Helvetica Neue",sans-serif; 5 | } 6 | 7 | .progress { 8 | width:100%; 9 | margin-bottom:10px; 10 | } 11 | 12 | /* Header */ 13 | .header { 14 | display: flex; 15 | align-items: center; 16 | flex-direction: row; 17 | justify-content: space-around; 18 | border-bottom: 1px solid #e5e5e5; 19 | } 20 | 21 | .header .header-title { 22 | display: flex; 23 | align-items: center; 24 | } 25 | 26 | /* Content */ 27 | .content { 28 | display: flex; 29 | align-items: center; 30 | flex-direction: column; 31 | margin-top: 10px; 32 | } 33 | 34 | .content .form { 35 | width: 50%; 36 | padding: 30px; 37 | } 38 | .content .form .input-full { 39 | width: 100%; 40 | } 41 | 42 | .content .form .actions { 43 | display: flex; 44 | justify-content: flex-end; 45 | } 46 | 47 | table { 48 | width: 100%; 49 | } 50 | -------------------------------------------------------------------------------- /stockmarket-angular8/src/app/app.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 |

Stock Market demo with 6 |

7 |
8 | 9 |
10 |

An application token is required for authentication. Sign Up to get yours.

11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 |
20 | 23 |
24 |
25 | 28 |
29 |
30 |
31 |
32 |
33 | 34 | 35 | 36 | {{column.label}} 37 | {{element[column.name]}} 38 | 39 | 40 | 41 |
42 |
Disclaimer: data is emulated and does not reflect the actual market data.
43 |
44 |
45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /stockmarket-angular8/src/app/app.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed, async } from '@angular/core/testing'; 2 | import { AppComponent } from './app.component'; 3 | import {MatFormFieldModule} from '@angular/material/form-field'; 4 | import {MatButtonModule} from '@angular/material/button'; 5 | import {MatIconModule} from '@angular/material/icon'; 6 | import {MatInputModule} from '@angular/material/input'; 7 | import {MatProgressBarModule} from '@angular/material/progress-bar'; 8 | import {MatTableModule} from '@angular/material/table'; 9 | import {BrowserModule} from '@angular/platform-browser'; 10 | import {FormsModule} from '@angular/forms'; 11 | import {BrowserAnimationsModule} from '@angular/platform-browser/animations'; 12 | 13 | describe('AppComponent', () => { 14 | beforeEach(async(() => { 15 | TestBed.configureTestingModule({ 16 | declarations: [ 17 | AppComponent 18 | ], 19 | imports: [ 20 | BrowserModule, 21 | FormsModule, 22 | BrowserAnimationsModule, 23 | MatFormFieldModule, 24 | MatButtonModule, 25 | MatIconModule, 26 | MatInputModule, 27 | MatProgressBarModule, 28 | MatTableModule 29 | ] 30 | }).compileComponents(); 31 | })); 32 | 33 | it('should create the app', () => { 34 | const fixture = TestBed.createComponent(AppComponent); 35 | const app = fixture.debugElement.componentInstance; 36 | expect(app).toBeTruthy(); 37 | }); 38 | 39 | it('should render title in a h3 tag', () => { 40 | const fixture = TestBed.createComponent(AppComponent); 41 | fixture.detectChanges(); 42 | const compiled = fixture.debugElement.nativeElement; 43 | expect(compiled.querySelector('h3').textContent).toContain('Stock Market demo'); 44 | }); 45 | 46 | it(`should have a link to portal for retrieve token'`, () => { 47 | const fixture = TestBed.createComponent(AppComponent); 48 | fixture.detectChanges(); 49 | const compiled = fixture.debugElement.nativeElement; 50 | expect(compiled.querySelector('a').href).toContain('https://portal.streamdata.io/#/register'); 51 | }); 52 | }); 53 | -------------------------------------------------------------------------------- /stockmarket-angular8/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import {Component} from '@angular/core'; 2 | import {StreamData, StreamDataError, StreamDataIo} from 'streamdataio-js-sdk'; 3 | import {applyPatch} from 'fast-json-patch'; 4 | import {StockMarket} from '../shared/StockMarket'; 5 | import {cloneDeep} from 'lodash'; 6 | 7 | @Component({ 8 | selector: 'app-root', 9 | templateUrl: './app.component.html', 10 | styleUrls: ['./app.component.css'] 11 | }) 12 | 13 | export class AppComponent { 14 | // Private 15 | private streamData: StreamData; 16 | // Public for bunding 17 | dataSource; 18 | token: string = ""; 19 | 20 | url: string = "http://stockmarket.streamdata.io/v2/prices"; 21 | result: StockMarket[]; 22 | previousResult: StockMarket[]; 23 | 24 | columns: Array = [ 25 | { name: 'title', label: 'Title' }, 26 | { name: 'company', label: 'Company' }, 27 | { name: 'ticker', label: 'Ticker' }, 28 | { name: 'last', label: 'Last' }, 29 | { name: 'source', label: 'Source' }, 30 | { name: 'volume', label: 'Volume' }, 31 | { name: 'dt', label: 'Timestamp' } 32 | ]; 33 | 34 | displayedColumns: string[] = this.columns.map(column => column.name); 35 | 36 | public connect(): void { 37 | 38 | // If ever you wish to get the whole data instead of patches: 39 | // headers = ["Accept: application/json"]; 40 | let headers = []; 41 | 42 | if (this.isConnected) { 43 | this.streamData.close(); 44 | } 45 | 46 | this.streamData = StreamDataIo.createEventSource(this.url, this.token, headers); 47 | 48 | this.streamData 49 | .onOpen(() => { 50 | console.log('--------------- stream opened ---------------'); 51 | // you can also add custom behavior when the stream is opened 52 | this.updatePreviousResult([]); 53 | this.result = []; 54 | }) 55 | .onData((data: StockMarket[]) => { 56 | console.log('--------------- snapshot received ---------------'); 57 | this.updatePreviousResult(data); 58 | // initialize your data with the initial snapshot 59 | this.result = data; 60 | }, this) 61 | .onPatch((patch) => { 62 | console.log('--------------- patch received ---------------'); 63 | this.updatePreviousResult(this.result); 64 | // update the data with the provided patch 65 | applyPatch(this.result, patch); 66 | }, this) 67 | .onError((error: StreamDataError) => { 68 | console.log('--------------- error received ---------------'); 69 | // do whatever you need in case of error 70 | console.log('error: %o', error); 71 | this.streamData.close(); 72 | console.log('--------------- stream closed ---------------'); 73 | }); 74 | 75 | this.streamData.open(); 76 | } 77 | 78 | public updatePreviousResult(value: StockMarket[]): void { 79 | // Store values to enable changes indicators 80 | this.previousResult = cloneDeep(value); 81 | 82 | setTimeout(() => { 83 | // Forgot previous values to disable changes indicators 84 | this.previousResult = this.result; 85 | }, 1000); 86 | 87 | } 88 | 89 | public disconnect(): void { 90 | this.streamData && this.streamData.close(); 91 | this.streamData = null; 92 | } 93 | 94 | public get isConnected(): boolean { 95 | return !!this.streamData && this.streamData.isConnected(); 96 | } 97 | 98 | } 99 | -------------------------------------------------------------------------------- /stockmarket-angular8/src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import {BrowserModule} from '@angular/platform-browser'; 2 | import {NgModule} from '@angular/core'; 3 | import {FormsModule} from '@angular/forms'; 4 | import {BrowserAnimationsModule} from '@angular/platform-browser/animations'; 5 | import { MatButtonModule } from '@angular/material/button'; 6 | import { MatIconModule } from '@angular/material/icon'; 7 | import { MatInputModule } from '@angular/material/input'; 8 | import { MatProgressBarModule } from '@angular/material/progress-bar'; 9 | import { MatTableModule } from '@angular/material/table'; 10 | import {AppComponent} from './app.component'; 11 | import {MatFormFieldModule} from '@angular/material/form-field'; 12 | 13 | @NgModule({ 14 | declarations: [ 15 | AppComponent 16 | ], 17 | imports: [ 18 | BrowserModule, 19 | FormsModule, 20 | BrowserAnimationsModule, 21 | MatFormFieldModule, 22 | MatButtonModule, 23 | MatIconModule, 24 | MatInputModule, 25 | MatProgressBarModule, 26 | MatTableModule 27 | ], 28 | providers: [], 29 | bootstrap: [AppComponent] 30 | }) 31 | export class AppModule { 32 | } 33 | -------------------------------------------------------------------------------- /stockmarket-angular8/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/axway-streams/axway-amplify-streams-js/d8ee9481907ea9e7556f3eab73224838b881276a/stockmarket-angular8/src/assets/.gitkeep -------------------------------------------------------------------------------- /stockmarket-angular8/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /stockmarket-angular8/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 | * For easier debugging in development mode, you can import the following file 11 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. 12 | * 13 | * This import should be commented out in production mode because it will have a negative impact 14 | * on performance if an error is thrown. 15 | */ 16 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI. 17 | -------------------------------------------------------------------------------- /stockmarket-angular8/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/axway-streams/axway-amplify-streams-js/d8ee9481907ea9e7556f3eab73224838b881276a/stockmarket-angular8/src/favicon.ico -------------------------------------------------------------------------------- /stockmarket-angular8/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Stock Market demo 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /stockmarket-angular8/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('@angular-devkit/build-angular/plugins/karma') 14 | ], 15 | client: { 16 | clearContext: false // leave Jasmine Spec Runner output visible in browser 17 | }, 18 | coverageIstanbulReporter: { 19 | dir: require('path').join(__dirname, '../coverage'), 20 | reports: ['html', 'lcovonly', 'text-summary'], 21 | fixWebpackSourcePaths: true 22 | }, 23 | reporters: ['progress', 'kjhtml'], 24 | port: 9876, 25 | colors: true, 26 | logLevel: config.LOG_INFO, 27 | autoWatch: true, 28 | browsers: ['Chrome'], 29 | singleRun: false 30 | }); 31 | }; -------------------------------------------------------------------------------- /stockmarket-angular8/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule) 12 | .catch(err => console.error(err)); 13 | -------------------------------------------------------------------------------- /stockmarket-angular8/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/guide/browser-support 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 | /** 38 | * If the application will be indexed by Google Search, the following is required. 39 | * Googlebot uses a renderer based on Chrome 41. 40 | * https://developers.google.com/search/docs/guides/rendering 41 | **/ 42 | // import 'core-js/es6/array'; 43 | 44 | /** IE10 and IE11 requires the following for NgClass support on SVG elements */ 45 | // import 'classlist.js'; // Run `npm install --save classlist.js`. 46 | 47 | /** IE10 and IE11 requires the following for the Reflect API. */ 48 | // import 'core-js/es6/reflect'; 49 | 50 | /** 51 | * Web Animations `@angular/platform-browser/animations` 52 | * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari. 53 | * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0). 54 | **/ 55 | // import 'web-animations-js'; // Run `npm install --save web-animations-js`. 56 | 57 | /** 58 | * By default, zone.js will patch all possible macroTask and DomEvents 59 | * user can disable parts of macroTask/DomEvents patch by setting following flags 60 | * because those flags need to be set before `zone.js` being loaded, and webpack 61 | * will put import in the top of bundle, so user need to create a separate file 62 | * in this directory (for example: zone-flags.ts), and put the following flags 63 | * into that file, and then add the following code before importing zone.js. 64 | * import './zone-flags.ts'; 65 | * 66 | * The flags allowed in zone-flags.ts are listed here. 67 | * 68 | * The following flags will work for all browsers. 69 | * 70 | * (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame 71 | * (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick 72 | * (window as any).__zone_symbol__BLACK_LISTED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames 73 | * 74 | * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js 75 | * with the following flag, it will bypass `zone.js` patch for IE/Edge 76 | * 77 | * (window as any).__Zone_enable_cross_context_check = true; 78 | * 79 | */ 80 | 81 | /*************************************************************************************************** 82 | * Zone JS is required by default for Angular itself. 83 | */ 84 | import 'zone.js/dist/zone'; // Included with Angular CLI. 85 | 86 | 87 | /*************************************************************************************************** 88 | * APPLICATION IMPORTS 89 | */ 90 | -------------------------------------------------------------------------------- /stockmarket-angular8/src/shared/StockMarket.ts: -------------------------------------------------------------------------------- 1 | export interface StockMarket { 2 | 3 | title: string; 4 | company: string; 5 | ticker: string; 6 | source: string; 7 | last: number; 8 | dt: string; 9 | volume: number; 10 | 11 | } 12 | -------------------------------------------------------------------------------- /stockmarket-angular8/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | @import '~@angular/material/prebuilt-themes/deeppurple-amber.css'; -------------------------------------------------------------------------------- /stockmarket-angular8/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 | -------------------------------------------------------------------------------- /stockmarket-angular8/src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "types": [] 6 | }, 7 | "exclude": [ 8 | "test.ts", 9 | "**/*.spec.ts" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /stockmarket-angular8/src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "types": [ 6 | "jasmine", 7 | "node" 8 | ] 9 | }, 10 | "files": [ 11 | "test.ts", 12 | "polyfills.ts" 13 | ], 14 | "include": [ 15 | "**/*.spec.ts", 16 | "**/*.d.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /stockmarket-angular8/src/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tslint.json", 3 | "rules": { 4 | "directive-selector": [ 5 | true, 6 | "attribute", 7 | "app", 8 | "camelCase" 9 | ], 10 | "component-selector": [ 11 | true, 12 | "element", 13 | "app", 14 | "kebab-case" 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /stockmarket-angular8/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "baseUrl": "./", 5 | "downlevelIteration": true, 6 | "outDir": "./dist/out-tsc", 7 | "sourceMap": true, 8 | "declaration": false, 9 | "module": "esnext", 10 | "moduleResolution": "node", 11 | "emitDecoratorMetadata": true, 12 | "experimentalDecorators": true, 13 | "importHelpers": true, 14 | "target": "es2015", 15 | "typeRoots": [ 16 | "node_modules/@types" 17 | ], 18 | "lib": [ 19 | "es2018", 20 | "dom" 21 | ] 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /stockmarket-angular8/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "rulesDirectory": [ 3 | "codelyzer" 4 | ], 5 | "rules": { 6 | "arrow-return-shorthand": true, 7 | "callable-types": true, 8 | "class-name": true, 9 | "comment-format": [ 10 | true, 11 | "check-space" 12 | ], 13 | "curly": true, 14 | "deprecation": { 15 | "severity": "warn" 16 | }, 17 | "eofline": true, 18 | "forin": true, 19 | "import-blacklist": [ 20 | true, 21 | "rxjs/Rx" 22 | ], 23 | "import-spacing": true, 24 | "indent": [ 25 | true, 26 | "spaces" 27 | ], 28 | "interface-over-type-literal": true, 29 | "label-position": true, 30 | "max-line-length": [ 31 | true, 32 | 140 33 | ], 34 | "member-access": false, 35 | "member-ordering": [ 36 | true, 37 | { 38 | "order": [ 39 | "static-field", 40 | "instance-field", 41 | "static-method", 42 | "instance-method" 43 | ] 44 | } 45 | ], 46 | "no-arg": true, 47 | "no-bitwise": true, 48 | "no-console": [ 49 | true, 50 | "debug", 51 | "info", 52 | "time", 53 | "timeEnd", 54 | "trace" 55 | ], 56 | "no-construct": true, 57 | "no-debugger": true, 58 | "no-duplicate-super": true, 59 | "no-empty": false, 60 | "no-empty-interface": true, 61 | "no-eval": true, 62 | "no-inferrable-types": [ 63 | true, 64 | "ignore-params" 65 | ], 66 | "no-misused-new": true, 67 | "no-non-null-assertion": true, 68 | "no-redundant-jsdoc": true, 69 | "no-shadowed-variable": true, 70 | "no-string-literal": false, 71 | "no-string-throw": true, 72 | "no-switch-case-fall-through": true, 73 | "no-trailing-whitespace": true, 74 | "no-unnecessary-initializer": true, 75 | "no-unused-expression": true, 76 | "no-use-before-declare": true, 77 | "no-var-keyword": true, 78 | "object-literal-sort-keys": false, 79 | "one-line": [ 80 | true, 81 | "check-open-brace", 82 | "check-catch", 83 | "check-else", 84 | "check-whitespace" 85 | ], 86 | "prefer-const": true, 87 | "quotemark": [ 88 | true, 89 | "single" 90 | ], 91 | "radix": true, 92 | "semicolon": [ 93 | true, 94 | "always" 95 | ], 96 | "triple-equals": [ 97 | true, 98 | "allow-null-check" 99 | ], 100 | "typedef-whitespace": [ 101 | true, 102 | { 103 | "call-signature": "nospace", 104 | "index-signature": "nospace", 105 | "parameter": "nospace", 106 | "property-declaration": "nospace", 107 | "variable-declaration": "nospace" 108 | } 109 | ], 110 | "unified-signatures": true, 111 | "variable-name": false, 112 | "whitespace": [ 113 | true, 114 | "check-branch", 115 | "check-decl", 116 | "check-operator", 117 | "check-separator", 118 | "check-type" 119 | ], 120 | "no-output-on-prefix": true, 121 | "no-inputs-metadata-property": true, 122 | "no-outputs-metadata-property": true, 123 | "no-host-metadata-property": true, 124 | "no-input-rename": true, 125 | "no-output-rename": true, 126 | "use-lifecycle-interface": true, 127 | "use-pipe-transform-interface": true, 128 | "component-class-suffix": true, 129 | "directive-class-suffix": true 130 | } 131 | } 132 | -------------------------------------------------------------------------------- /stockmarket-console/README.md: -------------------------------------------------------------------------------- 1 | # streamdata-js/stockmarket-console 2 | 3 | This sample application shows how to use the streamdata.io Javascript SDK. 4 | 5 | The streamdata.io JavaScript SDK allows the use of streamdata.io to get data pushed from various sources and use them in your application. 6 | 7 | Edit the `index.html` and replace: 8 | 9 | `var token = "";` 10 | 11 | with your streamdata.io token you can get at streamdata.io portal. 12 | 13 | In a shell terminal, run the commands: 14 | 15 | ``` 16 | cd stockmarket-console 17 | npm install 18 | ``` 19 | 20 | This will install the streamdata.io JavaScript SDK and a Json-Patch JavaScript library. 21 | 22 | Then, to run the sample, open the `index.html` in your browser (Chrome, Firefox, Safari, IE > 10) and the web console of the developers tools of your browser. 23 | 24 | **You should see data and patches printed in the console** (if the web console has not been open first, you may have missed the first data: in this case, refresh the page or open the web console before the `index.html`). 25 | 26 | If you have any questions or feedback, feel free to ask: support@streamdata.io 27 | 28 | Enjoy! 29 | -------------------------------------------------------------------------------- /stockmarket-console/index.html: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | Streamdataio Demo 21 | 22 | 23 |

Hello! Open the web console of your browser to see the results!

24 | 25 | 26 | 27 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /stockmarket-console/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "streamdataio-console", 3 | "version": "1.0.0", 4 | "lockfileVersion": 1, 5 | "dependencies": { 6 | "core-js": { 7 | "version": "2.5.1", 8 | "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.1.tgz", 9 | "integrity": "sha1-rmh03GaTd4m4B1T/VCjfZoGcpQs=" 10 | }, 11 | "deep-equal": { 12 | "version": "1.0.1", 13 | "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz", 14 | "integrity": "sha1-9dJgKStmDghO/0zbyfCK0yR0SLU=" 15 | }, 16 | "eventsource": { 17 | "version": "github:streamdataio/eventsource-js#92ceda879f6d4e6d45fd6bb6fc82ca12a0c2c5db" 18 | }, 19 | "eventsource-polyfill": { 20 | "version": "github:streamdataio/EventSource#bc353046d1eef182642e1d85deb442a3fd62849e" 21 | }, 22 | "fast-json-patch": { 23 | "version": "2.0.6", 24 | "resolved": "https://registry.npmjs.org/fast-json-patch/-/fast-json-patch-2.0.6.tgz", 25 | "integrity": "sha1-hv/4+GYjkaqBlyKGTWMuYD5u5gU=" 26 | }, 27 | "original": { 28 | "version": "1.0.0", 29 | "resolved": "https://registry.npmjs.org/original/-/original-1.0.0.tgz", 30 | "integrity": "sha1-kUf5P6FpbQS+YeAb1QuurKZWvTs=" 31 | }, 32 | "querystringify": { 33 | "version": "0.0.4", 34 | "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-0.0.4.tgz", 35 | "integrity": "sha1-DPf4T5Rj/wrlHExLFC2VvjdyTZw=" 36 | }, 37 | "requires-port": { 38 | "version": "1.0.0", 39 | "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", 40 | "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=" 41 | }, 42 | "streamdataio-js-sdk": { 43 | "version": "2.0.2", 44 | "resolved": "https://registry.npmjs.org/streamdataio-js-sdk/-/streamdataio-js-sdk-2.0.2.tgz", 45 | "integrity": "sha512-Fw0Y5owXy1aTEqOy1YTtZIFEDTg32PeTkAK2X3k3rVSZkLx2KHvswzbV17CvC6zzuvfXFJo4AVxo9RazzHKzbQ==" 46 | }, 47 | "url-parse": { 48 | "version": "1.0.5", 49 | "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.0.5.tgz", 50 | "integrity": "sha1-CFSGBCKv3P7+tsllxmLUgAFpkns=" 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /stockmarket-console/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "streamdataio-console", 3 | "version": "1.0.0", 4 | "description": "Sample with web console of the Streamdata.io Javascript SDK", 5 | "keywords": [ 6 | "streamdata", 7 | "streamdata.io", 8 | "push", 9 | "sse", 10 | "server-sent-event", 11 | "api", 12 | "streaming" 13 | ], 14 | "author": "Streamdataio support@streamdata.io", 15 | "license": "Apache-2.0", 16 | "dependencies": { 17 | "fast-json-patch": "^2.0.3", 18 | "streamdataio-js-sdk": "^2.0.2" 19 | }, 20 | "devDependencies": { 21 | "eventsource": "^1.0.4" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /stockmarket-nodejs/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | 5 | # Runtime data 6 | pids 7 | *.pid 8 | *.seed 9 | 10 | # Directory for instrumented libs generated by jscoverage/JSCover 11 | lib-cov 12 | 13 | # Coverage directory used by tools like istanbul 14 | coverage 15 | 16 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 17 | .grunt 18 | 19 | # node-waf configuration 20 | .lock-wscript 21 | 22 | # Compiled binary addons (http://nodejs.org/api/addons.html) 23 | build/Release 24 | 25 | # Dependency directory 26 | # https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git 27 | node_modules 28 | 29 | .idea 30 | *.iml 31 | -------------------------------------------------------------------------------- /stockmarket-nodejs/LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | 203 | -------------------------------------------------------------------------------- /stockmarket-nodejs/README.md: -------------------------------------------------------------------------------- 1 | # Simple node.js app using streamdata.io 2 | 3 | ## Step by step setup 4 | 5 | 1. Create an free account on streamdata.io https://portal.streamdata.io/#/register to get an App token. 6 | 7 | 2. Edit server.js and replace ```[YOUR_STREAMDATAIO_APP_TOKEN]``` with your App token. 8 | 9 | 3. Make sure you have Node version 0.11.5 or later installed 10 | 11 | 4. Install node dependencies by running in a terminal: 12 | 13 | ``` 14 | npm install 15 | ``` 16 | 17 | 5. Launch node in a terminal: 18 | 19 | ``` 20 | node server.js 21 | ``` 22 | 23 | You should see data and patches pushed in your application and displayed on your terminal. 24 | 25 | you can use the provided demo example API which simulates updating stocks prices from a financial market: 26 | 'http://stockmarket.streamdata.io/v2/prices' 27 | 28 | Feel free to test it with any REST/Json API of your choice. 29 | -------------------------------------------------------------------------------- /stockmarket-nodejs/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "stockmarket-nodejs", 3 | "version": "1.0.0", 4 | "lockfileVersion": 1, 5 | "dependencies": { 6 | "core-js": { 7 | "version": "2.5.1", 8 | "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.1.tgz", 9 | "integrity": "sha1-rmh03GaTd4m4B1T/VCjfZoGcpQs=" 10 | }, 11 | "crypto-js": { 12 | "version": "3.1.9-1", 13 | "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-3.1.9-1.tgz", 14 | "integrity": "sha1-/aGedh/Ad+Af+/3G6f38WeiAbNg=" 15 | }, 16 | "deep-equal": { 17 | "version": "1.0.1", 18 | "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz", 19 | "integrity": "sha1-9dJgKStmDghO/0zbyfCK0yR0SLU=" 20 | }, 21 | "eventsource": { 22 | "version": "github:streamdataio/eventsource-js#92ceda879f6d4e6d45fd6bb6fc82ca12a0c2c5db" 23 | }, 24 | "eventsource-polyfill": { 25 | "version": "github:streamdataio/EventSource#bc353046d1eef182642e1d85deb442a3fd62849e" 26 | }, 27 | "fast-json-patch": { 28 | "version": "2.0.6", 29 | "resolved": "https://registry.npmjs.org/fast-json-patch/-/fast-json-patch-2.0.6.tgz", 30 | "integrity": "sha1-hv/4+GYjkaqBlyKGTWMuYD5u5gU=" 31 | }, 32 | "node-print": { 33 | "version": "0.0.4", 34 | "resolved": "https://registry.npmjs.org/node-print/-/node-print-0.0.4.tgz", 35 | "integrity": "sha1-5kxpiG4C5HzriWTz7SvepRRwgHY=" 36 | }, 37 | "original": { 38 | "version": "1.0.0", 39 | "resolved": "https://registry.npmjs.org/original/-/original-1.0.0.tgz", 40 | "integrity": "sha1-kUf5P6FpbQS+YeAb1QuurKZWvTs=" 41 | }, 42 | "querystringify": { 43 | "version": "0.0.4", 44 | "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-0.0.4.tgz", 45 | "integrity": "sha1-DPf4T5Rj/wrlHExLFC2VvjdyTZw=" 46 | }, 47 | "requires-port": { 48 | "version": "1.0.0", 49 | "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", 50 | "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=" 51 | }, 52 | "streamdataio-js-sdk": { 53 | "version": "2.0.2", 54 | "resolved": "https://registry.npmjs.org/streamdataio-js-sdk/-/streamdataio-js-sdk-2.0.2.tgz", 55 | "integrity": "sha512-Fw0Y5owXy1aTEqOy1YTtZIFEDTg32PeTkAK2X3k3rVSZkLx2KHvswzbV17CvC6zzuvfXFJo4AVxo9RazzHKzbQ==" 56 | }, 57 | "streamdataio-js-sdk-auth": { 58 | "version": "2.0.0", 59 | "resolved": "https://registry.npmjs.org/streamdataio-js-sdk-auth/-/streamdataio-js-sdk-auth-2.0.0.tgz", 60 | "integrity": "sha512-y89ECCkmQubmeeJq5QZWRoI03B5w47xzaS9XxlvyCecWIgeWUS5NV1tbZ8P8YCq1eMeoykeaP430gxG3pggmiA==" 61 | }, 62 | "url-parse": { 63 | "version": "1.0.5", 64 | "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.0.5.tgz", 65 | "integrity": "sha1-CFSGBCKv3P7+tsllxmLUgAFpkns=" 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /stockmarket-nodejs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "stockmarket-nodejs", 3 | "version": "1.0.0", 4 | "description": "Simple node.js app using streamdata.io", 5 | "main": "server.js", 6 | "scripts": { 7 | "start": "node server.js", 8 | "test": "echo \"Error: no test specified\" && exit 1" 9 | }, 10 | "author": "", 11 | "license": "Apache 2 License", 12 | "dependencies": { 13 | "fast-json-patch": "^2.0.3", 14 | "node-print": "0.0.4", 15 | "streamdataio-js-sdk": "^2.0.2", 16 | "streamdataio-js-sdk-auth": "^2.0.0" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /stockmarket-nodejs/server.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2016 Streamdata.io 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // add EventSource dependency 18 | var streamdataio = require('streamdataio-js-sdk/dist/bundles/streamdataio-node'); 19 | var AuthStrategy = require('streamdataio-js-sdk-auth'); 20 | // add json patch dependency 21 | var jsonPatch = require('fast-json-patch'); 22 | var print = require('node-print'); 23 | 24 | function server() 25 | { 26 | // targetUrl is the JSON API you wish to stream 27 | // you can use this example API which simulates updating stocks prices from a financial market 28 | var targetUrl = 'http://stockmarket.streamdata.io/v2/prices'; 29 | 30 | // appToken is the way Streamdata.io authenticates you as a valid user. 31 | // you MUST provide a valid token for your request to go through. 32 | var appToken = '[YOUR_STREAMDATAIO_APP_TOKEN]'; 33 | var privateKey = '[YOUR_STREAMDATAIO_APP_PRIVATE_KEY]'; 34 | 35 | eventSource = 36 | streamdataio.createEventSource(targetUrl, appToken, [], AuthStrategy.newSignatureStrategy(appToken, privateKey)); 37 | var result = []; 38 | 39 | eventSource 40 | // the standard 'open' callback will be called when connection is established with the server 41 | .onOpen(function () 42 | { 43 | console.log("connected!"); 44 | }) 45 | // the streamdata.io specific 'data' event will be called when a fresh Json data set 46 | // is pushed by Streamdata.io coming from the API 47 | .onData(function (data) 48 | { 49 | console.log("data received"); 50 | // memorize the fresh data set 51 | result = data; 52 | print.printTable(result); 53 | }) 54 | // the streamdata.io specific 'patch' event will be called when a fresh Json patch 55 | // is pushed by streamdata.io from the API. This patch has to be applied to the 56 | // latest data set provided. 57 | .onPatch(function (patch) 58 | { 59 | // display the patch 60 | console.log("patch: ", patch); 61 | // apply the patch to data using json patch API 62 | jsonPatch.applyPatch(result, patch); 63 | // do whatever you wish with the update data 64 | print.printTable(result); 65 | 66 | }) 67 | 68 | // the standard 'error' callback will be called when an error occur with the evenSource 69 | // for example with an invalid token provided 70 | .onError(function (error) 71 | { 72 | console.log('ERROR!', error); 73 | eventSource.close(); 74 | 75 | }); 76 | 77 | eventSource.open(); 78 | 79 | } 80 | 81 | console.log('starting'); 82 | server(); 83 | 84 | -------------------------------------------------------------------------------- /stockmarket-vuejs/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | ["env", { "modules": false }], 4 | "stage-2" 5 | ], 6 | "plugins": ["transform-runtime"], 7 | "comments": false, 8 | "env": { 9 | "test": { 10 | "presets": ["env", "stage-2"], 11 | "plugins": [ "istanbul" ] 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /stockmarket-vuejs/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /stockmarket-vuejs/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .idea 3 | *.iml 4 | node_modules/ 5 | dist/ 6 | npm-debug.log* 7 | yarn-debug.log* 8 | yarn-error.log* 9 | -------------------------------------------------------------------------------- /stockmarket-vuejs/.postcssrc.js: -------------------------------------------------------------------------------- 1 | // https://github.com/michael-ciniawsky/postcss-load-config 2 | 3 | module.exports = { 4 | "plugins": { 5 | // to edit target browsers: use "browserlist" field in package.json 6 | "autoprefixer": {} 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /stockmarket-vuejs/LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /stockmarket-vuejs/README.md: -------------------------------------------------------------------------------- 1 | # Axway AMPLIFY Streams Vue.js 2 | 3 | This sample application shows how to use the Axway AMPLIFY Streams Javascript SDK with Vue.js. 4 | 5 | The Axway AMPLIFY Streams JavaScript SDK allows the use of [Axway AMPLIFY Streams](https://streamdata.io) to get data pushed from various sources and use them in your application. 6 | 7 | This project was create with [Vue CLI](https://github.com/vuejs/vue-cli) version 2.8.0 8 | 9 | ## Build Setup 10 | 11 | ``` bash 12 | # install dependencies 13 | npm install 14 | 15 | # serve with hot reload at localhost:8080 16 | npm run dev 17 | 18 | # build for production with minification 19 | npm run build 20 | 21 | # build for production and view the bundle analyzer report 22 | npm run build --report 23 | ``` 24 | 25 | For detailed explanation on how things work, checkout the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader). 26 | 27 | ## Run the demo 28 | 29 | After running the server with npm run dev, navigate to localhost:8080. You will need to enter your Axway AMPLIFY Streams token. If you don't have one, you can get it for free at [Axway AMPLIFY Streams portal](https://portal.streamdata.io). 30 | 31 | This demo uses fake market data emulated by our public API : http://stockmarket.streamdata.io/v2/prices 32 | 33 | ## Contributing 34 | 35 | Please read [Contributing.md](https://github.com/axway-amplify-streams/Common/blob/master/Contributing.md) for details on our code of conduct, and the process for submitting pull requests to us. 36 | 37 | ## Team 38 | 39 | ![alt text][Axwaylogo] Axway Team 40 | 41 | [Axwaylogo]: https://github.com/axway-amplify-streams/Common/blob/master/img/AxwayLogoSmall.png "Axway logo" 42 | 43 | ## License 44 | 45 | [Apache License 2.0](https://github.com/axway-amplify-streams/Common/blob/master/LICENSE) 46 | -------------------------------------------------------------------------------- /stockmarket-vuejs/build/build.js: -------------------------------------------------------------------------------- 1 | require('./check-versions')() 2 | 3 | process.env.NODE_ENV = 'production' 4 | 5 | var ora = require('ora') 6 | var rm = require('rimraf') 7 | var path = require('path') 8 | var chalk = require('chalk') 9 | var webpack = require('webpack') 10 | var config = require('../config') 11 | var webpackConfig = require('./webpack.prod.conf') 12 | 13 | var spinner = ora('building for production...') 14 | spinner.start() 15 | 16 | rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { 17 | if (err) throw err 18 | webpack(webpackConfig, function (err, stats) { 19 | spinner.stop() 20 | if (err) throw err 21 | process.stdout.write(stats.toString({ 22 | colors: true, 23 | modules: false, 24 | children: false, 25 | chunks: false, 26 | chunkModules: false 27 | }) + '\n\n') 28 | 29 | console.log(chalk.cyan(' Build complete.\n')) 30 | console.log(chalk.yellow( 31 | ' Tip: built files are meant to be served over an HTTP server.\n' + 32 | ' Opening index.html over file:// won\'t work.\n' 33 | )) 34 | }) 35 | }) 36 | -------------------------------------------------------------------------------- /stockmarket-vuejs/build/check-versions.js: -------------------------------------------------------------------------------- 1 | var chalk = require('chalk') 2 | var semver = require('semver') 3 | var packageConfig = require('../package.json') 4 | var shell = require('shelljs') 5 | function exec (cmd) { 6 | return require('child_process').execSync(cmd).toString().trim() 7 | } 8 | 9 | var versionRequirements = [ 10 | { 11 | name: 'node', 12 | currentVersion: semver.clean(process.version), 13 | versionRequirement: packageConfig.engines.node 14 | }, 15 | ] 16 | 17 | if (shell.which('npm')) { 18 | versionRequirements.push({ 19 | name: 'npm', 20 | currentVersion: exec('npm --version'), 21 | versionRequirement: packageConfig.engines.npm 22 | }) 23 | } 24 | 25 | module.exports = function () { 26 | var warnings = [] 27 | for (var i = 0; i < versionRequirements.length; i++) { 28 | var mod = versionRequirements[i] 29 | if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { 30 | warnings.push(mod.name + ': ' + 31 | chalk.red(mod.currentVersion) + ' should be ' + 32 | chalk.green(mod.versionRequirement) 33 | ) 34 | } 35 | } 36 | 37 | if (warnings.length) { 38 | console.log('') 39 | console.log(chalk.yellow('To use this template, you must update following to modules:')) 40 | console.log() 41 | for (var i = 0; i < warnings.length; i++) { 42 | var warning = warnings[i] 43 | console.log(' ' + warning) 44 | } 45 | console.log() 46 | process.exit(1) 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /stockmarket-vuejs/build/dev-client.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | require('eventsource-polyfill') 3 | var hotClient = require('webpack-hot-middleware/client?noInfo=true&reload=true') 4 | 5 | hotClient.subscribe(function (event) { 6 | if (event.action === 'reload') { 7 | window.location.reload() 8 | } 9 | }) 10 | -------------------------------------------------------------------------------- /stockmarket-vuejs/build/dev-server.js: -------------------------------------------------------------------------------- 1 | require('./check-versions')() 2 | 3 | var config = require('../config') 4 | if (!process.env.NODE_ENV) { 5 | process.env.NODE_ENV = JSON.parse(config.dev.env.NODE_ENV) 6 | } 7 | 8 | var opn = require('opn') 9 | var path = require('path') 10 | var express = require('express') 11 | var webpack = require('webpack') 12 | var proxyMiddleware = require('http-proxy-middleware') 13 | var webpackConfig = require('./webpack.dev.conf') 14 | 15 | // default port where dev server listens for incoming traffic 16 | var port = process.env.PORT || config.dev.port 17 | // automatically open browser, if not set will be false 18 | var autoOpenBrowser = !!config.dev.autoOpenBrowser 19 | // Define HTTP proxies to your custom API backend 20 | // https://github.com/chimurai/http-proxy-middleware 21 | var proxyTable = config.dev.proxyTable 22 | 23 | var app = express() 24 | var compiler = webpack(webpackConfig) 25 | 26 | var devMiddleware = require('webpack-dev-middleware')(compiler, { 27 | publicPath: webpackConfig.output.publicPath, 28 | quiet: true 29 | }) 30 | 31 | var hotMiddleware = require('webpack-hot-middleware')(compiler, { 32 | log: () => {} 33 | }) 34 | // force page reload when html-webpack-plugin template changes 35 | compiler.plugin('compilation', function (compilation) { 36 | compilation.plugin('html-webpack-plugin-after-emit', function (data, cb) { 37 | hotMiddleware.publish({ action: 'reload' }) 38 | cb() 39 | }) 40 | }) 41 | 42 | // proxy api requests 43 | Object.keys(proxyTable).forEach(function (context) { 44 | var options = proxyTable[context] 45 | if (typeof options === 'string') { 46 | options = { target: options } 47 | } 48 | app.use(proxyMiddleware(options.filter || context, options)) 49 | }) 50 | 51 | // handle fallback for HTML5 history API 52 | app.use(require('connect-history-api-fallback')()) 53 | 54 | // serve webpack bundle output 55 | app.use(devMiddleware) 56 | 57 | // enable hot-reload and state-preserving 58 | // compilation error display 59 | app.use(hotMiddleware) 60 | 61 | // serve pure static assets 62 | var staticPath = path.posix.join(config.dev.assetsPublicPath, config.dev.assetsSubDirectory) 63 | app.use(staticPath, express.static('./static')) 64 | 65 | var uri = 'http://localhost:' + port 66 | 67 | var _resolve 68 | var readyPromise = new Promise(resolve => { 69 | _resolve = resolve 70 | }) 71 | 72 | console.log('> Starting dev server...') 73 | devMiddleware.waitUntilValid(() => { 74 | console.log('> Listening at ' + uri + '\n') 75 | // when env is testing, don't need open it 76 | if (autoOpenBrowser && process.env.NODE_ENV !== 'testing') { 77 | opn(uri) 78 | } 79 | _resolve() 80 | }) 81 | 82 | var server = app.listen(port) 83 | 84 | module.exports = { 85 | ready: readyPromise, 86 | close: () => { 87 | server.close() 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /stockmarket-vuejs/build/utils.js: -------------------------------------------------------------------------------- 1 | var path = require('path') 2 | var config = require('../config') 3 | var ExtractTextPlugin = require('extract-text-webpack-plugin') 4 | 5 | exports.assetsPath = function (_path) { 6 | var assetsSubDirectory = process.env.NODE_ENV === 'production' 7 | ? config.build.assetsSubDirectory 8 | : config.dev.assetsSubDirectory 9 | return path.posix.join(assetsSubDirectory, _path) 10 | } 11 | 12 | exports.cssLoaders = function (options) { 13 | options = options || {} 14 | 15 | var cssLoader = { 16 | loader: 'css-loader', 17 | options: { 18 | minimize: process.env.NODE_ENV === 'production', 19 | sourceMap: options.sourceMap 20 | } 21 | } 22 | 23 | // generate loader string to be used with extract text plugin 24 | function generateLoaders (loader, loaderOptions) { 25 | var loaders = [cssLoader] 26 | if (loader) { 27 | loaders.push({ 28 | loader: loader + '-loader', 29 | options: Object.assign({}, loaderOptions, { 30 | sourceMap: options.sourceMap 31 | }) 32 | }) 33 | } 34 | 35 | // Extract CSS when that option is specified 36 | // (which is the case during production build) 37 | if (options.extract) { 38 | return ExtractTextPlugin.extract({ 39 | use: loaders, 40 | fallback: 'vue-style-loader' 41 | }) 42 | } else { 43 | return ['vue-style-loader'].concat(loaders) 44 | } 45 | } 46 | 47 | // https://vue-loader.vuejs.org/en/configurations/extract-css.html 48 | return { 49 | css: generateLoaders(), 50 | postcss: generateLoaders(), 51 | less: generateLoaders('less'), 52 | sass: generateLoaders('sass', { indentedSyntax: true }), 53 | scss: generateLoaders('sass'), 54 | stylus: generateLoaders('stylus'), 55 | styl: generateLoaders('stylus') 56 | } 57 | } 58 | 59 | // Generate loaders for standalone style files (outside of .vue) 60 | exports.styleLoaders = function (options) { 61 | var output = [] 62 | var loaders = exports.cssLoaders(options) 63 | for (var extension in loaders) { 64 | var loader = loaders[extension] 65 | output.push({ 66 | test: new RegExp('\\.' + extension + '$'), 67 | use: loader 68 | }) 69 | } 70 | return output 71 | } 72 | -------------------------------------------------------------------------------- /stockmarket-vuejs/build/vue-loader.conf.js: -------------------------------------------------------------------------------- 1 | var utils = require('./utils') 2 | var config = require('../config') 3 | var isProduction = process.env.NODE_ENV === 'production' 4 | 5 | module.exports = { 6 | loaders: utils.cssLoaders({ 7 | sourceMap: isProduction 8 | ? config.build.productionSourceMap 9 | : config.dev.cssSourceMap, 10 | extract: isProduction 11 | }) 12 | } 13 | -------------------------------------------------------------------------------- /stockmarket-vuejs/build/webpack.base.conf.js: -------------------------------------------------------------------------------- 1 | var path = require('path') 2 | var utils = require('./utils') 3 | var config = require('../config') 4 | var vueLoaderConfig = require('./vue-loader.conf') 5 | 6 | function resolve (dir) { 7 | return path.join(__dirname, '..', dir) 8 | } 9 | 10 | module.exports = { 11 | entry: { 12 | app: './src/main.js' 13 | }, 14 | output: { 15 | path: config.build.assetsRoot, 16 | filename: '[name].js', 17 | publicPath: process.env.NODE_ENV === 'production' 18 | ? config.build.assetsPublicPath 19 | : config.dev.assetsPublicPath 20 | }, 21 | resolve: { 22 | extensions: ['.js', '.vue', '.json'], 23 | alias: { 24 | 'vue$': 'vue/dist/vue.esm.js', 25 | '@': resolve('src') 26 | } 27 | }, 28 | module: { 29 | rules: [ 30 | { 31 | test: /\.vue$/, 32 | loader: 'vue-loader', 33 | options: vueLoaderConfig 34 | }, 35 | { 36 | test: /\.js$/, 37 | loader: 'babel-loader', 38 | include: [resolve('src'), resolve('test')] 39 | }, 40 | { 41 | test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, 42 | loader: 'url-loader', 43 | options: { 44 | limit: 10000, 45 | name: utils.assetsPath('img/[name].[hash:7].[ext]') 46 | } 47 | }, 48 | { 49 | test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, 50 | loader: 'url-loader', 51 | options: { 52 | limit: 10000, 53 | name: utils.assetsPath('fonts/[name].[hash:7].[ext]') 54 | } 55 | } 56 | ] 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /stockmarket-vuejs/build/webpack.dev.conf.js: -------------------------------------------------------------------------------- 1 | var utils = require('./utils') 2 | var webpack = require('webpack') 3 | var config = require('../config') 4 | var merge = require('webpack-merge') 5 | var baseWebpackConfig = require('./webpack.base.conf') 6 | var HtmlWebpackPlugin = require('html-webpack-plugin') 7 | var FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') 8 | 9 | // add hot-reload related code to entry chunks 10 | Object.keys(baseWebpackConfig.entry).forEach(function (name) { 11 | baseWebpackConfig.entry[name] = ['./build/dev-client'].concat(baseWebpackConfig.entry[name]) 12 | }) 13 | 14 | module.exports = merge(baseWebpackConfig, { 15 | module: { 16 | rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap }) 17 | }, 18 | // cheap-module-eval-source-map is faster for development 19 | devtool: '#cheap-module-eval-source-map', 20 | plugins: [ 21 | new webpack.DefinePlugin({ 22 | 'process.env': config.dev.env 23 | }), 24 | // https://github.com/glenjamin/webpack-hot-middleware#installation--usage 25 | new webpack.HotModuleReplacementPlugin(), 26 | new webpack.NoEmitOnErrorsPlugin(), 27 | // https://github.com/ampedandwired/html-webpack-plugin 28 | new HtmlWebpackPlugin({ 29 | filename: 'index.html', 30 | template: 'index.html', 31 | inject: true 32 | }), 33 | new FriendlyErrorsPlugin() 34 | ] 35 | }) 36 | -------------------------------------------------------------------------------- /stockmarket-vuejs/build/webpack.prod.conf.js: -------------------------------------------------------------------------------- 1 | var path = require('path') 2 | var utils = require('./utils') 3 | var webpack = require('webpack') 4 | var config = require('../config') 5 | var merge = require('webpack-merge') 6 | var baseWebpackConfig = require('./webpack.base.conf') 7 | var CopyWebpackPlugin = require('copy-webpack-plugin') 8 | var HtmlWebpackPlugin = require('html-webpack-plugin') 9 | var ExtractTextPlugin = require('extract-text-webpack-plugin') 10 | var OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') 11 | 12 | var env = config.build.env 13 | 14 | var webpackConfig = merge(baseWebpackConfig, { 15 | module: { 16 | rules: utils.styleLoaders({ 17 | sourceMap: config.build.productionSourceMap, 18 | extract: true 19 | }) 20 | }, 21 | devtool: config.build.productionSourceMap ? '#source-map' : false, 22 | output: { 23 | path: config.build.assetsRoot, 24 | filename: utils.assetsPath('js/[name].[chunkhash].js'), 25 | chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') 26 | }, 27 | plugins: [ 28 | // http://vuejs.github.io/vue-loader/en/workflow/production.html 29 | new webpack.DefinePlugin({ 30 | 'process.env': env 31 | }), 32 | new webpack.optimize.UglifyJsPlugin({ 33 | compress: { 34 | warnings: false 35 | }, 36 | sourceMap: true 37 | }), 38 | // extract css into its own file 39 | new ExtractTextPlugin({ 40 | filename: utils.assetsPath('css/[name].[contenthash].css') 41 | }), 42 | // Compress extracted CSS. We are using this plugin so that possible 43 | // duplicated CSS from different components can be deduped. 44 | new OptimizeCSSPlugin({ 45 | cssProcessorOptions: { 46 | safe: true 47 | } 48 | }), 49 | // generate dist index.html with correct asset hash for caching. 50 | // you can customize output by editing /index.html 51 | // see https://github.com/ampedandwired/html-webpack-plugin 52 | new HtmlWebpackPlugin({ 53 | filename: config.build.index, 54 | template: 'index.html', 55 | inject: true, 56 | minify: { 57 | removeComments: true, 58 | collapseWhitespace: true, 59 | removeAttributeQuotes: true 60 | // more options: 61 | // https://github.com/kangax/html-minifier#options-quick-reference 62 | }, 63 | // necessary to consistently work with multiple chunks via CommonsChunkPlugin 64 | chunksSortMode: 'dependency' 65 | }), 66 | // split vendor js into its own file 67 | new webpack.optimize.CommonsChunkPlugin({ 68 | name: 'vendor', 69 | minChunks: function (module, count) { 70 | // any required modules inside node_modules are extracted to vendor 71 | return ( 72 | module.resource && 73 | /\.js$/.test(module.resource) && 74 | module.resource.indexOf( 75 | path.join(__dirname, '../node_modules') 76 | ) === 0 77 | ) 78 | } 79 | }), 80 | // extract webpack runtime and module manifest to its own file in order to 81 | // prevent vendor hash from being updated whenever app bundle is updated 82 | new webpack.optimize.CommonsChunkPlugin({ 83 | name: 'manifest', 84 | chunks: ['vendor'] 85 | }), 86 | // copy custom static assets 87 | new CopyWebpackPlugin([ 88 | { 89 | from: path.resolve(__dirname, '../static'), 90 | to: config.build.assetsSubDirectory, 91 | ignore: ['.*'] 92 | } 93 | ]) 94 | ] 95 | }) 96 | 97 | if (config.build.productionGzip) { 98 | var CompressionWebpackPlugin = require('compression-webpack-plugin') 99 | 100 | webpackConfig.plugins.push( 101 | new CompressionWebpackPlugin({ 102 | asset: '[path].gz[query]', 103 | algorithm: 'gzip', 104 | test: new RegExp( 105 | '\\.(' + 106 | config.build.productionGzipExtensions.join('|') + 107 | ')$' 108 | ), 109 | threshold: 10240, 110 | minRatio: 0.8 111 | }) 112 | ) 113 | } 114 | 115 | if (config.build.bundleAnalyzerReport) { 116 | var BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin 117 | webpackConfig.plugins.push(new BundleAnalyzerPlugin()) 118 | } 119 | 120 | module.exports = webpackConfig 121 | -------------------------------------------------------------------------------- /stockmarket-vuejs/config/dev.env.js: -------------------------------------------------------------------------------- 1 | var merge = require('webpack-merge') 2 | var prodEnv = require('./prod.env') 3 | 4 | module.exports = merge(prodEnv, { 5 | NODE_ENV: '"development"' 6 | }) 7 | -------------------------------------------------------------------------------- /stockmarket-vuejs/config/index.js: -------------------------------------------------------------------------------- 1 | // see http://vuejs-templates.github.io/webpack for documentation. 2 | var path = require('path') 3 | 4 | module.exports = { 5 | build: { 6 | env: require('./prod.env'), 7 | index: path.resolve(__dirname, '../dist/index.html'), 8 | assetsRoot: path.resolve(__dirname, '../dist'), 9 | assetsSubDirectory: 'static', 10 | assetsPublicPath: '/', 11 | productionSourceMap: true, 12 | // Gzip off by default as many popular static hosts such as 13 | // Surge or Netlify already gzip all static assets for you. 14 | // Before setting to `true`, make sure to: 15 | // npm install --save-dev compression-webpack-plugin 16 | productionGzip: false, 17 | productionGzipExtensions: ['js', 'css'], 18 | // Run the build command with an extra argument to 19 | // View the bundle analyzer report after build finishes: 20 | // `npm run build --report` 21 | // Set to `true` or `false` to always turn it on or off 22 | bundleAnalyzerReport: process.env.npm_config_report 23 | }, 24 | dev: { 25 | env: require('./dev.env'), 26 | port: 8080, 27 | autoOpenBrowser: true, 28 | assetsSubDirectory: 'static', 29 | assetsPublicPath: '/', 30 | proxyTable: {}, 31 | // CSS Sourcemaps off by default because relative paths are "buggy" 32 | // with this option, according to the CSS-Loader README 33 | // (https://github.com/webpack/css-loader#sourcemaps) 34 | // In our experience, they generally work as expected, 35 | // just be aware of this issue when enabling this option. 36 | cssSourceMap: false 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /stockmarket-vuejs/config/prod.env.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | NODE_ENV: '"production"' 3 | } 4 | -------------------------------------------------------------------------------- /stockmarket-vuejs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | stockmarket 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /stockmarket-vuejs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "stockmarket-vuejs", 3 | "version": "1.0.0", 4 | "description": "A Vue.js project", 5 | "author": "lpisicchio ", 6 | "private": true, 7 | "scripts": { 8 | "dev": "node build/dev-server.js", 9 | "start": "node build/dev-server.js", 10 | "build": "node build/build.js" 11 | }, 12 | "dependencies": { 13 | "fast-json-patch": "^2.0.3", 14 | "streamdataio-js-sdk": "^2.0.2", 15 | "vue": "^2.3.3", 16 | "vue-material": "^0.7.2", 17 | "bootstrap-vue": "^0.18.0" 18 | }, 19 | "devDependencies": { 20 | "autoprefixer": "^6.7.2", 21 | "babel-core": "^6.22.1", 22 | "babel-loader": "^6.2.10", 23 | "babel-plugin-transform-runtime": "^6.22.0", 24 | "babel-preset-env": "^1.3.2", 25 | "babel-preset-stage-2": "^6.22.0", 26 | "babel-register": "^6.22.0", 27 | "braces": "^2.3.1", 28 | "chalk": "^1.1.3", 29 | "clean-css": "^4.1.11", 30 | "connect-history-api-fallback": "^1.3.0", 31 | "copy-webpack-plugin": "^4.0.1", 32 | "css-loader": "^0.28.0", 33 | "eventsource-polyfill": "^0.9.6", 34 | "express": "^4.14.1", 35 | "extract-text-webpack-plugin": "^2.0.0", 36 | "file-loader": "^0.11.1", 37 | "friendly-errors-webpack-plugin": "^1.1.3", 38 | "html-webpack-plugin": "^2.28.0", 39 | "http-proxy-middleware": "^0.17.3", 40 | "js-yaml": "^3.13.1", 41 | "opn": "^4.0.2", 42 | "optimize-css-assets-webpack-plugin": "^1.3.0", 43 | "ora": "^1.3.0", 44 | "rimraf": "^2.6.0", 45 | "semver": "^5.3.0", 46 | "shelljs": "^0.7.6", 47 | "url-loader": "^0.5.8", 48 | "vue-loader": "^12.1.0", 49 | "vue-style-loader": "^3.0.1", 50 | "vue-template-compiler": "^2.3.3", 51 | "webpack": "^2.6.1", 52 | "webpack-bundle-analyzer": "^2.2.1", 53 | "webpack-dev-middleware": "^1.10.0", 54 | "webpack-hot-middleware": "^2.18.0", 55 | "webpack-merge": "^4.1.0" 56 | }, 57 | "engines": { 58 | "node": ">= 4.0.0", 59 | "npm": ">= 3.0.0" 60 | }, 61 | "browserslist": [ 62 | "> 1%", 63 | "last 2 versions", 64 | "not ie <= 8" 65 | ] 66 | } 67 | -------------------------------------------------------------------------------- /stockmarket-vuejs/src/App.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 17 | 18 | 28 | -------------------------------------------------------------------------------- /stockmarket-vuejs/src/assets/streamdataio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/axway-streams/axway-amplify-streams-js/d8ee9481907ea9e7556f3eab73224838b881276a/stockmarket-vuejs/src/assets/streamdataio.png -------------------------------------------------------------------------------- /stockmarket-vuejs/src/assets/vuejs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/axway-streams/axway-amplify-streams-js/d8ee9481907ea9e7556f3eab73224838b881276a/stockmarket-vuejs/src/assets/vuejs.png -------------------------------------------------------------------------------- /stockmarket-vuejs/src/components/Streamdataio.vue: -------------------------------------------------------------------------------- 1 | 60 | 61 | 118 | 119 | 120 | 196 | -------------------------------------------------------------------------------- /stockmarket-vuejs/src/main.js: -------------------------------------------------------------------------------- 1 | // The Vue build version to load with the `import` command 2 | // (runtime-only or standalone) has been set in webpack.base.conf with an alias. 3 | import Vue from 'vue' 4 | import App from './App' 5 | 6 | import VueMaterial from 'vue-material' 7 | import 'vue-material/dist/vue-material.css' 8 | import BootstrapVue from 'bootstrap-vue'; 9 | import 'bootstrap/dist/css/bootstrap.css' 10 | import 'bootstrap-vue/dist/bootstrap-vue.css' 11 | 12 | Vue.use(VueMaterial) 13 | Vue.use(BootstrapVue) 14 | Vue.material.registerTheme('default', { 15 | primary: 'deep-purple', 16 | accent: 'amber', 17 | warn: 'red', 18 | background: 'grey' 19 | }) 20 | 21 | Vue.config.productionTip = false 22 | 23 | /* eslint-disable no-new */ 24 | new Vue({ 25 | el: '#app', 26 | template: '', 27 | components: { App } 28 | }) 29 | -------------------------------------------------------------------------------- /stockmarket-vuejs/static/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/axway-streams/axway-amplify-streams-js/d8ee9481907ea9e7556f3eab73224838b881276a/stockmarket-vuejs/static/.gitkeep --------------------------------------------------------------------------------