Skip to content
Merged
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
33 changes: 23 additions & 10 deletions apps/api/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AnalyticsMetric } from '../enums/analytics-metric.enum';
import { AnalyticsMetric } from './analytics-metric.enum';

export interface AnalyticsRecord {
id: string;
Expand Down
18 changes: 10 additions & 8 deletions apps/api/src/Analytics-Export/csv-builder.util.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Injectable } from '@nestjs/common';
import { CsvBuildOptions, CsvColumn } from '../interfaces/export-options.interface';
import { AnalyticsRecord } from '../interfaces/analytics-record.interface';
import { CsvBuildOptions, CsvColumn } from './export-options.interface';
import { AnalyticsRecord } from './analytics-record.interface';

@Injectable()
export class CsvBuilderUtil {
Expand All @@ -9,10 +9,7 @@ export class CsvBuilderUtil {
/**
* Build a complete CSV string from an array of records.
*/
build(
records: AnalyticsRecord[],
options: CsvBuildOptions,
): string {
build(records: AnalyticsRecord[], options: CsvBuildOptions): string {
const lines: string[] = [];

if (options.includeHeader) {
Expand Down Expand Up @@ -46,7 +43,9 @@ export class CsvBuilderUtil {
* Build the header row.
*/
buildHeader(columns: CsvColumn[], delimiter: string): string {
return columns.map((col) => this.escapeField(col.header, delimiter)).join(delimiter);
return columns
.map((col) => this.escapeField(col.header, delimiter))
.join(delimiter);
}

/**
Expand All @@ -57,7 +56,10 @@ export class CsvBuilderUtil {

return columns
.map((col) => {
const rawValue = this.getNestedValue(record, col.key);
const rawValue = this.getNestedValue(
record as unknown as Record<string, unknown>,
col.key,
);
let formatted: string;

if (rawValue === null || rawValue === undefined) {
Expand Down
2 changes: 1 addition & 1 deletion apps/api/src/Analytics-Export/export-options.interface.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AnalyticsMetric } from '../enums/analytics-metric.enum';
import { AnalyticsMetric } from './analytics-metric.enum';

export interface ExportOptions {
metrics: AnalyticsMetric[];
Expand Down
4 changes: 3 additions & 1 deletion apps/api/src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import { IntelligenceHubModule } from './intelligence-hub/stellar/intelligence-h
import { AssetDiscoveryModule } from './api/assets/discovery/stellar/asset-discovery.module';
import { RecommendationMetricsModule } from './metrics/recommendations/recommendation-metrics.module';
import { StellarEcosystemMetricsModule } from './metrics/ecosystem/stellar/stellar-ecosystem-metrics.module';
import { RouteInsightsExporterModule } from './exporters/routes/stellar/route-insights-exporter.module';

@Module({
imports: [
Expand Down Expand Up @@ -55,7 +56,7 @@ import { StellarEcosystemMetricsModule } from './metrics/ecosystem/stellar/stell
AnalyticsModule,
TokenMetadataModule,
VersionModule,
StellarReputationModule,
StellarReputationModule,
WalletModule,
SorobanContractModule,
StellarTimeoutModule,
Expand All @@ -73,6 +74,7 @@ import { StellarEcosystemMetricsModule } from './metrics/ecosystem/stellar/stell
// Explainability API for Stellar route recommendations
// Exposed through /explainability/stellar endpoints.
StellarExplainabilityModule,
RouteInsightsExporterModule,
],
controllers: [AppController],
providers: [
Expand Down
Loading
Loading