@nangohq/types 0.69.5 → 0.69.7

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/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;
@@ -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';
@@ -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.5",
3
+ "version": "0.69.7",
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
- }