@vibiz/sdk 0.3.14 → 0.3.16

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/client.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { ActionInfo, ActionResult, ActionRun, ActionRunList, ActionRunsQuery, ActionUsage, AdminMetrics, AiJob, AiKeyProvider, AiModelInfo, AiProviderKey, AiProviderKeyInput, AiProviderKeyList, AiSettings, AnalyticsPeriod, AnalyticsReport, ApiKey, AppKeyInfo, AppStoreAccount, AppStoreConnectLink, AppStoreSetup, AppStoreSetupInput, AppStoreState, AuthEnvironment, AuthProviderId, AuthProviderInput, AuthSettings, AuthSettingsPatch, Automation, AutomationEnrollment, AutomationInput, AutomationTrigger, Billing, BillingCharge, BillingCheckout, BillingEntry, BillingEntryKind, BillingList, BillingUpdate, Broadcast, BroadcastInput, BroadcastRecipient, BroadcastReview, BroadcastStatus, ChatChunk, ChatCompletion, ChatRequest, Checkout, CheckoutBrandPatch, CheckoutInput, Company, CompanyAddressFields, CompanyCatalog, CompanyDraft, CompanyEnvironment, CompanyLink, Connector, ConnectorApproval, ConnectorCall, ConnectorCallInput, ConnectorCheck, ConnectorEnvironment, ConnectorImport, ConnectorInput, ConnectorPatch, ConnectorResponse, ContactPropertyValue, ContactStatus, DashboardLink, DeployFile, Deployment, DeploymentFiles, DesignSectionRead, DesignSpec, DevEnvironment, DnsRecord, DnsRecordInput, DnsRecordList, Domain, DomainBuyInput, DomainList, DomainOwnerContact, DomainOwnerDetails, DomainQuote, DomainSearch, DomainUse, DomainUseInput, EmailContact, EmailContactInput, EmailContactList, EmailContactPatch, EmailForwarding, EmailForwardingLog, EmailForwardingRule, EmailImportInput, EmailImportReport, EmailList, EmailMarketing, EmailMarketingPatch, EmailPage, EmailPreview, EmailSegment, EmailTestResult, EnvTargetInfo, EnvVarInfo, ExportInput, FileEnvironment, FileList, FileListOptions, FileUploadOptions, HealthList, HealthRun, HealthStatus, HostKind, ImageRequest, ImageResult, InboxSettings, KeyAccess, KeyPermission, KeyPresetChoice, LedgerEntry, Mailbox, MailboxInput, MailDomain, MailFolder, MailReplyInput, MailSendInput, MailThreadDetail, MailThreadList, MailView, MetricsReport, MissionControl, MissionControlLayout, Operation, OwnAccountLink, OwnedDomain, OwnedDomainList, OwnerStripe, OwnerStripeApply, OwnerStripeDisconnect, OwnerStripeLink, Payment, PaymentPrice, PaymentPriceInput, PaymentProduct, PaymentSubscription, PaymentsAccount, PaymentsEnvironment, PaymentsList, PaymentsSimulation, PhoneAnsweringInput, PhoneCall, PhoneCallInput, PhoneCallList, PhoneMessage, PhoneMessageList, PhoneNumber, PhoneNumberList, PhoneQuote, PhoneRegistrationInput, PhoneRegistrationRequirements, PhoneSearch, PhoneSendInput, PhoneThreadList, Project, ProjectExport, ProjectHealth, ProjectSearch, ReplayDetail, ReplayFrames, ReplayFramesOptions, ReplayInsights, ReplayListOptions, ReplayPeriod, ReplayStatus, ReplaySummary, Resource, ResourceType, SearchConnectionList, SearchPageList, SecretLink, SegmentFilter, SendEmailInput, SendEmailOutput, SocialAccount, SocialAccountAnalytics, SocialAdCampaign, SocialAdChange, SocialAdChangeInput, SocialCampaignCreateInput, SocialConnectLink, SocialEnvironment, SocialMedia, SocialOverview, SocialPost, SocialPostAnalytics, SocialPostInput, SpeechRequest, Transcription, UsageOptions, UsagePeriod, UsageReport, VersionDiff, VersionList, VersionRestore, VibizFile, WebDesignInput, WebhookDelivery, WebhookEventType, Withdrawal } from './types.js';
1
+ import type { ActionInfo, ActionResult, ActionRun, ActionRunList, ActionRunsQuery, ActionUsage, AdminMetrics, AiJob, AiKeyProvider, AiModelInfo, AiProviderKey, AiProviderKeyInput, AiProviderKeyList, AiSettings, AnalyticsPeriod, AnalyticsReport, ApiKey, AppKeyInfo, AppStoreAccount, AppStoreConnectLink, AppStoreSetup, AppStoreSetupInput, AppStoreState, AuthEnvironment, AuthProviderId, AuthProviderInput, AuthSettings, AuthSettingsPatch, Automation, AutomationEnrollment, AutomationInput, AutomationTrigger, Billing, BillingCharge, BillingCheckout, BillingEntry, BillingEntryKind, BillingList, BillingUpdate, Broadcast, BroadcastInput, BroadcastRecipient, BroadcastReview, BroadcastStatus, ChatChunk, ChatCompletion, ChatRequest, Checkout, CheckoutBrandPatch, CheckoutInput, Company, CompanyAddressFields, CompanyCatalog, CompanyDraft, CompanyEnvironment, CompanyLink, Connector, ConnectorApproval, ConnectorCall, ConnectorCallInput, ConnectorCheck, ConnectorEnvironment, ConnectorImport, ConnectorInput, ConnectorPatch, ConnectorResponse, ContactPropertyValue, ContactStatus, DashboardLink, DeployFile, Deployment, DeploymentFiles, DesignSectionRead, DesignSpec, DevEnvironment, DnsRecord, DnsRecordInput, DnsRecordList, Domain, DomainBuyInput, DomainList, DomainOwnerContact, DomainOwnerDetails, DomainQuote, DomainSearch, DomainUse, DomainUseInput, EmailContact, EmailContactInput, EmailContactList, EmailContactPatch, EmailForwarding, EmailForwardingLog, EmailForwardingRule, EmailImportInput, EmailImportReport, EmailList, EmailMarketing, EmailMarketingPatch, EmailPage, EmailPreview, EmailSegment, EmailTestResult, EnvTargetInfo, EnvVarInfo, ExportInput, FileEnvironment, FileList, FileListOptions, FileUploadOptions, HealthList, HealthRun, HealthStatus, HostKind, ImageRequest, ImageResult, InboxSettings, KeyAccess, KeyPermission, KeyPresetChoice, LedgerEntry, Mailbox, MailboxInput, MailDomain, MailFolder, MailReplyInput, MailSendInput, MailThreadDetail, MailThreadList, MailView, MediaModelInfo, MetricsReport, MissionControl, MissionControlLayout, Operation, OwnAccountLink, OwnedDomain, OwnedDomainList, OwnerStripe, OwnerStripeApply, OwnerStripeDisconnect, OwnerStripeLink, Payment, PaymentPrice, PaymentPriceInput, PaymentProduct, PaymentSubscription, PaymentsAccount, PaymentsEnvironment, PaymentsList, PaymentsSimulation, PhoneAnsweringInput, PhoneCall, PhoneCallInput, PhoneCallList, PhoneMessage, PhoneMessageList, PhoneNumber, PhoneNumberList, PhoneQuote, PhoneRegistrationInput, PhoneRegistrationRequirements, PhoneSearch, PhoneSendInput, PhoneThreadList, Project, ProjectExport, ProjectHealth, ProjectSearch, ReplayDetail, ReplayFrames, ReplayFramesOptions, ReplayInsights, ReplayListOptions, ReplayPeriod, ReplayStatus, ReplaySummary, Resource, ResourceType, SearchConnectionList, SearchPageList, SecretLink, SegmentFilter, SendEmailInput, SendEmailOutput, SocialAccount, SocialAccountAnalytics, SocialAdCampaign, SocialAdChange, SocialAdChangeInput, SocialCampaignCreateInput, SocialConnectLink, SocialEnvironment, SocialMedia, SocialOverview, SocialPost, SocialPostAnalytics, SocialPostInput, SpeechRequest, Transcription, UsageOptions, UsagePeriod, UsageReport, VersionDiff, VersionList, VersionRestore, VibizFile, WebDesignInput, WebhookDelivery, WebhookEventType, Withdrawal } from './types.js';
2
2
  /**
3
3
  * An error status with no Vibiz error body: a proxy, a load balancer or the
4
4
  * network answered instead of the API. Say so, and what to do.
@@ -530,6 +530,13 @@ export declare class Vibiz {
530
530
  /** Check DNS and ownership again now. */
