@atlasauth/backend 0.6.0 → 0.7.1
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/CHANGELOG.md +89 -0
- package/README.md +40 -0
- package/dist/client/api-keys.d.ts +100 -0
- package/dist/client/api-keys.js +15 -0
- package/dist/client/api-keys.js.map +1 -1
- package/dist/client/error.d.ts +8 -0
- package/dist/client/error.js +8 -0
- package/dist/client/error.js.map +1 -1
- package/dist/client/import-export.d.ts +2 -0
- package/dist/client/import-export.js.map +1 -1
- package/dist/client/index.d.ts +6 -1
- package/dist/client/messaging.d.ts +10 -1
- package/dist/client/messaging.js +13 -2
- package/dist/client/messaging.js.map +1 -1
- package/dist/client/platform.d.ts +2 -2
- package/dist/client/sessions.d.ts +16 -0
- package/dist/client/sessions.js +10 -0
- package/dist/client/sessions.js.map +1 -1
- package/dist/client/users.d.ts +5 -0
- package/dist/client/users.js.map +1 -1
- package/package.json +5 -4
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# @atlasauth/backend changelog
|
|
2
|
+
|
|
3
|
+
## 0.7.1
|
|
4
|
+
- **Email provider removal.** `messaging.deleteChannel(channel, options?)` accepts `{ force?: boolean }` (sent as `?force=true`). Removing the email provider is refused with `409 EMAIL_PROVIDER_IN_USE` while email-dependent features are on and nothing else would deliver for the instance; `meta.features` names them.
|
|
5
|
+
- **Error codes.** `AtlasErrorCodes` adds `EMAIL_PROVIDER_IN_USE`.
|
|
6
|
+
- **Compatible.** The new argument is optional; no signatures changed.
|
|
7
|
+
|
|
8
|
+
## 0.7.0
|
|
9
|
+
- **API key spend caps.** `apiKeys.create` and `apiKeys.update` accept `limits` (`ApiKeyLimit[]`: `{ unit, amount, period: 'request' | 'day' | 'month' | 'total' }`, or `null` to clear). `ApiKey` gains `limits` and `usage` (`ApiKeyLimitState[]`: `{ unit, period, amount, used, remaining, window_start, resets_at }`).
|
|
10
|
+
- **Usage metering.** `apiKeys.recordUsage(id, { amount, unit, idempotency_key? })` returns `ApiKeyUsageDebit` (`key_id`, `unit`, `amount`, `allowed`, `code`, `exceeded`, `usage`, `counters`, `idempotent_replay`); a refusal resolves with `allowed: false`. `apiKeys.getUsage(id)` returns `ApiKeyUsage` (`key_id`, `limits`, `usage`, `counters`). New types: `ApiKeyLimit`, `ApiKeyLimitPeriod`, `ApiKeyLimitState`, `ApiKeyUsageCounter`, `RecordApiKeyUsageBody`, `ApiKeyUsageDebit`, `ApiKeyUsage`.
|
|
11
|
+
- **Verify.** A valid `ApiKeyVerification` gains `name`, `scopes`, `constraints`, `limits`, `usage` and `expires_at`.
|
|
12
|
+
- **Session keep-alive.** `sessions.touch(id)` returns `TouchedSession` (the session plus `extended`). `Session` gains `idle_expires_at`.
|
|
13
|
+
- **Users.** `CreateUserBody` and `ImportUsersBody` accept `notify` (boolean; `false`, the default, sends nothing to the user).
|
|
14
|
+
- **Error codes.** `AtlasErrorCodes` adds `LIMIT_EXCEEDED`, `SESSION_REVOKED`, `SESSION_IDLE_EXPIRED` and `SESSION_EXPIRED`.
|
|
15
|
+
- **Docs.** `AtlasIdAppCopy.sign_in_title` / `sign_up_title` comments state the current defaults ("Sign in", "Create your Atlas Account"); no type change.
|
|
16
|
+
- **Compatible.** New fields are optional on existing types; no signatures changed.
|
|
17
|
+
|
|
18
|
+
## 0.6.0
|
|
19
|
+
- **Full Backend API and Platform API coverage.** Every secret-key and platform-key operation in the public API reference now has a typed method.
|
|
20
|
+
- **Platform client.** `createAtlasPlatformClient({ platformKey })` manages apps and their instances (create, update, archive, transfer, claim, rotate secrets, list secret keys), accountless apps, Sign in with Atlas apps (`atlasIdApps`, including logout URIs, branding and design preview), and platform design images.
|
|
21
|
+
- **Design.** `design` reads, replaces and patches the sign-in page design for the instance and for each organization, previews unsaved designs, uploads, lists and deletes design images, and reads the catalog. The design object is fully typed (`AtlasDesign`, `AtlasDesignPatch`).
|
|
22
|
+
- **Raw uploads.** Image uploads send the raw bytes with their content type (`Blob`, `ArrayBuffer` or typed array).
|
|
23
|
+
- **Strict request bodies.** `createAtlasClient({ strict: true })` sends `Atlas-Strict: true` on every write, so an unknown body field is refused with `422 UNKNOWN_FIELD`. Use `client.withOptions({ strict })` to override it for some calls. `onUnknownFields` reports fields Atlas ignored (the `Atlas-Unknown-Fields` header).
|
|
24
|
+
- **Back-channel logout.** `LogoutTokenVerifier` / `verifyLogoutToken` / `AtlasBackend#verifyLogoutToken` verify an OIDC back-channel `logout_token`, and `memoryLogoutReplayStore()` refuses a replayed `jti`.
|
|
25
|
+
- **Instance setup.** `instance.preflight()` lists configuration problems with fixes, and `instance.cookieConsent` reads, sets and removes the hosted pages' cookie-consent banner.
|
|
26
|
+
- **OAuth providers.** `list({ provider, configured })` filters the list. Upsert accepts `display_name`, `icon_url`, `mode`, wallet settings, and `null` setting values that clear a setting. Responses include `icon_url`, `mode` and `setting_values`.
|
|
27
|
+
- **OAuth clients.** `OAuthClient` includes the logout registration (`post_logout_redirect_uris`, `backchannel_logout_uri`, `backchannel_logout_session_required`, `frontchannel_logout_uri`, `frontchannel_logout_session_required`). `oauthClients.create` and `update` accept these fields; on update, `null` clears a URI and `[]` clears the post-logout list.
|
|
28
|
+
- **Webhooks.** Endpoints can be updated. You can reveal or rotate an endpoint's secret, send a test event, and redeliver a past delivery.
|
|
29
|
+
- **New namespaces.** `entitlementOverrides`, `orgLdapConnections`, `organizationSettingsSchema`, `emailAddresses`, `openfga`, `connectors`, `notifications`, `auditEvents`, `events`, `usage`, `configChangelog`, `pca`, `mcp`, `mcpConnector`, `legacyAuthConnection`, `redirectUrls`, `sessionExchangeApps`, `tickets`, `testMode`, `diagnostics`.
|
|
30
|
+
- **Organizations.** The policy is fully typed, with room for extra keys. Organizations gain `settings`, `auditStreams`, `branding`, `endUsers` and `readerDomain`.
|
|
31
|
+
- **Users.** Added `byEmails`, `resolved`, `state`, `signInHistory`, `listOrganizationMemberships`, `setPassword`, `deleteProfileImage`, `deletePasskey`, identity import and removal, erasure export and acknowledgements, graceful `deletion`, `directives`, `consents`, `approvalRequests`, `notificationPreferences`, `phoneNumbers` and `progression`.
|
|
32
|
+
- **Other additions.**
|
|
33
|
+
- `sessions.getToken(id, template)`
|
|
34
|
+
- Billing: `importSubscription`, `reportUsage`, `syncSeats`
|
|
35
|
+
- `dataSubjectRequests.create` and `.cancel`
|
|
36
|
+
- `invitations.bulkCreate`
|
|
37
|
+
- Waitlist: `create`, `bulkCreate`, `delete`
|
|
38
|
+
- `oauthClients.import`
|
|
39
|
+
- `signInTokens.revoke` (deprecated)
|
|
40
|
+
- **Error codes.** `AtlasErrorCodes` names the stable codes worth branching on, such as `EMAIL_DELIVERY_NOT_CONFIGURED`, `UNKNOWN_FIELD`, `WRONG_KEY_SURFACE` and `INVALID_KEY`.
|
|
41
|
+
- **Compatible.** Existing methods keep their signatures. A few response types widen to match the server: `webhooks.endpoints.list` and `deliveries` now type `has_more` as `boolean`, and `oauthProviders.upsert` types `configured` as `boolean`. `AtlasClient` is now an interface, with the same members plus `withOptions`.
|
|
42
|
+
|
|
43
|
+
## 0.5.0
|
|
44
|
+
- **`jwksUrl` is optional.** `new AtlasBackend({ issuer })` now discovers the JWKS URL from `${issuer}/.well-known/openid-configuration`. The discovered URL is cached for the JWKS TTL (an hour), a failing discovery endpoint is retried at most once a minute, and the last good URL keeps serving through a discovery outage. The document's `issuer` must equal your configured `issuer` and its `jwks_uri` must be https, or nothing is fetched from it.
|
|
45
|
+
- **Instances on the shared host** (no frontend API domain of their own) carry the shared issuer in their tokens, and the shared host's root discovery document is not theirs. Pass `instanceId` (or `publishableKey`, from which the instance id is read) so discovery uses the per-instance document instead.
|
|
46
|
+
- When keys cannot be obtained, `verify()` returns `{ ok: false, reason: 'no_keys', detail }` with `detail` saying why (e.g. the discovery URL and HTTP status).
|
|
47
|
+
- **Compatible.** `jwksUrl` and `jwks` work exactly as before; passing both still throws. New exports: `JwksDiscovery`, `DiscoveryError`, `discoveryUrlFor`, `instanceIdFromPublishableKey`.
|
|
48
|
+
|
|
49
|
+
## 0.4.0
|
|
50
|
+
- **Typed messaging provider config.** `messaging.setEmail` / `messaging.setSms` now take a body discriminated by `transport` (`EmailProviderInput` / `SmsProviderInput`), with the exact `config` keys each provider accepts — Resend, SES, SMTP, Brevo, Mailgun; Twilio, Vonage, MessageBird, Plivo, Telnyx, Sinch, Infobip, ClickSend, Bandwidth, AWS SNS. A typo or another provider's key now fails to compile, matching the API, which refuses unknown keys with a 422.
|
|
51
|
+
- Required keys are documented per field ("Required on first setup"). `EmailProviderSetup` / `SmsProviderSetup` require them at the type level — use them with `satisfies` for a first setup. On an update of the same transport, every key is optional: an omitted key, including a stored secret, keeps its value.
|
|
52
|
+
- Responses are typed per transport (`EmailProvider` / `SmsProvider`). Secret keys never appear in `config`; `secrets_set` lists exactly that transport's secret keys.
|
|
53
|
+
- **Compatible.** The old untyped `MessagingProviderInput` (`transport: string`, `config: Record<string, unknown>`) still compiles through a `@deprecated` overload.
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
## 0.3.0
|
|
57
|
+
- **Machines.** New `machines` namespace: `list` (filter by owner, organization or metadata, cursor-paginated), `create` (returns the secret once), `get`, `rename`, `patchMetadata`, `approve`, `revoke`, `rotateSecret`, `rotateKey`, `delete` and `organizationMemberships`. Enrolment tokens: `createEnrolmentToken`, `listEnrolmentTokens`, `deleteEnrolmentToken`. `verifyM2mToken(token)` checks a machine token and resolves to `{ valid: false }` on any failure. New types include `Machine`, `MachineWithSecret`, `MachineEnrolmentToken` and `M2mTokenVerification`.
|
|
58
|
+
- **API keys.** `apiKeys.mintToken({ secret, ... })` exchanges an API key secret for a short-lived signed token (`ApiKeyToken`), and `apiKeys.listRevoked({ since, limit })` pages through revoked keys (`RevokedApiKeyRef`).
|
|
59
|
+
|
|
60
|
+
## 0.2.0
|
|
61
|
+
- **CAPTCHA verification.** New `captcha.verify(token, { action, remote_ip })` checks a CAPTCHA token server-side against the provider configured for the instance (or for the named action), so your server never holds the CAPTCHA secret. Returns a `CaptchaVerification` (`success`, `action`, `provider`).
|
|
62
|
+
|
|
63
|
+
## 0.1.7
|
|
64
|
+
- **Metadata.** Added `repository` (monorepo + package directory), `homepage`, and `bugs` so the npm page links back to source.
|
|
65
|
+
|
|
66
|
+
## 0.1.6
|
|
67
|
+
- **Optional `audience` verification.** `verifySessionToken(..., { audience })` now enforces the session token's `aud` claim when you pass an expected audience (string or array); omit it and verification is unchanged. Pairs with Atlas sessions now carrying `aud` (the instance id) and `azp`. Backwards compatible.
|
|
68
|
+
|
|
69
|
+
## 0.1.5
|
|
70
|
+
- **Fixed: default Backend API host.** `DEFAULT_API_URL` (the `apiUrl` used when you don't pass one) is now `https://api.atlasauth.net`. The previous default did not resolve, so clients without an explicit `apiUrl` could not reach the API.
|
|
71
|
+
|
|
72
|
+
## 0.1.4
|
|
73
|
+
- **OAuth callback forwarding.** `AtlasBackend#oauthCallbackForwardUrl(provider, incoming)` builds Atlas's OAuth callback URL from your configured issuer, so an app that keeps its own registered callback can forward to Atlas in one line (`res.redirect(302, atlas.oauthCallbackForwardUrl('github', req.url))`). It accepts `req.url`, a full URL, a query string, a parsed query object or `URLSearchParams`, keeps only the OAuth callback parameters (`code`, `state`, `error`, ...), and rejects provider keys that are not a plain slug.
|
|
74
|
+
|
|
75
|
+
## 0.1.3
|
|
76
|
+
- **Offline verification for tests and CI.** `AtlasBackend` accepts a static `jwks` instead of `jwksUrl` (pass exactly one); with `jwks` it never fetches keys. All other checks are unchanged.
|
|
77
|
+
- New `createTestIssuer()` returns `{ issuer, jwks, kid, mintSession(claims?) }`, so tests can mint session tokens and verify them with no network. New types `TestIssuer`, `CreateTestIssuerOptions`.
|
|
78
|
+
|
|
79
|
+
## 0.1.2
|
|
80
|
+
- **Webhook verification.** New `verifyWebhook({ body, headers, secret })` verifies an incoming Atlas webhook (HMAC-SHA256 signature over the raw body, constant-time compare, 5-minute replay window by default, override with `toleranceMs`). It never throws on a bad signature: it returns `{ verified, reason?, event? }`, with `reason` one of `missing_headers`, `malformed_signature`, `stale_timestamp` or `signature_mismatch`. Also exports `ATLAS_WEBHOOK_HEADERS` (`atlas-id`, `atlas-timestamp`, `atlas-signature`) and the `WebhookVerifyResult` / `VerifyWebhookInput` types.
|
|
81
|
+
|
|
82
|
+
## 0.1.1
|
|
83
|
+
- First published release.
|
|
84
|
+
- **Session verification.** `AtlasBackend` verifies Atlas session JWTs locally against a cached JWKS (`verify()`, `verifyOnline()`, `authenticateRequest()`), checking signature, issuer and expiry, with an optional `authorizedParties` allowlist for the `azp` claim. `SessionClaims` carries roles, permissions, active plan and features, and an `actor` claim on impersonation sessions.
|
|
85
|
+
- **Authorization helpers.** `has()`, `protect()`, `hasRole()` and `hasPermission()` check roles, permissions, `plan` and `feature` against verified claims.
|
|
86
|
+
- **Cross-domain sign-in handshake.** `redeemHandshake()`, `readHandshakeParams()` and `createPkcePair()` let a satellite domain exchange a PKCE-bound handshake nonce for a first-party session, without a token in the URL.
|
|
87
|
+
- **Backend API client.** `createAtlasClient({ secretKey, apiUrl? })` is a typed client for the secret-key Backend API, with namespaces for users, sessions (including minting a session with `sessions.create`), organizations, roles and permissions, invitations, OAuth clients and providers, SSO and SCIM, domains, allowlist / blocklist / waitlist, webhooks, API keys, JWT templates, fine-grained authorization (`fga`), attack protection, branding, email and SMS templates, billing, messaging, import / export, data subject requests, audit logs and instance settings.
|
|
88
|
+
- `users.connectExternalAccount()` links a new sign-in provider to an existing user from your server.
|
|
89
|
+
- Errors are thrown as `AtlasApiError`; `paginate()` and `collect()` walk paginated lists.
|
package/README.md
CHANGED
|
@@ -80,6 +80,46 @@ await atlas.design.organizations.update('org_123', { palette: { primary: null }
|
|
|
80
80
|
|
|
81
81
|
Uploads send the raw image bytes with their content type. A `Blob` brings its own type.
|
|
82
82
|
|
|
83
|
+
### API key spend caps
|
|
84
|
+
|
|
85
|
+
Give an end-user API key caps per unit and period (`request`, `day`, `month` or `total`), then meter what each call costs. A debit that would exceed a cap is refused without recording anything; it resolves with `allowed: false` rather than throwing.
|
|
86
|
+
|
|
87
|
+
```ts
|
|
88
|
+
const key = await atlas.apiKeys.create({
|
|
89
|
+
subject_type: 'user',
|
|
90
|
+
subject_id: 'user_123',
|
|
91
|
+
limits: [
|
|
92
|
+
{ unit: 'requests', amount: 1000, period: 'day' },
|
|
93
|
+
{ unit: 'usd_cents', amount: 5000, period: 'month' },
|
|
94
|
+
],
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
const debit = await atlas.apiKeys.recordUsage(key.id, {
|
|
98
|
+
unit: 'usd_cents',
|
|
99
|
+
amount: 12,
|
|
100
|
+
idempotency_key: 'req_8f2c', // a retry returns the first outcome without counting again
|
|
101
|
+
});
|
|
102
|
+
if (!debit.allowed) {
|
|
103
|
+
// debit.code === 'LIMIT_EXCEEDED'; debit.exceeded lists the caps that refused it
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
const { usage } = await atlas.apiKeys.getUsage(key.id); // used / remaining / resets_at per cap
|
|
107
|
+
await atlas.apiKeys.update(key.id, { limits: null }); // remove the caps
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
`apiKeys.verify(secret)` also returns the key's `name`, `scopes`, `constraints`, `limits` and current `usage`.
|
|
111
|
+
|
|
112
|
+
### Session keep-alive
|
|
113
|
+
|
|
114
|
+
If your app loads the Atlas frontend SDK only on some pages, time spent on the other pages can count as inactivity. Touch the session from your backend to slide its inactivity window:
|
|
115
|
+
|
|
116
|
+
```ts
|
|
117
|
+
const s = await atlas.sessions.touch(sessionId);
|
|
118
|
+
// s.idle_expires_at is the new inactivity deadline; s.extended is false when a touch in the last minute already did it
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
A touch never extends past the session's absolute expiry and never revives an ended session (`409 SESSION_REVOKED`, `SESSION_IDLE_EXPIRED` or `SESSION_EXPIRED`). It writes at most once a minute, so calling it on every request is safe.
|
|
122
|
+
|
|
83
123
|
### Strict request bodies
|
|
84
124
|
|
|
85
125
|
By default Atlas ignores a body field an endpoint does not accept. It lists the ignored fields in the `Atlas-Unknown-Fields` response header.
|
|
@@ -16,11 +16,88 @@ export interface ApiKey {
|
|
|
16
16
|
/** Enough to tell two keys apart in a listing; not enough to use one. */
|
|
17
17
|
prefix: string;
|
|
18
18
|
claims: Record<string, unknown>;
|
|
19
|
+
/** Per-key spend caps, or `null` when the key has none. */
|
|
20
|
+
limits?: ApiKeyLimit[] | null;
|
|
21
|
+
/** Each cap with its current-window usage (empty when the key has no caps). */
|
|
22
|
+
usage?: ApiKeyLimitState[];
|
|
19
23
|
last_used_at: number | null;
|
|
20
24
|
expires_at: number | null;
|
|
21
25
|
revoked_at: number | null;
|
|
22
26
|
created_at: number;
|
|
23
27
|
}
|
|
28
|
+
/** The window a spend cap counts over. `request` caps a single debit; `day`/`month` are UTC calendar windows; `total` never resets. */
|
|
29
|
+
export type ApiKeyLimitPeriod = 'request' | 'day' | 'month' | 'total';
|
|
30
|
+
/** A per-key spend cap, metered with {@link apiKeysResource} `recordUsage`. */
|
|
31
|
+
export interface ApiKeyLimit {
|
|
32
|
+
/** App-defined unit, e.g. `"requests"` or `"usd_cents"`. */
|
|
33
|
+
unit: string;
|
|
34
|
+
/** The cap, in `unit`. */
|
|
35
|
+
amount: number;
|
|
36
|
+
period: ApiKeyLimitPeriod;
|
|
37
|
+
}
|
|
38
|
+
/** A spend cap with its current-window usage. */
|
|
39
|
+
export interface ApiKeyLimitState {
|
|
40
|
+
unit: string;
|
|
41
|
+
period: ApiKeyLimitPeriod;
|
|
42
|
+
amount: number;
|
|
43
|
+
/** Used in the current window (always 0 for a per-request cap). */
|
|
44
|
+
used: number;
|
|
45
|
+
/** `amount - used`, never below 0 (the cap itself for a per-request cap). */
|
|
46
|
+
remaining: number;
|
|
47
|
+
/** Epoch ms the current window started; null for a per-request cap. */
|
|
48
|
+
window_start: number | null;
|
|
49
|
+
/** Epoch ms the current window ends; null for per-request and total caps. */
|
|
50
|
+
resets_at: number | null;
|
|
51
|
+
}
|
|
52
|
+
/** A raw usage counter for one unit in its current window. */
|
|
53
|
+
export interface ApiKeyUsageCounter {
|
|
54
|
+
unit: string;
|
|
55
|
+
period: 'day' | 'month' | 'total';
|
|
56
|
+
used: number;
|
|
57
|
+
window_start: number;
|
|
58
|
+
/** Epoch ms the window ends; null for `total`. */
|
|
59
|
+
resets_at: number | null;
|
|
60
|
+
}
|
|
61
|
+
/** Body of `POST /v1/api_keys/{id}/usage`. */
|
|
62
|
+
export interface RecordApiKeyUsageBody {
|
|
63
|
+
/** How much to debit, in `unit` (a positive integer). */
|
|
64
|
+
amount: number;
|
|
65
|
+
/** The unit to debit, matching the unit of the caps it should count against. */
|
|
66
|
+
unit: string;
|
|
67
|
+
/** Retry-safe key: the same value returns the first outcome without counting again (kept 24 hours). */
|
|
68
|
+
idempotency_key?: string;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* The outcome of a usage debit. A refusal is NOT an error: it resolves with
|
|
72
|
+
* `allowed: false` and `code: 'LIMIT_EXCEEDED'`, and nothing was recorded.
|
|
73
|
+
*/
|
|
74
|
+
export interface ApiKeyUsageDebit {
|
|
75
|
+
object: 'api_key_usage_debit';
|
|
76
|
+
key_id: string;
|
|
77
|
+
unit: string;
|
|
78
|
+
amount: number;
|
|
79
|
+
/** true when the debit was recorded; false when it would exceed a cap. */
|
|
80
|
+
allowed: boolean;
|
|
81
|
+
/** Present only when `allowed` is false. */
|
|
82
|
+
code?: 'LIMIT_EXCEEDED';
|
|
83
|
+
/** The caps that refused the debit (empty when allowed). */
|
|
84
|
+
exceeded: ApiKeyLimitState[];
|
|
85
|
+
/** Every cap on the key after this call. */
|
|
86
|
+
usage: ApiKeyLimitState[];
|
|
87
|
+
/** The debited unit's day, month and total counters after this call. */
|
|
88
|
+
counters: ApiKeyUsageCounter[];
|
|
89
|
+
/** true when this is the stored outcome of an earlier call with the same idempotency key. */
|
|
90
|
+
idempotent_replay: boolean;
|
|
91
|
+
}
|
|
92
|
+
/** A key's current-window usage (`GET /v1/api_keys/{id}/usage`). */
|
|
93
|
+
export interface ApiKeyUsage {
|
|
94
|
+
object: 'api_key_usage';
|
|
95
|
+
key_id: string;
|
|
96
|
+
limits: ApiKeyLimit[] | null;
|
|
97
|
+
usage: ApiKeyLimitState[];
|
|
98
|
+
/** Current-window counters for every unit the key has been debited in, capped or not. */
|
|
99
|
+
counters: ApiKeyUsageCounter[];
|
|
100
|
+
}
|
|
24
101
|
/** The mint response: the key plus its secret, revealed exactly once. */
|
|
25
102
|
export interface ApiKeyWithSecret extends ApiKey {
|
|
26
103
|
secret: string;
|
|
@@ -33,11 +110,15 @@ export interface CreateApiKeyBody {
|
|
|
33
110
|
claims?: Record<string, unknown>;
|
|
34
111
|
/** Epoch ms; null (or omitted) never expires. */
|
|
35
112
|
expires_at?: number | null;
|
|
113
|
+
/** Per-key spend caps, metered with `recordUsage`. */
|
|
114
|
+
limits?: ApiKeyLimit[] | null;
|
|
36
115
|
}
|
|
37
116
|
export interface UpdateApiKeyBody {
|
|
38
117
|
name?: string | null;
|
|
39
118
|
claims?: Record<string, unknown>;
|
|
40
119
|
expires_at?: number | null;
|
|
120
|
+
/** Replace the spend caps; `null` clears them (counters are kept). */
|
|
121
|
+
limits?: ApiKeyLimit[] | null;
|
|
41
122
|
}
|
|
42
123
|
/**
|
|
43
124
|
* The verify verdict. Every negative — unknown, malformed, revoked, expired, or a
|
|
@@ -53,8 +134,16 @@ export type ApiKeyVerification = {
|
|
|
53
134
|
id: string;
|
|
54
135
|
subject_type: ApiKeySubjectType;
|
|
55
136
|
subject_id: string;
|
|
137
|
+
name?: string | null;
|
|
56
138
|
claims: Record<string, unknown>;
|
|
139
|
+
scopes?: string[] | null;
|
|
140
|
+
constraints?: Record<string, unknown>;
|
|
141
|
+
/** The key's spend caps (null when none). */
|
|
142
|
+
limits?: ApiKeyLimit[] | null;
|
|
143
|
+
/** Each cap with its current-window usage. */
|
|
144
|
+
usage?: ApiKeyLimitState[];
|
|
57
145
|
last_used_at: number | null;
|
|
146
|
+
expires_at?: number | null;
|
|
58
147
|
};
|
|
59
148
|
/**
|
|
60
149
|
* §P1-8 a short-lived, offline-verifiable access JWT minted from a long-lived
|
|
@@ -113,6 +202,17 @@ export declare function apiKeysResource(request: RequestFn): {
|
|
|
113
202
|
id: string;
|
|
114
203
|
revoked: true;
|
|
115
204
|
}>;
|
|
205
|
+
/**
|
|
206
|
+
* Meter usage against a key's spend caps, atomically. When the debit fits
|
|
207
|
+
* every cap for `unit` it is recorded and `allowed` is true; when it would
|
|
208
|
+
* exceed one, nothing is recorded and the call resolves (it does not throw)
|
|
209
|
+
* with `allowed: false` and `code: 'LIMIT_EXCEEDED'`. Reusing an
|
|
210
|
+
* `idempotency_key` with a different unit or amount is a 409
|
|
211
|
+
* `IDEMPOTENCY_CONFLICT`; a revoked or expired key is a 409 `CONFLICT`.
|
|
212
|
+
*/
|
|
213
|
+
recordUsage(id: string, body: RecordApiKeyUsageBody): Promise<ApiKeyUsageDebit>;
|
|
214
|
+
/** A key's current-window usage: each cap's state plus every unit's counters. */
|
|
215
|
+
getUsage(id: string): Promise<ApiKeyUsage>;
|
|
116
216
|
/**
|
|
117
217
|
* §P1-8 mint a short-lived delegated token from an `ak_` key. Rate-limited —
|
|
118
218
|
* presenting the secret is the same online credential surface as verify.
|
package/dist/client/api-keys.js
CHANGED
|
@@ -26,6 +26,21 @@ function apiKeysResource(request) {
|
|
|
26
26
|
delete(id) {
|
|
27
27
|
return request({ method: 'DELETE', path: `/v1/api_keys/${(0, request_1.enc)(id)}` });
|
|
28
28
|
},
|
|
29
|
+
/**
|
|
30
|
+
* Meter usage against a key's spend caps, atomically. When the debit fits
|
|
31
|
+
* every cap for `unit` it is recorded and `allowed` is true; when it would
|
|
32
|
+
* exceed one, nothing is recorded and the call resolves (it does not throw)
|
|
33
|
+
* with `allowed: false` and `code: 'LIMIT_EXCEEDED'`. Reusing an
|
|
34
|
+
* `idempotency_key` with a different unit or amount is a 409
|
|
35
|
+
* `IDEMPOTENCY_CONFLICT`; a revoked or expired key is a 409 `CONFLICT`.
|
|
36
|
+
*/
|
|
37
|
+
recordUsage(id, body) {
|
|
38
|
+
return request({ method: 'POST', path: `/v1/api_keys/${(0, request_1.enc)(id)}/usage`, body });
|
|
39
|
+
},
|
|
40
|
+
/** A key's current-window usage: each cap's state plus every unit's counters. */
|
|
41
|
+
getUsage(id) {
|
|
42
|
+
return request({ method: 'GET', path: `/v1/api_keys/${(0, request_1.enc)(id)}/usage` });
|
|
43
|
+
},
|
|
29
44
|
/**
|
|
30
45
|
* §P1-8 mint a short-lived delegated token from an `ak_` key. Rate-limited —
|
|
31
46
|
* presenting the secret is the same online credential surface as verify.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-keys.js","sourceRoot":"","sources":["../../src/client/api-keys.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"api-keys.js","sourceRoot":"","sources":["../../src/client/api-keys.ts"],"names":[],"mappings":";;AA2MA,0CAyDC;AApQD,uCAAgD;AA2MhD,SAAgB,eAAe,CAAC,OAAkB;IAChD,OAAO;QACL,0CAA0C;QAC1C,IAAI,CAAC,KAGJ;YACC,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,CAAC,CAAC;QACjE,CAAC;QACD,qDAAqD;QACrD,MAAM,CAAC,IAAsB,EAAE,cAAuB;YACpD,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC,CAAC;QACjF,CAAC;QACD,iFAAiF;QACjF,MAAM,CAAC,MAAc;YACnB,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,qBAAqB,EAAE,IAAI,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC;QACpF,CAAC;QACD,GAAG,CAAC,EAAU;YACZ,OAAO,OAAO,CAAC,EAAE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CAAC"}
|
package/dist/client/error.d.ts
CHANGED
|
@@ -39,6 +39,8 @@ export declare const AtlasErrorCodes: {
|
|
|
39
39
|
readonly EMAIL_DELIVERY_NOT_CONFIGURED: "EMAIL_DELIVERY_NOT_CONFIGURED";
|
|
40
40
|
/** This setting needs your own email provider configured first. */
|
|
41
41
|
readonly EMAIL_PROVIDER_REQUIRED: "EMAIL_PROVIDER_REQUIRED";
|
|
42
|
+
/** The email provider can't be removed while email-dependent features need it (`meta.features`). */
|
|
43
|
+
readonly EMAIL_PROVIDER_IN_USE: "EMAIL_PROVIDER_IN_USE";
|
|
42
44
|
/** Strict mode: the body had a field this endpoint does not accept (`param` names it). */
|
|
43
45
|
readonly UNKNOWN_FIELD: "UNKNOWN_FIELD";
|
|
44
46
|
/** The billing plan still has subscribers and cannot be removed. */
|
|
@@ -50,7 +52,13 @@ export declare const AtlasErrorCodes: {
|
|
|
50
52
|
readonly NOT_FOUND: "NOT_FOUND";
|
|
51
53
|
readonly VALIDATION_FAILED: "VALIDATION_FAILED";
|
|
52
54
|
readonly RATE_LIMITED: "RATE_LIMITED";
|
|
55
|
+
/** An idempotency key was reused with a different request (e.g. another unit or amount). */
|
|
53
56
|
readonly IDEMPOTENCY_CONFLICT: "IDEMPOTENCY_CONFLICT";
|
|
57
|
+
/** A usage debit would exceed an API key's spend cap (`allowed: false` on the debit). */
|
|
58
|
+
readonly LIMIT_EXCEEDED: "LIMIT_EXCEEDED";
|
|
59
|
+
readonly SESSION_REVOKED: "SESSION_REVOKED";
|
|
60
|
+
readonly SESSION_IDLE_EXPIRED: "SESSION_IDLE_EXPIRED";
|
|
61
|
+
readonly SESSION_EXPIRED: "SESSION_EXPIRED";
|
|
54
62
|
readonly SCOPE_MISSING: "SCOPE_MISSING";
|
|
55
63
|
readonly FORBIDDEN: "FORBIDDEN";
|
|
56
64
|
readonly CONFLICT: "CONFLICT";
|
package/dist/client/error.js
CHANGED
|
@@ -35,6 +35,8 @@ exports.AtlasErrorCodes = {
|
|
|
35
35
|
EMAIL_DELIVERY_NOT_CONFIGURED: 'EMAIL_DELIVERY_NOT_CONFIGURED',
|
|
36
36
|
/** This setting needs your own email provider configured first. */
|
|
37
37
|
EMAIL_PROVIDER_REQUIRED: 'EMAIL_PROVIDER_REQUIRED',
|
|
38
|
+
/** The email provider can't be removed while email-dependent features need it (`meta.features`). */
|
|
39
|
+
EMAIL_PROVIDER_IN_USE: 'EMAIL_PROVIDER_IN_USE',
|
|
38
40
|
/** Strict mode: the body had a field this endpoint does not accept (`param` names it). */
|
|
39
41
|
UNKNOWN_FIELD: 'UNKNOWN_FIELD',
|
|
40
42
|
/** The billing plan still has subscribers and cannot be removed. */
|
|
@@ -46,7 +48,13 @@ exports.AtlasErrorCodes = {
|
|
|
46
48
|
NOT_FOUND: 'NOT_FOUND',
|
|
47
49
|
VALIDATION_FAILED: 'VALIDATION_FAILED',
|
|
48
50
|
RATE_LIMITED: 'RATE_LIMITED',
|
|
51
|
+
/** An idempotency key was reused with a different request (e.g. another unit or amount). */
|
|
49
52
|
IDEMPOTENCY_CONFLICT: 'IDEMPOTENCY_CONFLICT',
|
|
53
|
+
/** A usage debit would exceed an API key's spend cap (`allowed: false` on the debit). */
|
|
54
|
+
LIMIT_EXCEEDED: 'LIMIT_EXCEEDED',
|
|
55
|
+
SESSION_REVOKED: 'SESSION_REVOKED',
|
|
56
|
+
SESSION_IDLE_EXPIRED: 'SESSION_IDLE_EXPIRED',
|
|
57
|
+
SESSION_EXPIRED: 'SESSION_EXPIRED',
|
|
50
58
|
SCOPE_MISSING: 'SCOPE_MISSING',
|
|
51
59
|
FORBIDDEN: 'FORBIDDEN',
|
|
52
60
|
CONFLICT: 'CONFLICT',
|
package/dist/client/error.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.js","sourceRoot":"","sources":["../../src/client/error.ts"],"names":[],"mappings":";;;AAoBA,MAAa,aAAc,SAAQ,KAAK;IACpB,IAAI,GAAG,eAAe,CAAC;I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IAC5B,4FAA4F;IAC5F,oBAAoB,EAAE,sBAAsB;IAC5C,yFAAyF;IACzF,cAAc,EAAE,gBAAgB;IAChC,eAAe,EAAE,iBAAiB;IAClC,oBAAoB,EAAE,sBAAsB;IAC5C,eAAe,EAAE,iBAAiB;IAClC,aAAa,EAAE,eAAe;IAC9B,SAAS,EAAE,WAAW;IACtB,QAAQ,EAAE,UAAU;CACZ,CAAC"}
|
|
@@ -74,6 +74,8 @@ export interface ImportUsersBody {
|
|
|
74
74
|
users: ImportUserRow[];
|
|
75
75
|
/** Update an existing user matched by verified email instead of skipping it. */
|
|
76
76
|
upsert?: boolean;
|
|
77
|
+
/** Whether the import may notify the imported users. Defaults to false: nothing is sent. */
|
|
78
|
+
notify?: boolean;
|
|
77
79
|
}
|
|
78
80
|
export declare function importExportResource(request: RequestFn): {
|
|
79
81
|
/** Import users through the same per-row path sign-up uses. Deduped by verified email. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"import-export.js","sourceRoot":"","sources":["../../src/client/import-export.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"import-export.js","sourceRoot":"","sources":["../../src/client/import-export.ts"],"names":[],"mappings":";;AAqFA,oDAsBC;AA3GD,uCAAgD;AAqFhD,SAAgB,oBAAoB,CAAC,OAAkB;IACrD,OAAO;QACL,0FAA0F;QAC1F,WAAW,CAAC,IAAqB,EAAE,cAAuB;YACxD,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAkB,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC,CAAC;QACrF,CAAC;QACD,iFAAiF;QACjF,WAAW,CAAC,cAAuB;YACjC,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAkB,EAAE,cAAc,EAAE,CAAC,CAAC;QAC/E,CAAC;QACD,4DAA4D;QAC5D,QAAQ,CAAC,SAAuB,EAAE;YAChC,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,EAAE,GAAG,MAAM,EAAE,EAAE,CAAC,CAAC;QAC5E,CAAC;QACD,MAAM,CAAC,EAAU;YACf,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,YAAY,IAAA,aAAG,EAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QACjE,CAAC;QACD,mDAAmD;QACnD,YAAY,CAAC,EAAU;YACrB,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,YAAY,IAAA,aAAG,EAAC,EAAE,CAAC,SAAS,EAAE,CAAC,CAAC;QACxE,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/dist/client/index.d.ts
CHANGED
|
@@ -166,6 +166,7 @@ declare function buildNamespaces(request: RequestFn): {
|
|
|
166
166
|
id: string;
|
|
167
167
|
status: "revoked";
|
|
168
168
|
}>;
|
|
169
|
+
touch(id: string): Promise<import("./sessions").TouchedSession>;
|
|
169
170
|
getToken(id: string, template: string): Promise<import("./sessions").SessionTemplateToken>;
|
|
170
171
|
};
|
|
171
172
|
organizations: {
|
|
@@ -527,6 +528,8 @@ declare function buildNamespaces(request: RequestFn): {
|
|
|
527
528
|
id: string;
|
|
528
529
|
revoked: true;
|
|
529
530
|
}>;
|
|
531
|
+
recordUsage(id: string, body: import("./api-keys").RecordApiKeyUsageBody): Promise<import("./api-keys").ApiKeyUsageDebit>;
|
|
532
|
+
getUsage(id: string): Promise<import("./api-keys").ApiKeyUsage>;
|
|
530
533
|
mintToken(body: import("./api-keys").MintApiKeyTokenBody): Promise<import("./api-keys").ApiKeyToken>;
|
|
531
534
|
listRevoked(query?: import("./api-keys").ListRevokedApiKeysQuery): Promise<import("./types").CursorPage<import("./api-keys").RevokedApiKeyRef>>;
|
|
532
535
|
};
|
|
@@ -829,7 +832,9 @@ declare function buildNamespaces(request: RequestFn): {
|
|
|
829
832
|
transport: T;
|
|
830
833
|
} & (string extends T ? unknown : never)): Promise<import("./messaging").MessagingProvider>;
|
|
831
834
|
};
|
|
832
|
-
deleteChannel(channel: "email" | "sms"
|
|
835
|
+
deleteChannel(channel: "email" | "sms", options?: {
|
|
836
|
+
force?: boolean;
|
|
837
|
+
}): Promise<import("./messaging").DeletedMessagingProvider>;
|
|
833
838
|
test(channel: "email" | "sms", body: {
|
|
834
839
|
to: string;
|
|
835
840
|
}): Promise<import("./messaging").MessagingTestResult>;
|
|
@@ -313,7 +313,16 @@ export declare function messagingResource(request: RequestFn): {
|
|
|
313
313
|
(body: SmsProviderInput): Promise<SmsProvider>;
|
|
314
314
|
<T extends string>(body: LegacyInput<T>): Promise<MessagingProvider>;
|
|
315
315
|
};
|
|
316
|
-
|
|
316
|
+
/**
|
|
317
|
+
* Remove a channel's provider. Removing the email provider is refused with
|
|
318
|
+
* `409 EMAIL_PROVIDER_IN_USE` (`meta.features` names them) while
|
|
319
|
+
* email-dependent features are on and nothing else would deliver for the
|
|
320
|
+
* instance; pass `{ force: true }` to remove it anyway — those features then
|
|
321
|
+
* stop being offered until a provider is configured again.
|
|
322
|
+
*/
|
|
323
|
+
deleteChannel(channel: "email" | "sms", options?: {
|
|
324
|
+
force?: boolean;
|
|
325
|
+
}): Promise<DeletedMessagingProvider>;
|
|
317
326
|
/** Send a fixed, clearly-marked test message through the channel's provider. */
|
|
318
327
|
test(channel: "email" | "sms", body: {
|
|
319
328
|
to: string;
|
package/dist/client/messaging.js
CHANGED
|
@@ -26,8 +26,19 @@ function messagingResource(request) {
|
|
|
26
26
|
* secrets — keep their stored values.
|
|
27
27
|
*/
|
|
28
28
|
setSms,
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
/**
|
|
30
|
+
* Remove a channel's provider. Removing the email provider is refused with
|
|
31
|
+
* `409 EMAIL_PROVIDER_IN_USE` (`meta.features` names them) while
|
|
32
|
+
* email-dependent features are on and nothing else would deliver for the
|
|
33
|
+
* instance; pass `{ force: true }` to remove it anyway — those features then
|
|
34
|
+
* stop being offered until a provider is configured again.
|
|
35
|
+
*/
|
|
36
|
+
deleteChannel(channel, options = {}) {
|
|
37
|
+
return request({
|
|
38
|
+
method: 'DELETE',
|
|
39
|
+
path: `/v1/messaging_providers/${(0, request_1.enc)(channel)}`,
|
|
40
|
+
...(options.force ? { query: { force: 'true' } } : {}),
|
|
41
|
+
});
|
|
31
42
|
},
|
|
32
43
|
/** Send a fixed, clearly-marked test message through the channel's provider. */
|
|
33
44
|
test(channel, body) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messaging.js","sourceRoot":"","sources":["../../src/client/messaging.ts"],"names":[],"mappings":";;AAsVA,
|
|
1
|
+
{"version":3,"file":"messaging.js","sourceRoot":"","sources":["../../src/client/messaging.ts"],"names":[],"mappings":";;AAsVA,8CA0DC;AAhZD,uCAAgD;AAsVhD,SAAgB,iBAAiB,CAAC,OAAkB;IAIlD,SAAS,QAAQ,CAAC,IAAa;QAC7B,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,+BAA+B,EAAE,IAAI,EAAE,CAAC,CAAC;IACjF,CAAC;IAKD,SAAS,MAAM,CAAC,IAAa;QAC3B,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,6BAA6B,EAAE,IAAI,EAAE,CAAC,CAAC;IAC/E,CAAC;IAED,OAAO;QACL,0EAA0E;QAC1E,GAAG;YACD,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,yBAAyB,EAAE,CAAC,CAAC;QACrE,CAAC;QACD;;;;WAIG;QACH,QAAQ;QACR;;;;WAIG;QACH,MAAM;QACN;;;;;;WAMG;QACH,aAAa,CACX,OAAwB,EACxB,UAA+B,EAAE;YAEjC,OAAO,OAAO,CAAC;gBACb,MAAM,EAAE,QAAQ;gBAChB,IAAI,EAAE,2BAA2B,IAAA,aAAG,EAAC,OAAO,CAAC,EAAE;gBAC/C,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aACvD,CAAC,CAAC;QACL,CAAC;QACD,gFAAgF;QAChF,IAAI,CAAC,OAAwB,EAAE,IAAoB;YACjD,OAAO,OAAO,CAAC;gBACb,MAAM,EAAE,MAAM;gBACd,IAAI,EAAE,2BAA2B,IAAA,aAAG,EAAC,OAAO,CAAC,OAAO;gBACpD,IAAI;aACL,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -135,10 +135,10 @@ export interface CreateAccountlessAppBody {
|
|
|
135
135
|
}
|
|
136
136
|
/** Page text on the Sign in with Atlas page. Plain text; null or empty uses the default. */
|
|
137
137
|
export interface AtlasIdAppCopy {
|
|
138
|
-
/** Default "Sign in to continue to {app}". */
|
|
138
|
+
/** Default "Sign in" (the app is named on the "to continue to {app}" line under it). */
|
|
139
139
|
sign_in_title?: string | null;
|
|
140
140
|
sign_in_subtitle?: string | null;
|
|
141
|
-
/** Default "Create your
|
|
141
|
+
/** Default "Create your Atlas Account". */
|
|
142
142
|
sign_up_title?: string | null;
|
|
143
143
|
sign_up_subtitle?: string | null;
|
|
144
144
|
/** Shown on the consent screen above the list of permissions. */
|
|
@@ -10,8 +10,16 @@ export interface Session {
|
|
|
10
10
|
last_active_at: number;
|
|
11
11
|
expire_at: number;
|
|
12
12
|
abandon_at: number;
|
|
13
|
+
/** Epoch ms the session ends from inactivity unless there is activity first (same value as `abandon_at`). */
|
|
14
|
+
idle_expires_at?: number;
|
|
13
15
|
created_at: number;
|
|
14
16
|
}
|
|
17
|
+
/** The session after a keep-alive {@link sessionsResource} `touch`. */
|
|
18
|
+
export interface TouchedSession extends Session {
|
|
19
|
+
idle_expires_at: number;
|
|
20
|
+
/** true when this touch moved the inactivity window; false when one within the last 60 seconds already had. */
|
|
21
|
+
extended: boolean;
|
|
22
|
+
}
|
|
15
23
|
export interface ListSessionsParams {
|
|
16
24
|
/** Required by the BAPI: sessions are always scoped to one user. */
|
|
17
25
|
user_id: string;
|
|
@@ -62,6 +70,14 @@ export declare function sessionsResource(request: RequestFn): {
|
|
|
62
70
|
id: string;
|
|
63
71
|
status: "revoked";
|
|
64
72
|
}>;
|
|
73
|
+
/**
|
|
74
|
+
* `POST /v1/sessions/:id/touch` — keep a session alive from your backend:
|
|
75
|
+
* slides its inactivity window as if the user had just loaded a page. Never
|
|
76
|
+
* extends past the absolute expiry and never revives an ended session (409
|
|
77
|
+
* `SESSION_REVOKED` / `SESSION_IDLE_EXPIRED` / `SESSION_EXPIRED`). At most one
|
|
78
|
+
* effective write per minute, so calling it on every request is safe.
|
|
79
|
+
*/
|
|
80
|
+
touch(id: string): Promise<TouchedSession>;
|
|
65
81
|
/**
|
|
66
82
|
* `POST /v1/sessions/:id/tokens/:template` — mint a token from a named JWT
|
|
67
83
|
* template for this session. The reserved name `session` is refused.
|
package/dist/client/sessions.js
CHANGED
|
@@ -21,6 +21,16 @@ function sessionsResource(request) {
|
|
|
21
21
|
revoke(id) {
|
|
22
22
|
return request({ method: 'POST', path: `/v1/sessions/${(0, request_1.enc)(id)}/revoke` });
|
|
23
23
|
},
|
|
24
|
+
/**
|
|
25
|
+
* `POST /v1/sessions/:id/touch` — keep a session alive from your backend:
|
|
26
|
+
* slides its inactivity window as if the user had just loaded a page. Never
|
|
27
|
+
* extends past the absolute expiry and never revives an ended session (409
|
|
28
|
+
* `SESSION_REVOKED` / `SESSION_IDLE_EXPIRED` / `SESSION_EXPIRED`). At most one
|
|
29
|
+
* effective write per minute, so calling it on every request is safe.
|
|
30
|
+
*/
|
|
31
|
+
touch(id) {
|
|
32
|
+
return request({ method: 'POST', path: `/v1/sessions/${(0, request_1.enc)(id)}/touch` });
|
|
33
|
+
},
|
|
24
34
|
/**
|
|
25
35
|
* `POST /v1/sessions/:id/tokens/:template` — mint a token from a named JWT
|
|
26
36
|
* template for this session. The reserved name `session` is refused.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sessions.js","sourceRoot":"","sources":["../../src/client/sessions.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"sessions.js","sourceRoot":"","sources":["../../src/client/sessions.ts"],"names":[],"mappings":";;AA6DA,4CAwCC;AArGD,uCAAgD;AA6DhD,SAAgB,gBAAgB,CAAC,OAAkB;IACjD,OAAO;QACL;;;WAGG;QACH,MAAM,CAAC,MAA2B;YAChC,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,EAAE,GAAG,MAAM,EAAE,EAAE,CAAC,CAAC;QAChF,CAAC;QACD,wDAAwD;QACxD,IAAI,CAAC,MAA0B;YAC7B,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,EAAE,GAAG,MAAM,EAAE,EAAE,CAAC,CAAC;QAChF,CAAC;QACD,GAAG,CAAC,EAAU;YACZ,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,gBAAgB,IAAA,aAAG,EAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QACrE,CAAC;QACD,MAAM,CAAC,EAAU;YACf,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,IAAA,aAAG,EAAC,EAAE,CAAC,SAAS,EAAE,CAAC,CAAC;QAC7E,CAAC;QACD;;;;;;WAMG;QACH,KAAK,CAAC,EAAU;YACd,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,IAAA,aAAG,EAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC5E,CAAC;QACD;;;WAGG;QACH,QAAQ,CAAC,EAAU,EAAE,QAAgB;YACnC,OAAO,OAAO,CAAC;gBACb,MAAM,EAAE,MAAM;gBACd,IAAI,EAAE,gBAAgB,IAAA,aAAG,EAAC,EAAE,CAAC,WAAW,IAAA,aAAG,EAAC,QAAQ,CAAC,EAAE;aACxD,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/dist/client/users.d.ts
CHANGED
|
@@ -45,6 +45,11 @@ export interface CreateUserBody {
|
|
|
45
45
|
public_metadata?: Metadata;
|
|
46
46
|
private_metadata?: Metadata;
|
|
47
47
|
unsafe_metadata?: Metadata;
|
|
48
|
+
/**
|
|
49
|
+
* Whether creating the user may notify them. Defaults to false, which
|
|
50
|
+
* guarantees no email, SMS or push is sent as a consequence of the create.
|
|
51
|
+
*/
|
|
52
|
+
notify?: boolean;
|
|
48
53
|
}
|
|
49
54
|
export interface UpdateUserBody {
|
|
50
55
|
first_name?: string;
|
package/dist/client/users.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"users.js","sourceRoot":"","sources":["../../src/client/users.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"users.js","sourceRoot":"","sources":["../../src/client/users.ts"],"names":[],"mappings":";;AAwEA,sCAkaC;AA1eD,uCAAgD;AAwEhD,SAAgB,aAAa,CAAC,OAAkB;IAC9C,OAAO;QACL,0CAA0C;QAC1C,IAAI,CAAC,SAA0B,EAAE;YAC/B,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,EAAE,GAAG,MAAM,EAAE,EAAE,CAAC,CAAC;QAC7E,CAAC;QACD,GAAG,CAAC,EAAU;YACZ,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,aAAa,IAAA,aAAG,EAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QAClE,CAAC;QACD,MAAM,CAAC,IAAoB,EAAE,cAAuB;YAClD,OAAO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ACD,8BAA8B;QAC9B,WAAW,EAAE;YACX;;;eAGG;YACH,QAAQ,CAAC,EAAU,EAAE,IAA8B;gBACjD,OAAO,OAAO,CAAC;oBACb,MAAM,EAAE,MAAM;oBACd,IAAI,EAAE,aAAa,IAAA,aAAG,EAAC,EAAE,CAAC,qBAAqB;oBAC/C,IAAI;iBACL,CAAC,CAAC;YACL,CAAC;SACF;KACF,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlasauth/backend",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"jose": "^5.9.6",
|
|
8
|
-
"@atlasauth/
|
|
9
|
-
"@atlasauth/
|
|
8
|
+
"@atlasauth/pca": "0.1.0",
|
|
9
|
+
"@atlasauth/authz": "0.1.1"
|
|
10
10
|
},
|
|
11
11
|
"devDependencies": {
|
|
12
12
|
"typescript": "^5.6.3",
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
},
|
|
18
18
|
"files": [
|
|
19
19
|
"dist",
|
|
20
|
-
"README.md"
|
|
20
|
+
"README.md",
|
|
21
|
+
"CHANGELOG.md"
|
|
21
22
|
],
|
|
22
23
|
"repository": {
|
|
23
24
|
"type": "git",
|