@nangohq/types 0.69.4 → 0.69.6

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.
@@ -38,6 +38,7 @@ export type PostConnectSessions = Endpoint<{
38
38
  Success: {
39
39
  data: {
40
40
  token: string;
41
+ connect_link: string;
41
42
  expires_at: string;
42
43
  };
43
44
  };
@@ -56,6 +57,7 @@ export type PostPublicConnectSessionsReconnect = Endpoint<{
56
57
  Success: {
57
58
  data: {
58
59
  token: string;
60
+ connect_link: string;
59
61
  expires_at: string;
60
62
  };
61
63
  };
package/dist/index.d.ts CHANGED
@@ -30,8 +30,7 @@ export type * from './sharedCredentials/db.js';
30
30
  export type * from './sharedCredentials/dto.js';
31
31
  export type * from './billing/types.js';
32
32
  export type * from './billing/http.api.js';
33
- export type * from './usage/dto.js';
34
- export type * from './usage/db.js';
33
+ export type * from './usage/index.js';
35
34
  export type * from './providers/api.js';
36
35
  export type * from './proxy/api.js';
37
36
  export type * from './result.js';
@@ -2,7 +2,7 @@ import type { Timestamps } from '../db.js';
2
2
  export interface DBPlan extends Timestamps {
3
3
  id: number;
4
4
  account_id: number;
5
- name: 'free' | 'starter' | 'starter-legacy' | 'growth' | 'scale-legacy' | 'growth-legacy' | 'enterprise';
5
+ name: 'free' | 'starter-v2' | 'growth-v2' | 'enterprise' | 'starter' | 'growth' | 'starter-legacy' | 'scale-legacy' | 'growth-legacy';
6
6
  stripe_customer_id: string | null;
7
7
  stripe_payment_id: string | null;
8
8
  orb_customer_id: string | null;
@@ -43,11 +43,11 @@ export interface DBPlan extends Timestamps {
43
43
  * @default null
44
44
  */
45
45
  function_compute_gbms_max: number | null;
46
- /** Limit the number of external webhooks that can be triggered in a month
46
+ /** Limit the number of webhook forwards that can happen in a month
47
47
  * Set to null to remove limit
48
48
  * @default null
49
49
  */
50
- external_webhooks_max: number | null;
50
+ webhook_forwards_max: number | null;
51
51
  /** Limit the number of log entries in functions that can be created in a month
52
52
  * Set to null to remove limit
53
53
  * @default null
@@ -1,5 +1,5 @@
1
1
  import type { BillingCustomer, BillingUsageMetric } from '../billing/types.js';
2
- import type { MetricUsageSummary } from '../usage/dto.js';
2
+ import type { MetricUsageSummary } from '../usage/index.js';
3
3
  import type { ReplaceInObject } from '../utils.js';
4
4
  import type { DBPlan } from './db.js';
5
5
  import type { Endpoint } from '../api.js';
@@ -17,6 +17,9 @@ export type PostPlanExtendTrial = Endpoint<{
17
17
  };
18
18
  }>;
19
19
  export interface PlanDefinition {
20
+ /**
21
+ * Maps to orb external plan id
22
+ */
20
23
  code: DBPlan['name'];
21
24
  title: string;
22
25
  description: string;
@@ -24,22 +27,9 @@ export interface PlanDefinition {
24
27
  nextPlan: string[] | null;
25
28
  prevPlan: string[] | null;
26
29
  basePrice?: number;
27
- /**
28
- * OrbId is the custom external_plan_id that we can setup
29
- * It's handy because you can set the same id in staging and prod
30
- */
31
- orbId?: string;
32
30
  cta?: string;
33
31
  hidden?: boolean;
34
- flags: Omit<Partial<DBPlan>, 'id' | 'account_id'>;
35
- display?: {
36
- featuresHeading?: string;
37
- features: {
38
- title: string;
39
- sub?: string;
40
- }[];
41
- sub?: string;
42
- };
32
+ flags: Omit<Partial<DBPlan>, 'id' | 'account_id' | 'name'>;
43
33
  }
44
34
  export type GetPlans = Endpoint<{
45
35
  Method: 'GET';
@@ -8,14 +8,15 @@ export type PostStripeCollectPayment = Endpoint<{
8
8
  };
9
9
  };
10
10
  }>;
11
+ export interface StripePaymentMethod {
12
+ id: string;
13
+ last4: string;
14
+ }
11
15
  export type GetStripePaymentMethods = Endpoint<{
12
16
  Method: 'GET';
13
17
  Path: '/api/v1/stripe/payment_methods';
14
18
  Success: {
15
- data: {
16
- id: string;
17
- last4: string;
18
- }[];
19
+ data: StripePaymentMethod[];
19
20
  };
20
21
  }>;
21
22
  export type DeleteStripePayment = Endpoint<{
@@ -0,0 +1,6 @@
1
+ export type UsageMetric = 'proxy' | 'connections' | 'function_executions' | 'function_compute_gbms' | 'records' | 'webhook_forwards' | 'function_logs';
2
+ export interface MetricUsageSummary {
3
+ label: string;
4
+ usage: number;
5
+ limit: number | null;
6
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nangohq/types",
3
- "version": "0.69.4",
3
+ "version": "0.69.6",
4
4
  "description": "Types used in Nango applications",
5
5
  "type": "module",
6
6
  "typings": "dist/index.d.ts",
@@ -1,9 +0,0 @@
1
- export interface DBAccountUsage {
2
- id: number;
3
- account_id: number;
4
- month: Date;
5
- actions: number;
6
- active_records: number;
7
- created_at: string;
8
- updated_at: string;
9
- }
@@ -1,19 +0,0 @@
1
- import type { DBAccountUsage } from './db.js';
2
- export interface CreateAccountUsageDto {
3
- accountId: DBAccountUsage['account_id'];
4
- month: DBAccountUsage['month'];
5
- actions?: DBAccountUsage['actions'];
6
- activeRecords?: DBAccountUsage['active_records'];
7
- }
8
- export interface UpdateAccountUsageDto {
9
- actions?: DBAccountUsage['actions'];
10
- activeRecords?: DBAccountUsage['active_records'];
11
- }
12
- export type AccountUsageIncrementableMetric = 'actions' | 'active_records';
13
- export type AccountUsageMetric = AccountUsageIncrementableMetric | 'connections';
14
- export type AccountMetricsUsageSummary = Record<AccountUsageMetric, MetricUsageSummary>;
15
- export interface MetricUsageSummary {
16
- label: string;
17
- usage: number;
18
- limit: number | null;
19
- }