@vibiz/sdk 0.3.3 → 0.3.5

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, 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, HostKind, ImageRequest, ImageResult, InboxSettings, KeyAccess, LedgerEntry, Mailbox, MailboxInput, MailDomain, MailFolder, MailReplyInput, MailSendInput, MailThreadDetail, MailThreadList, MailView, MetricsReport, 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, ReplayDetail, ReplayFrames, ReplayFramesOptions, ReplayInsights, ReplayListOptions, ReplayPeriod, ReplayStatus, ReplaySummary, Resource, ResourceType, 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, 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, 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, ReplayDetail, ReplayFrames, ReplayFramesOptions, ReplayInsights, ReplayListOptions, ReplayPeriod, ReplayStatus, ReplaySummary, Resource, ResourceType, 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.
@@ -651,6 +651,44 @@ export declare class Vibiz {
651
651
  period?: AnalyticsPeriod;
652
652
  }) => Promise<AnalyticsReport>;
653
653
  };
654
+ /**
655
+ * Mission Control (docs: Mission Control and health checks): every business
656
+ * of the account with its health, worst first; one business's checks; and
657
+ * checking again now. Checks also run every hour on their own.
658
+ */
659
+ readonly health: {
660
+ /** Every business, worst first. `status`: only those (`['fail']`, `['fail', 'warn']`). */
661
+ list: (opts?: {
662
+ status?: HealthStatus[];
663
+ q?: string;
664
+ }) => Promise<HealthList>;
665
+ /** One business's checks (checked now if it never was). */
666
+ get: (projectId: string) => Promise<ProjectHealth>;
667
+ /** Check one business again now and answer its checks. */
668
+ run: (projectId: string) => Promise<ProjectHealth>;
669
+ /** Check every business again, in the background (a few at a time). */
670
+ runAll: () => Promise<HealthRun>;
671
+ };
672
+ /**
673
+ * Mission Control's canvas (docs: Mission Control and health checks): every
674
+ * business as a row of steps (domain, deploy, pages, traffic, experience,
675
+ * checkout, sales, limits) with 30 days of figures, plus the account's
676
+ * insights (today, movers, new problems, top sources), in one call.
677
+ */
678
+ readonly missionControl: {
679
+ get: () => Promise<MissionControl>;
680
+ /** The account's pinned rows and row order on the canvas. */
681
+ layout: () => Promise<MissionControlLayout>;
682
+ /** Pin or order rows; `replace` drops every row not listed ("Tidy up"). */
683
+ setLayout: (body: {
684
+ rows: {
685
+ project_id: string;
686
+ pinned?: boolean;
687
+ position?: number | null;
688
+ }[];
689
+ replace?: boolean;
690
+ }) => Promise<MissionControlLayout>;
691
+ };
654
692
  /** Session replay. Start from `insights`; open single sessions with `get`. */
655
693
  readonly replays: {
656
694
  /** Rule-based findings over recorded sessions: what broke and where people got stuck. */
package/dist/index.js CHANGED
@@ -786,6 +786,45 @@ var Vibiz = class {
786
786
  `/projects/${projectId}/analytics?period=${opts.period ?? "7d"}`
787
787
  )
788
788
  };
789
+ /**
790
+ * Mission Control (docs: Mission Control and health checks): every business
791
+ * of the account with its health, worst first; one business's checks; and
792
+ * checking again now. Checks also run every hour on their own.
793
+ */
794
+ health = {
795
+ /** Every business, worst first. `status`: only those (`['fail']`, `['fail', 'warn']`). */
796
+ list: (opts = {}) => {
797
+ const q = new URLSearchParams();
798
+ if (opts.status?.length) q.set("status", opts.status.join(","));
799
+ if (opts.q) q.set("q", opts.q);
800
+ const qs2 = q.toString();
801
+ return this.request(`/health${qs2 ? `?${qs2}` : ""}`);
802
+ },
803
+ /** One business's checks (checked now if it never was). */
804
+ get: (projectId) => this.request(`/projects/${encodeURIComponent(projectId)}/health`),
805
+ /** Check one business again now and answer its checks. */
806
+ run: (projectId) => this.request(`/projects/${encodeURIComponent(projectId)}/health/run`, {
807
+ method: "POST"
808
+ }),
809
+ /** Check every business again, in the background (a few at a time). */
810
+ runAll: () => this.request("/health/run", { method: "POST" })
811
+ };
812
+ /**
813
+ * Mission Control's canvas (docs: Mission Control and health checks): every
814
+ * business as a row of steps (domain, deploy, pages, traffic, experience,
815
+ * checkout, sales, limits) with 30 days of figures, plus the account's
816
+ * insights (today, movers, new problems, top sources), in one call.
817
+ */
818
+ missionControl = {
819
+ get: () => this.request("/mission-control"),
820
+ /** The account's pinned rows and row order on the canvas. */
821
+ layout: () => this.request("/mission-control/layout"),
822
+ /** Pin or order rows; `replace` drops every row not listed ("Tidy up"). */
823
+ setLayout: (body) => this.request("/mission-control/layout", {
824
+ method: "PUT",
825
+ body
826
+ })
827
+ };
789
828
  /** Session replay. Start from `insights`; open single sessions with `get`. */
