-
Notifications
You must be signed in to change notification settings - Fork 7
/
platform.ts
94 lines (83 loc) · 2.38 KB
/
platform.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
import { MapArtistProfile, MapNFTsToTrackIds, MapTrack } from './mapping';
import { NFT } from './nft';
import catalogMappers from './platforms-types/catalog';
import chaosMappers from './platforms-types/chaos';
import hedsCollabMappers from './platforms-types/heds-collab';
import mintsongsV2Mappers from './platforms-types/mintsongs-v2';
import multiTrackMultiprintContractMappers from './platforms-types/multi-track-multiprint-contract';
import ninaMappers from './platforms-types/nina'
import noizdMappers from './platforms-types/noizd';
import singleTrackMultiprintContractMappers from './platforms-types/single-track-multiprint-contract';
import soundMappers from './platforms-types/sound';
export const API_PLATFORMS = ['noizd'];
export enum MusicPlatformType {
sound = 'sound',
noizd = 'noizd',
catalog = 'catalog',
zora = 'zora',
'single-track-multiprint-contract' = 'single-track-multiprint-contract',
'multi-track-multiprint-contract' = 'multi-track-multiprint-contract',
chaos = 'chaos',
mintsongsV2 = 'mintsongs-v2',
nina = 'nina',
hedsCollab = 'heds-collab',
kota = 'kota'
}
export type MusicPlatform = {
id: string,
type: MusicPlatformType
name: string
}
export type PlatformMapper = {
mapNFTsToTrackIds: MapNFTsToTrackIds
mapTrack: MapTrack
mapArtistProfile: MapArtistProfile
selectPrimaryNFTForTrackMapper?: (nfts: NFT[]) => NFT
}
export type MusicPlatformTypeConfig = {
mappers: PlatformMapper
initialTrackCursor?: string
skipApiTracks?: boolean
};
export type MusicPlatformTypeConfigs = {
[key in MusicPlatformType]?: MusicPlatformTypeConfig
}
export const platformClients = {
sound: 'sound',
catalog: 'catalog',
noizd: 'noizd',
}
export const platformConfigs: MusicPlatformTypeConfigs = {
sound: {
mappers: soundMappers,
},
catalog: {
mappers: catalogMappers,
},
noizd: {
mappers: noizdMappers,
initialTrackCursor: '2020-04-07T21:11:16.494Z'
},
'single-track-multiprint-contract': {
mappers: singleTrackMultiprintContractMappers,
},
'multi-track-multiprint-contract': {
mappers: multiTrackMultiprintContractMappers,
skipApiTracks: true
},
'chaos': {
mappers: chaosMappers,
},
'mintsongs-v2': {
mappers: mintsongsV2Mappers,
},
'nina': {
mappers: ninaMappers,
},
'heds-collab': {
mappers: hedsCollabMappers,
},
zora: {
mappers: singleTrackMultiprintContractMappers,
}
}