palbase 0.16.1 → 0.17.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.
Files changed (52) hide show
  1. package/dist/ai/index.js +2 -2
  2. package/dist/backend/engine.js +2 -2
  3. package/dist/backend/env.js +1 -1
  4. package/dist/backend/index.js +3 -3
  5. package/dist/backend/stack.js +1 -1
  6. package/dist/backend/test.js +2 -2
  7. package/dist/chunks/{P7GVSVOQ.js → 25FDQIKY.js} +2 -2
  8. package/dist/chunks/{PNWXM3F7.js → 45DR7TF6.js} +2 -2
  9. package/dist/chunks/{W65UTO2K.js → 4GIYAC3R.js} +1 -1
  10. package/dist/chunks/{JTVDCPW7.js → 55C2GHGA.js} +2 -2
  11. package/dist/chunks/{MDWPVJRO.js → 56S5CF3M.js} +2 -2
  12. package/dist/chunks/{4VWCHDF7.js → 6CEXEK2F.js} +2 -2
  13. package/dist/chunks/{BPDWFY5W.js → 6VLC4QJY.js} +2 -2
  14. package/dist/chunks/{KGF5JQ55.js → CPQR6PSB.js} +1 -1
  15. package/dist/chunks/{BOD4ISVQ.js → ENZI5RN5.js} +1 -1
  16. package/dist/chunks/{RLBTQDNG.js → FQLY6TBH.js} +2 -2
  17. package/dist/chunks/{W4QRU33N.js → GL5Y2PAS.js} +2 -2
  18. package/dist/chunks/{DK4U5V6J.js → HPQSHDEH.js} +2 -2
  19. package/dist/chunks/{4NM7FLWE.js → IG2INK7Z.js} +2 -2
  20. package/dist/chunks/JGUQKVFH.js +22 -0
  21. package/dist/chunks/{TDJKVGZK.js → K2CN4CGB.js} +1 -1
  22. package/dist/chunks/{YAS3UQG4.js → K3KCYVMN.js} +1 -1
  23. package/dist/chunks/{RPMMGWJZ.js → KBO5NELQ.js} +2 -2
  24. package/dist/chunks/{CQFCBON3.js → KUTBWXNL.js} +1 -1
  25. package/dist/chunks/{2ZGWY65B.js → MI5QEZ7Y.js} +1 -1
  26. package/dist/chunks/{T2YPRKJ3.js → O6LRXDFY.js} +2 -2
  27. package/dist/chunks/V72PBUK4.js +2 -0
  28. package/dist/chunks/{3I7TLVPS.js → WW4HVDSO.js} +2 -2
  29. package/dist/chunks/{DZBKUOW6.js → XAHQAK65.js} +2 -2
  30. package/dist/cli.js +125 -120
  31. package/dist/refuse/ai.js +1 -1
  32. package/dist/refuse/backend.js +1 -1
  33. package/dist/refuse/server.js +1 -1
  34. package/dist/server/index.js +2 -2
  35. package/dist/server/testing.js +2 -2
  36. package/dist/web/index.js +2 -2
  37. package/dist/web/message.js +2 -2
  38. package/dist/web/palbe.js +2 -2
  39. package/dist/web/paywall.js +2 -2
  40. package/dist/web/push-sw.js +2 -2
  41. package/dist/web/ssr.js +2 -2
  42. package/dist/web/vite.js +2 -2
  43. package/package.json +2 -2
  44. package/types/internal/src/modules/ai.d.ts +39 -0
  45. package/types/internal/src/modules/events.d.ts +4 -3
  46. package/types/internal/src/modules/index.d.ts +1 -0
  47. package/types/internal/src/modules/messaging.d.ts +2322 -0
  48. package/types/internal/src/modules/notify.d.ts +54 -1
  49. package/types/internal/src/modules/stores.d.ts +685 -3
  50. package/types/web/src/socket.d.ts +7 -0
  51. package/dist/chunks/AVVQBB3X.js +0 -22
  52. package/dist/chunks/LVST7TZJ.js +0 -2
@@ -179,7 +179,7 @@ export type App = {
179
179
  upload_key?: UploadKey;
180
180
  };
181
181
  /**
182
- * stores.app.changed: an app was linked to its store.
182
+ * stores.app.changed: an app was linked to its store, or its App Store Connect record made or removed with the project's Apple ID.
183
183
  */