790
829
  replays = {
791
830
  /** Rule-based findings over recorded sessions: what broke and where people got stuck. */
@@ -1861,7 +1900,7 @@ function formatMinor(minor, currency) {
1861
1900
  }
1862
1901
 
1863
1902
  // packages/sdk/src/one-key.ts
1864
- var APP_SDK_VERSION = "0.3.3";
1903
+ var APP_SDK_VERSION = "0.3.5";
1865
1904
  var ONE_KEY_GIVES = "database, sign-in, email and inbox, AI models, files, payments, analytics with session replays, web data, social, phone and connectors";
1866
1905
  function oneKeyMessage(url, host) {
1867
1906
  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.3";
13
+ export declare const APP_SDK_VERSION = "0.3.5";
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
@@ -4100,4 +4100,218 @@ export interface EmailPage<T> {
4100
4100
  has_more: boolean;
4101
4101
  next_cursor: string | null;
4102
4102
  }
4103
+ export type HealthStatus = 'ok' | 'warn' | 'fail' | 'unknown';
4104
+ /** One health check: what it found, and how to fix it when it is a problem. */
4105
+ export interface HealthCheck {
4106
+ id: 'site' | 'deploy' | 'resources' | 'errors' | 'traffic' | 'pages' | 'payments' | 'limits' | 'domain';
4107
+ status: HealthStatus;
4108
+ title: string;
4109
+ detail: string;
4110
+ fix: string;
4111
+ /** The console page about it. */
4112
+ link: string | null;
4113
+ /** When it took its current status. */
4114
+ since: string;
4115
+ }
4116
+ export interface HealthProjectRef {
4117
+ id: string;
4118
+ name: string;
4119
+ slug: string;
4120
+ url: string | null;
4121
+ }
4122
+ /** A business in `GET /v1/health`: its status, the worst 3 problems, and its figures. */
4123
+ export interface HealthSummary {
4124
+ object: 'project_health';
4125
+ project: HealthProjectRef;
4126
+ status: HealthStatus;
4127
+ checked_at: string | null;
4128
+ counts: {
4129
+ fail: number;
4130
+ warn: number;
4131
+ };
4132
+ top: HealthCheck[];
4133
+ metrics: {
4134
+ visitors_7d: number;
4135
+ pageviews_24h: number;
4136
+ sales_30d: number;
4137
+ revenue_30d_usd_cents: number;
4138
+ errors_24h: number;
4139
+ };
4140
+ console_url: string;
4141
+ }
4142
+ export interface HealthList {
4143
+ object: 'list';
4144
+ data: HealthSummary[];
4145
+ totals: {
4146
+ projects: number;
4147
+ fail: number;
4148
+ warn: number;
4149
+ ok: number;
4150
+ unknown: number;
4151
+ };
4152
+ checked_at: string | null;
4153
+ console_url: string;
4154
+ }
4155
+ /** One business's checks, worst first. */
4156
+ export interface ProjectHealth {
4157
+ object: 'project_health';
4158
+ project: HealthProjectRef;
4159
+ status: HealthStatus;
4160
+ checked_at: string | null;
4161
+ next_check_at: string | null;
4162
+ counts: {
4163
+ fail: number;
4164
+ warn: number;
4165
+ };
4166
+ checks: HealthCheck[];
4167
+ metrics: Record<string, number>;
4168
+ console_url: string;
4169
+ }
4170
+ export interface HealthRun {
4171
+ object: 'health_run';
4172
+ queued: number;
4173
+ note: string;
4174
+ console_url: string;
4175
+ }
4176
+ /** A business's steps, left to right, each coloured by its own checks. */
4177
+ export type MissionControlStepId = 'domain' | 'deploy' | 'pages' | 'traffic' | 'experience' | 'payments' | 'sales' | 'limits';
4178
+ export interface MissionControlStep {
4179
+ id: MissionControlStepId;
4180
+ title: string;
4181
+ /** The worst of its checks. */
4182
+ status: HealthStatus;
4183
+ /** False: the business doesn't use this step yet ("not set up"). */
4184
+ set_up: boolean;
4185
+ /** The step's key number, in `unit` (`usd_micro`: millionths of a dollar). */
4186
+ value: number | null;
4187
+ unit: 'count' | 'usd_cents' | 'usd_micro' | null;
4188
+ value_label: string | null;
4189
+ /** One line: the worst problem's detail, else how it is. */
4190
+ line: string;
4191
+ checks: {
4192
+ id: HealthCheck['id'];
4193
+ status: HealthStatus;
4194
+ title: string;
4195
+ }[];
4196
+ /** The console page for it. */
4197
+ link: string | null;
4198
+ }
4199
+ /** One business on the canvas: its steps and its figures. */
4200
+ export interface MissionControlProject {
4201
+ object: 'mission_control_project';
4202
+ project: HealthProjectRef & {
4203
+ live: boolean;
4204
+ };
4205
+ status: HealthStatus;
4206
+ checked_at: string | null;
4207
+ counts: {
4208
+ fail: number;
4209
+ warn: number;
4210
+ };
4211
+ top: HealthCheck[];
4212
+ steps: MissionControlStep[];
4213
+ metrics: {
4214
+ /** Per day, oldest first, 30 long (the days are the answer's `days`). */
4215
+ pageviews_30d: number[];
4216
+ visitors_30d: number[];
4217
+ visitors_today: number;
4218
+ visitors_7d: number;
4219
+ visitors_prev_7d: number;
4220
+ /** Percent, 7 days against the 7 before; null with no visitors before. */
4221
+ visitors_change_pct: number | null;
4222
+ sales_30d: number;
4223
+ revenue_30d_usd_cents: number;
4224
+ sales_today: number;
4225
+ revenue_today_usd_cents: number;
4226
+ errors_24h: number;
4227
+ ai_spend_today_usd_micro: number;
4228
+ top_sources_7d: {
4229
+ source: string;
4230
+ visitors: number;
4231
+ }[];
4232
+ top_pages_7d: {
4233
+ path: string;
4234
+ pageviews: number;
4235
+ }[];
4236
+ last_deploy: {
4237
+ id: string;
4238
+ status: string;
4239
+ at: string;
4240
+ error: string | null;
4241
+ console_url: string | null;
4242
+ } | null;
4243
+ latest_problem_replay: {
4244
+ id: string;
4245
+ at: string;
4246
+ errors: number;
4247
+ rage_clicks: number;
4248
+ dead_clicks: number;
4249
+ console_url: string | null;
4250
+ } | null;
4251
+ };
4252
+ console_url: string;
4253
+ }
4254
+ export interface MissionControlLayout {
4255
+ object: 'mission_control_layout';
4256
+ /** Pinned rows come first; a `position` orders a row within its group. */
4257
+ rows: {
4258
+ project_id: string;
4259
+ pinned: boolean;
4260
+ position: number | null;
4261
+ }[];
4262
+ console_url: string;
4263
+ }
4264
+ /** `GET /v1/mission-control`: every business as a row of steps, plus the account's insights. */
4265
+ export interface MissionControl {
4266
+ object: 'mission_control';
4267
+ generated_at: string;
4268
+ /** When the figures were read (kept a minute); health is fresh on every call. */
4269
+ metrics_at: string;
4270
+ checked_at: string | null;
4271
+ steps: {
4272
+ id: MissionControlStepId;
4273
+ title: string;
4274
+ checks: HealthCheck['id'][];
4275
+ }[];
4276
+ /** The 30 days of each `*_30d` series, oldest first (`2026-11-12`). */
4277
+ days: string[];
4278
+ totals: {
4279
+ projects: number;
4280
+ fail: number;
4281
+ warn: number;
4282
+ ok: number;
4283
+ unknown: number;
4284
+ };
4285
+ data: MissionControlProject[];
4286
+ insights: {
4287
+ today: {
4288
+ visitors: number;
4289
+ sales: number;
4290
+ revenue_usd_cents: number;
4291
+ fail: number;
4292
+ warn: number;
4293
+ };
4294
+ movers: {
4295
+ project_id: string;
4296
+ name: string;
4297
+ visitors_7d: number;
4298
+ visitors_prev_7d: number;
4299
+ change_pct: number;
4300
+ direction: 'up' | 'down';
4301
+ console_url: string;
4302
+ }[];
4303
+ new_problems: {
4304
+ project_id: string;
4305
+ name: string;
4306
+ check: HealthCheck;
4307
+ console_url: string;
4308
+ }[];
4309
+ top_sources_7d: {
4310
+ source: string;
4311
+ visitors: number;
4312
+ }[];
4313
+ };
4314
+ layout: MissionControlLayout;
4315
+ console_url: string;
4316
+ }
4103
4317
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vibiz/sdk",
3
- "version": "0.3.3",
3
+ "version": "0.3.5",
4
4
  "description": "Typed client for the Vibiz Stack API: projects, hosting, databases, sign-in, email, AI, payments and more.",
5
5
  "keywords": [
6
6
  "vibiz",