Skip to content

Commit

Permalink
Haff/documentation cleanup (#74)
Browse files Browse the repository at this point in the history
* missed a spot

* remove non web fields from platform

* bump

* fix tests + fixtures

* lint
  • Loading branch information
TheHaff authored Mar 4, 2024
1 parent b0ca1a4 commit eb8b820
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 24 deletions.
6 changes: 3 additions & 3 deletions packages/event-producer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Run `pnpm i` in the event-producer root folder.
## How to use

```typescript
import { init, dispatchEvent, bus } from '@tidal-music/event-producer';
import { init, sendEvent, bus } from '@tidal-music/event-producer';
import { credentialsProvider } from './credentialsProvider';


Expand Down Expand Up @@ -76,8 +76,8 @@ async function main() {
tlPublicConsumerUri: '/api/public/event-batch',
});

// Now we can dispatch events
dispatchEvent({
// Now we can send events
sendEvent({
consentCategory: 'PERFORMANCE',
name: 'listened_to_track',
payload: {
Expand Down
2 changes: 1 addition & 1 deletion packages/event-producer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tidal-music/event-producer",
"version": "1.2.0",
"version": "1.2.1",
"type": "module",
"files": [
"dist"
Expand Down
3 changes: 0 additions & 3 deletions packages/event-producer/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,5 @@ export type EPEvent = Omit<SentEvent, 'consentCategory' | 'payload'> & {
export type PlatformData = {
browserName: string;
browserVersion: string;
deviceVendor: string;
model: string;
osName: string;
version: string;
};
3 changes: 0 additions & 3 deletions packages/event-producer/src/utils/headerUtils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,7 @@ describe('headerUtils', () => {
'browser-version': config.platform.browserVersion,
'client-id': 'fakeClientId',
'consent-category': 'NECESSARY',
'device-model': config.platform.model,
'device-vendor': config.platform.deviceVendor,
'os-name': config.platform.osName,
'os-version': config.platform.version,
'requested-sent-timestamp': '2023',
someXtraHeader: 'eggs',
});
Expand Down
12 changes: 1 addition & 11 deletions packages/event-producer/src/utils/headerUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,7 @@ export const getEventHeaders = ({
authorize = true,
consentCategory,
credentials,
platformData: {
browserName,
browserVersion,
deviceVendor,
model,
osName,
version: osVersion,
},
platformData: { browserName, browserVersion, osName },
sentTimestamp,
suppliedHeaders,
}: {
Expand All @@ -37,10 +30,7 @@ export const getEventHeaders = ({
'browser-version': browserVersion,
'client-id': clientId,
'consent-category': consentCategory,
'device-model': model,
'device-vendor': deviceVendor,
'os-name': osName,
'os-version': osVersion,
'requested-sent-timestamp': sentTimestamp,
};

Expand Down
3 changes: 0 additions & 3 deletions packages/event-producer/test/fixtures/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ export const config: Config = {
platform: {
browserName: 'brave',
browserVersion: 'final.final.final',
deviceVendor: 'baconfari',
model: 'the XL',
osName: 'Bic Mac',
version: '666',
},
tlConsumerUri: '/api/event-batch',
tlPublicConsumerUri: '/api/public/event-batch',
Expand Down

0 comments on commit eb8b820

Please sign in to comment.