chore: Use imports as ES modules
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
import { knexSnakeCaseMappers } from 'objection';
|
||||
import appConfig from './src/config/app';
|
||||
import appConfig from './src/config/app.js';
|
||||
import path from 'path';
|
||||
import { fileURLToPath } from 'url';
|
||||
|
||||
const fileExtension = 'js';
|
||||
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||
|
||||
const knexConfig = {
|
||||
client: 'pg',
|
@@ -3,11 +3,12 @@
|
||||
"version": "0.10.0",
|
||||
"license": "See LICENSE file",
|
||||
"description": "The open source Zapier alternative. Build workflow automation without spending time and money.",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "ts-node-dev --watch 'src/graphql/schema.graphql' --exit-child src/server.ts",
|
||||
"worker": "nodemon --watch 'src/**/*.ts' --exec 'ts-node' src/worker.ts",
|
||||
"worker": "nodemon --watch 'src/**/*.js' --exec 'node' src/worker.js",
|
||||
"build": "tsc && yarn copy-statics",
|
||||
"build:watch": "nodemon --watch 'src/**/*.ts' --watch 'bin/**/*.ts' --exec yarn build --ext ts",
|
||||
"build:watch": "nodemon --watch 'src/**/*.js' --watch 'bin/**/*.ts' --exec yarn build --ext ts",
|
||||
"start": "node dist/src/server.js",
|
||||
"pretest": "APP_ENV=test ts-node ./test/setup/prepare-test-env.ts",
|
||||
"test": "APP_ENV=test jest --verbose",
|
||||
|
@@ -7,7 +7,8 @@ import actions from './actions';
|
||||
export default defineApp({
|
||||
name: 'Azure OpenAI',
|
||||
key: 'azure-openai',
|
||||
baseUrl: 'https://azure.microsoft.com/en-us/products/ai-services/openai-service',
|
||||
baseUrl:
|
||||
'https://azure.microsoft.com/en-us/products/ai-services/openai-service',
|
||||
apiBaseUrl: '',
|
||||
iconUrl: '{BASE_URL}/apps/azure-openai/assets/favicon.svg',
|
||||
authDocUrl: 'https://automatisch.io/docs/apps/azure-openai/connection',
|
||||
|
@@ -4,8 +4,8 @@ import process from 'process';
|
||||
import pg from 'pg';
|
||||
pg.types.setTypeParser(20, 'text', parseInt);
|
||||
import knex from 'knex';
|
||||
import knexConfig from '../../knexfile';
|
||||
import logger from '../helpers/logger';
|
||||
import knexConfig from '../../knexfile.js';
|
||||
import logger from '../helpers/logger.js';
|
||||
|
||||
export const client = knex(knexConfig);
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { Model } from 'objection';
|
||||
import { client } from './database';
|
||||
import { client } from './database.js';
|
||||
|
||||
Model.knex(client);
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import appConfig from './app';
|
||||
import appConfig from './app.js';
|
||||
|
||||
const redisConfig = {
|
||||
host: appConfig.redisHost,
|
||||
|
@@ -1,3 +1,3 @@
|
||||
import BaseError from './base';
|
||||
import BaseError from './base.js';
|
||||
|
||||
export default class AlreadyProcessedError extends BaseError { }
|
||||
export default class AlreadyProcessedError extends BaseError {}
|
||||
|
@@ -1,3 +1,3 @@
|
||||
import BaseError from './base';
|
||||
import BaseError from './base.js';
|
||||
|
||||
export default class EarlyExitError extends BaseError {}
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import BaseError from './base';
|
||||
import BaseError from './base.js';
|
||||
|
||||
export default class HttpError extends BaseError {
|
||||
constructor(error) {
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import cloneDeep from 'lodash/cloneDeep';
|
||||
import cloneDeep from 'lodash/cloneDeep.js';
|
||||
|
||||
const connectionIdArgument = {
|
||||
name: 'id',
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import appConfig from '../config/app';
|
||||
import appConfig from '../config/app.js';
|
||||
|
||||
const appInfoConverter = (rawAppData) => {
|
||||
rawAppData.iconUrl = rawAppData.iconUrl.replace(
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import appConfig from '../../config/app';
|
||||
import appConfig from '../../config/app.js';
|
||||
|
||||
const testPlans = [
|
||||
{
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import Redis from 'ioredis';
|
||||
import logger from './logger';
|
||||
import redisConfig from '../config/redis';
|
||||
import logger from './logger.js';
|
||||
import redisConfig from '../config/redis.js';
|
||||
|
||||
const redisClient = new Redis(redisConfig);
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import delayForAsMilliseconds from './delay-for-as-milliseconds';
|
||||
import delayUntilAsMilliseconds from './delay-until-as-milliseconds';
|
||||
import delayForAsMilliseconds from './delay-for-as-milliseconds.js';
|
||||
import delayUntilAsMilliseconds from './delay-until-as-milliseconds.js';
|
||||
|
||||
const delayAsMilliseconds = (eventKey, computedParameters) => {
|
||||
let delayDuration = 0;
|
||||
|
@@ -1,8 +1,12 @@
|
||||
import path from 'node:path';
|
||||
import fs from 'node:fs';
|
||||
import { omit, cloneDeep } from 'lodash';
|
||||
import addAuthenticationSteps from './add-authentication-steps';
|
||||
import addReconnectionSteps from './add-reconnection-steps';
|
||||
import omit from 'lodash/omit.js';
|
||||
import cloneDeep from 'lodash/cloneDeep.js';
|
||||
import addAuthenticationSteps from './add-authentication-steps.js';
|
||||
import addReconnectionSteps from './add-reconnection-steps.js';
|
||||
import { fileURLToPath } from 'url';
|
||||
|
||||
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||
|
||||
const apps = fs
|
||||
.readdirSync(path.resolve(__dirname, `../apps/`), { withFileTypes: true })
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import createHttpClient from './http-client';
|
||||
import EarlyExitError from '../errors/early-exit';
|
||||
import AlreadyProcessedError from '../errors/already-processed';
|
||||
import createHttpClient from './http-client/index.js';
|
||||
import EarlyExitError from '../errors/early-exit.js';
|
||||
import AlreadyProcessedError from '../errors/already-processed.js';
|
||||
|
||||
const globalVariable = async (options) => {
|
||||
const {
|
||||
|
@@ -1,8 +1,6 @@
|
||||
import { URL } from 'node:url';
|
||||
export { AxiosInstance as IHttpClient } from 'axios';
|
||||
|
||||
import HttpError from '../../errors/http';
|
||||
import axios from '../axios-with-proxy';
|
||||
import HttpError from '../../errors/http.js';
|
||||
import axios from '../axios-with-proxy.js';
|
||||
|
||||
const removeBaseUrlForAbsoluteUrls = (requestConfig) => {
|
||||
try {
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import memoryCache from 'memory-cache';
|
||||
import appConfig from '../config/app';
|
||||
import axios from './axios-with-proxy';
|
||||
import appConfig from '../config/app.js';
|
||||
import axios from './axios-with-proxy.js';
|
||||
|
||||
const CACHE_DURATION = 1000 * 60 * 60 * 24; // 24 hours in milliseconds
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import * as winston from 'winston';
|
||||
import appConfig from '../config/app';
|
||||
import appConfig from '../config/app.js';
|
||||
|
||||
const levels = {
|
||||
error: 0,
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import nodemailer from 'nodemailer';
|
||||
import appConfig from '../config/app';
|
||||
import appConfig from '../config/app.js';
|
||||
|
||||
const mailer = nodemailer.createTransport({
|
||||
host: appConfig.smtpHost,
|
||||
|
@@ -1,7 +1,7 @@
|
||||
import * as Sentry from '@sentry/node';
|
||||
import * as Tracing from '@sentry/tracing';
|
||||
|
||||
import appConfig from '../config/app';
|
||||
import appConfig from '../config/app.js';
|
||||
|
||||
const isSentryEnabled = !!appConfig.sentryDsn;
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
import Analytics from '@rudderstack/rudder-sdk-node';
|
||||
import organizationId from './organization-id';
|
||||
import instanceId from './instance-id';
|
||||
import appConfig from '../../config/app';
|
||||
import organizationId from './organization-id.js';
|
||||
import instanceId from './instance-id.js';
|
||||
import appConfig from '../../config/app.js';
|
||||
import os from 'os';
|
||||
|
||||
const WRITE_KEY = '284Py4VgK2MsNYV7xlKzyrALx0v';
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import CryptoJS from 'crypto-js';
|
||||
import appConfig from '../../config/app';
|
||||
import appConfig from '../../config/app.js';
|
||||
|
||||
const organizationId = () => {
|
||||
const key = appConfig.encryptionKey;
|
||||
|
@@ -1,7 +1,8 @@
|
||||
import { AES, enc } from 'crypto-js';
|
||||
import appConfig from '../config/app';
|
||||
import AppConfig from './app-config';
|
||||
import Base from './base';
|
||||
import AES from 'crypto-js/aes.js';
|
||||
import enc from 'crypto-js/enc-utf8.js';
|
||||
import appConfig from '../config/app.js';
|
||||
import AppConfig from './app-config.js';
|
||||
import Base from './base.js';
|
||||
|
||||
class AppAuthClient extends Base {
|
||||
static tableName = 'app_auth_clients';
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import App from './app';
|
||||
import Base from './base';
|
||||
import AppAuthClient from './app-auth-client';
|
||||
import App from './app.js';
|
||||
import Base from './base.js';
|
||||
import AppAuthClient from './app-auth-client.js';
|
||||
|
||||
class AppConfig extends Base {
|
||||
static tableName = 'app_configs';
|
||||
|
@@ -1,7 +1,10 @@
|
||||
import fs from 'fs';
|
||||
import { join } from 'path';
|
||||
import appInfoConverter from '../helpers/app-info-converter';
|
||||
import getApp from '../helpers/get-app';
|
||||
import path, { join } from 'path';
|
||||
import { fileURLToPath } from 'url';
|
||||
import appInfoConverter from '../helpers/app-info-converter.js';
|
||||
import getApp from '../helpers/get-app.js';
|
||||
|
||||
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||
|
||||
class App {
|
||||
static folderPath = join(__dirname, '../apps');
|
||||
|
@@ -1,7 +1,7 @@
|
||||
import { AjvValidator, Model, snakeCaseMappers } from 'objection';
|
||||
import addFormats from 'ajv-formats';
|
||||
|
||||
import ExtendedQueryBuilder from './query-builder';
|
||||
import ExtendedQueryBuilder from './query-builder.js';
|
||||
|
||||
class Base extends Model {
|
||||
static QueryBuilder = ExtendedQueryBuilder;
|
||||
|
@@ -1,13 +1,14 @@
|
||||
import { AES, enc } from 'crypto-js';
|
||||
import App from './app';
|
||||
import AppConfig from './app-config';
|
||||
import AppAuthClient from './app-auth-client';
|
||||
import Base from './base';
|
||||
import User from './user';
|
||||
import Step from './step';
|
||||
import appConfig from '../config/app';
|
||||
import Telemetry from '../helpers/telemetry';
|
||||
import globalVariable from '../helpers/global-variable';
|
||||
import AES from 'crypto-js/aes.js';
|
||||
import enc from 'crypto-js/enc-utf8.js';
|
||||
import App from './app.js';
|
||||
import AppConfig from './app-config.js';
|
||||
import AppAuthClient from './app-auth-client.js';
|
||||
import Base from './base.js';
|
||||
import User from './user.js';
|
||||
import Step from './step.js';
|
||||
import appConfig from '../config/app.js';
|
||||
import Telemetry from '../helpers/telemetry/index.js';
|
||||
import globalVariable from '../helpers/global-variable.js';
|
||||
|
||||
class Connection extends Base {
|
||||
static tableName = 'connections';
|
||||
|
@@ -1,8 +1,8 @@
|
||||
import appConfig from '../config/app';
|
||||
import Base from './base';
|
||||
import Execution from './execution';
|
||||
import Step from './step';
|
||||
import Telemetry from '../helpers/telemetry';
|
||||
import appConfig from '../config/app.js';
|
||||
import Base from './base.js';
|
||||
import Execution from './execution.js';
|
||||
import Step from './step.js';
|
||||
import Telemetry from '../helpers/telemetry/index.js';
|
||||
|
||||
class ExecutionStep extends Base {
|
||||
static tableName = 'execution_steps';
|
||||
|
@@ -1,7 +1,7 @@
|
||||
import Base from './base';
|
||||
import Flow from './flow';
|
||||
import ExecutionStep from './execution-step';
|
||||
import Telemetry from '../helpers/telemetry';
|
||||
import Base from './base.js';
|
||||
import Flow from './flow.js';
|
||||
import ExecutionStep from './execution-step.js';
|
||||
import Telemetry from '../helpers/telemetry/index.js';
|
||||
|
||||
class Execution extends Base {
|
||||
static tableName = 'executions';
|
||||
|
@@ -1,9 +1,9 @@
|
||||
import { ValidationError } from 'objection';
|
||||
import Base from './base';
|
||||
import Step from './step';
|
||||
import User from './user';
|
||||
import Execution from './execution';
|
||||
import Telemetry from '../helpers/telemetry';
|
||||
import Base from './base.js';
|
||||
import Step from './step.js';
|
||||
import User from './user.js';
|
||||
import Execution from './execution.js';
|
||||
import Telemetry from '../helpers/telemetry/index.js';
|
||||
|
||||
class Flow extends Base {
|
||||
static tableName = 'flows';
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import Base from './base';
|
||||
import SamlAuthProvider from './saml-auth-provider.ee';
|
||||
import User from './user';
|
||||
import Base from './base.js';
|
||||
import SamlAuthProvider from './saml-auth-provider.ee.js';
|
||||
import User from './user.js';
|
||||
|
||||
class Identity extends Base {
|
||||
static tableName = 'identities';
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import Base from './base';
|
||||
import Base from './base.js';
|
||||
|
||||
class Permission extends Base {
|
||||
static tableName = 'permissions';
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import Base from './base';
|
||||
import Permission from './permission';
|
||||
import User from './user';
|
||||
import Base from './base.js';
|
||||
import Permission from './permission.js';
|
||||
import User from './user.js';
|
||||
|
||||
class Role extends Base {
|
||||
static tableName = 'roles';
|
||||
|
@@ -1,8 +1,8 @@
|
||||
import { URL } from 'node:url';
|
||||
import appConfig from '../config/app';
|
||||
import Base from './base';
|
||||
import Identity from './identity.ee';
|
||||
import SamlAuthProvidersRoleMapping from './saml-auth-providers-role-mapping.ee';
|
||||
import appConfig from '../config/app.js';
|
||||
import Base from './base.js';
|
||||
import Identity from './identity.ee.js';
|
||||
import SamlAuthProvidersRoleMapping from './saml-auth-providers-role-mapping.ee.js';
|
||||
|
||||
class SamlAuthProvider extends Base {
|
||||
static tableName = 'saml_auth_providers';
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import Base from './base';
|
||||
import SamlAuthProvider from './saml-auth-provider.ee';
|
||||
import Base from './base.js';
|
||||
import SamlAuthProvider from './saml-auth-provider.ee.js';
|
||||
|
||||
class SamlAuthProvidersRoleMapping extends Base {
|
||||
static tableName = 'saml_auth_providers_role_mappings';
|
||||
|
@@ -1,12 +1,12 @@
|
||||
import { URL } from 'node:url';
|
||||
import get from 'lodash.get';
|
||||
import Base from './base';
|
||||
import App from './app';
|
||||
import Flow from './flow';
|
||||
import Connection from './connection';
|
||||
import ExecutionStep from './execution-step';
|
||||
import Telemetry from '../helpers/telemetry';
|
||||
import appConfig from '../config/app';
|
||||
import Base from './base.js';
|
||||
import App from './app.js';
|
||||
import Flow from './flow.js';
|
||||
import Connection from './connection.js';
|
||||
import ExecutionStep from './execution-step.js';
|
||||
import Telemetry from '../helpers/telemetry/index.js';
|
||||
import appConfig from '../config/app.js';
|
||||
|
||||
class Step extends Base {
|
||||
static tableName = 'steps';
|
||||
|
@@ -1,8 +1,8 @@
|
||||
import Base from './base';
|
||||
import User from './user';
|
||||
import UsageData from './usage-data.ee';
|
||||
import Base from './base.js';
|
||||
import User from './user.js';
|
||||
import UsageData from './usage-data.ee.js';
|
||||
import { DateTime } from 'luxon';
|
||||
import { getPlanById } from '../helpers/billing/plans.ee';
|
||||
import { getPlanById } from '../helpers/billing/plans.ee.js';
|
||||
|
||||
class Subscription extends Base {
|
||||
static tableName = 'subscriptions';
|
||||
|
@@ -1,7 +1,7 @@
|
||||
import { raw } from 'objection';
|
||||
import Base from './base';
|
||||
import User from './user';
|
||||
import Subscription from './subscription.ee';
|
||||
import Base from './base.js';
|
||||
import User from './user.js';
|
||||
import Subscription from './subscription.ee.js';
|
||||
|
||||
class UsageData extends Base {
|
||||
static tableName = 'usage_data';
|
||||
|
@@ -2,19 +2,19 @@ import bcrypt from 'bcrypt';
|
||||
import { DateTime } from 'luxon';
|
||||
import crypto from 'node:crypto';
|
||||
|
||||
import appConfig from '../config/app';
|
||||
import { hasValidLicense } from '../helpers/license.ee';
|
||||
import userAbility from '../helpers/user-ability';
|
||||
import Base from './base';
|
||||
import Connection from './connection';
|
||||
import Execution from './execution';
|
||||
import Flow from './flow';
|
||||
import Identity from './identity.ee';
|
||||
import Permission from './permission';
|
||||
import Role from './role';
|
||||
import Step from './step';
|
||||
import Subscription from './subscription.ee';
|
||||
import UsageData from './usage-data.ee';
|
||||
import appConfig from '../config/app.js';
|
||||
import { hasValidLicense } from '../helpers/license.ee.js';
|
||||
import userAbility from '../helpers/user-ability.js';
|
||||
import Base from './base.js';
|
||||
import Connection from './connection.js';
|
||||
import Execution from './execution.js';
|
||||
import Flow from './flow.js';
|
||||
import Identity from './identity.ee.js';
|
||||
import Permission from './permission.js';
|
||||
import Role from './role.js';
|
||||
import Step from './step.js';
|
||||
import Subscription from './subscription.ee.js';
|
||||
import UsageData from './usage-data.ee.js';
|
||||
|
||||
class User extends Base {
|
||||
static tableName = 'users';
|
||||
|
@@ -1,7 +1,7 @@
|
||||
import process from 'process';
|
||||
import { Queue } from 'bullmq';
|
||||
import redisConfig from '../config/redis';
|
||||
import logger from '../helpers/logger';
|
||||
import redisConfig from '../config/redis.js';
|
||||
import logger from '../helpers/logger.js';
|
||||
|
||||
const CONNECTION_REFUSED = 'ECONNREFUSED';
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
import process from 'process';
|
||||
import { Queue } from 'bullmq';
|
||||
import redisConfig from '../config/redis';
|
||||
import logger from '../helpers/logger';
|
||||
import redisConfig from '../config/redis.js';
|
||||
import logger from '../helpers/logger.js';
|
||||
|
||||
const CONNECTION_REFUSED = 'ECONNREFUSED';
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
import process from 'process';
|
||||
import { Queue } from 'bullmq';
|
||||
import redisConfig from '../config/redis';
|
||||
import logger from '../helpers/logger';
|
||||
import redisConfig from '../config/redis.js';
|
||||
import logger from '../helpers/logger.js';
|
||||
|
||||
const CONNECTION_REFUSED = 'ECONNREFUSED';
|
||||
|
||||
|
@@ -1,13 +1,13 @@
|
||||
import Step from '../models/step';
|
||||
import Flow from '../models/flow';
|
||||
import Execution from '../models/execution';
|
||||
import ExecutionStep from '../models/execution-step';
|
||||
import computeParameters from '../helpers/compute-parameters';
|
||||
import globalVariable from '../helpers/global-variable';
|
||||
import { logger } from '../helpers/logger';
|
||||
import HttpError from '../errors/http';
|
||||
import EarlyExitError from '../errors/early-exit';
|
||||
import AlreadyProcessedError from '../errors/already-processed';
|
||||
import Step from '../models/step.js';
|
||||
import Flow from '../models/flow.js';
|
||||
import Execution from '../models/execution.js';
|
||||
import ExecutionStep from '../models/execution-step.js';
|
||||
import computeParameters from '../helpers/compute-parameters.js';
|
||||
import globalVariable from '../helpers/global-variable.js';
|
||||
import { logger } from '../helpers/logger.js';
|
||||
import HttpError from '../errors/http.js';
|
||||
import EarlyExitError from '../errors/early-exit.js';
|
||||
import AlreadyProcessedError from '../errors/already-processed.js';
|
||||
|
||||
export const processAction = async (options) => {
|
||||
const { flowId, stepId, executionId } = options;
|
||||
|
@@ -1,9 +1,9 @@
|
||||
import Flow from '../models/flow';
|
||||
import globalVariable from '../helpers/global-variable';
|
||||
import EarlyExitError from '../errors/early-exit';
|
||||
import AlreadyProcessedError from '../errors/already-processed';
|
||||
import HttpError from '../errors/http';
|
||||
import { logger } from '../helpers/logger';
|
||||
import Flow from '../models/flow.js';
|
||||
import globalVariable from '../helpers/global-variable.js';
|
||||
import EarlyExitError from '../errors/early-exit.js';
|
||||
import AlreadyProcessedError from '../errors/already-processed.js';
|
||||
import HttpError from '../errors/http.js';
|
||||
import { logger } from '../helpers/logger.js';
|
||||
|
||||
export const processFlow = async (options) => {
|
||||
const { testRun, flowId } = options;
|
||||
|
@@ -1,7 +1,7 @@
|
||||
import Step from '../models/step';
|
||||
import Flow from '../models/flow';
|
||||
import Execution from '../models/execution';
|
||||
import globalVariable from '../helpers/global-variable';
|
||||
import Step from '../models/step.js';
|
||||
import Flow from '../models/flow.js';
|
||||
import Execution from '../models/execution.js';
|
||||
import globalVariable from '../helpers/global-variable.js';
|
||||
|
||||
export const processTrigger = async (options) => {
|
||||
const { flowId, stepId, triggerItem, error, testRun } = options;
|
||||
|
@@ -1,21 +1,21 @@
|
||||
import * as Sentry from './helpers/sentry.ee';
|
||||
import appConfig from './config/app';
|
||||
import * as Sentry from './helpers/sentry.ee.js';
|
||||
import appConfig from './config/app.js';
|
||||
|
||||
Sentry.init();
|
||||
|
||||
import './config/orm';
|
||||
import './helpers/check-worker-readiness';
|
||||
import './workers/flow';
|
||||
import './workers/trigger';
|
||||
import './workers/action';
|
||||
import './workers/email';
|
||||
import './workers/delete-user.ee';
|
||||
import './config/orm.js';
|
||||
import './helpers/check-worker-readiness.js';
|
||||
import './workers/flow.js';
|
||||
import './workers/trigger.js';
|
||||
import './workers/action.js';
|
||||
import './workers/email.js';
|
||||
import './workers/delete-user.ee.js';
|
||||
|
||||
if (appConfig.isCloud) {
|
||||
import('./workers/remove-cancelled-subscriptions.ee');
|
||||
import('./queues/remove-cancelled-subscriptions.ee');
|
||||
import('./workers/remove-cancelled-subscriptions.ee.js');
|
||||
import('./queues/remove-cancelled-subscriptions.ee.js');
|
||||
}
|
||||
|
||||
import telemetry from './helpers/telemetry';
|
||||
import telemetry from './helpers/telemetry/index.js';
|
||||
|
||||
telemetry.setServiceType('worker');
|
||||
|
@@ -1,17 +1,17 @@
|
||||
import { Worker } from 'bullmq';
|
||||
import process from 'node:process';
|
||||
|
||||
import * as Sentry from '../helpers/sentry.ee';
|
||||
import redisConfig from '../config/redis';
|
||||
import logger from '../helpers/logger';
|
||||
import Step from '../models/step';
|
||||
import actionQueue from '../queues/action';
|
||||
import { processAction } from '../services/action';
|
||||
import * as Sentry from '../helpers/sentry.ee.js';
|
||||
import redisConfig from '../config/redis.js';
|
||||
import logger from '../helpers/logger.js';
|
||||
import Step from '../models/step.js';
|
||||
import actionQueue from '../queues/action.js';
|
||||
import { processAction } from '../services/action.js';
|
||||
import {
|
||||
REMOVE_AFTER_30_DAYS_OR_150_JOBS,
|
||||
REMOVE_AFTER_7_DAYS_OR_50_JOBS,
|
||||
} from '../helpers/remove-job-configuration';
|
||||
import delayAsMilliseconds from '../helpers/delay-as-milliseconds';
|
||||
} from '../helpers/remove-job-configuration.js';
|
||||
import delayAsMilliseconds from '../helpers/delay-as-milliseconds.js';
|
||||
|
||||
const DEFAULT_DELAY_DURATION = 0;
|
||||
|
||||
|
@@ -1,12 +1,12 @@
|
||||
import { Worker } from 'bullmq';
|
||||
import process from 'node:process';
|
||||
|
||||
import * as Sentry from '../helpers/sentry.ee';
|
||||
import redisConfig from '../config/redis';
|
||||
import logger from '../helpers/logger';
|
||||
import appConfig from '../config/app';
|
||||
import User from '../models/user';
|
||||
import ExecutionStep from '../models/execution-step';
|
||||
import * as Sentry from '../helpers/sentry.ee.js';
|
||||
import redisConfig from '../config/redis.js';
|
||||
import logger from '../helpers/logger.js';
|
||||
import appConfig from '../config/app.js';
|
||||
import User from '../models/user.js';
|
||||
import ExecutionStep from '../models/execution-step.js';
|
||||
|
||||
export const worker = new Worker(
|
||||
'delete-user',
|
||||
|
@@ -1,12 +1,12 @@
|
||||
import { Worker } from 'bullmq';
|
||||
import process from 'node:process';
|
||||
|
||||
import * as Sentry from '../helpers/sentry.ee';
|
||||
import redisConfig from '../config/redis';
|
||||
import logger from '../helpers/logger';
|
||||
import mailer from '../helpers/mailer.ee';
|
||||
import compileEmail from '../helpers/compile-email.ee';
|
||||
import appConfig from '../config/app';
|
||||
import * as Sentry from '../helpers/sentry.ee.js';
|
||||
import redisConfig from '../config/redis.js';
|
||||
import logger from '../helpers/logger.js';
|
||||
import mailer from '../helpers/mailer.ee.js';
|
||||
import compileEmail from '../helpers/compile-email.ee.js';
|
||||
import appConfig from '../config/app.js';
|
||||
|
||||
const isCloudSandbox = () => {
|
||||
return appConfig.isCloud && !appConfig.isProd;
|
||||
|
@@ -1,17 +1,17 @@
|
||||
import { Worker } from 'bullmq';
|
||||
import process from 'node:process';
|
||||
|
||||
import * as Sentry from '../helpers/sentry.ee';
|
||||
import redisConfig from '../config/redis';
|
||||
import logger from '../helpers/logger';
|
||||
import flowQueue from '../queues/flow';
|
||||
import triggerQueue from '../queues/trigger';
|
||||
import { processFlow } from '../services/flow';
|
||||
import Flow from '../models/flow';
|
||||
import * as Sentry from '../helpers/sentry.ee.js';
|
||||
import redisConfig from '../config/redis.js';
|
||||
import logger from '../helpers/logger.js';
|
||||
import flowQueue from '../queues/flow.js';
|
||||
import triggerQueue from '../queues/trigger.js';
|
||||
import { processFlow } from '../services/flow.js';
|
||||
import Flow from '../models/flow.js';
|
||||
import {
|
||||
REMOVE_AFTER_30_DAYS_OR_150_JOBS,
|
||||
REMOVE_AFTER_7_DAYS_OR_50_JOBS,
|
||||
} from '../helpers/remove-job-configuration';
|
||||
} from '../helpers/remove-job-configuration.js';
|
||||
|
||||
export const worker = new Worker(
|
||||
'flow',
|
||||
|
@@ -1,16 +1,16 @@
|
||||
import { Worker } from 'bullmq';
|
||||
import process from 'node:process';
|
||||
|
||||
import * as Sentry from '../helpers/sentry.ee';
|
||||
import redisConfig from '../config/redis';
|
||||
import logger from '../helpers/logger';
|
||||
import actionQueue from '../queues/action';
|
||||
import Step from '../models/step';
|
||||
import { processTrigger } from '../services/trigger';
|
||||
import * as Sentry from '../helpers/sentry.ee.js';
|
||||
import redisConfig from '../config/redis.js';
|
||||
import logger from '../helpers/logger.js';
|
||||
import actionQueue from '../queues/action.js';
|
||||
import Step from '../models/step.js';
|
||||
import { processTrigger } from '../services/trigger.js';
|
||||
import {
|
||||
REMOVE_AFTER_30_DAYS_OR_150_JOBS,
|
||||
REMOVE_AFTER_7_DAYS_OR_50_JOBS,
|
||||
} from '../helpers/remove-job-configuration';
|
||||
} from '../helpers/remove-job-configuration.js';
|
||||
|
||||
export const worker = new Worker(
|
||||
'trigger',
|
||||
|
Reference in New Issue
Block a user