@vibiz/sdk 0.3.24 → 0.3.26

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, Dashboard, DashboardCatalogue, DashboardData, DashboardDataQuery, DashboardLink, DashboardRange, DashboardWidget, DashboardWidgetInput, DashboardWidgetResult, 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, LibraryDeleted, LibraryEntry, LibraryExport, LibraryImport, LibraryList, Mailbox, MailboxInput, MailDomain, MailFolder, MailReplyInput, MailSendInput, MailThreadDetail, MailThreadList, MailView, MarketplaceList, MarketplaceOffer, MarketplaceQuery, 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, Profile, ProfileBusiness, ProfileBusinessesUpdate, ProfileBusinessUpdate, ProfileUpdate, Project, ProjectExport, ProjectHealth, ProjectSale, 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, SocialMessage, SocialOverview, SocialPost, SocialPostAnalytics, SocialPostInput, SocialReplyInput, SocialThread, SocialThreadDetail, SocialThreadKind, SpeechRequest, Transcription, UsageOptions, UsagePeriod, UsageReport, UsernameCheck, VerifyEmailOutput, 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, Dashboard, DashboardCatalogue, DashboardData, DashboardDataQuery, DashboardLink, DashboardRange, DashboardWidget, DashboardWidgetInput, DashboardWidgetResult, 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, LibraryDeleted, LibraryEntry, LibraryExport, LibraryImport, LibraryList, Mailbox, MailboxInput, MailDomain, MailFolder, MailReplyInput, MailSendInput, MailThreadDetail, MailThreadList, MailView, MarketplaceList, MarketplaceOffer, MarketplaceQuery, 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, Profile, ProfileBusiness, ProfileBusinessesUpdate, ProfileBusinessUpdate, ProfileUpdate, Project, ProjectExport, ProjectHealth, ProjectSale, 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, SocialMessage, SocialOverview, SocialPost, SocialPostAnalytics, SocialPostInput, SocialReplyInput, SocialThread, SocialThreadDetail, SocialThreadKind, SpeechRequest, Transcription, UsageOptions, UsagePeriod, UsageReport, UsernameCheck, VerifyEmailOutput, VersionDiff, VersionList, VersionRestore, VibizFile, VisitorJourneyDetail, VisitorJourneyList, VisitorJourneyQuery, 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.
@@ -733,6 +733,16 @@ export declare class Vibiz {
733
733
  get: (projectId: string, opts?: {
734
734
  period?: AnalyticsPeriod;
735
735
  }) => Promise<AnalyticsReport>;
736
+ /**
737
+ * Visitor journeys, newest first: each visitor-day's source, landing page,
738
+ * pages in order, events, and whether it converted (a sale or a goal event).
739
+ */
740
+ visitors: (projectId: string, opts?: VisitorJourneyQuery) => Promise<VisitorJourneyList>;
741
+ /** One visitor's path on one UTC day: the timeline, its replays and the sales it led to. */
742
+ visitor: (projectId: string, visitorId: string, opts?: {
743
+ day?: string;
744
+ goals?: string[];
745
+ }) => Promise<VisitorJourneyDetail>;
736
746
  };
737
747
  /**
738
748
  * Mission Control (docs: Mission Control and health checks): every business
@@ -1803,6 +1813,8 @@ export interface FeedbackInput {
1803
1813
  /** The tool or command involved (`vibiz_deploy`, `env set`). */
1804
1814
  tool?: string;
1805
1815
  error_code?: string;
1816
+ /** `error.details.report.request_id` of the failed call, when there was one. */
1817
+ request_id?: string;
1806
1818
  project_id?: string;
1807
1819
  /** The person's own words: only when they agreed to share them. */
1808
1820
  user_quote?: string;
@@ -1812,6 +1824,12 @@ export interface FeedbackReceipt {
1812
1824
  id: string;
1813
1825
  received: true;
1814
1826
  message: string;
1827
+ /** The failed call the report was linked to (the latest of this key or session, 30 minutes). */
1828
+ linked_error?: {
1829
+ route: string;
1830
+ code: string | null;
1831
+ request_id: string | null;
1832
+ };
1815
1833
  }
