@nangohq/types 0.42.10 → 0.42.12

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.
@@ -7,8 +7,12 @@ import type { DeleteTeamUser, GetTeam, PutTeam } from './team/api';
7
7
  import type { PostForgotPassword, PutResetPassword, PostSignin, PostSignup } from './account/api';
8
8
  import type { DeleteInvite, PostInvite } from './invitations/api';
9
9
  import type { GetUser, PatchUser } from './user/api';
10
- import type { GetListIntegrations } from './integration/api';
11
- export type APIEndpoints = PostSignup | PostSignin | GetTeam | PutTeam | GetUser | PatchUser | PostInvite | DeleteInvite | DeleteTeamUser | PostInsights | PostForgotPassword | PutResetPassword | SearchOperations | GetOperation | SearchMessages | SearchFilters | GetOnboardingStatus | SetMetadata | UpdateMetadata | PostDeploy | PostDeployConfirmation | GetListIntegrations;
10
+ import type { DeletePublicIntegration, GetPublicIntegration, GetPublicListIntegrations, GetPublicListIntegrationsLegacy } from './integration/api';
11
+ import type { PostPublicTableauAuthorization, PostPublicTbaAuthorization, PostPublicUnauthenticatedAuthorization } from './auth/http.api';
12
+ import type { GetPublicProvider, GetPublicProviders } from './providers/api';
13
+ export type PublicApiEndpoints = SetMetadata | UpdateMetadata | PostDeploy | PostDeployConfirmation | PostPublicTbaAuthorization | PostPublicTableauAuthorization | PostPublicUnauthenticatedAuthorization | GetPublicProviders | GetPublicProvider | GetPublicListIntegrationsLegacy | GetPublicListIntegrations | GetPublicIntegration | DeletePublicIntegration;
14
+ export type PrivateApiEndpoints = PostSignup | PostSignin | GetTeam | PutTeam | GetUser | PatchUser | PostInvite | DeleteInvite | DeleteTeamUser | PostInsights | PostForgotPassword | PutResetPassword | SearchOperations | GetOperation | SearchMessages | SearchFilters | GetOnboardingStatus;
15
+ export type APIEndpoints = PrivateApiEndpoints | PublicApiEndpoints;
12
16
  /**
13
17
  * Automatically narrow endpoints type with Method + Path
14
18
  */
@@ -1,43 +1,62 @@
1
1
  import type { ApiError, Endpoint } from '../api';
