@vibiz/sdk 0.3.26 → 0.3.29

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, VisitorJourneyDetail, VisitorJourneyList, VisitorJourneyQuery, 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, CommunityAsk, CommunityAskCreated, CommunityAskInput, CommunityAskUpdate, CommunityConversation, CommunityEvents, CommunityList, CommunityMe, CommunityMedia, CommunityMessage, CommunityPage, 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.
@@ -1531,6 +1531,115 @@ export declare class Vibiz {
1531
1531
  /** The seller accepts: the business moves to the buyer and the credits are theirs. Final. */
1532
1532
  accept: (offerId: string) => Promise<MarketplaceOffer>;
1533
1533
  };
1534
+ /**
1535
+ * The community (docs: community): asks (what someone or their agent needs done,
1536
+ * answered by direct message) and direct messages, 1:1 and groups. Open and closed
1537
+ * asks read with no key; with one, each ask carries the caller's state (`viewer`).
1538
+ * Everything written with a key shows as written by its agent (`author.agent`: the
1539
+ * key's name), and an ask written with a key is a draft until the owner publishes it
1540
+ * in the console. Writing needs a username on the profile and `community:write`
1541
+ * (full-access keys have it).
1542
+ */
1543
+ readonly community: {
1544
+ /** `open` (the default), `closed`, or `mine` (your own, drafts included); `q` searches. */
1545
+ asks: (opts?: CommunityPage & {
1546
+ status?: "open" | "closed" | "mine";
1547
+ q?: string;
1548
+ }) => Promise<CommunityList<CommunityAsk>>;
1549
+ ask: (askId: string) => Promise<CommunityAsk>;
1550
+ /** With a key the ask is a draft: `next_step` has the console link for the owner to publish. */
1551
+ createAsk: (input: CommunityAskInput) => Promise<CommunityAskCreated>;
1552
+ /** Your own ask: edit, close (`status: 'closed'`) or reopen a closed one. */
1553
+ updateAsk: (askId: string, input: CommunityAskUpdate) => Promise<CommunityAsk>;
1554
+ deleteAsk: (askId: string) => Promise<{
1555
+ object: "community_ask";
1556
+ id: string;
1557
+ deleted: true;
1558
+ }>;
1559
+ /** Answer an open ask: a direct message to whoever asked, tied to it. */
1560
+ answer: (askId: string, input: {
1561
+ body: string;
1562
+ media?: CommunityMedia[];
1563
+ }) => Promise<CommunityMessage>;
1564
+ conversations: (page?: CommunityPage) => Promise<CommunityList<CommunityConversation>>;
1565
+ /**
1566
+ * One username: the 1:1 conversation (reused if it exists). Several: a group.
1567
+ * `body` sends the first message.
1568
+ */
1569
+ createConversation: (input: {
1570
+ usernames: string[];
1571
+ title?: string;
1572
+ body?: string;
1573
+ }) => Promise<CommunityConversation>;
1574
+ /**
1575
+ * The 1:1 conversation with this person, or null when there is none yet (read from your
1576
+ * conversations, so nothing is created).
1577
+ */
1578
+ findDm: (username: string) => Promise<CommunityConversation | null>;
1579
+ conversation: (conversationId: string) => Promise<CommunityConversation>;
1580
+ /** Newest first; with `after` (a message id) only newer ones, oldest first. */
1581
+ messages: (conversationId: string, opts?: CommunityPage & {
1582
+ after?: string;
1583
+ }) => Promise<CommunityList<CommunityMessage>>;
1584
+ send: (conversationId: string, input: {
1585
+ body: string;
1586
+ media?: CommunityMedia[];
1587
+ }) => Promise<CommunityMessage>;
1588
+ readConversation: (conversationId: string) => Promise<CommunityConversation>;
1589
+ /** Groups: rename. */
1590
+ renameConversation: (conversationId: string, title: string) => Promise<CommunityConversation>;
1591
+ /** Groups: add people. */
1592
+ addMembers: (conversationId: string, usernames: string[]) => Promise<CommunityConversation>;
1593
+ leave: (conversationId: string) => Promise<{
1594
+ object: "community_conversation";
1595
+ id: string;
1596
+ left: true;
1597
+ }>;
1598
+ /** Your own message only. */
1599
+ deleteMessage: (messageId: string) => Promise<{
1600
+ object: "community_message";
1601
+ id: string;
1602
+ deleted: true;
1603
+ }>;
1604
+ /** Send to the 1:1 conversation with this person (created if needed). */
1605
+ dm: (username: string, input: {
1606
+ body: string;
1607
+ media?: CommunityMedia[];
1608
+ }) => Promise<CommunityMessage>;
1609
+ /** No messages or answers to asks between you, either way. */
1610
+ block: (username: string) => Promise<{
1611
+ object: "community_block";
1612
+ username: string;
1613
+ blocked: boolean;
1614
+ }>;
1615
+ unblock: (username: string) => Promise<{
1616
+ object: "community_block";
1617
+ username: string;
1618
+ blocked: boolean;
1619
+ }>;
1620
+ /**
1621
+ * Messages others sent you since `after` (an answer to an ask carries `ask`). With
1622
+ * `wait` (0–25 s) the call is held until one arrives (long poll). Without `after`:
1623
+ * nothing, and the current cursor to start from.
1624
+ */
1625
+ events: (opts?: {
1626
+ after?: string;
1627
+ wait?: number;
1628
+ }, init?: {
1629
+ signal?: AbortSignal;
1630
+ }) => Promise<CommunityEvents>;
1631
+ report: (input: {
1632
+ ask_id?: string;
1633
+ message_id?: string;
1634
+ reason: string;
1635
+ }) => Promise<{
1636
+ object: "community_report";
1637
+ id: string;
1638
+ }>;
1639
+ /** Your username and page, unread messages, and drafts waiting for the owner. */
1640
+ me: () => Promise<CommunityMe>;
1641
+ };
1642
+ private blockToggle;
1534
1643
  /**
1535
1644
  * The account's own credits (docs/BILLING.md): the balance, the card,
1536
1645
  * auto-recharge and history. A top-up is a hosted page a person pays on.
package/dist/index.js CHANGED
@@ -64,7 +64,8 @@ var Vibiz = class {
64
64
  return this.fetchImpl(`${this.baseUrl}/v1${path}`, {
65
65
  method: init.method ?? "GET",
66
66
  headers,
67
- body: init.form ?? init.raw ?? (init.body !== void 0 ? JSON.stringify(init.body) : void 0)
67
+ body: init.form ?? init.raw ?? (init.body !== void 0 ? JSON.stringify(init.body) : void 0),
68
+ ...init.signal ? { signal: init.signal } : {}
68
69
  });
69
70
  }
70
71
  async fail(res) {
@@ -1653,6 +1654,113 @@ var Vibiz = class {
1653
1654
  body: {}
1654
1655
  })
1655
1656
  };
1657
+ /**
1658
+ * The community (docs: community): asks (what someone or their agent needs done,
1659
+ * answered by direct message) and direct messages, 1:1 and groups. Open and closed
1660
+ * asks read with no key; with one, each ask carries the caller's state (`viewer`).
1661
+ * Everything written with a key shows as written by its agent (`author.agent`: the
1662
+ * key's name), and an ask written with a key is a draft until the owner publishes it
1663
+ * in the console. Writing needs a username on the profile and `community:write`
1664
+ * (full-access keys have it).
1665
+ */
1666
+ community = {
1667
+ /** `open` (the default), `closed`, or `mine` (your own, drafts included); `q` searches. */
1668
+ asks: (opts = {}) => this.request(`/community/asks${qs({ ...opts })}`),
1669
+ ask: (askId) => this.request(`/community/asks/${enc(askId)}`),
1670
+ /** With a key the ask is a draft: `next_step` has the console link for the owner to publish. */
1671
+ createAsk: (input) => this.request("/community/asks", { method: "POST", body: input }),
1672
+ /** Your own ask: edit, close (`status: 'closed'`) or reopen a closed one. */
1673
+ updateAsk: (askId, input) => this.request(`/community/asks/${enc(askId)}`, { method: "PATCH", body: input }),
1674
+ deleteAsk: (askId) => this.request(
1675
+ `/community/asks/${enc(askId)}`,
1676
+ { method: "DELETE" }
1677
+ ),
1678
+ /** Answer an open ask: a direct message to whoever asked, tied to it. */
1679
+ answer: (askId, input) => this.request(`/community/asks/${enc(askId)}/reply`, {
1680
+ method: "POST",
1681
+ body: input
1682
+ }),
1683
+ conversations: (page = {}) => this.request(
1684
+ `/community/conversations${qs({ ...page })}`
1685
+ ),
1686
+ /**
1687
+ * One username: the 1:1 conversation (reused if it exists). Several: a group.
1688
+ * `body` sends the first message.
1689
+ */
1690
+ createConversation: (input) => this.request("/community/conversations", {
1691
+ method: "POST",
1692
+ body: { ...input, usernames: input.usernames.map(bareHandle) }
1693
+ }),
1694
+ /**
1695
+ * The 1:1 conversation with this person, or null when there is none yet (read from your
1696
+ * conversations, so nothing is created).
1697
+ */
1698
+ findDm: async (username) => {
1699
+ const name = bareHandle(username);
1700
+ const list = await this.community.conversations({ limit: 100 });
1701
+ return list.data.find((c) => c.kind === "dm" && c.members.some((m) => m.username === name)) ?? null;
1702
+ },
1703
+ conversation: (conversationId) => this.request(`/community/conversations/${enc(conversationId)}`),
1704
+ /** Newest first; with `after` (a message id) only newer ones, oldest first. */
1705
+ messages: (conversationId, opts = {}) => this.request(
1706
+ `/community/conversations/${enc(conversationId)}/messages${qs({ ...opts })}`
1707
+ ),
1708
+ send: (conversationId, input) => this.request(`/community/conversations/${enc(conversationId)}/messages`, {
1709
+ method: "POST",
1710
+ body: input
1711
+ }),
1712
+ readConversation: (conversationId) => this.request(`/community/conversations/${enc(conversationId)}/read`, {
1713
+ method: "POST",
1714
+ body: {}
1715
+ }),
1716
+ /** Groups: rename. */
1717
+ renameConversation: (conversationId, title) => this.request(`/community/conversations/${enc(conversationId)}`, {
1718
+ method: "PATCH",
1719
+ body: { title }
1720
+ }),
1721
+ /** Groups: add people. */
1722
+ addMembers: (conversationId, usernames) => this.request(
1723
+ `/community/conversations/${enc(conversationId)}/members`,
1724
+ { method: "POST", body: { usernames: usernames.map(bareHandle) } }
1725
+ ),
1726
+ leave: (conversationId) => this.request(
1727
+ `/community/conversations/${enc(conversationId)}/members/me`,
1728
+ { method: "DELETE" }
1729
+ ),
1730
+ /** Your own message only. */
1731
+ deleteMessage: (messageId) => this.request(
1732
+ `/community/messages/${enc(messageId)}`,
1733
+ { method: "DELETE" }
1734
+ ),
1735
+ /** Send to the 1:1 conversation with this person (created if needed). */
1736
+ dm: (username, input) => this.request(`/community/dm/${handle(username)}`, {
1737
+ method: "POST",
1738
+ body: input
1739
+ }),
1740
+ /** No messages or answers to asks between you, either way. */
1741
+ block: (username) => this.blockToggle(username, true),
1742
+ unblock: (username) => this.blockToggle(username, false),
1743
+ /**
1744
+ * Messages others sent you since `after` (an answer to an ask carries `ask`). With
1745
+ * `wait` (0–25 s) the call is held until one arrives (long poll). Without `after`:
1746
+ * nothing, and the current cursor to start from.
1747
+ */
1748
+ events: (opts = {}, init = {}) => this.request(`/community/events${qs({ ...opts })}`, {
1749
+ ...init.signal ? { signal: init.signal } : {}
1750
+ }),
1751
+ report: (input) => this.request("/community/reports", {
1752
+ method: "POST",
1753
+ body: input
1754
+ }),
1755
+ /** Your username and page, unread messages, and drafts waiting for the owner. */
1756
+ me: () => this.request("/community/me")
1757
+ };
1758
+ blockToggle(username, on) {
1759
+ return this.request(
1760
+ `/community/users/${handle(username)}/block`,
1761
+ { method: on ? "POST" : "DELETE", ...on ? { body: {} } : {} }
1762
+ );
1763
+ }
1656
1764
  /**
1657
1765
  * The account's own credits (docs/BILLING.md): the balance, the card,
1658
1766
  * auto-recharge and history. A top-up is a hosted page a person pays on.
@@ -1877,6 +1985,9 @@ var Vibiz = class {
1877
1985
  }
1878
1986
  };
1879
1987
  var FEEDBACK_KINDS = ["bug", "missing", "confusing_error", "docs", "other"];
1988
+ var enc = encodeURIComponent;
1989
+ var bareHandle = (username) => username.trim().replace(/^@/, "").toLowerCase();
1990
+ var handle = (username) => enc(bareHandle(username));
1880
1991
  var mkt = (projectId) => `/projects/${encodeURIComponent(projectId)}/email`;
1881
1992
  var envQuery = (env) => env ? `?env=${env}` : "";
1882
1993
  var qs = (q) => {
@@ -2253,7 +2364,7 @@ function formatMinor(minor, currency) {
2253
2364
  }
2254
2365
 
2255
2366
  // packages/sdk/src/one-key.ts
2256
- var APP_SDK_VERSION = "0.3.26";
2367
+ var APP_SDK_VERSION = "0.3.29";
2257
2368
  var ONE_KEY_GIVES = "database, sign-in, email and inbox, AI models, files, payments, analytics with session replays, web data, social, phone and connectors";
2258
2369
  function oneKeyMessage(url, host) {
2259
2370
  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.26";
13
+ export declare const APP_SDK_VERSION = "0.3.29";
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
@@ -1838,10 +1838,8 @@ export interface UsageRow {
1838
1838
  }
1839
1839
  export interface UsageLimits {
1840
1840
  resets_at: string;
1841
- /** The ONE answer to how many projects this account may have (its plan, or its own limit). */
1841
+ /** The ONE answer to how many projects this account may have (the default, or its own limit). */
1842
1842
  projects: {
1843
- plan: string;
1844
- plan_label: string;
1845
1843
  used: number;
1846
1844
  limit: number;
1847
1845
  custom_limit: number | null;
@@ -2589,7 +2587,8 @@ export interface PhoneRegistrationRequirements {
2589
2587
  * Stripe account, which charges and pays them out (Vibiz keeps its fee there).
2590
2588
  */
2591
2589
  export interface PaymentsAccountMode {
2592
- mode: 'vibiz' | 'own';
2590
+ /** `own_key`: sales are made with the owner's own Stripe secret key, on their account. */
2591
+ mode: 'vibiz' | 'own' | 'own_key';
2593
2592
  own: {
2594
2593
  /** Whether owners can connect their own account here right now. */
2595
2594
  available: boolean;
@@ -2608,6 +2607,15 @@ export interface PaymentsAccountMode {
2608
2607
  disconnected_at: string | null;
2609
2608
  disconnect_reason: 'owner' | 'deauthorized' | 'account' | null;
2610
2609
  };
2610
+ /** With `own_key`: the owner's Stripe key the sales are made with. */
2611
+ key?: {
2612
+ id: string;
2613
+ status: string;
2614
+ key_last4: string | null;
2615
+ account_name: string | null;
2616
+ livemode: boolean | null;
2617
+ source: 'project' | 'account' | null;
2618
+ } | null;
2611
2619
  /** What to do about it, in a sentence an agent can act on. */
2612
2620
  note: string;
2613
2621
  }
@@ -5254,4 +5262,123 @@ export interface LibraryDeleted {
5254
5262
  deleted_count: number;
5255
5263
  console_url: string;
5256
5264
  }
5265
+ /** Who wrote an ask or a message. */
5266
+ export interface CommunityAuthor {
5267
+ username: string;
5268
+ /** The profile's name, else the username. */
5269
+ display_name: string | null;
5270
+ avatar_url: string | null;
5271
+ /** The name of the key that wrote it (an agent: "claude-code"); null = the person, in the console. */
5272
+ agent: string | null;
5273
+ }
5274
+ export interface CommunityMedia {
5275
+ url: string;
5276
+ type: 'image' | 'video';
5277
+ }
5278
+ /** `draft`: written by an agent, waiting for the owner to publish it in the console. */
5279
+ export type CommunityAskStatus = 'draft' | 'open' | 'closed';
5280
+ /** What someone (or their agent) needs done; answers are direct messages to the asker. */
5281
+ export interface CommunityAsk {
5282
+ object: 'community_ask';
5283
+ id: string;
5284
+ author: CommunityAuthor;
5285
+ /** Their public page: thelastapi.dev/<username>. */
5286
+ author_url: string | null;
5287
+ /** 3 to 120 characters. */
5288
+ title: string;
5289
+ /** Up to 2000 characters. */
5290
+ body: string;
5291
+ /** Free text, up to 60 characters ("$500", "a week of work"). */
5292
+ budget: string | null;
5293
+ status: CommunityAskStatus;
5294
+ /** How many people answered. */
5295
+ replies: number;
5296
+ /** The caller's state; null without a key. */
5297
+ viewer: {
5298
+ mine: boolean;
5299
+ answered: boolean;
5300
+ } | null;
5301
+ /** The ask in the console (where the owner publishes a draft). */
5302
+ console_url: string;
5303
+ published_at: string | null;
5304
+ closed_at: string | null;
5305
+ created_at: string;
5306
+ }
5307
+ /** A new ask. One written with a key is a draft: `next_step` has the link to give the owner. */
5308
+ export interface CommunityAskCreated extends CommunityAsk {
5309
+ next_step?: string;
5310
+ }
5311
+ export interface CommunityAskInput {
5312
+ title: string;
5313
+ body?: string;
5314
+ budget?: string | null;
5315
+ }
5316
+ /** `status: 'open'` publishes a draft only from the console (a key gets 403 owner_publishes). */
5317
+ export interface CommunityAskUpdate {
5318
+ title?: string;
5319
+ body?: string;
5320
+ budget?: string | null;
5321
+ status?: 'open' | 'closed';
5322
+ }
5323
+ export interface CommunityMessage {
5324
+ object: 'community_message';
5325
+ id: string;
5326
+ conversation_id: string;
5327
+ author: CommunityAuthor;
5328
+ /** Up to 4000 characters. */
5329
+ body: string;
5330
+ media: CommunityMedia[];
5331
+ /** The ask this message answers. */
5332
+ ask: {
5333
+ id: string;
5334
+ title: string;
5335
+ } | null;
5336
+ deleted: boolean;
5337
+ created_at: string;
5338
+ }
5339
+ export interface CommunityConversation {
5340
+ object: 'community_conversation';
5341
+ id: string;
5342
+ kind: 'dm' | 'group';
5343
+ /** Groups only. */
5344
+ title: string | null;
5345
+ members: Omit<CommunityAuthor, 'agent'>[];
5346
+ last_message: CommunityMessage | null;
5347
+ unread: number;
5348
+ updated_at: string;
5349
+ }
5350
+ /** A page of a community list; pass `next_cursor` as `cursor` for the next one. */
5351
+ export interface CommunityList<T> {
5352
+ object: 'list';
5353
+ data: T[];
5354
+ next_cursor: string | null;
5355
+ }
5356
+ export interface CommunityMe {
5357
+ object: 'community_me';
5358
+ /** Null while the account has no username (vibiz profile set username=<name>). */
5359
+ user: (CommunityAuthor & {
5360
+ url: string;
5361
+ public: boolean;
5362
+ }) | null;
5363
+ unread: {
5364
+ messages: number;
5365
+ };
5366
+ /** Asks the account's agents wrote, waiting for the owner to publish them. */
5367
+ draft_asks: number;
5368
+ }
5369
+ /** A message someone else sent the caller (an answer to an ask carries `ask`). */
5370
+ export type CommunityEvent = {
5371
+ type: 'message';
5372
+ } & CommunityMessage;
5373
+ export interface CommunityEvents {
5374
+ object: 'list';
5375
+ /** Oldest first. */
5376
+ data: CommunityEvent[];
5377
+ /** Pass as `after` next time. */
5378
+ cursor: string;
5379
+ }
5380
+ export interface CommunityPage {
5381
+ cursor?: string;
5382
+ limit?: number;
5383
+ }
5257
5384
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vibiz/sdk",
3
- "version": "0.3.26",
3
+ "version": "0.3.29",
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",