-
Notifications
You must be signed in to change notification settings - Fork 1
/
Identifiers.ts
64 lines (62 loc) · 1.73 KB
/
Identifiers.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
/**
* A set of identifiers that uniquely identify a user.
*/
export interface Identifiers {
/**
* The user's email if known
*/
email?: string;
/**
* Zaius's globally unique identifier generated by SDKs such as the Javascript SDK.
* Only use if you are forwarding a VUID generated by Zaius.
*/
vuid?: string;
/**
* Other identifiers known to the account, such as `my_app_cart_token`
*/
[field: string]: string | undefined;
}
/**
* Custom metadata that can be added to any identifier.
* Do not include fields you do not want to update.
*/
export interface IdentifierMetadata {
/**
* The name of the identifier field you want to update, e.g., email
*/
identifier_field_name: string;
/**
* An existing identifier value, such as a known email address
*/
identifier_value: string;
/**
* The metadata to update
*/
metadata: {
/**
* The fields must already exist before updating.
* The value should be a string, number, or boolean value matching the metadata field type.
* An explicitly null value will remove the previous value.
*/
[field: string]: string | number | boolean | null;
};
}
export interface IdentifierMetadataResponse {
/**
* The name of the identifier field, e.g., email
*/
identifier_value: string;
/**
* The identifier value requested, such as a customer's email address
*/
identifier_field_name: string;
/**
* An object representing the metadata associated with this identifier value
*/
metadata: IdentifierMetadata;
/**
* The time the metadata was last updated. Time expressed as seconds since the unix epoch.
* Convert to a date with `new Date(metadata_update_ts * 1000)`.
*/
metadata_update_ts: number | null;
}