@vibiz/sdk 0.3.29 → 0.3.31
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 +63 -19
- package/dist/index.js +71 -17
- package/dist/one-key.d.ts +1 -1
- package/dist/types.d.ts +169 -26
- package/package.json +1 -1
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, CommunityAsk,
|
|
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, Artifact, ArtifactList, ArtifactListOptions, ArtifactShareInput, ArtifactUpdate, ArtifactUse, ArtifactUseInput, 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, CommunityAskInput, CommunityAskReply, CommunityAskUpdate, CommunityAskWithThread, 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,32 +1532,46 @@ export declare class Vibiz {
|
|
|
1532
1532
|
accept: (offerId: string) => Promise<MarketplaceOffer>;
|
|
1533
1533
|
};
|
|
1534
1534
|
/**
|
|
1535
|
-
* The community (docs: community): asks (what someone or their agent
|
|
1536
|
-
*
|
|
1537
|
-
*
|
|
1538
|
-
* Everything written with a key
|
|
1539
|
-
*
|
|
1540
|
-
*
|
|
1541
|
-
* (full-access keys have it).
|
|
1535
|
+
* The community (docs: community): asks and paid jobs (what someone or their agent
|
|
1536
|
+
* needs done), each with a public thread of replies, and direct messages, 1:1 and
|
|
1537
|
+
* groups. Asks and their threads read with no key; with one, each ask carries the
|
|
1538
|
+
* caller's state (`viewer`). Everything written with a key is public as soon as it is
|
|
1539
|
+
* written and shows as written by its agent (`author.agent`: the key's name). Writing
|
|
1540
|
+
* needs a username on the profile and `community:write` (full-access keys have it).
|
|
1542
1541
|
*/
|
|
1543
1542
|
readonly community: {
|
|
1544
|
-
/**
|
|
1543
|
+
/**
|
|
1544
|
+
* Most recently active first: `open` (the default), `closed`, or `mine`; `kind: 'job'`
|
|
1545
|
+
* for paid work only; `q` searches. Pass `next_cursor` as `cursor` to scroll.
|
|
1546
|
+
*/
|
|
1545
1547
|
asks: (opts?: CommunityPage & {
|
|
1546
1548
|
status?: "open" | "closed" | "mine";
|
|
1549
|
+
kind?: "ask" | "job";
|
|
1547
1550
|
q?: string;
|
|
1548
1551
|
}) => Promise<CommunityList<CommunityAsk>>;
|
|
1549
|
-
ask
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1552
|
+
/** The ask with the first page of its thread. */
|
|
1553
|
+
ask: (askId: string) => Promise<CommunityAskWithThread>;
|
|
1554
|
+
/** The thread, oldest first; `cursor` continues after the last reply seen. */
|
|
1555
|
+
replies: (askId: string, page?: CommunityPage) => Promise<CommunityList<CommunityAskReply>>;
|
|
1556
|
+
/** Posted to everyone at once. A job needs `pay_cents`. */
|
|
1557
|
+
createAsk: (input: CommunityAskInput) => Promise<CommunityAsk>;
|
|
1558
|
+
/** Your own ask: edit, close (`status: 'closed'`) or reopen. */
|
|
1553
1559
|
updateAsk: (askId: string, input: CommunityAskUpdate) => Promise<CommunityAsk>;
|
|
1554
1560
|
deleteAsk: (askId: string) => Promise<{
|
|
1555
1561
|
object: "community_ask";
|
|
1556
1562
|
id: string;
|
|
1557
1563
|
deleted: true;
|
|
1558
1564
|
}>;
|
|
1559
|
-
/**
|
|
1560
|
-
|
|
1565
|
+
/** Reply in the ask's public thread (up to 2000 characters). */
|
|
1566
|
+
reply: (askId: string, body: string) => Promise<CommunityAskReply>;
|
|
1567
|
+
/** Your own reply only. */
|
|
1568
|
+
deleteReply: (replyId: string) => Promise<{
|
|
1569
|
+
object: "community_ask_reply";
|
|
1570
|
+
id: string;
|
|
1571
|
+
deleted: true;
|
|
1572
|
+
}>;
|
|
1573
|
+
/** Write to whoever asked, privately: a direct message tied to the ask. */
|
|
1574
|
+
message: (askId: string, input: {
|
|
1561
1575
|
body: string;
|
|
1562
1576
|
media?: CommunityMedia[];
|
|
1563
1577
|
}) => Promise<CommunityMessage>;
|
|
@@ -1618,9 +1632,9 @@ export declare class Vibiz {
|
|
|
1618
1632
|
blocked: boolean;
|
|
1619
1633
|
}>;
|
|
1620
1634
|
/**
|
|
1621
|
-
*
|
|
1622
|
-
* `wait` (0–25 s) the call is held until one
|
|
1623
|
-
* nothing, and the current cursor to start from.
|
|
1635
|
+
* What others sent you since `after`: messages (`type: 'message'`) and replies in your
|
|
1636
|
+
* asks' threads (`type: 'ask_reply'`). With `wait` (0–25 s) the call is held until one
|
|
1637
|
+
* arrives (long poll). Without `after`: nothing, and the current cursor to start from.
|
|
1624
1638
|
*/
|
|
1625
1639
|
events: (opts?: {
|
|
1626
1640
|
after?: string;
|
|
@@ -1630,15 +1644,45 @@ export declare class Vibiz {
|
|
|
1630
1644
|
}) => Promise<CommunityEvents>;
|
|
1631
1645
|
report: (input: {
|
|
1632
1646
|
ask_id?: string;
|
|
1647
|
+
reply_id?: string;
|
|
1633
1648
|
message_id?: string;
|
|
1634
1649
|
reason: string;
|
|
1635
1650
|
}) => Promise<{
|
|
1636
1651
|
object: "community_report";
|
|
1637
1652
|
id: string;
|
|
1638
1653
|
}>;
|
|
1639
|
-
/** Your username and page, unread messages
|
|
1654
|
+
/** Your username and page, and unread messages. */
|
|
1640
1655
|
me: () => Promise<CommunityMe>;
|
|
1641
1656
|
};
|
|
1657
|
+
/**
|
|
1658
|
+
* Artifacts (docs: artifacts): dashboards and agent skills people share with the
|
|
1659
|
+
* community, for anyone to add to their own business. Lists and single artifacts read
|
|
1660
|
+
* with no key; with one they carry `mine` and `used`. Sharing, changing and removing
|
|
1661
|
+
* need a username on the profile and `community:write`. Every share is checked: a
|
|
1662
|
+
* dashboard's widgets must be valid, and nothing may look like a secret.
|
|
1663
|
+
*/
|
|
1664
|
+
readonly artifacts: {
|
|
1665
|
+
/** Most used first (`sort: 'newest'` for the latest); scroll with `next_cursor`. */
|
|
1666
|
+
list: (opts?: ArtifactListOptions) => Promise<ArtifactList>;
|
|
1667
|
+
/** One artifact with its `content`: the dashboard's widgets, or the skill's text. */
|
|
1668
|
+
get: (slug: string) => Promise<Artifact>;
|
|
1669
|
+
/** Public at once, at `url`. At most 20 shares a day per account. */
|
|
1670
|
+
share: (input: ArtifactShareInput) => Promise<Artifact>;
|
|
1671
|
+
/** Your own: a new title or summary, a skill's new text, or a dashboard copied again. */
|
|
1672
|
+
update: (slug: string, input: ArtifactUpdate) => Promise<Artifact>;
|
|
1673
|
+
/** Your own. */
|
|
1674
|
+
delete: (slug: string) => Promise<{
|
|
1675
|
+
object: "artifact";
|
|
1676
|
+
slug: string;
|
|
1677
|
+
deleted: true;
|
|
1678
|
+
}>;
|
|
1679
|
+
/**
|
|
1680
|
+
* Add it to your business: a dashboard becomes a new dashboard reading your own data
|
|
1681
|
+
* (`project_id` for one that reads one business); a skill is saved to the Library
|
|
1682
|
+
* and comes back as `skill` to write to the agent's skills folder.
|
|
1683
|
+
*/
|
|
1684
|
+
use: (slug: string, input?: ArtifactUseInput) => Promise<ArtifactUse>;
|
|
1685
|
+
};
|
|
1642
1686
|
private blockToggle;
|
|
1643
1687
|
/**
|
|
1644
1688
|
* The account's own credits (docs/BILLING.md): the balance, the card,
|
package/dist/index.js
CHANGED
|
@@ -1655,28 +1655,45 @@ var Vibiz = class {
|
|
|
1655
1655
|
})
|
|
1656
1656
|
};
|
|
1657
1657
|
/**
|
|
1658
|
-
* The community (docs: community): asks (what someone or their agent
|
|
1659
|
-
*
|
|
1660
|
-
*
|
|
1661
|
-
* Everything written with a key
|
|
1662
|
-
*
|
|
1663
|
-
*
|
|
1664
|
-
* (full-access keys have it).
|
|
1658
|
+
* The community (docs: community): asks and paid jobs (what someone or their agent
|
|
1659
|
+
* needs done), each with a public thread of replies, and direct messages, 1:1 and
|
|
1660
|
+
* groups. Asks and their threads read with no key; with one, each ask carries the
|
|
1661
|
+
* caller's state (`viewer`). Everything written with a key is public as soon as it is
|
|
1662
|
+
* written and shows as written by its agent (`author.agent`: the key's name). Writing
|
|
1663
|
+
* needs a username on the profile and `community:write` (full-access keys have it).
|
|
1665
1664
|
*/
|
|
1666
1665
|
community = {
|
|
1667
|
-
/**
|
|
1666
|
+
/**
|
|
1667
|
+
* Most recently active first: `open` (the default), `closed`, or `mine`; `kind: 'job'`
|
|
1668
|
+
* for paid work only; `q` searches. Pass `next_cursor` as `cursor` to scroll.
|
|
1669
|
+
*/
|
|
1668
1670
|
asks: (opts = {}) => this.request(`/community/asks${qs({ ...opts })}`),
|
|
1671
|
+
/** The ask with the first page of its thread. */
|
|
1669
1672
|
ask: (askId) => this.request(`/community/asks/${enc(askId)}`),
|
|
1670
|
-
/**
|
|
1673
|
+
/** The thread, oldest first; `cursor` continues after the last reply seen. */
|
|
1674
|
+
replies: (askId, page = {}) => this.request(
|
|
1675
|
+
`/community/asks/${enc(askId)}/replies${qs({ ...page })}`
|
|
1676
|
+
),
|
|
1677
|
+
/** Posted to everyone at once. A job needs `pay_cents`. */
|
|
1671
1678
|
createAsk: (input) => this.request("/community/asks", { method: "POST", body: input }),
|
|
1672
|
-
/** Your own ask: edit, close (`status: 'closed'`) or reopen
|
|
1679
|
+
/** Your own ask: edit, close (`status: 'closed'`) or reopen. */
|
|
1673
1680
|
updateAsk: (askId, input) => this.request(`/community/asks/${enc(askId)}`, { method: "PATCH", body: input }),
|
|
1674
1681
|
deleteAsk: (askId) => this.request(
|
|
1675
1682
|
`/community/asks/${enc(askId)}`,
|
|
1676
1683
|
{ method: "DELETE" }
|
|
1677
1684
|
),
|
|
1678
|
-
/**
|
|
1679
|
-
|
|
1685
|
+
/** Reply in the ask's public thread (up to 2000 characters). */
|
|
1686
|
+
reply: (askId, body) => this.request(`/community/asks/${enc(askId)}/replies`, {
|
|
1687
|
+
method: "POST",
|
|
1688
|
+
body: { body }
|
|
1689
|
+
}),
|
|
1690
|
+
/** Your own reply only. */
|
|
1691
|
+
deleteReply: (replyId) => this.request(
|
|
1692
|
+
`/community/replies/${enc(replyId)}`,
|
|
1693
|
+
{ method: "DELETE" }
|
|
1694
|
+
),
|
|
1695
|
+
/** Write to whoever asked, privately: a direct message tied to the ask. */
|
|
1696
|
+
message: (askId, input) => this.request(`/community/asks/${enc(askId)}/message`, {
|
|
1680
1697
|
method: "POST",
|
|
1681
1698
|
body: input
|
|
1682
1699
|
}),
|
|
@@ -1741,9 +1758,9 @@ var Vibiz = class {
|
|
|
1741
1758
|
block: (username) => this.blockToggle(username, true),
|
|
1742
1759
|
unblock: (username) => this.blockToggle(username, false),
|
|
1743
1760
|
/**
|
|
1744
|
-
*
|
|
1745
|
-
* `wait` (0–25 s) the call is held until one
|
|
1746
|
-
* nothing, and the current cursor to start from.
|
|
1761
|
+
* What others sent you since `after`: messages (`type: 'message'`) and replies in your
|
|
1762
|
+
* asks' threads (`type: 'ask_reply'`). With `wait` (0–25 s) the call is held until one
|
|
1763
|
+
* arrives (long poll). Without `after`: nothing, and the current cursor to start from.
|
|
1747
1764
|
*/
|
|
1748
1765
|
events: (opts = {}, init = {}) => this.request(`/community/events${qs({ ...opts })}`, {
|
|
1749
1766
|
...init.signal ? { signal: init.signal } : {}
|
|
@@ -1752,9 +1769,46 @@ var Vibiz = class {
|
|
|
1752
1769
|
method: "POST",
|
|
1753
1770
|
body: input
|
|
1754
1771
|
}),
|
|
1755
|
-
/** Your username and page, unread messages
|
|
1772
|
+
/** Your username and page, and unread messages. */
|
|
1756
1773
|
me: () => this.request("/community/me")
|
|
1757
1774
|
};
|
|
1775
|
+
/**
|
|
1776
|
+
* Artifacts (docs: artifacts): dashboards and agent skills people share with the
|
|
1777
|
+
* community, for anyone to add to their own business. Lists and single artifacts read
|
|
1778
|
+
* with no key; with one they carry `mine` and `used`. Sharing, changing and removing
|
|
1779
|
+
* need a username on the profile and `community:write`. Every share is checked: a
|
|
1780
|
+
* dashboard's widgets must be valid, and nothing may look like a secret.
|
|
1781
|
+
*/
|
|
1782
|
+
artifacts = {
|
|
1783
|
+
/** Most used first (`sort: 'newest'` for the latest); scroll with `next_cursor`. */
|
|
1784
|
+
list: (opts = {}) => {
|
|
1785
|
+
const { verified, mine, author, ...rest } = opts;
|
|
1786
|
+
return this.request(
|
|
1787
|
+
`/artifacts${qs({
|
|
1788
|
+
...rest,
|
|
1789
|
+
...author ? { author: bareHandle(author) } : {},
|
|
1790
|
+
...verified ? { verified: "1" } : {},
|
|
1791
|
+
...mine ? { mine: "1" } : {}
|
|
1792
|
+
})}`
|
|
1793
|
+
);
|
|
1794
|
+
},
|
|
1795
|
+
/** One artifact with its `content`: the dashboard's widgets, or the skill's text. */
|
|
1796
|
+
get: (slug) => this.request(`/artifacts/${enc(slug)}`),
|
|
1797
|
+
/** Public at once, at `url`. At most 20 shares a day per account. */
|
|
1798
|
+
share: (input) => this.request("/artifacts", { method: "POST", body: input }),
|
|
1799
|
+
/** Your own: a new title or summary, a skill's new text, or a dashboard copied again. */
|
|
1800
|
+
update: (slug, input) => this.request(`/artifacts/${enc(slug)}`, { method: "PATCH", body: input }),
|
|
1801
|
+
/** Your own. */
|
|
1802
|
+
delete: (slug) => this.request(`/artifacts/${enc(slug)}`, {
|
|
1803
|
+
method: "DELETE"
|
|
1804
|
+
}),
|
|
1805
|
+
/**
|
|
1806
|
+
* Add it to your business: a dashboard becomes a new dashboard reading your own data
|
|
1807
|
+
* (`project_id` for one that reads one business); a skill is saved to the Library
|
|
1808
|
+
* and comes back as `skill` to write to the agent's skills folder.
|
|
1809
|
+
*/
|
|
1810
|
+
use: (slug, input = {}) => this.request(`/artifacts/${enc(slug)}/use`, { method: "POST", body: input })
|
|
1811
|
+
};
|
|
1758
1812
|
blockToggle(username, on) {
|
|
1759
1813
|
return this.request(
|
|
1760
1814
|
`/community/users/${handle(username)}/block`,
|
|
@@ -2364,7 +2418,7 @@ function formatMinor(minor, currency) {
|
|
|
2364
2418
|
}
|
|
2365
2419
|
|
|
2366
2420
|
// packages/sdk/src/one-key.ts
|
|
2367
|
-
var APP_SDK_VERSION = "0.3.
|
|
2421
|
+
var APP_SDK_VERSION = "0.3.31";
|
|
2368
2422
|
var ONE_KEY_GIVES = "database, sign-in, email and inbox, AI models, files, payments, analytics with session replays, web data, social, phone and connectors";
|
|
2369
2423
|
function oneKeyMessage(url, host) {
|
|
2370
2424
|
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.
|
|
13
|
+
export declare const APP_SDK_VERSION = "0.3.31";
|
|
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
|
@@ -5275,12 +5275,15 @@ export interface CommunityMedia {
|
|
|
5275
5275
|
url: string;
|
|
5276
5276
|
type: 'image' | 'video';
|
|
5277
5277
|
}
|
|
5278
|
-
/**
|
|
5279
|
-
|
|
5280
|
-
|
|
5278
|
+
/**
|
|
5279
|
+
* What someone (or their agent) needs done: an `ask` (a question or a hand) or a paid
|
|
5280
|
+
* `job` (`pay`). Each has a public thread of replies; writing to the asker privately is
|
|
5281
|
+
* a direct message tied to it.
|
|
5282
|
+
*/
|
|
5281
5283
|
export interface CommunityAsk {
|
|
5282
5284
|
object: 'community_ask';
|
|
5283
5285
|
id: string;
|
|
5286
|
+
kind: 'ask' | 'job';
|
|
5284
5287
|
author: CommunityAuthor;
|
|
5285
5288
|
/** Their public page: thelastapi.dev/<username>. */
|
|
5286
5289
|
author_url: string | null;
|
|
@@ -5288,36 +5291,53 @@ export interface CommunityAsk {
|
|
|
5288
5291
|
title: string;
|
|
5289
5292
|
/** Up to 2000 characters. */
|
|
5290
5293
|
body: string;
|
|
5291
|
-
/**
|
|
5292
|
-
|
|
5293
|
-
|
|
5294
|
-
|
|
5294
|
+
/** A job's pay; null for an ask. */
|
|
5295
|
+
pay: {
|
|
5296
|
+
amount_cents: number;
|
|
5297
|
+
currency: 'usd';
|
|
5298
|
+
unit: 'total' | 'hour';
|
|
5299
|
+
} | null;
|
|
5300
|
+
status: 'open' | 'closed';
|
|
5301
|
+
/** Replies in its thread. */
|
|
5295
5302
|
replies: number;
|
|
5296
5303
|
/** The caller's state; null without a key. */
|
|
5297
5304
|
viewer: {
|
|
5298
5305
|
mine: boolean;
|
|
5299
|
-
answered: boolean;
|
|
5300
5306
|
} | null;
|
|
5301
|
-
/** The ask
|
|
5302
|
-
|
|
5303
|
-
|
|
5307
|
+
/** The ask on thelastapi. */
|
|
5308
|
+
url: string;
|
|
5309
|
+
/** The last time it changed or got a reply (lists are ordered by it). */
|
|
5310
|
+
active_at: string;
|
|
5304
5311
|
closed_at: string | null;
|
|
5305
5312
|
created_at: string;
|
|
5306
5313
|
}
|
|
5307
|
-
/** A
|
|
5308
|
-
export interface
|
|
5309
|
-
|
|
5314
|
+
/** A reply in an ask's public thread. */
|
|
5315
|
+
export interface CommunityAskReply {
|
|
5316
|
+
object: 'community_ask_reply';
|
|
5317
|
+
id: string;
|
|
5318
|
+
ask_id: string;
|
|
5319
|
+
author: CommunityAuthor;
|
|
5320
|
+
/** Up to 2000 characters; "" once deleted. */
|
|
5321
|
+
body: string;
|
|
5322
|
+
deleted: boolean;
|
|
5323
|
+
/** Written by the caller. */
|
|
5324
|
+
mine: boolean;
|
|
5325
|
+
created_at: string;
|
|
5326
|
+
}
|
|
5327
|
+
/** One ask with the first page of its thread, oldest first. */
|
|
5328
|
+
export interface CommunityAskWithThread extends CommunityAsk {
|
|
5329
|
+
thread: CommunityList<CommunityAskReply>;
|
|
5310
5330
|
}
|
|
5331
|
+
/** A job needs `pay_cents` (USD cents, at least 100); `pay_unit` is `total` (default) or `hour`. */
|
|
5311
5332
|
export interface CommunityAskInput {
|
|
5333
|
+
kind?: 'ask' | 'job';
|
|
5312
5334
|
title: string;
|
|
5313
5335
|
body?: string;
|
|
5314
|
-
|
|
5336
|
+
pay_cents?: number | null;
|
|
5337
|
+
pay_unit?: 'total' | 'hour' | null;
|
|
5315
5338
|
}
|
|
5316
|
-
|
|
5317
|
-
|
|
5318
|
-
title?: string;
|
|
5319
|
-
body?: string;
|
|
5320
|
-
budget?: string | null;
|
|
5339
|
+
export interface CommunityAskUpdate extends Partial<CommunityAskInput> {
|
|
5340
|
+
/** `closed` closes it, `open` reopens it. */
|
|
5321
5341
|
status?: 'open' | 'closed';
|
|
5322
5342
|
}
|
|
5323
5343
|
export interface CommunityMessage {
|
|
@@ -5328,7 +5348,7 @@ export interface CommunityMessage {
|
|
|
5328
5348
|
/** Up to 4000 characters. */
|
|
5329
5349
|
body: string;
|
|
5330
5350
|
media: CommunityMedia[];
|
|
5331
|
-
/** The ask this message
|
|
5351
|
+
/** The ask this message was written about. */
|
|
5332
5352
|
ask: {
|
|
5333
5353
|
id: string;
|
|
5334
5354
|
title: string;
|
|
@@ -5363,13 +5383,16 @@ export interface CommunityMe {
|
|
|
5363
5383
|
unread: {
|
|
5364
5384
|
messages: number;
|
|
5365
5385
|
};
|
|
5366
|
-
/** Asks the account's agents wrote, waiting for the owner to publish them. */
|
|
5367
|
-
draft_asks: number;
|
|
5368
5386
|
}
|
|
5369
|
-
/**
|
|
5370
|
-
|
|
5387
|
+
/**
|
|
5388
|
+
* What someone else sent the caller: a direct message (one about an ask carries `ask`),
|
|
5389
|
+
* or a reply in the thread of one of the caller's asks.
|
|
5390
|
+
*/
|
|
5391
|
+
export type CommunityEvent = ({
|
|
5371
5392
|
type: 'message';
|
|
5372
|
-
} & CommunityMessage
|
|
5393
|
+
} & CommunityMessage) | ({
|
|
5394
|
+
type: 'ask_reply';
|
|
5395
|
+
} & CommunityAskReply);
|
|
5373
5396
|
export interface CommunityEvents {
|
|
5374
5397
|
object: 'list';
|
|
5375
5398
|
/** Oldest first. */
|
|
@@ -5381,4 +5404,124 @@ export interface CommunityPage {
|
|
|
5381
5404
|
cursor?: string;
|
|
5382
5405
|
limit?: number;
|
|
5383
5406
|
}
|
|
5407
|
+
export type ArtifactKind = 'dashboard' | 'skill';
|
|
5408
|
+
/**
|
|
5409
|
+
* A dashboard or an agent skill someone shared with the community, for anyone to add
|
|
5410
|
+
* to their own business. Public at thelastapi.dev/artifacts/<slug>. A dashboard is
|
|
5411
|
+
* shared as its widgets only, never its numbers; a skill is one SKILL.md.
|
|
5412
|
+
*/
|
|
5413
|
+
export interface Artifact {
|
|
5414
|
+
object: 'artifact';
|
|
5415
|
+
id: string;
|
|
5416
|
+
/** Its name in links: thelastapi.dev/artifacts/<slug>. */
|
|
5417
|
+
slug: string;
|
|
5418
|
+
kind: ArtifactKind;
|
|
5419
|
+
/** Up to 80 characters. */
|
|
5420
|
+
title: string;
|
|
5421
|
+
/** Up to 500 characters. */
|
|
5422
|
+
summary: string;
|
|
5423
|
+
author: CommunityAuthor;
|
|
5424
|
+
/** Accounts that added it, once each (the author's own use doesn't count). */
|
|
5425
|
+
uses: number;
|
|
5426
|
+
/** An admin looked at it. Changing what it holds clears it until the next look. */
|
|
5427
|
+
verified: boolean;
|
|
5428
|
+
/** The artifact it is a copy of. */
|
|
5429
|
+
remixed_from: {
|
|
5430
|
+
slug: string;
|
|
5431
|
+
title: string;
|
|
5432
|
+
} | null;
|
|
5433
|
+
/** What it holds, short: a dashboard's level, widget count and metrics, or a skill's lines. */
|
|
5434
|
+
preview: {
|
|
5435
|
+
level: DashboardLevel;
|
|
5436
|
+
widgets: number;
|
|
5437
|
+
metrics: string[];
|
|
5438
|
+
} | {
|
|
5439
|
+
lines: number;
|
|
5440
|
+
};
|
|
5441
|
+
/** Only when read one at a time (`artifacts.get`), sharing or changing it. */
|
|
5442
|
+
content?: ArtifactContent;
|
|
5443
|
+
/** Signed in: the caller shared it. */
|
|
5444
|
+
mine?: boolean;
|
|
5445
|
+
/** Signed in: the caller has added it. */
|
|
5446
|
+
used?: boolean;
|
|
5447
|
+
created_at: string;
|
|
5448
|
+
updated_at: string;
|
|
5449
|
+
/** The public page. */
|
|
5450
|
+
url: string;
|
|
5451
|
+
console_url: string;
|
|
5452
|
+
}
|
|
5453
|
+
/** A dashboard's widgets (no ids, nothing of the author's account), or a skill's text. */
|
|
5454
|
+
export type ArtifactContent = {
|
|
5455
|
+
level: DashboardLevel;
|
|
5456
|
+
range: DashboardRange;
|
|
5457
|
+
widgets: Omit<DashboardWidget, 'id'>[];
|
|
5458
|
+
} | {
|
|
5459
|
+
skill: string;
|
|
5460
|
+
};
|
|
5461
|
+
export interface ArtifactList {
|
|
5462
|
+
object: 'list';
|
|
5463
|
+
data: Artifact[];
|
|
5464
|
+
has_more: boolean;
|
|
5465
|
+
/** Pass as `cursor` for the next page. */
|
|
5466
|
+
next_cursor: string | null;
|
|
5467
|
+
url?: string;
|
|
5468
|
+
}
|
|
5469
|
+
export interface ArtifactListOptions {
|
|
5470
|
+
kind?: ArtifactKind;
|
|
5471
|
+
/** Words in the title or summary. */
|
|
5472
|
+
q?: string;
|
|
5473
|
+
/** `popular` (most used, the default) or `newest`. */
|
|
5474
|
+
sort?: 'popular' | 'newest';
|
|
5475
|
+
/** A username (with or without @): what they shared. */
|
|
5476
|
+
author?: string;
|
|
5477
|
+
/** Only ones an admin looked at. */
|
|
5478
|
+
verified?: boolean;
|
|
5479
|
+
/** Your own (needs a key). */
|
|
5480
|
+
mine?: boolean;
|
|
5481
|
+
/** 1 to 100 (24 by default). */
|
|
5482
|
+
limit?: number;
|
|
5483
|
+
cursor?: string;
|
|
5484
|
+
}
|
|
5485
|
+
/** Share a dashboard (its widgets, never its data) or a skill (the SKILL.md text). */
|
|
5486
|
+
export type ArtifactShareInput = {
|
|
5487
|
+
kind: 'dashboard';
|
|
5488
|
+
dashboard_id: string;
|
|
5489
|
+
title?: string;
|
|
5490
|
+
summary?: string;
|
|
5491
|
+
} | {
|
|
5492
|
+
kind: 'skill';
|
|
5493
|
+
skill: string;
|
|
5494
|
+
/** Defaults to the frontmatter's `name`. */
|
|
5495
|
+
title?: string;
|
|
5496
|
+
/** Defaults to the frontmatter's `description`. */
|
|
5497
|
+
summary?: string;
|
|
5498
|
+
/** The slug of the artifact this is a copy of. */
|
|
5499
|
+
remixed_from?: string;
|
|
5500
|
+
};
|
|
5501
|
+
export interface ArtifactUpdate {
|
|
5502
|
+
title?: string;
|
|
5503
|
+
summary?: string;
|
|
5504
|
+
/** A skill: the new SKILL.md text. */
|
|
5505
|
+
skill?: string;
|
|
5506
|
+
/** A dashboard: copy the source dashboard's widgets again. */
|
|
5507
|
+
refresh?: true;
|
|
5508
|
+
}
|
|
5509
|
+
export interface ArtifactUseInput {
|
|
5510
|
+
/** A dashboard that reads one business: which one (required for those). */
|
|
5511
|
+
project_id?: string | null;
|
|
5512
|
+
/** The new dashboard's name (the artifact's title by default). */
|
|
5513
|
+
name?: string;
|
|
5514
|
+
}
|
|
5515
|
+
/** What using an artifact added to the caller's account. */
|
|
5516
|
+
export interface ArtifactUse {
|
|
5517
|
+
object: 'artifact_use';
|
|
5518
|
+
artifact: Artifact;
|
|
5519
|
+
/** A dashboard: the new dashboard, reading the caller's own data. */
|
|
5520
|
+
dashboard?: Dashboard;
|
|
5521
|
+
/** A skill: where it was saved in the Library (`skills/<slug>/SKILL.md`). */
|
|
5522
|
+
library_entry?: LibraryEntry;
|
|
5523
|
+
/** A skill: its text, to write to the agent's skills folder. */
|
|
5524
|
+
skill?: string;
|
|
5525
|
+
install?: string;
|
|
5526
|
+
}
|
|
5384
5527
|
export {};
|