@nangohq/types 0.42.8 → 0.42.9

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'>;
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'>;
15
15
  export type EndpointMethod = 'GET' | 'POST' | 'PATCH' | 'PUT' | 'DELETE';
16
16
  /**
17
17
  * API Request/Response type
@@ -19,3 +19,32 @@ export type GetConnection = Endpoint<{
19
19
  errorLog: ActiveLog | null;
20
20
  };
21
21
  }>;
22
+ export type DeletePublicConnection = Endpoint<{
23
+ Method: 'DELETE';
24
+ Path: '/connection/:connectionId';
25
+ Params: {
26
+ connectionId: string;
27
+ };
28
+ Querystring: {
29
+ provider_config_key: string;
30
+ };
31
+ Error: ApiError<'unknown_connection'> | ApiError<'unknown_provider_config'>;
32
+ Success: {
33
+ success: boolean;
34
+ };
35
+ }>;
36
+ export type DeleteConnection = Endpoint<{
37
+ Method: 'DELETE';
38
+ Path: '/connection/:connectionId';
39
+ Params: {
40
+ connectionId: string;
41
+ };
42
+ Querystring: {
43
+ provider_config_key: string;
44
+ env: string;
45
+ };
46
+ Error: ApiError<'unknown_connection'> | ApiError<'unknown_provider_config'>;
47
+ Success: {
48
+ success: boolean;
49
+ };
50
+ }>;
@@ -26,7 +26,7 @@ export type PostPreBuiltDeploy = Endpoint<{
26
26
  scriptName: string;
27
27
  type: ScriptTypeLiteral;
28
28
  };
29
- Error: ApiError<'unknown_provider'> | ApiError<'resource_capped'> | ApiError<'failed_to_deploy', Error[]> | ApiError<'unknown_flow'>;
29
+ Error: ApiError<'unknown_provider'> | ApiError<'failed_to_deploy', Error[]> | ApiError<'unknown_flow'>;
30
30
  Success: {
31
31
  data: {
32
32
  id: number;
package/dist/index.d.ts CHANGED
@@ -20,6 +20,7 @@ export type * from './proxy/api.js';
20
20
  export type * from './environment/db.js';
21
21
  export type * from './scripts/post-connection/db.js';
22
22
  export type * from './scripts/syncs/api.js';
23
+ export type * from './slackNotifications/db.js';
23
24
  export type * from './notification/active-logs/db.js';
24
25
  export type * from './connection/api/get.js';
25
26
  export type * from './integration/api.js';
@@ -1,8 +1,10 @@
1
1
  import type { Endpoint } from '../api';
2
2
  import type { MessageRow, MessageState, OperationList, OperationRow } from './messages';
3
- type Concat<T extends OperationList> = T[keyof T] | (T extends {
3
+ type Concat<T extends OperationList> = T extends {
4
4
  action: string;
5
- } ? `${T['type']}:${T['action']}` : never);
5
+ } ? `${T['type']}:${T['action']}` : never;
6
+ export type ConcatOperationList = Concat<OperationList>;
7
+ export type ConcatOperationListWithGroup = OperationList[keyof OperationList] | ConcatOperationList;
6
8
  export type SearchOperations = Endpoint<{
7
9
  Method: 'POST';
8
10
  Path: '/api/v1/logs/operations';
@@ -28,7 +30,7 @@ export type SearchOperations = Endpoint<{
28
30
  };
29
31
  }>;
30
32
  export type SearchOperationsState = 'all' | MessageState;
31
- export type SearchOperationsType = 'all' | Concat<OperationList>;
33
+ export type SearchOperationsType = 'all' | ConcatOperationListWithGroup;
32
34
  export type SearchOperationsIntegration = 'all' | string;
33
35
  export type SearchOperationsConnection = 'all' | string;
34
36
  export type SearchOperationsSync = 'all' | string;
@@ -31,9 +31,11 @@ export interface OperationSync {
31
31
  }
32
32
  export interface OperationProxy {
33
33
  type: 'proxy';
34
+ action: 'call';
34
35
  }
35
36
  export interface OperationAction {
36
37
  type: 'action';
38
+ action: 'run';
37
39
  }
38
40
  export interface OperationAuth {
39
41
  type: 'auth';
@@ -113,11 +115,11 @@ export interface MessageRow {
113
115
  /**
114
116
  * What is required to insert a Message
115
117
  */
116
- export type OperationRowInsert = Merge<Partial<MessageRow>, {
117
- message: string;
118
+ export type OperationRowInsert = Omit<Merge<Partial<MessageRow>, {
118
119
  operation: OperationList;
119
- }>;
120
+ }>, 'message'>;
120
121
  export type OperationRow = Merge<Required<OperationRowInsert>, {
122
+ message: string;
121
123
  accountId: number;
122
124
  accountName: string;
123
125
  }>;
@@ -127,5 +129,4 @@ export type OperationRow = Merge<Required<OperationRowInsert>, {
127
129
  export type MessageRowInsert = Pick<MessageRow, 'type' | 'message'> & Partial<Omit<MessageRow, 'type' | 'message'>> & {
128
130
  id?: never;
129
131
  };
130
- export type LogsBuffer = Pick<MessageRow, 'level' | 'message' | 'createdAt'> & Partial<Pick<MessageRow, 'error' | 'meta' | 'type' | 'request' | 'response'>>;
131
132
  export type MessageOrOperationRow = MessageRow | OperationRow;
@@ -0,0 +1,11 @@
1
+ import type { Timestamps } from '../db';
2
+ export interface DBSlackNotification extends Timestamps {
3
+ id: number;
4
+ open: boolean;
5
+ environment_id: number;
6
+ name: string;
7
+ type: string;
8
+ connection_list: number[];
9
+ slack_timestamp: string | null;
10
+ admin_slack_timestamp: string | null;
11
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nangohq/types",
3
- "version": "0.42.8",
3
+ "version": "0.42.9",
4
4
  "description": "Types used in Nango applications",
5
5
  "type": "module",
6
6
  "typings": "dist/index.d.ts",