-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathpreviewToken.ts
More file actions
78 lines (71 loc) · 1.59 KB
/
previewToken.ts
File metadata and controls
78 lines (71 loc) · 1.59 KB
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
import { AnyProperty, SystemFields } from "../../utility/fields";
import { Creatable, SystemFunction } from "../../utility/operations";
// Main preview token interface
export interface PreviewToken
extends SystemFields,
Creatable<PreviewToken, PreviewToken>,
SystemFunction<PreviewToken> {
name: string;
description: string;
scope: Scope[];
uid: string;
created_by: string;
updated_by: string;
created_at: string;
updated_at: string;
token: string;
type: string;
preview_token: string;
}
// API response shape for creating a preview token
export interface PreviewTokenResponse {
notice: string;
token: PreviewTokenData;
}
// Data inside the response `token`
export interface PreviewTokenData extends AnyProperty {
name: string;
description: string;
scope: Scope[];
uid: string;
created_by: string;
updated_by: string;
created_at: string;
updated_at: string;
token: string;
type: string;
preview_token: string;
}
export interface Scope {
module: string;
environments?: Environment[];
branches?: string[];
locales?: string[];
acl: ACL;
_metadata?: {
uid: string;
};
}
export interface Environment extends AnyProperty {
name: string;
uid: string;
urls?: UrlLocale[];
_version?: number;
app_user_object_uid?: string;
created_by?: string;
updated_by?: string;
created_at?: string;
updated_at?: string;
ACL?: unknown[];
tags?: string[];
}
export interface UrlLocale {
url: string;
locale: string;
}
export interface ACL extends AnyProperty {
read?: boolean;
write?: boolean;
create?: boolean;
update?: boolean;
}