@nangohq/types 0.40.2 → 0.40.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/logs/api.d.ts +3 -3
- package/dist/logs/messages.d.ts +22 -16
- package/package.json +3 -2
package/dist/logs/api.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Endpoint } from '../api';
|
|
2
|
-
import type {
|
|
3
|
-
type Concat<T extends
|
|
2
|
+
import type { MessageRow, MessageState, OperationList, OperationRow } from './messages';
|
|
3
|
+
type Concat<T extends OperationList> = T[keyof T] | (T extends {
|
|
4
4
|
action: string;
|
|
5
5
|
} ? `${T['type']}:${T['action']}` : never);
|
|
6
6
|
export type SearchOperations = Endpoint<{
|
|
@@ -28,7 +28,7 @@ export type SearchOperations = Endpoint<{
|
|
|
28
28
|
};
|
|
29
29
|
}>;
|
|
30
30
|
export type SearchOperationsState = 'all' | MessageState;
|
|
31
|
-
export type SearchOperationsType = 'all' | Concat<
|
|
31
|
+
export type SearchOperationsType = 'all' | Concat<OperationList>;
|
|
32
32
|
export type SearchOperationsIntegration = 'all' | string;
|
|
33
33
|
export type SearchOperationsConnection = 'all' | string;
|
|
34
34
|
export type SearchOperationsSync = 'all' | string;
|
package/dist/logs/messages.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Merge } from 'type-fest';
|
|
1
2
|
/**
|
|
2
3
|
* Level of the log and operation
|
|
3
4
|
*/
|
|
@@ -24,37 +25,37 @@ export type MessageState = 'waiting' | 'running' | 'success' | 'failed' | 'timeo
|
|
|
24
25
|
/**
|
|
25
26
|
* Operations
|
|
26
27
|
*/
|
|
27
|
-
export interface
|
|
28
|
+
export interface OperationSync {
|
|
28
29
|
type: 'sync';
|
|
29
30
|
action: 'pause' | 'unpause' | 'run' | 'request_run' | 'request_run_full' | 'cancel' | 'init';
|
|
30
31
|
}
|
|
31
|
-
export interface
|
|
32
|
+
export interface OperationProxy {
|
|
32
33
|
type: 'proxy';
|
|
33
34
|
}
|
|
34
|
-
export interface
|
|
35
|
+
export interface OperationAction {
|
|
35
36
|
type: 'action';
|
|
36
37
|
}
|
|
37
|
-
export interface
|
|
38
|
+
export interface OperationAuth {
|
|
38
39
|
type: 'auth';
|
|
39
40
|
action: 'create_connection' | 'refresh_token' | 'post_connection';
|
|
40
41
|
}
|
|
41
|
-
export interface
|
|
42
|
+
export interface OperationAdmin {
|
|
42
43
|
type: 'admin';
|
|
43
44
|
action: 'impersonation';
|
|
44
45
|
}
|
|
45
|
-
export interface
|
|
46
|
+
export interface OperationWebhook {
|
|
46
47
|
type: 'webhook';
|
|
47
48
|
action: 'incoming' | 'outgoing';
|
|
48
49
|
}
|
|
49
|
-
export interface
|
|
50
|
+
export interface OperationDeploy {
|
|
50
51
|
type: 'deploy';
|
|
51
52
|
action: 'prebuilt' | 'custom';
|
|
52
53
|
}
|
|
53
|
-
export type
|
|
54
|
+
export type OperationList = OperationSync | OperationProxy | OperationAction | OperationWebhook | OperationDeploy | OperationAuth | OperationAdmin;
|
|
54
55
|
/**
|
|
55
56
|
* Full schema
|
|
56
57
|
*/
|
|
57
|
-
export
|
|
58
|
+
export interface MessageRow {
|
|
58
59
|
id: string;
|
|
59
60
|
source: 'internal' | 'user';
|
|
60
61
|
level: LogLevel;
|
|
@@ -63,6 +64,7 @@ export type MessageRow = {
|
|
|
63
64
|
title: string | null;
|
|
64
65
|
state: MessageState;
|
|
65
66
|
code: MessageCode | null;
|
|
67
|
+
operation: null;
|
|
66
68
|
accountId: number | null;
|
|
67
69
|
accountName: string | null;
|
|
68
70
|
environmentId: number | null;
|
|
@@ -105,19 +107,23 @@ export type MessageRow = {
|
|
|
105
107
|
startedAt: string | null;
|
|
106
108
|
endedAt: string | null;
|
|
107
109
|
expiresAt: string | null;
|
|
108
|
-
}
|
|
109
|
-
operation: MessageOperation | null;
|
|
110
|
-
};
|
|
110
|
+
}
|
|
111
111
|
/**
|
|
112
112
|
* What is required to insert a Message
|
|
113
113
|
*/
|
|
114
|
-
export type
|
|
115
|
-
|
|
116
|
-
|
|
114
|
+
export type OperationRowInsert = Merge<Partial<MessageRow>, {
|
|
115
|
+
message: string;
|
|
116
|
+
operation: OperationList;
|
|
117
|
+
}>;
|
|
118
|
+
export type OperationRow = Merge<Required<OperationRowInsert>, {
|
|
119
|
+
accountId: number;
|
|
120
|
+
accountName: string;
|
|
121
|
+
}>;
|
|
117
122
|
/**
|
|
118
123
|
* What is required to insert a Message
|
|
119
124
|
*/
|
|
120
125
|
export type MessageRowInsert = Pick<MessageRow, 'type' | 'message'> & Partial<Omit<MessageRow, 'type' | 'message'>> & {
|
|
121
|
-
id?:
|
|
126
|
+
id?: never;
|
|
122
127
|
};
|
|
123
128
|
export type LogsBuffer = Pick<MessageRow, 'level' | 'message' | 'createdAt'> & Partial<Pick<MessageRow, 'error' | 'meta'>>;
|
|
129
|
+
export type MessageOrOperationRow = MessageRow | OperationRow;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nangohq/types",
|
|
3
|
-
"version": "0.40.
|
|
3
|
+
"version": "0.40.4",
|
|
4
4
|
"description": "Types used in Nango applications",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -12,7 +12,8 @@
|
|
|
12
12
|
"directory": "packages/utils"
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
|
-
"axios": "^1.3.4"
|
|
15
|
+
"axios": "^1.3.4",
|
|
16
|
+
"type-fest": "4.14.0"
|
|
16
17
|
},
|
|
17
18
|
"license": "SEE LICENSE IN LICENSE FILE IN GIT REPOSITORY",
|
|
18
19
|
"files": [
|