@nangohq/types 0.42.13 → 0.42.14

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/api.d.ts CHANGED
@@ -11,7 +11,7 @@ export interface ValidationError {
11
11
  message: string;
12
12
  path: (string | number)[];
13
13
  }
14
- export type ResDefaultErrors = ApiError<'not_found'> | ApiError<'invalid_query_params', ValidationError[]> | ApiError<'invalid_body', ValidationError[]> | ApiError<'invalid_uri_params', ValidationError[]> | ApiError<'feature_disabled'> | ApiError<'missing_auth_header'> | ApiError<'generic_error_support', undefined, string> | ApiError<'server_error'> | ApiError<'resource_capped'>;
14
+ export type ResDefaultErrors = ApiError<'not_found'> | ApiError<'invalid_query_params', ValidationError[]> | ApiError<'invalid_body', ValidationError[]> | ApiError<'invalid_uri_params', ValidationError[]> | ApiError<'feature_disabled'> | ApiError<'generic_error_support', undefined, string> | ApiError<'server_error'> | ApiError<'resource_capped'> | ApiError<'missing_auth_header'> | ApiError<'malformed_auth_header'> | ApiError<'unknown_account'> | ApiError<'unknown_connect_session_token'>;
15
15
  export type EndpointMethod = 'GET' | 'POST' | 'PATCH' | 'PUT' | 'DELETE';
