New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please provide a description: How to use aws-sdk-typescript. #16

Closed
JanOschii opened this Issue Jul 6, 2016 · 12 comments

Comments

Projects
None yet
5 participants
@JanOschii

JanOschii commented Jul 6, 2016

As a beginner, i still have some questions. Some words in the readme would be nice, about:

  • I do not need to install the aws-sdk anymore, do I?
  • I do not need to install the typings for aws-sdk anymore, right?
  • How I "require" the library in my project

I think that could help a lot of people.

Thank you

Jan

@aldrinleal

This comment has been minimized.

Show comment
Hide comment
@aldrinleal

aldrinleal Jul 6, 2016

Member

Pull Requests are welcome!
On Jul 6, 2016 11:15, "JanOschii" notifications@github.com wrote:

As a beginner, i still have some questions. Some words in the readme would
be nice, about:

  • I do not need to install the aws-sdk anymore, do I?
  • I do not need to install the typings for aws-sdk anymore, right?
  • How I "require" the library in my project

I think that could help a lot of people.

Thank you

Jan


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#16, or mute the
thread
https://github.com/notifications/unsubscribe/AAPctdXi4veOtHqT5DAJo93vPYepME07ks5qS9SYgaJpZM4JGQFO
.

Member

aldrinleal commented Jul 6, 2016

Pull Requests are welcome!
On Jul 6, 2016 11:15, "JanOschii" notifications@github.com wrote:

As a beginner, i still have some questions. Some words in the readme would
be nice, about:

  • I do not need to install the aws-sdk anymore, do I?
  • I do not need to install the typings for aws-sdk anymore, right?
  • How I "require" the library in my project

I think that could help a lot of people.

Thank you

Jan


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#16, or mute the
thread
https://github.com/notifications/unsubscribe/AAPctdXi4veOtHqT5DAJo93vPYepME07ks5qS9SYgaJpZM4JGQFO
.

@djabry

This comment has been minimized.

Show comment
Hide comment
@djabry

djabry Jul 6, 2016

@JanOschii

  1. You still need to install the aws-sdk module since this project is only there to provide the typescript bindings
  2. You should not install the definitely typed bindings if you use this version
  3. You can use these in your project by setting up typings and then installing the bindings from github using:
    typings i aws-sdk=github:ingenieux/aws-sdk-typescript#HEAD --save -G

If your setup is correct then you should be able to use a standard import or require statement in your code e.g.
import {S3} from "aws-sdk";

@aldrinleal I've started a readme in my forked version with installation instructions

djabry commented Jul 6, 2016

@JanOschii

  1. You still need to install the aws-sdk module since this project is only there to provide the typescript bindings
  2. You should not install the definitely typed bindings if you use this version
  3. You can use these in your project by setting up typings and then installing the bindings from github using:
    typings i aws-sdk=github:ingenieux/aws-sdk-typescript#HEAD --save -G

If your setup is correct then you should be able to use a standard import or require statement in your code e.g.
import {S3} from "aws-sdk";

@aldrinleal I've started a readme in my forked version with installation instructions

@JanOschii

This comment has been minimized.

Show comment
Hide comment
@JanOschii

JanOschii Jul 7, 2016

@djabry Many thanks m8! That really helps starting using aws-sdk-typescript.

JanOschii commented Jul 7, 2016

@djabry Many thanks m8! That really helps starting using aws-sdk-typescript.

@JanOschii JanOschii changed the title from Please provider a description How to use aws-sdk-typescript. to Please provide a description How to use aws-sdk-typescript. Jul 7, 2016

@JanOschii JanOschii changed the title from Please provide a description How to use aws-sdk-typescript. to Please provide a description: How to use aws-sdk-typescript. Jul 7, 2016

@DmitryEfimenko

This comment has been minimized.

Show comment
Hide comment
@DmitryEfimenko

DmitryEfimenko Aug 12, 2016

these aws typings are so much better then the once on DefinitellyTyped.
I was looking for a way to install them using typings, and the comment by @djabry worked great, but on a relevant note, how come these typings are not coming up when you typings search aws-sdk?
I bet if more people were aware of them, it would only help!

DmitryEfimenko commented Aug 12, 2016

