palbase 0.18.0 → 0.18.2
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/{BW5DFI3C.js → 2MCXKESR.js} +1 -1
- package/dist/chunks/{6IMY2J5W.js → 34GIR5XI.js} +1 -1
- package/dist/chunks/6O7HI5DJ.js +2 -0
- package/dist/chunks/{7QFBZLAK.js → BZD6DTRS.js} +1 -1
- package/dist/chunks/{KRQZOF2L.js → DTILUE3A.js} +2 -2
- package/dist/chunks/{FT7G3QQ4.js → FWE2RQ74.js} +2 -2
- package/dist/chunks/{XF3JEDIQ.js → FYEDISVZ.js} +1 -1
- package/dist/chunks/{4S4ODZVM.js → J3GVOUKS.js} +2 -2
- package/dist/chunks/{OC32TP3L.js → J3SSWIXW.js} +2 -2
- package/dist/chunks/{BKGX3AZA.js → JK6Y5742.js} +2 -2
- package/dist/chunks/{XHNZDLR4.js → JWBOJ4DZ.js} +2 -2
- package/dist/chunks/{PMQOJ7FF.js → KPB7BB3F.js} +2 -2
- package/dist/chunks/N7TLZR3V.js +22 -0
- package/dist/chunks/{4HFD24QY.js → NWFZYTV4.js} +1 -1
- package/dist/chunks/{VQXYHAU4.js → PPIZUQG5.js} +2 -2
- package/dist/chunks/{ART5HP5M.js → PQU3TAPP.js} +2 -2
- package/dist/chunks/{7R4WTDHI.js → QEBQ452U.js} +1 -1
- package/dist/chunks/{3GWBIPGH.js → RFF725G4.js} +2 -2
- package/dist/chunks/{CAZYHE64.js → TAFRNPVE.js} +2 -2
- package/dist/chunks/{PPK2UEAY.js → TNSIU2CJ.js} +2 -2
- package/dist/chunks/{T2O6XEQO.js → X6FNTEXY.js} +1 -1
- package/dist/chunks/{JKA2W4E5.js → XQANDC54.js} +2 -2
- package/dist/chunks/ZFJ7245R.js +21 -0
- package/dist/cli.js +127 -127
- 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/attest.d.ts +59 -0
- package/types/backend/src/decorators.d.ts +10 -1
- package/types/backend/src/index.d.ts +1 -1
- package/types/internal/src/modules/auth.d.ts +8 -0
- package/types/internal/src/modules/events.d.ts +2 -2
- package/types/internal/src/modules/purchases.d.ts +197 -2
- package/types/internal/src/modules/stores.d.ts +166 -0
- package/types/web/src/auth.d.ts +11 -1
- package/types/web/src/purchases.d.ts +11 -0
- package/dist/chunks/32XY6IBN.js +0 -21
- package/dist/chunks/EVBWED24.js +0 -22
- package/dist/chunks/ZXV3ZKVM.js +0 -2
|
@@ -467,6 +467,10 @@ export type AppleChangedEvent = {
|
|
|
467
467
|
* What Apple said of the key (connected, checked).
|
|
468
468
|
*/
|
|
469
469
|
status?: "active" | "agreement" | "refused";
|
|
470
|
+
/**
|
|
471
|
+
* The key was made at Apple by Palbase, with the environment's Apple ID session (connected).
|
|
472
|
+
*/
|
|
473
|
+
made?: boolean;
|
|
470
474
|
};
|
|
471
475
|
/**
|
|
472
476
|
* A one-time grant to connect an Apple key: the key goes from the person's browser (connect_url) or terminal (POST /stores/connect with the grant) straight to the module.
|
|
@@ -2532,6 +2536,7 @@ export type AppleSession = {
|
|
|
2532
2536
|
*/
|
|
2533
2537
|
status?: "active" | "expired";
|
|
2534
2538
|
team?: AppleTeam;
|
|
2539
|
+
shared_from?: SharedEnvironment;
|
|
2535
2540
|
};
|
|
2536
2541
|
/**
|
|
2537
2542
|
* stores.apple.session.changed: an Apple ID was signed in for the project, or disconnected. Never the session.
|
|
@@ -2885,6 +2890,125 @@ export type AppleSessionEndedEvent = {
|
|
|
2885
2890
|
*/
|
|
2886
2891
|
connected_by: string;
|
|
2887
2892
|
};
|
|
2893
|
+
/**
|
|
2894
|
+
* A key Palbase made at Apple for the environment: never its .p8.
|
|
2895
|
+
*/
|
|
2896
|
+
export type MadeKey = {
|
|
2897
|
+
/**
|
|
2898
|
+
* The apps it is for (APNs, In-App Purchase).
|
|
2899
|
+
*/
|
|
2900
|
+
bundles?: string[];
|
|
2901
|
+
/**
|
|
2902
|
+
* An APNs key's environment.
|
|
2903
|
+
*/
|
|
2904
|
+
environment?: "sandbox" | "prod";
|
|
2905
|
+
/**
|
|
2906
|
+
* The key's id at Apple.
|
|
2907
|
+
*/
|
|
2908
|
+
key_id: string;
|
|
2909
|
+
/**
|
|
2910
|
+
* `asc` (App Store Connect API), `apns` or `iap` (In-App Purchase).
|
|
2911
|
+
*/
|
|
2912
|
+
kind: "asc" | "apns" | "iap";
|
|
2913
|
+
/**
|
|
2914
|
+
* When it was made.
|
|
2915
|
+
*/
|
|
2916
|
+
made_at: string;
|
|
2917
|
+
/**
|
|
2918
|
+
* Who asked for it: a developer's id, or the key's.
|
|
2919
|
+
*/
|
|
2920
|
+
made_by: string;
|
|
2921
|
+
/**
|
|
2922
|
+
* The module it is for: notify (APNs), purchases (In-App Purchase).
|
|
2923
|
+
*/
|
|
2924
|
+
module?: "notify" | "purchases";
|
|
2925
|
+
/**
|
|
2926
|
+
* What became of it, when it was not simply taken.
|
|
2927
|
+
*/
|
|
2928
|
+
note?: string;
|
|
2929
|
+
/**
|
|
2930
|
+
* When its module took it, refused it, or it was revoked.
|
|
2931
|
+
*/
|
|
2932
|
+
settled_at?: string;
|
|
2933
|
+
/**
|
|
2934
|
+
* `waiting` for its module to take it, `taken`, `refused` (its module keeps a key of its own and it could not be revoked at Apple), or `revoked`.
|
|
2935
|
+
*/
|
|
2936
|
+
state: "waiting" | "taken" | "refused" | "revoked";
|
|
2937
|
+
};
|
|
2938
|
+
/**
|
|
2939
|
+
* Keys Palbase made at Apple for the environment.
|
|
2940
|
+
*/
|
|
2941
|
+
export type MadeKeys = {
|
|
2942
|
+
keys: MadeKey[];
|
|
2943
|
+
};
|
|
2944
|
+
/**
|
|
2945
|
+
* The key to make at Apple.
|
|
2946
|
+
*/
|
|
2947
|
+
export type MakeKeyRequest = {
|
|
2948
|
+
/**
|
|
2949
|
+
* The iOS app an In-App Purchase key is for; required when the environment has more than one.
|
|
2950
|
+
*/
|
|
2951
|
+
bundle?: string;
|
|
2952
|
+
/**
|
|
2953
|
+
* `asc` (App Store Connect API), `apns` or `iap` (In-App Purchase).
|
|
2954
|
+
*/
|
|
2955
|
+
kind: "asc" | "apns" | "iap";
|
|
2956
|
+
};
|
|
2957
|
+
/**
|
|
2958
|
+
* The environment of the organization whose Apple ID session the project uses, having none of its own: signed in to the project's App Store Connect team.
|
|
2959
|
+
*/
|
|
2960
|
+
export type SharedEnvironment = {
|
|
2961
|
+
/**
|
|
2962
|
+
* Its project's name.
|
|
2963
|
+
*/
|
|
2964
|
+
name?: string;
|
|
2965
|
+
/**
|
|
2966
|
+
* Its platform project's id.
|
|
2967
|
+
*/
|
|
2968
|
+
project_id: string;
|
|
2969
|
+
/**
|
|
2970
|
+
* Its ref.
|
|
2971
|
+
*/
|
|
2972
|
+
ref?: string;
|
|
2973
|
+
};
|
|
2974
|
+
/**
|
|
2975
|
+
* stores.apple.key.made: keys were made at Apple for another module of the environment (notify's APNs keys, purchases' In-App Purchase key), which takes them. Never a key.
|
|
2976
|
+
*/
|
|
2977
|
+
export type AppleKeyMadeEvent = {
|
|
2978
|
+
/**
|
|
2979
|
+
* The keys' handover: what the module takes at once.
|
|
2980
|
+
*/
|
|
2981
|
+
handover: string;
|
|
2982
|
+
/**
|
|
2983
|
+
* The keys' ids at Apple.
|
|
2984
|
+
*/
|
|
2985
|
+
key_ids: string[];
|
|
2986
|
+
/**
|
|
2987
|
+
* `apns` or `iap`.
|
|
2988
|
+
*/
|
|
2989
|
+
kind: "apns" | "iap";
|
|
2990
|
+
/**
|
|
2991
|
+
* The module the keys are for.
|
|
2992
|
+
*/
|
|
2993
|
+
module: "notify" | "purchases";
|
|
2994
|
+
};
|
|
2995
|
+
/**
|
|
2996
|
+
* stores.apple.key.revoked: a key Palbase made at Apple for the environment was revoked there. Never the key.
|
|
2997
|
+
*/
|
|
2998
|
+
export type AppleKeyRevokedEvent = {
|
|
2999
|
+
/**
|
|
3000
|
+
* The key's id at Apple.
|
|
3001
|
+
*/
|
|
3002
|
+
key_id: string;
|
|
3003
|
+
/**
|
|
3004
|
+
* `apns` or `iap`.
|
|
3005
|
+
*/
|
|
3006
|
+
kind: "asc" | "apns" | "iap";
|
|
3007
|
+
/**
|
|
3008
|
+
* The module it was for.
|
|
3009
|
+
*/
|
|
3010
|
+
module?: string;
|
|
3011
|
+
};
|
|
2888
3012
|
/** The events this module sends the project's webhooks (x-palbase-events), by type: each one's payload, the event's data. */
|
|
2889
3013
|
export interface Events {
|
|
2890
3014
|
/**
|
|
@@ -2971,6 +3095,14 @@ export interface Events {
|
|
|
2971
3095
|
* 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
3096
|
*/
|
|
2973
3097
|
"stores.apple.session.ended": AppleSessionEndedEvent;
|
|
3098
|
+
/**
|
|
3099
|
+
* stores.apple.key.made: keys were made at Apple for another module of the environment (notify's APNs keys, purchases' In-App Purchase key), which takes them. Never a key.
|
|
3100
|
+
*/
|
|
3101
|
+
"stores.apple.key.made": AppleKeyMadeEvent;
|
|
3102
|
+
/**
|
|
3103
|
+
* stores.apple.key.revoked: a key Palbase made at Apple for the environment was revoked there. Never the key.
|
|
3104
|
+
*/
|
|
3105
|
+
"stores.apple.key.revoked": AppleKeyRevokedEvent;
|
|
2974
3106
|
}
|
|
2975
3107
|
/** Palbase Stores */
|
|
2976
3108
|
export declare function client(t: Transport): {
|
|
@@ -3914,5 +4046,39 @@ export declare function client(t: Transport): {
|
|
|
3914
4046
|
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
3915
4047
|
signal?: AbortSignal;
|
|
3916
4048
|
}): Promise<Reply<204, undefined>>;
|
|
4049
|
+
/**
|
|
4050
|
+
* Keys made at Apple
|
|
4051
|
+
*
|
|
4052
|
+
* The keys Palbase made at Apple for the environment with its Apple ID session (`POST /stores/apple/keys`), the newest first — never a key itself: its App Store Connect API key, its APNs keys (notify's) and its In-App Purchase key (purchases'), and where each stands.
|
|
4053
|
+
*/
|
|
4054
|
+
listMadeAppleKeys(input?: {
|
|
4055
|
+
signal?: AbortSignal;
|
|
4056
|
+
}): Promise<Reply<200, MadeKeys>>;
|
|
4057
|
+
/**
|
|
4058
|
+
* Make a key at Apple
|
|
4059
|
+
*
|
|
4060
|
+
* Makes one key at Apple with the Apple ID session the environment uses, and connects it: no one downloads a .p8. `asc` — the environment's App Store Connect API key (Admin, every app), connected as `POST /stores/connect` connects one (409 `key_connected` when one is). `apns` — two APNs keys, one for each APNs environment (Apple makes a key scoped to apps for one environment), scoped to the environment's iOS apps, which the notify module takes as its APNs provider. `iap` — an In-App Purchase key for one of its iOS apps (`bundle`, required with more than one), which the purchases module connects. A module that keeps a key the environment connected itself refuses the one made, and it is revoked at Apple. One a request (each well inside the edge's time); 409 `key_made` for a kind Palbase made already. The Apple ID must be an Admin or the Account Holder (409 `apple_role_insufficient`). An owner's or an admin's, or the project's secret key's (403 `admin_required` for a member); never an environment's token's (403 `token_out_of_scope`): a key outlives it. Emits `stores.apple.changed` (asc) or `stores.apple.key.made` (apns, iap).
|
|
4061
|
+
*/
|
|
4062
|
+
makeAppleKey(input: {
|
|
4063
|
+
headers?: {
|
|
4064
|
+
"Idempotency-Key"?: string;
|
|
4065
|
+
};
|
|
4066
|
+
body: MakeKeyRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
4067
|
+
signal?: AbortSignal;
|
|
4068
|
+
}): Promise<Reply<201, MadeKeys>>;
|
|
4069
|
+
/**
|
|
4070
|
+
* Revoke a key made at Apple
|
|
4071
|
+
*
|
|
4072
|
+
* Revokes at Apple an APNs or In-App Purchase key Palbase made for the environment: its module keeps it, and it no longer works. The App Store Connect key is revoked as it is disconnected (`DELETE /stores/apple`; 409 `key_connected` here). An owner's or an admin's, or the project's secret key's. Emits `stores.apple.key.revoked`.
|
|
4073
|
+
*/
|
|
4074
|
+
revokeMadeAppleKey(input: {
|
|
4075
|
+
path: {
|
|
4076
|
+
key_id: string;
|
|
4077
|
+
};
|
|
4078
|
+
headers?: {
|
|
4079
|
+
"Idempotency-Key"?: string;
|
|
4080
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
4081
|
+
signal?: AbortSignal;
|
|
4082
|
+
}): Promise<Reply<200, MadeKey>>;
|
|
3917
4083
|
};
|
|
3918
4084
|
export type Client = ReturnType<typeof client>;
|
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
|
|
3
|
+
import { type AuthEvent, type Session, type SessionEndReason, type SessionManager } from './session.js';
|
|
4
4
|
type A = typeof authModule;
|
|
5
5
|
export type User = authModule.User;
|
|
6
6
|
export type SignupRequest = authModule.SignupRequest;
|
|
@@ -62,6 +62,13 @@ export declare class Auth {
|
|
|
62
62
|
/** Removes a factor; the account's password confirms it. */
|
|
63
63
|
removeFactor: (id: string, currentPassword: string) => Promise<void>;
|
|
64
64
|
regenerateRecoveryCodes: () => Promise<authModule.MFARecoveryCodesResponse>;
|
|
65
|
+
/**
|
|
66
|
+
* Raises the signed-in session to aal2 with a code the authenticator app
|
|
67
|
+
* shows — what a route marked auth { aal: 'aal2' } asks for (401
|
|
68
|
+
* insufficient_user_authentication). The session holds the new token from
|
|
69
|
+
* here on; its refreshes stay at aal2.
|
|
70
|
+
*/
|
|
71
|
+
stepUp: (code: string) => Promise<Session>;
|
|
65
72
|
};
|
|
66
73
|
readonly passkey: {
|
|
67
74
|
/** Adds a passkey to the signed-in user. */
|
|
@@ -79,6 +86,8 @@ export declare class Auth {
|
|
|
79
86
|
* it (the sign-up answers no tokens). The identifier is the user's email.
|
|
80
87
|
*/
|
|
81
88
|
signUp: (identifier: string, userName?: string) => Promise<User>;
|
|
89
|
+
/** Raises the signed-in session to aal2 with one of the user's passkeys (as mfa.stepUp does with a code). */
|
|
90
|
+
stepUp: () => Promise<Session>;
|
|
82
91
|
list: () => Promise<authModule.WebAuthnCredentialList>;
|
|
83
92
|
remove: (id: string) => Promise<void>;
|
|
84
93
|
};
|
|
@@ -156,6 +165,7 @@ export declare class Auth {
|
|
|
156
165
|
}): Promise<User>;
|
|
157
166
|
/** Starts the session from a token pair; the user is the answer's, or read once when it carries none. */
|
|
158
167
|
private signedIn;
|
|
168
|
+
private steppedUp;
|
|
159
169
|
private authenticator;
|
|
160
170
|
}
|
|
161
171
|
type Json = Record<string, unknown>;
|
|
@@ -12,6 +12,7 @@ export type OfferView = purchasesModule.OfferView;
|
|
|
12
12
|
export type GrantInfo = purchasesModule.GrantInfo;
|
|
13
13
|
export type Redeemed = purchasesModule.Redeemed;
|
|
14
14
|
export type RedemptionLink = purchasesModule.RedemptionLink;
|
|
15
|
+
export type RefundDataConsent = purchasesModule.RefundDataConsent;
|
|
15
16
|
/** Where a checkout is opened: an app linking out to buy on the web says its platform and its store's storefront (ISO 3166-1 alpha-3: `USA`). */
|
|
16
17
|
export type CheckoutSource = purchasesModule.CheckoutSource;
|
|
17
18
|
/** Told what the customer has: on the first read, then each time it changes; null while no one is signed in. */
|
|
@@ -156,6 +157,16 @@ export declare class Purchases {
|
|
|
156
157
|
* grant, it is the same merge.
|
|
157
158
|
*/
|
|
158
159
|
merge(grant: MergeGrant | string): Promise<CustomerInfo>;
|
|
160
|
+
/**
|
|
161
|
+
* What the signed-in customer said, as the app asked them: whether, when
|
|
162
|
+
* they ask the App Store for a refund, Apple is told what they had of the
|
|
163
|
+
* purchase — whether it was given, whether a free trial came first, how
|
|
164
|
+
* much of a pack of credits was spent. With it, Palbase answers Apple's
|
|
165
|
+
* question within its 12 hours and states no preference of its own;
|
|
166
|
+
* without it — never asked, or false — Apple is told nothing. The latest
|
|
167
|
+
* word counts.
|
|
168
|
+
*/
|
|
169
|
+
setRefundDataConsent(consented: boolean): Promise<RefundDataConsent>;
|
|
159
170
|
/** Where this tab keeps a checkout's redemption key. */
|
|
160
171
|
private keyName;
|
|
161
172
|
/**
|