Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ jobs:

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 11

- name: Setup Node
uses: actions/setup-node@v4
Expand Down Expand Up @@ -113,8 +111,6 @@ jobs:

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 11

- name: Setup Node
uses: actions/setup-node@v4
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
"author": "",
"private": true,
"license": "UNLICENSED",
"packageManager": "pnpm@9.1.0",
"prNote": "Added packageManager field per issue #1209",
"scripts": {
"license:scan": "node scripts/scan-licenses.js",
"build": "nest build",
Expand Down
5 changes: 5 additions & 0 deletions src/ab-testing/entities/experiment-metric.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
UpdateDateColumn,
ManyToOne,
VersionColumn,
Index,
} from 'typeorm';
import { Experiment } from './experiment.entity';
export enum MetricType {
Expand All @@ -20,6 +21,10 @@ export enum MetricType {
* Represents the experiment Metric entity.
*/
@Entity({ name: 'experiment_metrics' })
@Index('IDX_experiment_metrics_experiment_id', ['experiment'])
@Index('IDX_experiment_metrics_type', ['type'])
@Index('IDX_experiment_metrics_created_at', ['createdAt'])
@Index('IDX_experiment_metrics_experiment_is_primary', ['experiment', 'isPrimary'])
export class ExperimentMetric {
@PrimaryGeneratedColumn('uuid')
id: string;
Expand Down
2 changes: 2 additions & 0 deletions src/ab-testing/entities/variant-metric.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ import {
UpdateDateColumn,
ManyToOne,
VersionColumn,
Index,
} from 'typeorm';
import { IExperimentVariant } from './experiment-variant.entity';

/**
* Represents the variant Metric entity.
*/
@Index('IDX_variant_metrics_variant_createdAt', ['variant', 'createdAt'])
@Entity({ name: 'variant_metrics' })
export class VariantMetric {
@PrimaryGeneratedColumn('uuid')
Expand Down
1 change: 0 additions & 1 deletion src/achievements/achievements.seed.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { AchievementType, AchievementDifficulty } from './entities/achievement.entity';
import { Logger } from '@nestjs/common';

/**
* Seed data for default achievements
Expand Down
1 change: 0 additions & 1 deletion src/auth/auth.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import { RegisterDto } from './dto/register.dto';
import { RefreshTokenDto } from './dto/refresh-token.dto';
import { InjectRepository } from '@nestjs/typeorm';
import { User } from '../users/entities/user.entity';
import { Tenant } from '../tenancy/entities/tenant.entity';
import { Repository } from 'typeorm';
import * as bcrypt from 'bcrypt';
import { JwtAuthGuard } from './guards/jwt-auth.guard';
Expand Down
2 changes: 1 addition & 1 deletion src/email-marketing/automation/automation.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { TriggerType } from '../enums/trigger-type.enum';
import { ActionType } from '../enums/action-type.enum';
import { WorkflowStatus } from '../enums/workflow-status.enum';

function validateWebhookUrl(urlStr: string): void {
function _validateWebhookUrl(urlStr: string): void {
if (!urlStr) return;
let parsedUrl: URL;
try {
Expand Down
2 changes: 1 addition & 1 deletion src/migrations/1599999999999-BaselineSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2310,7 +2310,7 @@ export class BaselineSchema1599999999999 implements MigrationInterface {
`);
}

public async down(queryRunner: QueryRunner): Promise<void> {
public async down(_queryRunner: QueryRunner): Promise<void> {
// Dropping the entire baseline schema is handled by `migration:revert`
// in reverse order; the tables are dropped as their corresponding
// migrations are reverted.
Expand Down
34 changes: 34 additions & 0 deletions src/migrations/1801000000000-add-experiment-metric-indexes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { MigrationInterface, QueryRunner, TableIndex } from 'typeorm';

export class AddExperimentMetricIndexes1801000000000 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.createIndices('experiment_metrics', [
new TableIndex({
name: 'IDX_experiment_metrics_experiment_id',
columnNames: ['experimentId'],
}),
new TableIndex({
name: 'IDX_experiment_metrics_type',
columnNames: ['type'],
}),
new TableIndex({
name: 'IDX_experiment_metrics_created_at',
columnNames: ['createdAt'],
}),
new TableIndex({
name: 'IDX_experiment_metrics_experiment_is_primary',
columnNames: ['experimentId', 'isPrimary'],
}),
]);
}

public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.dropIndex(
'experiment_metrics',
'IDX_experiment_metrics_experiment_is_primary',
);
await queryRunner.dropIndex('experiment_metrics', 'IDX_experiment_metrics_created_at');
await queryRunner.dropIndex('experiment_metrics', 'IDX_experiment_metrics_type');
await queryRunner.dropIndex('experiment_metrics', 'IDX_experiment_metrics_experiment_id');
}
}
16 changes: 16 additions & 0 deletions src/migrations/1802000000000-add-variant-metric-indexes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { MigrationInterface, QueryRunner, TableIndex } from 'typeorm';

export class AddVariantMetricIndexes1802000000000 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.createIndices('variant_metrics', [
new TableIndex({
name: 'IDX_variant_metrics_variant_createdAt',
columnNames: ['variantId', 'createdAt'],
}),
]);
}

public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.dropIndex('variant_metrics', 'IDX_variant_metrics_variant_createdAt');
}
}
4 changes: 2 additions & 2 deletions src/payments/providers/payment-provider.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export class PaymentProviderService {
userId: string,
amount: number,
currency: string,
metadata: Record<string, unknown> = {},
_metadata: Record<string, unknown> = {},
): Promise<ChargeResult> {
// TODO: replace with real Stripe call:
// const intent = await stripe.paymentIntents.create({ amount: Math.round(amount * 100), currency, ... });
Expand All @@ -58,7 +58,7 @@ export class PaymentProviderService {
userId: string,
amount: number,
currency: string,
metadata: Record<string, unknown> = {},
_metadata: Record<string, unknown> = {},
): Promise<CreditResult> {
// TODO: replace with real Stripe call:
// const credit = await stripe.customers.createBalanceTransaction(customerId, { amount: -Math.round(amount * 100), currency });
Expand Down
Loading