This file contains hidden or 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 fetch = require('node-fetch') | |
const Moysklad = require('moysklad').compose(require('moysklad-extension-queue')) | |
const ms = Moysklad({ | |
fetch, | |
login: process.env.MOYSKLAD_LOGIN, | |
password: process.env.MOYSKLAD_PASSWORD, | |
queue: true |
This file contains hidden or 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
{ | |
"resource": "/{proxy+}", | |
"path": "/path", | |
"httpMethod": "GET", | |
"headers": { | |
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", | |
"Accept-Encoding": "gzip, deflate, br", | |
"Accept-Language": "ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7", | |
"CloudFront-Forwarded-Proto": "https", | |
"CloudFront-Is-Desktop-Viewer": "true", |
This file contains hidden or 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 path from "node:path"; | |
import _H from "highland"; | |
import { stringify } from "csv-stringify"; | |
import { createWriteStream } from "node:fs"; | |
import { writeFile } from "node:fs/promises"; | |
/** | |
* @param {string} targetFolderPath | |
* @param {string} fileName | |
* @param {Record<string, unknown>[]} records |
This file contains hidden or 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
# https://cloud.google.com/sdk/docs/quickstart-debian-ubuntu | |
# Create environment variable for correct distribution | |
export CLOUD_SDK_REPO="cloud-sdk-$(lsb_release -c -s)" | |
# Add the Cloud SDK distribution URI as a package source | |
echo "deb http://packages.cloud.google.com/apt $CLOUD_SDK_REPO main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list | |
# Import the Google Cloud Platform public key | |
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add - |
This file contains hidden or 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
function buildQueryString (params) { | |
return Object.keys(params) | |
.map(k => encodeURIComponent(k) + '=' + encodeURIComponent(params[k])) | |
.join('&') | |
} |
This file contains hidden or 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 path = require('path') | |
const express = require('express') | |
const favicon = require('serve-favicon') | |
const bodyParser = require('body-parser') | |
const publicPath = p => | |
path.resolve(__dirname, path.join('../../public', p)) |