@nangohq/types 0.70.8 → 0.70.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.
@@ -4,9 +4,9 @@ import type { PostImpersonate } from './admin/http.api.js';
4
4
  import type { EndpointMethod } from './api.js';
5
5
  import type { PostPublicApiKeyAuthorization, PostPublicAppStoreAuthorization, PostPublicAwsSigV4Authorization, PostPublicBasicAuthorization, PostPublicBillAuthorization, PostPublicJwtAuthorization, PostPublicOauthOutboundAuthorization, PostPublicSignatureAuthorization, PostPublicTbaAuthorization, PostPublicTwoStepAuthorization, PostPublicUnauthenticatedAuthorization } from './auth/http.api.js';
6
6
  import type { DeleteConnectSession, GetConnectSession, PostConnectSessions, PostInternalConnectSessions, PostPublicConnectSessionsReconnect, PostPublicConnectTelemetry } from './connect/api.js';
7
- import type { GetConnectUISettings, PutConnectUISettings } from './connectUISettings/api.js';
8
7
  import type { DeletePublicConnection, GetConnection, GetConnections, GetConnectionsCount, GetPublicConnection, GetPublicConnections, PatchPublicConnection, PostConnectionRefresh, PostPublicConnection } from './connection/api/get.js';
9
8
  import type { SetMetadata, UpdateMetadata } from './connection/api/metadata.js';
9
+ import type { GetConnectUISettings, PutConnectUISettings } from './connectUISettings/api.js';
10
10
  import type { PostDeploy, PostDeployConfirmation, PostDeployInternal } from './deploy/api.js';
11
11
  import type { CreateApiKey, DeleteApiKey, DeleteEnvironment, GetEnvironment, GetEnvironments, ListApiKeys, PatchApiKey, PatchEnvironment, PostEnvironment } from './environment/api/index.js';
12
12
  import type { PatchWebhook } from './environment/api/webhook.js';
@@ -80,6 +80,7 @@ export interface BreakdownDimensions {
80
80
  webhook_forwards: 'environment_id' | 'integration_id' | 'connection_id' | 'success';
81
81
  records: 'environment_id' | 'integration_id' | 'connection_id' | 'model';
82
82
  connections: 'environment_id' | 'integration_id';
83
+ data_transfer: 'environment_id' | 'integration_id' | 'connection_id' | 'package' | 'callsite';
83
84
  }
84
85
  export type DimensionFor<M extends UsageMetric> = 'none' | BreakdownDimensions[M];
