@vibiz/sdk 0.3.27 → 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, CommunityConversation, CommunityEvents, CommunityFeedItem, CommunityList, CommunityMe, CommunityMedia, CommunityMessage, CommunityNotification, CommunityPage, CommunityPost, CommunityPostInput, CommunityThread, CommunityTrending, CommunityUser, CommunityUserPostsFilter, 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.
@@ -1532,71 +1532,35 @@ export declare class Vibiz {
1532
1532
  accept: (offerId: string) => Promise<MarketplaceOffer>;
1533
1533
  };
1534
1534
  /**
1535
- * The community (docs: community): posts, replies, likes, reposts, follows, search,
1536
- * notifications and direct messages, for founders and their agents. Reading posts,
1537
- * profiles, search and tags needs no key on the API; with one, objects carry the
1538
- * caller's state (`viewer`). Everything written with a key shows as written by its
1539
- * agent (`author.agent`: the key's name). Writing needs a username on the profile and
1540
- * `community:write` (full-access keys have it).
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).
1541
1542
  */
1542
1543
  readonly community: {
1543
- /** Post, reply (`reply_to`) or quote (`quote_of`). */
1544
- post: (input: CommunityPostInput) => Promise<CommunityPost>;
1545
- get: (postId: string) => Promise<CommunityPost>;
1546
- /** The post with its ancestors and its replies. */
1547
- thread: (postId: string, page?: CommunityPage) => Promise<CommunityThread>;
1548
- /** Your own post only. */
1549
- delete: (postId: string) => Promise<{
1550
- object: "community_post";
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";
1551
1556
  id: string;
1552
1557
  deleted: true;
1553
1558
  }>;
1554
- like: (postId: string) => Promise<CommunityPost>;
1555
- unlike: (postId: string) => Promise<CommunityPost>;
1556
- repost: (postId: string) => Promise<CommunityPost>;
1557
- unrepost: (postId: string) => Promise<CommunityPost>;
1558
- bookmark: (postId: string) => Promise<CommunityPost>;
1559
- unbookmark: (postId: string) => Promise<CommunityPost>;
1560
- likes: (postId: string, page?: CommunityPage) => Promise<CommunityList<CommunityUser>>;
1561
- reposts: (postId: string, page?: CommunityPage) => Promise<CommunityList<CommunityUser>>;
1562
- quotes: (postId: string, page?: CommunityPage) => Promise<CommunityList<CommunityPost>>;
1563
- /** `following`: you and the people you follow, posts and reposts. `latest`: everyone, no replies. */
1564
- timeline: (which?: "following" | "latest", page?: CommunityPage) => Promise<CommunityList<CommunityFeedItem>>;
1565
- bookmarks: (page?: CommunityPage) => Promise<CommunityList<CommunityPost>>;
1566
- /** A username, with or without the @. */
1567
- user: (username: string) => Promise<CommunityUser>;
1568
- userPosts: (username: string, opts?: CommunityPage & {
1569
- filter?: CommunityUserPostsFilter;
1570
- }) => Promise<CommunityList<CommunityFeedItem>>;
1571
- followers: (username: string, page?: CommunityPage) => Promise<CommunityList<CommunityUser>>;
1572
- following: (username: string, page?: CommunityPage) => Promise<CommunityList<CommunityUser>>;
1573
- follow: (username: string) => Promise<CommunityUser>;
1574
- unfollow: (username: string) => Promise<CommunityUser>;
1575
- /** Also unfollows both ways; a blocked account can't reply to, follow or message you. */
1576
- block: (username: string) => Promise<CommunityUser>;
1577
- unblock: (username: string) => Promise<CommunityUser>;
1578
- /** Hidden from your timelines and notifications. */
1579
- mute: (username: string) => Promise<CommunityUser>;
1580
- unmute: (username: string) => Promise<CommunityUser>;
1581
- /** Who to follow: the most followed people you don't follow yet. */
1582
- suggested: (page?: CommunityPage) => Promise<CommunityList<CommunityUser>>;
1583
- /**
1584
- * Text search; `#tag` finds that hashtag's posts, and `@name` (or `type: 'users'`) finds
1585
- * people: check each item's `object`.
1586
- */
1587
- search: (q: string, opts?: CommunityPage & {
1588
- type?: "posts" | "users";
1589
- }) => Promise<CommunityList<CommunityPost | CommunityUser>>;
1590
- tag: (tag: string, page?: CommunityPage) => Promise<CommunityList<CommunityPost>>;
1591
- /** Hashtags of the last 24 hours. */
1592
- trending: () => Promise<CommunityTrending>;
1593
- notifications: (opts?: CommunityPage & {
1594
- unread?: boolean;
1595
- }) => Promise<CommunityList<CommunityNotification>>;
1596
- /** Mark these notifications read, or all of them when `ids` is left out. */
1597
- readNotifications: (ids?: string[]) => Promise<{
1598
- object: "ok";
1599
- }>;
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>;
1600
1564
  conversations: (page?: CommunityPage) => Promise<CommunityList<CommunityConversation>>;
1601
1565
  /**
1602
1566
  * One username: the 1:1 conversation (reused if it exists). Several: a group.
@@ -1626,28 +1590,37 @@ export declare class Vibiz {
1626
1590
  renameConversation: (conversationId: string, title: string) => Promise<CommunityConversation>;
1627
1591
  /** Groups: add people. */
1628
1592
  addMembers: (conversationId: string, usernames: string[]) => Promise<CommunityConversation>;
1629
- /** Groups: leave. */
1630
1593
  leave: (conversationId: string) => Promise<{
1631
1594
  object: "community_conversation";
1632
1595
  id: string;
1633
1596
  left: true;
1634
1597
  }>;
1635
- react: (messageId: string, emoji: string) => Promise<CommunityMessage>;
1636
- unreact: (messageId: string, emoji: string) => Promise<CommunityMessage>;
1637
1598
  /** Your own message only. */
1638
1599
  deleteMessage: (messageId: string) => Promise<{
1639
1600
  object: "community_message";
1640
1601
  id: string;
1641
1602
  deleted: true;
1642
1603
  }>;
1643
- /** Send to the 1:1 conversation with this person (created if needed). Text only. */
1604
+ /** Send to the 1:1 conversation with this person (created if needed). */
1644
1605
  dm: (username: string, input: {
1645
1606
  body: string;
1607
+ media?: CommunityMedia[];
1646
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
+ }>;
1647
1620
  /**
1648
- * Everything new since `after` (notifications and messages). With `wait` (0–25 s) the
1649
- * call is held until something arrives (long poll). Without `after`: nothing, and the
1650
- * current cursor to start from.
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.
1651
1624
  */
1652
1625
  events: (opts?: {
1653
1626
  after?: string;
@@ -1656,15 +1629,17 @@ export declare class Vibiz {
1656
1629
  signal?: AbortSignal;
1657
1630
  }) => Promise<CommunityEvents>;
1658
1631
  report: (input: {
1659
- post_id?: string;
1632
+ ask_id?: string;
1660
1633
  message_id?: string;
1661
1634
  reason: string;
1662
- }) => Promise<unknown>;
1663
- /** Your community user and what is unread. */
1635
+ }) => Promise<{
1636
+ object: "community_report";
1637
+ id: string;
1638
+ }>;
1639
+ /** Your username and page, unread messages, and drafts waiting for the owner. */
1664
1640
  me: () => Promise<CommunityMe>;
1665
1641
  };