these aws typings are so much better then the once on DefinitellyTyped.
I was looking for a way to install them using typings, and the comment by @djabry worked great, but on a relevant note, how come these typings are not coming up when you typings search aws-sdk?
I bet if more people were aware of them, it would only help!

@Prashant-Kan

This comment has been minimized.

Show comment
Hide comment
@Prashant-Kan

Prashant-Kan Aug 14, 2016

I am facing the issue using the aws.sdk.ts file. I have install it and import in my mainmodule.ts file.
Have used S3bucket, config and other functions from aws.sdk file. But, when I run in the browser It shows undefined for the aws import file.

import * as AWS from 'aws-sdk';

export function typeScriptViewModel(first, last) {
    var self = this;
    var DataBucket = 'emaildataports';
    var userDatBucket = 'user-data';

    var testBucket = 'emailtests';
    var userTestBucket = 'user--tests';


    AWS.Config({
        accessKeyId: 'myaccessKeyID',
        secretAccessKey: 'mysecretAccessKey'
    });
....
...
...
// many more usage of AWS. but got stuck on the first implementation itself.
   //var bucket = new AWS.S3({
   //         params: {
   //             Bucket: bucketName, Prefix: path, Delimiter: '/'
   //         }
   //     });
}

"Uncaught TypeError: Cannot read property 'Config' of undefined".

what can be the solution for this.
I read the comment to install the typings and go ahead. But, didn't able to get on that. Getting error when installing using
typings i aws-sdk=github:ingenieux/aws-sdk-typescript#HEAD --save -G

I have typings folder in my root project. I know I m missing some minor thing.

Prashant-Kan commented Aug 14, 2016

I am facing the issue using the aws.sdk.ts file. I have install it and import in my mainmodule.ts file.
Have used S3bucket, config and other functions from aws.sdk file. But, when I run in the browser It shows undefined for the aws import file.

import * as AWS from 'aws-sdk';

export function typeScriptViewModel(first, last) {
    var self = this;
    var DataBucket = 'emaildataports';
    var userDatBucket = 'user-data';

    var testBucket = 'emailtests';
    var userTestBucket = 'user--tests';


    AWS.Config({
        accessKeyId: 'myaccessKeyID',
        secretAccessKey: 'mysecretAccessKey'
    });
....
...
...
// many more usage of AWS. but got stuck on the first implementation itself.
   //var bucket = new AWS.S3({
   //         params: {
   //             Bucket: bucketName, Prefix: path, Delimiter: '/'
   //         }
   //     });
}

"Uncaught TypeError: Cannot read property 'Config' of undefined".

what can be the solution for this.
I read the comment to install the typings and go ahead. But, didn't able to get on that. Getting error when installing using
typings i aws-sdk=github:ingenieux/aws-sdk-typescript#HEAD --save -G

I have typings folder in my root project. I know I m missing some minor thing.

@djabry

This comment has been minimized.

Show comment
Hide comment
@djabry

djabry Aug 14, 2016

@Prashant-Kan - It's difficult to tell from your code what's going wrong since it's probably a configuration issue (i.e. something with your package.json or with your index.html). Are you able to recreate the problem on Codepen or something similar?

if AWS is undefined then it would suggest that the AWS SDK isn't installed - you could try npm install --save aws-sdk

djabry commented Aug 14, 2016

@Prashant-Kan - It's difficult to tell from your code what's going wrong since it's probably a configuration issue (i.e. something with your package.json or with your index.html). Are you able to recreate the problem on Codepen or something similar?

if AWS is undefined then it would suggest that the AWS SDK isn't installed - you could try npm install --save aws-sdk

@Prashant-Kan

This comment has been minimized.

Show comment
Hide comment
@Prashant-Kan

Prashant-Kan Aug 14, 2016

I was trying to follow your previous comments on 7th July.
and now also tried to install the aws-sdk. Facing the attached error.
Kindly check and reply if you have the solution. Meanwhile I will upload the code to codepen or fiddler for you to check.

npm_aws

Thanks in advance

Prashant-Kan commented Aug 14, 2016

I was trying to follow your previous comments on 7th July.
and now also tried to install the aws-sdk. Facing the attached error.
Kindly check and reply if you have the solution. Meanwhile I will upload the code to codepen or fiddler for you to check.