531
531
  verify: (id: string, domain: string) => Promise<Domain>;
532
532
  remove: (id: string, domain: string) => Promise<DomainList>;
533
+ /**
534
+ * Moving to a new address (full-access keys): every URL on `domain`
535
+ * answers a permanent redirect to the same path on `to`, another live
536
+ * domain of the project, so search engines carry its pages over. `null`
537
+ * stops it. A redirecting domain is never the project's primary.
538
+ */
539
+ redirect: (id: string, domain: string, to: string | null) => Promise<Domain>;
533
540
  /**
534
541
  * Full-access keys: buy a domain from the account's credits; it serves on this
535
542
  * project once registered. A Limited key answers `owner_only` with the
@@ -1060,6 +1067,17 @@ export declare class Vibiz {
1060
1067
  all?: boolean;
1061
1068
  q?: string;
1062
1069
  }) => Promise<AiModelInfo[]>;
1070
+ /**
1071
+ * Every image and video model that runs by its id (Kling, Seedance,
1072
+ * face swap, upscalers…), with its live price. Run one with
1073
+ * `jobs.create({ type, model: id, input: { prompt, model_input } })`:
1074
+ * charged from credits.
1075
+ */
1076
+ mediaModels: (opts?: {
1077
+ q?: string;
1078
+ category?: string;
1079
+ limit?: number;
1080
+ }) => Promise<MediaModelInfo[]>;
1063
1081
  jobs: {
1064
1082
  create: (input: {
1065
1083
  type: "image" | "video";
@@ -1069,9 +1087,16 @@ export declare class Vibiz {
1069
1087
  n?: number;
1070
1088
  size?: string;
1071
1089
  aspect_ratio?: "16:9" | "9:16" | "1:1";
1072
- /** Video: a still to animate (image to video), a public https URL. */
1090
+ /** Video: a still to animate. Image: a photo to edit. A public https URL. */
1073
1091
  image_url?: string;
1074
- /** With a `fal/<endpoint>` model (your own fal key): raw input for that endpoint. */
1092
+ /** Image: more photos to combine, at most 8 with `image_url`. */
1093
+ image_urls?: string[];
1094
+ /**
1095
+ * With a model run by its id (`ai.mediaModels`): that model's own
1096
+ * parameters (face images, duration, …), at most 16 KB.
1097
+ */
1098
+ model_input?: Record<string, unknown>;
1099
+ /** The older name of `model_input`. */
1075
1100
  fal_input?: Record<string, unknown>;
1076
1101
  };
1077
1102
  }, opts?: {
package/dist/index.js CHANGED
@@ -619,6 +619,16 @@ var Vibiz = class {
619
619
  remove: (id, domain) => this.request(`/projects/${id}/domains/${encodeURIComponent(domain)}`, {
620
620
  method: "DELETE"
621
621
  }),
622
+ /**
623
+ * Moving to a new address (full-access keys): every URL on `domain`
624
+ * answers a permanent redirect to the same path on `to`, another live
625
+ * domain of the project, so search engines carry its pages over. `null`
626
+ * stops it. A redirecting domain is never the project's primary.
627
+ */
628
+ redirect: (id, domain, to) => this.request(`/projects/${id}/domains/${encodeURIComponent(domain)}`, {
629
+ method: "PATCH",
630
+ body: { redirect_to: to }
631
+ }),
622
632
  /**
623
633
  * Full-access keys: buy a domain from the account's credits; it serves on this
624
634
  * project once registered. A Limited key answers `owner_only` with the
@@ -1220,6 +1230,22 @@ var Vibiz = class {
1220
1230
  const tail = qs2.size ? `?${qs2}` : "";
1221
1231
  return this.request(`/ai/models${tail}`).then((r) => r.data);
1222
1232
  },
1233
+ /**
1234
+ * Every image and video model that runs by its id (Kling, Seedance,
1235
+ * face swap, upscalers…), with its live price. Run one with
1236
+ * `jobs.create({ type, model: id, input: { prompt, model_input } })`:
1237
+ * charged from credits.
1238
+ */
1239
+ mediaModels: (opts = {}) => {
1240
+ const qs2 = new URLSearchParams();
1241
+ if (opts.q) qs2.set("q", opts.q);
1242
+ if (opts.category) qs2.set("category", opts.category);
1243
+ if (opts.limit) qs2.set("limit", String(opts.limit));
1244
+ const tail = qs2.size ? `?${qs2}` : "";
1245
+ return this.request(`/ai/media-models${tail}`).then(
1246
+ (r) => r.data
1247
+ );
1248
+ },
1223
1249
  jobs: {
1224
1250
  create: (input, opts = {}) => this.request("/ai/jobs", { method: "POST", body: input, ...opts }),
1225
1251
  get: (id) => this.request(`/ai/jobs/${id}`),
@@ -1979,7 +2005,7 @@ function formatMinor(minor, currency) {
1979
2005
  }
1980
2006
 
1981
2007
  // packages/sdk/src/one-key.ts
1982
- var APP_SDK_VERSION = "0.3.14";
2008
+ var APP_SDK_VERSION = "0.3.16";
1983
2009
  var ONE_KEY_GIVES = "database, sign-in, email and inbox, AI models, files, payments, analytics with session replays, web data, social, phone and connectors";
1984
2010
  function oneKeyMessage(url, host) {
1985
2011
  const where = host ?? "your host";
package/dist/one-key.d.ts CHANGED
@@ -10,7 +10,7 @@
10
10
  * (`npm install --save-exact @vibiz/app@<this>`). A test keeps it, the skills
11
11
  * and the docs equal to packages/app/package.json.
12
12
  */
13
- export declare const APP_SDK_VERSION = "0.3.14";
13
+ export declare const APP_SDK_VERSION = "0.3.16";
14
14
  /** Everything one app key reaches. */
15
15
  export declare const ONE_KEY_GIVES = "database, sign-in, email and inbox, AI models, files, payments, analytics with session replays, web data, social, phone and connectors";
16
16
  /**
package/dist/types.d.ts CHANGED
@@ -81,6 +81,12 @@ export interface Domain {
81
81
  records_to_set: DnsRecordToSet[];
82
82
  /** `www.<domain>`, redirecting to the domain (an apex domain). */
83
83
  www_redirect: string | null;
84
+ /**
85
+ * Another of the project's domains every URL here permanently redirects to,
86
+ * path kept (a move to a new address). Null: it serves the app. Optional for
87
+ * an API from before redirects.
88
+ */
89
+ redirect_to?: string | null;
84
90
  /** What to do next, in plain words. */
85
91
  next_step: string;
86
92
  error: string | null;
@@ -1409,11 +1415,33 @@ export interface ImageRequest {
1409
1415
  /** `b64_json` (default) or `url`: a Vibiz link valid for a day. */
1410
1416
  response_format?: 'b64_json' | 'url';
1411
1417
  /**
1412
- * With a `fal/<endpoint>` model, which runs only on your own fal key: raw
1413
- * input for that endpoint, merged into what it receives (at most 16 KB).
1418
+ * A photo to edit or start from, public https (a Files link works): the
1419
+ * prompt says what to change. vibiz/image, vibiz/image-pro, vibiz/image-text.
1414
1420
  */
1421
+ image_url?: string;
1422
+ /** Several photos to combine (a person and a product…), at most 8 with `image_url`. */
1423
+ image_urls?: string[];
1424
+ /**
1425
+ * With a model run by its id (`ai.mediaModels`): that model's own
1426
+ * parameters, merged into what it receives (at most 16 KB).
1427
+ */
1428
+ model_input?: Record<string, unknown>;
1429
+ /** The older name of `model_input`. */
1415
1430
  fal_input?: Record<string, unknown>;
1416
1431
  }
1432
+ /** An entry of `GET /v1/ai/media-models`: an image or video model that runs by its id. */
1433
+ export interface MediaModelInfo {
1434
+ id: string;
1435
+ name: string;
1436
+ category: string;
1437
+ description: string;
1438
+ type: 'image' | 'video';
1439
+ /** The live price per unit (image, megapixel, video, seconds…), in USD. */
1440
+ price: {
1441
+ unit: string;
1442
+ usd: number;
1443
+ } | null;
1444
+ }
1417
1445
  export interface ImageResult {
1418
1446
  created: number;
1419
1447
  model: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vibiz/sdk",
3
- "version": "0.3.14",
3
+ "version": "0.3.16",
4
4
  "description": "Typed client for the thelastapi API: projects, hosting, databases, sign-in, email, AI, payments and more.",
5
5
  "keywords": [
6
6
  "vibiz",