palbase 0.27.0 → 0.29.0
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/README.md +12 -1
- package/dist/ai/index.js +2 -2
- package/dist/backend/engine.js +2 -2
- package/dist/backend/env.js +1 -1
- package/dist/backend/index.js +3 -3
- package/dist/backend/stack.js +1 -1
- package/dist/backend/test.js +2 -2
- package/dist/chunks/{XUZ532UW.js → 3NB2Z2MF.js} +1 -1
- package/dist/chunks/{Y2RBMBJB.js → 4Q5QXL7S.js} +1 -1
- package/dist/chunks/{UJATFHC4.js → 62XTQSVZ.js} +2 -2
- package/dist/chunks/{CTKJ7E5R.js → 66PTYGSE.js} +2 -2
- package/dist/chunks/{2VZXMKE4.js → A6CGX34F.js} +2 -2
- package/dist/chunks/{7CVC2UYK.js → AMWYOTRD.js} +2 -2
- package/dist/chunks/C2SU644S.js +2 -0
- package/dist/chunks/{O5LG6IFL.js → EWMPKYBN.js} +1 -1
- package/dist/chunks/{R2KG2E4H.js → GJPGCOTW.js} +2 -2
- package/dist/chunks/{5ETIB37E.js → GV63GJ4D.js} +2 -2
- package/dist/chunks/{HKLIKCYR.js → HC2AGD3N.js} +2 -2
- package/dist/chunks/{UWZP4YV6.js → I5IDPWDM.js} +2 -2
- package/dist/chunks/IOU6E244.js +22 -0
- package/dist/chunks/{HHQ5RAYH.js → IQ6QJDM4.js} +2 -2
- package/dist/chunks/{JCS5FSY6.js → IYJRPKS2.js} +2 -2
- package/dist/chunks/{YS5GF7JB.js → KN6YJGWP.js} +2 -2
- package/dist/chunks/{NGAXCQJ4.js → MKLUERPB.js} +2 -2
- package/dist/chunks/{5PLOENVJ.js → OAVOR7X5.js} +1 -1
- package/dist/chunks/{AVQ7DQA4.js → OCZ5XVNP.js} +1 -1
- package/dist/chunks/{ZN4ELT45.js → OLRLJB7H.js} +1 -1
- package/dist/chunks/{LXS4IDDQ.js → VCUKXTAR.js} +2 -2
- package/dist/chunks/{QL42CXIT.js → WNEUGMU4.js} +1 -1
- package/dist/chunks/ZVRYGPBA.js +2 -0
- package/dist/cli.js +132 -132
- package/dist/cloud/index.js +2 -2
- package/dist/refuse/ai.js +1 -1
- package/dist/refuse/backend.js +1 -1
- package/dist/refuse/cloud.js +1 -1
- package/dist/refuse/server.js +1 -1
- package/dist/server/index.js +2 -2
- package/dist/server/testing.js +2 -2
- package/dist/web/calls-ui.js +46 -0
- package/dist/web/index.js +2 -2
- package/dist/web/message.js +2 -2
- package/dist/web/palbe.js +2 -2
- package/dist/web/paywall.js +2 -2
- package/dist/web/push-sw.js +2 -2
- package/dist/web/ssr.js +2 -2
- package/dist/web/vite.js +2 -2
- package/package.json +7 -2
- package/types/cloud/src/generated/project.d.ts +2 -1
- package/types/internal/src/modules/calls.d.ts +810 -0
- package/types/internal/src/modules/events.d.ts +4 -3
- package/types/internal/src/modules/index.d.ts +1 -0
- package/types/internal/src/modules/machines.d.ts +118 -8
- package/types/internal/src/modules/messaging.d.ts +53 -3
- package/types/internal/src/modules/realtime.d.ts +1 -1
- package/types/server/src/server.d.ts +7 -0
- package/types/web/src/calls-ui/index.d.ts +71 -0
- package/types/web/src/calls.d.ts +274 -0
- package/types/web/src/client.d.ts +5 -0
- package/types/web/src/index.d.ts +1 -0
- package/dist/chunks/BRK5A42K.js +0 -22
- package/dist/chunks/BXJGHBB5.js +0 -2
- package/dist/chunks/ZBY3Q6Q2.js +0 -2
|
@@ -2,6 +2,7 @@ import type { WebhookEvent } from '../event.js';
|
|
|
2
2
|
import type { Events as AiEvents } from './ai.js';
|
|
3
3
|
import type { Events as AnalyticsEvents } from './analytics.js';
|
|
4
4
|
import type { Events as AuthEvents } from './auth.js';
|
|
5
|
+
import type { Events as CallsEvents } from './calls.js';
|
|
5
6
|
import type { Events as FlagsEvents } from './flags.js';
|
|
6
7
|
import type { Events as JourneysEvents } from './journeys.js';
|
|
7
8
|
import type { Events as MessagingEvents } from './messaging.js';
|
|
@@ -10,16 +11,16 @@ import type { Events as PurchasesEvents } from './purchases.js';
|
|
|
10
11
|
import type { Events as StorageEvents } from './storage.js';
|
|
11
12
|
import type { Events as StoresEvents } from './stores.js';
|
|
12
13
|
/** Every event the modules' contracts say they send the project's webhooks (x-palbase-events), by type: its payload, the event's data. */
|
|
13
|
-
export interface PlatformEvents extends AiEvents, AnalyticsEvents, AuthEvents, FlagsEvents, JourneysEvents, MessagingEvents, NotifyEvents, PurchasesEvents, StorageEvents, StoresEvents {
|
|
14
|
+
export interface PlatformEvents extends AiEvents, AnalyticsEvents, AuthEvents, CallsEvents, FlagsEvents, JourneysEvents, MessagingEvents, NotifyEvents, PurchasesEvents, StorageEvents, StoresEvents {
|
|
14
15
|
}
|
|
15
16
|
/** A platform event's type: one a module's contract declares. */
|
|
16
17
|
export type EventType = keyof PlatformEvents;
|
|
17
18
|
/** Every platform event's type, as the contracts declare them. */
|
|
18
|
-
export declare const EVENT_TYPES: readonly ["ai.goal.updated", "ai.response.completed", "ai.response.failed", "ai.response.started", "ai.voice.closed", "ai.voice.delegated", "ai.voice.started", "ai.workspace.published", "ai.workspace.pushed", "audience.entered", "audience.exited", "consent.changed", "device.revoked", "file.deleted", "file.moved", "file.uploaded", "flag.changed", "flag.override_changed", "journey.converted", "journey.ended", "journey.entered", "journey.event", "journey.step", "messaging.conversation.created", "messaging.conversation.deleted", "messaging.conversation.read", "messaging.message.created", "messaging.report.created", "notification.action", "notification.bounced", "notification.complained", "notification.delivered", "notification.dismissed", "notification.expired", "notification.failed", "notification.not_shown", "notification.opened", "notification.push_failing", "notification.read", "notification.received", "notification.rejected", "notification.sent", "notification.unconfirmed", "notification.undelivered", "notification.uninstalled", "purchases.catalog.applied", "purchases.catalog.changed", "purchases.coupon.redeemed", "purchases.credits.depleted", "purchases.credits.low", "purchases.customer.changed", "purchases.customer.erased", "purchases.customer.merged", "purchases.entitlement.changed", "purchases.offer.redeemed", "purchases.ownership.transferred", "purchases.paywall.published", "purchases.purchase.completed", "purchases.quota.exhausted", "purchases.quota.threshold", "purchases.refund.changed", "purchases.store.changed", "purchases.subscription.changed", "session.ended", "stores.action.changed", "stores.app.changed", "stores.apple.changed", "stores.apple.key.made", "stores.apple.key.revoked", "stores.apple.session.changed", "stores.apple.session.ended", "stores.apple.session.expired", "stores.beta_review.changed", "stores.build.changed", "stores.delivery.changed", "stores.delivery.requested", "stores.feedback.received", "stores.google.changed", "stores.group.changed", "stores.package.changed", "stores.play_release.changed", "stores.product.changed", "stores.review.message", "stores.version.changed", "stores.version.reviewed", "stores.vitals.changed", "stores.webhook.changed", "user.converted", "user.deleted", "user.locale_changed", "user.permissions_changed"];
|
|
19
|
+
export declare const EVENT_TYPES: readonly ["ai.goal.updated", "ai.response.completed", "ai.response.failed", "ai.response.started", "ai.voice.closed", "ai.voice.delegated", "ai.voice.started", "ai.workspace.published", "ai.workspace.pushed", "audience.entered", "audience.exited", "calls.call.ended", "calls.call.started", "calls.participant.joined", "calls.participant.left", "consent.changed", "device.revoked", "file.deleted", "file.moved", "file.uploaded", "flag.changed", "flag.override_changed", "journey.converted", "journey.ended", "journey.entered", "journey.event", "journey.step", "messaging.conversation.created", "messaging.conversation.deleted", "messaging.conversation.read", "messaging.message.created", "messaging.report.created", "notification.action", "notification.bounced", "notification.complained", "notification.delivered", "notification.dismissed", "notification.expired", "notification.failed", "notification.not_shown", "notification.opened", "notification.push_failing", "notification.read", "notification.received", "notification.rejected", "notification.sent", "notification.unconfirmed", "notification.undelivered", "notification.uninstalled", "purchases.catalog.applied", "purchases.catalog.changed", "purchases.coupon.redeemed", "purchases.credits.depleted", "purchases.credits.low", "purchases.customer.changed", "purchases.customer.erased", "purchases.customer.merged", "purchases.entitlement.changed", "purchases.offer.redeemed", "purchases.ownership.transferred", "purchases.paywall.published", "purchases.purchase.completed", "purchases.quota.exhausted", "purchases.quota.threshold", "purchases.refund.changed", "purchases.store.changed", "purchases.subscription.changed", "session.ended", "stores.action.changed", "stores.app.changed", "stores.apple.changed", "stores.apple.key.made", "stores.apple.key.revoked", "stores.apple.session.changed", "stores.apple.session.ended", "stores.apple.session.expired", "stores.beta_review.changed", "stores.build.changed", "stores.delivery.changed", "stores.delivery.requested", "stores.feedback.received", "stores.google.changed", "stores.group.changed", "stores.package.changed", "stores.play_release.changed", "stores.product.changed", "stores.review.message", "stores.version.changed", "stores.version.reviewed", "stores.vitals.changed", "stores.webhook.changed", "user.converted", "user.deleted", "user.locale_changed", "user.permissions_changed"];
|
|
19
20
|
/**
|
|
20
21
|
* A platform event as delivered: one member per type the contracts declare,
|
|
21
22
|
* its data that type's payload, so a switch on its type narrows it. An
|
|
22
23
|
* event of a type none of them declares (one a newer platform sends) is no
|
|
23
24
|
* member: at run time it reaches the switch's default, which takes it.
|
|
24
25
|
*/
|
|
25
|
-
export type PalbaseEvent = WebhookEvent<PlatformEvents["ai.goal.updated"], "ai.goal.updated"> | WebhookEvent<PlatformEvents["ai.response.completed"], "ai.response.completed"> | WebhookEvent<PlatformEvents["ai.response.failed"], "ai.response.failed"> | WebhookEvent<PlatformEvents["ai.response.started"], "ai.response.started"> | WebhookEvent<PlatformEvents["ai.voice.closed"], "ai.voice.closed"> | WebhookEvent<PlatformEvents["ai.voice.delegated"], "ai.voice.delegated"> | WebhookEvent<PlatformEvents["ai.voice.started"], "ai.voice.started"> | WebhookEvent<PlatformEvents["ai.workspace.published"], "ai.workspace.published"> | WebhookEvent<PlatformEvents["ai.workspace.pushed"], "ai.workspace.pushed"> | WebhookEvent<PlatformEvents["audience.entered"], "audience.entered"> | WebhookEvent<PlatformEvents["audience.exited"], "audience.exited"> | WebhookEvent<PlatformEvents["consent.changed"], "consent.changed"> | WebhookEvent<PlatformEvents["device.revoked"], "device.revoked"> | WebhookEvent<PlatformEvents["file.deleted"], "file.deleted"> | WebhookEvent<PlatformEvents["file.moved"], "file.moved"> | WebhookEvent<PlatformEvents["file.uploaded"], "file.uploaded"> | WebhookEvent<PlatformEvents["flag.changed"], "flag.changed"> | WebhookEvent<PlatformEvents["flag.override_changed"], "flag.override_changed"> | WebhookEvent<PlatformEvents["journey.converted"], "journey.converted"> | WebhookEvent<PlatformEvents["journey.ended"], "journey.ended"> | WebhookEvent<PlatformEvents["journey.entered"], "journey.entered"> | WebhookEvent<PlatformEvents["journey.event"], "journey.event"> | WebhookEvent<PlatformEvents["journey.step"], "journey.step"> | WebhookEvent<PlatformEvents["messaging.conversation.created"], "messaging.conversation.created"> | WebhookEvent<PlatformEvents["messaging.conversation.deleted"], "messaging.conversation.deleted"> | WebhookEvent<PlatformEvents["messaging.conversation.read"], "messaging.conversation.read"> | WebhookEvent<PlatformEvents["messaging.message.created"], "messaging.message.created"> | WebhookEvent<PlatformEvents["messaging.report.created"], "messaging.report.created"> | WebhookEvent<PlatformEvents["notification.action"], "notification.action"> | WebhookEvent<PlatformEvents["notification.bounced"], "notification.bounced"> | WebhookEvent<PlatformEvents["notification.complained"], "notification.complained"> | WebhookEvent<PlatformEvents["notification.delivered"], "notification.delivered"> | WebhookEvent<PlatformEvents["notification.dismissed"], "notification.dismissed"> | WebhookEvent<PlatformEvents["notification.expired"], "notification.expired"> | WebhookEvent<PlatformEvents["notification.failed"], "notification.failed"> | WebhookEvent<PlatformEvents["notification.not_shown"], "notification.not_shown"> | WebhookEvent<PlatformEvents["notification.opened"], "notification.opened"> | WebhookEvent<PlatformEvents["notification.push_failing"], "notification.push_failing"> | WebhookEvent<PlatformEvents["notification.read"], "notification.read"> | WebhookEvent<PlatformEvents["notification.received"], "notification.received"> | WebhookEvent<PlatformEvents["notification.rejected"], "notification.rejected"> | WebhookEvent<PlatformEvents["notification.sent"], "notification.sent"> | WebhookEvent<PlatformEvents["notification.unconfirmed"], "notification.unconfirmed"> | WebhookEvent<PlatformEvents["notification.undelivered"], "notification.undelivered"> | WebhookEvent<PlatformEvents["notification.uninstalled"], "notification.uninstalled"> | WebhookEvent<PlatformEvents["purchases.catalog.applied"], "purchases.catalog.applied"> | WebhookEvent<PlatformEvents["purchases.catalog.changed"], "purchases.catalog.changed"> | WebhookEvent<PlatformEvents["purchases.coupon.redeemed"], "purchases.coupon.redeemed"> | WebhookEvent<PlatformEvents["purchases.credits.depleted"], "purchases.credits.depleted"> | WebhookEvent<PlatformEvents["purchases.credits.low"], "purchases.credits.low"> | WebhookEvent<PlatformEvents["purchases.customer.changed"], "purchases.customer.changed"> | WebhookEvent<PlatformEvents["purchases.customer.erased"], "purchases.customer.erased"> | WebhookEvent<PlatformEvents["purchases.customer.merged"], "purchases.customer.merged"> | WebhookEvent<PlatformEvents["purchases.entitlement.changed"], "purchases.entitlement.changed"> | WebhookEvent<PlatformEvents["purchases.offer.redeemed"], "purchases.offer.redeemed"> | WebhookEvent<PlatformEvents["purchases.ownership.transferred"], "purchases.ownership.transferred"> | WebhookEvent<PlatformEvents["purchases.paywall.published"], "purchases.paywall.published"> | WebhookEvent<PlatformEvents["purchases.purchase.completed"], "purchases.purchase.completed"> | WebhookEvent<PlatformEvents["purchases.quota.exhausted"], "purchases.quota.exhausted"> | WebhookEvent<PlatformEvents["purchases.quota.threshold"], "purchases.quota.threshold"> | WebhookEvent<PlatformEvents["purchases.refund.changed"], "purchases.refund.changed"> | WebhookEvent<PlatformEvents["purchases.store.changed"], "purchases.store.changed"> | WebhookEvent<PlatformEvents["purchases.subscription.changed"], "purchases.subscription.changed"> | WebhookEvent<PlatformEvents["session.ended"], "session.ended"> | WebhookEvent<PlatformEvents["stores.action.changed"], "stores.action.changed"> | WebhookEvent<PlatformEvents["stores.app.changed"], "stores.app.changed"> | WebhookEvent<PlatformEvents["stores.apple.changed"], "stores.apple.changed"> | WebhookEvent<PlatformEvents["stores.apple.key.made"], "stores.apple.key.made"> | WebhookEvent<PlatformEvents["stores.apple.key.revoked"], "stores.apple.key.revoked"> | WebhookEvent<PlatformEvents["stores.apple.session.changed"], "stores.apple.session.changed"> | WebhookEvent<PlatformEvents["stores.apple.session.ended"], "stores.apple.session.ended"> | WebhookEvent<PlatformEvents["stores.apple.session.expired"], "stores.apple.session.expired"> | WebhookEvent<PlatformEvents["stores.beta_review.changed"], "stores.beta_review.changed"> | WebhookEvent<PlatformEvents["stores.build.changed"], "stores.build.changed"> | WebhookEvent<PlatformEvents["stores.delivery.changed"], "stores.delivery.changed"> | WebhookEvent<PlatformEvents["stores.delivery.requested"], "stores.delivery.requested"> | WebhookEvent<PlatformEvents["stores.feedback.received"], "stores.feedback.received"> | WebhookEvent<PlatformEvents["stores.google.changed"], "stores.google.changed"> | WebhookEvent<PlatformEvents["stores.group.changed"], "stores.group.changed"> | WebhookEvent<PlatformEvents["stores.package.changed"], "stores.package.changed"> | WebhookEvent<PlatformEvents["stores.play_release.changed"], "stores.play_release.changed"> | WebhookEvent<PlatformEvents["stores.product.changed"], "stores.product.changed"> | WebhookEvent<PlatformEvents["stores.review.message"], "stores.review.message"> | WebhookEvent<PlatformEvents["stores.version.changed"], "stores.version.changed"> | WebhookEvent<PlatformEvents["stores.version.reviewed"], "stores.version.reviewed"> | WebhookEvent<PlatformEvents["stores.vitals.changed"], "stores.vitals.changed"> | WebhookEvent<PlatformEvents["stores.webhook.changed"], "stores.webhook.changed"> | WebhookEvent<PlatformEvents["user.converted"], "user.converted"> | WebhookEvent<PlatformEvents["user.deleted"], "user.deleted"> | WebhookEvent<PlatformEvents["user.locale_changed"], "user.locale_changed"> | WebhookEvent<PlatformEvents["user.permissions_changed"], "user.permissions_changed">;
|
|
26
|
+
export type PalbaseEvent = WebhookEvent<PlatformEvents["ai.goal.updated"], "ai.goal.updated"> | WebhookEvent<PlatformEvents["ai.response.completed"], "ai.response.completed"> | WebhookEvent<PlatformEvents["ai.response.failed"], "ai.response.failed"> | WebhookEvent<PlatformEvents["ai.response.started"], "ai.response.started"> | WebhookEvent<PlatformEvents["ai.voice.closed"], "ai.voice.closed"> | WebhookEvent<PlatformEvents["ai.voice.delegated"], "ai.voice.delegated"> | WebhookEvent<PlatformEvents["ai.voice.started"], "ai.voice.started"> | WebhookEvent<PlatformEvents["ai.workspace.published"], "ai.workspace.published"> | WebhookEvent<PlatformEvents["ai.workspace.pushed"], "ai.workspace.pushed"> | WebhookEvent<PlatformEvents["audience.entered"], "audience.entered"> | WebhookEvent<PlatformEvents["audience.exited"], "audience.exited"> | WebhookEvent<PlatformEvents["calls.call.ended"], "calls.call.ended"> | WebhookEvent<PlatformEvents["calls.call.started"], "calls.call.started"> | WebhookEvent<PlatformEvents["calls.participant.joined"], "calls.participant.joined"> | WebhookEvent<PlatformEvents["calls.participant.left"], "calls.participant.left"> | WebhookEvent<PlatformEvents["consent.changed"], "consent.changed"> | WebhookEvent<PlatformEvents["device.revoked"], "device.revoked"> | WebhookEvent<PlatformEvents["file.deleted"], "file.deleted"> | WebhookEvent<PlatformEvents["file.moved"], "file.moved"> | WebhookEvent<PlatformEvents["file.uploaded"], "file.uploaded"> | WebhookEvent<PlatformEvents["flag.changed"], "flag.changed"> | WebhookEvent<PlatformEvents["flag.override_changed"], "flag.override_changed"> | WebhookEvent<PlatformEvents["journey.converted"], "journey.converted"> | WebhookEvent<PlatformEvents["journey.ended"], "journey.ended"> | WebhookEvent<PlatformEvents["journey.entered"], "journey.entered"> | WebhookEvent<PlatformEvents["journey.event"], "journey.event"> | WebhookEvent<PlatformEvents["journey.step"], "journey.step"> | WebhookEvent<PlatformEvents["messaging.conversation.created"], "messaging.conversation.created"> | WebhookEvent<PlatformEvents["messaging.conversation.deleted"], "messaging.conversation.deleted"> | WebhookEvent<PlatformEvents["messaging.conversation.read"], "messaging.conversation.read"> | WebhookEvent<PlatformEvents["messaging.message.created"], "messaging.message.created"> | WebhookEvent<PlatformEvents["messaging.report.created"], "messaging.report.created"> | WebhookEvent<PlatformEvents["notification.action"], "notification.action"> | WebhookEvent<PlatformEvents["notification.bounced"], "notification.bounced"> | WebhookEvent<PlatformEvents["notification.complained"], "notification.complained"> | WebhookEvent<PlatformEvents["notification.delivered"], "notification.delivered"> | WebhookEvent<PlatformEvents["notification.dismissed"], "notification.dismissed"> | WebhookEvent<PlatformEvents["notification.expired"], "notification.expired"> | WebhookEvent<PlatformEvents["notification.failed"], "notification.failed"> | WebhookEvent<PlatformEvents["notification.not_shown"], "notification.not_shown"> | WebhookEvent<PlatformEvents["notification.opened"], "notification.opened"> | WebhookEvent<PlatformEvents["notification.push_failing"], "notification.push_failing"> | WebhookEvent<PlatformEvents["notification.read"], "notification.read"> | WebhookEvent<PlatformEvents["notification.received"], "notification.received"> | WebhookEvent<PlatformEvents["notification.rejected"], "notification.rejected"> | WebhookEvent<PlatformEvents["notification.sent"], "notification.sent"> | WebhookEvent<PlatformEvents["notification.unconfirmed"], "notification.unconfirmed"> | WebhookEvent<PlatformEvents["notification.undelivered"], "notification.undelivered"> | WebhookEvent<PlatformEvents["notification.uninstalled"], "notification.uninstalled"> | WebhookEvent<PlatformEvents["purchases.catalog.applied"], "purchases.catalog.applied"> | WebhookEvent<PlatformEvents["purchases.catalog.changed"], "purchases.catalog.changed"> | WebhookEvent<PlatformEvents["purchases.coupon.redeemed"], "purchases.coupon.redeemed"> | WebhookEvent<PlatformEvents["purchases.credits.depleted"], "purchases.credits.depleted"> | WebhookEvent<PlatformEvents["purchases.credits.low"], "purchases.credits.low"> | WebhookEvent<PlatformEvents["purchases.customer.changed"], "purchases.customer.changed"> | WebhookEvent<PlatformEvents["purchases.customer.erased"], "purchases.customer.erased"> | WebhookEvent<PlatformEvents["purchases.customer.merged"], "purchases.customer.merged"> | WebhookEvent<PlatformEvents["purchases.entitlement.changed"], "purchases.entitlement.changed"> | WebhookEvent<PlatformEvents["purchases.offer.redeemed"], "purchases.offer.redeemed"> | WebhookEvent<PlatformEvents["purchases.ownership.transferred"], "purchases.ownership.transferred"> | WebhookEvent<PlatformEvents["purchases.paywall.published"], "purchases.paywall.published"> | WebhookEvent<PlatformEvents["purchases.purchase.completed"], "purchases.purchase.completed"> | WebhookEvent<PlatformEvents["purchases.quota.exhausted"], "purchases.quota.exhausted"> | WebhookEvent<PlatformEvents["purchases.quota.threshold"], "purchases.quota.threshold"> | WebhookEvent<PlatformEvents["purchases.refund.changed"], "purchases.refund.changed"> | WebhookEvent<PlatformEvents["purchases.store.changed"], "purchases.store.changed"> | WebhookEvent<PlatformEvents["purchases.subscription.changed"], "purchases.subscription.changed"> | WebhookEvent<PlatformEvents["session.ended"], "session.ended"> | WebhookEvent<PlatformEvents["stores.action.changed"], "stores.action.changed"> | WebhookEvent<PlatformEvents["stores.app.changed"], "stores.app.changed"> | WebhookEvent<PlatformEvents["stores.apple.changed"], "stores.apple.changed"> | WebhookEvent<PlatformEvents["stores.apple.key.made"], "stores.apple.key.made"> | WebhookEvent<PlatformEvents["stores.apple.key.revoked"], "stores.apple.key.revoked"> | WebhookEvent<PlatformEvents["stores.apple.session.changed"], "stores.apple.session.changed"> | WebhookEvent<PlatformEvents["stores.apple.session.ended"], "stores.apple.session.ended"> | WebhookEvent<PlatformEvents["stores.apple.session.expired"], "stores.apple.session.expired"> | WebhookEvent<PlatformEvents["stores.beta_review.changed"], "stores.beta_review.changed"> | WebhookEvent<PlatformEvents["stores.build.changed"], "stores.build.changed"> | WebhookEvent<PlatformEvents["stores.delivery.changed"], "stores.delivery.changed"> | WebhookEvent<PlatformEvents["stores.delivery.requested"], "stores.delivery.requested"> | WebhookEvent<PlatformEvents["stores.feedback.received"], "stores.feedback.received"> | WebhookEvent<PlatformEvents["stores.google.changed"], "stores.google.changed"> | WebhookEvent<PlatformEvents["stores.group.changed"], "stores.group.changed"> | WebhookEvent<PlatformEvents["stores.package.changed"], "stores.package.changed"> | WebhookEvent<PlatformEvents["stores.play_release.changed"], "stores.play_release.changed"> | WebhookEvent<PlatformEvents["stores.product.changed"], "stores.product.changed"> | WebhookEvent<PlatformEvents["stores.review.message"], "stores.review.message"> | WebhookEvent<PlatformEvents["stores.version.changed"], "stores.version.changed"> | WebhookEvent<PlatformEvents["stores.version.reviewed"], "stores.version.reviewed"> | WebhookEvent<PlatformEvents["stores.vitals.changed"], "stores.vitals.changed"> | WebhookEvent<PlatformEvents["stores.webhook.changed"], "stores.webhook.changed"> | WebhookEvent<PlatformEvents["user.converted"], "user.converted"> | WebhookEvent<PlatformEvents["user.deleted"], "user.deleted"> | WebhookEvent<PlatformEvents["user.locale_changed"], "user.locale_changed"> | WebhookEvent<PlatformEvents["user.permissions_changed"], "user.permissions_changed">;
|
|
@@ -2,6 +2,7 @@ export * as ai from './ai.js';
|
|
|
2
2
|
export * as analytics from './analytics.js';
|
|
3
3
|
export * as auth from './auth.js';
|
|
4
4
|
export * as cache from './cache.js';
|
|
5
|
+
export * as calls from './calls.js';
|
|
5
6
|
export * as flags from './flags.js';
|
|
6
7
|
export * as journeys from './journeys.js';
|
|
7
8
|
export * as machines from './machines.js';
|
|
@@ -1714,9 +1714,9 @@ export type Preview = {
|
|
|
1714
1714
|
*/
|
|
1715
1715
|
url: string;
|
|
1716
1716
|
/**
|
|
1717
|
-
* building, ready, failed — or closed: its pull request closed,
|
|
1717
|
+
* authorization_required — a fork's head waiting for an admin of the environment to authorize it (fork protection): nothing of it is built until one does, and each push asks again —, building, ready, failed — or closed: its pull request closed, its address answers no more.
|
|
1718
1718
|
*/
|
|
1719
|
-
state: "building" | "ready" | "failed" | "closed";
|
|
1719
|
+
state: "authorization_required" | "building" | "ready" | "failed" | "closed";
|
|
1720
1720
|
/**
|
|
1721
1721
|
* A machine's preview: its own machine, by name.
|
|
1722
1722
|
*/
|
|
@@ -1724,6 +1724,15 @@ export type Preview = {
|
|
|
1724
1724
|
created_at: string;
|
|
1725
1725
|
updated_at: string;
|
|
1726
1726
|
closed_at?: string;
|
|
1727
|
+
/**
|
|
1728
|
+
* The fork's head an admin last authorized.
|
|
1729
|
+
*/
|
|
1730
|
+
authorized_commit?: string;
|
|
1731
|
+
/**
|
|
1732
|
+
* Who authorized it: a developer's id, or the credential the call presented.
|
|
1733
|
+
*/
|
|
1734
|
+
authorized_by?: string;
|
|
1735
|
+
authorized_at?: string;
|
|
1727
1736
|
};
|
|
1728
1737
|
/**
|
|
1729
1738
|
* A site's or a machine's previews, the fifty newest first.
|
|
@@ -1735,12 +1744,12 @@ export type PreviewList = {
|
|
|
1735
1744
|
* One record of a domain's DNS.
|
|
1736
1745
|
*/
|
|
1737
1746
|
export type DNSRecord = {
|
|
1738
|
-
type: "CNAME" | "TXT";
|
|
1747
|
+
type: "A" | "CNAME" | "TXT";
|
|
1739
1748
|
name: string;
|
|
1740
1749
|
value: string;
|
|
1741
1750
|
};
|
|
1742
1751
|
/**
|
|
1743
|
-
* A domain of the customer's own a site or a machine answers at too. Its owner adds its records to its DNS:
|
|
1752
|
+
* A domain of the customer's own a site or a machine answers at too. Its owner adds its records to its DNS: a subdomain's CNAME points it at the platform through Cloudflare; an apex's A record names the platform's address for apexes, which any DNS host takes (its certificate the edge's, from Let's Encrypt) — or, where its DNS host has one, an ALIAS, ANAME or flattened CNAME to the subdomains' target keeps it behind Cloudflare. The TXT shows it is this environment's. It answers once its certificate is issued and the TXT record is there. A domain may send its visitors to another domain of the same site or machine (redirect_to). A domain is one environment's, platform-wide, until it is deleted there.
|
|
1744
1753
|
*/
|
|
1745
1754
|
export type Domain = {
|
|
1746
1755
|
/**
|
|
@@ -1752,9 +1761,21 @@ export type Domain = {
|
|
|
1752
1761
|
*/
|
|
1753
1762
|
state: "pending" | "active";
|
|
1754
1763
|
/**
|
|
1755
|
-
* A domain of its own, not a subdomain:
|
|
1764
|
+
* A domain of its own, not a subdomain: its DNS takes an A record at the platform's address for apexes (records), or an ALIAS, ANAME or flattened CNAME to the subdomains' target.
|
|
1756
1765
|
*/
|
|
1757
1766
|
apex: boolean;
|
|
1767
|
+
/**
|
|
1768
|
+
* How it reaches the platform, as last read: cdn through Cloudflare (its certificate Cloudflare's), ip an apex's A record at the platform's address for apexes (its certificate Let's Encrypt's); null while its DNS says neither.
|
|
1769
|
+
*/
|
|
1770
|
+
via: ("cdn" | "ip") | null;
|
|
1771
|
+
/**
|
|
1772
|
+
* Another domain of the same site or machine its visitors are sent to, the same path and query there (Vercel's "Redirect to"); null when it answers itself.
|
|
1773
|
+
*/
|
|
1774
|
+
redirect_to: string | null;
|
|
1775
|
+
/**
|
|
1776
|
+
* The redirect's status: 308 unless said; null with redirect_to.
|
|
1777
|
+
*/
|
|
1778
|
+
redirect_status: (301 | 302 | 307 | 308) | null;
|
|
1758
1779
|
/**
|
|
1759
1780
|
* What its owner adds to its DNS.
|
|
1760
1781
|
*/
|
|
@@ -1774,13 +1795,50 @@ export type DomainList = {
|
|
|
1774
1795
|
domains: Domain[];
|
|
1775
1796
|
};
|
|
1776
1797
|
/**
|
|
1777
|
-
* A domain to add.
|
|
1798
|
+
* A domain to add — sending its visitors to another of the same site's or machine's when redirect_to names one.
|
|
1778
1799
|
*/
|
|
1779
1800
|
export type DomainCreate = {
|
|
1780
1801
|
/**
|
|
1781
1802
|
* The domain: www.example.com, or example.com — none of the platform's own.
|
|
1782
1803
|
*/
|
|
1783
1804
|
host: string;
|
|
1805
|
+
/**
|
|
1806
|
+
* Another domain of the same site or machine, added before, its visitors are sent to (an apex to its www, or a www to its apex). It may not redirect itself, and this one may not be another's target.
|
|
1807
|
+
*/
|
|
1808
|
+
redirect_to?: string;
|
|
1809
|
+
/**
|
|
1810
|
+
* The redirect's status, with redirect_to: 308 unless said.
|
|
1811
|
+
*/
|
|
1812
|
+
redirect_status?: 301 | 302 | 307 | 308;
|
|
1813
|
+
};
|
|
1814
|
+
/**
|
|
1815
|
+
* Where a domain sends its visitors: another domain of the same site or machine, or null to have it answer itself. It holds at once.
|
|
1816
|
+
*/
|
|
1817
|
+
export type DomainUpdate = {
|
|
1818
|
+
/**
|
|
1819
|
+
* Another domain of the same site or machine (one that redirects nowhere itself), or null.
|
|
1820
|
+
*/
|
|
1821
|
+
redirect_to: string | null;
|
|
1822
|
+
/**
|
|
1823
|
+
* The redirect's status, with redirect_to: 308 unless said.
|
|
1824
|
+
*/
|
|
1825
|
+
redirect_status?: 301 | 302 | 307 | 308;
|
|
1826
|
+
};
|
|
1827
|
+
/**
|
|
1828
|
+
* The fork's head an admin authorizes: the one they looked at, which must be the pull request's newest.
|
|
1829
|
+
*/
|
|
1830
|
+
export type PreviewAuthorize = {
|
|
1831
|
+
/**
|
|
1832
|
+
* The pull request's head, as its preview says (Preview.commit).
|
|
1833
|
+
*/
|
|
1834
|
+
commit: string;
|
|
1835
|
+
};
|
|
1836
|
+
/**
|
|
1837
|
+
* An authorization taken: the preview is being built at the commit.
|
|
1838
|
+
*/
|
|
1839
|
+
export type PreviewAuthorized = {
|
|
1840
|
+
pull_request: number;
|
|
1841
|
+
commit: string;
|
|
1784
1842
|
};
|
|
1785
1843
|
/** Palbase Machines */
|
|
1786
1844
|
export declare function client(t: Transport): {
|
|
@@ -1975,7 +2033,7 @@ export declare function client(t: Transport): {
|
|
|
1975
2033
|
/**
|
|
1976
2034
|
* Delete a machine's domain
|
|
1977
2035
|
*
|
|
1978
|
-
* Takes a domain away: it answers no more at once, and another environment may add it.
|
|
2036
|
+
* Takes a domain away: it answers no more at once, and another environment may add it. One another domain redirects to is kept (409 domain_redirected_to): change that one's redirect first.
|
|
1979
2037
|
*/
|
|
1980
2038
|
deleteMachineDomain(input: {
|
|
1981
2039
|
path: {
|
|
@@ -1984,6 +2042,19 @@ export declare function client(t: Transport): {
|
|
|
1984
2042
|
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
1985
2043
|
signal?: AbortSignal;
|
|
1986
2044
|
}): Promise<Reply<204, undefined>>;
|
|
2045
|
+
/**
|
|
2046
|
+
* Set where a machine's domain redirects
|
|
2047
|
+
*
|
|
2048
|
+
* Sends the domain's visitors to another domain of the same machine — the same path and query there, with redirect_status (308 unless said) — or, redirect_to null, has it answer itself. It holds at the edge at once. A domain redirects to one that redirects nowhere, and one others redirect to answers itself.
|
|
2049
|
+
*/
|
|
2050
|
+
updateMachineDomain(input: {
|
|
2051
|
+
path: {
|
|
2052
|
+
name: string; /** The domain. */
|
|
2053
|
+
host: string;
|
|
2054
|
+
};
|
|
2055
|
+
body: DomainUpdate; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2056
|
+
signal?: AbortSignal;
|
|
2057
|
+
}): Promise<Reply<200, Domain>>;
|
|
1987
2058
|
/**
|
|
1988
2059
|
* Read a build
|
|
1989
2060
|
*
|
|
@@ -2570,7 +2641,7 @@ export declare function client(t: Transport): {
|
|
|
2570
2641
|
/**
|
|
2571
2642
|
* Delete a site's domain
|
|
2572
2643
|
*
|
|
2573
|
-
* Takes a domain away: it answers no more at once, and another environment may add it.
|
|
2644
|
+
* Takes a domain away: it answers no more at once, and another environment may add it. One another domain redirects to is kept (409 domain_redirected_to): change that one's redirect first.
|
|
2574
2645
|
*/
|
|
2575
2646
|
deleteSiteDomain(input: {
|
|
2576
2647
|
path: {
|
|
@@ -2579,6 +2650,19 @@ export declare function client(t: Transport): {
|
|
|
2579
2650
|
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2580
2651
|
signal?: AbortSignal;
|
|
2581
2652
|
}): Promise<Reply<204, undefined>>;
|
|
2653
|
+
/**
|
|
2654
|
+
* Set where a site's domain redirects
|
|
2655
|
+
*
|
|
2656
|
+
* Sends the domain's visitors to another domain of the same site — the same path and query there, with redirect_status (308 unless said) — or, redirect_to null, has it answer itself. It holds at the edge at once. A domain redirects to one that redirects nowhere, and one others redirect to answers itself.
|
|
2657
|
+
*/
|
|
2658
|
+
updateSiteDomain(input: {
|
|
2659
|
+
path: {
|
|
2660
|
+
name: string; /** The domain. */
|
|
2661
|
+
host: string;
|
|
2662
|
+
};
|
|
2663
|
+
body: DomainUpdate; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2664
|
+
signal?: AbortSignal;
|
|
2665
|
+
}): Promise<Reply<200, Domain>>;
|
|
2582
2666
|
/**
|
|
2583
2667
|
* Get a site's build
|
|
2584
2668
|
*
|
|
@@ -2591,5 +2675,31 @@ export declare function client(t: Transport): {
|
|
|
2591
2675
|
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2592
2676
|
signal?: AbortSignal;
|
|
2593
2677
|
}): Promise<Reply<200, SiteBuild>>;
|
|
2678
|
+
/**
|
|
2679
|
+
* Authorize a fork's pull request's preview
|
|
2680
|
+
*
|
|
2681
|
+
* Builds the preview of a pull request from a fork at the head an admin looked at (fork protection, Vercel's Git Fork Protection: a fork's code runs with the environment's settings and secrets). The head must be the pull request's newest: a push since answers 409 preview_head_moved. Each new push asks again.
|
|
2682
|
+
*/
|
|
2683
|
+
authorizeSitePreview(input: {
|
|
2684
|
+
path: {
|
|
2685
|
+
name: string; /** The pull request's number. */
|
|
2686
|
+
pull_request: number;
|
|
2687
|
+
};
|
|
2688
|
+
body: PreviewAuthorize; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2689
|
+
signal?: AbortSignal;
|
|
2690
|
+
}): Promise<Reply<202, PreviewAuthorized>>;
|
|
2691
|
+
/**
|
|
2692
|
+
* Authorize a fork's pull request's preview
|
|
2693
|
+
*
|
|
2694
|
+
* Builds the preview of a pull request from a fork at the head an admin looked at (fork protection, Vercel's Git Fork Protection: a fork's code runs with the environment's settings and secrets). The head must be the pull request's newest: a push since answers 409 preview_head_moved. Each new push asks again.
|
|
2695
|
+
*/
|
|
2696
|
+
authorizeMachinePreview(input: {
|
|
2697
|
+
path: {
|
|
2698
|
+
name: string; /** The pull request's number. */
|
|
2699
|
+
pull_request: number;
|
|
2700
|
+
};
|
|
2701
|
+
body: PreviewAuthorize; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2702
|
+
signal?: AbortSignal;
|
|
2703
|
+
}): Promise<Reply<202, PreviewAuthorized>>;
|
|
2594
2704
|
};
|
|
2595
2705
|
export type Client = ReturnType<typeof client>;
|
|
@@ -293,6 +293,51 @@ export type BlockPage = {
|
|
|
293
293
|
*/
|
|
294
294
|
next_cursor?: string;
|
|
295
295
|
};
|
|
296
|
+
/**
|
|
297
|
+
* A call made from a conversation, as its call message keeps it (the calls module's word).
|
|
298
|
+
*/
|
|
299
|
+
export type CallRecord = {
|
|
300
|
+
/**
|
|
301
|
+
* When it was answered
|
|
302
|
+
*/
|
|
303
|
+
answered_at: string | null;
|
|
304
|
+
/**
|
|
305
|
+
* The call (GET /calls/{call_id})
|
|
306
|
+
*/
|
|
307
|
+
call_id: string;
|
|
308
|
+
/**
|
|
309
|
+
* Who called
|
|
310
|
+
*/
|
|
311
|
+
caller_id: string;
|
|
312
|
+
/**
|
|
313
|
+
* Why it ended: hung_up, canceled, declined, missed, busy, failed or ended
|
|
314
|
+
*/
|
|
315
|
+
end_reason: string | null;
|
|
316
|
+
/**
|
|
317
|
+
* When it ended
|
|
318
|
+
*/
|
|
319
|
+
ended_at: string | null;
|
|
320
|
+
/**
|
|
321
|
+
* Two people, or a group
|
|
322
|
+
*/
|
|
323
|
+
kind: "direct" | "group";
|
|
324
|
+
/**
|
|
325
|
+
* How long it lasted, from its answer to its end
|
|
326
|
+
*/
|
|
327
|
+
seconds: number;
|
|
328
|
+
/**
|
|
329
|
+
* When it was made
|
|
330
|
+
*/
|
|
331
|
+
started_at: string;
|
|
332
|
+
/**
|
|
333
|
+
* Ringing, going on, or over
|
|
334
|
+
*/
|
|
335
|
+
state: "ringing" | "active" | "ended";
|
|
336
|
+
/**
|
|
337
|
+
* A video call (else voice)
|
|
338
|
+
*/
|
|
339
|
+
video: boolean;
|
|
340
|
+
};
|
|
296
341
|
/**
|
|
297
342
|
* A conversation as a member reads it.
|
|
298
343
|
*/
|
|
@@ -822,6 +867,10 @@ export type Message = {
|
|
|
822
867
|
* Its files.
|
|
823
868
|
*/
|
|
824
869
|
attachments: Attachment[];
|
|
870
|
+
/**
|
|
871
|
+
* What a call message keeps of its call (kind call): written as the call starts, and again as it is answered and as it ends. It counts as no unread message. Always sent (null on any other message); absent (an answer kept from before it was): null.
|
|
872
|
+
*/
|
|
873
|
+
call?: CallRecord | null;
|
|
825
874
|
/**
|
|
826
875
|
* The writer's app's own id of it.
|
|
827
876
|
*/
|
|
@@ -855,9 +904,9 @@ export type Message = {
|
|
|
855
904
|
*/
|
|
856
905
|
id: string;
|
|
857
906
|
/**
|
|
858
|
-
* text, media (files) or
|
|
907
|
+
* text, media (files), system, or call (a call made from the conversation: `call` says how it went).
|
|
859
908
|
*/
|
|
860
|
-
kind: "text" | "media" | "system";
|
|
909
|
+
kind: "text" | "media" | "system" | "call";
|
|
861
910
|
/**
|
|
862
911
|
* When its thread was last answered.
|
|
863
912
|
*/
|
|
@@ -2407,7 +2456,8 @@ export declare function client(t: Transport): {
|
|
|
2407
2456
|
limit?: number; /** The cursor a page handed out (next_cursor). */
|
|
2408
2457
|
cursor?: string; /** Open the timeline at this message: the page holds it, about half the page before it and half after (next_cursor pages back, newer_cursor forward). A thread's answer is read in its thread (`in_thread`). */
|
|
2409
2458
|
around?: string; /** The cursor a page handed out to read on toward the newest (newer_cursor). */
|
|
2410
|
-
after?: string;
|
|
2459
|
+
after?: string; /** Only messages of this kind — text, media, system or call; several comma-separated (call: the calls made from the conversation). */
|
|
2460
|
+
kind?: string;
|
|
2411
2461
|
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2412
2462
|
signal?: AbortSignal;
|
|
2413
2463
|
}): Promise<Reply<200, MessagePage>>;
|
|
@@ -307,7 +307,7 @@ export declare function client(t: Transport): {
|
|
|
307
307
|
/**
|
|
308
308
|
* Declare the channels
|
|
309
309
|
*
|
|
310
|
-
* Replaces the project's channel declaration, in its order (100 at most). A pattern is ':'-separated segments; a {name} segment matches exactly one. `owner`: the pattern's one {name} must be the joining user, who may do everything on it. `public`: any signed-in user of the project subscribes, and may publish and read or write state as declared. A channel no pattern matches belongs to no one. roles:, flags:, messaging: and debug: are the platform's. Open sockets are decided again within a heartbeat.
|
|
310
|
+
* Replaces the project's channel declaration, in its order (100 at most). A pattern is ':'-separated segments; a {name} segment matches exactly one. `owner`: the pattern's one {name} must be the joining user, who may do everything on it. `public`: any signed-in user of the project subscribes, and may publish and read or write state as declared. A channel no pattern matches belongs to no one. roles:, flags:, messaging:, calls: and debug: are the platform's. Open sockets are decided again within a heartbeat.
|
|
311
311
|
*/
|
|
312
312
|
putChannels(input: {
|
|
313
313
|
body: ChannelDeclaration; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
@@ -26,6 +26,13 @@ export interface PalbaseServer {
|
|
|
26
26
|
auth: ReturnType<typeof modules.auth.client>;
|
|
27
27
|
/** The project's cache entries; palbase/backend's Cache is the way to use them. */
|
|
28
28
|
cache: ReturnType<typeof modules.cache.client>;
|
|
29
|
+
/**
|
|
30
|
+
* The project's calls: their settings (getCallSettings, putCallSettings, rotateCallHookSecret), the calls read and
|
|
31
|
+
* ended (adminListCalls, adminGetCall, adminEndCall), and the project's own agent let into one —
|
|
32
|
+
* createCallTicket({ path: { call_id }, body: { identity } }) answers the media server's url and an access token its
|
|
33
|
+
* open-source agent libraries connect with as they are.
|
|
34
|
+
*/
|
|
35
|
+
calls: ReturnType<typeof modules.calls.client>;
|
|
29
36
|
/**
|
|
30
37
|
* The project's encrypted database fields (fields.ts): `await
|
|
31
38
|
* palbase.fields.load()` at startup, then encrypt, decrypt and lookup —
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { Call, CallSession, Calls } from '../calls.js';
|
|
2
|
+
/** Every word the screens show. */
|
|
3
|
+
export interface CallUITexts {
|
|
4
|
+
incomingVoice: string;
|
|
5
|
+
incomingVideo: string;
|
|
6
|
+
accept: string;
|
|
7
|
+
acceptVoiceOnly: string;
|
|
8
|
+
decline: string;
|
|
9
|
+
calling: string;
|
|
10
|
+
connecting: string;
|
|
11
|
+
reconnecting: string;
|
|
12
|
+
/** How the call ended for this device, by its endReason; `ended` for any other. */
|
|
13
|
+
declined: string;
|
|
14
|
+
missed: string;
|
|
15
|
+
busy: string;
|
|
16
|
+
hungUp: string;
|
|
17
|
+
canceled: string;
|
|
18
|
+
failed: string;
|
|
19
|
+
answeredElsewhere: string;
|
|
20
|
+
left: string;
|
|
21
|
+
ended: string;
|
|
22
|
+
}
|
|
23
|
+
/** What a screen reader says of what shows no words of its own. */
|
|
24
|
+
export interface CallUILabels {
|
|
25
|
+
/** The ringing sheet. */
|
|
26
|
+
incoming: string;
|
|
27
|
+
/** The call's view. */
|
|
28
|
+
call: string;
|
|
29
|
+
mute: string;
|
|
30
|
+
unmute: string;
|
|
31
|
+
cameraOn: string;
|
|
32
|
+
cameraOff: string;
|
|
33
|
+
switchCamera: string;
|
|
34
|
+
hangUp: string;
|
|
35
|
+
/** This device's camera. */
|
|
36
|
+
self: string;
|
|
37
|
+
}
|
|
38
|
+
/** The screens' colors, corners and font: CSS values, set as --pb-call-<name> on the root element. */
|
|
39
|
+
export interface CallUITheme {
|
|
40
|
+
accent?: string;
|
|
41
|
+
background?: string;
|
|
42
|
+
foreground?: string;
|
|
43
|
+
danger?: string;
|
|
44
|
+
/** A length; a number is pixels. */
|
|
45
|
+
radius?: string | number;
|
|
46
|
+
font?: string;
|
|
47
|
+
}
|
|
48
|
+
export interface CallUIOptions {
|
|
49
|
+
/** The element the screens are drawn in (positioned): over the whole page (the body) unless given. */
|
|
50
|
+
container?: HTMLElement;
|
|
51
|
+
texts?: Partial<CallUITexts>;
|
|
52
|
+
labels?: Partial<CallUILabels>;
|
|
53
|
+
/** The light and dark colors the system asks for, unless given. */
|
|
54
|
+
theme?: CallUITheme;
|
|
55
|
+
/** Added to the root element's classes. */
|
|
56
|
+
className?: string;
|
|
57
|
+
/** A soft ring while a sheet shows (true by default); silent where the page may not play sound yet. */
|
|
58
|
+
ringtone?: boolean;
|
|
59
|
+
/** Asked once for each call that rings: false leaves it to the app's own screen. */
|
|
60
|
+
incoming?(call: Call, session: CallSession): boolean;
|
|
61
|
+
/** An answer, a microphone or a camera that failed (the person refused the camera, the network). */
|
|
62
|
+
onError?(error: unknown, session: CallSession): void;
|
|
63
|
+
}
|
|
64
|
+
export interface CallUI {
|
|
65
|
+
/** Takes the screens away and stops listening; a call goes on. */
|
|
66
|
+
unmount(): void;
|
|
67
|
+
}
|
|
68
|
+
export declare const CALL_UI_TEXTS: Readonly<CallUITexts>;
|
|
69
|
+
export declare const CALL_UI_LABELS: Readonly<CallUILabels>;
|
|
70
|
+
/** Shows pb.calls' ringing calls and the call this page is in, until unmount. */
|
|
71
|
+
export declare function mountCallUI(calls: Calls, options?: CallUIOptions): CallUI;
|