forked from NangoHQ/nango
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.d.ts
131 lines (116 loc) · 2.55 KB
/
types.d.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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
import { Request } from 'express'
import { TWithInstrument } from './instrumentation/middleware'
import { Integration } from './legacy/functions/integration'
import { AuthDetails } from './legacy/auth/v3/types'
import Knex from 'knex'
export type Omit<T, K> = Pick<T, Exclude<keyof T, K>>
export interface IntegrationServiceRequest extends Request {
environmentIdentifier: string
organizationIdentifier: string
}
export type TRequest = Request & {
clientId: string
authId: string
organizationIdentifier?: any
environmentIdentifier?: any
bearerOverhead?: number
} & TWithInstrument
export type TServerResponse = {
data: {
data: {
organization?: {
identifier?: string
id: string
clientId: string
user?: {
auth0uuid: string
}
}
errors?: {
field: string
messages: string[]
}
}
}
}
export type TBackendRequestV4 = TRequest & {
userId: string
authId: string
auth: any
bearerResponse: {
StatusCode: number
Payload: any
}
userDefinedData: any
functionArn?: string
organizationIdentifier?: any
environmentIdentifier?: any
isBackend: string
setupId: string
integration: Integration
functionName: string
internalCorrelationId?: string
userCorrelationId?: string
fullLogs: boolean
}
type TRequestLog = {
endedAt?: number
duration?: number
} & TRequest
export type TIdentifiersRequest = Request & {
clientId: string
environmentIdentifier: string
organizationIdentifier: string
buid?: string
uuid?: string
alias?: string
webhookConfig?: any
fullLogs?: boolean
}
/**********************/
declare global {
namespace Express {
export interface Request {
store?: Knex
}
}
}
export namespace Types {
export interface Integration {
id: string
image: string
name: string
config: {
authType: string
setupKeyLabel: string
setupSecretLabel: string
}
request: {
baseURL: string
headers?: { [key: string]: string }
params?: { [key: string]: string }
}
}
export interface OAuth2Credentials {
clientId: string
clientSecret: string
}
export interface OAuth1Credentials {
consumerKey: string
consumerSecret: string
}
export interface Configuration {
id: string
object: string
scopes: string[]
credentials: OAuth1Credentials | OAuth2Credentials
createdAt?: string
modifiedAt?: string
}
export interface Authentication {
auth_id: string
payload: any
created_at: string
updated_at: string
}
}