[AUDIT] Run knip over twenty-server (#21159)
# Introduction Run [knip](https://knip.dev/) over twenty-server Used config: ```json { "$schema": "https://unpkg.com/knip@5/schema.json", "workspaces": { "packages/twenty-server": { "entry": [ "src/main.ts", "src/command/command.ts", "src/queue-worker/queue-worker.ts", "src/database/scripts/setup-db.ts", "src/database/scripts/truncate-db.ts", "src/database/clickHouse/migrations/run-migrations.ts", "src/database/clickHouse/seeds/run-seeds.ts", "src/instrument.ts", "lingui.config.ts", "test/integration/graphql/codegen/index.ts", "test/integration/utils/setup-test.ts", "test/integration/utils/teardown-test.ts", "scripts/**/*.ts", "**/*.spec.ts", "**/*.integration-spec.ts" ], "project": ["src/**/*.ts", "test/**/*.ts", "scripts/**/*.ts"], "ignore": [ "src/database/typeorm/**/migrations/**", "src/database/typeorm/**/*.entity.ts", "**/*.workspace-entity.ts", "**/logic-function-resource/constants/seed-project/**" ], "ignoreDependencies": ["@types/psl", "@types/aws-lambda"], "ignoreBinaries": ["nest", "lingui", "typeorm"] } } } ```
This commit is contained in:
-2
@@ -1,2 +0,0 @@
|
||||
export const BILLING_WORKFLOW_EXECUTION_ERROR_MESSAGE =
|
||||
'No remaining credits to execute workflow. Please check your subscription.';
|
||||
@@ -1,20 +0,0 @@
|
||||
/* @license Enterprise */
|
||||
|
||||
import { Field, ObjectType } from '@nestjs/graphql';
|
||||
|
||||
import { SubscriptionInterval } from 'src/engine/core-modules/billing/enums/billing-subscription-interval.enum';
|
||||
|
||||
@ObjectType('BillingPrice')
|
||||
export class BillingPriceDTO {
|
||||
@Field(() => Number)
|
||||
upTo: number;
|
||||
|
||||
@Field(() => Number)
|
||||
amount: number;
|
||||
|
||||
@Field(() => String)
|
||||
stripePriceId: string;
|
||||
|
||||
@Field(() => SubscriptionInterval)
|
||||
recurringInterval: SubscriptionInterval;
|
||||
}
|
||||
-15
@@ -1,15 +0,0 @@
|
||||
/* @license Enterprise */
|
||||
|
||||
import { ArgsType, Field } from '@nestjs/graphql';
|
||||
|
||||
import { IsNotEmpty, IsString } from 'class-validator';
|
||||
|
||||
import { AvailableProduct } from 'src/engine/core-modules/billing/enums/billing-available-product.enum';
|
||||
|
||||
@ArgsType()
|
||||
export class BillingProductInput {
|
||||
@Field(() => String)
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
product: AvailableProduct;
|
||||
}
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
/* @license Enterprise */
|
||||
|
||||
export enum AvailableProduct {
|
||||
BasePlan = 'base-plan',
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
import { SubscriptionInterval } from 'src/engine/core-modules/billing/enums/billing-subscription-interval.enum';
|
||||
import {
|
||||
BillingException,
|
||||
BillingExceptionCode,
|
||||
} from 'src/engine/core-modules/billing/billing.exception';
|
||||
|
||||
export const getOppositeInterval = (interval: SubscriptionInterval) => {
|
||||
if (interval === SubscriptionInterval.Month) return SubscriptionInterval.Year;
|
||||
if (interval === SubscriptionInterval.Year) return SubscriptionInterval.Month;
|
||||
throw new BillingException(
|
||||
`Interval invalid`,
|
||||
BillingExceptionCode.BILLING_SUBSCRIPTION_INTERVAL_INVALID,
|
||||
);
|
||||
};
|
||||
@@ -1,14 +0,0 @@
|
||||
import {
|
||||
BillingException,
|
||||
BillingExceptionCode,
|
||||
} from 'src/engine/core-modules/billing/billing.exception';
|
||||
import { BillingPlanKey } from 'src/engine/core-modules/billing/enums/billing-plan-key.enum';
|
||||
|
||||
export const getOppositePlan = (plan: BillingPlanKey) => {
|
||||
if (plan === BillingPlanKey.PRO) return BillingPlanKey.ENTERPRISE;
|
||||
if (plan === BillingPlanKey.ENTERPRISE) return BillingPlanKey.PRO;
|
||||
throw new BillingException(
|
||||
`Plan invalid`,
|
||||
BillingExceptionCode.BILLING_PLAN_NOT_FOUND,
|
||||
);
|
||||
};
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
export const isSubscriptionIncompleteOnboardingStatus = (
|
||||
hasAnySubscription: boolean,
|
||||
) => {
|
||||
return !hasAnySubscription;
|
||||
};
|
||||
Reference in New Issue
Block a user