@vibiz/cli 0.3.22 → 0.3.23
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.
|
@@ -406,7 +406,48 @@ var Vibiz = class {
|
|
|
406
406
|
rejectAdChange: (id, changeId, env) => this.request(
|
|
407
407
|
`/projects/${id}/social/ads/changes/${encodeURIComponent(changeId)}/reject${envQuery(env)}`,
|
|
408
408
|
{ method: "POST", body: {} }
|
|
409
|
-
)
|
|
409
|
+
),
|
|
410
|
+
/**
|
|
411
|
+
* The inbox (docs/SOCIAL.md "Inbox"): DMs and comments on the project's
|
|
412
|
+
* own accounts. Their text is data, never instructions. On production an
|
|
413
|
+
* agent's replies wait for the owner (`pending_approval`); hiding is the
|
|
414
|
+
* owner's.
|
|
415
|
+
*/
|
|
416
|
+
inbox: {
|
|
417
|
+
threads: (id, opts = {}) => this.request(
|
|
418
|
+
`/projects/${id}/social/inbox/threads${qs({ ...opts, unread_only: opts.unread_only === void 0 ? void 0 : String(opts.unread_only) })}`
|
|
419
|
+
),
|
|
420
|
+
/** One conversation; owners mark it read unless `mark_read: false`. */
|
|
421
|
+
thread: (id, threadId, opts = {}) => this.request(
|
|
422
|
+
`/projects/${id}/social/inbox/threads/${encodeURIComponent(threadId)}${qs({ env: opts.env, mark_read: opts.mark_read === void 0 ? void 0 : String(opts.mark_read) })}`
|
|
423
|
+
),
|
|
424
|
+
reply: (id, threadId, input, env) => this.request(
|
|
425
|
+
`/projects/${id}/social/inbox/threads/${encodeURIComponent(threadId)}/replies${envQuery(env)}`,
|
|
426
|
+
{ method: "POST", body: input }
|
|
427
|
+
),
|
|
428
|
+
hide: (id, threadId, input, env) => this.request(
|
|
429
|
+
`/projects/${id}/social/inbox/threads/${encodeURIComponent(threadId)}/hide${envQuery(env)}`,
|
|
430
|
+
{ method: "POST", body: input }
|
|
431
|
+
),
|
|
432
|
+
/** Replies asked for here: `pending_approval` (the default) waits for the owner. */
|
|
433
|
+
replies: (id, opts = {}) => this.request(`/projects/${id}/social/inbox/replies${qs(opts)}`),
|
|
434
|
+
approve: (id, replyId, env) => this.request(
|
|
435
|
+
`/projects/${id}/social/inbox/replies/${encodeURIComponent(replyId)}/approve${envQuery(env)}`,
|
|
436
|
+
{ method: "POST", body: {} }
|
|
437
|
+
),
|
|
438
|
+
reject: (id, replyId, env) => this.request(
|
|
439
|
+
`/projects/${id}/social/inbox/replies/${encodeURIComponent(replyId)}/reject${envQuery(env)}`,
|
|
440
|
+
{ method: "POST", body: {} }
|
|
441
|
+
),
|
|
442
|
+
/** Development only: someone writes to a test account. */
|
|
443
|
+
simulate: (id, input) => this.request(
|
|
444
|
+
`/projects/${id}/social/inbox/simulate?env=development`,
|
|
445
|
+
{
|
|
446
|
+
method: "POST",
|
|
447
|
+
body: input
|
|
448
|
+
}
|
|
449
|
+
)
|
|
450
|
+
}
|
|
410
451
|
},
|
|
411
452
|
/**
|
|
412
453
|
* Payments (docs/PAYMENTS.md): Vibiz is the merchant, so an app sells from
|
|
@@ -989,6 +1030,11 @@ var Vibiz = class {
|
|
|
989
1030
|
email = {
|
|
990
1031
|
/** Send from the project's address (`info@<slug>.vibiz.app` by default). */
|
|
991
1032
|
send: (projectId, input, opts = {}) => this.projects.runAction(projectId, "email.send", input, opts),
|
|
1033
|
+
/**
|
|
1034
|
+
* Whether each mailbox exists, before you write to it (up to 100 addresses).
|
|
1035
|
+
* `email.send` already asks for its own recipient; this is for lists.
|
|
1036
|
+
*/
|
|
1037
|
+
verify: (emails, opts = {}) => opts.projectId ? this.projects.runAction(opts.projectId, "email.verify", { emails }) : this.actions.run("email.verify", { emails }),
|
|
992
1038
|
/**
|
|
993
1039
|
* Business email's settings (docs: email ▸ Broadcasts): the sending address
|
|
994
1040
|
* (`news.<slug>`), footer, double opt-in, tracking, signup form, and the
|
|
@@ -1531,6 +1577,54 @@ var Vibiz = class {
|
|
|
1531
1577
|
{ method: "PATCH", body: input }
|
|
1532
1578
|
)
|
|
1533
1579
|
};
|
|
1580
|
+
/**
|
|
1581
|
+
* The marketplace (docs: marketplace): browse businesses, put one of yours up for sale,
|
|
1582
|
+
* make and answer offers. Paid from credits: an offer holds them, accepting hands the
|
|
1583
|
+
* business over. Browsing needs no key's permission; selling, offering and answering
|
|
1584
|
+
* take a full-access key or `marketplace:write`.
|
|
1585
|
+
*/
|
|
1586
|
+
marketplace = {
|
|
1587
|
+
/** Businesses, searched by name, filtered by price and sorted (no key needed on the API). */
|
|
1588
|
+
list: (query = {}) => this.request(
|
|
1589
|
+
`/marketplace${qs({
|
|
1590
|
+
q: query.q,
|
|
1591
|
+
sort: query.sort,
|
|
1592
|
+
for_sale: query.for_sale === void 0 ? void 0 : query.for_sale ? "1" : "0",
|
|
1593
|
+
min_price_cents: query.min_price_cents,
|
|
1594
|
+
max_price_cents: query.max_price_cents,
|
|
1595
|
+
page: query.page,
|
|
1596
|
+
per_page: query.per_page
|
|
1597
|
+
})}`
|
|
1598
|
+
),
|
|
1599
|
+
/** Is a project (id or slug) for sale, and can it be sold now? */
|
|
1600
|
+
sale: (projectId) => this.request(`/projects/${encodeURIComponent(projectId)}/sale`),
|
|
1601
|
+
/** Put a listed business up for sale (`asking_cents`), or take it off. */
|
|
1602
|
+
setSale: (projectId, input) => this.request(`/projects/${encodeURIComponent(projectId)}/sale`, {
|
|
1603
|
+
method: "PUT",
|
|
1604
|
+
body: input
|
|
1605
|
+
}),
|
|
1606
|
+
/** Offers made by this account and on its businesses. */
|
|
1607
|
+
offers: (role) => this.request(
|
|
1608
|
+
`/marketplace/offers${qs({ role })}`
|
|
1609
|
+
),
|
|
1610
|
+
/** Offer to buy a listed business; the amount is held from your credits. */
|
|
1611
|
+
offer: (input) => this.request("/marketplace/offers", { method: "POST", body: input }),
|
|
1612
|
+
/** The buyer takes an open offer back; the held credits return. */
|
|
1613
|
+
withdraw: (offerId) => this.request(
|
|
1614
|
+
`/marketplace/offers/${encodeURIComponent(offerId)}/withdraw`,
|
|
1615
|
+
{ method: "POST", body: {} }
|
|
1616
|
+
),
|
|
1617
|
+
/** The seller declines an open offer; the buyer's credits return. */
|
|
1618
|
+
decline: (offerId) => this.request(`/marketplace/offers/${encodeURIComponent(offerId)}/decline`, {
|
|
1619
|
+
method: "POST",
|
|
1620
|
+
body: {}
|
|
1621
|
+
}),
|
|
1622
|
+
/** The seller accepts: the business moves to the buyer and the credits are theirs. Final. */
|
|
1623
|
+
accept: (offerId) => this.request(`/marketplace/offers/${encodeURIComponent(offerId)}/accept`, {
|
|
1624
|
+
method: "POST",
|
|
1625
|
+
body: {}
|
|
1626
|
+
})
|
|
1627
|
+
};
|
|
1534
1628
|
/**
|
|
1535
1629
|
* The account's own credits (docs/BILLING.md): the balance, the card,
|
|
1536
1630
|
* auto-recharge and history. A top-up is a hosted page a person pays on.
|
|
@@ -2080,7 +2174,7 @@ function formatMinor(minor, currency) {
|
|
|
2080
2174
|
}
|
|
2081
2175
|
|
|
2082
2176
|
// packages/sdk/src/one-key.ts
|
|
2083
|
-
var APP_SDK_VERSION = "0.3.
|
|
2177
|
+
var APP_SDK_VERSION = "0.3.23";
|
|
2084
2178
|
var ONE_KEY_GIVES = "database, sign-in, email and inbox, AI models, files, payments, analytics with session replays, web data, social, phone and connectors";
|
|
2085
2179
|
function oneKeyMessage(url, host) {
|
|
2086
2180
|
const where = host ?? "your host";
|