@nangohq/types 0.69.13 → 0.69.15
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/account/api.d.ts +1 -1
- package/dist/api.endpoints.d.ts +2 -2
- package/dist/auth/api.d.ts +1 -0
- package/dist/billing/types.d.ts +22 -14
- package/dist/plans/http.api.d.ts +6 -5
- package/dist/providers/api.d.ts +28 -0
- package/dist/providers/provider.d.ts +3 -0
- package/dist/proxy/api.d.ts +2 -0
- package/dist/runner/sdk.d.ts +2 -0
- package/dist/web/env.d.ts +2 -0
- package/dist/webhooks/api.d.ts +1 -0
- package/package.json +1 -1
package/dist/account/api.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ export type ValidateEmailAndLogin = Endpoint<{
|
|
|
24
24
|
Body: {
|
|
25
25
|
token: string;
|
|
26
26
|
};
|
|
27
|
-
Error: ApiError<'error_logging_in'> | ApiError<'error_validating_user'> | ApiError<'token_expired'> | ApiError<'error_refreshing_token'>;
|
|
27
|
+
Error: ApiError<'error_logging_in'> | ApiError<'error_validating_user'> | ApiError<'invalid_token'> | ApiError<'token_expired'> | ApiError<'error_refreshing_token'>;
|
|
28
28
|
Success: {
|
|
29
29
|
user: ApiUser;
|
|
30
30
|
};
|
package/dist/api.endpoints.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ import type { DeleteInvite, GetInvite, PostInvite } from './invitations/api.js';
|
|
|
18
18
|
import type { GetOperation, PostInsights, SearchFilters, SearchMessages, SearchOperations } from './logs/api.js';
|
|
19
19
|
import type { GetMeta } from './meta/api.js';
|
|
20
20
|
import type { PostPlanExtendTrial } from './plans/http.api.js';
|
|
21
|
-
import type { GetPublicProvider, GetPublicProviders } from './providers/api.js';
|
|
21
|
+
import type { GetProvider, GetProviders, GetPublicProvider, GetPublicProviders } from './providers/api.js';
|
|
22
22
|
import type { AllPublicProxy } from './proxy/http.api.js';
|
|
23
23
|
import type { GetPublicRecords } from './record/api.js';
|
|
24
24
|
import type { GetPublicScriptsConfig } from './scripts/http.api.js';
|
|
@@ -28,7 +28,7 @@ import type { DeleteTeamUser, GetTeam, PutTeam } from './team/api.js';
|
|
|
28
28
|
import type { GetUser, PatchUser } from './user/api.js';
|
|
29
29
|
import type { PostPublicWebhook } from './webhooks/http.api.js';
|
|
30
30
|
export type PublicApiEndpoints = SetMetadata | UpdateMetadata | PostDeploy | PostDeployConfirmation | PostPublicTrigger | PostPublicTbaAuthorization | PostPublicJwtAuthorization | PostPublicUnauthenticatedAuthorization | PostPublicApiKeyAuthorization | PostPublicBasicAuthorization | PostPublicAppStoreAuthorization | GetPublicProviders | GetPublicProvider | GetPublicListIntegrations | GetPublicIntegration | DeletePublicIntegration | PostConnectSessions | PostPublicConnectSessionsReconnect | GetPublicConnections | GetPublicConnection | GetConnectSession | DeleteConnectSession | PostDeployInternal | PostPublicBillAuthorization | DeletePublicConnection | PostPublicSignatureAuthorization | PostPublicTwoStepAuthorization | PostPublicWebhook | GetPublicRecords | GetPublicScriptsConfig | PostPublicConnectTelemetry | PutPublicSyncConnectionFrequency | PostPublicIntegration | PatchPublicIntegration | GetAsyncActionResult | PostPublicOauthOutboundAuthorization | PostPublicConnection | PostPublicSyncStart | PostPublicSyncPause | GetPublicSyncStatus | GetPublicV1 | PostPublicTriggerAction | AllPublicProxy;
|
|
31
|
-
export type PrivateApiEndpoints = PostSignup | PostSignin | PostLogout | GetTeam | PutTeam | PostPlanExtendTrial | GetUser | PatchUser | PostInvite | DeleteInvite | DeleteTeamUser | PostInsights | PostForgotPassword | PutResetPassword | SearchOperations | GetOperation | SearchMessages | SearchFilters | PostInternalConnectSessions | GetIntegrationFlows | DeleteIntegration | PatchIntegration | GetIntegration | PostIntegration | GetConnections | GetConnectionsCount | GetConnection | GetInvite | GetMeta | GetEmailByExpiredToken | GetEmailByUuid | GetManagedCallback | PatchFlowDisable | PatchFlowEnable | PatchFlowFrequency | PutUpgradePreBuiltFlow | PostConnectionRefresh | PostManagedSignup | PostPreBuiltDeploy | PostEnvironment | PatchEnvironment | DeleteEnvironment | PatchWebhook | PostEnvironmentVariables | PostImpersonate | GetSharedCredentialsProviders | GetSharedCredentialsProvider | PostSharedCredentialsProvider | PatchSharedCredentialsProvider | GetGettingStarted | PatchGettingStarted | GetConnectUISettings | PutConnectUISettings;
|
|
31
|
+
export type PrivateApiEndpoints = PostSignup | PostSignin | PostLogout | GetTeam | PutTeam | PostPlanExtendTrial | GetUser | PatchUser | PostInvite | DeleteInvite | DeleteTeamUser | PostInsights | PostForgotPassword | PutResetPassword | SearchOperations | GetOperation | SearchMessages | SearchFilters | PostInternalConnectSessions | GetIntegrationFlows | DeleteIntegration | PatchIntegration | GetIntegration | PostIntegration | GetConnections | GetConnectionsCount | GetConnection | GetInvite | GetMeta | GetEmailByExpiredToken | GetEmailByUuid | GetManagedCallback | PatchFlowDisable | PatchFlowEnable | PatchFlowFrequency | PutUpgradePreBuiltFlow | PostConnectionRefresh | PostManagedSignup | PostPreBuiltDeploy | PostEnvironment | PatchEnvironment | DeleteEnvironment | PatchWebhook | PostEnvironmentVariables | PostImpersonate | GetSharedCredentialsProviders | GetSharedCredentialsProvider | PostSharedCredentialsProvider | PatchSharedCredentialsProvider | GetGettingStarted | PatchGettingStarted | GetConnectUISettings | PutConnectUISettings | GetProviders | GetProvider;
|
|
32
32
|
export type APIEndpoints = PrivateApiEndpoints | PublicApiEndpoints;
|
|
33
33
|
/**
|
|
34
34
|
* Automatically narrow endpoints type with Method + Path
|
package/dist/auth/api.d.ts
CHANGED
package/dist/billing/types.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Result } from '../result.js';
|
|
2
2
|
import type { DBTeam } from '../team/db.js';
|
|
3
|
+
import type { UsageMetric } from '../usage/index.js';
|
|
3
4
|
import type { DBUser } from '../user/db.js';
|
|
4
5
|
export interface BillingClient {
|
|
5
6
|
ingest: (events: BillingEvent[]) => Promise<Result<void>>;
|
|
@@ -9,7 +10,7 @@ export interface BillingClient {
|
|
|
9
10
|
getCustomer: (accountId: number) => Promise<Result<BillingCustomer>>;
|
|
10
11
|
getSubscription: (accountId: number) => Promise<Result<BillingSubscription | null>>;
|
|
11
12
|
createSubscription: (team: DBTeam, planExternalId: string) => Promise<Result<BillingSubscription>>;
|
|
12
|
-
getUsage: (subscriptionId: string, opts?: GetBillingUsageOpts) => Promise<Result<
|
|
13
|
+
getUsage: (subscriptionId: string, opts?: GetBillingUsageOpts) => Promise<Result<BillingUsageMetrics>>;
|
|
13
14
|
upgrade: (opts: {
|
|
14
15
|
subscriptionId: string;
|
|
15
16
|
planExternalId: string;
|
|
@@ -51,12 +52,11 @@ export interface GetBillingUsageOpts {
|
|
|
51
52
|
granularity?: 'day';
|
|
52
53
|
billingMetric?: {
|
|
53
54
|
id: string;
|
|
54
|
-
group_by?: 'environmentId' | '
|
|
55
|
+
group_by?: 'environmentId' | 'environmentName' | 'integrationId' | 'type' | 'functionName' | 'model';
|
|
55
56
|
};
|
|
56
57
|
}
|
|
57
58
|
export interface BillingUsageMetric {
|
|
58
|
-
|
|
59
|
-
name: string;
|
|
59
|
+
externalId: string;
|
|
60
60
|
group?: {
|
|
61
61
|
key: string;
|
|
62
62
|
value: string;
|
|
@@ -67,7 +67,13 @@ export interface BillingUsageMetric {
|
|
|
67
67
|
timeframeEnd: Date;
|
|
68
68
|
quantity: number;
|
|
69
69
|
}[];
|
|
70
|
+
view_mode: 'cumulative' | 'periodic';
|
|
71
|
+
}
|
|
72
|
+
export type BillingUsageMetrics = Partial<Record<UsageMetric, BillingUsageMetric | undefined>>;
|
|
73
|
+
export interface ApiBillingUsageMetric extends BillingUsageMetric {
|
|
74
|
+
label: string;
|
|
70
75
|
}
|
|
76
|
+
export type ApiBillingUsageMetrics = Record<UsageMetric, ApiBillingUsageMetric>;
|
|
71
77
|
export interface BillingPlan {
|
|
72
78
|
id: string;
|
|
73
79
|
external_plan_id: string;
|
|
@@ -84,9 +90,9 @@ interface BillingEventBase<TType extends string, TProperties extends BillingProp
|
|
|
84
90
|
} & TProperties;
|
|
85
91
|
}
|
|
86
92
|
export type MarBillingEvent = BillingEventBase<'monthly_active_records', {
|
|
87
|
-
connectionId: number;
|
|
88
93
|
environmentId: number;
|
|
89
|
-
|
|
94
|
+
environmentName: string;
|
|
95
|
+
integrationId: string;
|
|
90
96
|
syncId: string;
|
|
91
97
|
model: string;
|
|
92
98
|
}>;
|
|
@@ -97,14 +103,17 @@ export type RecordsBillingEvent = BillingEventBase<'records', {
|
|
|
97
103
|
};
|
|
98
104
|
}>;
|
|
99
105
|
export type ActionsBillingEvent = BillingEventBase<'billable_actions', {
|
|
100
|
-
connectionId: number;
|
|
101
106
|
environmentId: number;
|
|
102
|
-
|
|
107
|
+
environmentName: string;
|
|
108
|
+
integrationId: string;
|
|
103
109
|
actionName: string;
|
|
104
110
|
}>;
|
|
105
111
|
export type FunctionExecutionsBillingEvent = BillingEventBase<'function_executions', {
|
|
112
|
+
environmentId: number;
|
|
113
|
+
environmentName: string;
|
|
114
|
+
integrationId: string;
|
|
106
115
|
type: string;
|
|
107
|
-
|
|
116
|
+
functionName: string;
|
|
108
117
|
telemetry: {
|
|
109
118
|
successes: number;
|
|
110
119
|
failures: number;
|
|
@@ -116,10 +125,9 @@ export type FunctionExecutionsBillingEvent = BillingEventBase<'function_executio
|
|
|
116
125
|
frequencyMs?: number | undefined;
|
|
117
126
|
}>;
|
|
118
127
|
export type ProxyBillingEvent = BillingEventBase<'proxy', {
|
|
119
|
-
connectionId: number;
|
|
120
128
|
environmentId: number;
|
|
121
|
-
|
|
122
|
-
|
|
129
|
+
environmentName: string;
|
|
130
|
+
integrationId: string;
|
|
123
131
|
telemetry: {
|
|
124
132
|
successes: number;
|
|
125
133
|
failures: number;
|
|
@@ -127,8 +135,8 @@ export type ProxyBillingEvent = BillingEventBase<'proxy', {
|
|
|
127
135
|
}>;
|
|
128
136
|
export type WebhookForwardBillingEvent = BillingEventBase<'webhook_forwards', {
|
|
129
137
|
environmentId: number;
|
|
130
|
-
|
|
131
|
-
|
|
138
|
+
environmentName: string;
|
|
139
|
+
integrationId: string;
|
|
132
140
|
telemetry: {
|
|
133
141
|
successes: number;
|
|
134
142
|
failures: number;
|
package/dist/plans/http.api.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { MetricUsageSummary } from '../usage/index.js';
|
|
1
|
+
import type { ApiBillingUsageMetrics, BillingCustomer } from '../billing/types.js';
|
|
2
|
+
import type { MetricUsageSummary, UsageMetric } from '../usage/index.js';
|
|
3
3
|
import type { ReplaceInObject } from '../utils.js';
|
|
4
4
|
import type { DBPlan } from './db.js';
|
|
5
5
|
import type { Endpoint } from '../api.js';
|
|
@@ -58,7 +58,7 @@ export type GetUsage = Endpoint<{
|
|
|
58
58
|
env: string;
|
|
59
59
|
};
|
|
60
60
|
Success: {
|
|
61
|
-
data: Record<
|
|
61
|
+
data: Record<UsageMetric, MetricUsageSummary>;
|
|
62
62
|
};
|
|
63
63
|
}>;
|
|
64
64
|
export type GetBillingUsage = Endpoint<{
|
|
@@ -66,12 +66,13 @@ export type GetBillingUsage = Endpoint<{
|
|
|
66
66
|
Path: '/api/v1/plans/billing-usage';
|
|
67
67
|
Querystring: {
|
|
68
68
|
env: string;
|
|
69
|
+
from?: string | undefined;
|
|
70
|
+
to?: string | undefined;
|
|
69
71
|
};
|
|
70
72
|
Success: {
|
|
71
73
|
data: {
|
|
72
74
|
customer: BillingCustomer;
|
|
73
|
-
|
|
74
|
-
previous: BillingUsageMetric[];
|
|
75
|
+
usage: ApiBillingUsageMetrics;
|
|
75
76
|
};
|
|
76
77
|
};
|
|
77
78
|
}>;
|
package/dist/providers/api.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Endpoint } from '../api.js';
|
|
2
2
|
import type { Provider } from './provider.js';
|
|
3
|
+
import type { AuthModeType } from '../auth/api.js';
|
|
3
4
|
export type GetPublicProviders = Endpoint<{
|
|
4
5
|
Method: 'GET';
|
|
5
6
|
Path: `/providers`;
|
|
@@ -27,3 +28,30 @@ export type GetPublicProvider = Endpoint<{
|
|
|
27
28
|
data: ApiProvider;
|
|
28
29
|
};
|
|
29
30
|
}>;
|
|
31
|
+
export interface ApiProviderListItem {
|
|
32
|
+
name: string;
|
|
33
|
+
displayName: string;
|
|
34
|
+
defaultScopes?: string[] | undefined;
|
|
35
|
+
authMode: AuthModeType;
|
|
36
|
+
categories?: string[] | undefined;
|
|
37
|
+
docs: string;
|
|
38
|
+
preConfigured: boolean;
|
|
39
|
+
preConfiguredScopes: string[];
|
|
40
|
+
}
|
|
41
|
+
export type GetProviders = Endpoint<{
|
|
42
|
+
Method: 'GET';
|
|
43
|
+
Path: '/api/v1/providers';
|
|
44
|
+
Success: {
|
|
45
|
+
data: ApiProviderListItem[];
|
|
46
|
+
};
|
|
47
|
+
}>;
|
|
48
|
+
export type GetProvider = Endpoint<{
|
|
49
|
+
Method: 'GET';
|
|
50
|
+
Path: '/api/v1/providers/:providerConfigKey';
|
|
51
|
+
Params: {
|
|
52
|
+
providerConfigKey: string;
|
|
53
|
+
};
|
|
54
|
+
Success: {
|
|
55
|
+
data: ApiProviderListItem;
|
|
56
|
+
};
|
|
57
|
+
}>;
|
|
@@ -175,10 +175,13 @@ export interface ProviderTwoStep extends Omit<BaseProvider, 'body_format'> {
|
|
|
175
175
|
};
|
|
176
176
|
token_request_method?: 'GET';
|
|
177
177
|
token_headers?: Record<string, string>;
|
|
178
|
+
refresh_url?: string;
|
|
179
|
+
refresh_token_params?: Record<string, string>;
|
|
178
180
|
token_response: {
|
|
179
181
|
token: string;
|
|
180
182
|
token_expiration?: string;
|
|
181
183
|
token_expiration_strategy?: 'expireAt' | 'expireIn';
|
|
184
|
+
refresh_token?: string;
|
|
182
185
|
};
|
|
183
186
|
additional_steps?: {
|
|
184
187
|
body_format?: 'json' | 'form';
|
package/dist/proxy/api.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { DBConnectionDecrypted } from '../connection/db.js';
|
|
2
|
+
import type { DBIntegrationDecrypted } from '../integration/db.js';
|
|
2
3
|
import type { HTTP_METHOD } from '../nangoYaml/index.js';
|
|
3
4
|
import type { Provider } from '../providers/provider.js';
|
|
4
5
|
import type { AxiosResponse } from 'axios';
|
|
@@ -32,6 +33,7 @@ export interface UserProvidedProxyConfiguration extends BaseProxyConfiguration {
|
|
|
32
33
|
paginate?: Partial<CursorPagination> | Partial<LinkPagination> | Partial<OffsetPagination>;
|
|
33
34
|
}
|
|
34
35
|
export type ConnectionForProxy = Pick<DBConnectionDecrypted, 'connection_id' | 'connection_config' | 'credentials' | 'metadata'>;
|
|
36
|
+
export type IntegrationConfigForProxy = Pick<DBIntegrationDecrypted, 'oauth_client_id' | 'oauth_client_secret'>;
|
|
35
37
|
export interface ApplicationConstructedProxyConfiguration extends BaseProxyConfiguration {
|
|
36
38
|
decompress: boolean;
|
|
37
39
|
method: HTTP_METHOD;
|
package/dist/runner/sdk.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { RunnerFlags } from './index.js';
|
|
2
2
|
import type { LogLevel } from '../logs/messages.js';
|
|
3
|
+
import type { IntegrationConfigForProxy } from '../proxy/api.js';
|
|
3
4
|
import type { DBSyncConfig } from '../syncConfigs/db.js';
|
|
4
5
|
import type { DBTeam } from '../team/db.js';
|
|
5
6
|
import type { AxiosError, AxiosInterceptorManager, AxiosRequestConfig, AxiosResponse } from 'axios';
|
|
@@ -40,6 +41,7 @@ export interface NangoProps {
|
|
|
40
41
|
} | null;
|
|
41
42
|
heartbeatTimeoutSecs?: number | undefined;
|
|
42
43
|
isCLI?: boolean | undefined;
|
|
44
|
+
integrationConfig?: IntegrationConfigForProxy;
|
|
43
45
|
axios?: {
|
|
44
46
|
request?: AxiosInterceptorManager<AxiosRequestConfig>;
|
|
45
47
|
response?: {
|
package/dist/web/env.d.ts
CHANGED
package/dist/webhooks/api.d.ts
CHANGED