1816
1834
  export interface WhoAmI {
1817
1835
  object: 'whoami';
package/dist/index.js CHANGED
@@ -855,7 +855,33 @@ var Vibiz = class {
855
855
  /** Visitors, pageviews, top pages, sources, countries, events and a timeseries. */
856
856
  get: (projectId, opts = {}) => this.request(
857
857
  `/projects/${projectId}/analytics?period=${opts.period ?? "7d"}`
858
- )
858
+ ),
859
+ /**
860
+ * Visitor journeys, newest first: each visitor-day's source, landing page,
861
+ * pages in order, events, and whether it converted (a sale or a goal event).
862
+ */
863
+ visitors: (projectId, opts = {}) => {
864
+ const q = new URLSearchParams();
865
+ q.set("period", opts.period ?? "7d");
866
+ if (opts.source) q.set("source", opts.source);
867
+ if (opts.landing) q.set("landing", opts.landing);
868
+ if (opts.country) q.set("country", opts.country);
869
+ if (opts.converted) q.set("converted", "true");
870
+ if (opts.goals?.length) q.set("goals", opts.goals.join(","));
871
+ if (opts.limit) q.set("limit", String(opts.limit));
872
+ if (opts.cursor) q.set("cursor", opts.cursor);
873
+ return this.request(`/projects/${projectId}/analytics/visitors?${q}`);
874
+ },
875
+ /** One visitor's path on one UTC day: the timeline, its replays and the sales it led to. */
876
+ visitor: (projectId, visitorId, opts = {}) => {
877
+ const q = new URLSearchParams();
878
+ if (opts.day) q.set("day", opts.day);
879
+ if (opts.goals?.length) q.set("goals", opts.goals.join(","));
880
+ const qs2 = q.size ? `?${q}` : "";
881
+ return this.request(
882
+ `/projects/${projectId}/analytics/visitors/${encodeURIComponent(visitorId)}${qs2}`
883
+ );
884
+ }
859
885
  };
860
886
  /**
861
887
  * Mission Control (docs: Mission Control and health checks): every business
@@ -2227,7 +2253,7 @@ function formatMinor(minor, currency) {
2227
2253
  }
2228
2254
 
2229
2255
  // packages/sdk/src/one-key.ts
2230
- var APP_SDK_VERSION = "0.3.24";
2256
+ var APP_SDK_VERSION = "0.3.26";
2231
2257
  var ONE_KEY_GIVES = "database, sign-in, email and inbox, AI models, files, payments, analytics with session replays, web data, social, phone and connectors";
2232
2258
  function oneKeyMessage(url, host) {
2233
2259
  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.24";
13
+ export declare const APP_SDK_VERSION = "0.3.26";
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
@@ -1105,6 +1105,147 @@ export interface AnalyticsReport {
1105
1105
  visitors: number;
1106
1106
  }>;
1107
1107
  }
1108
+ /** First-touch attribution of a sale, as `vibiz.attribution()` captured it in the buyer's tab. */
1109
+ export interface Attribution {
1110
+ /** Referrer host or `utm_source`; null: a direct visit. */
1111
+ source: string | null;
1112
+ referrer: string | null;
1113
+ utm_source: string | null;
1114
+ utm_medium: string | null;
1115
+ utm_campaign: string | null;
1116
+ utm_term: string | null;
1117
+ utm_content: string | null;
1118
+ landing_page: string | null;
1119
+ /** The page the checkout started from. */
1120
+ checkout_page: string | null;
1121
+ /** The analytics visitor-day the sale links to (`analytics.visitor`). */
1122
+ visitor_id: string | null;
1123
+ day: string | null;
1124
+ first_seen_at: string | null;
1125
+ }
1126
+ /** A sale a visitor-day led to (its checkout carried that visitor's attribution). */
1127
+ export interface JourneySale {
1128
+ object: 'payment';
1129
+ console_url?: string;
1130
+ id: string;
1131
+ environment: 'production' | 'development';
1132
+ status: string;
1133
+ amount_cents: number;
1134
+ currency: string;
1135
+ created_at: string;
1136
+ checkout_page: string | null;
1137
+ }
1138
+ /** One visitor's day on the site (`GET /projects/:id/analytics/visitors`). */
1139
+ export interface VisitorJourney {
1140
+ object: 'visitor_journey';
1141
+ /** The journey in the web console, absolute: give it to the person. */
1142
+ console_url?: string;
1143
+ project_id: string;
1144
+ /** Pseudonymous: the browser's random id, the app's user (hashed) or a daily hash. */
1145
+ visitor_id: string;
1146
+ /** UTC day: a journey is one visitor on one day. */
1147
+ day: string;
1148
+ started_at: string;
1149
+ ended_at: string;
1150
+ duration_ms: number;
1151
+ /** The first page's source: referrer host or utm_source. Null: direct. */
1152
+ source: string | null;
1153
+ landing_page: string | null;
1154
+ country: string | null;
1155
+ device: string | null;
1156
+ pageviews: number;
1157
+ /** Custom events and outbound clicks. */
1158
+ events: number;
1159
+ /** A sale linked by attribution, or a conversion event (`goals`). */
1160
+ converted: boolean;
1161
+ sales: JourneySale[];
1162
+ }
1163
+ export interface VisitorJourneySummary extends VisitorJourney {
1164
+ /** Pages in order (the first 30). */
1165
+ pages: Array<{
1166
+ path: string;
1167
+ at: string;
1168
+ }>;
1169
+ /** Custom events in order (the first 20). */
1170
+ custom_events: Array<{
1171
+ name: string;
1172
+ path: string;
1173
+ at: string;
1174
+ }>;
1175
+ replays: Array<{
1176
+ id: string;
1177
+ object: 'replay';
1178
+ console_url?: string;
1179
+ started_at: string;
1180
+ duration_ms: number;
1181
+ }>;
1182
+ }
1183
+ export interface VisitorJourneyList {
1184
+ object: 'visitor_journey_list';
1185
+ console_url?: string;
1186
+ project_id: string;
1187
+ period: AnalyticsPeriod;
1188
+ from: string;
1189
+ to: string;
1190
+ filters: {
1191
+ source: string | null;
1192
+ landing: string | null;
1193
+ country: string | null;
1194
+ converted: boolean;
1195
+ goals: string[] | null;
1196
+ };
1197
+ /** Newest first. */
1198
+ data: VisitorJourneySummary[];
1199
+ has_more: boolean;
1200
+ /** Pass as `cursor` for the next page. */
1201
+ next_cursor: string | null;
1202
+ note: string;
1203
+ }
1204
+ export interface VisitorJourneyDetail extends VisitorJourney {
1205
+ /** Every source the visitor arrived from that day, in order. */
1206
+ sources: string[];
1207
+ /** Every pageview and event in order (at most 1,000). */
1208
+ timeline: Array<{
1209
+ at: string;
1210
+ offset_ms: number;
1211
+ type: 'pageview' | 'event';
1212
+ /** Events only. */
1213
+ name?: string;
1214
+ path: string;
1215
+ source?: string;
1216
+ props?: Record<string, string>;
1217
+ /** Pageviews: until the visitor's next event that day. */
1218
+ time_on_page_ms?: number;
1219
+ }>;
1220
+ timeline_truncated: boolean;
1221
+ /** Recordings of the visit: `visitor` stamped by the tag, `time` matched by device, country and time. */
1222
+ replays: Array<{
1223
+ id: string;
1224
+ object: 'replay';
1225
+ console_url?: string;
1226
+ project_id: string;
1227
+ started_at: string;
1228
+ duration_ms: number;
1229
+ pages: string[];
1230
+ source: string | null;
1231
+ match: 'visitor' | 'time';
1232
+ }>;
1233
+ }
1234
+ export interface VisitorJourneyQuery {
1235
+ period?: AnalyticsPeriod;
1236
+ /** First source, e.g. `google.com` or `newsletter`; `direct` for none. */
1237
+ source?: string;
1238
+ /** Landing page path, e.g. `/pricing`. */
1239
+ landing?: string;
1240
+ /** Two-letter country code. */
1241
+ country?: string;
1242
+ /** Only visitor-days with a sale or a conversion event. */
1243
+ converted?: boolean;
1244
+ /** Event names that count as a conversion (default: Purchase, Signup, Subscribe…). */
1245
+ goals?: string[];
1246
+ limit?: number;
1247
+ cursor?: string;
1248
+ }
1108
1249
  export type ReplayPeriod = '24h' | '7d' | '30d';
