deepline 0.1.194 → 0.1.196

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
@@ -1396,6 +1396,27 @@ type BillingInvoicesResult = {
1396
1396
  org_id: string;
1397
1397
  entries: BillingInvoiceEntry[];
1398
1398
  };
1399
+ /** Saved payment method details returned by one-click billing top-up. */
1400
+ type BillingPaymentMethodSummary = {
1401
+ brand?: string | null;
1402
+ last4?: string | null;
1403
+ exp_month?: number | null;
1404
+ exp_year?: number | null;
1405
+ label?: string | null;
1406
+ };
1407
+ /**
1408
+ * Result of `POST /api/v2/billing/top-up`: a saved-card charge and purchased
1409
+ * Deepline credit grant for the active workspace.
1410
+ */
1411
+ type BillingTopUpResult = {
1412
+ ok: true;
1413
+ credits: number;
1414
+ amount_cents: number;
1415
+ currency: string;
1416
+ balance: number;
1417
+ stripe_payment_intent_id: string;
1418
+ payment_method?: BillingPaymentMethodSummary | null;
1419
+ };
1399
1420
  /** One published plan from `GET /api/v2/billing/catalog/current`. */
1400
1421
  type BillingPlanEntry = {
1401
1422
  plan_family_id: string;
@@ -1453,6 +1474,11 @@ type BillingPlansResult = {
1453
1474
  * @sdkReference client 030 client.billing
1454
1475
  */
1455
1476
  type BillingNamespace = {
1477
+ /** Charge the saved payment method and add Deepline credits to the active workspace. */
1478
+ topUp: (options: {
1479
+ credits: number;
1480
+ idempotencyKey?: string;
1481
+ }) => Promise<BillingTopUpResult>;
1456
1482
  /** Published plans plus the plan you are on ("what plans exist and what am I on"). */
1457
1483
  plans: () => Promise<BillingPlansResult>;
1458
1484
  subscription: {
@@ -2329,6 +2355,18 @@ declare class DeeplineClient {
2329
2355
  * @returns Snake_case catalog from `GET /api/v2/billing/catalog/current`
2330
2356
  */
2331
2357
  getBillingPlans(): Promise<BillingPlansResult>;
2358
+ /**
2359
+ * Charge the saved payment method and add Deepline credits to the active
2360
+ * workspace. Prefer `client.billing.topUp(...)`.
2361
+ *
2362
+ * @throws {@link DeeplineError} with `statusCode: 409` when checkout is
2363
+ * required because the workspace has no saved payment method or the card
2364
+ * requires confirmation.
2365
+ */
2366
+ topUpBillingBalance(options: {
2367
+ credits: number;
2368
+ idempotencyKey?: string;
2369
+ }): Promise<BillingTopUpResult>;
2332
2370
  /**
2333
2371
  * Subscription state for the active workspace: active plan, whether a
2334
2372
  * Stripe subscription backs it, renewal/cancellation facts, and remaining
@@ -4251,4 +4289,4 @@ declare function writeCsvOutputFile(rows: Array<Record<string, unknown>>, stem:
4251
4289
  */
4252
4290
  declare function extractSummaryFields(payload: unknown): Record<string, Scalar>;
4253
4291
 
4254
- export { AuthError, type BillingCreditPool, type BillingInvoiceEntry, type BillingInvoicesResult, type BillingNamespace, type BillingSubscriptionCancelResult, type BillingSubscriptionStatus, type ClearPlayHistoryRequest, type ClearPlayHistoryResult, type ColumnMap, type ColumnResolver, type ConditionalStepResolver, ConfigError, type CsvInput, type CsvOptions, type CustomerDbQueryResult, DEEPLINE_EXTRACTOR_TARGETS, DEEPLINE_EXTRACTOR_TARGET_DEFINITIONS, DEEPLINE_TOOL_CATEGORIES, type DatasetBuilder, type DatasetColumnDefinition, type DatasetColumnRunInput, Deepline, DeeplineClient, type DeeplineClientOptions, DeeplineContext, type DeeplineEmailStatusGetterValue, DeeplineError, type DeeplineExtractorTarget, type DeeplineGetterValue, type DeeplineGetterValueMap, type DeeplineNamedPlay, type DeeplinePlayRuntimeContext, type DeeplinePlaysNamespace, type DeeplineToolCategory, type DeeplineToolsNamespace, type DefinePlayConfig, type DefinedPlay, type FileInput, JOB_CHANGE_STATUS_VALUES, type JobChangeStatus, type LiveEventEnvelope, PHONE_STATUS_VALUES, PLAY_BOOTSTRAP_COMPANY_FIELDS, PLAY_BOOTSTRAP_COMPANY_PROVIDER_CATEGORY, PLAY_BOOTSTRAP_CONTACT_FIELDS, PLAY_BOOTSTRAP_FINDER_KINDS, PLAY_BOOTSTRAP_OUTPUT_FIELD_BY_FINDER, PLAY_BOOTSTRAP_PEOPLE_PROVIDER_CATEGORY, PLAY_BOOTSTRAP_PROVIDER_CATEGORY_BY_FINDER, PLAY_BOOTSTRAP_SOURCE_KINDS, PLAY_BOOTSTRAP_STAGE_KINDS, PLAY_BOOTSTRAP_TEMPLATES, PROD_URL, type PhoneStatus, type PlayBindings, type PlayBootstrapEntityKind, type PlayBootstrapFinderKind, type PlayDataset, type PlayDatasetInput, type PlayInputContract, type PlayJob, type PlayListItem, type PlayLiveEvent, type PlayRevisionSummary, type PlayRunResult, type PlayRunStart, type PlaySheetRow, type PlaySheetRowsResult, type PlayStatus, type PlayStepProgramStep, type PrebuiltPlayRef, type PreviousCell, type PublishPlayVersionRequest, type PublishPlayVersionResult, RateLimitError, type ResolvedConfig, RunObserveTransportUnavailableError, type RunsListOptions, type RunsLogsOptions, type RunsLogsResult, type RunsNamespace, type RunsTailOptions, SDK_API_CONTRACT, SDK_VERSION, type SqlListenerDeclaration, type SqlListenerEvent, type SqlListenerOperation, type SqlQuery, type StartPlayRunRequest, type StepOptions, type StepProgram, type StepProgramResolver, type StepResolver, type StopPlayRunResult, type ToolDefinition, type ToolExecuteResult, type ToolExecution, type ToolExecutionRequest, type ToolMetadata, type ToolSearchOptions, type ToolSearchResult, defineInput, definePlay, defineWorkflow, extractSummaryFields, formatPlayBootstrapFinderKinds, formatPlayBootstrapFinderKindsForSentence, formatPlayBootstrapTemplates, getDefinedPlayMetadata, isDeeplineExtractorTarget, isPlayBootstrapFinderKind, isPlayBootstrapTemplate, resolveConfig, runIf, steps, tryConvertToList, writeCsvOutputFile, writeJsonOutputFile };
4292
+ export { AuthError, type BillingCreditPool, type BillingInvoiceEntry, type BillingInvoicesResult, type BillingNamespace, type BillingPaymentMethodSummary, type BillingSubscriptionCancelResult, type BillingSubscriptionStatus, type BillingTopUpResult, type ClearPlayHistoryRequest, type ClearPlayHistoryResult, type ColumnMap, type ColumnResolver, type ConditionalStepResolver, ConfigError, type CsvInput, type CsvOptions, type CustomerDbQueryResult, DEEPLINE_EXTRACTOR_TARGETS, DEEPLINE_EXTRACTOR_TARGET_DEFINITIONS, DEEPLINE_TOOL_CATEGORIES, type DatasetBuilder, type DatasetColumnDefinition, type DatasetColumnRunInput, Deepline, DeeplineClient, type DeeplineClientOptions, DeeplineContext, type DeeplineEmailStatusGetterValue, DeeplineError, type DeeplineExtractorTarget, type DeeplineGetterValue, type DeeplineGetterValueMap, type DeeplineNamedPlay, type DeeplinePlayRuntimeContext, type DeeplinePlaysNamespace, type DeeplineToolCategory, type DeeplineToolsNamespace, type DefinePlayConfig, type DefinedPlay, type FileInput, JOB_CHANGE_STATUS_VALUES, type JobChangeStatus, type LiveEventEnvelope, PHONE_STATUS_VALUES, PLAY_BOOTSTRAP_COMPANY_FIELDS, PLAY_BOOTSTRAP_COMPANY_PROVIDER_CATEGORY, PLAY_BOOTSTRAP_CONTACT_FIELDS, PLAY_BOOTSTRAP_FINDER_KINDS, PLAY_BOOTSTRAP_OUTPUT_FIELD_BY_FINDER, PLAY_BOOTSTRAP_PEOPLE_PROVIDER_CATEGORY, PLAY_BOOTSTRAP_PROVIDER_CATEGORY_BY_FINDER, PLAY_BOOTSTRAP_SOURCE_KINDS, PLAY_BOOTSTRAP_STAGE_KINDS, PLAY_BOOTSTRAP_TEMPLATES, PROD_URL, type PhoneStatus, type PlayBindings, type PlayBootstrapEntityKind, type PlayBootstrapFinderKind, type PlayDataset, type PlayDatasetInput, type PlayInputContract, type PlayJob, type PlayListItem, type PlayLiveEvent, type PlayRevisionSummary, type PlayRunResult, type PlayRunStart, type PlaySheetRow, type PlaySheetRowsResult, type PlayStatus, type PlayStepProgramStep, type PrebuiltPlayRef, type PreviousCell, type PublishPlayVersionRequest, type PublishPlayVersionResult, RateLimitError, type ResolvedConfig, RunObserveTransportUnavailableError, type RunsListOptions, type RunsLogsOptions, type RunsLogsResult, type RunsNamespace, type RunsTailOptions, SDK_API_CONTRACT, SDK_VERSION, type SqlListenerDeclaration, type SqlListenerEvent, type SqlListenerOperation, type SqlQuery, type StartPlayRunRequest, type StepOptions, type StepProgram, type StepProgramResolver, type StepResolver, type StopPlayRunResult, type ToolDefinition, type ToolExecuteResult, type ToolExecution, type ToolExecutionRequest, type ToolMetadata, type ToolSearchOptions, type ToolSearchResult, defineInput, definePlay, defineWorkflow, extractSummaryFields, formatPlayBootstrapFinderKinds, formatPlayBootstrapFinderKindsForSentence, formatPlayBootstrapTemplates, getDefinedPlayMetadata, isDeeplineExtractorTarget, isPlayBootstrapFinderKind, isPlayBootstrapTemplate, resolveConfig, runIf, steps, tryConvertToList, writeCsvOutputFile, writeJsonOutputFile };
package/dist/index.js CHANGED
@@ -422,10 +422,10 @@ var SDK_RELEASE = {
422
422
  // 0.1.154 removes the short-lived generated enrich StepOptions recompute
423
423
  // fields shipped in 0.1.153.
424
424
  // 0.1.175 ships loud `deepline enrich` empty-waterfall reporting.
425
- version: "0.1.194",
425
+ version: "0.1.196",
426
426
  apiContract: "2026-06-dataset-handle-results-hard-cutover",
427
427
  supportPolicy: {
428
- latest: "0.1.194",
428
+ latest: "0.1.196",
429
429
  minimumSupported: "0.1.53",
430
430
  deprecatedBelow: "0.1.53",
431
431
  commandMinimumSupported: [
@@ -2353,6 +2353,7 @@ var DeeplineClient = class {
2353
2353
  stopAll: (options2) => this.stopAllRuns(options2)
2354
2354
  };
2355
2355
  this.billing = {
2356
+ topUp: (options2) => this.topUpBillingBalance(options2),
2356
2357
  plans: () => this.getBillingPlans(),
2357
2358
  subscription: {
2358
2359
  status: () => this.getBillingSubscriptionStatus(),
@@ -4034,6 +4035,28 @@ var DeeplineClient = class {
4034
4035
  async getBillingPlans() {
4035
4036
  return this.http.get("/api/v2/billing/catalog/current");
4036
4037
  }
4038
+ /**
4039
+ * Charge the saved payment method and add Deepline credits to the active
4040
+ * workspace. Prefer `client.billing.topUp(...)`.
4041
+ *
4042
+ * @throws {@link DeeplineError} with `statusCode: 409` when checkout is
4043
+ * required because the workspace has no saved payment method or the card
4044
+ * requires confirmation.
4045
+ */
4046
+ async topUpBillingBalance(options) {
4047
+ return this.http.post(
4048
+ "/api/v2/billing/top-up",
4049
+ {
4050
+ credits: options.credits,
4051
+ ...options.idempotencyKey ? { idempotency_key: options.idempotencyKey } : {}
4052
+ },
4053
+ void 0,
4054
+ // The idempotency key makes a retry at the product layer safe, but the
4055
+ // CLI should not hide ambiguous local delivery failures behind implicit
4056
+ // transport retries for a payment mutation.
4057
+ { maxRetries: 0, exactUrlOnly: true }
4058
+ );
4059
+ }
4037
4060
  /**
4038
4061
  * Subscription state for the active workspace: active plan, whether a
4039
4062
  * Stripe subscription backs it, renewal/cancellation facts, and remaining
package/dist/index.mjs CHANGED
@@ -352,10 +352,10 @@ var SDK_RELEASE = {
352
352
  // 0.1.154 removes the short-lived generated enrich StepOptions recompute
353
353
  // fields shipped in 0.1.153.
354
354
  // 0.1.175 ships loud `deepline enrich` empty-waterfall reporting.
355
- version: "0.1.194",
355
+ version: "0.1.196",
356
356
  apiContract: "2026-06-dataset-handle-results-hard-cutover",
357
357
  supportPolicy: {
358
- latest: "0.1.194",
358
+ latest: "0.1.196",
359
359
  minimumSupported: "0.1.53",
360
360
  deprecatedBelow: "0.1.53",
361
361
  commandMinimumSupported: [
@@ -2283,6 +2283,7 @@ var DeeplineClient = class {
2283
2283
  stopAll: (options2) => this.stopAllRuns(options2)
2284
2284
  };
2285
2285
  this.billing = {
2286
+ topUp: (options2) => this.topUpBillingBalance(options2),
2286
2287
  plans: () => this.getBillingPlans(),
2287
2288
  subscription: {
2288
2289
  status: () => this.getBillingSubscriptionStatus(),
@@ -3964,6 +3965,28 @@ var DeeplineClient = class {
3964
3965
  async getBillingPlans() {
3965
3966
  return this.http.get("/api/v2/billing/catalog/current");
3966
3967
  }
3968
+ /**
3969
+ * Charge the saved payment method and add Deepline credits to the active
3970
+ * workspace. Prefer `client.billing.topUp(...)`.
3971
+ *
3972
+ * @throws {@link DeeplineError} with `statusCode: 409` when checkout is
3973
+ * required because the workspace has no saved payment method or the card
3974
+ * requires confirmation.
3975
+ */
3976
+ async topUpBillingBalance(options) {
3977
+ return this.http.post(
3978
+ "/api/v2/billing/top-up",
3979
+ {
3980
+ credits: options.credits,
3981
+ ...options.idempotencyKey ? { idempotency_key: options.idempotencyKey } : {}
3982
+ },
3983
+ void 0,
3984
+ // The idempotency key makes a retry at the product layer safe, but the
3985
+ // CLI should not hide ambiguous local delivery failures behind implicit
3986
+ // transport retries for a payment mutation.
3987
+ { maxRetries: 0, exactUrlOnly: true }
3988
+ );
3989
+ }
3967
3990
  /**
3968
3991
  * Subscription state for the active workspace: active plan, whether a
3969
3992
  * Stripe subscription backs it, renewal/cancellation facts, and remaining
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deepline",
3
- "version": "0.1.194",
3
+ "version": "0.1.196",
4
4
  "description": "Deepline SDK + CLI — B2B data enrichment powered by durable cloud execution",
5
5
  "license": "MIT",
6
6
  "repository": {