/
types.ts
81 lines (73 loc) · 1.72 KB
/
types.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
export interface IProxyRequestError {
message?: string
code: number
passwordProtected?: true
}
interface INodeManifestPage {
path?: string
}
type FoundPageBy =
| `ownerNodeId`
| `filesystem-route-api`
| `context.id`
| `context.slug`
| `queryTracking`
| `none`
export interface INodeManifestOut {
page: INodeManifestPage
node: {
id: string
}
foundPageBy: FoundPageBy
pageDataDigest?: string
id?: string
}
export interface IPageDataJsonParams {
manifest?: INodeManifestOut
frontendUrl: string
}
export interface IPageData {
path: string
manifestId?: string
}
enum BuildStatus {
GitClone = `GIT_CLONE`,
GitCloneError = `GIT_CLONE_ERROR`,
GitPull = `GIT_PULL`,
GitPullError = `GIT_PULL_ERROR`,
DepInstall = `DEP_INSTALL`,
DepInstallError = `DEP_INSTALL_ERROR`,
Queued = `QUEUED`,
Canceled = `CANCELED`,
CanceledByGatsbyCloud = `CANCELED_BY_GATSBY_CLOUD`,
Building = `BUILDING`,
Uploading = `UPLOADING`,
Publishing = `PUBLISHING`,
UploadError = `UPLOAD_ERROR`,
PublishError = `PUBLISH_ERROR`,
PublishCanceled = `PUBLISH_CANCELED`,
TimedOut = `TIMED_OUT`,
Success = `SUCCESS`,
Error = `ERROR`,
}
export interface IContentLoaderInfo {
previewBuildStatus?: BuildStatus
previewUrl?: string
orgId?: string
}
export interface IPollArguments {
contentLoaderInfo?: IContentLoaderInfo
shouldPoll: boolean
showError: boolean
manifestId: string
sourcePluginName: string
siteId: string
frontendUrl: string | false
pollCount: number
pollCallback?: () => void
waitThenTriggerNextPoll: () => void
setErrorMessage: (arg: string) => void
setShowError: (arg: boolean) => void
setRedirectUrl: (arg: string) => void
setLoadingDuration: (arg: number) => void
}