npm_aws

Thanks in advance

@Prashant-Kan

This comment has been minimized.

Show comment
Hide comment
@Prashant-Kan

Prashant-Kan Aug 14, 2016

@djabry
I have share the visual studio source for you.
I can't share via codepen or fiddle. So in the end I have share using gmail drive. Hope you reproduce the error and revert with some solution. I have send you the link in your email.

IGNORE the above comments
Ok. Wil share into github.

Prashant-Kan commented Aug 14, 2016

@djabry
I have share the visual studio source for you.
I can't share via codepen or fiddle. So in the end I have share using gmail drive. Hope you reproduce the error and revert with some solution. I have send you the link in your email.

IGNORE the above comments
Ok. Wil share into github.

@aldrinleal

This comment has been minimized.

Show comment
Hide comment
@aldrinleal

aldrinleal Aug 14, 2016

Member

@Prashant-Kan its better to have your code into gist (gist.github.com)

Member

aldrinleal commented Aug 14, 2016

@Prashant-Kan its better to have your code into gist (gist.github.com)

@Prashant-Kan

This comment has been minimized.

Show comment
Hide comment
@Prashant-Kan

Prashant-Kan Aug 14, 2016

Hi,
I have created one new repository [ https://github.com/Prashant-Kan/AwsDemo]. Kindly check and let me know if anything missing.

Prashant-Kan commented Aug 14, 2016

Hi,
I have created one new repository [ https://github.com/Prashant-Kan/AwsDemo]. Kindly check and let me know if anything missing.

@djabry

This comment has been minimized.

Show comment
Hide comment
@djabry

djabry Aug 15, 2016

@Prashant-Kan - It looks like you're using the definitely typed version of the AWS SDK Typescript bindings (rather than the one associated with ingenieux/aws-sdk-typescript): https://github.com/Prashant-Kan/AwsDemo/blob/master/awsdemo/Scripts/typings/aws-sdk/aws-sdk.d.ts

Also: I can't see any error messages in your screenshot so I'm not sure what could be causing your problems.

If the error you're getting is that AWS is not defined then the problem in your project is going to be with how you import the AWS SDK rather than with how you reference the Typescript bindings i.e. something to do with how you're using requirejs to load the AWS SDK.

One thing you could try is just adding <script src="https://sdk.amazonaws.com/js/aws-sdk-2.5.0.min.js"></script> to your index.html instead of using requirejs.

I'm afraid I can't help with the Visual studio configuration part of your project since I'm not familiar with it and don't have a Windows machine.

djabry commented Aug 15, 2016

@Prashant-Kan - It looks like you're using the definitely typed version of the AWS SDK Typescript bindings (rather than the one associated with ingenieux/aws-sdk-typescript): https://github.com/Prashant-Kan/AwsDemo/blob/master/awsdemo/Scripts/typings/aws-sdk/aws-sdk.d.ts

Also: I can't see any error messages in your screenshot so I'm not sure what could be causing your problems.

If the error you're getting is that AWS is not defined then the problem in your project is going to be with how you import the AWS SDK rather than with how you reference the Typescript bindings i.e. something to do with how you're using requirejs to load the AWS SDK.

One thing you could try is just adding <script src="https://sdk.amazonaws.com/js/aws-sdk-2.5.0.min.js"></script> to your index.html instead of using requirejs.

I'm afraid I can't help with the Visual studio configuration part of your project since I'm not familiar with it and don't have a Windows machine.

@aldrinleal

This comment has been minimized.

Show comment
Hide comment
@aldrinleal

aldrinleal Aug 15, 2016

Member

So basically its unrelated. Please note that:

a. You didn't open a new issue
b. You didn't do your homework and posted the issue on the wrong project
c. Its completely unrelated to how aws-sdk-typescript

So please review your manners, really.

(btw, I'm closing this)

Member

aldrinleal commented Aug 15, 2016

So basically its unrelated. Please note that:

a. You didn't open a new issue
b. You didn't do your homework and posted the issue on the wrong project
c. Its completely unrelated to how aws-sdk-typescript

So please review your manners, really.

(btw, I'm closing this)

@aldrinleal aldrinleal closed this Aug 15, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment