@nangohq/types 0.47.1 → 0.48.1

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.
@@ -11,10 +11,11 @@ import type { DeleteIntegration, DeletePublicIntegration, GetIntegration, GetInt
11
11
  import type { PostPublicTableauAuthorization, PostPublicTbaAuthorization, PostPublicUnauthenticatedAuthorization, PostPublicJwtAuthorization, PostPublicBillAuthorization, PostPublicSignatureAuthorization, PostPublicTwoStepAuthorization, PostPublicApiKeyAuthorization, PostPublicBasicAuthorization, PostPublicAppStoreAuthorization } from './auth/http.api';
12
12
  import type { GetPublicProvider, GetPublicProviders } from './providers/api';
13
13
  import type { DeleteConnectSession, GetConnectSession, PostConnectSessions, PostInternalConnectSessions, PostPublicConnectSessionsReconnect } from './connect/api';
14
- import type { DeletePublicConnection, GetConnection, GetConnections, GetConnectionsCount, GetPublicConnections, PostConnectionRefresh } from './connection/api/get';
14
+ import type { DeletePublicConnection, GetConnection, GetConnections, GetConnectionsCount, GetPublicConnection, GetPublicConnections, PostConnectionRefresh } from './connection/api/get';
15
15
  import type { GetMeta } from './meta/api';
16
16
  import type { PatchFlowDisable, PatchFlowEnable, PatchFlowFrequency, PostPreBuiltDeploy, PutUpgradePreBuiltFlow } from './flow/http.api';
17
- export type PublicApiEndpoints = SetMetadata | UpdateMetadata | PostDeploy | PostDeployConfirmation | PostPublicTbaAuthorization | PostPublicTableauAuthorization | PostPublicJwtAuthorization | PostPublicUnauthenticatedAuthorization | PostPublicApiKeyAuthorization | PostPublicBasicAuthorization | PostPublicAppStoreAuthorization | GetPublicProviders | GetPublicProvider | GetPublicListIntegrationsLegacy | GetPublicListIntegrations | GetPublicIntegration | DeletePublicIntegration | PostConnectSessions | PostPublicConnectSessionsReconnect | GetPublicConnections | GetConnectSession | DeleteConnectSession | PostDeployInternal | PostPublicBillAuthorization | DeletePublicConnection | PostPublicSignatureAuthorization | PostPublicTwoStepAuthorization;
17
+ import type { PostPublicWebhook } from './webhooks/http.api';
18
+ export type PublicApiEndpoints = SetMetadata | UpdateMetadata | PostDeploy | PostDeployConfirmation | PostPublicTbaAuthorization | PostPublicTableauAuthorization | PostPublicJwtAuthorization | PostPublicUnauthenticatedAuthorization | PostPublicApiKeyAuthorization | PostPublicBasicAuthorization | PostPublicAppStoreAuthorization | GetPublicProviders | GetPublicProvider | GetPublicListIntegrationsLegacy | GetPublicListIntegrations | GetPublicIntegration | DeletePublicIntegration | PostConnectSessions | PostPublicConnectSessionsReconnect | GetPublicConnections | GetPublicConnection | GetConnectSession | DeleteConnectSession | PostDeployInternal | PostPublicBillAuthorization | DeletePublicConnection | PostPublicSignatureAuthorization | PostPublicTwoStepAuthorization | PostPublicWebhook;
18
19
  export type PrivateApiEndpoints = PostSignup | PostSignin | GetTeam | PutTeam | GetUser | PatchUser | PostInvite | DeleteInvite | DeleteTeamUser | PostInsights | PostForgotPassword | PutResetPassword | SearchOperations | GetOperation | SearchMessages | SearchFilters | PatchOnboarding | PostInternalConnectSessions | GetIntegrationFlows | DeleteIntegration | PatchIntegration | GetIntegration | PostIntegration | GetConnections | GetConnectionsCount | GetConnection | GetInvite | GetMeta | GetEmailByExpiredToken | GetEmailByUuid | GetManagedCallback | PatchFlowDisable | PatchFlowEnable | PatchFlowFrequency | PutUpgradePreBuiltFlow | PostConnectionRefresh | PostManagedSignup | PostPreBuiltDeploy;
19
20
  export type APIEndpoints = PrivateApiEndpoints | PublicApiEndpoints;
20
21
  /**
@@ -3,12 +3,13 @@ import type { DBConnection } from '../db.js';
3
3
  import type { ActiveLog } from '../../notification/active-logs/db.js';
4
4
  import type { Merge } from 'type-fest';
5
5
  import type { ApiEndUser } from '../../endUser/index.js';
6
+ import type { AllAuthCredentials } from '../../auth/api.js';
6
7
  export type ApiConnectionSimple = Pick<Merge<DBConnection, ApiTimestamps>, 'id' | 'connection_id' | 'provider_config_key' | 'created_at' | 'updated_at'> & {
7
8
  provider: string;
8
- errors: [{
9
+ errors: {
9
10
  type: string;
10
11
  log_id: string;
11
- }];
12
+ }[];
12
13
  endUser: ApiEndUser | null;
13
14
  };
14
15
  export type GetConnections = Endpoint<{
@@ -44,16 +45,19 @@ export type ApiPublicConnection = Pick<DBConnection, 'id' | 'connection_id' | 'p
44
45
  created: string;
45
46
  metadata: Record<string, unknown> | null;
46
47
  provider: string;
47
- errors: [{
48
+ errors: {
48
49
  type: string;
49
50
  log_id: string;
50
- }];
51
+ }[];
52
+ end_user: ApiEndUser | null;
51
53
  };
52
54
  export type GetPublicConnections = Endpoint<{
53
55
  Method: 'GET';
54
56
  Querystring: {
55
57
  connectionId?: string | undefined;
56
58
  search?: string | undefined;
59
+ endUserId?: string | undefined;
60
+ endUserOrganizationId?: string | undefined;
57
61
  };
58
62
  Path: '/connection';
59
63
  Success: {
@@ -81,6 +85,33 @@ export type GetConnection = Endpoint<{
81
85
  };
82
86
  };
83
87
  }>;
88
+ export type ApiPublicConnectionFull = Pick<DBConnection, 'id' | 'connection_id' | 'provider_config_key' | 'connection_config'> & {
89
+ created_at: string;
90
+ updated_at: string;
91
+ last_fetched_at: string;
92
+ metadata: Record<string, unknown> | null;
93
+ provider: string;
94
+ errors: {
95
+ type: string;
96
+ log_id: string;
97
+ }[];
98
+ end_user: ApiEndUser | null;
99
+ credentials: AllAuthCredentials;
100
+ };
101
+ export type GetPublicConnection = Endpoint<{
102
+ Method: 'GET';
103
+ Params: {
104
+ connectionId: string;
105
+ };
106
+ Querystring: {
107
+ provider_config_key: string;
108
+ refresh_token?: boolean | undefined;
109
+ force_refresh?: boolean | undefined;
110
+ };
111
+ Path: '/connection/:connectionId';
112
+ Error: ApiError<'unknown_provider_config'>;
113
+ Success: ApiPublicConnectionFull;
114
+ }>;
84
115
  export type PostConnectionRefresh = Endpoint<{
85
116
  Method: 'POST';
86
117
  Params: {
package/dist/index.d.ts CHANGED
@@ -47,6 +47,7 @@ export type * from './environment/db.js';
47
47
  export type * from './environment/api/webhook.js';
48
48
  export type * from './environment/api/otlp.js';
49
49
  export type * from './webhooks/api.js';
50
+ export type * from './webhooks/http.api.js';
50
51
  export type * from './flow/http.api.js';
51
52
  export type * from './utils.js';
52
53
  export type * from './web/env.js';
@@ -0,0 +1,11 @@
1
+ import type { ApiError, Endpoint } from '../api';
2
+ export type PostPublicWebhook = Endpoint<{
3
+ Method: 'POST';
4
+ Path: '/webhook/:environmentUuid/:providerConfigKey';
5
+ Params: {
6
+ environmentUuid: string;
7
+ providerConfigKey: string;
8
+ };
9
+ Error: ApiError<'unknown_environment'> | ApiError<'unknown_provider_config'>;
10
+ Success: any;
11
+ }>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nangohq/types",
3
- "version": "0.47.1",
3
+ "version": "0.48.1",
4
4
  "description": "Types used in Nango applications",
5
5
  "type": "module",
6
6
  "typings": "dist/index.d.ts",