-
Notifications
You must be signed in to change notification settings - Fork 27
Fix the examples #205
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
Fix the examples #205
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,7 @@ | ||
| module.exports = { | ||
| rules: { | ||
| 'no-console': 0, | ||
| 'import/no-extraneous-dependencies': 0, | ||
| 'import/no-unresolved': 0, | ||
| }, | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,16 +3,18 @@ | |
| // | ||
| // env TRANSLOADIT_KEY=xxx TRANSLOADIT_SECRET=yyy node template_api.js | ||
| // | ||
| // You'll likely just want to `require('transloadit')`, but we're requiring the local | ||
| // variant here for easier testing: | ||
| const Transloadit = require('../src/Transloadit') | ||
| // You may need to build the project first using: | ||
| // | ||
| // yarn prepack | ||
| // | ||
| const { Transloadit } = require('transloadit') | ||
|
|
||
| const transloadit = new Transloadit({ | ||
| authKey: process.env.TRANSLOADIT_KEY, | ||
| authSecret: process.env.TRANSLOADIT_SECRET, | ||
| // authKey : process.env.API2_SYSTEMTEST_AUTH_KEY, | ||
| // authSecret: process.env.API2_SYSTEMTEST_SECRET_KEY, | ||
| // endpoint : 'https://api2-vbox.transloadit.com', | ||
| authKey: /** @type {string} */ (process.env.TRANSLOADIT_KEY), | ||
| authSecret: /** @type {string} */ (process.env.TRANSLOADIT_SECRET), | ||
| // authKey: /** @type {string} */ (process.env.API2_SYSTEMTEST_AUTH_KEY), | ||
| // authSecret: /** @type {string} */ (process.env.API2_SYSTEMTEST_SECRET_KEY), | ||
| // endpoint: /** @type {string} */ ('https://api2-vbox.transloadit.com'), | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The three values that are commented out are the result from internal from other repositories and don't serve a purpose for our users. Should we just remove them here?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I kept it as-is, but I agree this should probably be removed. |
||
| }) | ||
|
|
||
| const firstName = 'myProductionS3' | ||
|
|
@@ -51,9 +53,8 @@ const credentialParams = { | |
| } | ||
|
|
||
| console.log(`==> createTemplateCredential`) | ||
| const createTemplateCredentialResult = await transloadit.createTemplateCredential( | ||
| credentialParams | ||
| ) | ||
| const createTemplateCredentialResult = | ||
| await transloadit.createTemplateCredential(credentialParams) | ||
| console.log('TemplateCredential created successfully:', createTemplateCredentialResult) | ||
| // ^-- with Templates, there is `ok`, `message`, `id`, `content`, `name`, `require_signature_auth`. Same is true for: created, updated, fetched | ||
| // with Credentials, there is `ok`, `message`, `credentials` <-- and a single object nested directly under it, which is unexpected with that plural imho. Same is true for created, updated, fetched | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.