16
16
  /**
17
17
  * API Request/Response type
@@ -10,8 +10,9 @@ import type { GetUser, PatchUser } from './user/api';
10
10
  import type { DeletePublicIntegration, GetPublicIntegration, GetPublicListIntegrations, GetPublicListIntegrationsLegacy } from './integration/api';
11
11
  import type { PostPublicTableauAuthorization, PostPublicTbaAuthorization, PostPublicUnauthenticatedAuthorization } from './auth/http.api';
12
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;
13
+ import type { PostConnectSessions, PostInternalConnectSessions } from './connect/api';
14
+ export type PublicApiEndpoints = SetMetadata | UpdateMetadata | PostDeploy | PostDeployConfirmation | PostPublicTbaAuthorization | PostPublicTableauAuthorization | PostPublicUnauthenticatedAuthorization | GetPublicProviders | GetPublicProvider | GetPublicListIntegrationsLegacy | GetPublicListIntegrations | GetPublicIntegration | DeletePublicIntegration | PostConnectSessions;
15
+ export type PrivateApiEndpoints = PostSignup | PostSignin | GetTeam | PutTeam | GetUser | PatchUser | PostInvite | DeleteInvite | DeleteTeamUser | PostInsights | PostForgotPassword | PutResetPassword | SearchOperations | GetOperation | SearchMessages | SearchFilters | GetOnboardingStatus | PostInternalConnectSessions;
15
16
  export type APIEndpoints = PrivateApiEndpoints | PublicApiEndpoints;
16
17
  /**
17
18
  * Automatically narrow endpoints type with Method + Path
@@ -0,0 +1,57 @@
1
+ import type { Endpoint } from '../api.js';
2
+ export type PostConnectSessions = Endpoint<{
3
+ Method: 'POST';
4
+ Path: '/connect/sessions';
5
+ Body: {
6
+ end_user: {
7
+ id: string;
8
+ email: string;
9
+ display_name?: string | undefined;
10
+ };
11
+ organization?: {
12
+ id: string;
13
+ display_name?: string | undefined;
14
+ } | undefined;
15
+ allowed_integrations?: string[] | undefined;
16
+ integrations_config_defaults?: Record<string, {
17
+ connection_config: Record<string, unknown>;
18
+ }> | undefined;
19
+ };
20
+ Success: {
21
+ data: {
22
+ token: string;
23
+ expires_at: Date;
24
+ };
25
+ };
26
+ }>;
27
+ export type GetConnectSession = Endpoint<{
28
+ Method: 'GET';
29
+ Path: '/connect/session';
30
+ Success: {
31
+ data: {
32
+ allowed_integrations?: string[] | undefined;
33
+ integrations_config_defaults?: Record<string, {
34
+ connection_config: Record<string, unknown>;
35
+ }> | undefined;
36
+ end_user: {
37
+ id: string;
38
+ email: string;
39
+ display_name?: string | undefined;
40
+ };
41
+ organization?: {
42
+ id: string;
43
+ display_name?: string | undefined;
44
+ } | undefined;
45
+ };
46
+ };
47
+ }>;
48
+ export type DeleteConnectSession = Endpoint<{
49
+ Method: 'DELETE';
50
+ Path: '/connect/session';
51
+ Success: never;
52
+ }>;
53
+ export type PostInternalConnectSessions = Endpoint<{
54
+ Method: 'POST';
55
+ Path: '/api/v1/connect/sessions';
56
+ Success: PostConnectSessions['Success'];
57
+ }>;
@@ -0,0 +1,12 @@
1
+ export interface ConnectSession {
2
+ readonly id: number;
3
+ readonly endUserId: number;
4
+ readonly accountId: number;
5
+ readonly environmentId: number;
6
+ readonly allowedIntegrations?: string[] | null;
7
+ readonly integrationsConfigDefaults?: Record<string, {
8
+ connectionConfig: Record<string, unknown>;
9
+ }> | null;
10
+ readonly createdAt: Date;
11
+ readonly updatedAt: Date | null;
12
+ }
@@ -0,0 +1,14 @@
1
+ export interface EndUser {
2
+ readonly id: number;
3
+ readonly endUserId: string;
4
+ readonly accountId: number;
5
+ readonly environmentId: number;
6
+ readonly email: string;
7
+ readonly displayName?: string | null;
8
+ readonly organization?: {
9
+ readonly organizationId: string;
10
+ readonly displayName?: string | null;
11
+ } | null;
12
+ readonly createdAt: Date;
13
+ readonly updatedAt: Date | null;
14
+ }
package/dist/index.d.ts CHANGED
@@ -35,6 +35,9 @@ export type * from './auth/db.js';
35
35
  export type * from './auth/http.api.js';
36
36
  export type * from './deploy/api.js';
37
37
  export type * from './deploy/incomingFlow.js';
38
+ export type * from './connect/api.js';
39
+ export type * from './connect/session.js';
40
+ export type * from './endUser/index.js';
38
41
  export type * from './nangoYaml/index.js';
39
42
  export type * from './environment/db.js';
40
43
  export type * from './environment/api/webhook.js';
@@ -9,6 +9,7 @@ import type { JSONSchema7 } from 'json-schema';
9
9
  import type { SyncType } from '../scripts/syncs/api';
10
10
  export type ApiPublicIntegration = Merge<Pick<IntegrationConfig, 'created_at' | 'updated_at' | 'unique_key' | 'provider'>, ApiTimestamps> & {
11
11
  logo: string;
12
+ display_name: string;
12
13
  } & ApiPublicIntegrationInclude;
13
14
  export interface ApiPublicIntegrationInclude {
14
15
  webhook_url?: string | null;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="node" />
2
- export type EntityType = 'session' | 'connection' | 'environment';
2
+ export type EntityType = 'connect_session' | 'connection' | 'environment';
3
3
  export interface PrivateKey {
4
4
  readonly id: number;
5
5
  readonly displayName: string;
@@ -18,6 +18,19 @@ export interface ProviderAlias {
18
18
  base_url?: string;
19
19
  };
20
20
  }
21
+ export interface SimplifiedJSONSchema {
22
+ type: 'string';
23
+ title: string;
24
+ description: string;
25
+ example?: string;
26
+ pattern?: string;
27
+ format?: string;
28
+ order: number;
29
+ default_value?: string;
30
+ hidden?: string;
31
+ suffix?: string;
32
+ doc_section?: string;
33
+ }
21
34
  export interface BaseProvider {
22
35
  display_name: string;
23
36
  auth_mode: AuthModeType;
@@ -49,12 +62,15 @@ export interface BaseProvider {
49
62
  redirect_uri_metadata?: string[];
50
63
  token_response_metadata?: string[];
51
64
  docs: string;
65
+ docs_connect?: string;
52
66
  token_expiration_buffer?: number;
53
67
  webhook_routing_script?: string;
54
68
  webhook_user_defined_secret?: boolean;
55
69
  post_connection_script?: string;
56
70
  categories?: string[];
57
71
  connection_configuration?: string[];
72
+ connection_config?: Record<string, SimplifiedJSONSchema>;
73
+ credentials?: Record<string, SimplifiedJSONSchema>;
58
74
  }
59
75
  export interface ProviderOAuth2 extends BaseProvider {
60
76
  auth_mode: 'OAUTH2' | 'CUSTOM';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nangohq/types",
3
- "version": "0.42.13",
3
+ "version": "0.42.14",
4
4
  "description": "Types used in Nango applications",
5
5
  "type": "module",
6
6
  "typings": "dist/index.d.ts",