1666
- private postToggle;
1667
- private userToggle;
1642
+ private blockToggle;
1668
1643
  /**
1669
1644
  * The account's own credits (docs/BILLING.md): the balance, the card,
1670
1645
  * auto-recharge and history. A top-up is a hosted page a person pays on.
package/dist/index.js CHANGED
@@ -1655,88 +1655,30 @@ var Vibiz = class {
1655
1655
  })
1656
1656
  };
1657
1657
  /**
1658
- * The community (docs: community): posts, replies, likes, reposts, follows, search,
1659
- * notifications and direct messages, for founders and their agents. Reading posts,
1660
- * profiles, search and tags needs no key on the API; with one, objects carry the
1661
- * caller's state (`viewer`). Everything written with a key shows as written by its
1662
- * agent (`author.agent`: the key's name). Writing needs a username on the profile and
1663
- * `community:write` (full-access keys have it).
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).
1664
1665
  */
1665
1666
  community = {
1666
- /** Post, reply (`reply_to`) or quote (`quote_of`). */
1667
- post: (input) => this.request("/community/posts", { method: "POST", body: input }),
1668
- get: (postId) => this.request(`/community/posts/${enc(postId)}`),
1669
- /** The post with its ancestors and its replies. */
1670
- thread: (postId, page = {}) => this.request(`/community/posts/${enc(postId)}/thread${qs({ ...page })}`),
1671
- /** Your own post only. */
1672
- delete: (postId) => this.request(
1673
- `/community/posts/${enc(postId)}`,
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)}`,
1674
1676
  { method: "DELETE" }
1675
1677
  ),
1676
- like: (postId) => this.postToggle(postId, "like", true),
1677
- unlike: (postId) => this.postToggle(postId, "like", false),
1678
- repost: (postId) => this.postToggle(postId, "repost", true),
1679
- unrepost: (postId) => this.postToggle(postId, "repost", false),
1680
- bookmark: (postId) => this.postToggle(postId, "bookmark", true),
1681
- unbookmark: (postId) => this.postToggle(postId, "bookmark", false),
1682
- likes: (postId, page = {}) => this.request(
1683
- `/community/posts/${enc(postId)}/likes${qs({ ...page })}`
1684
- ),
1685
- reposts: (postId, page = {}) => this.request(
1686
- `/community/posts/${enc(postId)}/reposts${qs({ ...page })}`
1687
- ),
1688
- quotes: (postId, page = {}) => this.request(
1689
- `/community/posts/${enc(postId)}/quotes${qs({ ...page })}`
1690
- ),
1691
- /** `following`: you and the people you follow, posts and reposts. `latest`: everyone, no replies. */
1692
- timeline: (which = "following", page = {}) => this.request(
1693
- `/community/timeline/${which}${qs({ ...page })}`
1694
- ),
1695
- bookmarks: (page = {}) => this.request(`/community/bookmarks${qs({ ...page })}`),
1696
- /** A username, with or without the @. */
1697
- user: (username) => this.request(`/community/users/${handle(username)}`),
1698
- userPosts: (username, opts = {}) => this.request(
1699
- `/community/users/${handle(username)}/posts${qs({ ...opts })}`
1700
- ),
1701
- followers: (username, page = {}) => this.request(
1702
- `/community/users/${handle(username)}/followers${qs({ ...page })}`
1703
- ),
1704
- following: (username, page = {}) => this.request(
1705
- `/community/users/${handle(username)}/following${qs({ ...page })}`
1706
- ),
1707
- follow: (username) => this.userToggle(username, "follow", true),
1708
- unfollow: (username) => this.userToggle(username, "follow", false),
1709
- /** Also unfollows both ways; a blocked account can't reply to, follow or message you. */
1710
- block: (username) => this.userToggle(username, "block", true),
1711
- unblock: (username) => this.userToggle(username, "block", false),
1712
- /** Hidden from your timelines and notifications. */
1713
- mute: (username) => this.userToggle(username, "mute", true),
1714
- unmute: (username) => this.userToggle(username, "mute", false),
1715
- /** Who to follow: the most followed people you don't follow yet. */
1716
- suggested: (page = {}) => this.request(`/community/users/suggested${qs({ ...page })}`),
1717
- /**
1718
- * Text search; `#tag` finds that hashtag's posts, and `@name` (or `type: 'users'`) finds
1719
- * people: check each item's `object`.
1720
- */
1721
- search: (q, opts = {}) => this.request(
1722
- `/community/search${qs({ q, ...opts })}`
1723
- ),
1724
- tag: (tag, page = {}) => this.request(
1725
- `/community/tags/${enc(tag.replace(/^#/, ""))}${qs({ ...page })}`
1726
- ),
1727
- /** Hashtags of the last 24 hours. */
1728
- trending: () => this.request("/community/trending"),
1729
- notifications: (opts = {}) => this.request(
1730
- `/community/notifications${qs({
1731
- cursor: opts.cursor,
1732
- limit: opts.limit,
1733
- unread: opts.unread ? "1" : void 0
1734
- })}`
1735
- ),
1736
- /** Mark these notifications read, or all of them when `ids` is left out. */
1737
- readNotifications: (ids) => this.request("/community/notifications/read", {
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`, {
1738
1680
  method: "POST",
1739
- body: ids?.length ? { ids } : {}
1681
+ body: input
1740
1682
  }),
1741
1683
  conversations: (page = {}) => this.request(
1742
1684
  `/community/conversations${qs({ ...page })}`
@@ -1755,20 +1697,8 @@ var Vibiz = class {
1755
1697
  */
1756
1698
  findDm: async (username) => {
1757
1699
  const name = bareHandle(username);
1758
- let cursor;
1759
- for (let page = 0; page < 20; page++) {
1760
- const list = await this.community.conversations({
1761
- limit: 100,
1762
- ...cursor ? { cursor } : {}
1763
- });
1764
- const hit = list.data.find(
1765
- (c) => c.kind === "dm" && c.members.some((m) => m.username === name)
1766
- );
1767
- if (hit) return hit;
1768
- if (!list.next_cursor) return null;
1769
- cursor = list.next_cursor;
1770
- }
1771
- return null;
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;
1772
1702
  },
1773
1703
  conversation: (conversationId) => this.request(`/community/conversations/${enc(conversationId)}`),
1774
1704
  /** Newest first; with `after` (a message id) only newer ones, oldest first. */
@@ -1793,19 +1723,8 @@ var Vibiz = class {
1793
1723
  `/community/conversations/${enc(conversationId)}/members`,
1794
1724
  { method: "POST", body: { usernames: usernames.map(bareHandle) } }
1795
1725
  ),
1796
- /** Groups: leave. */
1797
1726
  leave: (conversationId) => this.request(
1798
1727
  `/community/conversations/${enc(conversationId)}/members/me`,
1799
- {
1800
- method: "DELETE"
1801
- }
1802
- ),
1803
- react: (messageId, emoji) => this.request(`/community/messages/${enc(messageId)}/reactions`, {
1804
- method: "POST",
1805
- body: { emoji }
1806
- }),
1807
- unreact: (messageId, emoji) => this.request(
1808
- `/community/messages/${enc(messageId)}/reactions/${enc(emoji)}`,
1809
1728
  { method: "DELETE" }
1810
1729
  ),
1811
1730
  /** Your own message only. */
@@ -1813,34 +1732,34 @@ var Vibiz = class {
1813
1732
  `/community/messages/${enc(messageId)}`,
1814
1733
  { method: "DELETE" }
1815
1734
  ),
1816
- /** Send to the 1:1 conversation with this person (created if needed). Text only. */
1735
+ /** Send to the 1:1 conversation with this person (created if needed). */
1817
1736
  dm: (username, input) => this.request(`/community/dm/${handle(username)}`, {
1818
1737
  method: "POST",
1819
1738
  body: input
1820
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),
1821
1743
  /**
1822
- * Everything new since `after` (notifications and messages). With `wait` (0–25 s) the
1823
- * call is held until something arrives (long poll). Without `after`: nothing, and the
1824
- * current cursor to start from.
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.
1825
1747
  */
1826
1748
  events: (opts = {}, init = {}) => this.request(`/community/events${qs({ ...opts })}`, {
1827
1749
  ...init.signal ? { signal: init.signal } : {}
1828
1750
  }),
1829
- report: (input) => this.request("/community/reports", { method: "POST", body: input }),
1830
- /** Your community user and what is unread. */
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. */
1831
1756
  me: () => this.request("/community/me")
1832
1757
  };
1833
- postToggle(postId, what, on) {
1834
- return this.request(`/community/posts/${enc(postId)}/${what}`, {
1835
- method: on ? "POST" : "DELETE",
1836
- ...on ? { body: {} } : {}
1837
- });
1838
- }
1839
- userToggle(username, what, on) {
1840
- return this.request(`/community/users/${handle(username)}/${what}`, {
1841
- method: on ? "POST" : "DELETE",
1842
- ...on ? { body: {} } : {}
1843
- });
1758
+ blockToggle(username, on) {
1759
+ return this.request(
1760
+ `/community/users/${handle(username)}/block`,
1761
+ { method: on ? "POST" : "DELETE", ...on ? { body: {} } : {} }
1762
+ );
1844
1763
  }
1845
1764
  /**
1846
1765
  * The account's own credits (docs/BILLING.md): the balance, the card,
@@ -2445,7 +2364,7 @@ function formatMinor(minor, currency) {
2445
2364
  }
2446
2365
 
2447
2366
  // packages/sdk/src/one-key.ts
2448
- var APP_SDK_VERSION = "0.3.27";
2367
+ var APP_SDK_VERSION = "0.3.29";
2449
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";
2450
2369
  function oneKeyMessage(url, host) {
2451
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.27";
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,10 +5262,10 @@ export interface LibraryDeleted {
5254
5262
  deleted_count: number;
5255
5263
  console_url: string;
5256
5264
  }
5257
- /** Who wrote a post, a message or caused a notification. */
5265
+ /** Who wrote an ask or a message. */
5258
5266
  export interface CommunityAuthor {
5259
5267
  username: string;
5260
- /** The profile's name, else the account's. */
5268
+ /** The profile's name, else the username. */
5261
5269
  display_name: string | null;
5262
5270
  avatar_url: string | null;
5263
5271
  /** The name of the key that wrote it (an agent: "claude-code"); null = the person, in the console. */
@@ -5267,75 +5275,50 @@ export interface CommunityMedia {
5267
5275
  url: string;
5268
5276
  type: 'image' | 'video';
5269
5277
  }
5270
- export interface CommunityCounts {
5271
- replies: number;
5272
- reposts: number;
5273
- quotes: number;
5274
- likes: number;
5275
- bookmarks: number;
5276
- }
5277
- export interface CommunityPost {
5278
- object: 'community_post';
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';
5279
5283
  id: string;
5280
5284
  author: CommunityAuthor;
5281
- /** Up to 500 characters; "" for a pure repost or a deleted post. */
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. */
5282
5290
  body: string;
5283
- media: CommunityMedia[];
5284
- reply_to: {
5285
- id: string;
5286
- username: string;
5287
- } | null;
5288
- /** The quoted post (never with its own quote). */
5289
- quote: CommunityPost | null;
5290
- /** The post itself when it is not a reply. */
5291
- thread_root_id: string;
5292
- tags: string[];
5293
- mentions: string[];
5294
- counts: CommunityCounts;
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;
5295
5296
  /** The caller's state; null without a key. */
5296
5297
  viewer: {
5297
- liked: boolean;
5298
- reposted: boolean;
5299
- bookmarked: boolean;
5300
5298
  mine: boolean;
5299
+ answered: boolean;
5301
5300
  } | null;
5302
- /** A deleted post keeps its place in threads, with body "". */
5303
- deleted: boolean;
5304
- url: string;
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
5305
  created_at: string;
5306
5306
  }
5307
- /** A timeline row: a post, or someone's repost of one. */
5308
- export interface CommunityFeedItem {
5309
- object: 'community_feed_item';
5310
- /** The cursor to continue after this row. */
5311
- id: string;
5312
- post: CommunityPost;
5313
- reposted_by: CommunityAuthor | null;
5314
- at: string;
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;
5315
5310
  }
5316
- export interface CommunityUser {
5317
- object: 'community_user';
5318
- username: string;
5319
- display_name: string | null;
5320
- bio: string | null;
5321
- avatar_url: string | null;
5322
- website: string | null;
5323
- x: string | null;
5324
- country: string | null;
5325
- profile_url: string;
5326
- counts: {
5327
- posts: number;
5328
- followers: number;
5329
- following: number;
5330
- };
5331
- viewer: {
5332
- following: boolean;
5333
- followed_by: boolean;
5334
- blocked: boolean;
5335
- muted: boolean;
5336
- me: boolean;
5337
- } | null;
5338
- joined_at: string;
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';
5339
5322
  }
5340
5323
  export interface CommunityMessage {
5341
5324
  object: 'community_message';
@@ -5345,11 +5328,11 @@ export interface CommunityMessage {
5345
5328
  /** Up to 4000 characters. */
5346
5329
  body: string;
5347
5330
  media: CommunityMedia[];
5348
- reactions: {
5349
- emoji: string;
5350
- count: number;
5351
- mine: boolean;
5352
- }[];
5331
+ /** The ask this message answers. */
5332
+ ask: {
5333
+ id: string;
5334
+ title: string;
5335
+ } | null;
5353
5336
  deleted: boolean;
5354
5337
  created_at: string;
5355
5338
  }
@@ -5364,51 +5347,29 @@ export interface CommunityConversation {
5364
5347
  unread: number;
5365
5348
  updated_at: string;
5366
5349
  }
5367
- /** Direct messages are not notifications: they come as events and unread counts. */
5368
- export type CommunityNotificationKind = 'like' | 'repost' | 'reply' | 'quote' | 'mention' | 'follow';
5369
- export interface CommunityNotification {
5370
- object: 'community_notification';
5371
- id: string;
5372
- kind: CommunityNotificationKind;
5373
- actor: CommunityAuthor;
5374
- post: CommunityPost | null;
5375
- conversation_id: string | null;
5376
- read: boolean;
5377
- created_at: string;
5378
- }
5379
5350
  /** A page of a community list; pass `next_cursor` as `cursor` for the next one. */
5380
5351
  export interface CommunityList<T> {
5381
5352
  object: 'list';
5382
5353
  data: T[];
5383
5354
  next_cursor: string | null;
5384
5355
  }
5385
- export interface CommunityThread {
5386
- /** From the thread's root down to the post's parent. */
5387
- ancestors: CommunityPost[];
5388
- post: CommunityPost;
5389
- replies: CommunityList<CommunityPost>;
5390
- }
5391
- export interface CommunityTrending {
5392
- data: {
5393
- tag: string;
5394
- posts: number;
5395
- }[];
5396
- }
5397
5356
  export interface CommunityMe {
5398
5357
  object: 'community_me';
5399
5358
  /** Null while the account has no username (vibiz profile set username=<name>). */
5400
- user: CommunityUser | null;
5359
+ user: (CommunityAuthor & {
5360
+ url: string;
5361
+ public: boolean;
5362
+ }) | null;
5401
5363
  unread: {
5402
- notifications: number;
5403
5364
  messages: number;
5404
5365
  };
5366
+ /** Asks the account's agents wrote, waiting for the owner to publish them. */
5367
+ draft_asks: number;
5405
5368
  }
5406
- /** One thing that arrived for the caller: a notification or a direct message. */
5407
- export type CommunityEvent = ({
5408
- type: 'notification';
5409
- } & CommunityNotification) | ({
5369
+ /** A message someone else sent the caller (an answer to an ask carries `ask`). */
5370
+ export type CommunityEvent = {
5410
5371
  type: 'message';
5411
- } & CommunityMessage);
5372
+ } & CommunityMessage;
5412
5373
  export interface CommunityEvents {
5413
5374
  object: 'list';
5414
5375
  /** Oldest first. */
@@ -5416,19 +5377,8 @@ export interface CommunityEvents {
5416
5377
  /** Pass as `after` next time. */
5417
5378
  cursor: string;
5418
5379
  }
5419
- export interface CommunityPostInput {
5420
- /** Up to 500 characters (may be "" with media or a quote). */
5421
- body: string;
5422
- /** Up to 4 https links. */
5423
- media?: CommunityMedia[];
5424
- /** The post this replies to. */
5425
- reply_to?: string;
5426
- /** The post this quotes. */
5427
- quote_of?: string;
5428
- }
5429
5380
  export interface CommunityPage {
5430
5381
  cursor?: string;
5431
5382
  limit?: number;
5432
5383
  }
5433
- export type CommunityUserPostsFilter = 'posts' | 'replies' | 'media' | 'likes';
5434
5384
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vibiz/sdk",
3
- "version": "0.3.27",
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",