Files
firefox-accounts-mirror/libs/shared/experiments/src/lib/nimbus.config.ts
Reino Muhl da61ea678e feat(next): add experiments to payments-next
Because:

- Need to enable experiments in payments-next by adding support for
  nimbus.

This commit:

- Initializes the experiments shared library
- Updates subplat backend glean metrics with nimbus_user_id
- Adds Nimbus client

Closes #PAY-3248
2025-11-06 10:31:03 -05:00

30 lines
933 B
TypeScript

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
import { faker } from '@faker-js/faker';
import { Provider } from '@nestjs/common';
import { IsBoolean, IsNumber, IsUrl } from 'class-validator';
export class NimbusClientConfig {
@IsUrl({ require_tld: false })
public readonly apiUrl!: string;
@IsBoolean()
public readonly previewEnabled!: boolean;
@IsNumber()
public readonly timeoutMs!: number;
}
export const MockNimbusClientConfig = {
apiUrl: faker.internet.url(),
previewEnabled: faker.datatype.boolean(),
timeoutMs: faker.number.int({ min: 100, max: 2000 }),
} satisfies NimbusClientConfig;
export const MockNimbusClientConfigProvider = {
provide: NimbusClientConfig,
useValue: MockNimbusClientConfig,
} satisfies Provider<NimbusClientConfig>;