1109
1250
  export type ReplayTrigger = 'error' | 'rage' | 'dead' | 'event' | 'always' | 'sample';
1110
1251
  /** Settings of the `replay` resource. */
@@ -1133,6 +1274,11 @@ export interface ReplaySummary {
1133
1274
  trigger: ReplayTrigger;
1134
1275
  device: string | null;
1135
1276
  country: string | null;
1277
+ /** Where the visitor came from (referrer host or utm_source); null: direct or not known. */
1278
+ source?: string | null;
1279
+ landing_page?: string | null;
1280
+ /** The analytics visitor-day this tab is part of (`analytics.visitor`). */
1281
+ visitor_id?: string | null;
1136
1282
  pages: string[];
1137
1283
  counts: {
1138
1284
  clicks: number;
@@ -2697,6 +2843,8 @@ export interface CheckoutInput {
2697
2843
  metadata?: Record<string, string>;
2698
2844
  /** The business's look on the page, over the project's brand field by field. */
2699
2845
  brand?: CheckoutBrand;
2846
+ /** Where the buyer came from: what `vibiz.attribution()` gave in their browser. */
2847
+ attribution?: Partial<Attribution> | null;
2700
2848
  }
2701
2849
  export interface Checkout {
2702
2850
  object: 'checkout';
@@ -2729,6 +2877,8 @@ export interface Payment {
2729
2877
  price_id: string | null;
2730
2878
  subscription_id: string | null;
2731
2879
  metadata: Record<string, string>;
2880
+ /** Where the buyer came from, as the checkout carried it; null: sent without it. */
2881
+ attribution?: Attribution | null;
2732
2882
  card: {
2733
2883
  brand: string;
2734
2884
  last4: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vibiz/sdk",
3
- "version": "0.3.24",
3
+ "version": "0.3.26",
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",