This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { HTTP } from 'meteor/http' | |
let google = require('googleapis'); | |
const serviceId = '[email protected]'; | |
const keyFileName = 'xxx_service_account.json'; | |
const scopeUrl = 'https://www.googleapis.com/auth/spreadsheets'; | |
const jwtClient = new google.auth.JWT( | |
serviceId, Assets.absoluteFilePath( keyFileName ), null, [ scopeUrl ] | |
); | |
jwtClient.authorize( Meteor.bindEnvironment( ( err, tokens ) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const https = require('https'); | |
const FileAPI = require('file-api'); | |
const File = FileAPI.File; | |
let fs = require('fs'); | |
let async = require('async'); | |
let aws = require('aws-sdk'); | |
let s3 = new aws.S3( { apiVersion: '2006-03-01' } ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
openssl key pair generate | |
//client - using meteor.js | |
const nodersa = Npm.require('node-rsa'); | |
import { HTTP } from 'meteor/http'; | |
const syncPost = Meteor.wrapAsync( HTTP.post, HTTP ); | |
encryptStringWithRsaPublicKey( data ) { | |
const absolutePath = Assets.absoluteFilePath( "public.key" ); //public key file path | |
const publicKey = fs.readFileSync( absolutePath, "utf8" ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Meteor.methods({ | |
sendMail( from, to, userName, attachments ) { | |
check( from, String ); | |
check( to, String ); | |
check( userName, String ); | |
check( attachments, Array ); | |
this.unblock(); | |
const files = attachments.map( _ => { return { filename : 'filename', path : 'remote file url' }; } ); //example |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const ErrorMixins = { | |
bye() { | |
console.log('bye'); | |
} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { connect } from 'react-redux'; | |
import { Header } from './Header.jsx'; | |
import { Footer } from './Footer.jsx'; | |
class AppComponent extends React.Component { | |
constructor( props ) { | |
super( props ); |