@nangohq/types 0.71.2 → 0.71.4

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.
Files changed (53) hide show
  1. package/dist/account/api.d.ts +100 -19
  2. package/dist/action/api.d.ts +21 -5
  3. package/dist/admin/http.api.d.ts +8 -2
  4. package/dist/api-keys/auth.d.ts +38 -0
  5. package/dist/api-keys/scopes.d.ts +3 -1
  6. package/dist/api.d.ts +7 -0
  7. package/dist/api.endpoints.d.ts +7 -6
  8. package/dist/audit-trail/api.d.ts +41 -0
  9. package/dist/audit-trail/event.d.ts +56 -0
  10. package/dist/auth/api.d.ts +2 -10
  11. package/dist/auth/http.api.d.ts +50 -26
  12. package/dist/authz/types.d.ts +1 -1
  13. package/dist/billing/http.api.d.ts +6 -2
  14. package/dist/cli/api.d.ts +6 -2
  15. package/dist/clientMetadata/http.api.d.ts +6 -2
  16. package/dist/connect/api.d.ts +36 -7
  17. package/dist/connectUISettings/api.d.ts +11 -3
  18. package/dist/connection/api/get.d.ts +39 -12
  19. package/dist/connection/api/metadata.d.ts +8 -4
  20. package/dist/db.d.ts +5 -0
  21. package/dist/deploy/api.d.ts +14 -4
  22. package/dist/environment/api/index.d.ts +34 -11
  23. package/dist/environment/api/otlp.d.ts +6 -2
  24. package/dist/environment/api/webhook.d.ts +4 -2
  25. package/dist/environment/variable/api.d.ts +4 -2
  26. package/dist/flow/http.api.d.ts +17 -7
  27. package/dist/function/config.d.ts +65 -0
  28. package/dist/function/db.d.ts +39 -0
  29. package/dist/functions/api.d.ts +141 -17
  30. package/dist/gettingStarted/api.d.ts +11 -3
  31. package/dist/index.d.ts +7 -3
  32. package/dist/integration/api.d.ts +52 -15
  33. package/dist/invitations/api.d.ts +15 -6
  34. package/dist/logs/api.d.ts +26 -6
  35. package/dist/mcp/api.d.ts +21 -5
  36. package/dist/meta/api.d.ts +7 -2
  37. package/dist/mfa/api.d.ts +35 -6
  38. package/dist/plain/api.d.ts +6 -2
  39. package/dist/plans/http.api.d.ts +33 -9
  40. package/dist/providers/api.d.ts +21 -5
  41. package/dist/providers/provider.d.ts +4 -7
  42. package/dist/proxy/http.api.d.ts +6 -2
  43. package/dist/pubsub/events.d.ts +3 -1
  44. package/dist/record/api.d.ts +21 -5
  45. package/dist/scripts/http.api.d.ts +6 -2
  46. package/dist/stripe/http.api.d.ts +16 -5
  47. package/dist/sync/api.d.ts +22 -8
  48. package/dist/team/api.d.ts +18 -6
  49. package/dist/user/api.d.ts +11 -4
  50. package/dist/user/db.d.ts +2 -0
  51. package/dist/webhooks/http.api.d.ts +6 -2
  52. package/package.json +1 -1
  53. package/dist/functions/capabilities.d.ts +0 -7
@@ -1,4 +1,4 @@
1
- import type { ApiError, Endpoint } from '../api.js';
1
+ import type { ApiEndpoint, ApiError } from '../api.js';
2
2
  export type RecordLastAction = 'ADDED' | 'UPDATED' | 'DELETED' | 'added' | 'updated' | 'deleted';
3
3
  export type CombinedFilterAction = `${RecordLastAction},${RecordLastAction}`;