184
184
  export type AppChangedEvent = {
185
185
  /**
@@ -197,7 +197,7 @@ export type AppChangedEvent = {
197
197
  /**
198
198
  * What happened.
199
199
  */
200
- change: "linked";
200
+ change: "linked" | "record_made" | "record_removed";
201
201
  /**
202
202
  * The platform (an Android app's link says it).
203
203
  */
@@ -2405,6 +2405,486 @@ export type WhatToTest = {
2405
2405
  */
2406
2406
  text: string;
2407
2407
  };
2408
+ /**
2409
+ * Apple's code, with the link's grant.
2410
+ */
2411
+ export type AppleIDCodeRequest = {
2412
+ /**
2413
+ * The six digits Apple sent.
2414
+ */
2415
+ code: string;
2416
+ /**
2417
+ * The link's grant.
2418
+ */
2419
+ grant: string;
2420
+ };
2421
+ /**
2422
+ * A one-time link to sign an Apple ID in, and the key its password is sealed to: the password is sealed in the person's browser (connect_url) or terminal, and goes sealed, with the grant, to POST /stores/connect/apple-id.
2423
+ */
2424
+ export type AppleIDGrant = {
2425
+ /**
2426
+ * The page that signs the Apple ID in from a browser. The grant rides in the URL's fragment, which a browser never sends to a server.
2427
+ */
2428
+ connect_url: string;
2429
+ /**
2430
+ * When the grant stops working.
2431
+ */
2432
+ expires_at: string;
2433
+ /**
2434
+ * The grant: spent when the Apple ID is connected, or after 15 minutes.
2435
+ */
2436
+ grant: string;
2437
+ /**
2438
+ * The project's X25519 public key (base64url, 32 bytes) the password is sealed to: HPKE (RFC 9180) base mode, DHKEM(X25519, HKDF-SHA256), HKDF-SHA256, AES-128-GCM, info `palbase/stores/apple-id/password/1`, a NUL byte, then the grant — palbase-js's hpkeSeal. Nothing on the password's way reads it; the stores module alone opens it.
2439
+ */
2440
+ seal_key: string;
2441
+ };
2442
+ /**
2443
+ * An Apple ID and its sealed password, with the link's grant.
2444
+ */
2445
+ export type AppleIDSignInRequest = {
2446
+ /**
2447
+ * The Apple ID.
2448
+ */
2449
+ apple_id: string;
2450
+ /**
2451
+ * The link's grant.
2452
+ */
2453
+ grant: string;
2454
+ /**
2455
+ * The password, sealed to the grant's seal_key (AppleIDGrant): base64url of the encapsulated key and the ciphertext. Opened by the stores module alone, handed to Apple, never kept. A password in the clear is no field of the request.
2456
+ */
2457
+ password_sealed: string;
2458
+ };
2459
+ /**
2460
+ * Where a sign-in stands.
2461
+ */
2462
+ export type AppleIDSignInStep = {
2463
+ /**
2464
+ * The phone it went to, as Apple masks it (`code`, `phone`).
2465
+ */
2466
+ destination?: string;
2467
+ /**
2468
+ * Where Apple sent the code (`code`): `trusted-device` or `phone`.
2469
+ */
2470
+ method?: string;
2471
+ session?: AppleSession;
2472
+ /**
2473
+ * `code`: Apple sent a code; `team`: choose the team; `connected`: done.
2474
+ */
2475
+ step: "code" | "team" | "connected";
2476
+ /**
2477
+ * The Apple ID's teams (`team`).
2478
+ */
2479
+ teams?: AppleTeam[];
2480
+ };
2481
+ /**
2482
+ * The team chosen, with the link's grant.
2483
+ */
2484
+ export type AppleIDTeamRequest = {
2485
+ /**
2486
+ * The link's grant.
2487
+ */
2488
+ grant: string;
2489
+ /**
2490
+ * The team's `id`, from the `team` step.
2491
+ */
2492
+ team: string;
2493
+ };
2494
+ /**
2495
+ * The project's Apple ID session: never the session itself.
2496
+ */
2497
+ export type AppleSession = {
2498
+ /**
2499
+ * What the person has to do, when the session waits on them.
2500
+ */
2501
+ action?: string;
2502
+ /**
2503
+ * The Apple ID, as Apple says it.
2504
+ */
2505
+ apple_id?: string;
2506
+ /**
2507
+ * When Apple last said what it is.
2508
+ */
2509
+ checked_at?: string;
2510
+ /**
2511
+ * Whether an Apple ID is signed in.
2512
+ */
2513
+ connected: boolean;
2514
+ /**
2515
+ * When it was signed in.
2516
+ */
2517
+ connected_at?: string;
2518
+ /**
2519
+ * Who asked for the sign-in link: a developer's id, or the key's.
2520
+ */
2521
+ connected_by?: string;
2522
+ /**
2523
+ * When Apple's end of it was found.
2524
+ */
2525
+ expired_at?: string;
2526
+ /**
2527
+ * The Apple ID's roles in the team.
2528
+ */
2529
+ roles?: string[];
2530
+ /**
2531
+ * `active`, or `expired`: Apple ended the session; sign in again.
2532
+ */
2533
+ status?: "active" | "expired";
2534
+ team?: AppleTeam;
2535
+ };
2536
+ /**
2537
+ * stores.apple.session.changed: an Apple ID was signed in for the project, or disconnected. Never the session.
2538
+ */
2539
+ export type AppleSessionChangedEvent = {
2540
+ /**
2541
+ * The Apple ID.
2542
+ */
2543
+ apple_id: string;
2544
+ /**
2545
+ * What happened.
2546
+ */
2547
+ change: "connected" | "disconnected";
2548
+ team: AppleTeam;
2549
+ };
2550
+ /**
2551
+ * stores.apple.session.expired: Apple ended the project's Apple ID session (it does after a few weeks, and when the password changes). What needs it answers 409 `apple_id_expired` until someone signs in again.
2552
+ */
2553
+ export type AppleSessionExpiredEvent = {
2554
+ /**
2555
+ * The Apple ID.
2556
+ */
2557
+ apple_id: string;
2558
+ team: AppleTeam;
2559
+ };
2560
+ /**
2561
+ * An App Store Connect team (Apple's provider).
2562
+ */
2563
+ export type AppleTeam = {
2564
+ /**
2565
+ * The team's public id at Apple.
2566
+ */
2567
+ id: string;
2568
+ /**
2569
+ * The team's name.
2570
+ */
2571
+ name: string;
2572
+ /**
2573
+ * Apple's number for the team.
2574
+ */
2575
+ provider_id: number;
2576
+ };
2577
+ /**
2578
+ * A guideline a rejection names.
2579
+ */
2580
+ export type ReviewReason = {
2581
+ /**
2582
+ * The guideline's section (2.1, 5.1.1…).
2583
+ */
2584
+ section?: string;
2585
+ /**
2586
+ * What App Review says of it.
2587
+ */
2588
+ description?: string;
2589
+ /**
2590
+ * Apple's code for it.
2591
+ */
2592
+ code?: string;
2593
+ };
2594
+ /**
2595
+ * A rejection App Review wrote in a thread.
2596
+ */
2597
+ export type ReviewRejection = {
2598
+ /**
2599
+ * The rejection.
2600
+ */
2601
+ id: string;
2602
+ /**
2603
+ * The guidelines it names.
2604
+ */
2605
+ reasons: ReviewReason[];
2606
+ /**
2607
+ * Its attachments' ids.
2608
+ */
2609
+ attachments: string[];
2610
+ };
2611
+ /**
2612
+ * A message in a thread, as plain text.
2613
+ */
2614
+ export type ReviewMessage = {
2615
+ /**
2616
+ * The message.
2617
+ */
2618
+ id: string;
2619
+ /**
2620
+ * When it was written, as Apple says it.
2621
+ */
2622
+ created_at?: string;
2623
+ /**
2624
+ * Who wrote it, as Apple says it (its actor's type).
2625
+ */
2626
+ from?: string;
2627
+ /**
2628
+ * Its text.
2629
+ */
2630
+ body: string;
2631
+ /**
2632
+ * The rejections it carries.
2633
+ */
2634
+ rejections: string[];
2635
+ /**
2636
+ * Its attachments' ids.
2637
+ */
2638
+ attachments: string[];
2639
+ };
2640
+ /**
2641
+ * A file App Review attached.
2642
+ */
2643
+ export type ReviewAttachment = {
2644
+ /**
2645
+ * The attachment.
2646
+ */
2647
+ id: string;
2648
+ /**
2649
+ * Its name.
2650
+ */
2651
+ file_name?: string;
2652
+ /**
2653
+ * Its size in bytes.
2654
+ */
2655
+ file_size?: number;
2656
+ /**
2657
+ * Whether Apple offers it for download.
2658
+ */
2659
+ downloadable: boolean;
2660
+ /**
2661
+ * The message it is of.
2662
+ */
2663
+ message_id?: string;
2664
+ /**
2665
+ * The rejection it is of.
2666
+ */
2667
+ rejection_id?: string;
2668
+ };
2669
+ /**
2670
+ * The answer to a thread, not sent yet (a thread with none has no draft).
2671
+ */
2672
+ export type ReviewDraft = {
2673
+ /**
2674
+ * The draft.
2675
+ */
2676
+ id: string;
2677
+ /**
2678
+ * Its text.
2679
+ */
2680
+ body: string;
2681
+ };
2682
+ /**
2683
+ * A Resolution Center thread of the app: a rejection, or a message from App Review.
2684
+ */
2685
+ export type ReviewThread = {
2686
+ /**
2687
+ * The thread.
2688
+ */
2689
+ id: string;
2690
+ /**
2691
+ * Apple's kind of thread (REJECTION_BINARY, REJECTION_METADATA, APP_MESSAGE_…).
2692
+ */
2693
+ type?: string;
2694
+ /**
2695
+ * Its state at Apple.
2696
+ */
2697
+ state?: string;
2698
+ /**
2699
+ * When it began.
2700
+ */
2701
+ created_at?: string;
2702
+ /**
2703
+ * When its last message came.
2704
+ */
2705
+ last_message_at?: string;
2706
+ /**
2707
+ * Whether App Review takes an answer on it.
2708
+ */
2709
+ can_reply: boolean;
2710
+ /**
2711
+ * The App Store versions it is of.
2712
+ */
2713
+ versions: string[];
2714
+ /**
2715
+ * Its messages.
2716
+ */
2717
+ messages: ReviewMessage[];
2718
+ /**
2719
+ * Its rejections.
2720
+ */
2721
+ rejections: ReviewRejection[];
2722
+ /**
2723
+ * Its attachments.
2724
+ */
2725
+ attachments: ReviewAttachment[];
2726
+ draft?: ReviewDraft;
2727
+ };
2728
+ /**
2729
+ * The app's Resolution Center.
2730
+ */
2731
+ export type ReviewPage = {
2732
+ /**
2733
+ * Its threads, newest first.
2734
+ */
2735
+ threads: ReviewThread[];
2736
+ };
2737
+ /**
2738
+ * The answer to write.
2739
+ */
2740
+ export type DraftRequest = {
2741
+ /**
2742
+ * Its text.
2743
+ */
2744
+ body: string;
2745
+ };
2746
+ /**
2747
+ * One line of the app's privacy details, in Apple's words: a kind of data (category: USER_ID, PURCHASE_HISTORY…), what it is used for (purpose: APP_FUNCTIONALITY, ANALYTICS…) and how (data_protection: DATA_LINKED_TO_YOU, DATA_NOT_LINKED_TO_YOU, DATA_USED_TO_TRACK_YOU) — or DATA_NOT_COLLECTED alone.
2748
+ */
2749
+ export type PrivacyUsage = {
2750
+ /**
2751
+ * The kind of data.
2752
+ */
2753
+ category?: string;
2754
+ /**
2755
+ * What it is used for.
2756
+ */
2757
+ purpose?: string;
2758
+ /**
2759
+ * How.
2760
+ */
2761
+ data_protection: string;
2762
+ };
2763
+ /**
2764
+ * The app's privacy details at Apple.
2765
+ */
2766
+ export type Privacy = {
2767
+ /**
2768
+ * Its lines.
2769
+ */
2770
+ usages: PrivacyUsage[];
2771
+ /**
2772
+ * Whether they are published on the App Store.
2773
+ */
2774
+ published: boolean;
2775
+ };
2776
+ /**
2777
+ * The privacy details to write.
2778
+ */
2779
+ export type PrivacyRequest = {
2780
+ /**
2781
+ * Every line, or DATA_NOT_COLLECTED alone.
2782
+ */
2783
+ usages: PrivacyUsage[];
2784
+ /**
2785
+ * Publish them once written.
2786
+ */
2787
+ publish?: boolean;
2788
+ };
2789
+ /**
2790
+ * The app record to make.
2791
+ */
2792
+ export type RecordRequest = {
2793
+ /**
2794
+ * Its App Store name.
2795
+ */
2796
+ name: string;
2797
+ /**
2798
+ * Its own id in the team (the bundle id when empty).
2799
+ */
2800
+ sku?: string;
2801
+ /**
2802
+ * Its store page's first language (en-US when empty).
2803
+ */
2804
+ primary_locale?: string;
2805
+ /**
2806
+ * The seller's name, which a team's first app sets.
2807
+ */
2808
+ company_name?: string;
2809
+ };
2810
+ /**
2811
+ * stores.review.message: a message in the app's Resolution Center not told yet — App Review's, or any not sent from Palbase — with the guidelines its rejections name and its attachments. Told while the project has an Apple ID signed in and a version of the app is in review or was rejected in the last 30 days.
2812
+ */
2813
+ export type ReviewMessageEvent = {
2814
+ /**
2815
+ * The app.
2816
+ */
2817
+ app_id: string;
2818
+ /**
2819
+ * Its bundle id.
2820
+ */
2821
+ bundle_id: string;
2822
+ /**
2823
+ * Its App Store Connect record.
2824
+ */
2825
+ asc_app_id: string;
2826
+ /**
2827
+ * The thread.
2828
+ */
2829
+ thread_id: string;
2830
+ /**
2831
+ * Apple's kind of thread.
2832
+ */
2833
+ thread_type?: string;
2834
+ /**
2835
+ * The App Store versions it is of.
2836
+ */
2837
+ versions?: string[];
2838
+ /**
2839
+ * The message.
2840
+ */
2841
+ message_id: string;
2842
+ /**
2843
+ * When it was written.
2844
+ */
2845
+ created_at?: string;
2846
+ /**
2847
+ * Who wrote it, as Apple says it.
2848
+ */
2849
+ from?: string;
2850
+ /**
2851
+ * Its text (24 KiB at most).
2852
+ */
2853
+ body: string;
2854
+ /**
2855
+ * Whether the text was cut to fit.
2856
+ */
2857
+ body_cut: boolean;
2858
+ /**
2859
+ * The guidelines its rejections name.
2860
+ */
2861
+ reasons: ReviewReason[];
2862
+ /**
2863
+ * Its attachments (read them from GET …/review/threads/{thread_id}/attachments/{attachment_id}).
2864
+ */
2865
+ attachments: ReviewAttachment[];
2866
+ };
2867
+ /**
2868
+ * stores.apple.session.ended: Palbase's own project's copy of an Apple ID session Apple ended in a customer's project, whose Studio mails the person who connected it.
2869
+ */
2870
+ export type AppleSessionEndedEvent = {
2871
+ /**
2872
+ * The customer's project.
2873
+ */
2874
+ project_id: string;
2875
+ /**
2876
+ * The Apple ID.
2877
+ */
2878
+ apple_id: string;
2879
+ /**
2880
+ * Its team's name.
2881
+ */
2882
+ team: string;
2883
+ /**
2884
+ * Who asked for the sign-in link: a developer's id, or the key's.
2885
+ */
2886
+ connected_by: string;
2887
+ };
2408
2888
  /** The events this module sends the project's webhooks (x-palbase-events), by type: each one's payload, the event's data. */
2409
2889
  export interface Events {
2410
2890
  /**
@@ -2412,7 +2892,7 @@ export interface Events {
2412
2892
  */
2413
2893
  "stores.action.changed": ActionChangedEvent;
2414
2894
  /**
2415
- * stores.app.changed: an app was linked to its store.
2895
+ * stores.app.changed: an app was linked to its store, or its App Store Connect record made or removed with the project's Apple ID.
2416
2896
  */
2417
2897
  "stores.app.changed": AppChangedEvent;
2418
2898
  /**
@@ -2475,6 +2955,22 @@ export interface Events {
2475
2955
  * stores.webhook.changed: an app's App Store Connect webhook came on, or was refused (the key's role) or failed.
2476
2956
  */
2477
2957
  "stores.webhook.changed": WebhookChangedEvent;
2958
+ /**
2959
+ * stores.apple.session.changed: an Apple ID was signed in for the project, or disconnected. Never the session.
2960
+ */
2961
+ "stores.apple.session.changed": AppleSessionChangedEvent;
2962
+ /**
2963
+ * stores.apple.session.expired: Apple ended the project's Apple ID session (it does after a few weeks, and when the password changes). What needs it answers 409 `apple_id_expired` until someone signs in again.
2964
+ */
2965
+ "stores.apple.session.expired": AppleSessionExpiredEvent;
2966
+ /**
2967
+ * stores.review.message: a message in the app's Resolution Center not told yet — App Review's, or any not sent from Palbase — with the guidelines its rejections name and its attachments. Told while the project has an Apple ID signed in and a version of the app is in review or was rejected in the last 30 days.
2968
+ */
2969
+ "stores.review.message": ReviewMessageEvent;
2970
+ /**
2971
+ * stores.apple.session.ended: Palbase's own project's copy of an Apple ID session Apple ended in a customer's project, whose Studio mails the person who connected it.
2972
+ */
2973
+ "stores.apple.session.ended": AppleSessionEndedEvent;
2478
2974
  }
2479
2975
  /** Palbase Stores */
2480
2976
  export declare function client(t: Transport): {
@@ -3232,5 +3728,191 @@ export declare function client(t: Transport): {
3232
3728
  body: AppleWebhookDelivery; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
3233
3729
  signal?: AbortSignal;
3234
3730
  }): Promise<Reply<200, undefined>>;
3731
+ /**
3732
+ * The Apple ID session
3733
+ *
3734
+ * The Apple ID signed in for the project (App Store Connect's web session, for what Apple's API does not do: App Review's Resolution Center, App Privacy, making an app record), its team and roles, and whether Apple still takes it — never the session itself. `connected: false` with none.
3735
+ */
3736
+ getAppleSession(input?: {
3737
+ signal?: AbortSignal;
3738
+ }): Promise<Reply<200, AppleSession>>;
3739
+ /**
3740
+ * Disconnect the Apple ID
3741
+ *
3742
+ * Signs the session out at Apple and forgets it; Apple not answering does not keep it. An owner's or an admin's, or the project's secret key's (403 `admin_required` for a member). Emits `stores.apple.session.changed` (disconnected).
3743
+ */
3744
+ disconnectAppleSession(input?: {
3745
+ headers?: {
3746
+ "Idempotency-Key"?: string;
3747
+ }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
3748
+ signal?: AbortSignal;
3749
+ }): Promise<Reply<204, undefined>>;
3750
+ /**
3751
+ * Check the Apple ID session
3752
+ *
3753
+ * Asks Apple whose the session is now (its team, its roles) — the module does every 6 hours a session is not used. A session Apple ended is marked `expired` and told (`stores.apple.session.expired`); sign in again to go on.
3754
+ */
3755
+ checkAppleSession(input?: {
3756
+ headers?: {
3757
+ "Idempotency-Key"?: string;
3758
+ }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
3759
+ signal?: AbortSignal;
3760
+ }): Promise<Reply<200, AppleSession>>;
3761
+ /**
3762
+ * Grant an Apple ID's sign-in
3763
+ *
3764
+ * A one-time link, good for 15 minutes, to sign an Apple ID in for the project. Whoever asks for it never holds the password: the person opens `connect_url` in a browser, or a terminal posts to `POST /stores/connect/apple-id` with the grant. A link takes 3 passwords and 3 codes; a project 6 passwords an hour, however many links it asks for (Apple locks an Apple ID tried too often), and holds 5 open links at most (429 `too_many_grants`). An owner's or an admin's, or the project's secret key's (403 `admin_required` for a member).
3765
+ */
3766
+ createAppleIdGrant(input?: {
3767
+ headers?: {
3768
+ "Idempotency-Key"?: string;
3769
+ }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
3770
+ signal?: AbortSignal;
3771
+ }): Promise<Reply<201, AppleIDGrant>>;
3772
+ /**
3773
+ * The Apple ID sign-in page
3774
+ *
3775
+ * The page a sign-in link opens: it names the project the Apple ID goes to, reads the grant from the link's fragment and posts the Apple ID, its password, Apple's code and the team with it. No credential: the grant is the authorization.
3776
+ */
3777
+ getAppleIdPage(input?: {
3778
+ signal?: AbortSignal;
3779
+ }): Promise<Reply<200, Response>>;
3780
+ /**
3781
+ * Sign an Apple ID in
3782
+ *
3783
+ * Takes an Apple ID and its password, sealed to the link's seal_key, with a grant: the stores module opens the password and hands it to Apple. It is in no row, event or log, and nothing on its way reads it. Apple then asks for a code (`step: code`), the Apple ID's team is to be chosen (`step: team`), or it is connected (`step: connected`, emitting `stores.apple.session.changed`). Each password counts against the link (3), the project's hour (6) and the Apple ID's hour, whatever project tries it (10); past either hour, 429 `too_many_attempts`.
3784
+ */
3785
+ signInAppleId(input: {
3786
+ body: AppleIDSignInRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
3787
+ signal?: AbortSignal;
3788
+ }): Promise<Reply<200, AppleIDSignInStep>>;
3789
+ /**
3790
+ * Send Apple's code
3791
+ *
3792
+ * Finishes a sign-in with the six-digit code Apple sent to the Apple ID's trusted devices or phone. A link takes 3 codes.
3793
+ */
3794
+ submitAppleIdCode(input: {
3795
+ body: AppleIDCodeRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
3796
+ signal?: AbortSignal;
3797
+ }): Promise<Reply<200, AppleIDSignInStep>>;
3798
+ /**
3799
+ * Choose the team
3800
+ *
3801
+ * Finishes a sign-in whose Apple ID is in more than one App Store Connect team, with the team's `id` from the `team` step.
3802
+ */
3803
+ chooseAppleIdTeam(input: {
3804
+ body: AppleIDTeamRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
3805
+ signal?: AbortSignal;
3806
+ }): Promise<Reply<200, AppleIDSignInStep>>;
3807
+ /**
3808
+ * The app's Resolution Center
3809
+ *
3810
+ * App Review's threads of the app, the five written to last, latest first: each message as plain text, the guidelines each rejection names, the attachments, and the answer not sent yet. Needs the project's Apple ID signed in (409 `apple_id_not_connected`, or `apple_id_expired` once Apple ended its session) and the app's App Store Connect record (409 `app_record_missing`).
3811
+ */
3812
+ getAppReview(input: {
3813
+ path: {
3814
+ app_id: string;
3815
+ }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
3816
+ signal?: AbortSignal;
3817
+ }): Promise<Reply<200, ReviewPage>>;
3818
+ /**
3819
+ * An App Review attachment
3820
+ *
3821
+ * The file App Review attached to a message or a rejection, read from where Apple serves it and passed on as it comes (64 MiB at most): with none of the session's cookies, but where App Store Connect serves it itself. 404 `thread_not_found` or `attachment_not_found`. Needs the project's Apple ID signed in (409 `apple_id_not_connected`, or `apple_id_expired` once Apple ended its session) and the app's App Store Connect record (409 `app_record_missing`).
3822
+ */
3823
+ getReviewAttachment(input: {
3824
+ path: {
3825
+ app_id: string; /** The Resolution Center thread's id (ReviewThread.id). */
3826
+ thread_id: string; /** The attachment's id (ReviewAttachment.id). */
3827
+ attachment_id: string;
3828
+ }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
3829
+ signal?: AbortSignal;
3830
+ }): Promise<Reply<200, Response>>;
3831
+ /**
3832
+ * Write the answer to App Review
3833
+ *
3834
+ * Writes the thread's answer, not sent: App Store Connect keeps it as the website's draft. 409 `thread_closed` when App Review takes no answer on the thread. Needs the project's Apple ID signed in (409 `apple_id_not_connected`, or `apple_id_expired` once Apple ended its session) and the app's App Store Connect record (409 `app_record_missing`).
3835
+ */
3836
+ setReviewDraft(input: {
3837
+ path: {
3838
+ app_id: string; /** The Resolution Center thread's id (ReviewThread.id). */
3839
+ thread_id: string;
3840
+ };
3841
+ headers?: {
3842
+ "Idempotency-Key"?: string;
3843
+ };
3844
+ body: DraftRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
3845
+ signal?: AbortSignal;
3846
+ }): Promise<Reply<200, ReviewDraft>>;
3847
+ /**
3848
+ * Send the answer to App Review
3849
+ *
3850
+ * Sends the thread's draft to App Review (409 `draft_missing` with none). The message is the project's own: it is not told back as `stores.review.message`. Needs the project's Apple ID signed in (409 `apple_id_not_connected`, or `apple_id_expired` once Apple ended its session) and the app's App Store Connect record (409 `app_record_missing`).
3851
+ */
3852
+ sendReviewDraft(input: {
3853
+ path: {
3854
+ app_id: string; /** The Resolution Center thread's id (ReviewThread.id). */
3855
+ thread_id: string;
3856
+ };
3857
+ headers?: {
3858
+ "Idempotency-Key"?: string;
3859
+ }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
3860
+ signal?: AbortSignal;
3861
+ }): Promise<Reply<200, ReviewMessage>>;
3862
+ /**
3863
+ * The app's App Privacy details
3864
+ *
3865
+ * The app's privacy details as App Store Connect has them, in Apple's words, and whether they are published. Needs the project's Apple ID signed in (409 `apple_id_not_connected`, or `apple_id_expired` once Apple ended its session) and the app's App Store Connect record (409 `app_record_missing`).
3866
+ */
3867
+ getAppPrivacy(input: {
3868
+ path: {
3869
+ app_id: string;
3870
+ }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
3871
+ signal?: AbortSignal;
3872
+ }): Promise<Reply<200, Privacy>>;
3873
+ /**
3874
+ * Write the app's App Privacy details
3875
+ *
3876
+ * Writes the app's privacy details at Apple — the lines it lacks made first, then the ones not asked for removed, so that a write that stops half way leaves more said than asked, never less — and publishes them with `publish`. Every value must be one of Apple's own lists (400 `invalid_privacy` names the others). The write is not one transaction at Apple: sent again, it finishes what one cut short. Published, the version's missing list stops asking for App Privacy. Needs the project's Apple ID signed in (409 `apple_id_not_connected`, or `apple_id_expired` once Apple ended its session) and the app's App Store Connect record (409 `app_record_missing`).
3877
+ */
3878
+ setAppPrivacy(input: {
3879
+ path: {
3880
+ app_id: string;
3881
+ };
3882
+ headers?: {
3883
+ "Idempotency-Key"?: string;
3884
+ };
3885
+ body: PrivacyRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
3886
+ signal?: AbortSignal;
3887
+ }): Promise<Reply<200, Privacy>>;
3888
+ /**
3889
+ * Make the app's App Store Connect record
3890
+ *
3891
+ * Makes the app's record at App Store Connect, which Apple's API leaves to a person on the website, and links the app to it (`stores.app.changed`, record_made); its webhook is made then, or by the leader's next round when Apple refuses it. 409 `app_record_exists` when it has one, `app_name_taken` when the App Store has the name. Needs the project's Apple ID signed in.
3892
+ */
3893
+ makeAppRecord(input: {
3894
+ path: {
3895
+ app_id: string;
3896
+ };
3897
+ headers?: {
3898
+ "Idempotency-Key"?: string;
3899
+ };
3900
+ body: RecordRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
3901
+ signal?: AbortSignal;
3902
+ }): Promise<Reply<201, App>>;
3903
+ /**
3904
+ * Remove the app's App Store Connect record
3905
+ *
3906
+ * Removes the app's record at App Store Connect, as its Remove App does: Apple takes it for an app never approved, with no version ready for, waiting for, in or rejected by App Review, sold on the App Store alone (409 `app_record_not_removable` says which). The removal is read back: the app stays linked, with no record (`stores.app.changed`, record_removed), only once Apple says it is removed. An owner's or an admin's, or the project's secret key's. Needs the project's Apple ID signed in (409 `apple_id_not_connected`, or `apple_id_expired`) and the app's App Store Connect record (409 `app_record_missing`).
3907
+ */
3908
+ removeAppRecord(input: {
3909
+ path: {
3910
+ app_id: string;
3911
+ };
3912
+ headers?: {
3913
+ "Idempotency-Key"?: string;
3914
+ }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
3915
+ signal?: AbortSignal;
3916
+ }): Promise<Reply<204, undefined>>;
3235
3917
  };
3236
3918
  export type Client = ReturnType<typeof client>;