diff --git a/server/storage.ts b/server/storage.ts index 61a76f7..1f88189 100644 --- a/server/storage.ts +++ b/server/storage.ts @@ -121,60 +121,68 @@ export interface IStorage { export class MemStorage implements IStorage { private usersMap: Map; - private orgsMap: Map; + private customersMap: Map; + private customerUserMap: Map; private domainsMap: Map; + private domainCredentialsMap: Map; private recordsMap: Map; private providersMap: Map; private apiTokensMap: Map; + private apiTokenCustomerAccessMap: Map; private historyMap: Map; private webhooksMap: Map; private webhookDeliveryLogsMap: Map; private metricsMap: Map; private customRolesMap: Map; - // Group maps have been removed // Counters for IDs private userIdCounter: number; - private orgIdCounter: number; + private customerIdCounter: number; + private customerUserIdCounter: number; private domainIdCounter: number; + private domainCredentialsIdCounter: number; private recordIdCounter: number; private providerIdCounter: number; private apiTokenIdCounter: number; + private apiTokenCustomerAccessIdCounter: number; private historyIdCounter: number; private webhookIdCounter: number; private webhookDeliveryLogIdCounter: number; private metricIdCounter: number; private customRoleIdCounter: number; - // Group counters have been removed public sessionStore: any; constructor() { this.usersMap = new Map(); - this.orgsMap = new Map(); + this.customersMap = new Map(); + this.customerUserMap = new Map(); this.domainsMap = new Map(); + this.domainCredentialsMap = new Map(); this.recordsMap = new Map(); this.providersMap = new Map(); this.apiTokensMap = new Map(); + this.apiTokenCustomerAccessMap = new Map(); this.historyMap = new Map(); this.webhooksMap = new Map(); this.webhookDeliveryLogsMap = new Map(); this.metricsMap = new Map(); this.customRolesMap = new Map(); - // Group maps initialization has been removed this.userIdCounter = 1; - this.orgIdCounter = 1; + this.customerIdCounter = 1; + this.customerUserIdCounter = 1; this.domainIdCounter = 1; + this.domainCredentialsIdCounter = 1; this.recordIdCounter = 1; this.providerIdCounter = 1; this.apiTokenIdCounter = 1; + this.apiTokenCustomerAccessIdCounter = 1; this.historyIdCounter = 1; this.webhookIdCounter = 1; this.webhookDeliveryLogIdCounter = 1; this.metricIdCounter = 1; this.customRoleIdCounter = 1; - // Group counter initialization has been removed // Session store is created in the DatabaseStorage class this.sessionStore = null; @@ -661,9 +669,9 @@ export class MemStorage implements IStorage { return this.webhooksMap.get(parseInt(id)); } - async getWebhooksByOrganization(organizationId: string): Promise { + async getWebhooksByCustomer(customerId: string): Promise { return Array.from(this.webhooksMap.values()) - .filter(webhook => webhook.organizationId === organizationId); + .filter(webhook => webhook.customerId === customerId); } async createWebhook(webhook: InsertWebhook): Promise { @@ -673,7 +681,7 @@ export class MemStorage implements IStorage { id: numId.toString(), name: webhook.name, url: webhook.url, - organizationId: webhook.organizationId, + customerId: webhook.customerId, secret: webhook.secret ?? null, events: webhook.events, isActive: webhook.isActive ?? true,