├── .gitignore ├── .npmignore ├── LICENSE ├── README.md ├── aws.js ├── demo ├── app │ ├── App_Resources │ │ ├── Android │ │ │ ├── AndroidManifest.xml │ │ │ ├── app.gradle │ │ │ ├── drawable-hdpi │ │ │ │ ├── background.png │ │ │ │ ├── icon.png │ │ │ │ └── logo.png │ │ │ ├── drawable-ldpi │ │ │ │ ├── background.png │ │ │ │ ├── icon.png │ │ │ │ └── logo.png │ │ │ ├── drawable-mdpi │ │ │ │ ├── background.png │ │ │ │ ├── icon.png │ │ │ │ └── logo.png │ │ │ ├── drawable-nodpi │ │ │ │ └── splash_screen.xml │ │ │ ├── drawable-xhdpi │ │ │ │ ├── background.png │ │ │ │ ├── icon.png │ │ │ │ └── logo.png │ │ │ ├── drawable-xxhdpi │ │ │ │ ├── background.png │ │ │ │ ├── icon.png │ │ │ │ └── logo.png │ │ │ ├── drawable-xxxhdpi │ │ │ │ ├── background.png │ │ │ │ ├── icon.png │ │ │ │ └── logo.png │ │ │ ├── values-v21 │ │ │ │ ├── colors.xml │ │ │ │ └── styles.xml │ │ │ └── values │ │ │ │ ├── colors.xml │ │ │ │ └── styles.xml │ │ └── iOS │ │ │ ├── Assets.xcassets │ │ │ ├── AppIcon.appiconset │ │ │ │ ├── Contents.json │ │ │ │ ├── icon-29.png │ │ │ │ ├── icon-29@2x.png │ │ │ │ ├── icon-29@3x.png │ │ │ │ ├── icon-40.png │ │ │ │ ├── icon-40@2x.png │ │ │ │ ├── icon-40@3x.png │ │ │ │ ├── icon-50.png │ │ │ │ ├── icon-50@2x.png │ │ │ │ ├── icon-57.png │ │ │ │ ├── icon-57@2x.png │ │ │ │ ├── icon-60@2x.png │ │ │ │ ├── icon-60@3x.png │ │ │ │ ├── icon-72.png │ │ │ │ ├── icon-72@2x.png │ │ │ │ ├── icon-76.png │ │ │ │ ├── icon-76@2x.png │ │ │ │ └── icon-83.5@2x.png │ │ │ ├── Contents.json │ │ │ ├── LaunchImage.launchimage │ │ │ │ ├── Contents.json │ │ │ │ ├── Default-568h@2x.png │ │ │ │ ├── Default-667h@2x.png │ │ │ │ ├── Default-736h@3x.png │ │ │ │ ├── Default-Landscape.png │ │ │ │ ├── Default-Landscape@2x.png │ │ │ │ ├── Default-Landscape@3x.png │ │ │ │ ├── Default-Portrait.png │ │ │ │ ├── Default-Portrait@2x.png │ │ │ │ ├── Default.png │ │ │ │ └── Default@2x.png │ │ │ ├── LaunchScreen.AspectFill.imageset │ │ │ │ ├── Contents.json │ │ │ │ ├── LaunchScreen-AspectFill.png │ │ │ │ └── LaunchScreen-AspectFill@2x.png │ │ │ └── LaunchScreen.Center.imageset │ │ │ │ ├── Contents.json │ │ │ │ ├── LaunchScreen-Center.png │ │ │ │ └── LaunchScreen-Center@2x.png │ │ │ ├── Info.plist │ │ │ ├── LaunchScreen.storyboard │ │ │ └── build.xcconfig │ ├── app.css │ ├── app.ts │ ├── main-page.ts │ ├── main-page.xml │ ├── main-view-model.ts │ ├── package.json │ └── tests │ │ └── tests.js ├── karma.conf.js ├── package.json └── tsconfig.json ├── package.json ├── postinstall.js └── screenshots ├── android-s3-list.png └── ios-s3-list.png /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .vscode 3 | *.js.map 4 | *.log 5 | !scripts/*.js 6 | demo/app/*.js 7 | !demo/karma.conf.js 8 | !demo/app/tests/*.js 9 | demo/*.d.ts 10 | demo/lib 11 | demo/platforms 12 | demo/node_modules 13 | node_modules -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .vscode 3 | demo/ 4 | screenshots/ 5 | *.gif 6 | *.png 7 | *.log 8 | *.map 9 | !*.d.ts 10 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | nativescript-aws 4 | Copyright (c) 2016, Eddy Verbruggen 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # NativeScript AWS plugin 2 | 3 | > DEPRECATED! Please either use [the AWS Native SDK plugin by Osei Fortune](https://github.com/triniwiz/nativescript-aws-sdk), or try `nativescript-nodeify` (which allows you to use the ASW JS SDK) and [follow these instructions](https://github.com/EddyVerbruggen/nativescript-nodeify/blob/master/README.md#aws-sdk-or-amazon-cognito-identity-js-which-includes-aws-sdk). 4 | 5 | ## OLD INSTRUCTIONS 6 | 7 | 8 | ### Q & A 9 | #### Q. Why this module and not use the AWS JS SDK directly? 10 | A. Because you can't due to dependencies on Node and/or the browser (crypto, path, DOMParser, etc). Both of which are not available in a NativeScript context. 11 | 12 | #### Q. So is this plugin not using the AWS JS SDK then? 13 | A. Oh yes it is but upon installation the plugin will modify a few bits in the AWS SDK so it's NativeScript-compatible. 14 | 15 | #### Q. Lol. Wut? Modify AWS? 16 | A. The main trick here is a `postinstall` hook that scans the `aws-sdk` module for `package.json` files, 17 | looks for `browser` configuration nodes, and find-replaces any matching `require()` calls in that package and its dependencies. 18 | 19 | #### Q. But doesn't browserify / Webpack solve this for us? 20 | A. Not in this case, at least not without further modifications. Feel free to submit a PR for a nicer implementation, but this is the best I could think of. 21 | 22 | #### Q. Not bad actually, can we use this approach for other npm modules that depend on node built-ins? 23 | A. Thanks. And good point. Most of this should apply to more generic usages so expect me to release some universal plugin this one will depend on. 24 | 25 | 26 | ### Installation 27 | From the command prompt go to your app's root folder and execute: 28 | 29 | ``` 30 | tns plugin add nativescript-aws 31 | ``` 32 | 33 | Make sure you use TypeScript (as our demo app does), because this plugin exposes the AWS SDK's 34 | TypeScript definitions so you'll have an easier time interacting with Amazon's services. 35 | 36 | ### Demo app 37 | Really, check [the demo](https://github.com/EddyVerbruggen/nativescript-aws/blob/master/demo/app/main-view-model.ts)! It shows how to interact with S3 and Dynamo, 38 | but you should be able to interact with all other AWS services as well. 39 | 40 | Run the demo app from the root of the project: `npm run demo.ios` or `npm run demo.android`. 41 | 42 | #### iOS & Android screenshots 43 | 44 | 45 | 46 | ### API 47 | 100% equal to [the `aws-sdk` module](https://www.npmjs.com/package/aws-sdk). Look at their docs and use TypeScript to make your life easier. 48 | 49 | To get you started, this is how you can require the plugin and pass your credentials: 50 | 51 | #### TypeScript 52 | ```js 53 | import * as AWS from "nativescript-aws"; 54 | import { Credentials } from "nativescript-aws"; 55 | 56 | AWS.config.update({ 57 | region: AWS_region, 58 | credentials: new Credentials(AWS_accessKeyId, AWS_secretAccessKey) 59 | }); 60 | ``` 61 | 62 | #### JavaScript 63 | ```js 64 | var AWS = require("nativescript-aws"); 65 | 66 | AWS.config.update({ 67 | region: AWS_region, 68 | credentials: { 69 | accessKeyId: AWS_accessKeyId, 70 | secretAccessKey: AWS_secretAccessKey 71 | } 72 | }); 73 | ``` 74 | 75 | ### Disclaimer 76 | I've tried to iron out all compatibility issues between AWS and NativeScript, 77 | but you may use some service that throws an error at runtime because it's `require`-ing some 78 | unsupported node module. Please [open an issue](https://github.com/EddyVerbruggen/nativescript-aws/issues/new) in that case and I'll take a look! 79 | 80 | ### Future work 81 | Working on a way to make NativeScript with virtually any Node module, inspired by this plugin.. will update this doc when more news is available. 82 | -------------------------------------------------------------------------------- /aws.js: -------------------------------------------------------------------------------- 1 | // patch {N}'s xhr because AWS uses a few events that cause {N} to throw 'unsupported' errors 2 | require("xhr"); 3 | 4 | var xhrAddEventListenerOrig = XMLHttpRequest.prototype.addEventListener; 5 | XMLHttpRequest.prototype.addEventListener = function(eventName, callback) { 6 | if (eventName === "readystatechange") { 7 | this.onreadystatechange = callback; 8 | } else if (eventName === "progress") { 9 | this.onprogress = callback; 10 | } else if (eventName === "timeout") { 11 | this.ontimeout = callback; 12 | } else { 13 | xhrAddEventListenerOrig.call(this, eventName, callback); 14 | } 15 | }; 16 | if (!XMLHttpRequest.prototype.upload) { 17 | XMLHttpRequest.prototype['upload'] = { 18 | addEventListener: function() {} 19 | }; 20 | } 21 | 22 | module.exports = require("aws-sdk"); -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 12 | 13 | 16 | 17 | 18 | 19 | 20 | 21 | 27 | 28 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/app.gradle: -------------------------------------------------------------------------------- 1 | // Add your native dependencies here: 2 | 3 | // Uncomment to add recyclerview-v7 dependency 4 | //dependencies { 5 | // compile 'com.android.support:recyclerview-v7:+' 6 | //} 7 | 8 | android { 9 | defaultConfig { 10 | generatedDensities = [] 11 | applicationId = "org.nativescript.starter" 12 | } 13 | aaptOptions { 14 | additionalParameters "--no-version-vectors" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/drawable-hdpi/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EddyVerbruggen/nativescript-aws/c4ace5acddfdfbaa78048cbc5271025c114367d3/demo/app/App_Resources/Android/drawable-hdpi/background.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/drawable-hdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EddyVerbruggen/nativescript-aws/c4ace5acddfdfbaa78048cbc5271025c114367d3/demo/app/App_Resources/Android/drawable-hdpi/icon.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/drawable-hdpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EddyVerbruggen/nativescript-aws/c4ace5acddfdfbaa78048cbc5271025c114367d3/demo/app/App_Resources/Android/drawable-hdpi/logo.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/drawable-ldpi/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EddyVerbruggen/nativescript-aws/c4ace5acddfdfbaa78048cbc5271025c114367d3/demo/app/App_Resources/Android/drawable-ldpi/background.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/drawable-ldpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EddyVerbruggen/nativescript-aws/c4ace5acddfdfbaa78048cbc5271025c114367d3/demo/app/App_Resources/Android/drawable-ldpi/icon.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/drawable-ldpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EddyVerbruggen/nativescript-aws/c4ace5acddfdfbaa78048cbc5271025c114367d3/demo/app/App_Resources/Android/drawable-ldpi/logo.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/drawable-mdpi/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EddyVerbruggen/nativescript-aws/c4ace5acddfdfbaa78048cbc5271025c114367d3/demo/app/App_Resources/Android/drawable-mdpi/background.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/drawable-mdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EddyVerbruggen/nativescript-aws/c4ace5acddfdfbaa78048cbc5271025c114367d3/demo/app/App_Resources/Android/drawable-mdpi/icon.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/drawable-mdpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EddyVerbruggen/nativescript-aws/c4ace5acddfdfbaa78048cbc5271025c114367d3/demo/app/App_Resources/Android/drawable-mdpi/logo.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/drawable-nodpi/splash_screen.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/drawable-xhdpi/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EddyVerbruggen/nativescript-aws/c4ace5acddfdfbaa78048cbc5271025c114367d3/demo/app/App_Resources/Android/drawable-xhdpi/background.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/drawable-xhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EddyVerbruggen/nativescript-aws/c4ace5acddfdfbaa78048cbc5271025c114367d3/demo/app/App_Resources/Android/drawable-xhdpi/icon.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/drawable-xhdpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EddyVerbruggen/nativescript-aws/c4ace5acddfdfbaa78048cbc5271025c114367d3/demo/app/App_Resources/Android/drawable-xhdpi/logo.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/drawable-xxhdpi/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EddyVerbruggen/nativescript-aws/c4ace5acddfdfbaa78048cbc5271025c114367d3/demo/app/App_Resources/Android/drawable-xxhdpi/background.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/drawable-xxhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EddyVerbruggen/nativescript-aws/c4ace5acddfdfbaa78048cbc5271025c114367d3/demo/app/App_Resources/Android/drawable-xxhdpi/icon.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/drawable-xxhdpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EddyVerbruggen/nativescript-aws/c4ace5acddfdfbaa78048cbc5271025c114367d3/demo/app/App_Resources/Android/drawable-xxhdpi/logo.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/drawable-xxxhdpi/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EddyVerbruggen/nativescript-aws/c4ace5acddfdfbaa78048cbc5271025c114367d3/demo/app/App_Resources/Android/drawable-xxxhdpi/background.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/drawable-xxxhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EddyVerbruggen/nativescript-aws/c4ace5acddfdfbaa78048cbc5271025c114367d3/demo/app/App_Resources/Android/drawable-xxxhdpi/icon.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/drawable-xxxhdpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EddyVerbruggen/nativescript-aws/c4ace5acddfdfbaa78048cbc5271025c114367d3/demo/app/App_Resources/Android/drawable-xxxhdpi/logo.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/values-v21/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3d5afe 4 | -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/values-v21/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 10 | 11 | 14 | 15 | 16 | 19 | 20 | 23 | -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #F5F5F5 4 | #757575 5 | #33B5E5 6 | #272734 7 | -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 18 | 19 | 21 | 22 | 23 | 31 | 32 | 34 | 35 | 36 | 42 | 43 | 45 | 46 | -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "29x29", 5 | "idiom" : "iphone", 6 | "filename" : "icon-29.png", 7 | "scale" : "1x" 8 | }, 9 | { 10 | "size" : "29x29", 11 | "idiom" : "iphone", 12 | "filename" : "icon-29@2x.png", 13 | "scale" : "2x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "icon-29@3x.png", 19 | "scale" : "3x" 20 | }, 21 | { 22 | "size" : "40x40", 23 | "idiom" : "iphone", 24 | "filename" : "icon-40@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "40x40", 29 | "idiom" : "iphone", 30 | "filename" : "icon-40@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "57x57", 35 | "idiom" : "iphone", 36 | "filename" : "icon-57.png", 37 | "scale" : "1x" 38 | }, 39 | { 40 | "size" : "57x57", 41 | "idiom" : "iphone", 42 | "filename" : "icon-57@2x.png", 43 | "scale" : "2x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "icon-60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "icon-60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "29x29", 59 | "idiom" : "ipad", 60 | "filename" : "icon-29.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "29x29", 65 | "idiom" : "ipad", 66 | "filename" : "icon-29@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "40x40", 71 | "idiom" : "ipad", 72 | "filename" : "icon-40.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "40x40", 77 | "idiom" : "ipad", 78 | "filename" : "icon-40@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "50x50", 83 | "idiom" : "ipad", 84 | "filename" : "icon-50.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "50x50", 89 | "idiom" : "ipad", 90 | "filename" : "icon-50@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "72x72", 95 | "idiom" : "ipad", 96 | "filename" : "icon-72.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "72x72", 101 | "idiom" : "ipad", 102 | "filename" : "icon-72@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "76x76", 107 | "idiom" : "ipad", 108 | "filename" : "icon-76.png", 109 | "scale" : "1x" 110 | }, 111 | { 112 | "size" : "76x76", 113 | "idiom" : "ipad", 114 | "filename" : "icon-76@2x.png", 115 | "scale" : "2x" 116 | }, 117 | { 118 | "size" : "83.5x83.5", 119 | "idiom" : "ipad", 120 | "filename" : "icon-83.5@2x.png", 121 | "scale" : "2x" 122 | } 123 | ], 124 | "info" : { 125 | "version" : 1, 126 | "author" : "xcode" 127 | } 128 | } -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EddyVerbruggen/nativescript-aws/c4ace5acddfdfbaa78048cbc5271025c114367d3/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EddyVerbruggen/nativescript-aws/c4ace5acddfdfbaa78048cbc5271025c114367d3/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EddyVerbruggen/nativescript-aws/c4ace5acddfdfbaa78048cbc5271025c114367d3/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EddyVerbruggen/nativescript-aws/c4ace5acddfdfbaa78048cbc5271025c114367d3/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EddyVerbruggen/nativescript-aws/c4ace5acddfdfbaa78048cbc5271025c114367d3/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EddyVerbruggen/nativescript-aws/c4ace5acddfdfbaa78048cbc5271025c114367d3/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EddyVerbruggen/nativescript-aws/c4ace5acddfdfbaa78048cbc5271025c114367d3/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-50.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-50@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EddyVerbruggen/nativescript-aws/c4ace5acddfdfbaa78048cbc5271025c114367d3/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-50@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-57.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EddyVerbruggen/nativescript-aws/c4ace5acddfdfbaa78048cbc5271025c114367d3/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-57.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-57@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EddyVerbruggen/nativescript-aws/c4ace5acddfdfbaa78048cbc5271025c114367d3/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-57@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EddyVerbruggen/nativescript-aws/c4ace5acddfdfbaa78048cbc5271025c114367d3/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EddyVerbruggen/nativescript-aws/c4ace5acddfdfbaa78048cbc5271025c114367d3/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EddyVerbruggen/nativescript-aws/c4ace5acddfdfbaa78048cbc5271025c114367d3/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-72.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-72@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EddyVerbruggen/nativescript-aws/c4ace5acddfdfbaa78048cbc5271025c114367d3/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-72@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EddyVerbruggen/nativescript-aws/c4ace5acddfdfbaa78048cbc5271025c114367d3/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EddyVerbruggen/nativescript-aws/c4ace5acddfdfbaa78048cbc5271025c114367d3/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EddyVerbruggen/nativescript-aws/c4ace5acddfdfbaa78048cbc5271025c114367d3/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "extent" : "full-screen", 5 | "idiom" : "iphone", 6 | "subtype" : "736h", 7 | "filename" : "Default-736h@3x.png", 8 | "minimum-system-version" : "8.0", 9 | "orientation" : "portrait", 10 | "scale" : "3x" 11 | }, 12 | { 13 | "extent" : "full-screen", 14 | "idiom" : "iphone", 15 | "subtype" : "736h", 16 | "filename" : "Default-Landscape@3x.png", 17 | "minimum-system-version" : "8.0", 18 | "orientation" : "landscape", 19 | "scale" : "3x" 20 | }, 21 | { 22 | "extent" : "full-screen", 23 | "idiom" : "iphone", 24 | "subtype" : "667h", 25 | "filename" : "Default-667h@2x.png", 26 | "minimum-system-version" : "8.0", 27 | "orientation" : "portrait", 28 | "scale" : "2x" 29 | }, 30 | { 31 | "orientation" : "portrait", 32 | "idiom" : "iphone", 33 | "filename" : "Default@2x.png", 34 | "extent" : "full-screen", 35 | "minimum-system-version" : "7.0", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "extent" : "full-screen", 40 | "idiom" : "iphone", 41 | "subtype" : "retina4", 42 | "filename" : "Default-568h@2x.png", 43 | "minimum-system-version" : "7.0", 44 | "orientation" : "portrait", 45 | "scale" : "2x" 46 | }, 47 | { 48 | "orientation" : "portrait", 49 | "idiom" : "ipad", 50 | "filename" : "Default-Portrait.png", 51 | "extent" : "full-screen", 52 | "minimum-system-version" : "7.0", 53 | "scale" : "1x" 54 | }, 55 | { 56 | "orientation" : "landscape", 57 | "idiom" : "ipad", 58 | "filename" : "Default-Landscape.png", 59 | "extent" : "full-screen", 60 | "minimum-system-version" : "7.0", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "orientation" : "portrait", 65 | "idiom" : "ipad", 66 | "filename" : "Default-Portrait@2x.png", 67 | "extent" : "full-screen", 68 | "minimum-system-version" : "7.0", 69 | "scale" : "2x" 70 | }, 71 | { 72 | "orientation" : "landscape", 73 | "idiom" : "ipad", 74 | "filename" : "Default-Landscape@2x.png", 75 | "extent" : "full-screen", 76 | "minimum-system-version" : "7.0", 77 | "scale" : "2x" 78 | }, 79 | { 80 | "orientation" : "portrait", 81 | "idiom" : "iphone", 82 | "filename" : "Default.png", 83 | "extent" : "full-screen", 84 | "scale" : "1x" 85 | }, 86 | { 87 | "orientation" : "portrait", 88 | "idiom" : "iphone", 89 | "filename" : "Default@2x.png", 90 | "extent" : "full-screen", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "orientation" : "portrait", 95 | "idiom" : "iphone", 96 | "filename" : "Default-568h@2x.png", 97 | "extent" : "full-screen", 98 | "subtype" : "retina4", 99 | "scale" : "2x" 100 | }, 101 | { 102 | "orientation" : "portrait", 103 | "idiom" : "ipad", 104 | "extent" : "to-status-bar", 105 | "scale" : "1x" 106 | }, 107 | { 108 | "orientation" : "portrait", 109 | "idiom" : "ipad", 110 | "filename" : "Default-Portrait.png", 111 | "extent" : "full-screen", 112 | "scale" : "1x" 113 | }, 114 | { 115 | "orientation" : "landscape", 116 | "idiom" : "ipad", 117 | "extent" : "to-status-bar", 118 | "scale" : "1x" 119 | }, 120 | { 121 | "orientation" : "landscape", 122 | "idiom" : "ipad", 123 | "filename" : "Default-Landscape.png", 124 | "extent" : "full-screen", 125 | "scale" : "1x" 126 | }, 127 | { 128 | "orientation" : "portrait", 129 | "idiom" : "ipad", 130 | "extent" : "to-status-bar", 131 | "scale" : "2x" 132 | }, 133 | { 134 | "orientation" : "portrait", 135 | "idiom" : "ipad", 136 | "filename" : "Default-Portrait@2x.png", 137 | "extent" : "full-screen", 138 | "scale" : "2x" 139 | }, 140 | { 141 | "orientation" : "landscape", 142 | "idiom" : "ipad", 143 | "extent" : "to-status-bar", 144 | "scale" : "2x" 145 | }, 146 | { 147 | "orientation" : "landscape", 148 | "idiom" : "ipad", 149 | "filename" : "Default-Landscape@2x.png", 150 | "extent" : "full-screen", 151 | "scale" : "2x" 152 | } 153 | ], 154 | "info" : { 155 | "version" : 1, 156 | "author" : "xcode" 157 | } 158 | } -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EddyVerbruggen/nativescript-aws/c4ace5acddfdfbaa78048cbc5271025c114367d3/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-568h@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-667h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EddyVerbruggen/nativescript-aws/c4ace5acddfdfbaa78048cbc5271025c114367d3/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-667h@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-736h@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EddyVerbruggen/nativescript-aws/c4ace5acddfdfbaa78048cbc5271025c114367d3/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-736h@3x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EddyVerbruggen/nativescript-aws/c4ace5acddfdfbaa78048cbc5271025c114367d3/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EddyVerbruggen/nativescript-aws/c4ace5acddfdfbaa78048cbc5271025c114367d3/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EddyVerbruggen/nativescript-aws/c4ace5acddfdfbaa78048cbc5271025c114367d3/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@3x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EddyVerbruggen/nativescript-aws/c4ace5acddfdfbaa78048cbc5271025c114367d3/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EddyVerbruggen/nativescript-aws/c4ace5acddfdfbaa78048cbc5271025c114367d3/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EddyVerbruggen/nativescript-aws/c4ace5acddfdfbaa78048cbc5271025c114367d3/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EddyVerbruggen/nativescript-aws/c4ace5acddfdfbaa78048cbc5271025c114367d3/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchScreen-AspectFill.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchScreen-AspectFill@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EddyVerbruggen/nativescript-aws/c4ace5acddfdfbaa78048cbc5271025c114367d3/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EddyVerbruggen/nativescript-aws/c4ace5acddfdfbaa78048cbc5271025c114367d3/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchScreen-Center.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchScreen-Center@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EddyVerbruggen/nativescript-aws/c4ace5acddfdfbaa78048cbc5271025c114367d3/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EddyVerbruggen/nativescript-aws/c4ace5acddfdfbaa78048cbc5271025c114367d3/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIRequiresFullScreen 28 | 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/build.xcconfig: -------------------------------------------------------------------------------- 1 | // You can add custom settings here 2 | // for example you can uncomment the following line to force distribution code signing 3 | // CODE_SIGN_IDENTITY = iPhone Distribution 4 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 5 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 6 | -------------------------------------------------------------------------------- /demo/app/app.css: -------------------------------------------------------------------------------- 1 | .message { 2 | color: #666; 3 | font-size: 16; 4 | padding: 20; 5 | } 6 | 7 | button { 8 | background-color: #6494AA; 9 | padding: 10; 10 | margin: 6 20; 11 | font-size: 14; 12 | border-radius: 6; 13 | } 14 | 15 | .button { 16 | color: #ffffff; 17 | } 18 | 19 | .button-a { 20 | background-color: #90A959; 21 | } 22 | 23 | .button-b { 24 | background-color: #E0A458; 25 | } 26 | 27 | .button-c { 28 | background-color: #FF6600; 29 | } -------------------------------------------------------------------------------- /demo/app/app.ts: -------------------------------------------------------------------------------- 1 | import * as application from 'application'; 2 | application.start({ moduleName: "main-page" }); 3 | -------------------------------------------------------------------------------- /demo/app/main-page.ts: -------------------------------------------------------------------------------- 1 | import * as observable from 'data/observable'; 2 | import * as pages from 'ui/page'; 3 | import {HelloWorldModel} from './main-view-model'; 4 | 5 | // Event handler for Page 'loaded' event attached in main-page.xml 6 | export function pageLoaded(args: observable.EventData) { 7 | // Get the event sender 8 | let page = args.object; 9 | page.bindingContext = new HelloWorldModel(); 10 | } -------------------------------------------------------------------------------- /demo/app/main-page.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | -------------------------------------------------------------------------------- /demo/app/main-view-model.ts: -------------------------------------------------------------------------------- 1 | import { Observable } from "data/observable"; 2 | import { alert } from "ui/dialogs"; 3 | 4 | import * as AWS from "nativescript-aws"; 5 | import { Credentials } from "nativescript-aws"; 6 | 7 | declare let JSON, Date: any; 8 | 9 | 10 | 11 | // TODO replace these with your own AWS credentials ************************** 12 | const AWS_accessKeyId: string = "YOUR_ACCESS_KEY_ID"; 13 | const AWS_secretAccessKey: string = "YOUR_SECRET_ACCESS_KEY"; 14 | const AWS_region: string = "us-west-2"; 15 | const AWS_S3_bucket: string = "telerikdemoapp"; 16 | 17 | 18 | export class HelloWorldModel extends Observable { 19 | constructor() { 20 | super(); 21 | AWS.config.update({ 22 | region: AWS_region, 23 | credentials: new Credentials(AWS_accessKeyId, AWS_secretAccessKey) 24 | }); 25 | } 26 | 27 | public listS3BucketContents() { 28 | const s3 = new AWS.S3({ 29 | apiVersion: "2006-03-01" 30 | }); 31 | 32 | s3.listObjects({Bucket: AWS_S3_bucket}, (err, data) => { 33 | if (err) { 34 | alert(JSON.stringify(err)); 35 | } else { 36 | let result: string = `Loaded ${data.Contents.length} items from S3:\n`; 37 | for (let i = 0; i < data.Contents.length; i++) { 38 | result += ` - ${data.Contents[i].Key}\n`; 39 | } 40 | alert({ 41 | title: "S3 Bucket contents", 42 | message: result, 43 | okButtonText: "OK" 44 | }); 45 | } 46 | }); 47 | } 48 | 49 | public listDynamoTables() { 50 | const db = new AWS.DynamoDB(); 51 | db.listTables((err, data) => { 52 | if (err) { 53 | alert(JSON.stringify(err)); 54 | } else { 55 | alert({ 56 | title: "Dynamo tables", 57 | message: "" + data.TableNames, 58 | okButtonText: "OK" 59 | }); 60 | } 61 | }); 62 | } 63 | 64 | public updateDynamoTable() { 65 | new AWS.DynamoDB().putItem({ 66 | TableName: "html5frameworks", 67 | Item: { 68 | "Framework ID": {S: "Kendo UI"}, 69 | data: { 70 | S: "Last update: " + new Date().toString() 71 | } 72 | } 73 | }, (err, data) => { 74 | if (err) { 75 | alert(err); 76 | } else { 77 | alert({ 78 | title: "", 79 | message: "Record updated", 80 | okButtonText: "OK" 81 | }); 82 | } 83 | }); 84 | } 85 | } -------------------------------------------------------------------------------- /demo/app/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "AWS", 3 | "main": "app.js", 4 | "version": "1.6.0", 5 | "author": { 6 | "name": "Telerik", 7 | "email": "support@telerik.com" 8 | }, 9 | "description": "Nativescript hello-world-ts project template", 10 | "license": "Apache-2.0", 11 | "keywords": [ 12 | "telerik", 13 | "mobile", 14 | "nativescript", 15 | "{N}", 16 | "tns", 17 | "appbuilder", 18 | "template" 19 | ], 20 | "repository": { 21 | "type": "git", 22 | "url": "git+ssh://git@github.com/NativeScript/template-hello-world-ts.git" 23 | }, 24 | "bugs": { 25 | "url": "https://github.com/NativeScript/template-hello-world-ts/issues" 26 | }, 27 | "homepage": "https://github.com/NativeScript/template-hello-world-ts", 28 | "android": { 29 | "v8Flags": "--expose_gc" 30 | }, 31 | "devDependencies": { 32 | "nativescript-dev-typescript": "^0.3.0" 33 | }, 34 | "_id": "tns-template-hello-world-ts@1.6.0", 35 | "_shasum": "a567c2b9a56024818c06596dab9629d155c5b8a8", 36 | "_resolved": "https://registry.npmjs.org/tns-template-hello-world-ts/-/tns-template-hello-world-ts-1.6.0.tgz", 37 | "_from": "tns-template-hello-world-ts@latest", 38 | "scripts": {}, 39 | "_npmVersion": "2.14.7", 40 | "_nodeVersion": "4.2.2", 41 | "_npmUser": { 42 | "name": "enchev", 43 | "email": "vladimir.enchev@gmail.com" 44 | }, 45 | "dist": { 46 | "shasum": "a567c2b9a56024818c06596dab9629d155c5b8a8", 47 | "tarball": "http://registry.npmjs.org/tns-template-hello-world-ts/-/tns-template-hello-world-ts-1.6.0.tgz" 48 | }, 49 | "maintainers": [ 50 | { 51 | "name": "enchev", 52 | "email": "vladimir.enchev@gmail.com" 53 | }, 54 | { 55 | "name": "erjangavalji", 56 | "email": "erjan.gavalji@gmail.com" 57 | }, 58 | { 59 | "name": "fatme", 60 | "email": "hfatme@gmail.com" 61 | }, 62 | { 63 | "name": "hdeshev", 64 | "email": "hristo@deshev.com" 65 | }, 66 | { 67 | "name": "kerezov", 68 | "email": "d.kerezov@gmail.com" 69 | }, 70 | { 71 | "name": "ligaz", 72 | "email": "stefan.dobrev@gmail.com" 73 | }, 74 | { 75 | "name": "nsndeck", 76 | "email": "nedyalko.nikolov@telerik.com" 77 | }, 78 | { 79 | "name": "rosen-vladimirov", 80 | "email": "rosen.vladimirov.91@gmail.com" 81 | }, 82 | { 83 | "name": "sdobrev", 84 | "email": "stefan.dobrev@gmail.com" 85 | }, 86 | { 87 | "name": "tailsu", 88 | "email": "tailsu@gmail.com" 89 | }, 90 | { 91 | "name": "teobugslayer", 92 | "email": "teobugslayer@gmail.com" 93 | }, 94 | { 95 | "name": "valio.stoychev", 96 | "email": "valio.stoychev@gmail.com" 97 | } 98 | ], 99 | "_npmOperationalInternal": { 100 | "host": "packages-5-east.internal.npmjs.com", 101 | "tmp": "tmp/tns-template-hello-world-ts-1.6.0.tgz_1455717516189_0.6427943941671401" 102 | }, 103 | "directories": {}, 104 | "readme": "ERROR: No README data found!" 105 | } 106 | -------------------------------------------------------------------------------- /demo/app/tests/tests.js: -------------------------------------------------------------------------------- 1 | var aws = require("nativescript-aws"); 2 | 3 | describe("config", function() { 4 | it("exists", function() { 5 | expect(aws.config).toBeDefined(); 6 | }); 7 | }); -------------------------------------------------------------------------------- /demo/karma.conf.js: -------------------------------------------------------------------------------- 1 | module.exports = function(config) { 2 | config.set({ 3 | 4 | // base path that will be used to resolve all patterns (eg. files, exclude) 5 | basePath: '', 6 | 7 | 8 | // frameworks to use 9 | // available frameworks: https://npmjs.org/browse/keyword/karma-adapter 10 | frameworks: ['jasmine'], 11 | 12 | 13 | // list of files / patterns to load in the browser 14 | files: [ 15 | 'app/**/*.js', 16 | ], 17 | 18 | 19 | // list of files to exclude 20 | exclude: [ 21 | ], 22 | 23 | 24 | // preprocess matching files before serving them to the browser 25 | // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor 26 | preprocessors: { 27 | }, 28 | 29 | 30 | // test results reporter to use 31 | // possible values: 'dots', 'progress' 32 | // available reporters: https://npmjs.org/browse/keyword/karma-reporter 33 | reporters: ['progress'], 34 | 35 | 36 | // web server port 37 | port: 9876, 38 | 39 | 40 | // enable / disable colors in the output (reporters and logs) 41 | colors: true, 42 | 43 | 44 | // level of logging 45 | // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG 46 | logLevel: config.LOG_INFO, 47 | 48 | 49 | // enable / disable watching file and executing tests whenever any file changes 50 | autoWatch: true, 51 | 52 | 53 | // start these browsers 54 | // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher 55 | browsers: [], 56 | 57 | customLaunchers: { 58 | android: { 59 | base: 'NS', 60 | platform: 'android' 61 | }, 62 | ios: { 63 | base: 'NS', 64 | platform: 'ios' 65 | }, 66 | ios_simulator: { 67 | base: 'NS', 68 | platform: 'ios', 69 | arguments: ['--emulator'] 70 | } 71 | }, 72 | 73 | // Continuous Integration mode 74 | // if true, Karma captures browsers, runs the tests and exits 75 | singleRun: false 76 | }); 77 | }; 78 | -------------------------------------------------------------------------------- /demo/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "nativescript": { 3 | "id": "org.nativescript.demo.aws", 4 | "tns-android": { 5 | "version": "2.4.1" 6 | }, 7 | "tns-ios": { 8 | "version": "2.4.0" 9 | } 10 | }, 11 | "dependencies": { 12 | "nativescript-aws": "file:..", 13 | "nativescript-unit-test-runner": "^0.3.0", 14 | "tns-core-modules": "^2.3.0" 15 | }, 16 | "devDependencies": { 17 | "babel-traverse": "6.12.0", 18 | "babel-types": "6.11.1", 19 | "babylon": "6.8.4", 20 | "filewalker": "0.1.2", 21 | "jasmine-core": "^2.5.2", 22 | "karma": "^1.3.0", 23 | "karma-jasmine": "^1.0.2", 24 | "karma-nativescript-launcher": "^0.4.0", 25 | "lazy": "1.0.11", 26 | "nativescript-dev-typescript": "^0.3.2", 27 | "typescript": "^2.0.7" 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /demo/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "commonjs", 5 | "declaration": false, 6 | "removeComments": true, 7 | "noLib": false, 8 | "emitDecoratorMetadata": true, 9 | "experimentalDecorators": true, 10 | "lib": [ 11 | "dom" 12 | ], 13 | "sourceMap": true, 14 | "pretty": true, 15 | "allowUnreachableCode": false, 16 | "allowUnusedLabels": false, 17 | "noEmitHelpers": true, 18 | "noEmitOnError": false, 19 | "noImplicitAny": false, 20 | "noImplicitReturns": true, 21 | "noImplicitUseStrict": false, 22 | "noFallthroughCasesInSwitch": true, 23 | "typeRoots": [ 24 | "./node_modules/@types", 25 | "./node_modules" 26 | ], 27 | "types": [] 28 | }, 29 | "exclude": [ 30 | "node_modules", 31 | "platforms" 32 | ], 33 | "compileOnSave": false 34 | } -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nativescript-aws", 3 | "version": "1.0.0", 4 | "description": "NativeScript wrapper for the AWS JavaScript SDK. Fixes a few incompatibilites.", 5 | "main": "aws", 6 | "typings": "node_modules/aws-sdk/index.d.ts", 7 | "nativescript": { 8 | "platforms": { 9 | "android": "2.3.0", 10 | "ios": "2.3.0" 11 | } 12 | }, 13 | "scripts": { 14 | "demo.ios": "npm run preparedemo && cd demo && tns emulate ios", 15 | "demo.ios.device": "npm run preparedemo && cd demo && tns run ios", 16 | "demo.android": "npm run preparedemo && cd demo && tns run android", 17 | "test.ios": "cd demo && tns test ios --emulator", 18 | "test.ios.device": "cd demo && tns test ios", 19 | "test.android": "cd demo && tns test android", 20 | "preparedemo": "cd demo && tns plugin add .. && tns install", 21 | "setup": "npm i && cd demo && npm i && cd .. && cd demo && tns plugin add .. && cd ..", 22 | "postinstall": "node postinstall.js" 23 | }, 24 | "repository": { 25 | "type": "git", 26 | "url": "https://github.com/EddyVerbruggen/nativescript-aws.git" 27 | }, 28 | "keywords": [ 29 | "ecosystem:nativescript", 30 | "NativeScript", 31 | "JavaScript", 32 | "Android", 33 | "iOS", 34 | "AWS", 35 | "Amazon", 36 | "S3", 37 | "Dynamo" 38 | ], 39 | "author": { 40 | "name": "Eddy Verbruggen", 41 | "email": "eddyverbruggen@gmail.com" 42 | }, 43 | "bugs": { 44 | "url": "https://github.com/EddyVerbruggen/nativescript-aws/issues" 45 | }, 46 | "license": "MIT", 47 | "homepage": "https://github.com/EddyVerbruggen/nativescript-aws", 48 | "readmeFilename": "README.md", 49 | "dependencies": { 50 | "aws-sdk": "^2.4.8", 51 | "replace-in-file": "^2.0.3", 52 | "nativescript-xml2js": "^0.1.0", 53 | "events": "^1.1.1" 54 | }, 55 | "devDependencies": { 56 | "tns-core-modules": "^2.3.0", 57 | "tns-platform-declarations": "^2.3.0", 58 | "typescript": "^2.0.7", 59 | "prompt": "^1.0.0", 60 | "rimraf": "^2.5.0" 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /postinstall.js: -------------------------------------------------------------------------------- 1 | console.log("**********************************************************"); 2 | console.log("******* start nativescript-aws compatibility patch *******"); 3 | console.log("**********************************************************"); 4 | 5 | var fs = require('fs'), 6 | path = require('path'), 7 | replaceInFile = require('replace-in-file'); 8 | 9 | // extracted this var as I can foresee part of this hook turning into a standalone plugin 10 | var rootpackagename = 'aws-sdk'; 11 | 12 | function changeFiles(files, replace, by) { 13 | var changedFiles = replaceInFile.sync({ 14 | files: files, 15 | replace: replace, 16 | with: by, 17 | allowEmptyPaths: true 18 | }); 19 | if (changedFiles.length > 0) { 20 | console.log("\nReplaced '" + replace + "' by '" + by + "' in:\n " + changedFiles.join('\n ')); 21 | } 22 | } 23 | 24 | function findFilesByName(startPath, filter, result) { 25 | if (fs.existsSync(startPath)) { 26 | var files = fs.readdirSync(startPath); 27 | for (var i = 0; i < files.length; i++) { 28 | var filename = files[i]; 29 | var filepath = path.join(startPath, filename); 30 | var stat = fs.lstatSync(filepath); 31 | if (stat.isDirectory()) { 32 | findFilesByName(filepath, filter, result); 33 | } else if (filename === filter) { 34 | result.push("./" + startPath); 35 | } 36 | } 37 | } 38 | return result; 39 | } 40 | 41 | function patchPackageJsonMainAndFetchBrowserNode(fileName) { 42 | var file = require(fileName); 43 | var main = file.main; 44 | var browser = file.browser; 45 | if (main && browser) { 46 | var mainReplacement = browser[main]; 47 | if (mainReplacement) { 48 | console.log("\n" + fileName + "'s main ('" + main + "') was replaced by its browser version ('" + mainReplacement + "')"); 49 | file.main = mainReplacement; 50 | fs.writeFileSync(fileName, JSON.stringify(file, null, 2)); 51 | } 52 | } 53 | return browser; 54 | } 55 | 56 | function patchPackage(packagepath) { 57 | var browserNode = patchPackageJsonMainAndFetchBrowserNode(packagepath + "/package.json"); 58 | if (browserNode) { 59 | var transformed = []; 60 | var nodeValue; 61 | // duplicate all modules starting with './' to '../' as modules may be referenced in either way 62 | for (nodeValue in browserNode) { 63 | if (browserNode.hasOwnProperty(nodeValue) && browserNode[nodeValue]) { 64 | if (nodeValue.startsWith("./")) { 65 | transformed.push(["\\.\\" + nodeValue, "." + browserNode[nodeValue]]); 66 | } 67 | transformed.push([nodeValue, browserNode[nodeValue]]); 68 | } 69 | } 70 | for (var i in transformed) { 71 | nodeValue = transformed[i][0]; 72 | var browserReplacement = transformed[i][1]; 73 | if (browserReplacement) { 74 | if (nodeValue.endsWith(".js")) { 75 | nodeValue = nodeValue.substring(0, nodeValue.indexOf(".js")); 76 | } 77 | if (browserReplacement.endsWith(".js")) { 78 | browserReplacement = browserReplacement.substring(0, browserReplacement.indexOf(".js")); 79 | } 80 | var where = [packagepath + "/**/*.js"], 81 | what = new RegExp("require\\((.*)" + nodeValue + "(.*)\\)", "g"), 82 | // to be safe, adding a space after require so it won't match repeatedly 83 | by = "require ('" + browserReplacement + "')"; 84 | changeFiles(where, what, by); 85 | } 86 | } 87 | } 88 | } 89 | 90 | 91 | try { 92 | var rootpackagepath = "./node_modules/" + rootpackagename; 93 | var packages = findFilesByName(rootpackagepath + "/node_modules", "package.json", [rootpackagepath]); 94 | // console.log("\npackage.jsons found in:\n " + packages.join("\n ")); 95 | 96 | for (var p in packages) { 97 | patchPackage(packages[p]); 98 | } 99 | 100 | // we need to do some more replacements than specified in the root package.json as these modules depend on a browser window / DOM 101 | changeFiles(["./node_modules/" + rootpackagename + "/lib/browser_loader.js"], "require('./xml/browser_parser')", "require('./xml/node_parser')"); 102 | changeFiles(["./node_modules/" + rootpackagename + "/lib/xml/node_parser.js"], "require('xml2js')", "require('nativescript-xml2js')"); 103 | 104 | } catch (error) { 105 | console.error('Error occurred:', error); 106 | } 107 | 108 | console.log("\n"); 109 | console.log("**********************************************************"); 110 | console.log("******* end nativescript-aws compatibility patch *******"); 111 | console.log("**********************************************************"); 112 | console.log("\n"); -------------------------------------------------------------------------------- /screenshots/android-s3-list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EddyVerbruggen/nativescript-aws/c4ace5acddfdfbaa78048cbc5271025c114367d3/screenshots/android-s3-list.png -------------------------------------------------------------------------------- /screenshots/ios-s3-list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EddyVerbruggen/nativescript-aws/c4ace5acddfdfbaa78048cbc5271025c114367d3/screenshots/ios-s3-list.png --------------------------------------------------------------------------------