@archastro/sdk 0.17.0 → 0.19.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/auth.d.ts +42 -18
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +53 -19
- package/dist/auth.js.map +1 -1
- package/dist/channels/api_chat_channel.d.ts +11 -1
- package/dist/channels/api_chat_channel.d.ts.map +1 -1
- package/dist/channels/api_chat_channel.js +14 -2
- package/dist/channels/api_chat_channel.js.map +1 -1
- package/dist/effective-access.d.ts +1 -1
- package/dist/effective-access.d.ts.map +1 -1
- package/dist/effective-access.js +2 -5
- package/dist/effective-access.js.map +1 -1
- package/dist/types/ai.d.ts +310 -0
- package/dist/types/ai.d.ts.map +1 -1
- package/dist/types/ai.js +51 -1
- package/dist/types/ai.js.map +1 -1
- package/dist/types/artifacts.d.ts +14 -2
- package/dist/types/artifacts.d.ts.map +1 -1
- package/dist/types/artifacts.js +5 -1
- package/dist/types/artifacts.js.map +1 -1
- package/dist/types/chat.d.ts +192 -168
- package/dist/types/chat.d.ts.map +1 -1
- package/dist/types/chat.js +10 -3
- package/dist/types/chat.js.map +1 -1
- package/dist/types/common.d.ts +347 -128
- package/dist/types/common.d.ts.map +1 -1
- package/dist/types/common.js +39 -20
- package/dist/types/common.js.map +1 -1
- package/dist/types/config.d.ts +2 -2
- package/dist/types/events.d.ts +32 -32
- package/dist/types/extractions.d.ts +12 -12
- package/dist/types/tasks.d.ts +34 -8
- package/dist/types/tasks.d.ts.map +1 -1
- package/dist/types/tasks.js +12 -3
- package/dist/types/tasks.js.map +1 -1
- package/dist/types/teams.d.ts +10 -10
- package/dist/types/threads.d.ts +18 -18
- package/dist/types/threads.d.ts.map +1 -1
- package/dist/types/threads.js +3 -3
- package/dist/types/threads.js.map +1 -1
- package/dist/v1/resources/agents.d.ts +8 -2
- package/dist/v1/resources/agents.d.ts.map +1 -1
- package/dist/v1/resources/agents.js +7 -2
- package/dist/v1/resources/agents.js.map +1 -1
- package/dist/v1/resources/ai.d.ts +72 -1
- package/dist/v1/resources/ai.d.ts.map +1 -1
- package/dist/v1/resources/ai.js +44 -1
- package/dist/v1/resources/ai.js.map +1 -1
- package/dist/v1/resources/artifacts.d.ts +52 -0
- package/dist/v1/resources/artifacts.d.ts.map +1 -1
- package/dist/v1/resources/artifacts.js +35 -1
- package/dist/v1/resources/artifacts.js.map +1 -1
- package/dist/v1/resources/files.d.ts +7 -0
- package/dist/v1/resources/files.d.ts.map +1 -1
- package/dist/v1/resources/files.js +8 -1
- package/dist/v1/resources/files.js.map +1 -1
- package/dist/v1/resources/knowledge_sources.d.ts +41 -0
- package/dist/v1/resources/knowledge_sources.d.ts.map +1 -1
- package/dist/v1/resources/knowledge_sources.js +31 -1
- package/dist/v1/resources/knowledge_sources.js.map +1 -1
- package/dist/v1/resources/orgs.d.ts +506 -0
- package/dist/v1/resources/orgs.d.ts.map +1 -1
- package/dist/v1/resources/orgs.js +71 -1
- package/dist/v1/resources/orgs.js.map +1 -1
- package/dist/v1/resources/sandboxes.d.ts +3 -2
- package/dist/v1/resources/sandboxes.d.ts.map +1 -1
- package/dist/v1/resources/sandboxes.js +4 -3
- package/dist/v1/resources/sandboxes.js.map +1 -1
- package/dist/v1/resources/scripts.d.ts +6 -2
- package/dist/v1/resources/scripts.d.ts.map +1 -1
- package/dist/v1/resources/scripts.js +5 -3
- package/dist/v1/resources/scripts.js.map +1 -1
- package/dist/v1/resources/tasks.d.ts +58 -3
- package/dist/v1/resources/tasks.d.ts.map +1 -1
- package/dist/v1/resources/tasks.js +61 -2
- package/dist/v1/resources/tasks.js.map +1 -1
- package/dist/v1/resources/teams.d.ts +46 -14
- package/dist/v1/resources/teams.d.ts.map +1 -1
- package/dist/v1/resources/teams.js +54 -16
- package/dist/v1/resources/teams.js.map +1 -1
- package/dist/v1/resources/threads.d.ts +16 -6
- package/dist/v1/resources/threads.d.ts.map +1 -1
- package/dist/v1/resources/threads.js +19 -8
- package/dist/v1/resources/threads.js.map +1 -1
- package/dist/v1/resources/users.d.ts +13 -3
- package/dist/v1/resources/users.d.ts.map +1 -1
- package/dist/v1/resources/users.js +13 -3
- package/dist/v1/resources/users.js.map +1 -1
- package/package.json +1 -1
package/dist/auth.d.ts
CHANGED
|
@@ -40,7 +40,7 @@ export declare class AuthClient {
|
|
|
40
40
|
* Request a magic link for login
|
|
41
41
|
* Sends a magic link to the given email address so an existing user can sign in
|
|
42
42
|
* without a password. The user clicks the link in their email and is redirected to
|
|
43
|
-
* `redirect_uri` with a token; pass that token to `/auth/
|
|
43
|
+
* `redirect_uri` with a token; pass that token to `/api/v1/auth/verify/link` to obtain
|
|
44
44
|
* session tokens.
|
|
45
45
|
* If no account exists for the email, the endpoint still returns success to prevent
|
|
46
46
|
* email enumeration — no link is sent in that case. Both `email` and `redirect_uri`
|
|
@@ -75,8 +75,12 @@ export declare class AuthClient {
|
|
|
75
75
|
* invite is not found.
|
|
76
76
|
* - **Standard registration**: supply `password`. An `invite_code` may optionally be
|
|
77
77
|
* included for invite-gated apps; an invalid code returns HTTP 404.
|
|
78
|
-
*
|
|
79
|
-
*
|
|
78
|
+
* Provide `team_invite` or `password`; when both are supplied, team registration
|
|
79
|
+
* takes precedence. Omitting both returns HTTP 400. Unknown fields return HTTP 400
|
|
80
|
+
* with field-level guidance. Use `full_name` for the profile name (returned as
|
|
81
|
+
* `user.name`); `name` is not an input field. `alias` is a separate optional handle.
|
|
82
|
+
* Legacy `team_invite_id` remains accepted; `team_invite` takes precedence.
|
|
83
|
+
* Password registration must be enabled for the app; disabled apps return
|
|
80
84
|
* HTTP 403. The response status is HTTP 201 on success.
|
|
81
85
|
*
|
|
82
86
|
* @param email - Email address for the new account.
|
|
@@ -94,22 +98,24 @@ export declare class AuthClient {
|
|
|
94
98
|
* Request a magic link for registration
|
|
95
99
|
* Starts a passwordless registration flow by sending a verification link to the given
|
|
96
100
|
* email address. The recipient clicks the link and is redirected to `redirect_uri` with
|
|
97
|
-
* a token; pass that token to `/auth/
|
|
101
|
+
* a token; pass that token to `/api/v1/auth/verify/link` to complete registration and obtain
|
|
98
102
|
* session tokens.
|
|
99
|
-
* Profile fields (`full_name`, `alias`, `timezone`)
|
|
100
|
-
*
|
|
103
|
+
* Profile fields (`full_name`, `alias`, `timezone`) and, with `set_org`, the `org`
|
|
104
|
+
* details are captured now and applied when the link is verified; nothing is created
|
|
105
|
+
* before the click. Requests are rate-limited per IP (10 per minute) and per
|
|
101
106
|
* email-IP pair (3 per minute) — exceeding either limit returns HTTP 429. Returns
|
|
102
107
|
* HTTP 204 on success.
|
|
103
108
|
*
|
|
104
109
|
* @param alias - Display alias (handle) for the new account.
|
|
105
110
|
* @param email - Email address to send the registration magic link to.
|
|
106
111
|
* @param fullName - Full name for the new account.
|
|
112
|
+
* @param org - Company details for the organization a `set_org` registration creates at confirmation. Ignored when the domain org already exists or the mailbox is personal (which keeps the platform's own identity and takes only the sign-in methods).
|
|
107
113
|
* @param redirectUri - URL the user is redirected to after clicking the registration link. The token is appended as a query parameter.
|
|
108
114
|
* @param setOrg - Create or reuse an organization from the work-email domain during confirmation.
|
|
109
115
|
* @param timezone - IANA timezone name for the new account, e.g. `"America/New_York"`.
|
|
110
116
|
* @returns No content
|
|
111
117
|
*/
|
|
112
|
-
requestRegisterMagicLink(alias?: string, email?: string, fullName?: string, redirectUri?: string, setOrg?: boolean, timezone?: string): Promise<Record<string, unknown>>;
|
|
118
|
+
requestRegisterMagicLink(alias?: string, email?: string, fullName?: string, org?: string, redirectUri?: string, setOrg?: boolean, timezone?: string): Promise<Record<string, unknown>>;
|
|
113
119
|
/**
|
|
114
120
|
* Request a magic link for login or registration
|
|
115
121
|
* Sends a passwordless magic link to the given email address. If an account with that
|
|
@@ -119,25 +125,41 @@ export declare class AuthClient {
|
|
|
119
125
|
* The `redirect_uri` is validated against the app's registered hosts; an unregistered
|
|
120
126
|
* URI returns HTTP 400. Both `email` and `redirect_uri` are required. Requests are
|
|
121
127
|
* rate-limited per IP (10 per minute) and per email-IP pair (3 per minute). Returns
|
|
122
|
-
* HTTP 204 on success — no body.
|
|
128
|
+
* HTTP 204 on success — no body. If the app has Allowed Users enabled and the
|
|
129
|
+
* address is not on the list, returns HTTP 403 `user_not_allowed`. That refusal
|
|
130
|
+
* is the same for new and existing addresses, so it does not reveal whether an
|
|
131
|
+
* account exists.
|
|
132
|
+
* For a new user, `full_name` and (with `set_org`) the `org` details ride the pending
|
|
133
|
+
* registration and are applied when the link is verified; nothing is created before
|
|
134
|
+
* the click. They are ignored when the email already belongs to a user. Malformed
|
|
135
|
+
* values return HTTP 422 before the address is looked up, so the response cannot
|
|
136
|
+
* reveal whether an account exists.
|
|
123
137
|
*
|
|
124
138
|
* @param email - Email address to send the magic link to.
|
|
139
|
+
* @param fullName - Display name for the account the verified link will create.
|
|
140
|
+
* @param mcpClientId - Opaque dynamic-registration client id for an MCP consent signup. Platform resolves it to a closed analytics key.
|
|
141
|
+
* @param org - Company details for the organization a `set_org` registration creates at confirmation. Ignored when the domain org already exists or the mailbox is personal (which keeps the platform's own identity and takes only the sign-in methods).
|
|
125
142
|
* @param redirectUri - URL the user is redirected to after clicking the magic link. Must be registered with the app.
|
|
126
143
|
* @param setOrg - For a new user, create or reuse an organization from the work-email domain during confirmation.
|
|
144
|
+
* @param signupOrigin - Closed product intent for a new signup. Missing or unknown values become generic and never affect authentication.
|
|
127
145
|
* @returns No content
|
|
128
146
|
*/
|
|
129
|
-
requestMagicLink(email?: string, redirectUri?: string, setOrg?: boolean): Promise<Record<string, unknown>>;
|
|
147
|
+
requestMagicLink(email?: string, fullName?: string, mcpClientId?: string, org?: string, redirectUri?: string, setOrg?: boolean, signupOrigin?: string): Promise<Record<string, unknown>>;
|
|
130
148
|
/**
|
|
131
149
|
* Exchange a one-time login token for session tokens
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
*
|
|
135
|
-
*
|
|
150
|
+
* Exchanges an email-login token (including email reply links) or an internal
|
|
151
|
+
* impersonation login token for session credentials. Passwordless magic-link tokens
|
|
152
|
+
* from `/api/v1/auth/login/link`, `/api/v1/auth/register/link`, or
|
|
153
|
+
* `/api/v1/auth/request/link` must instead go to `/api/v1/auth/verify/link`.
|
|
154
|
+
* Numeric email codes go to `/api/v1/auth/code/verify` with `email` and `code`.
|
|
155
|
+
* Access and refresh tokens are not accepted here. Invalid, expired, or already-used
|
|
156
|
+
* login tokens return HTTP 401 with structured `error.type`, `error.code`, and
|
|
157
|
+
* `error.message` fields.
|
|
136
158
|
* If `timezone` is provided and the user's current timezone is still the default
|
|
137
159
|
* (`"America/Los_Angeles"`), the account timezone is updated in the same request.
|
|
138
160
|
* Requests are rate-limited to 10 per IP per minute; exceeding this returns HTTP 429.
|
|
139
161
|
*
|
|
140
|
-
* @param token - Single-use login token
|
|
162
|
+
* @param token - Single-use email-login or impersonation token; not a passwordless magic-link token or numeric code.
|
|
141
163
|
* @param timezone - IANA timezone name to apply to the account if the account timezone is still the default, e.g. `"Europe/London"`. Omit to leave the timezone unchanged.
|
|
142
164
|
* @returns Access token, refresh token, and the authenticated user object.
|
|
143
165
|
*/
|
|
@@ -146,11 +168,13 @@ export declare class AuthClient {
|
|
|
146
168
|
* Verify a magic link token
|
|
147
169
|
* Consumes a single-use token from a magic link URL and returns an access token,
|
|
148
170
|
* refresh token, and the authenticated user object. This endpoint completes both the
|
|
149
|
-
* login flow (initiated by `/auth/
|
|
150
|
-
* (initiated by `/auth/
|
|
171
|
+
* login flow (initiated by `/api/v1/auth/login/link`) and the registration flow
|
|
172
|
+
* (initiated by `/api/v1/auth/register/link` or `/api/v1/auth/request/link`).
|
|
151
173
|
* Extract the token from the `token` query parameter of the magic link redirect URI
|
|
152
|
-
* and POST
|
|
153
|
-
*
|
|
174
|
+
* and POST JSON `{"token":"<token from redirect URI>"}` to
|
|
175
|
+
* `/api/v1/auth/verify/link`, not `/api/v1/auth/token`. Expired or already-used tokens return HTTP 401 — expired links
|
|
176
|
+
* have `error.code` = `authentication_error` and `error.message` =
|
|
177
|
+
* `expired_token`; unknown or already-used tokens have `error.message` =
|
|
154
178
|
* `invalid_or_expired_token`. If the app has disabled passwordless authentication
|
|
155
179
|
* the request returns HTTP 403. Rate-limited to 10 requests per IP per minute —
|
|
156
180
|
* exceeding this returns HTTP 429.
|
package/dist/auth.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEtD,MAAM,WAAW,UAAU;IACzB,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;CACjC;AAED,qBAAa,UAAU;IACT,OAAO,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU;IAEpC;;;;;;;;;;;;OAYG;IACG,kBAAkB,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAQ5D;;;;;;;;;;;;;OAaG;IACG,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAgBjE;;;;;;;;;;;;;;OAcG;IACG,qBAAqB,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAYnG;;;;;;;;;;;;OAYG;IACG,OAAO,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAexD
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEtD,MAAM,WAAW,UAAU;IACzB,WAAW,EAAE,MAAM,GAAG,SAAS,CA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AO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAiB5L;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACG,gBAAgB,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAiB9L;;;;;;;;;;;;;;;;;OAiBG;IACG,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAgB/E;;;;;;;;;;;;;;;;;OAiBG;IACG,eAAe,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;CAc3D"}
|
package/dist/auth.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Copyright (c) 2026 ArchAstro Inc. Licensed under the MIT License.
|
|
2
2
|
// This file is auto-generated by @archastro/sdk-generator. Do not edit.
|
|
3
|
-
// Content hash:
|
|
3
|
+
// Content hash: f49ac3f1c720
|
|
4
4
|
export class AuthClient {
|
|
5
5
|
http;
|
|
6
6
|
constructor(http) {
|
|
@@ -52,7 +52,7 @@ export class AuthClient {
|
|
|
52
52
|
* Request a magic link for login
|
|
53
53
|
* Sends a magic link to the given email address so an existing user can sign in
|
|
54
54
|
* without a password. The user clicks the link in their email and is redirected to
|
|
55
|
-
* `redirect_uri` with a token; pass that token to `/auth/
|
|
55
|
+
* `redirect_uri` with a token; pass that token to `/api/v1/auth/verify/link` to obtain
|
|
56
56
|
* session tokens.
|
|
57
57
|
* If no account exists for the email, the endpoint still returns success to prevent
|
|
58
58
|
* email enumeration — no link is sent in that case. Both `email` and `redirect_uri`
|
|
@@ -104,8 +104,12 @@ export class AuthClient {
|
|
|
104
104
|
* invite is not found.
|
|
105
105
|
* - **Standard registration**: supply `password`. An `invite_code` may optionally be
|
|
106
106
|
* included for invite-gated apps; an invalid code returns HTTP 404.
|
|
107
|
-
*
|
|
108
|
-
*
|
|
107
|
+
* Provide `team_invite` or `password`; when both are supplied, team registration
|
|
108
|
+
* takes precedence. Omitting both returns HTTP 400. Unknown fields return HTTP 400
|
|
109
|
+
* with field-level guidance. Use `full_name` for the profile name (returned as
|
|
110
|
+
* `user.name`); `name` is not an input field. `alias` is a separate optional handle.
|
|
111
|
+
* Legacy `team_invite_id` remains accepted; `team_invite` takes precedence.
|
|
112
|
+
* Password registration must be enabled for the app; disabled apps return
|
|
109
113
|
* HTTP 403. The response status is HTTP 201 on success.
|
|
110
114
|
*
|
|
111
115
|
* @param email - Email address for the new account.
|
|
@@ -146,22 +150,24 @@ export class AuthClient {
|
|
|
146
150
|
* Request a magic link for registration
|
|
147
151
|
* Starts a passwordless registration flow by sending a verification link to the given
|
|
148
152
|
* email address. The recipient clicks the link and is redirected to `redirect_uri` with
|
|
149
|
-
* a token; pass that token to `/auth/
|
|
153
|
+
* a token; pass that token to `/api/v1/auth/verify/link` to complete registration and obtain
|
|
150
154
|
* session tokens.
|
|
151
|
-
* Profile fields (`full_name`, `alias`, `timezone`)
|
|
152
|
-
*
|
|
155
|
+
* Profile fields (`full_name`, `alias`, `timezone`) and, with `set_org`, the `org`
|
|
156
|
+
* details are captured now and applied when the link is verified; nothing is created
|
|
157
|
+
* before the click. Requests are rate-limited per IP (10 per minute) and per
|
|
153
158
|
* email-IP pair (3 per minute) — exceeding either limit returns HTTP 429. Returns
|
|
154
159
|
* HTTP 204 on success.
|
|
155
160
|
*
|
|
156
161
|
* @param alias - Display alias (handle) for the new account.
|
|
157
162
|
* @param email - Email address to send the registration magic link to.
|
|
158
163
|
* @param fullName - Full name for the new account.
|
|
164
|
+
* @param org - Company details for the organization a `set_org` registration creates at confirmation. Ignored when the domain org already exists or the mailbox is personal (which keeps the platform's own identity and takes only the sign-in methods).
|
|
159
165
|
* @param redirectUri - URL the user is redirected to after clicking the registration link. The token is appended as a query parameter.
|
|
160
166
|
* @param setOrg - Create or reuse an organization from the work-email domain during confirmation.
|
|
161
167
|
* @param timezone - IANA timezone name for the new account, e.g. `"America/New_York"`.
|
|
162
168
|
* @returns No content
|
|
163
169
|
*/
|
|
164
|
-
async requestRegisterMagicLink(alias, email, fullName, redirectUri, setOrg, timezone) {
|
|
170
|
+
async requestRegisterMagicLink(alias, email, fullName, org, redirectUri, setOrg, timezone) {
|
|
165
171
|
const body = {};
|
|
166
172
|
if (alias !== undefined)
|
|
167
173
|
body["alias"] = alias;
|
|
@@ -169,6 +175,8 @@ export class AuthClient {
|
|
|
169
175
|
body["email"] = email;
|
|
170
176
|
if (fullName !== undefined)
|
|
171
177
|
body["full_name"] = fullName;
|
|
178
|
+
if (org !== undefined)
|
|
179
|
+
body["org"] = org;
|
|
172
180
|
if (redirectUri !== undefined)
|
|
173
181
|
body["redirect_uri"] = redirectUri;
|
|
174
182
|
if (setOrg !== undefined)
|
|
@@ -187,35 +195,59 @@ export class AuthClient {
|
|
|
187
195
|
* The `redirect_uri` is validated against the app's registered hosts; an unregistered
|
|
188
196
|
* URI returns HTTP 400. Both `email` and `redirect_uri` are required. Requests are
|
|
189
197
|
* rate-limited per IP (10 per minute) and per email-IP pair (3 per minute). Returns
|
|
190
|
-
* HTTP 204 on success — no body.
|
|
198
|
+
* HTTP 204 on success — no body. If the app has Allowed Users enabled and the
|
|
199
|
+
* address is not on the list, returns HTTP 403 `user_not_allowed`. That refusal
|
|
200
|
+
* is the same for new and existing addresses, so it does not reveal whether an
|
|
201
|
+
* account exists.
|
|
202
|
+
* For a new user, `full_name` and (with `set_org`) the `org` details ride the pending
|
|
203
|
+
* registration and are applied when the link is verified; nothing is created before
|
|
204
|
+
* the click. They are ignored when the email already belongs to a user. Malformed
|
|
205
|
+
* values return HTTP 422 before the address is looked up, so the response cannot
|
|
206
|
+
* reveal whether an account exists.
|
|
191
207
|
*
|
|
192
208
|
* @param email - Email address to send the magic link to.
|
|
209
|
+
* @param fullName - Display name for the account the verified link will create.
|
|
210
|
+
* @param mcpClientId - Opaque dynamic-registration client id for an MCP consent signup. Platform resolves it to a closed analytics key.
|
|
211
|
+
* @param org - Company details for the organization a `set_org` registration creates at confirmation. Ignored when the domain org already exists or the mailbox is personal (which keeps the platform's own identity and takes only the sign-in methods).
|
|
193
212
|
* @param redirectUri - URL the user is redirected to after clicking the magic link. Must be registered with the app.
|
|
194
213
|
* @param setOrg - For a new user, create or reuse an organization from the work-email domain during confirmation.
|
|
214
|
+
* @param signupOrigin - Closed product intent for a new signup. Missing or unknown values become generic and never affect authentication.
|
|
195
215
|
* @returns No content
|
|
196
216
|
*/
|
|
197
|
-
async requestMagicLink(email, redirectUri, setOrg) {
|
|
217
|
+
async requestMagicLink(email, fullName, mcpClientId, org, redirectUri, setOrg, signupOrigin) {
|
|
198
218
|
const body = {};
|
|
199
219
|
if (email !== undefined)
|
|
200
220
|
body["email"] = email;
|
|
221
|
+
if (fullName !== undefined)
|
|
222
|
+
body["full_name"] = fullName;
|
|
223
|
+
if (mcpClientId !== undefined)
|
|
224
|
+
body["mcp_client_id"] = mcpClientId;
|
|
225
|
+
if (org !== undefined)
|
|
226
|
+
body["org"] = org;
|
|
201
227
|
if (redirectUri !== undefined)
|
|
202
228
|
body["redirect_uri"] = redirectUri;
|
|
203
229
|
if (setOrg !== undefined)
|
|
204
230
|
body["set_org"] = setOrg;
|
|
231
|
+
if (signupOrigin !== undefined)
|
|
232
|
+
body["signup_origin"] = signupOrigin;
|
|
205
233
|
const data = await this.http.request("/api/v1/auth/request/link", { method: "POST", body });
|
|
206
234
|
return data;
|
|
207
235
|
}
|
|
208
236
|
/**
|
|
209
237
|
* Exchange a one-time login token for session tokens
|
|
210
|
-
*
|
|
211
|
-
*
|
|
212
|
-
*
|
|
213
|
-
*
|
|
238
|
+
* Exchanges an email-login token (including email reply links) or an internal
|
|
239
|
+
* impersonation login token for session credentials. Passwordless magic-link tokens
|
|
240
|
+
* from `/api/v1/auth/login/link`, `/api/v1/auth/register/link`, or
|
|
241
|
+
* `/api/v1/auth/request/link` must instead go to `/api/v1/auth/verify/link`.
|
|
242
|
+
* Numeric email codes go to `/api/v1/auth/code/verify` with `email` and `code`.
|
|
243
|
+
* Access and refresh tokens are not accepted here. Invalid, expired, or already-used
|
|
244
|
+
* login tokens return HTTP 401 with structured `error.type`, `error.code`, and
|
|
245
|
+
* `error.message` fields.
|
|
214
246
|
* If `timezone` is provided and the user's current timezone is still the default
|
|
215
247
|
* (`"America/Los_Angeles"`), the account timezone is updated in the same request.
|
|
216
248
|
* Requests are rate-limited to 10 per IP per minute; exceeding this returns HTTP 429.
|
|
217
249
|
*
|
|
218
|
-
* @param token - Single-use login token
|
|
250
|
+
* @param token - Single-use email-login or impersonation token; not a passwordless magic-link token or numeric code.
|
|
219
251
|
* @param timezone - IANA timezone name to apply to the account if the account timezone is still the default, e.g. `"Europe/London"`. Omit to leave the timezone unchanged.
|
|
220
252
|
* @returns Access token, refresh token, and the authenticated user object.
|
|
221
253
|
*/
|
|
@@ -235,11 +267,13 @@ export class AuthClient {
|
|
|
235
267
|
* Verify a magic link token
|
|
236
268
|
* Consumes a single-use token from a magic link URL and returns an access token,
|
|
237
269
|
* refresh token, and the authenticated user object. This endpoint completes both the
|
|
238
|
-
* login flow (initiated by `/auth/
|
|
239
|
-
* (initiated by `/auth/
|
|
270
|
+
* login flow (initiated by `/api/v1/auth/login/link`) and the registration flow
|
|
271
|
+
* (initiated by `/api/v1/auth/register/link` or `/api/v1/auth/request/link`).
|
|
240
272
|
* Extract the token from the `token` query parameter of the magic link redirect URI
|
|
241
|
-
* and POST
|
|
242
|
-
*
|
|
273
|
+
* and POST JSON `{"token":"<token from redirect URI>"}` to
|
|
274
|
+
* `/api/v1/auth/verify/link`, not `/api/v1/auth/token`. Expired or already-used tokens return HTTP 401 — expired links
|
|
275
|
+
* have `error.code` = `authentication_error` and `error.message` =
|
|
276
|
+
* `expired_token`; unknown or already-used tokens have `error.message` =
|
|
243
277
|
* `invalid_or_expired_token`. If the app has disabled passwordless authentication
|
|
244
278
|
* the request returns HTTP 403. Rate-limited to 10 requests per IP per minute —
|
|
245
279
|
* exceeding this returns HTTP 429.
|
package/dist/auth.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,wEAAwE;AACxE,6BAA6B;AAU7B,MAAM,OAAO,UAAU;IACD;IAApB,YAAoB,IAAgB;QAAhB,SAAI,GAAJ,IAAI,CAAY;IAAG,CAAC;IAExC;;;;;;;;;;;;OAYG;IACH,KAAK,CAAC,kBAAkB;QACtB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,CAClC,mCAAmC,EACnC,EAAE,MAAM,EAAE,KAAK,EAAE,CAClB,CAAC;QACF,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,KAAK,CAAC,KAAK,CAAC,KAAa,EAAE,QAAgB;QACzC,MAAM,IAAI,GAA4B,EAAE,CAAC;QACzC,IAAI,CAAC,OAAO,CAAC,GAAG,KAAK,CAAC;QACtB,IAAI,CAAC,UAAU,CAAC,GAAG,QAAQ,CAAC;QAE5B,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,CAClC,oBAAoB,EACpB,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,CACzB,CAAC;QACF,OAAO;YACL,WAAW,EAAE,IAAI,CAAC,UAAgC;YAClD,YAAY,EAAE,IAAI,CAAC,aAAmC;YACtD,WAAW,EAAE,IAAI,CAAC,KAA2B;SAC9C,CAAA;IACH,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,KAAK,CAAC,qBAAqB,CAA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AAK,KAAK,SAAS;YAAE,IAAI,CAAC,OAAO,CAAC,GAAG,KAAK,CAAC;QAE/C,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,CAClC,0BAA0B,EAC1B,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,CACzB,CAAC;QACF,OAAO;YACL,WAAW,EAAE,IAAI,CAAC,UAAgC;YAClD,YAAY,EAAE,IAAI,CAAC,aAAmC;YACtD,WAAW,EAAE,IAAI,CAAC,KAA2B;SAC9C,CAAA;IACH,CAAC;CACF"}
|
|
@@ -3,7 +3,8 @@ import type { Socket } from "../phx_channel/socket.js";
|
|
|
3
3
|
/**
|
|
4
4
|
* Channel for real-time chat messaging.
|
|
5
5
|
* Supports team-scoped and user-scoped threads with keyed, transient, and direct
|
|
6
|
-
* thread access patterns
|
|
6
|
+
* thread access patterns, plus org-scoped joins for organization-visibility
|
|
7
|
+
* threads, where org membership alone grants read and post.
|
|
7
8
|
*/
|
|
8
9
|
export declare class ApiChatChannel {
|
|
9
10
|
private channel;
|
|
@@ -36,6 +37,15 @@ export declare class ApiChatChannel {
|
|
|
36
37
|
include_metadata?: boolean;
|
|
37
38
|
limit?: number;
|
|
38
39
|
}): Promise<ApiChatChannel>;
|
|
40
|
+
/** Join an organization-visibility thread by ID */
|
|
41
|
+
static topicOrgThread(orgId: string, threadId: string): string;
|
|
42
|
+
/** Join an organization-visibility thread by ID */
|
|
43
|
+
static joinOrgThread(socket: Socket, orgId: string, threadId: string, payload?: {
|
|
44
|
+
after_cursor?: string;
|
|
45
|
+
before_cursor?: string;
|
|
46
|
+
include_metadata?: boolean;
|
|
47
|
+
limit?: number;
|
|
48
|
+
}): Promise<ApiChatChannel>;
|
|
39
49
|
/** Join a user-scoped thread by ID, optionally supplying local tools for a personal thread */
|
|
40
50
|
static topicUserThread(threadId: string): string;
|
|
41
51
|
/** Join a user-scoped thread by ID, optionally supplying local tools for a personal thread */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api_chat_channel.d.ts","sourceRoot":"","sources":["../../src/channels/api_chat_channel.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAEvD
|
|
1
|
+
{"version":3,"file":"api_chat_channel.d.ts","sourceRoot":"","sources":["../../src/channels/api_chat_channel.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAEvD;;;;;GAKG;AACH,qBAAa,cAAc;IACb,OAAO,CAAC,OAAO;aAA2B,YAAY,CAAC,EAAE,OAAO;gBAAxD,OAAO,EAAE,OAAO,EAAkB,YAAY,CAAC,EAAE,OAAO,YAAA;IAE5E,sCAAsC;IACtC,MAAM,CAAC,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM;IAIhE,sCAAsC;WACzB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,YAAY,CAAC,EAAE,MAAM,CAAC;QAAC,aAAa,CAAC,EAAE,MAAM,CAAC;QAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,cAAc,CAAC;IAO/M,gDAAgD;IAChD,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM;IAI1D,gDAAgD;WACnC,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,YAAY,CAAC,EAAE,MAAM,CA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C,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;IAIlF,2EAA2E;IACrE,sBAAsB,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;IAIhF,wDAAwD;IACxD,cAAc,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,GAAG,MAAM,IAAI;IAIhE,qDAAqD;IACrD,gBAAgB,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,GAAG,MAAM,IAAI;IAIlE,+EAA+E;IAC/E,aAAa,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,GAAG,MAAM,IAAI;IAI/D,mCAAmC;IACnC,aAAa,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,GAAG,MAAM,IAAI;IAI/D,wGAAwG;IACxG,QAAQ,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,GAAG,MAAM,IAAI;IAI1D,yEAAyE;IACzE,eAAe,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,GAAG,MAAM,IAAI;IAIjE,sEAAsE;IACtE,oBAAoB,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,GAAG,MAAM,IAAI;CAGvE"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
// Copyright (c) 2026 ArchAstro Inc. Licensed under the MIT License.
|
|
2
2
|
// This file is auto-generated by @archastro/sdk-generator. Do not edit.
|
|
3
|
-
// Content hash:
|
|
3
|
+
// Content hash: cdb46059fae8
|
|
4
4
|
/**
|
|
5
5
|
* Channel for real-time chat messaging.
|
|
6
6
|
* Supports team-scoped and user-scoped threads with keyed, transient, and direct
|
|
7
|
-
* thread access patterns
|
|
7
|
+
* thread access patterns, plus org-scoped joins for organization-visibility
|
|
8
|
+
* threads, where org membership alone grants read and post.
|
|
8
9
|
*/
|
|
9
10
|
export class ApiChatChannel {
|
|
10
11
|
channel;
|
|
@@ -46,6 +47,17 @@ export class ApiChatChannel {
|
|
|
46
47
|
const joinResponse = await channel.join(payload);
|
|
47
48
|
return new ApiChatChannel(channel, joinResponse);
|
|
48
49
|
}
|
|
50
|
+
/** Join an organization-visibility thread by ID */
|
|
51
|
+
static topicOrgThread(orgId, threadId) {
|
|
52
|
+
return `api:chat:org:${orgId}:thread:${threadId}`;
|
|
53
|
+
}
|
|
54
|
+
/** Join an organization-visibility thread by ID */
|
|
55
|
+
static async joinOrgThread(socket, orgId, threadId, payload) {
|
|
56
|
+
const topic = ApiChatChannel.topicOrgThread(orgId, threadId);
|
|
57
|
+
const channel = socket.channel(topic);
|
|
58
|
+
const joinResponse = await channel.join(payload);
|
|
59
|
+
return new ApiChatChannel(channel, joinResponse);
|
|
60
|
+
}
|
|
49
61
|
/** Join a user-scoped thread by ID, optionally supplying local tools for a personal thread */
|
|
50
62
|
static topicUserThread(threadId) {
|
|
51
63
|
return `api:chat:user:thread:${threadId}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api_chat_channel.js","sourceRoot":"","sources":["../../src/channels/api_chat_channel.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,wEAAwE;AACxE,6BAA6B;AAK7B
|
|
1
|
+
{"version":3,"file":"api_chat_channel.js","sourceRoot":"","sources":["../../src/channels/api_chat_channel.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,wEAAwE;AACxE,6BAA6B;AAK7B;;;;;GAKG;AACH,MAAM,OAAO,cAAc;IACL;IAAkC;IAAtD,YAAoB,OAAgB,EAAkB,YAAsB;QAAxD,YAAO,GAAP,OAAO,CAAS;QAAkB,iBAAY,GAAZ,YAAY,CAAU;IAAG,CAAC;IAEhF,sCAAsC;IACtC,MAAM,CAAC,eAAe,CAAC,MAAc,EAAE,QAAgB;QACrD,OAAO,iBA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AAC,iBAAiB,EAAE,QAAQ,CAAC,CAAC;IACtD,CAAC;IAED,sEAAsE;IACtE,oBAAoB,CAAC,QAAoC;QACvD,OAAO,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,sBAAsB,EAAE,QAAQ,CAAC,CAAC;IAC3D,CAAC;CACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type EffectiveAccessBillingPrincipal } from "./types/common.js";
|
|
2
2
|
export type EffectiveAccessSource = "personal" | "organization";
|
|
3
3
|
interface ParsedEffectiveAccessEntitlementBase {
|
|
4
4
|
key: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"effective-access.d.ts","sourceRoot":"","sources":["../src/effective-access.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK
|
|
1
|
+
{"version":3,"file":"effective-access.d.ts","sourceRoot":"","sources":["../src/effective-access.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,+BAA+B,EACrC,MAAM,mBAAmB,CAAC;AAE3B,MAAM,MAAM,qBAAqB,GAAG,UAAU,GAAG,cAAc,CAAC;AAEhE,UAAU,oCAAoC;IAC5C,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,qBAAqB,EAAE,CAAC;IACrC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,2EAA2E;AAC3E,MAAM,WAAW,0CACf,SAAQ,oCAAoC;IAC5C,SAAS,EAAE,IAAI,CAAC;IAChB,UAAU,EAAE,SAAS,CAAC;IACtB,KAAK,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;CACxB;AAED,wEAAwE;AACxE,MAAM,WAAW,qCACf,SAAQ,oCAAoC;IAC5C,SAAS,EAAE,KAAK,CAAC;CAClB;AAED,MAAM,MAAM,gCAAgC,GACxC,0CAA0C,GAC1C,qCAAqC,CAAC;AAE1C,8EAA8E;AAC9E,MAAM,WAAW,qBAAqB;IACpC,YAAY,EAAE,gCAAgC,EAAE,CAAC;IACjD,OAAO,EAAE,+BAA+B,EAAE,CAAC;IAC3C,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAiBD;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,qBAAqB,CAiC1E"}
|
package/dist/effective-access.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import { effectiveAccessBillingPrincipalSchema, } from "./types/common.js";
|
|
2
3
|
const entitlementWireSchema = z.object({
|
|
3
4
|
key: z.string(),
|
|
4
5
|
granted: z.boolean(),
|
|
@@ -6,13 +7,9 @@ const entitlementWireSchema = z.object({
|
|
|
6
7
|
value: z.unknown().optional(),
|
|
7
8
|
provided_by: z.array(z.enum(["personal", "organization"])),
|
|
8
9
|
}).passthrough();
|
|
9
|
-
const billingPrincipalSchema = z.object({
|
|
10
|
-
principal_type: z.enum(["user", "org"]),
|
|
11
|
-
administrator: z.boolean(),
|
|
12
|
-
}).passthrough();
|
|
13
10
|
const effectiveAccessWireSchema = z.object({
|
|
14
11
|
entitlements: z.array(entitlementWireSchema),
|
|
15
|
-
billing: z.array(
|
|
12
|
+
billing: z.array(effectiveAccessBillingPrincipalSchema),
|
|
16
13
|
}).passthrough();
|
|
17
14
|
const booleanValueSchema = z.boolean().nullable().optional();
|
|
18
15
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"effective-access.js","sourceRoot":"","sources":["../src/effective-access.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"effective-access.js","sourceRoot":"","sources":["../src/effective-access.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA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