feat: modules and resources domains, drop removed domains, regenerated models

This commit is contained in:
edmand46
2026-09-17 12:08:03 +03:00
parent f45261439f
commit 6f37b00fb4
71 changed files with 516 additions and 4184 deletions
+28 -29
View File
@@ -14,20 +14,17 @@ describe('public API surface', () => {
});
it('keeps helpers, domain classes, and service constructors out of the barrel', () => {
// Device id helper — internal.
expect('getOrCreateDeviceId' in sdk).toBe(false);
// Domain classes — exported as types only.
for (const name of [
'PlayerDomain',
'CatalogDomain',
'InventoryDomain',
'ConfigDomain',
'StorageDomain',
'StoresDomain',
'ProjectStorageDomain',
'ModulesDomain',
'ResourcesDomain',
]) {
expect(name in sdk).toBe(false);
}
// Service constructors — exported as types only.
for (const name of [
'AuthService',
'LeaderboardsService',
@@ -48,43 +45,45 @@ describe('public API surface', () => {
'RudderHttpError',
'RudderAuthError',
'SDK_ERROR_INVALID_OPTIONS',
'RudderErrorCodes',
'createDefaultTokenStore',
'createLocalStorageTokenStore',
'SyncedState',
'RemoteConfigState',
'ShopHandle',
'OfferHandle',
]) {
expect(name in sdk, name).toBe(true);
}
expect('RemoteConfigState' in sdk).toBe(false);
expect('ShopHandle' in sdk).toBe(false);
expect('OfferHandle' in sdk).toBe(false);
expect('QuestMetrics' in sdk).toBe(false);
});
it('exposes effects without a public scenarios service on the client', () => {
it('exposes kernel members and no module-specific namespaces on the client', () => {
const client = new RudderClient({
baseUrl: 'https://api.test.rudder.build',
projectKey: 'test-project',
runtime: { loginEvent: null },
});
expect(client.auth).toBeDefined();
expect(client.player).toBeDefined();
expect(client.catalog).toBeDefined();
expect(client.storage).toBeDefined();
expect(client.projectStorage).toBeDefined();
expect(client.modules).toBeDefined();
expect(typeof client.modules.call).toBe('function');
expect(typeof client.resources).toBe('function');
expect(client.effects).toBeDefined();
expect('battlePass' in client).toBe(false);
expect('quests' in client).toBe(false);
expect('leaderboards' in client).toBe(false);
expect('stores' in client).toBe(false);
expect('inventory' in client).toBe(false);
expect('remoteConfig' in client).toBe(false);
expect('scenarios' in client).toBe(false);
});
it('uses the canonical glossary property names on the client', () => {
const client = new RudderClient({
baseUrl: 'https://api.test.rudder.build',
projectKey: 'test-project',
runtime: { loginEvent: null },
});
expect(client.remoteConfig).toBeDefined();
expect('config' in client).toBe(false);
expect(client.battlePass).toBeDefined();
expect('battlepass' in client).toBe(false);
expect(typeof client.effects.onBattlePass).toBe('function');
expect(typeof client.effects.onBattlePassLevel).toBe('function');
expect('onBattlepass' in client.effects).toBe(false);
expect('onBattlepassLevel' in client.effects).toBe(false);
expect('onBattlePass' in client.effects).toBe(false);
expect('onStoreOffer' in client.effects).toBe(false);
expect('onQuest' in client.effects).toBe(false);
expect('onLeaderboard' in client.effects).toBe(false);
expect('onConfigChanged' in client.effects).toBe(false);
});
});