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 MwsApi from 'amazon-mws'; | |
const log = require('simple-node-logger').createSimpleLogger('project.log'); | |
const MwsApi = require('amazon-mws') | |
const amazonMws = new MwsApi(); | |
const requestReport = async(accessKey, accessSecret, version, reportType, sellerId, mwsAuthToken, startDate, endDate) => { | |
amazonMws.setApiKey(accessKey, accessSecret); | |
amazonMws.setHost('mws.amazonservices.in'); | |
try { | |
const response = await amazonMws.reports.submit({ |
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
const log = require('simple-node-logger').createSimpleLogger('project.log'); | |
//Reports | |
const inventoryReports = ['_GET_MERCHANT_LISTINGS_ALL_DATA_', ]; | |
const orderReports = ['_GET_FLAT_FILE_ORDERS_DATA_']; | |
const performanceReports = ['_GET_V1_SELLER_PERFORMANCE_REPORT_']; | |
const amazonPayReports = ['_GET_FLAT_FILE_OFFAMAZONPAYMENTS_SANDBOX_SETTLEMENT_DATA_']; | |
const settlementReports = ['_GET_V2_SETTLEMENT_REPORT_DATA_XML_']; | |
//helper reports array | |
var helper = []; |
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
var Report = require('./reports/Reports.js') | |
var HelperReport = require('./reports/HelperReport.js') | |
const log = require('simple-node-logger').createSimpleLogger('project.log'); | |
var UserId = 'xyz' | |
const VERSION = '2009-01-01'; | |
var AWS_ACCESS_KEY_ID = 'arg1' | |
var AWS_SECRET_ACCESS_KEY = 'arg2' | |
var SellerId = 'arg3' | |
var MWSAuthToken = 'arg4' | |
var startDate; |
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
var express = require('express') | |
var app = express(); | |
var App = require('./app.js') | |
var bodyParser = require('body-parser') | |
app.use(bodyParser.urlencoded({ | |
extended: true | |
})) | |
app.get('/', function (req, res) { |
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
<html> | |
<head> | |
<title>Reports</title> | |
<!-- jQuery --> | |
https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js | |
<!-- Bootstrap --> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> | |
https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js | |
<!-- Datepicker --> | |
<link href='bootstrap-datepicker/dist/css/bootstrap-datepicker.min.css' rel='stylesheet' type='text/css'> |
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
const mongoose = require("mongoose"); | |
const fruitsSchema = new mongoose.Schema({ | |
name: { | |
type: String | |
} | |
}); | |
module.exports = fruits = mongoose.model("fruits", fruitsSchema) |
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
require('./config/config') | |
const express = require('express') | |
const mongoose = require('mongoose'); | |
mongoose.set('useFindAndModify', false); | |
const app = express() | |
const bodyParser = require('body-parser') | |
const swaggerJsonDoc = require('swagger-jsdoc') | |
const swaggerUI = require('swagger-ui-express') |
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
const swaggerOptions = { | |
swaggerDefinition: { | |
info: { | |
title: "Documenting REST API's", | |
description: "This is an implementation of how to document your RESTful API's using SWAGGER", | |
servers: ['http://localhost:3000'] | |
}, | |
"components": { | |
"schemas": { | |
"fruits": { |
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
/** | |
* @swagger | |
* /api/fruits: | |
* get: | |
* tags: | |
* - Fruits | |
* description: Returns all fruits | |
* produces: | |
* - application/json | |
* responses: |
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
const express = require("express"); | |
const router = express.Router(); | |
var Fruits = require('../../model/fruits.js') | |
/** | |
* @swagger | |
* /api/fruits: | |
* get: | |
* tags: | |
* - Fruits |
OlderNewer