85
86
  export interface GetBillingUsageOpts {
@@ -120,9 +121,11 @@ export interface GetBillingUsageOpts {
120
121
  metrics?: UsageMetric[];
121
122
  /**
122
123
  * Per-metric row-level filter: scopes that metric's response to rows
123
- * where the given dimension equals the given value. Mutually exclusive
124
- * with `breakdown[<metric>]` on the same metric — controllers reject
125
- * the combination. CH path only; the Orb client ignores it.
124
+ * where the given dimension equals the given value. Composes with
125
+ * `breakdown[<metric>]` on the same metric when the dimensions differ
126
+ * (drill-in: filter to one value, re-break-down by another); controllers
127
+ * reject only the same-dimension pairing. CH path only; the Orb client
128
+ * ignores it.
126
129
  */
127
130
  filter?: {
128
131
  [M in UsageMetric]?: {
@@ -159,11 +162,11 @@ export interface BillingUsageMetric {
159
162
  * dimension-value series (carrying its own `group: {key, value}`), with
160
163
  * one 'rest' entry aggregating the long tail.
161
164
  *
162
- * Mutually exclusive with the top-level `usage`/`total`: when breakdown
163
- * is requested the top-level is empty (`usage: []`, `total: 0`) and only
164
- * `breakdown` carries data — callers asking for a breakdown opt into the
165
- * per-dim view. When breakdown is NOT requested, the top-level is the
166
- * no-dim global and this field is absent.
165
+ * Paired with the top-level `usage`/`total`: when a breakdown is requested
166
+ * the top-level `usage` is empty (the per-day points live under `breakdown`)
167
+ * and `total` is the sum across the top-N + 'rest' series, which partition
168
+ * every row — so it equals the (filtered) global. When breakdown is NOT
169
+ * requested, the top-level is the no-dim global and this is absent.
167
170
  */
168
171
  breakdown?: BillingUsageMetric[];
169
172
  }
@@ -1,8 +1,8 @@
1
1
  import type { ApiError, Endpoint } from '../api.js';
2
- import type { CLIDeployFlowConfig, OnEventScriptsByProvider } from './incomingFlow.js';
3
- import type { SyncDeploymentResult } from './index.js';
4
2
  import type { OnEventType } from '../scripts/on-events/api.js';
5
3
  import type { FunctionSource } from '../syncConfigs/db.js';
4
+ import type { CLIDeployFlowConfig, OnEventScriptsByProvider } from './incomingFlow.js';
5
+ import type { SyncDeploymentResult } from './index.js';
6
6
  import type { JSONSchema7 } from 'json-schema';
7
7
  export type PostDeployConfirmation = Endpoint<{
8
8
  Method: 'POST';
@@ -27,7 +27,6 @@ export type PostPreBuiltDeploy = Endpoint<{
27
27
  env: string;
28
28
  };
29
29
  Body: {
30
- provider: string;
31
30
  providerConfigKey: string;
32
31
  scriptName: string;
33
32
  type: ScriptTypeLiteral;
@@ -68,7 +68,7 @@ export type FunctionDryrunResultBody = {
68
68
  payload?: unknown;
69
69
  };
70
70
  };
71
- export interface FunctionDeploymentBody {
71
+ export interface FunctionDeploymentCodeBody {
72
72
  type: 'function';
73
73
  integration_id: string;
74
74
  function_name: string;
@@ -77,9 +77,24 @@ export interface FunctionDeploymentBody {
77
77
  version?: string | undefined;
78
78
  allow_destructive?: boolean | undefined;
79
79
  }
80
+ export interface FunctionDeploymentTemplateBody {
81
+ type: 'template';
82
+ integration_id: string;
83
+ template: string;
84
+ /** Optional; inferred from the template name unless a sync and an action share it. */
85
+ function_type?: RunnableFunctionType | undefined;
86
+ }
87
+ export interface FunctionDeploymentTemplateStoredRequest {
88
+ type: 'template';
89
+ integration_id: string;
90
+ template: string;
91
+ function_name: string;
92
+ function_type: RunnableFunctionType;
93
+ }
94
+ export type FunctionDeploymentBody = FunctionDeploymentCodeBody | FunctionDeploymentTemplateBody;
80
95
  export interface FunctionDeploymentCreateSuccess {
81
96
  id: string;
82
- status: Extract<FunctionDeploymentStatus, 'waiting' | 'running'>;
97
+ status: FunctionDeploymentStatus;
83
98
  created_at: string;
84
99
  }
85
100
  export interface FunctionDeploymentResultSuccess {
@@ -154,7 +169,7 @@ export type PostFunctionDeployment = Endpoint<{
154
169
  Method: 'POST';
155
170
  Path: '/functions/deployments';
156
171
  Body: FunctionDeploymentBody;
157
- Error: ApiError<FunctionErrorCode>;
172
+ Error: ApiError<FunctionErrorCode> | ApiError<'template_not_found' | 'ambiguous_function' | 'plan_limit' | 'template_already_deployed'>;
158
173
  Success: FunctionDeploymentCreateSuccess;
159
174
  }>;
160
175
  export type GetFunctionDeployment = Endpoint<{
@@ -1,5 +1,5 @@
1
- import type { GettingStartedOutput as GettingStartedProgressOutput, PatchGettingStartedInput as PatchGettingStartedProgressInput } from './dto.js';
2
1
  import type { ApiError, Endpoint } from '../api.js';
2
+ import type { GettingStartedOutput as GettingStartedProgressOutput, PatchGettingStartedInput as PatchGettingStartedProgressInput } from './dto.js';
3
3
  export type GetGettingStarted = Endpoint<{
4
4
  Method: 'GET';
5
5
  Path: '/api/v1/getting-started';
@@ -1,7 +1,7 @@
1
- import type { DBGettingStartedMeta, DBGettingStartedProgress } from './db.js';
2
1
  import type { DBConnection } from '../connection/db.js';
3
2
  import type { DBEnvironment } from '../environment/db.js';
4
3
  import type { IntegrationConfig } from '../integration/db.js';
4
+ import type { DBGettingStartedMeta, DBGettingStartedProgress } from './db.js';
5
5
  export interface GettingStartedOutput {
6
6
  meta: {
7
7
  environment: Pick<DBEnvironment, 'id' | 'name'>;
@@ -1,9 +1,9 @@
1
1
  import type { ApiError, ApiTimestamps, Endpoint } from '../api.js';
2
- import type { IntegrationConfig } from './db.js';
3
- import type { AuthModeType, AuthModes } from '../auth/api.js';
2
+ import type { AuthModes, AuthModeType } from '../auth/api.js';
4
3
  import type { NangoSyncConfig } from '../flow/index.js';
5
4
  import type { ScriptTypeLiteral } from '../nangoYaml/index.js';
6
5
  import type { Provider } from '../providers/provider.js';
6
+ import type { IntegrationConfig } from './db.js';
7
7
  import type { Merge } from 'type-fest';
8
8
  export type ApiPublicIntegration = Merge<Pick<IntegrationConfig, 'created_at' | 'updated_at' | 'unique_key' | 'provider' | 'display_name' | 'forward_webhooks'>, ApiTimestamps> & {
9
9
  logo: string;
@@ -1,8 +1,8 @@
1
- import type { DBPlan } from './db.js';
2
1
  import type { Endpoint } from '../api.js';
3
2
  import type { ApiBillingUsageMetrics, BillingCustomer, BillingInvoicingDetails, BreakdownDimensions } from '../billing/types.js';
4
3
  import type { MetricUsageSummary, UsageMetric } from '../usage/index.js';
5
4
  import type { ReplaceInObject } from '../utils.js';
5
+ import type { DBPlan } from './db.js';
6
6
  export type ApiPlan = ReplaceInObject<DBPlan, Date, string>;
7
7
  export type PostPlanExtendTrial = Endpoint<{
8
8
  Method: 'POST';
@@ -1,6 +1,6 @@
1
1
  import type { Endpoint } from '../api.js';
2
- import type { Provider, SimplifiedJSONSchema } from './provider.js';
3
2
  import type { AuthModeType } from '../auth/api.js';
3
+ import type { Provider, SimplifiedJSONSchema } from './provider.js';
4
4
  export type GetPublicProviders = Endpoint<{
5
5
  Method: 'GET';
6
6
  Path: `/providers`;
@@ -1,7 +1,7 @@
1
- import type { TelemetryBag } from './sdk.js';
2
1
  import type { CheckpointRange } from '../checkpoint/types.js';
3
2
  import type { DBPlan } from '../plans/db.js';
4
3
  import type { Feature } from '../syncConfigs/db.js';
4
+ import type { TelemetryBag } from './sdk.js';
5
5
  export interface RunnerOutputError {
6
6
  type: string;
7
7
  payload: Record<string, unknown> | unknown[];
@@ -1,8 +1,8 @@
1
- import type { RunnerFlags } from './index.js';
2
1
  import type { LogLevel } from '../logs/messages.js';
3
2
  import type { IntegrationConfigForProxy } from '../proxy/api.js';
4
3
  import type { DBSyncConfig } from '../syncConfigs/db.js';
5
4
  import type { DBTeam } from '../team/db.js';
5
+ import type { RunnerFlags } from './index.js';
6
6
  import type { AxiosError, AxiosInterceptorManager, AxiosRequestConfig, AxiosResponse } from 'axios';
7
7
  export interface SdkLogger {
8
8
  level: LogLevel | 'off';
@@ -1,5 +1,5 @@
1
- import type { ReportedSyncJobStatus } from './index.js';
2
1
  import type { ApiError, Endpoint } from '../api.js';
2
+ import type { ReportedSyncJobStatus } from './index.js';
3
3
  export type PostPublicTrigger = Endpoint<{
4
4
  Method: 'POST';
5
5
  Path: '/sync/trigger';
@@ -1,8 +1,8 @@
1
1
  import type { ApiError, ApiTimestamps, Endpoint } from '../api.js';
2
- import type { DBTeam } from './db.js';
3
2
  import type { DBInvitation } from '../invitations/db.js';
4
3
  import type { ApiUser } from '../user/api.js';
5
4
  import type { Role } from '../user/db.js';
5
+ import type { DBTeam } from './db.js';
6
6
  import type { Merge } from 'type-fest';
7
7
  export type GetTeam = Endpoint<{
8
8
  Method: 'GET';
@@ -1,4 +1,4 @@
1
- export type UsageMetric = 'proxy' | 'connections' | 'function_executions' | 'function_compute_gbms' | 'records' | 'webhook_forwards' | 'function_logs';
1
+ export type UsageMetric = 'proxy' | 'connections' | 'function_executions' | 'function_compute_gbms' | 'records' | 'webhook_forwards' | 'function_logs' | 'data_transfer';
2
2
  export interface MetricUsageSummary {
3
3
  label: string;
4
4
  usage: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nangohq/types",
3
- "version": "0.70.8",
3
+ "version": "0.70.9",
4
4
  "description": "Types used in Nango applications",
5
5
  "type": "module",
6
6
  "typings": "dist/index.d.ts",