palbase 0.6.2 → 0.8.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 -14
- package/dist/backend/engine.js +2 -2
- package/dist/backend/env.js +1 -1
- package/dist/backend/index.js +9 -9
- package/dist/backend/stack.js +1 -1
- package/dist/backend/test.js +2 -2
- package/dist/chunks/5VTGMNPL.js +20 -0
- package/dist/chunks/{SXH5AIQX.js → BO5KR2EQ.js} +2 -2
- package/dist/chunks/{AYY4J3B2.js → BRBCWPR3.js} +1 -1
- package/dist/chunks/DB3SIBKB.js +2 -0
- package/dist/chunks/EGNEXFTZ.js +2 -0
- package/dist/chunks/{VP7V7YRH.js → FZ3MQOVA.js} +2 -2
- package/dist/chunks/{A3CDCPXX.js → JSJVV43D.js} +1 -1
- package/dist/chunks/K6RRNI23.js +4 -0
- package/dist/chunks/{SUX2BJG4.js → KDWDPSL2.js} +1 -1
- package/dist/chunks/P4Z5E6ZI.js +2 -0
- package/dist/chunks/PDOHT46N.js +2 -0
- package/dist/chunks/PGPQGKH2.js +18 -0
- package/dist/chunks/{DRTZ33XF.js → RBA6V3UO.js} +2 -2
- package/dist/chunks/{KLANM6M6.js → RO5Y5YU4.js} +1 -1
- package/dist/chunks/{53FS342F.js → TUGRIOFX.js} +2 -2
- package/dist/chunks/WEI32SAJ.js +13 -0
- package/dist/chunks/{GVFZM4BI.js → WINBISC2.js} +3 -3
- package/dist/chunks/Z5JVQNAZ.js +2 -0
- package/dist/cli.js +140 -139
- 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/palbe.js +2 -2
- package/dist/web/paywall.js +2 -2
- package/dist/web/ssr.js +2 -2
- package/dist/web/vite.js +2 -2
- package/package.json +2 -2
- package/types/ai/src/ai.d.ts +46 -19
- package/types/ai/src/chats.d.ts +478 -18
- package/types/ai/src/index.d.ts +4 -4
- package/types/ai/src/tools.d.ts +161 -29
- package/types/backend/src/bootstrap.d.ts +8 -0
- package/types/backend/src/container.d.ts +11 -2
- package/types/backend/src/database.d.ts +17 -2
- package/types/backend/src/engine.d.ts +3 -4
- package/types/backend/src/gateways.d.ts +269 -0
- package/types/backend/src/index.d.ts +3 -2
- package/types/backend/src/openapi.d.ts +3 -6
- package/types/backend/src/runtime.d.ts +51 -2
- package/types/backend/src/testing/unit.d.ts +3 -1
- package/types/internal/src/chat.d.ts +168 -35
- package/types/internal/src/modules/ai.d.ts +1826 -545
- package/types/internal/src/modules/auth.d.ts +14 -2
- package/types/internal/src/modules/events.d.ts +2 -2
- package/types/internal/src/modules/machines.d.ts +57 -1
- package/types/internal/src/modules/notify.d.ts +6 -6
- package/types/internal/src/modules/purchases.d.ts +357 -13
- package/types/internal/src/modules/realtime.d.ts +45 -1
- package/types/internal/src/modules/stores.d.ts +259 -22
- package/types/internal/src/transport.d.ts +5 -0
- package/types/server/src/auth/jwt.d.ts +1 -6
- package/types/web/src/auth.d.ts +15 -4
- package/types/web/src/backends.d.ts +20 -13
- package/types/web/src/chat.d.ts +329 -0
- package/types/web/src/client.d.ts +28 -3
- package/types/web/src/gateways.d.ts +90 -0
- package/types/web/src/index.d.ts +5 -4
- package/types/web/src/session.d.ts +11 -1
- package/types/web/src/socket.d.ts +18 -2
- package/types/web/src/voice.d.ts +36 -0
- package/dist/chunks/2RG3I7LX.js +0 -6
- package/dist/chunks/A76UZBAF.js +0 -2
- package/dist/chunks/AD5LBZAB.js +0 -4
- package/dist/chunks/DRGYTL6T.js +0 -20
- package/dist/chunks/IVEAUFGE.js +0 -13
- package/dist/chunks/IYCW6PWG.js +0 -2
- package/dist/chunks/KL7FIRII.js +0 -2
- package/dist/chunks/U4OZ4HOF.js +0 -2
- package/types/backend/src/channels.d.ts +0 -81
- package/types/backend/src/rooms.d.ts +0 -178
- package/types/web/src/ai.d.ts +0 -224
- package/types/web/src/rooms.d.ts +0 -61
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { type Reply, type Transport } from '../transport.js';
|
|
2
|
+
/**
|
|
3
|
+
* An Android App Bundle (.aab).
|
|
4
|
+
*/
|
|
5
|
+
export type AABFile = Blob;
|
|
2
6
|
/**
|
|
3
7
|
* A step that changes something at Apple for good: planned, then run only when a person confirms it with its hash, within a day.
|
|
4
8
|
*/
|
|
@@ -12,7 +16,7 @@ export type Action = {
|
|
|
12
16
|
*/
|
|
13
17
|
decided_at: string | null;
|
|
14
18
|
/**
|
|
15
|
-
* Who confirmed or declined it.
|
|
19
|
+
* Who confirmed or declined it: `user:<id>`, the person who confirmed it (Studio's developer, as Studio vouches for them), or the key that declined it.
|
|
16
20
|
*/
|
|
17
21
|
decided_by: string | null;
|
|
18
22
|
/**
|
|
@@ -99,7 +103,7 @@ export type ActionPage = {
|
|
|
99
103
|
next_cursor?: string;
|
|
100
104
|
};
|
|
101
105
|
/**
|
|
102
|
-
* An app of the project linked to its store.
|
|
106
|
+
* An app of the project linked to its store: an iOS app to the App Store, an Android app to Google Play.
|
|
103
107
|
*/
|
|
104
108
|
export type App = {
|
|
105
109
|
/**
|
|
@@ -111,33 +115,35 @@ export type App = {
|
|
|
111
115
|
*/
|
|
112
116
|
asc_app_id: string | null;
|
|
113
117
|
/**
|
|
114
|
-
*
|
|
118
|
+
* An iOS app's bundle id, an Android app's package name.
|
|
115
119
|
*/
|
|
116
120
|
bundle_id: string;
|
|
117
121
|
/**
|
|
118
|
-
* Apple's id of the bundle id.
|
|
122
|
+
* Apple's id of the bundle id (an iOS app's).
|
|
119
123
|
*/
|
|
120
|
-
bundle_resource_id
|
|
124
|
+
bundle_resource_id?: string;
|
|
121
125
|
/**
|
|
122
126
|
* When it was first linked.
|
|
123
127
|
*/
|
|
124
128
|
linked_at: string;
|
|
125
129
|
/**
|
|
126
|
-
* Its name
|
|
130
|
+
* Its name in the store.
|
|
127
131
|
*/
|
|
128
132
|
name: string;
|
|
129
133
|
/**
|
|
130
134
|
* The platform.
|
|
131
135
|
*/
|
|
132
|
-
platform: "ios";
|
|
136
|
+
platform: "ios" | "android";
|
|
137
|
+
play?: GoogleAppCheck;
|
|
133
138
|
/**
|
|
134
|
-
* Its Apple team.
|
|
139
|
+
* Its Apple team (an iOS app's).
|
|
135
140
|
*/
|
|
136
|
-
team_id
|
|
141
|
+
team_id?: string;
|
|
137
142
|
/**
|
|
138
143
|
* When it was last linked.
|
|
139
144
|
*/
|
|
140
145
|
updated_at: string;
|
|
146
|
+
upload_key?: UploadKey;
|
|
141
147
|
};
|
|
142
148
|
/**
|
|
143
149
|
* stores.app.changed: an app was linked to its store.
|
|
@@ -152,13 +158,21 @@ export type AppChangedEvent = {
|
|
|
152
158
|
*/
|
|
153
159
|
asc_app_id?: string | null;
|
|
154
160
|
/**
|
|
155
|
-
* Its bundle id.
|
|
161
|
+
* Its bundle id, or package name.
|
|
156
162
|
*/
|
|
157
163
|
bundle_id: string;
|
|
158
164
|
/**
|
|
159
165
|
* What happened.
|
|
160
166
|
*/
|
|
161
167
|
change: "linked";
|
|
168
|
+
/**
|
|
169
|
+
* The platform (an Android app's link says it).
|
|
170
|
+
*/
|
|
171
|
+
platform?: "ios" | "android";
|
|
172
|
+
/**
|
|
173
|
+
* An Android app's upload key fingerprint.
|
|
174
|
+
*/
|
|
175
|
+
upload_key?: string;
|
|
162
176
|
};
|
|
163
177
|
/**
|
|
164
178
|
* The project's linked apps.
|
|
@@ -252,6 +266,19 @@ export type AppleGrant = {
|
|
|
252
266
|
*/
|
|
253
267
|
grant: string;
|
|
254
268
|
};
|
|
269
|
+
/**
|
|
270
|
+
* Where a Play delivery's signed bundle is downloaded from: the project's own address, with a token sealed for that bundle.
|
|
271
|
+
*/
|
|
272
|
+
export type BundleLink = {
|
|
273
|
+
/**
|
|
274
|
+
* Until when it works.
|
|
275
|
+
*/
|
|
276
|
+
expires_at: string;
|
|
277
|
+
/**
|
|
278
|
+
* The link.
|
|
279
|
+
*/
|
|
280
|
+
url: string;
|
|
281
|
+
};
|
|
255
282
|
/**
|
|
256
283
|
* The sandbox testers whose purchases Apple forgets.
|
|
257
284
|
*/
|
|
@@ -330,11 +357,11 @@ export type CreatePackageRequest = {
|
|
|
330
357
|
*/
|
|
331
358
|
export type DeliverRequest = {
|
|
332
359
|
/**
|
|
333
|
-
* The channel.
|
|
360
|
+
* The channel: testflight for an iOS app, play_internal (Play's internal testing) for an Android app.
|
|
334
361
|
*/
|
|
335
|
-
channel: "testflight";
|
|
362
|
+
channel: "testflight" | "play_internal";
|
|
336
363
|
/**
|
|
337
|
-
* The groups it goes to once ready.
|
|
364
|
+
* The groups it goes to once ready. TestFlight's alone: Play's internal testing reaches the testers its track lists in Play Console.
|
|
338
365
|
*/
|
|
339
366
|
groups?: string[];
|
|
340
367
|
what_to_test?: WhatToTest;
|
|
@@ -348,9 +375,9 @@ export type Delivery = {
|
|
|
348
375
|
*/
|
|
349
376
|
asc_build_id: string | null;
|
|
350
377
|
/**
|
|
351
|
-
* The channel.
|
|
378
|
+
* The channel: TestFlight, or Play's internal testing track.
|
|
352
379
|
*/
|
|
353
|
-
channel: "testflight";
|
|
380
|
+
channel: "testflight" | "play_internal";
|
|
354
381
|
/**
|
|
355
382
|
* When it was first sent.
|
|
356
383
|
*/
|
|
@@ -360,7 +387,7 @@ export type Delivery = {
|
|
|
360
387
|
*/
|
|
361
388
|
error: string | null;
|
|
362
389
|
/**
|
|
363
|
-
* Why it failed: apple_agreement, apple_key_refused, certificate_limit, app_record_missing, manual_step, capability_missing, not_an_ipa, apple_refused, upload_failed, processing_failed, build_changed (the kept build is not the one uploaded), build_gone (no longer kept: builds are kept 90 days), step_timed_out (signing or handing it over took more than 45 minutes), worker_stopped (it stopped the module's worker three times), gave_up.
|
|
390
|
+
* Why it failed: apple_agreement, apple_key_refused, certificate_limit, app_record_missing, manual_step, capability_missing, not_an_ipa, apple_refused, upload_failed, processing_failed, build_changed (the kept build is not the one uploaded), build_gone (no longer kept: builds are kept 90 days), step_timed_out (signing or handing it over took more than 45 minutes), worker_stopped (it stopped the module's worker three times), build_number_taken (App Store Connect has a build of this version and number this delivery did not upload: send a new package), gave_up (failed tries in a row; its error names the reference Palbase keeps the cause under). A Play delivery's: google_not_connected, google_no_access (Play Console has not invited the service account with the app), play_app_missing, first_release_manual (Play takes the app's first release only in Play Console: upload the signed bundle there, from its link), google_refused (Play's own words), no_upload_key, not_an_aab.
|
|
364
391
|
*/
|
|
365
392
|
error_code: string | null;
|
|
366
393
|
/**
|
|
@@ -371,6 +398,14 @@ export type Delivery = {
|
|
|
371
398
|
* The package.
|
|
372
399
|
*/
|
|
373
400
|
package_id: string;
|
|
401
|
+
/**
|
|
402
|
+
* The release's status on the Play track: completed — testers get it — or draft, on an app never published, which only Play Console rolls out.
|
|
403
|
+
*/
|
|
404
|
+
play_release_status?: "completed" | "draft";
|
|
405
|
+
/**
|
|
406
|
+
* The version code Play took (a Play delivery, once ready).
|
|
407
|
+
*/
|
|
408
|
+
play_version_code?: number;
|
|
374
409
|
/**
|
|
375
410
|
* Apple's processing state.
|
|
376
411
|
*/
|
|
@@ -416,6 +451,14 @@ export type DeliveryChangedEvent = {
|
|
|
416
451
|
* The package.
|
|
417
452
|
*/
|
|
418
453
|
package_id: string;
|
|
454
|
+
/**
|
|
455
|
+
* The release's status on the Play track (ready).
|
|
456
|
+
*/
|
|
457
|
+
play_release_status?: "completed" | "draft";
|
|
458
|
+
/**
|
|
459
|
+
* The version code Play took (ready).
|
|
460
|
+
*/
|
|
461
|
+
play_version_code?: number;
|
|
419
462
|
/**
|
|
420
463
|
* Where it is now.
|
|
421
464
|
*/
|
|
@@ -499,6 +542,93 @@ export type FeedbackPage = {
|
|
|
499
542
|
*/
|
|
500
543
|
feedback: Feedback[];
|
|
501
544
|
};
|
|
545
|
+
/**
|
|
546
|
+
* The project's Play connection as the API shows it: the service account its Play Console invites, and what Play let it reach. There is no key: Palbase acts as the account.
|
|
547
|
+
*/
|
|
548
|
+
export type GoogleAccount = {
|
|
549
|
+
/**
|
|
550
|
+
* What the person has to do in Play Console.
|
|
551
|
+
*/
|
|
552
|
+
action?: string;
|
|
553
|
+
/**
|
|
554
|
+
* What each Android app answered, when the connection was checked just now.
|
|
555
|
+
*/
|
|
556
|
+
apps?: GoogleAppCheck[];
|
|
557
|
+
/**
|
|
558
|
+
* What it reached when it was last checked, over the project's apps.
|
|
559
|
+
*/
|
|
560
|
+
capabilities?: ("releases" | "products")[];
|
|
561
|
+
/**
|
|
562
|
+
* When Play was last asked.
|
|
563
|
+
*/
|
|
564
|
+
checked_at?: string | null;
|
|
565
|
+
/**
|
|
566
|
+
* Whether the project has a Play connection.
|
|
567
|
+
*/
|
|
568
|
+
connected: boolean;
|
|
569
|
+
/**
|
|
570
|
+
* When it was connected.
|
|
571
|
+
*/
|
|
572
|
+
connected_at?: string;
|
|
573
|
+
/**
|
|
574
|
+
* Who connected it.
|
|
575
|
+
*/
|
|
576
|
+
connected_by?: string;
|
|
577
|
+
/**
|
|
578
|
+
* The service account its Play Console invites (Users and permissions).
|
|
579
|
+
*/
|
|
580
|
+
service_account?: string;
|
|
581
|
+
/**
|
|
582
|
+
* invited: made, and no app answered it yet (Play Console has not invited it). active: Play answers it for an app. refused: it answered once, and no app does any more.
|
|
583
|
+
*/
|
|
584
|
+
status?: "invited" | "active" | "refused";
|
|
585
|
+
};
|
|
586
|
+
/**
|
|
587
|
+
* One Android app's answer to a check of the Play connection.
|
|
588
|
+
*/
|
|
589
|
+
export type GoogleAppCheck = {
|
|
590
|
+
/**
|
|
591
|
+
* The app.
|
|
592
|
+
*/
|
|
593
|
+
app_id: string;
|
|
594
|
+
/**
|
|
595
|
+
* What the account reached of it: releases (it opens an edit — uploads builds, changes tracks), products (it reads its subscriptions).
|
|
596
|
+
*/
|
|
597
|
+
capabilities: ("releases" | "products")[];
|
|
598
|
+
/**
|
|
599
|
+
* Its package name.
|
|
600
|
+
*/
|
|
601
|
+
package_name: string;
|
|
602
|
+
/**
|
|
603
|
+
* Why Play did not let the account reach it.
|
|
604
|
+
*/
|
|
605
|
+
problem?: string;
|
|
606
|
+
/**
|
|
607
|
+
* Whether Play let the service account reach it.
|
|
608
|
+
*/
|
|
609
|
+
reached: boolean;
|
|
610
|
+
};
|
|
611
|
+
/**
|
|
612
|
+
* stores.google.changed: the project's Play connection was made, checked (and Play's answer changed) or disconnected.
|
|
613
|
+
*/
|
|
614
|
+
export type GoogleChangedEvent = {
|
|
615
|
+
/**
|
|
616
|
+
* What it reaches (checked).
|
|
617
|
+
*/
|
|
618
|
+
capabilities?: string[];
|
|
619
|
+
/**
|
|
620
|
+
* What happened.
|
|
621
|
+
*/
|
|
622
|
+
change: "connected" | "checked" | "disconnected";
|
|
623
|
+
/**
|
|
624
|
+
* The service account.
|
|
625
|
+
*/
|
|
626
|
+
service_account: string;
|
|
627
|
+
/**
|
|
628
|
+
* What Play said of it (connected, checked).
|
|
629
|
+
*/
|
|
630
|
+
status?: "invited" | "active" | "refused";
|
|
631
|
+
};
|
|
502
632
|
/**
|
|
503
633
|
* A group of people who test an app: in TestFlight an internal group (the account's App Store Connect users, who get a build at once) and an external one (everyone else, after Beta App Review).
|
|
504
634
|
*/
|
|
@@ -618,15 +748,15 @@ export type GroupTester = {
|
|
|
618
748
|
side: "internal" | "external";
|
|
619
749
|
};
|
|
620
750
|
/**
|
|
621
|
-
* The
|
|
751
|
+
* The build as the build machine made it: an unsigned .ipa, or an Android App Bundle (.aab) — unsigned, or signed with the app's upload key.
|
|
622
752
|
*/
|
|
623
753
|
export type IPAFile = Blob;
|
|
624
754
|
/**
|
|
625
|
-
* How the app is called
|
|
755
|
+
* How the app is called in its store.
|
|
626
756
|
*/
|
|
627
757
|
export type LinkAppRequest = {
|
|
628
758
|
/**
|
|
629
|
-
* Its name at Apple
|
|
759
|
+
* Its name in the store (at Apple, folded to letters, digits and spaces); the bundle id or package name when absent.
|
|
630
760
|
*/
|
|
631
761
|
name?: string;
|
|
632
762
|
};
|
|
@@ -674,6 +804,10 @@ export type Package = {
|
|
|
674
804
|
* The .ipa's SHA-256.
|
|
675
805
|
*/
|
|
676
806
|
sha256: string | null;
|
|
807
|
+
/**
|
|
808
|
+
* The certificate an Android bundle came signed with by its maker; absent when Palbase signs it with the app's upload key.
|
|
809
|
+
*/
|
|
810
|
+
signer_fingerprint?: string;
|
|
677
811
|
/**
|
|
678
812
|
* The .ipa's size in bytes.
|
|
679
813
|
*/
|
|
@@ -729,6 +863,10 @@ export type PackageChangedEvent = {
|
|
|
729
863
|
* The package.
|
|
730
864
|
*/
|
|
731
865
|
package_id: string;
|
|
866
|
+
/**
|
|
867
|
+
* An Android bundle's signer (uploaded): palbase, with the app's upload key, or its maker.
|
|
868
|
+
*/
|
|
869
|
+
signed_by?: "palbase" | "maker";
|
|
732
870
|
/**
|
|
733
871
|
* Its version (uploaded).
|
|
734
872
|
*/
|
|
@@ -1011,6 +1149,23 @@ export type TestersRequest = {
|
|
|
1011
1149
|
*/
|
|
1012
1150
|
testers: TesterInput[];
|
|
1013
1151
|
};
|
|
1152
|
+
/**
|
|
1153
|
+
* An Android app's upload key as the API shows it: its certificate, never its private key.
|
|
1154
|
+
*/
|
|
1155
|
+
export type UploadKey = {
|
|
1156
|
+
/**
|
|
1157
|
+
* The certificate (PEM).
|
|
1158
|
+
*/
|
|
1159
|
+
certificate: string;
|
|
1160
|
+
/**
|
|
1161
|
+
* When Palbase made it.
|
|
1162
|
+
*/
|
|
1163
|
+
created_at: string;
|
|
1164
|
+
/**
|
|
1165
|
+
* The certificate's SHA-256, as Play Console shows an upload key.
|
|
1166
|
+
*/
|
|
1167
|
+
fingerprint: string;
|
|
1168
|
+
};
|
|
1014
1169
|
/**
|
|
1015
1170
|
* A build's note to testers.
|
|
1016
1171
|
*/
|
|
@@ -1046,6 +1201,10 @@ export interface Events {
|
|
|
1046
1201
|
* stores.delivery.requested: a delivery was sent (or sent again); the stores module runs it.
|
|
1047
1202
|
*/
|
|
1048
1203
|
"stores.delivery.requested": DeliveryRequestedEvent;
|
|
1204
|
+
/**
|
|
1205
|
+
* stores.google.changed: the project's Play connection was made, checked (and Play's answer changed) or disconnected.
|
|
1206
|
+
*/
|
|
1207
|
+
"stores.google.changed": GoogleChangedEvent;
|
|
1049
1208
|
/**
|
|
1050
1209
|
* stores.group.changed: a group was made, renamed, deleted, its testers set, or a build given to it.
|
|
1051
1210
|
*/
|
|
@@ -1084,7 +1243,7 @@ export declare function client(t: Transport): {
|
|
|
1084
1243
|
/**
|
|
1085
1244
|
* Confirm an action
|
|
1086
1245
|
*
|
|
1087
|
-
* Runs a planned action: only with its hash, only once, only before it expires. Emits `stores.action.changed`.
|
|
1246
|
+
* Runs a planned action: only a person's confirmation — Studio's call for its developer, signed in (it carries Studio's word for them, X-Palbase-Person) — only with its hash, only once, only before it expires. The project's secret key alone, an organization's access token or a CI job is refused (403 `person_required`), before the action is looked up. Emits `stores.action.changed`.
|
|
1088
1247
|
*/
|
|
1089
1248
|
confirmAction(input: {
|
|
1090
1249
|
path: {
|
|
@@ -1245,7 +1404,7 @@ export declare function client(t: Transport): {
|
|
|
1245
1404
|
/**
|
|
1246
1405
|
* Link an app to its store
|
|
1247
1406
|
*
|
|
1248
|
-
* Links one of the project's registered iOS
|
|
1407
|
+
* Links one of the project's registered apps to its store. An iOS app (this environment's bundle and team): its bundle id is registered on the Apple account when it is not, and its App Store Connect record is looked up — Apple lets only a person make that, once, on the website. An Android app (its package): Palbase makes the app's upload key (its builds are signed with it, the first release in Play Console too) and asks Play, as the project's Play connection, what it reaches of the app. Linking again refreshes them and keeps the upload key. Emits `stores.app.changed`.
|
|
1249
1408
|
*/
|
|
1250
1409
|
linkApp(input: {
|
|
1251
1410
|
path: {
|
|
@@ -1301,6 +1460,28 @@ export declare function client(t: Transport): {
|
|
|
1301
1460
|
body: ReviewInfo; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
1302
1461
|
signal?: AbortSignal;
|
|
1303
1462
|
}): Promise<Reply<200, ReviewInfoAnswer>>;
|
|
1463
|
+
/**
|
|
1464
|
+
* Read an Android app's upload key
|
|
1465
|
+
*
|
|
1466
|
+
* The certificate of the upload key Palbase signs the app's builds with — never its private key: what Play Console shows of an app's upload key, and asks for when it is changed to Palbase's.
|
|
1467
|
+
*/
|
|
1468
|
+
getUploadKey(input: {
|
|
1469
|
+
path: {
|
|
1470
|
+
app_id: string;
|
|
1471
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
1472
|
+
signal?: AbortSignal;
|
|
1473
|
+
}): Promise<Reply<200, UploadKey>>;
|
|
1474
|
+
/**
|
|
1475
|
+
* Download a signed bundle with its link
|
|
1476
|
+
*
|
|
1477
|
+
* The signed bundle a link names (POST …/bundle-link). The token in the link is the authorization: sealed for this project's bundle, until it expires.
|
|
1478
|
+
*/
|
|
1479
|
+
downloadSignedBundle(input: {
|
|
1480
|
+
query: {
|
|
1481
|
+
token: string;
|
|
1482
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
1483
|
+
signal?: AbortSignal;
|
|
1484
|
+
}): Promise<Reply<200, Response>>;
|
|
1304
1485
|
/**
|
|
1305
1486
|
* The connect page
|
|
1306
1487
|
*
|
|
@@ -1318,6 +1499,47 @@ export declare function client(t: Transport): {
|
|
|
1318
1499
|
body: ConnectAppleKeyRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
1319
1500
|
signal?: AbortSignal;
|
|
1320
1501
|
}): Promise<Reply<200, AppleAccount>>;
|
|
1502
|
+
/**
|
|
1503
|
+
* Read the project's Play connection
|
|
1504
|
+
*
|
|
1505
|
+
* The project's Play connection: the service account its Play Console invites, its status and what Play let it reach.
|
|
1506
|
+
*/
|
|
1507
|
+
getGoogleAccount(input?: {
|
|
1508
|
+
signal?: AbortSignal;
|
|
1509
|
+
}): Promise<Reply<200, GoogleAccount>>;
|
|
1510
|
+
/**
|
|
1511
|
+
* Connect Google Play
|
|
1512
|
+
*
|
|
1513
|
+
* Makes the project's service account in Palbase's Google Cloud project and answers it, with what to do next: invite it in Play Console (Users and permissions) with the app. It holds no key — Palbase acts as it. Connecting again answers the same account. Emits `stores.google.changed` (connected).
|
|
1514
|
+
*/
|
|
1515
|
+
connectGoogle(input?: {
|
|
1516
|
+
headers?: {
|
|
1517
|
+
"Idempotency-Key"?: string;
|
|
1518
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
1519
|
+
signal?: AbortSignal;
|
|
1520
|
+
}): Promise<Reply<200, GoogleAccount> | Reply<201, GoogleAccount>>;
|
|
1521
|
+
/**
|
|
1522
|
+
* Disconnect Google Play
|
|
1523
|
+
*
|
|
1524
|
+
* Deletes the project's service account at Google, then forgets it: Play Console's invite of it reaches nothing any more. Emits `stores.google.changed` (disconnected).
|
|
1525
|
+
*/
|
|
1526
|
+
disconnectGoogle(input?: {
|
|
1527
|
+
headers?: {
|
|
1528
|
+
"Idempotency-Key"?: string;
|
|
1529
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
1530
|
+
signal?: AbortSignal;
|
|
1531
|
+
}): Promise<Reply<204, undefined>>;
|
|
1532
|
+
/**
|
|
1533
|
+
* Check the Play connection
|
|
1534
|
+
*
|
|
1535
|
+
* Asks Play, as the project's service account, what it reaches of each of the project's Android apps: after Play Console invited it, or changed what it may do. Emits `stores.google.changed` (checked) when Play's answer changed.
|
|
1536
|
+
*/
|
|
1537
|
+
checkGoogleAccount(input?: {
|
|
1538
|
+
headers?: {
|
|
1539
|
+
"Idempotency-Key"?: string;
|
|
1540
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
1541
|
+
signal?: AbortSignal;
|
|
1542
|
+
}): Promise<Reply<200, GoogleAccount>>;
|
|
1321
1543
|
/**
|
|
1322
1544
|
* Delete a group
|
|
1323
1545
|
*
|
|
@@ -1415,7 +1637,7 @@ export declare function client(t: Transport): {
|
|
|
1415
1637
|
/**
|
|
1416
1638
|
* Hand over a package's build
|
|
1417
1639
|
*
|
|
1418
|
-
* A build machine hands over the unsigned .ipa with the package's upload token (Palbase-Upload-Token header) and its Content-Length. It must be the app's — its bundle id, and the build number the package was given — or it is refused and the package keeps waiting for the right file. One upload of a package at a time, two of a project's at once (409 `upload_in_progress`); an upload ends within an hour
|
|
1640
|
+
* A build machine hands over the unsigned .ipa with the package's upload token (Palbase-Upload-Token header) and its Content-Length. It must be the app's — its bundle id, and the build number the package was given — or it is refused and the package keeps waiting for the right file. One upload of a package at a time, two of a project's at once (409 `upload_in_progress`); an upload ends within an hour, waits a minute at most for its next bytes and, after its first minute, keeps up 256 KiB a second on average (400 `upload_too_slow`). Sent again after it arrived, the same token answers 409 `package_uploaded`. Emits `stores.package.changed` (uploaded).
|
|
1419
1641
|
*/
|
|
1420
1642
|
uploadArtifact(input: {
|
|
1421
1643
|
path: {
|
|
@@ -1468,6 +1690,21 @@ export declare function client(t: Transport): {
|
|
|
1468
1690
|
body: DeliverRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
1469
1691
|
signal?: AbortSignal;
|
|
1470
1692
|
}): Promise<Reply<200, Delivery> | Reply<202, Delivery>>;
|
|
1693
|
+
/**
|
|
1694
|
+
* Link to a Play delivery's signed bundle
|
|
1695
|
+
*
|
|
1696
|
+
* A link, on the project's own address and valid 15 minutes, to the package's bundle as signed for the channel with the app's upload key: the file a person uploads in Play Console when Play takes an app's first release only there. Its bytes go from the project's address straight to whoever downloads it.
|
|
1697
|
+
*/
|
|
1698
|
+
getSignedBundleLink(input: {
|
|
1699
|
+
path: {
|
|
1700
|
+
package_id: string; /** The Play channel. */
|
|
1701
|
+
channel: "play_internal";
|
|
1702
|
+
};
|
|
1703
|
+
headers?: {
|
|
1704
|
+
"Idempotency-Key"?: string;
|
|
1705
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
1706
|
+
signal?: AbortSignal;
|
|
1707
|
+
}): Promise<Reply<201, BundleLink>>;
|
|
1471
1708
|
/**
|
|
1472
1709
|
* Plan expiring a build
|
|
1473
1710
|
*
|
|
@@ -57,6 +57,11 @@ export declare class PalbaseError extends Error {
|
|
|
57
57
|
/** The refusal's body as sent, for the answers that are not the envelope (OAuth errors, proof-of-work). */
|
|
58
58
|
readonly body?: unknown;
|
|
59
59
|
readonly op: string;
|
|
60
|
+
/**
|
|
61
|
+
* The request was never answered — no network, the host unreachable — and may be tried again. A refusal made on
|
|
62
|
+
* the device has status 0 too, and is not one: ask this, not `status === 0`.
|
|
63
|
+
*/
|
|
64
|
+
get isNetworkError(): boolean;
|
|
60
65
|
constructor(init: {
|
|
61
66
|
op: string;
|
|
62
67
|
status: number;
|
|
@@ -30,11 +30,6 @@ export declare class AuthUnavailable extends Error {
|
|
|
30
30
|
}
|
|
31
31
|
/** Whether the session the token belongs to still stands: true, false, or a throw when that cannot be told now. */
|
|
32
32
|
export type SessionStanding = (token: string, sessionId: string) => Promise<boolean>;
|
|
33
|
-
/**
|
|
34
|
-
* The platform's answer to whether a token's session stands: GET /auth/user
|
|
35
|
-
* with the token and the project's secret key — the edge answers it from the
|
|
36
|
-
* session's standing; a 401 is a session that has ended.
|
|
37
|
-
*/
|
|
38
33
|
export declare function sessionStanding(opts: {
|
|
39
34
|
url: string;
|
|
40
35
|
secretKey: string;
|
|
@@ -60,7 +55,7 @@ export interface VerifierOptions {
|
|
|
60
55
|
refetchIntervalMs?: number;
|
|
61
56
|
/** How long the key set is waited for, ms (default 5000). */
|
|
62
57
|
fetchTimeoutMs?: number;
|
|
63
|
-
/** The platform's answer to "does this token's session stand" (bootstrap asks GET /auth/
|
|
58
|
+
/** The platform's answer to "does this token's session stand" (bootstrap asks the edge: GET /auth/session/standing). */
|
|
64
59
|
standing: SessionStanding;
|
|
65
60
|
/** How long a session's standing is kept, ms (default 1000): a session that ended is refused within it. */
|
|
66
61
|
standingTtlMs?: number;
|
package/types/web/src/auth.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { auth as authModule } from '../../internal/src/modules/index.js';
|
|
2
2
|
import type { Transport } from '../../internal/src/transport.js';
|
|
3
|
-
import type { AuthEvent, Session, SessionManager } from './session.js';
|
|
3
|
+
import type { AuthEvent, Session, SessionEndReason, SessionManager } from './session.js';
|
|
4
4
|
type A = typeof authModule;
|
|
5
5
|
export type User = authModule.User;
|
|
6
6
|
export type SignupRequest = authModule.SignupRequest;
|
|
@@ -83,7 +83,10 @@ export declare class Auth {
|
|
|
83
83
|
remove: (id: string) => Promise<void>;
|
|
84
84
|
};
|
|
85
85
|
readonly magicLink: {
|
|
86
|
-
|
|
86
|
+
/** Sends the link; redirectTo is where it lands instead of the site URL — on the allow-list, or one of the project's web apps' redirects. */
|
|
87
|
+
send: (email: string, options?: {
|
|
88
|
+
redirectTo?: string;
|
|
89
|
+
}) => Promise<void>;
|
|
87
90
|
/** The token from the link the email carried. */
|
|
88
91
|
verify: (token: string) => Promise<User>;
|
|
89
92
|
};
|
|
@@ -92,8 +95,10 @@ export declare class Auth {
|
|
|
92
95
|
verifyCode: (phone: string, code: string) => Promise<SignInResult>;
|
|
93
96
|
};
|
|
94
97
|
readonly password: {
|
|
95
|
-
/** Sends the reset link; finish with confirmReset(token, newPassword). */
|
|
96
|
-
requestReset: (email: string
|
|
98
|
+
/** Sends the reset link; finish with confirmReset(token, newPassword). redirectTo is where it lands instead of the site URL — on the allow-list, or one of the project's web apps' redirects. */
|
|
99
|
+
requestReset: (email: string, options?: {
|
|
100
|
+
redirectTo?: string;
|
|
101
|
+
}) => Promise<void>;
|
|
97
102
|
confirmReset: (token: string, newPassword: string) => Promise<void>;
|
|
98
103
|
change: (body: authModule.PasswordChangeRequest) => Promise<authModule.SuccessResponse>;
|
|
99
104
|
set: (body: authModule.PasswordSetRequest) => Promise<authModule.SuccessResponse>;
|
|
@@ -113,6 +118,12 @@ export declare class Auth {
|
|
|
113
118
|
onAuthStateChange(listener: (event: AuthEvent, session: Session | null) => void): () => void;
|
|
114
119
|
/** The current session, or null when no one is signed in. */
|
|
115
120
|
currentSession(): Promise<Session | null>;
|
|
121
|
+
/**
|
|
122
|
+
* Why the last session ended without the app signing out — set before SESSION_EXPIRED is told, so a listener
|
|
123
|
+
* reads it: the account deleted ('userDeleted') or suspended ('userBanned'), the session revoked ('revoked') or
|
|
124
|
+
* run out ('expired'). Null once someone signs in or the app signs out.
|
|
125
|
+
*/
|
|
126
|
+
get sessionEndReason(): SessionEndReason | null;
|
|
116
127
|
/** Creates the account. When the project signs new users in at once, the session starts too. */
|
|
117
128
|
signUp(body: SignupRequest): Promise<authModule.SignupResult>;
|
|
118
129
|
/** Email and password. A second factor, when the account has one, is asked for in mfaRequired. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type Transport } from '../../internal/src/transport.js';
|
|
2
2
|
import { BackendError } from './backend-error.js';
|
|
3
|
-
import { type
|
|
3
|
+
import { type GatewayDescriptor, type GatewayEvent, type JoinedGateway, type JoinOptions } from './gateways.js';
|
|
4
4
|
import type { RealtimeSocket } from './socket.js';
|
|
5
5
|
export interface CallOptions {
|
|
6
6
|
headers?: Record<string, string>;
|
|
@@ -59,22 +59,29 @@ export interface BackendBase {
|
|
|
59
59
|
*/
|
|
60
60
|
call<O = unknown>(name: string, input?: unknown, options?: CallOptions): Promise<O>;
|
|
61
61
|
/**
|
|
62
|
-
* Joins a
|
|
63
|
-
* module's, `params` its pattern's `{param}` values: resolves once
|
|
64
|
-
* backend let the user in, with the handle its events arrive on and its
|
|
65
|
-
* messages go through
|
|
62
|
+
* Joins a gateway the backend declared with `@Gateway` — `gateway` is the
|
|
63
|
+
* generated module's, `params` its pattern's `{param}` values: resolves once
|
|
64
|
+
* the backend let the user in, with the handle its events arrive on and its
|
|
65
|
+
* messages go through (each answered with its ack); rejects with a
|
|
66
|
+
* GatewayError (its reason) when it did not. A durable gateway's handle is
|
|
67
|
+
* sent what it keeps first, unless `{ history: false }`; a chat gateway's
|
|
68
|
+
* holds the chat its server piped there (`handle.chat`).
|
|
66
69
|
*
|
|
67
|
-
* const
|
|
68
|
-
*
|
|
69
|
-
* await
|
|
70
|
-
*
|
|
70
|
+
* const chat = await pb.api.join(ChatGateway, { chatId });
|
|
71
|
+
* chat.chat.subscribe((s) => render(s.items));
|
|
72
|
+
* const { id } = await chat.send('say', { text: 'hello' });
|
|
73
|
+
* chat.leave();
|
|
71
74
|
*/
|
|
72
|
-
join<E extends
|
|
75
|
+
join<E extends GatewayEvent, S, R, P extends readonly string[], C extends boolean = false>(gateway: GatewayDescriptor<E, S, R, P, C>, params: Record<P[number], string>, options?: JoinOptions): Promise<JoinedGateway<E, S, R, C>>;
|
|
73
76
|
}
|
|
74
77
|
/** What every client createClient makes inherits: one getter per registered backend name. */
|
|
75
78
|
export declare const clientBase: object;
|
|
76
|
-
/**
|
|
77
|
-
|
|
79
|
+
/**
|
|
80
|
+
* Gives a client made by createClient its project's origin, its way to the
|
|
81
|
+
* machines, its project's transport (an upload's way, through storage), its
|
|
82
|
+
* socket (a gateway's) and its signed-in user (a chat gateway's own turns).
|
|
83
|
+
*/
|
|
84
|
+
export declare function bindMachines(client: object, project: string, machine: (url: string) => Transport, storage: Transport, socket: RealtimeSocket, me?: () => string | undefined): void;
|
|
78
85
|
/**
|
|
79
86
|
* Registers a backend under `client` for the clients of `project` (the
|
|
80
87
|
* address createClient is given) — the machine `machine`, at `url` — called
|