palbase 0.10.1 → 0.11.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/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 +11 -11
- package/dist/backend/stack.js +1 -1
- package/dist/backend/test.js +2 -2
- package/dist/chunks/{PG7BO4MR.js → 2CQIOY2Z.js} +1 -1
- package/dist/chunks/{QC2SDBJD.js → 2MS22NJC.js} +2 -2
- package/dist/chunks/476DZPIV.js +2 -0
- package/dist/chunks/{NBI5LPMS.js → 52DZTUF7.js} +2 -2
- package/dist/chunks/{FHXGE2MX.js → 5D7BAVO5.js} +1 -1
- package/dist/chunks/{R4OLJRMH.js → 63TWL4SB.js} +2 -2
- package/dist/chunks/{RWGEPDRQ.js → 7JE4KOPN.js} +2 -2
- package/dist/chunks/{QW3V2NBT.js → AEAFASN2.js} +2 -2
- package/dist/chunks/{RO7ERCT3.js → BAOQMZPI.js} +2 -2
- package/dist/chunks/CQBT2Z2T.js +20 -0
- package/dist/chunks/{APTIATSC.js → D6RL5OCI.js} +2 -2
- package/dist/chunks/{MFMA46HN.js → DAYQLOBB.js} +2 -2
- package/dist/chunks/GCVVMTWI.js +2 -0
- package/dist/chunks/{Z4A62VQR.js → GUFHH4DP.js} +2 -2
- package/dist/chunks/KXY2SF4N.js +2 -0
- package/dist/chunks/{QD3SPM7D.js → LJ3VOTHH.js} +2 -2
- package/dist/chunks/{XYXBDSXW.js → NHNXW6EK.js} +1 -1
- package/dist/chunks/{NGS4ALOE.js → QX7E6TNL.js} +1 -1
- package/dist/chunks/{6N3E2XHZ.js → S4GBHZOR.js} +1 -1
- package/dist/chunks/WYUC5N2T.js +2 -0
- package/dist/chunks/{IVJCGBYG.js → XBT3QJRS.js} +2 -2
- package/dist/cli.js +172 -128
- package/dist/refuse/ai.js +1 -1
- package/dist/refuse/backend.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/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 +1 -1
- package/dist/web/ssr.js +2 -2
- package/dist/web/vite.js +2 -2
- package/package.json +2 -2
- package/types/backend/src/container.d.ts +2 -0
- package/types/backend/src/database.d.ts +8 -1
- package/types/backend/src/decorators.d.ts +1 -0
- package/types/backend/src/engine-db.d.ts +3 -1
- package/types/backend/src/engine.d.ts +8 -1
- package/types/backend/src/idempotency.d.ts +136 -0
- package/types/backend/src/index.d.ts +1 -0
- package/types/backend/src/test-user-templates.d.ts +58 -0
- package/types/internal/src/modules/auth.d.ts +44 -13
- package/types/internal/src/modules/events.d.ts +2 -2
- package/types/internal/src/modules/machines.d.ts +74 -2
- package/types/internal/src/modules/purchases.d.ts +39 -3
- package/types/internal/src/modules/secrets.d.ts +138 -3
- package/types/internal/src/modules/stores.d.ts +714 -8
- package/types/server/src/fields.d.ts +62 -0
- package/types/server/src/index.d.ts +1 -0
- package/types/server/src/server.d.ts +8 -0
- package/types/server/src/testing.d.ts +8 -0
- package/dist/chunks/EUI3Y3LO.js +0 -20
- package/dist/chunks/INRWHOEW.js +0 -2
- package/dist/chunks/UDAWSJMT.js +0 -2
- package/dist/chunks/YQEM4H7U.js +0 -2
|
@@ -13,11 +13,11 @@ export interface PlatformEvents extends AiEvents, AnalyticsEvents, AuthEvents, F
|
|
|
13
13
|
/** A platform event's type: one a module's contract declares. */
|
|
14
14
|
export type EventType = keyof PlatformEvents;
|
|
15
15
|
/** Every platform event's type, as the contracts declare them. */
|
|
16
|
-
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", "notification.action", "notification.bounced", "notification.complained", "notification.delivered", "notification.dismissed", "notification.expired", "notification.failed", "notification.not_shown", "notification.opened", "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.delivery.changed", "stores.delivery.requested", "stores.google.changed", "stores.group.changed", "stores.package.changed", "user.converted", "user.deleted", "user.locale_changed", "user.permissions_changed"];
|
|
16
|
+
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", "notification.action", "notification.bounced", "notification.complained", "notification.delivered", "notification.dismissed", "notification.expired", "notification.failed", "notification.not_shown", "notification.opened", "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.delivery.changed", "stores.delivery.requested", "stores.google.changed", "stores.group.changed", "stores.package.changed", "stores.version.changed", "stores.version.reviewed", "user.converted", "user.deleted", "user.locale_changed", "user.permissions_changed"];
|
|
17
17
|
/**
|
|
18
18
|
* A platform event as delivered: one member per type the contracts declare,
|
|
19
19
|
* its data that type's payload, so a switch on its type narrows it. An
|
|
20
20
|
* event of a type none of them declares (one a newer platform sends) is no
|
|
21
21
|
* member: at run time it reaches the switch's default, which takes it.
|
|
22
22
|
*/
|
|
23
|
-
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["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.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.delivery.changed"], "stores.delivery.changed"> | WebhookEvent<PlatformEvents["stores.delivery.requested"], "stores.delivery.requested"> | 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["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">;
|
|
23
|
+
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["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.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.delivery.changed"], "stores.delivery.changed"> | WebhookEvent<PlatformEvents["stores.delivery.requested"], "stores.delivery.requested"> | 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.version.changed"], "stores.version.changed"> | WebhookEvent<PlatformEvents["stores.version.reviewed"], "stores.version.reviewed"> | 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">;
|
|
@@ -123,7 +123,7 @@ export type InstallationLink = {
|
|
|
123
123
|
user_token: string;
|
|
124
124
|
};
|
|
125
125
|
/**
|
|
126
|
-
* Connects an installation another project of the same organization connected, on
|
|
126
|
+
* Connects an installation another project of the same organization connected, on the registry's word that both are one organization's (the X-Palbase-Studio-Share header, which the registry alone signs, for an admin of both; Studio's call that connects an organization's installation asks it) — no GitHub user's token. The project reaches what that project's GitHub user can push to, as it does.
|
|
127
127
|
*/
|
|
128
128
|
export type InstallationShare = {
|
|
129
129
|
installation_id: number;
|
|
@@ -1345,6 +1345,41 @@ export type TaskType = {
|
|
|
1345
1345
|
export type TaskTypeList = {
|
|
1346
1346
|
types: TaskType[];
|
|
1347
1347
|
};
|
|
1348
|
+
/**
|
|
1349
|
+
* A template written for a test user — its rows by table, as the machine's program said — or why it was not (error: no_template, not_a_test_user, template_failed, template_timeout, machine_unavailable, then a colon and why). again: answered from what was kept when it was written before; the machine was not asked again.
|
|
1350
|
+
*/
|
|
1351
|
+
export type TemplateOutcome = {
|
|
1352
|
+
name: string;
|
|
1353
|
+
rows?: {
|
|
1354
|
+
[key: string]: number;
|
|
1355
|
+
};
|
|
1356
|
+
error?: string;
|
|
1357
|
+
again?: boolean;
|
|
1358
|
+
};
|
|
1359
|
+
/**
|
|
1360
|
+
* A test user made with a template: its sign-in, shown this once, and what became of the template. The user is made whatever came of the template.
|
|
1361
|
+
*/
|
|
1362
|
+
export type TemplatedUser = {
|
|
1363
|
+
user_id: string;
|
|
1364
|
+
email: string;
|
|
1365
|
+
/**
|
|
1366
|
+
* Its password, shown this once (a test fixture).
|
|
1367
|
+
*/
|
|
1368
|
+
password: string;
|
|
1369
|
+
/**
|
|
1370
|
+
* With with_tokens: an access token for it (a test fixture).
|
|
1371
|
+
*/
|
|
1372
|
+
access_token?: string;
|
|
1373
|
+
template: TemplateOutcome;
|
|
1374
|
+
};
|
|
1375
|
+
export type TemplatedUserList = {
|
|
1376
|
+
users: TemplatedUser[];
|
|
1377
|
+
};
|
|
1378
|
+
export type TemplatedUsersAsked = {
|
|
1379
|
+
count?: number;
|
|
1380
|
+
template: string;
|
|
1381
|
+
with_tokens?: boolean;
|
|
1382
|
+
};
|
|
1348
1383
|
/** Palbase Machines */
|
|
1349
1384
|
export declare function client(t: Transport): {
|
|
1350
1385
|
/**
|
|
@@ -1412,7 +1447,7 @@ export declare function client(t: Transport): {
|
|
|
1412
1447
|
/**
|
|
1413
1448
|
* Share an installation of the organization
|
|
1414
1449
|
*
|
|
1415
|
-
* Connects an installation of Palbase Cloud that another project of the same organization connected, on
|
|
1450
|
+
* Connects an installation of Palbase Cloud that another project of the same organization connected, on the registry's word (X-Palbase-Studio-Share), which Studio asks the registry for an admin of both projects: a program that opens a project for each product connects its own installation to each, with no person's GitHub token. The project reaches the repositories of it the GitHub user who connected it there can push to — and, as with every connection, one created or added to the installation later once that user can push to it (asked when a machine is built from it, and when GitHub says repositories were added). Refused without the registry's word, or when that project has not connected the installation; and when this project connected it otherwise — for other repositories, for all of them where this names some (or some where this names none), or by another GitHub user: linking again never widens, narrows or hands over a connection, so it is disconnected and connected anew. The same share again is as it was.
|
|
1416
1451
|
*/
|
|
1417
1452
|
shareInstallation(input: {
|
|
1418
1453
|
body: InstallationShare; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
@@ -1877,5 +1912,42 @@ export declare function client(t: Transport): {
|
|
|
1877
1912
|
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
1878
1913
|
signal?: AbortSignal;
|
|
1879
1914
|
}): Promise<Reply<200, TaskTypeList>>;
|
|
1915
|
+
/**
|
|
1916
|
+
* Make test users with a template's data
|
|
1917
|
+
*
|
|
1918
|
+
* Makes 1 to 10 test users (auth's: their tokens say test: true) and has the machine's own program write a template's data for each — the backend's seed for one account (palbase/backend's @TestUserTemplate), for a person or an agent to sign in and see a screen with its data. The platform calls the program for each user — POST /_palbase/test-user-templates/<template> on the machine's own port, with {"user": {"id", "email"}, "template"}, signed as a cron's call is, waking the machine for it; the program writes the template in one transaction and answers {"rows": {table: count}}, or refuses a user auth does not say is a test user (403). A user is made whatever came of its template: its template answers its error by name. The same user and template asked again (POST …/test-users/{user}/templates/{template}) answers what was kept, the machine not asked again. The users' passwords (and with with_tokens their access tokens) are test fixtures, shown this once, as auth's test users' are. 409 when auth makes no more test users for the project; 429 quota_exceeded, and no user made, when the project's machines are not run now (its machine time for the period used up, or the project deleted).
|
|
1919
|
+
*/
|
|
1920
|
+
makeTemplatedTestUsers(input: {
|
|
1921
|
+
path: {
|
|
1922
|
+
name: string;
|
|
1923
|
+
};
|
|
1924
|
+
body: TemplatedUsersAsked; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
1925
|
+
signal?: AbortSignal;
|
|
1926
|
+
}): Promise<Reply<201, TemplatedUserList>>;
|
|
1927
|
+
/**
|
|
1928
|
+
* Write a template for a test user
|
|
1929
|
+
*
|
|
1930
|
+
* Has the machine's program write a template for a test user this machine made with one (POST /machines/{name}/test-users) — answered from what was kept when it wrote that template for that user before, the machine not asked again (again: true). 429 quota_exceeded when the project's machines are not run now and the template was not written before. 404 when the user is no test user this machine made with a template: a test user is the machine's that made it, another machine of the project neither writes for it nor deletes it.
|
|
1931
|
+
*/
|
|
1932
|
+
templateTestUser(input: {
|
|
1933
|
+
path: {
|
|
1934
|
+
name: string; /** The test user's id, as the users made with a template were answered. */
|
|
1935
|
+
user: string; /** The template's name, as the machine's program names it (@TestUserTemplate): lowercase letters, digits, _ and -, starting with a letter, 64 at most. */
|
|
1936
|
+
template: string;
|
|
1937
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
1938
|
+
signal?: AbortSignal;
|
|
1939
|
+
}): Promise<Reply<200, TemplateOutcome>>;
|
|
1940
|
+
/**
|
|
1941
|
+
* Delete a test user made with a template
|
|
1942
|
+
*
|
|
1943
|
+
* Has the machine's program undo each template the user was written with — POST /_palbase/test-user-templates/<template>/undo, signed as the template's call; a program with no undo (404) leaves it to its user.deleted — then deletes the user. 502 undo_failed when the program did not undo one: the user is kept, for the delete to be asked again. 429 quota_exceeded, the user kept, when the project's machines are not run now. 404 when the user is no test user this machine made with a template: a test user is the machine's that made it, another machine of the project neither writes for it nor deletes it.
|
|
1944
|
+
*/
|
|
1945
|
+
deleteTemplatedTestUser(input: {
|
|
1946
|
+
path: {
|
|
1947
|
+
name: string; /** The test user's id, as the users made with a template were answered. */
|
|
1948
|
+
user: string;
|
|
1949
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
1950
|
+
signal?: AbortSignal;
|
|
1951
|
+
}): Promise<Reply<204, undefined>>;
|
|
1880
1952
|
};
|
|
1881
1953
|
export type Client = ReturnType<typeof client>;
|
|
@@ -8,7 +8,7 @@ export type AppReview = {
|
|
|
8
8
|
*/
|
|
9
9
|
note?: string;
|
|
10
10
|
/**
|
|
11
|
-
* The
|
|
11
|
+
* The screenshot App Review is shown of the product in the app: the sha256 (sha256:<hex> or the hex alone) of an image uploaded to the stores module for review (palbase stores:review-screenshot, PUT /stores/apps/{app_id}/screenshots?for=review). A plan gives it to App Store Connect, and Apple then has what it needs of the product.
|
|
12
12
|
*/
|
|
13
13
|
screenshot?: string;
|
|
14
14
|
};
|
|
@@ -232,6 +232,10 @@ export type ApplePrice = {
|
|
|
232
232
|
* The storefront (USA).
|
|
233
233
|
*/
|
|
234
234
|
territory: string;
|
|
235
|
+
/**
|
|
236
|
+
* A coming price's first day (UTC); none for one in effect.
|
|
237
|
+
*/
|
|
238
|
+
from?: string;
|
|
235
239
|
};
|
|
236
240
|
/**
|
|
237
241
|
* Whether the environment sells in the App Store, check by check.
|
|
@@ -271,6 +275,7 @@ export type AppleStepResult = {
|
|
|
271
275
|
* The App Store's product id (or the subscription group's reference name).
|
|
272
276
|
*/
|
|
273
277
|
store_id: string;
|
|
278
|
+
next_price?: ApplePrice;
|
|
274
279
|
};
|
|
275
280
|
/**
|
|
276
281
|
* What the stores module answered of a plan's Google Play part, once it wrote it (pending until then): Play's state, step by step.
|
|
@@ -645,6 +650,12 @@ export type Channel = {
|
|
|
645
650
|
* Stripe's tax code for the product (the web's alone).
|
|
646
651
|
*/
|
|
647
652
|
tax_code?: string;
|
|
653
|
+
/**
|
|
654
|
+
* Ids the store already sells the product's plans by — made in App Store Connect or the Play Console by hand, or by another tool — by plan key: the plan is that product at the store, found by its id and never made there (a plan's link step), and its purchases, recorded before, are the catalog's from then on. On the App Store each plan is a product of its own; on Google Play a subscription's plans are base plans of one product (every plan mapped, to the same product). Not for web.
|
|
655
|
+
*/
|
|
656
|
+
store_ids?: {
|
|
657
|
+
[key: string]: StoreID;
|
|
658
|
+
};
|
|
648
659
|
};
|
|
649
660
|
/**
|
|
650
661
|
* A chart, period by period.
|
|
@@ -3966,6 +3977,10 @@ export type Plan = {
|
|
|
3966
3977
|
*/
|
|
3967
3978
|
period?: string;
|
|
3968
3979
|
price: Price;
|
|
3980
|
+
/**
|
|
3981
|
+
* The plan off sale, its product sold by its other plans; a plan someone bought is retired, not left out (plan_has_buyers).
|
|
3982
|
+
*/
|
|
3983
|
+
retired?: boolean;
|
|
3969
3984
|
};
|
|
3970
3985
|
/**
|
|
3971
3986
|
* A confirmation, with the hash of the plan shown.
|
|
@@ -3995,7 +4010,7 @@ export type PlanStep = {
|
|
|
3995
4010
|
*/
|
|
3996
4011
|
note?: string;
|
|
3997
4012
|
/**
|
|
3998
|
-
* What it does: create_product, update_product, create_price (Stripe); create_subscription_group, create_subscription, create_in_app_purchase (the App Store); create_subscription, create_onetime_product (Google Play).
|
|
4013
|
+
* What it does: create_product, update_product, create_price (Stripe); create_subscription_group, create_subscription, create_in_app_purchase, update_subscription, update_in_app_purchase (what the catalog changed of a product App Store Connect has: its text, its price from tomorrow on — subscribers keep theirs —, its review screenshot and note), link_subscription, link_in_app_purchase (a product App Store Connect already sells, found by its id, nothing made or changed) (the App Store); create_subscription, create_onetime_product, update_subscription, update_onetime_product, link_subscription, link_onetime_product (Google Play).
|
|
3999
4014
|
*/
|
|
4000
4015
|
op: string;
|
|
4001
4016
|
/**
|
|
@@ -4154,6 +4169,10 @@ export type Product = {
|
|
|
4154
4169
|
* How much of each limit it gives.
|
|
4155
4170
|
*/
|
|
4156
4171
|
quota?: QuotaAllowance[];
|
|
4172
|
+
/**
|
|
4173
|
+
* Off sale: no store is asked to sell it and no one new buys it, while whoever bought it keeps what it gives. A product someone bought never leaves the catalog — a save that leaves it out, or gives it another key, is refused (product_has_buyers).
|
|
4174
|
+
*/
|
|
4175
|
+
retired?: boolean;
|
|
4157
4176
|
/**
|
|
4158
4177
|
* A subscription's level in its group, 1 or more: higher is more.
|
|
4159
4178
|
*/
|
|
@@ -5490,7 +5509,7 @@ export type AppleOfferRequest = {
|
|
|
5490
5509
|
environment?: string;
|
|
5491
5510
|
};
|
|
5492
5511
|
/**
|
|
5493
|
-
* What StoreKit buys the promotional offer with, for this customer's purchases: Apple's subscription offer signature.
|
|
5512
|
+
* What StoreKit buys the promotional offer with, for this customer's purchases and their Apple account: Apple's subscription offer signature.
|
|
5494
5513
|
*/
|
|
5495
5514
|
export type AppleOfferSignature = {
|
|
5496
5515
|
/**
|
|
@@ -5521,6 +5540,10 @@ export type AppleOfferSignature = {
|
|
|
5521
5540
|
* ES256, base64.
|
|
5522
5541
|
*/
|
|
5523
5542
|
signature: string;
|
|
5543
|
+
/**
|
|
5544
|
+
* The same offer as a compact JWS (ES256 under key_id), naming one of the customer's App Store transactions (transactionId): Apple buys it for the Apple account holding that transaction alone. StoreKit buys with it since iOS 26 (Product.PurchaseOption.promotionalOffer(_:compactJWS:), back-deployed to iOS 15), and Xcode's StoreKit testing takes it alone for a key Xcode generated.
|
|
5545
|
+
*/
|
|
5546
|
+
compact_jws: string;
|
|
5524
5547
|
};
|
|
5525
5548
|
/**
|
|
5526
5549
|
* What came of an offer.
|
|
@@ -5817,6 +5840,19 @@ export type CouponRedeemedEvent = {
|
|
|
5817
5840
|
*/
|
|
5818
5841
|
one_time: boolean;
|
|
5819
5842
|
};
|
|
5843
|
+
/**
|
|
5844
|
+
* A plan's product at a store.
|
|
5845
|
+
*/
|
|
5846
|
+
export type StoreID = {
|
|
5847
|
+
/**
|
|
5848
|
+
* A Google Play subscription's base plan id.
|
|
5849
|
+
*/
|
|
5850
|
+
base_plan?: string;
|
|
5851
|
+
/**
|
|
5852
|
+
* The store's product id.
|
|
5853
|
+
*/
|
|
5854
|
+
product: string;
|
|
5855
|
+
};
|
|
5820
5856
|
/** The events this module sends the project's webhooks (x-palbase-events), by type: each one's payload, the event's data. */
|
|
5821
5857
|
export interface Events {
|
|
5822
5858
|
/**
|
|
@@ -39,6 +39,93 @@ export type ErrorResponse = {
|
|
|
39
39
|
*/
|
|
40
40
|
status: number;
|
|
41
41
|
};
|
|
42
|
+
/**
|
|
43
|
+
* A field key with the key.
|
|
44
|
+
*/
|
|
45
|
+
export type FieldKey = {
|
|
46
|
+
/**
|
|
47
|
+
* When new values are sealed with it from.
|
|
48
|
+
*/
|
|
49
|
+
activates_at: string;
|
|
50
|
+
id: string;
|
|
51
|
+
/**
|
|
52
|
+
* The 32-byte AES-256-GCM key, base64url without padding.
|
|
53
|
+
*/
|
|
54
|
+
key: string;
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* One of the project's field keys, without the key.
|
|
58
|
+
*/
|
|
59
|
+
export type FieldKeyInfo = {
|
|
60
|
+
/**
|
|
61
|
+
* When new values are sealed with it from.
|
|
62
|
+
*/
|
|
63
|
+
activates_at: string;
|
|
64
|
+
created_at: string;
|
|
65
|
+
/**
|
|
66
|
+
* Who made it: a key's id, a developer's, or the first read's.
|
|
67
|
+
*/
|
|
68
|
+
created_by: string;
|
|
69
|
+
/**
|
|
70
|
+
* The key's id (k1, k2, …): what a value it sealed names.
|
|
71
|
+
*/
|
|
72
|
+
id: string;
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* The project's field keys, oldest first.
|
|
76
|
+
*/
|
|
77
|
+
export type FieldKeyList = {
|
|
78
|
+
/**
|
|
79
|
+
* The key new values are sealed with now.
|
|
80
|
+
*/
|
|
81
|
+
current: string;
|
|
82
|
+
keys: FieldKeyInfo[];
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* Every field key of the project, oldest first, and its lookup key.
|
|
86
|
+
*/
|
|
87
|
+
export type FieldKeys = {
|
|
88
|
+
keys: FieldKey[];
|
|
89
|
+
/**
|
|
90
|
+
* The 32-byte HMAC-SHA256 key a field's lookup is made with, base64url without padding; no rotation changes it.
|
|
91
|
+
*/
|
|
92
|
+
lookup: string;
|
|
93
|
+
};
|
|
94
|
+
export type FieldOpen = {
|
|
95
|
+
/**
|
|
96
|
+
* The column: table.column, or schema.table.column outside public.
|
|
97
|
+
*/
|
|
98
|
+
address: string;
|
|
99
|
+
/**
|
|
100
|
+
* The column's encrypted values (pbe1.…).
|
|
101
|
+
*/
|
|
102
|
+
values: string[];
|
|
103
|
+
};
|
|
104
|
+
export type FieldPlaceholder = {
|
|
105
|
+
/**
|
|
106
|
+
* The column: table.column, or schema.table.column outside public.
|
|
107
|
+
*/
|
|
108
|
+
address: string;
|
|
109
|
+
};
|
|
110
|
+
export type FieldSealed = {
|
|
111
|
+
/**
|
|
112
|
+
* The placeholder sealed (pbe1.…) with the key in force.
|
|
113
|
+
*/
|
|
114
|
+
value: string;
|
|
115
|
+
};
|
|
116
|
+
export type FieldsOpened = {
|
|
117
|
+
values: OpenedField[];
|
|
118
|
+
};
|
|
119
|
+
export type OpenedField = {
|
|
120
|
+
/**
|
|
121
|
+
* Why it did not open.
|
|
122
|
+
*/
|
|
123
|
+
error?: "unopenable";
|
|
124
|
+
/**
|
|
125
|
+
* The field's value; null when it did not open.
|
|
126
|
+
*/
|
|
127
|
+
value: string | null;
|
|
128
|
+
};
|
|
42
129
|
/**
|
|
43
130
|
* A secret, without its value.
|
|
44
131
|
*/
|
|
@@ -59,19 +146,22 @@ export type Secret = {
|
|
|
59
146
|
* One read or write of the project's secrets.
|
|
60
147
|
*/
|
|
61
148
|
export type SecretAuditEntry = {
|
|
62
|
-
action: "list" | "read" | "read_all" | "write" | "rollback" | "delete" | "versions";
|
|
149
|
+
action: "list" | "read" | "read_all" | "write" | "rollback" | "delete" | "versions" | "field_keys_list" | "field_keys_read" | "field_keys_rotate" | "field_open" | "field_placeholder";
|
|
63
150
|
/**
|
|
64
151
|
* When it happened.
|
|
65
152
|
*/
|
|
66
153
|
at: string;
|
|
67
|
-
|
|
154
|
+
/**
|
|
155
|
+
* The environment, for a secret's action; absent for the field keys'.
|
|
156
|
+
*/
|
|
157
|
+
environment?: "development" | "production";
|
|
68
158
|
id: string;
|
|
69
159
|
/**
|
|
70
160
|
* The id of the key that made the request.
|
|
71
161
|
*/
|
|
72
162
|
key_id: string;
|
|
73
163
|
/**
|
|
74
|
-
* The secret, when the action names one.
|
|
164
|
+
* The secret, when the action names one; the field key made, for a rotation; the column, for a field opened or a placeholder sealed.
|
|
75
165
|
*/
|
|
76
166
|
name?: string;
|
|
77
167
|
request_id: string;
|
|
@@ -170,6 +260,51 @@ export declare function client(t: Transport): {
|
|
|
170
260
|
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
171
261
|
signal?: AbortSignal;
|
|
172
262
|
}): Promise<Reply<200, SecretAuditPage>>;
|
|
263
|
+
/**
|
|
264
|
+
* List the field keys
|
|
265
|
+
*
|
|
266
|
+
* The project's field keys without the keys: their ids, when each came (or comes) into force, who made it, and the one new values are sealed with now. The project's first key is made on first use. Recorded in the audit trail.
|
|
267
|
+
*/
|
|
268
|
+
listFieldKeys(input?: {
|
|
269
|
+
signal?: AbortSignal;
|
|
270
|
+
}): Promise<Reply<200, FieldKeyList>>;
|
|
271
|
+
/**
|
|
272
|
+
* Read the field keys
|
|
273
|
+
*
|
|
274
|
+
* Every field key of the project with the key, and its lookup key: what its backend reads at startup and every minute after (palbase/server's `fields`). A developer reads them only as the project's owner — to open a dump of the database elsewhere. The read is recorded in the audit trail.
|
|
275
|
+
*/
|
|
276
|
+
getFieldKeys(input?: {
|
|
277
|
+
signal?: AbortSignal;
|
|
278
|
+
}): Promise<Reply<200, FieldKeys>>;
|
|
279
|
+
/**
|
|
280
|
+
* Open encrypted fields
|
|
281
|
+
*
|
|
282
|
+
* Opens encrypted fields of one column for a developer looking at them in Studio, as the project's owner or an admin; the keys stay in the module. A value that does not open there — tampered, from another column, not encrypted — is answered `unopenable`. Every opening is recorded in the audit trail, with the column.
|
|
283
|
+
*/
|
|
284
|
+
openFields(input: {
|
|
285
|
+
body: FieldOpen; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
286
|
+
signal?: AbortSignal;
|
|
287
|
+
}): Promise<Reply<200, FieldsOpened>>;
|
|
288
|
+
/**
|
|
289
|
+
* Seal the placeholder
|
|
290
|
+
*
|
|
291
|
+
* Seals the placeholder (`•••`) at a column's address with the key in force: what a copy of another environment's data (`palbase db:copy`) fills its encrypted columns with — never that environment's values, whose keys are not this project's. The value is fixed: no caller has a value of its choice sealed here, which the project's backend would take as its own. Recorded in the audit trail, with the column.
|
|
292
|
+
*/
|
|
293
|
+
sealPlaceholder(input: {
|
|
294
|
+
body: FieldPlaceholder; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
295
|
+
signal?: AbortSignal;
|
|
296
|
+
}): Promise<Reply<200, FieldSealed>>;
|
|
297
|
+
/**
|
|
298
|
+
* Rotate the field keys
|
|
299
|
+
*
|
|
300
|
+
* Makes a new field key, in force five minutes from now: by then every running backend has fetched it, so none meets a value it cannot open. New values are sealed with it from then on; the older keys go on opening what they sealed until a deploy seals their fields again. A developer rotates as the project's owner or an admin. One rotation at a time: a second before the first is in force is refused (409). Recorded in the audit trail.
|
|
301
|
+
*/
|
|
302
|
+
rotateFieldKeys(input?: {
|
|
303
|
+
headers?: {
|
|
304
|
+
"Idempotency-Key"?: string;
|
|
305
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
306
|
+
signal?: AbortSignal;
|
|
307
|
+
}): Promise<Reply<200, FieldKeyList>>;
|
|
173
308
|
/**
|
|
174
309
|
* List an environment's secrets
|
|
175
310
|
*
|