Skip to content

Instantly share code, notes, and snippets.

View lakshaygupta21's full-sized avatar
🎯
Focusing

Lakshay Gupta lakshaygupta21

🎯
Focusing
  • Bathinda, Punjab, India
View GitHub Profile
//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({
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 = [];
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;
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) {
<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'>
const mongoose = require("mongoose");
const fruitsSchema = new mongoose.Schema({
name: {
type: String
}
});
module.exports = fruits = mongoose.model("fruits", fruitsSchema)
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')
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": {
/**
* @swagger
* /api/fruits:
* get:
* tags:
* - Fruits
* description: Returns all fruits
* produces:
* - application/json
* responses:
const express = require("express");
const router = express.Router();
var Fruits = require('../../model/fruits.js')
/**
* @swagger
* /api/fruits:
* get:
* tags:
* - Fruits