-
Notifications
You must be signed in to change notification settings - Fork 59
/
Copy pathinterfaces.ts
49 lines (41 loc) · 1.03 KB
/
interfaces.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
import {MultipartPayload, MultipartValue} from '../../helpers/upload'
export interface Dsym {
bundlePath: string
slices: ArchSlice[]
}
export interface ArchSlice {
arch: string
objectPath: string
uuid: string
}
export class CompressedDsym {
public archivePath: string
public dsym: Dsym
constructor(archivePath: string, dsym: Dsym) {
this.archivePath = archivePath
this.dsym = dsym
}
public asMultipartPayload(): MultipartPayload {
const content = new Map([
['symbols_archive', {type: 'file', path: this.archivePath, options: {filename: 'ios_symbols_archive'}}],
['event', this.getMetadataPayload()],
])
return {
content,
}
}
private getMetadataPayload(): MultipartValue {
const concatUUIDs = this.dsym.slices.map((slice) => slice.uuid).join()
return {
type: 'string',
options: {
contentType: 'application/json',
filename: 'event',
},
value: JSON.stringify({
type: 'ios_symbols',
uuids: concatUUIDs,
}),
}
}
}