- TS application listening port: 7777
|-- dist
|-- src
|-- .dockerignore
|-- Dockerfile
function createStore(target, listener) { | |
const handler = { | |
set(target, prop, value, receiver) { | |
target[prop] = value; | |
listener(receiver); | |
return true; | |
}, | |
get(target, prop) { | |
return target[prop]; | |
}, |
const getCircularReplacer = () => { | |
const seen = new WeakSet(); | |
return (_key: any, value: object) => { | |
if (typeof value === "object" && value !== null) { | |
if (seen.has(value)) { | |
return; | |
} | |
seen.add(value); | |
} | |
return value; |
import { createWorkflow, WorkflowEvent } from "@deepkit/workflow"; | |
import { eventDispatcher, EventDispatcher } from "@deepkit/event"; | |
import { ConsoleTransport, Logger } from "@deepkit/logger"; | |
import { InjectorContext, InjectorModule } from "@deepkit/injector"; | |
import { BrokerDirectClient, BrokerKernel } from "@deepkit/broker"; | |
class EndEvent extends WorkflowEvent { | |
completed: boolean = true; | |
} |
const toParameterObject = (search) => | |
JSON.parse( | |
'{"' + search.replace(/&/g, '","').replace(/=/g, '":"') + '"}', | |
(key, value) => (key === "" ? value : decodeURIComponent(value)) | |
); |
const groupByKey = (list, key) => list.reduce((hash, obj) => ({...hash, [obj[key]]:( hash[obj[key]] || [] ).concat(obj)}), {}) |
const { Queue, QueueEvents } = require('bullmq'); | |
const { EventEmitter } = require('events'); | |
const config = require('../config'); | |
const createUid = require('uid'); | |
class QueueArena extends EventEmitter { | |
constructor({ redisDb = 1 }) { | |
super(); | |
this.redisDb = redisDb; |
Array.from(Array(10).keys()) |
import client from "../client"; | |
import CA from "../CA"; | |
export const handle = async function() { | |
try { | |
const response = await CA.get( | |
"Orders?$expand=Items($select=Sku,Quantity),CustomFields&exported=false&$filter=Fulfillments/Any (c: c/DistributionCenterID eq 2) and ShippingStatus eq 'Unshipped' and CreatedDateUtc ge 2020-01-12" | |
); | |
const promises = response.data.value |
import client from "../client"; | |
import CA from "../CA"; | |
export const handle = async function() { | |
try { | |
const response = await CA.get( | |
"Orders?$expand=Items($select=Sku,Quantity),CustomFields&exported=false&$filter=Fulfillments/Any (c: c/DistributionCenterID eq 2) and ShippingStatus eq 'Unshipped' and CreatedDateUtc ge 2020-01-12" | |
); | |
const promises = response.data.value |