@vibiz/sdk 0.3.2 → 0.3.4

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, 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,24 @@ 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
+ };
654
672
  /** Session replay. Start from `insights`; open single sessions with `get`. */
655
673
  readonly replays: {
656
674
  /** Rule-based findings over recorded sessions: what broke and where people got stuck. */
package/dist/index.js CHANGED
@@ -786,6 +786,29 @@ 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
+ };
789
812
  /** Session replay. Start from `insights`; open single sessions with `get`. */
790
813
  replays = {
791
814
  /** Rule-based findings over recorded sessions: what broke and where people got stuck. */
@@ -1861,7 +1884,7 @@ function formatMinor(minor, currency) {
1861
1884
  }
1862
1885
 
1863
1886
  // packages/sdk/src/one-key.ts
1864
- var APP_SDK_VERSION = "0.3.2";
1887
+ var APP_SDK_VERSION = "0.3.4";
1865
1888
  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
1889
  function oneKeyMessage(url, host) {
1867
1890
  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.2";
13
+ export declare const APP_SDK_VERSION = "0.3.4";
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,77 @@ 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
+ }
4103
4176
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vibiz/sdk",
3
- "version": "0.3.2",
3
+ "version": "0.3.4",
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",