2
- import type { ConnectionConfig } from '../connection/db';
3
- export type TbaAuthorization = Endpoint<{
2
+ export type PostPublicTbaAuthorization = Endpoint<{
4
3
  Method: 'POST';
5
4
  Body: {
6
5
  token_id: string;
7
6
  token_secret: string;
8
- oauth_client_id_override?: string;
9
- oauth_client_secret_override?: string;
7
+ oauth_client_id_override?: string | undefined;
8
+ oauth_client_secret_override?: string | undefined;
10
9
  };
11
- QueryParams: {
12
- connectionId: string;
13
- connectionConfig: ConnectionConfig;
10
+ Querystring: {
11
+ connection_id?: string | undefined;
12
+ public_key: string;
13
+ params?: Record<string, any> | undefined;
14
+ hmac?: string | undefined;
14
15
  };
15
16
  Params: {
16
17
  providerConfigKey: string;
17
18
  };
18
19
  Path: '/auth/tba';
19
- Error: ApiError<'invalid_body'> | ApiError<'invalid_query_params'> | ApiError<'unknown_provider_config'> | ApiError<'invalid_auth_mode'> | ApiError<'invalid_credentials'>;
20
+ Error: ApiError<'invalid_body'> | ApiError<'invalid_query_params'> | ApiError<'unknown_provider_config'> | ApiError<'unknown_provider_template'> | ApiError<'invalid_auth_mode'> | ApiError<'invalid_credentials'>;
20
21
  Success: {
21
22
  providerConfigKey: string;
22
23
  connectionId: string;
23
24
  };
24
25
  }>;
25
- export type TableauAuthorization = Endpoint<{
26
+ export type PostPublicTableauAuthorization = Endpoint<{
26
27
  Method: 'POST';
27
28
  Body: {
28
29
  pat_name: string;
29
30
  pat_secret: string;
30
- content_url?: string;
31
+ content_url?: string | undefined;
31
32
  };
32
- QueryParams: {
33
- connectionId: string;
34
- connectionConfig: ConnectionConfig;
33
+ Querystring: {
34
+ connection_id?: string | undefined;
35
+ public_key: string;
36
+ params?: Record<string, any> | undefined;
37
+ hmac?: string | undefined;
35
38
  };
36
39
  Params: {
37
40
  providerConfigKey: string;
38
41
  };
39
42
  Path: '/auth/tableau';
40
- Error: ApiError<'invalid_body'> | ApiError<'invalid_query_params'> | ApiError<'unknown_provider_config'> | ApiError<'invalid_auth_mode'> | ApiError<'invalid_credentials'>;
43
+ Error: ApiError<'invalid_body'> | ApiError<'invalid_query_params'> | ApiError<'unknown_provider_config'> | ApiError<'unknown_provider_template'> | ApiError<'invalid_auth_mode'> | ApiError<'invalid_credentials'>;
44
+ Success: {
45
+ providerConfigKey: string;
46
+ connectionId: string;
47
+ };
48
+ }>;
49
+ export type PostPublicUnauthenticatedAuthorization = Endpoint<{
50
+ Method: 'POST';
51
+ Querystring: {
52
+ connection_id?: string | undefined;
53
+ hmac?: string | undefined;
54
+ };
55
+ Params: {
56
+ providerConfigKey: string;
57
+ };
58
+ Path: '/auth/unauthenticated';
59
+ Error: ApiError<'invalid_body'> | ApiError<'invalid_query_params'> | ApiError<'unknown_provider_config'> | ApiError<'unknown_provider_template'> | ApiError<'invalid_auth_mode'> | ApiError<'invalid_credentials'>;
41
60
  Success: {
42
61
  providerConfigKey: string;
43
62
  connectionId: string;
package/dist/index.d.ts CHANGED
@@ -18,6 +18,7 @@ export type * from './syncConfigs/db.js';
18
18
  export type * from './syncConfigs/api.js';
19
19
  export type * from './team/api.js';
20
20
  export type * from './team/db.js';
21
+ export type * from './providers/api.js';
21
22
  export type * from './proxy/api.js';
22
23
  export type * from './environment/db.js';
23
24
  export type * from './scripts/post-connection/db.js';
@@ -27,7 +28,7 @@ export type * from './notification/active-logs/db.js';
27
28
  export type * from './connection/api/get.js';
28
29
  export type * from './integration/api.js';
29
30
  export type * from './integration/db.js';
30
- export type * from './integration/template.js';
31
+ export type * from './providers/provider.js';
31
32
  export type * from './auth/api.js';
32
33
  export type * from './auth/db.js';
33
34
  export type * from './auth/http.api.js';
@@ -1,23 +1,46 @@
1
1
  import type { Merge } from 'type-fest';
2
2
  import type { ApiTimestamps, Endpoint } from '../api';
3
3
  import type { IntegrationConfig } from './db';
4
- import type { Template } from './template';
4
+ import type { Provider } from '../providers/provider';
5
5
  import type { AuthModeType } from '../auth/api';
6
6
  import type { NangoModel, NangoSyncEndpoint, ScriptTypeLiteral } from '../nangoYaml';
7
7
  import type { LegacySyncModelSchema, NangoConfigMetadata } from '../deploy/incomingFlow';
8
8
  import type { JSONSchema7 } from 'json-schema';
9
9
  import type { SyncType } from '../scripts/syncs/api';
10
- export type GetListIntegrations = Endpoint<{
10
+ export type ApiPublicIntegration = Merge<Pick<IntegrationConfig, 'created_at' | 'updated_at' | 'unique_key' | 'provider'>, ApiTimestamps> & {
11
+ logo: string;
12
+ } & ApiPublicIntegrationInclude;
13
+ export interface ApiPublicIntegrationInclude {
14
+ webhook_url?: string | null;
15
+ }
16
+ export type GetPublicListIntegrationsLegacy = Endpoint<{
11
17
  Method: 'GET';
12
18
  Path: '/config';
13
19
  Success: {
14
- configs: {
15
- provider: string;
16
- unique_key: string;
17
- }[];
20
+ configs: ApiPublicIntegration[];
21
+ };
22
+ }>;
23
+ export type GetPublicListIntegrations = Endpoint<{
24
+ Method: 'GET';
25
+ Path: '/integrations';
26
+ Success: {
27
+ data: ApiPublicIntegration[];
28
+ };
29
+ }>;
30
+ export type GetPublicIntegration = Endpoint<{
31
+ Method: 'GET';
32
+ Path: '/integrations/:uniqueKey';
33
+ Params: {
34
+ uniqueKey: string;
35
+ };
36
+ Querystring: {
37
+ include?: 'webhook'[] | undefined;
38
+ };
39
+ Success: {
40
+ data: ApiPublicIntegration;
18
41
  };
19
42
  }>;
20
- export type DeleteIntegrationPublic = Endpoint<{
43
+ export type DeletePublicIntegration = Endpoint<{
21
44
  Method: 'DELETE';
22
45
  Path: '/config/:providerConfigKey';
23
46
  Params: {
@@ -47,7 +70,7 @@ export type GetIntegration = Endpoint<{
47
70
  Success: {
48
71
  data: {
49
72
  integration: ApiIntegration;
50
- template: Template;
73
+ template: Provider;
51
74
  meta: {
52
75
  connectionsCount: number;
53
76
  webhookUrl: string | null;
@@ -0,0 +1,25 @@
1
+ import type { Endpoint } from '../api';
2
+ import type { Provider } from './provider';
3
+ export type GetPublicProviders = Endpoint<{
4
+ Method: 'GET';
5
+ Path: `/providers`;
6
+ Querystring: {
7
+ search?: string | undefined;
8
+ };
9
+ Success: {
10
+ data: ApiProvider[];
11
+ };
12
+ }>;
13
+ export type ApiProvider = Provider & {
14
+ name: string;
15
+ };
16
+ export type GetPublicProvider = Endpoint<{
17
+ Method: 'GET';
18
+ Path: `/providers/:provider`;
19
+ Params: {
20
+ provider: string;
21
+ };
22
+ Success: {
23
+ data: ApiProvider;
24
+ };
25
+ }>;
@@ -12,7 +12,13 @@ export interface TokenUrlObject {
12
12
  APP?: string;
13
13
  NONE?: string;
14
14
  }
15
- export interface Template {
15
+ export interface ProviderAlias {
16
+ alias?: string;
17
+ proxy: {
18
+ base_url?: string;
19
+ };
20
+ }
21
+ export interface BaseProvider {
16
22
  auth_mode: AuthModeType;
17
23
  proxy?: {
18
24
  base_url: string;
@@ -49,7 +55,7 @@ export interface Template {
49
55
  categories?: string[];
50
56
  connection_configuration?: string[];
51
57
  }
52
- export interface TemplateOAuth2 extends Template {
58
+ export interface ProviderOAuth2 extends BaseProvider {
53
59
  auth_mode: 'OAUTH2' | 'CUSTOM';
54
60
  disable_pkce?: boolean;
55
61
  token_params?: {
@@ -64,7 +70,7 @@ export interface TemplateOAuth2 extends Template {
64
70
  expires_in_unit?: 'milliseconds';
65
71
  token_request_auth_method?: 'basic' | 'custom';
66
72
  }
67
- export interface TemplateOAuth1 extends Template {
73
+ export interface ProviderOAuth1 extends BaseProvider {
68
74
  auth_mode: 'OAUTH1';
69
75
  request_url: string;
70
76
  request_params?: Record<string, string>;
@@ -72,3 +78,4 @@ export interface TemplateOAuth1 extends Template {
72
78
  token_http_method?: 'GET' | 'PUT' | 'POST';
73
79
  signature_method: 'HMAC-SHA1' | 'RSA-SHA1' | 'PLAINTEXT';
74
80
  }
81
+ export type Provider = BaseProvider | ProviderOAuth1 | ProviderOAuth2;
@@ -2,7 +2,7 @@ import type { ParamsSerializerOptions } from 'axios';
2
2
  import type { EndpointMethod } from '../api.js';
3
3
  import type { BasicApiCredentials, ApiKeyCredentials, AppCredentials } from '../auth/api.js';
4
4
  import type { Connection } from '../connection/db.js';
5
- import type { Template as ProviderTemplate } from '../integration/template.js';
5
+ import type { Provider } from '../providers/provider.js';
6
6
  export interface BaseProxyConfiguration {
7
7
  providerConfigKey: string;
8
8
  connectionId: string;
@@ -25,16 +25,16 @@ export interface UserProvidedProxyConfiguration extends BaseProxyConfiguration {
25
25
  export interface ApplicationConstructedProxyConfiguration extends BaseProxyConfiguration {
26
26
  decompress?: boolean;
27
27
  method: EndpointMethod;
28
- provider: string;
28
+ providerName: string;
29
29
  token: string | BasicApiCredentials | ApiKeyCredentials | AppCredentials;
30
- template: ProviderTemplate;
30
+ provider: Provider;
31
31
  connection: Connection;
32
32
  }
33
33
  export type ResponseType = 'arraybuffer' | 'blob' | 'document' | 'json' | 'text' | 'stream';
34
34
  export interface InternalProxyConfiguration {
35
- provider: string;
35
+ providerName: string;
36
36
  connection: Connection;
37
- existingActivityLogId?: number | null;
37
+ existingActivityLogId?: string | null | undefined;
38
38
  }
39
39
  export interface RetryHeaderConfig {
40
40
  at?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nangohq/types",
3
- "version": "0.42.10",
3
+ "version": "0.42.12",
4
4
  "description": "Types used in Nango applications",
5
5
  "type": "module",
6
6
  "typings": "dist/index.d.ts",