4
4
  export interface RecordMetadata {
@@ -21,7 +21,11 @@ export type MergingStrategy = {
21
21
  cursor?: string | undefined;
22
22
  };
23
23
  export type CursorOffset = 'first' | 'last';
24
- export type GetPublicRecords = Endpoint<{
24
+ export type GetPublicRecords = ApiEndpoint<{
25
+ Audit: {
26
+ kind: 'no-audit';
27
+ reason: 'non-auditable';
28
+ };
25
29
  Method: 'GET';
26
30
  Path: `/records`;
27
31
  Headers: {
@@ -44,7 +48,11 @@ export type GetPublicRecords = Endpoint<{
44
48
  records: NangoRecord[];
45
49
  };
46
50
  }>;
47
- export type PatchPublicPruneRecords = Endpoint<{
51
+ export type PatchPublicPruneRecords = ApiEndpoint<{
52
+ Audit: {
53
+ kind: 'no-audit';
54
+ reason: 'TODO: audit coverage pending';
55
+ };
48
56
  Method: 'PATCH';
49
57
  Path: `/records/prune`;
50
58
  Headers: {
@@ -70,7 +78,11 @@ export interface ConnectionRecordModel {
70
78
  size_bytes: number;
71
79
  updated_at: string;
72
80
  }
73
- export type GetConnectionRecordModels = Endpoint<{
81
+ export type GetConnectionRecordModels = ApiEndpoint<{
82
+ Audit: {
83
+ kind: 'no-audit';
84
+ reason: 'non-auditable';
85
+ };
74
86
  Method: 'GET';
75
87
  Path: '/api/v1/connections/:connectionId/records/models';
76
88
  Params: {
@@ -84,7 +96,11 @@ export type GetConnectionRecordModels = Endpoint<{
84
96
  data: ConnectionRecordModel[];
85
97
  };
86
98
  }>;
87
- export type GetConnectionRecords = Endpoint<{
99
+ export type GetConnectionRecords = ApiEndpoint<{
100
+ Audit: {
101
+ kind: 'no-audit';
102
+ reason: 'non-auditable';
103
+ };
88
104
  Method: 'GET';
89
105
  Path: '/api/v1/connections/:connectionId/records';
90
106
  Params: {
@@ -1,4 +1,4 @@
1
- import type { Endpoint } from '../api.js';
1
+ import type { ApiEndpoint } from '../api.js';
2
2
  import type { StandardNangoConfig } from '../flow/index.js';
3
3
  export interface OpenAIFunction {
4
4
  name: string;
@@ -12,7 +12,11 @@ export interface OpenAIFunction {
12
12
  required: string[];
13
13
  };
14
14
  }
15
- export type GetPublicScriptsConfig = Endpoint<{
15
+ export type GetPublicScriptsConfig = ApiEndpoint<{
16
+ Audit: {
17
+ kind: 'no-audit';
18
+ reason: 'non-auditable';
19
+ };
16
20
  Method: 'GET';
17
21
  Path: `/scripts/config`;
18
22
  Query: {
@@ -1,5 +1,7 @@
1
- import type { Endpoint } from '../api.js';
2
- export type PostStripeCollectPayment = Endpoint<{
1
+ import type { ApiEndpoint } from '../api.js';
2
+ import type { AuditPolicy } from '../audit-trail/event.js';
3
+ export type PostStripeCollectPayment = ApiEndpoint<{
4
+ Audit: AuditPolicy<'billing', 'payment_method_added', 'account'>;
3
5
  Method: 'POST';
4
6
  Path: '/api/v1/stripe/payment_methods';
5
7
  Success: {
@@ -12,14 +14,19 @@ export interface StripePaymentMethod {
12
14
  id: string;
13
15
  last4: string;
14
16
  }
15
- export type GetStripePaymentMethods = Endpoint<{
17
+ export type GetStripePaymentMethods = ApiEndpoint<{
18
+ Audit: {
19
+ kind: 'no-audit';
20
+ reason: 'non-auditable';
21
+ };
16
22
  Method: 'GET';
17
23
  Path: '/api/v1/stripe/payment_methods';
18
24
  Success: {
19
25
  data: StripePaymentMethod[];
20
26
  };
21
27
  }>;
22
- export type DeleteStripePayment = Endpoint<{
28
+ export type DeleteStripePayment = ApiEndpoint<{
29
+ Audit: AuditPolicy<'billing', 'payment_method_removed', 'account'>;
23
30
  Method: 'DELETE';
24
31
  Path: '/api/v1/stripe/payment_methods';
25
32
  Querystring: {
@@ -31,7 +38,11 @@ export type DeleteStripePayment = Endpoint<{
31
38
  };
32
39
  };
33
40
  }>;
34
- export type PostStripeWebhooks = Endpoint<{
41
+ export type PostStripeWebhooks = ApiEndpoint<{
42
+ Audit: {
43
+ kind: 'no-audit';
44
+ reason: 'non-auditable';
45
+ };
35
46
  Method: 'POST';
36
47
  Path: '/api/v1/stripe/webhooks';
37
48
  Body: any;
@@ -1,6 +1,11 @@
1
- import type { ApiError, Endpoint } from '../api.js';
1
+ import type { ApiEndpoint, ApiError } from '../api.js';
2
+ import type { AuditPolicy } from '../audit-trail/event.js';
2
3
  import type { ReportedSyncJobStatus } from './index.js';
3
- export type PostPublicTrigger = Endpoint<{
4
+ export type PostPublicTrigger = ApiEndpoint<{
5
+ Audit: {
6
+ kind: 'no-audit';
7
+ reason: 'TODO: audit coverage pending';
8
+ };
4
9
  Method: 'POST';
5
10
  Path: '/sync/trigger';
6
11
  Body: {
@@ -26,7 +31,8 @@ export type PostPublicTrigger = Endpoint<{
26
31
  };
27
32
  Error: ApiError<'missing_provider_config_key' | 'unknown_provider_config' | 'unknown_connection' | 'no_syncs_found'>;
28
33
  }>;
29
- export type PostSyncVariant = Endpoint<{
34
+ export type PostSyncVariant = ApiEndpoint<{
35
+ Audit: AuditPolicy<'sync', 'variant_created', 'environment'>;
30
36
  Method: 'POST';
31
37
  Path: '/sync/:name/variant/:variant';
32
38
  Body: {
@@ -44,7 +50,8 @@ export type PostSyncVariant = Endpoint<{
44
50
  variant: string;
45
51
  };
46
52
  }>;
47
- export type DeleteSyncVariant = Endpoint<{
53
+ export type DeleteSyncVariant = ApiEndpoint<{
54
+ Audit: AuditPolicy<'sync', 'variant_deleted', 'environment'>;
48
55
  Method: 'DELETE';
49
56
  Path: '/sync/:name/variant/:variant';
50
57
  Body: {
@@ -60,7 +67,8 @@ export type DeleteSyncVariant = Endpoint<{
60
67
  success: boolean;
61
68
  };
62
69
  }>;
63
- export type PutPublicSyncConnectionFrequency = Endpoint<{
70
+ export type PutPublicSyncConnectionFrequency = ApiEndpoint<{
71
+ Audit: AuditPolicy<'sync', 'frequency_changed', 'environment'>;
64
72
  Method: 'PUT';
65
73
  Path: '/sync/update-connection-frequency';
66
74
  Body: {
@@ -75,7 +83,8 @@ export type PutPublicSyncConnectionFrequency = Endpoint<{
75
83
  };
76
84
  Error: ApiError<'unknown_connection' | 'unknown_sync'>;
77
85
  }>;
78
- export type PostPublicSyncPause = Endpoint<{
86
+ export type PostPublicSyncPause = ApiEndpoint<{
87
+ Audit: AuditPolicy<'sync', 'paused', 'environment'>;
79
88
  Method: 'POST';
80
89
  Path: '/sync/pause';
81
90
  Body: {
@@ -91,7 +100,8 @@ export type PostPublicSyncPause = Endpoint<{
91
100
  };
92
101
  Error: ApiError<'no_syncs_found' | 'unknown_connection' | 'unknown_provider_config'>;
93
102
  }>;
94
- export type PostPublicSyncStart = Endpoint<{
103
+ export type PostPublicSyncStart = ApiEndpoint<{
104
+ Audit: AuditPolicy<'sync', 'started', 'environment'>;
95
105
  Method: 'POST';
96
106
  Path: '/sync/start';
97
107
  Body: {
@@ -107,7 +117,11 @@ export type PostPublicSyncStart = Endpoint<{
107
117
  };
108
118
  Error: ApiError<'no_syncs_found' | 'unknown_connection' | 'unknown_provider_config'>;
109
119
  }>;
110
- export type GetPublicSyncStatus = Endpoint<{
120
+ export type GetPublicSyncStatus = ApiEndpoint<{
121
+ Audit: {
122
+ kind: 'no-audit';
123
+ reason: 'non-auditable';
124
+ };
111
125
  Method: 'GET';
112
126
  Path: '/sync/status';
113
127
  Querystring: {
@@ -1,10 +1,15 @@
1
- import type { ApiError, ApiTimestamps, Endpoint } from '../api.js';
1
+ import type { ApiEndpoint, ApiError, ApiTimestamps } from '../api.js';
2
+ import type { AuditPolicy } from '../audit-trail/event.js';
2
3
  import type { DBInvitation } from '../invitations/db.js';
3
4
  import type { ApiUser } from '../user/api.js';
4
5
  import type { Role } from '../user/db.js';
5
6
  import type { DBTeam } from './db.js';
6
7
  import type { Merge } from 'type-fest';
7
- export type GetTeam = Endpoint<{
8
+ export type GetTeam = ApiEndpoint<{
9
+ Audit: {
10
+ kind: 'no-audit';
11
+ reason: 'non-auditable';
12
+ };
8
13
  Method: 'GET';
9
14
  Path: '/api/v1/team';
10
15
  Querystring: {
@@ -13,15 +18,20 @@ export type GetTeam = Endpoint<{
13
18
  Success: {
14
19
  data: {
15
20
  account: ApiTeam;
16
- users: ApiUser[];
21
+ users: ApiTeamUser[];
17
22
  invitedUsers: ApiInvitation[];
18
23
  isAdminTeam: boolean;
24
+ mfaFeatureEnabled: boolean;
19
25
  };
20
26
  };
21
27
  }>;
28
+ export interface ApiTeamUser extends ApiUser {
29
+ mfaEnabled: boolean;
30
+ }
22
31
  export type ApiInvitation = Merge<Omit<DBInvitation, 'token'>, ApiTimestamps>;
23
32
  export type ApiTeam = Merge<DBTeam, ApiTimestamps>;
24
- export type PutTeam = Endpoint<{
33
+ export type PutTeam = ApiEndpoint<{
34
+ Audit: AuditPolicy<'team', 'updated', 'account'>;
25
35
  Method: 'PUT';
26
36
  Path: '/api/v1/team';
27
37
  Querystring: {
@@ -34,7 +44,8 @@ export type PutTeam = Endpoint<{
34
44
  data: ApiTeam;
35
45
  };
36
46
  }>;
37
- export type DeleteTeamUser = Endpoint<{
47
+ export type DeleteTeamUser = ApiEndpoint<{
48
+ Audit: AuditPolicy<'member', 'removed', 'account'>;
38
49
  Method: 'DELETE';
39
50
  Path: '/api/v1/team/users/:id';
40
51
  Querystring: {
@@ -50,7 +61,8 @@ export type DeleteTeamUser = Endpoint<{
50
61
  };
51
62
  };
52
63
  }>;
53
- export type PatchTeamUser = Endpoint<{
64
+ export type PatchTeamUser = ApiEndpoint<{
65
+ Audit: AuditPolicy<'member', 'role_changed', 'account'>;
54
66
  Method: 'PATCH';
55
67
  Path: '/api/v1/team/users/:id';
56
68
  Querystring: {
@@ -1,6 +1,11 @@
1
- import type { Endpoint } from '../api.js';
1
+ import type { ApiEndpoint, Endpoint } from '../api.js';
2
+ import type { AuditPolicy } from '../audit-trail/event.js';
2
3
  import type { Role } from './db.js';
3
- export type GetUser = Endpoint<{
4
+ export type GetUser = ApiEndpoint<{
5
+ Audit: {
6
+ kind: 'no-audit';
7
+ reason: 'non-auditable';
8
+ };
4
9
  Method: 'GET';
5
10
  Path: `/api/v1/user`;
6
11
  Success: {
@@ -17,7 +22,8 @@ export type InternalGetUsers = Endpoint<{
17
22
  data: ApiUser[];
18
23
  };
19
24
  }>;
20
- export type PatchUser = Endpoint<{
25
+ export type PatchUser = ApiEndpoint<{
26
+ Audit: AuditPolicy<'user', 'updated', 'account'>;
21
27
  Method: 'PATCH';
22
28
  Path: `/api/v1/user`;
23
29
  Body: {
@@ -42,7 +48,8 @@ export type ApiUserWithPermissions = ApiUser & {
42
48
  role: Role;
43
49
  permissions: AllowedPermissions;
44
50
  };
45
- export type PutUserPassword = Endpoint<{
51
+ export type PutUserPassword = ApiEndpoint<{
52
+ Audit: AuditPolicy<'app_auth', 'password_changed', 'account'>;
46
53
  Method: 'PUT';
47
54
  Path: `/api/v1/user/password`;
48
55
  Body: {
package/dist/user/db.d.ts CHANGED
@@ -15,5 +15,7 @@ export interface DBUser extends Timestamps {
15
15
  email_verification_token_expires_at: Date | null;
16
16
  uuid: string;
17
17
  getting_started_closed: boolean;
18
+ account_discovery_pending: boolean;
19
+ account_invitation_requested_at: Date | null;
18
20
  role: Role;
19
21
  }
@@ -1,5 +1,9 @@
1
- import type { ApiError, Endpoint } from '../api.js';
2
- export type PostPublicWebhook = Endpoint<{
1
+ import type { ApiEndpoint, ApiError } from '../api.js';
2
+ export type PostPublicWebhook = ApiEndpoint<{
3
+ Audit: {
4
+ kind: 'no-audit';
5
+ reason: 'non-auditable';
6
+ };
3
7
  Method: 'POST';
4
8
  Path: '/webhook/:environmentUuid/:providerConfigKey';
5
9
  Params: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nangohq/types",
3
- "version": "0.71.2",
3
+ "version": "0.71.4",
4
4
  "description": "Types used in Nango applications",
5
5
  "type": "module",
6
6
  "typings": "dist/index.d.ts",
@@ -1,7 +0,0 @@
1
- export interface FunctionCapabilities {
2
- usesRecords: boolean;
3
- usesCheckpoints: boolean;
4
- usesMetadata: boolean;
5
- usesOutbound: boolean;
6
- usesInvoke: boolean;
7
- }