Update import paths across various modules to include the '.js' extension for consistency and improved clarity. This change enhances maintainability and aligns with the updated module structure throughout the application.
This commit is contained in:
parent
12299b5b44
commit
5eebd11668
@ -1,6 +1,7 @@
|
||||
{
|
||||
"name": "@customer-portal/bff",
|
||||
"version": "1.0.0",
|
||||
"type": "module",
|
||||
"description": "Backend for Frontend API",
|
||||
"author": "",
|
||||
"private": true,
|
||||
|
||||
@ -31,8 +31,9 @@
|
||||
},
|
||||
"ts-node": {
|
||||
"transpileOnly": true,
|
||||
"esm": true,
|
||||
"compilerOptions": {
|
||||
"module": "CommonJS"
|
||||
"module": "Node16"
|
||||
}
|
||||
},
|
||||
"include": ["src/**/*", "scripts/**/*", "src/types/**/*"],
|
||||
|
||||
@ -12,8 +12,8 @@
|
||||
|
||||
import { z } from "zod";
|
||||
|
||||
import { emailSchema, nameSchema, passwordSchema, phoneSchema } from "../common/schema";
|
||||
import { addressSchema, userSchema } from "../customer/schema";
|
||||
import { emailSchema, nameSchema, passwordSchema, phoneSchema } from "../common/schema.js";
|
||||
import { addressSchema, userSchema } from "../customer/schema.js";
|
||||
|
||||
// ============================================================================
|
||||
// Authentication Request Schemas
|
||||
|
||||
@ -4,8 +4,8 @@
|
||||
* Transforms raw WHMCS invoice data into normalized billing domain types.
|
||||
*/
|
||||
|
||||
import type { Invoice, InvoiceItem } from "../../contract";
|
||||
import { invoiceSchema } from "../../schema";
|
||||
import type { Invoice, InvoiceItem } from "../../contract.js";
|
||||
import { invoiceSchema } from "../../schema.js";
|
||||
import {
|
||||
type WhmcsInvoiceRaw,
|
||||
whmcsInvoiceRawSchema,
|
||||
|
||||
@ -13,7 +13,7 @@ import type {
|
||||
SimCatalogProduct,
|
||||
SimActivationFeeCatalogItem,
|
||||
VpnCatalogProduct,
|
||||
} from "../../contract";
|
||||
} from "../../contract.js";
|
||||
import type {
|
||||
SalesforceProduct2WithPricebookEntries,
|
||||
SalesforcePricebookEntryRecord,
|
||||
|
||||
@ -4,9 +4,9 @@
|
||||
* Maps Prisma user data to UserAuth domain type using schema validation
|
||||
*/
|
||||
|
||||
import { userAuthSchema } from "../../schema";
|
||||
import { userAuthSchema } from "../../schema.js";
|
||||
import type { PrismaUserRaw } from "./types.js";
|
||||
import type { UserAuth } from "../../schema";
|
||||
import type { UserAuth } from "../../schema.js";
|
||||
|
||||
/**
|
||||
* Maps raw Prisma user data to UserAuth domain type
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
* Domain doesn't depend on @prisma/client directly.
|
||||
*/
|
||||
|
||||
import type { UserRole } from "../../schema";
|
||||
import type { UserRole } from "../../schema.js";
|
||||
|
||||
/**
|
||||
* Raw Prisma user data from portal database
|
||||
|
||||
@ -7,8 +7,8 @@
|
||||
|
||||
import { z } from "zod";
|
||||
|
||||
import type { WhmcsClient, Address } from "../../schema";
|
||||
import { whmcsClientSchema, addressSchema } from "../../schema";
|
||||
import type { WhmcsClient, Address } from "../../schema.js";
|
||||
import { whmcsClientSchema, addressSchema } from "../../schema.js";
|
||||
import {
|
||||
whmcsClientSchema as whmcsRawClientSchema,
|
||||
whmcsClientResponseSchema,
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
|
||||
import { z } from "zod";
|
||||
|
||||
import { countryCodeSchema } from "../common/schema";
|
||||
import { countryCodeSchema } from "../common/schema.js";
|
||||
|
||||
// ============================================================================
|
||||
// Helper Schemas
|
||||
|
||||
@ -4,8 +4,8 @@
|
||||
* Shared types for dashboard summaries, activity feeds, and related data.
|
||||
*/
|
||||
|
||||
import type { IsoDateTimeString } from "../common/types";
|
||||
import type { Invoice } from "../billing/contract";
|
||||
import type { IsoDateTimeString } from "../common/types.js";
|
||||
import type { Invoice } from "../billing/contract.js";
|
||||
|
||||
export type ActivityType =
|
||||
| "invoice_created"
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
* Normalized types for mapping portal users to external systems.
|
||||
*/
|
||||
|
||||
import type { IsoDateTimeString } from "../common/types";
|
||||
import type { IsoDateTimeString } from "../common/types.js";
|
||||
|
||||
export interface UserIdMapping {
|
||||
id: string;
|
||||
|
||||
@ -5,9 +5,9 @@
|
||||
* Validated types are derived from schemas (see schema.ts).
|
||||
*/
|
||||
|
||||
import type { SalesforceProductFieldMap } from "../catalog/contract";
|
||||
import type { SalesforceAccountFieldMap } from "../customer";
|
||||
import type { UserIdMapping } from "../mappings/contract";
|
||||
import type { SalesforceProductFieldMap } from "../catalog/contract.js";
|
||||
import type { SalesforceAccountFieldMap } from "../customer/index.js";
|
||||
import type { UserIdMapping } from "../mappings/contract.js";
|
||||
|
||||
// ============================================================================
|
||||
// Order Type Constants
|
||||
|
||||
@ -9,8 +9,8 @@ import type {
|
||||
OrderItemDetails,
|
||||
OrderItemSummary,
|
||||
OrderSummary,
|
||||
} from "../../contract";
|
||||
import { orderDetailsSchema, orderSummarySchema, orderItemDetailsSchema } from "../../schema";
|
||||
} from "../../contract.js";
|
||||
import { orderDetailsSchema, orderSummarySchema, orderItemDetailsSchema } from "../../schema.js";
|
||||
import type {
|
||||
SalesforceOrderItemRecord,
|
||||
SalesforceOrderRecord,
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
* Transforms normalized order data to WHMCS API format.
|
||||
*/
|
||||
|
||||
import type { OrderDetails, OrderItemDetails } from "../../contract";
|
||||
import type { OrderDetails, OrderItemDetails } from "../../contract.js";
|
||||
import {
|
||||
type WhmcsOrderItem,
|
||||
type WhmcsAddOrderParams,
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
{
|
||||
"name": "@customer-portal/domain",
|
||||
"version": "1.0.0",
|
||||
"type": "module",
|
||||
"description": "Unified domain layer with contracts, schemas, and provider mappers",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
|
||||
@ -2,8 +2,8 @@
|
||||
* WHMCS Payments Provider - Mapper
|
||||
*/
|
||||
|
||||
import type { PaymentMethod, PaymentGateway } from "../../contract";
|
||||
import { paymentMethodSchema, paymentGatewaySchema } from "../../schema";
|
||||
import type { PaymentMethod, PaymentGateway } from "../../contract.js";
|
||||
import { paymentMethodSchema, paymentGatewaySchema } from "../../schema.js";
|
||||
import {
|
||||
type WhmcsPaymentMethodRaw,
|
||||
type WhmcsPaymentGatewayRaw,
|
||||
|
||||
@ -2,8 +2,8 @@
|
||||
* Freebit SIM Provider - Mapper
|
||||
*/
|
||||
|
||||
import type { SimDetails, SimUsage, SimTopUpHistory, SimType, SimStatus } from "../../contract";
|
||||
import { simDetailsSchema, simUsageSchema, simTopUpHistorySchema } from "../../schema";
|
||||
import type { SimDetails, SimUsage, SimTopUpHistory, SimType, SimStatus } from "../../contract.js";
|
||||
import { simDetailsSchema, simUsageSchema, simTopUpHistorySchema } from "../../schema.js";
|
||||
import {
|
||||
type FreebitAccountDetailsRaw,
|
||||
type FreebitTrafficInfoRaw,
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
* These functions contain no infrastructure dependencies.
|
||||
*/
|
||||
|
||||
import type { Subscription } from "../subscriptions/schema";
|
||||
import type { Subscription } from "../subscriptions/schema.js";
|
||||
|
||||
/**
|
||||
* Check if a subscription is a SIM service
|
||||
|
||||
@ -4,8 +4,8 @@
|
||||
* Transforms raw WHMCS product/service data into normalized subscription types.
|
||||
*/
|
||||
|
||||
import type { Subscription, SubscriptionStatus, SubscriptionCycle } from "../../contract";
|
||||
import { subscriptionSchema } from "../../schema";
|
||||
import type { Subscription, SubscriptionStatus, SubscriptionCycle } from "../../contract.js";
|
||||
import { subscriptionSchema } from "../../schema.js";
|
||||
import {
|
||||
type WhmcsProductRaw,
|
||||
whmcsProductRawSchema,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user