-
Notifications
You must be signed in to change notification settings - Fork 451
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
## Changes Contributes to https://linear.app/nango/issue/NAN-2265/remove-shared-from-cli - Copy SDK types to `@nangohq/types` It's to prepare the field when I introduce a dedicated package for the SDK, so we can reuse types across the codebase. Those types are not used at the moment. (see #3297 for full PR) - Fix types for pagination It wasn't using a discriminated object which makes type narrowing impossible - Fix types for response saver
- Loading branch information
1 parent
6cfbb80
commit ddcabd7
Showing
9 changed files
with
89 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export interface EnvironmentVariable { | ||
name: string; | ||
value: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import type { AxiosError, AxiosInterceptorManager, AxiosRequestConfig, AxiosResponse } from 'axios'; | ||
import type { RunnerFlags } from '.'; | ||
import type { Metadata } from '../connection/db'; | ||
import type { DBTeam } from '../team/db'; | ||
import type { DBSyncConfig } from '../syncConfigs/db'; | ||
|
||
export interface RunArgs { | ||
sync: string; | ||
connectionId: string; | ||
lastSyncDate?: string; | ||
useServerLastSyncDate?: boolean; | ||
input?: object; | ||
metadata?: Metadata; | ||
autoConfirm: boolean; | ||
debug: boolean; | ||
optionalEnvironment?: string; | ||
optionalProviderConfigKey?: string; | ||
} | ||
|
||
export interface DryRunServiceInterface { | ||
run: (options: RunArgs, debug?: boolean) => Promise<string | void>; | ||
} | ||
|
||
export interface NangoProps { | ||
scriptType: 'sync' | 'action' | 'webhook' | 'on-event'; | ||
host?: string; | ||
secretKey: string; | ||
team?: Pick<DBTeam, 'id' | 'name'>; | ||
connectionId: string; | ||
environmentId: number; | ||
environmentName?: string; | ||
activityLogId?: string | undefined; | ||
providerConfigKey: string; | ||
provider: string; | ||
lastSyncDate?: Date; | ||
syncId?: string | undefined; | ||
nangoConnectionId?: number; | ||
syncJobId?: number | undefined; | ||
track_deletes?: boolean; | ||
attributes?: object | undefined; | ||
abortSignal?: AbortSignal; | ||
syncConfig: DBSyncConfig; | ||
runnerFlags: RunnerFlags; | ||
debug: boolean; | ||
startedAt: Date; | ||
endUser: { id: number; endUserId: string | null; orgId: string | null } | null; | ||
|
||
axios?: { | ||
request?: AxiosInterceptorManager<AxiosRequestConfig>; | ||
response?: { | ||
onFulfilled: (value: AxiosResponse) => AxiosResponse | Promise<AxiosResponse>; | ||
onRejected: (value: unknown) => AxiosError | Promise<AxiosError>; | ||
}; | ||
}; | ||
} | ||
|
||
export interface UserLogParameters { | ||
level?: 'info' | 'debug' | 'error' | 'warn' | 'http' | 'verbose' | 'silly'; | ||
} |