Deprecate legacy core datasource token (#14096)

This commit is contained in:
Weiko
2025-08-27 20:09:54 +02:00
committed by GitHub
parent c6aa419c18
commit 533d7fe49a
321 changed files with 702 additions and 849 deletions
@@ -43,21 +43,18 @@ import { PermissionsModule } from 'src/engine/metadata-modules/permissions/permi
MessageQueueModule,
PermissionsModule,
AiModule,
TypeOrmModule.forFeature(
[
BillingSubscription,
BillingSubscriptionItem,
BillingCustomer,
BillingProduct,
BillingPrice,
BillingMeter,
BillingEntitlement,
Workspace,
UserWorkspace,
FeatureFlag,
],
'core',
),
TypeOrmModule.forFeature([
BillingSubscription,
BillingSubscriptionItem,
BillingCustomer,
BillingProduct,
BillingPrice,
BillingMeter,
BillingEntitlement,
Workspace,
UserWorkspace,
FeatureFlag,
]),
],
providers: [
BillingSubscriptionService,
@@ -25,12 +25,12 @@ import { TwentyORMGlobalManager } from 'src/engine/twenty-orm/twenty-orm-global.
})
export class BillingAddWorkflowSubscriptionItemCommand extends ActiveOrSuspendedWorkspacesMigrationCommandRunner {
constructor(
@InjectRepository(Workspace, 'core')
@InjectRepository(Workspace)
protected readonly workspaceRepository: Repository<Workspace>,
protected readonly twentyORMGlobalManager: TwentyORMGlobalManager,
@InjectRepository(BillingSubscription, 'core')
@InjectRepository(BillingSubscription)
protected readonly billingSubscriptionRepository: Repository<BillingSubscription>,
@InjectRepository(BillingProduct, 'core')
@InjectRepository(BillingProduct)
protected readonly billingProductRepository: Repository<BillingProduct>,
private readonly stripeSubscriptionItemService: StripeSubscriptionItemService,
private readonly stripeSubscriptionService: StripeSubscriptionService,
@@ -21,10 +21,10 @@ import { TwentyORMGlobalManager } from 'src/engine/twenty-orm/twenty-orm-global.
})
export class BillingSyncCustomerDataCommand extends ActiveOrSuspendedWorkspacesMigrationCommandRunner {
constructor(
@InjectRepository(Workspace, 'core')
@InjectRepository(Workspace)
protected readonly workspaceRepository: Repository<Workspace>,
private readonly stripeSubscriptionService: StripeSubscriptionService,
@InjectRepository(BillingCustomer, 'core')
@InjectRepository(BillingCustomer)
protected readonly billingCustomerRepository: Repository<BillingCustomer>,
protected readonly twentyORMGlobalManager: TwentyORMGlobalManager,
) {
@@ -29,11 +29,11 @@ import { transformStripeProductToDatabaseProduct } from 'src/engine/core-modules
export class BillingSyncPlansDataCommand extends MigrationCommandRunner {
private readonly batchSize = 5;
constructor(
@InjectRepository(BillingPrice, 'core')
@InjectRepository(BillingPrice)
private readonly billingPriceRepository: Repository<BillingPrice>,
@InjectRepository(BillingProduct, 'core')
@InjectRepository(BillingProduct)
private readonly billingProductRepository: Repository<BillingProduct>,
@InjectRepository(BillingMeter, 'core')
@InjectRepository(BillingMeter)
private readonly billingMeterRepository: Repository<BillingMeter>,
private readonly stripeBillingMeterService: StripeBillingMeterService,
private readonly stripeProductService: StripeProductService,
@@ -30,10 +30,10 @@ export class BillingUpdateSubscriptionPriceCommand extends ActiveOrSuspendedWork
private clearUsage = false;
constructor(
@InjectRepository(Workspace, 'core')
@InjectRepository(Workspace)
protected readonly workspaceRepository: Repository<Workspace>,
protected readonly twentyORMGlobalManager: TwentyORMGlobalManager,
@InjectRepository(BillingSubscription, 'core')
@InjectRepository(BillingSubscription)
protected readonly billingSubscriptionRepository: Repository<BillingSubscription>,
private readonly billingSubscriptionService: BillingSubscriptionService,
private readonly stripeSubscriptionItemService: StripeSubscriptionItemService,
@@ -21,7 +21,7 @@ import { type BillingGetPricesPerPlanResult } from 'src/engine/core-modules/bill
export class BillingPlanService {
protected readonly logger = new Logger(BillingPlanService.name);
constructor(
@InjectRepository(BillingProduct, 'core')
@InjectRepository(BillingProduct)
private readonly billingProductRepository: Repository<BillingProduct>,
) {}
@@ -36,13 +36,13 @@ export class BillingPortalWorkspaceService {
private readonly stripeBillingPortalService: StripeBillingPortalService,
private readonly domainManagerService: DomainManagerService,
private readonly billingSubscriptionService: BillingSubscriptionService,
@InjectRepository(BillingSubscription, 'core')
@InjectRepository(BillingSubscription)
private readonly billingSubscriptionRepository: Repository<BillingSubscription>,
@InjectRepository(BillingSubscriptionItem, 'core')
@InjectRepository(BillingSubscriptionItem)
private readonly billingSubscriptionItemRepository: Repository<BillingSubscriptionItem>,
@InjectRepository(BillingCustomer, 'core')
@InjectRepository(BillingCustomer)
private readonly billingCustomerRepository: Repository<BillingCustomer>,
@InjectRepository(UserWorkspace, 'core')
@InjectRepository(UserWorkspace)
private readonly userWorkspaceRepository: Repository<UserWorkspace>,
) {}
@@ -16,7 +16,7 @@ import { TwentyConfigService } from 'src/engine/core-modules/twenty-config/twent
@Injectable()
export class BillingSubscriptionItemService {
constructor(
@InjectRepository(BillingSubscriptionItem, 'core')
@InjectRepository(BillingSubscriptionItem)
private readonly billingSubscriptionItemRepository: Repository<BillingSubscriptionItem>,
private readonly twentyConfigService: TwentyConfigService,
) {}
@@ -41,14 +41,14 @@ export class BillingSubscriptionService {
private readonly stripeSubscriptionService: StripeSubscriptionService,
private readonly billingPlanService: BillingPlanService,
private readonly billingProductService: BillingProductService,
@InjectRepository(BillingEntitlement, 'core')
@InjectRepository(BillingEntitlement)
private readonly billingEntitlementRepository: Repository<BillingEntitlement>,
@InjectRepository(BillingSubscription, 'core')
@InjectRepository(BillingSubscription)
private readonly billingSubscriptionRepository: Repository<BillingSubscription>,
private readonly stripeCustomerService: StripeCustomerService,
private readonly twentyConfigService: TwentyConfigService,
private readonly stripeSubscriptionItemService: StripeSubscriptionItemService,
@InjectRepository(BillingSubscriptionItem, 'core')
@InjectRepository(BillingSubscriptionItem)
private readonly billingSubscriptionItemRepository: Repository<BillingSubscriptionItem>,
) {}
@@ -24,7 +24,7 @@ import { type Workspace } from 'src/engine/core-modules/workspace/workspace.enti
export class BillingUsageService {
protected readonly logger = new Logger(BillingUsageService.name);
constructor(
@InjectRepository(BillingCustomer, 'core')
@InjectRepository(BillingCustomer)
private readonly billingCustomerRepository: Repository<BillingCustomer>,
private readonly billingSubscriptionService: BillingSubscriptionService,
private readonly stripeBillingMeterEventService: StripeBillingMeterEventService,
@@ -22,7 +22,7 @@ export class BillingService {
private readonly twentyConfigService: TwentyConfigService,
private readonly billingSubscriptionService: BillingSubscriptionService,
private readonly billingProductService: BillingProductService,
@InjectRepository(BillingSubscription, 'core')
@InjectRepository(BillingSubscription)
private readonly billingSubscriptionRepository: Repository<BillingSubscription>,
) {}
@@ -19,7 +19,7 @@ export class StripeCustomerService {
constructor(
private readonly twentyConfigService: TwentyConfigService,
private readonly stripeSDKService: StripeSDKService,
@InjectRepository(BillingCustomer, 'core')
@InjectRepository(BillingCustomer)
private readonly billingCustomerRepository: Repository<BillingCustomer>,
) {
if (!this.twentyConfigService.get('IS_BILLING_ENABLED')) {
@@ -21,7 +21,7 @@ import { DomainManagerModule } from 'src/engine/core-modules/domain-manager/doma
imports: [
DomainManagerModule,
StripeSDKModule,
TypeOrmModule.forFeature([BillingCustomer], 'core'),
TypeOrmModule.forFeature([BillingCustomer]),
],
providers: [
StripeSubscriptionItemService,